Discussion Should SQL clients open connections read-only by default?
Most GUI clients I've used treat every connection as read-write. You're one wrong tab away from running an UPDATE on prod.
In the client I'm building (Row Patrol, disclosure: I'm the dev), every connection opens read-only, and writes are an explicit switch. Some people love it. Others find it annoying for local dev databases.
How do you handle this today? Separate read-only DB users, client settings, colored prod tabs, or just being careful? Does read-only by default help, or does it get in the way?
5
Upvotes
View all comments
Show parent comment
1
u/juu073 32m ago
How many people recreate a connection every time they open an app to have to remember it?
You make it the default setting. Every app I've used has this feature. Workbench, Datagrip, TablePlus, Coda, VSCode plugins. If you run an INSERT/UPDATE/DELETE/etc. query, they all warn/warned you and gave you the ability to execute the command one off or turn off the block temporarily. They even protected you by not giving you the option to turn it on forever from the banner warning.
Or you make the default setting to use transactions.
If someone doesn't know to take the two seconds to set the default setting when they add the DB connection to their app, they should not have access to prod.