r/SQL • • 4h ago

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?

7 Upvotes

15 comments sorted by

View all comments

1

u/Available_Safe1818 3h ago

The standard way to handle this is that no one is given the ability to connect to prod from their development environment.

Opening in read-only by default is a shitty bandaid for the real problem, not a solution.

1

u/xike456 3h ago

Agreed, and if nobody on your team has standing prod access from their laptop, keep it that way. Read-only by default isn't meant to replace that or a read-only role. It's a seatbelt for the cases where someone does connect, like on-call, a support lookup or a replica, so the wrong tab or an AI agent can't change data by mistake.

2

u/Available_Safe1818 2h ago

You just rephrased the same problem. No one (and no AI) should have access to writeable prod databases. Read replicas are not an issue.