Remix.run Logo
evanelias 7 months ago

You're probably thinking of the --safe-updates option [1] for the `mysql` CLI, also available as the memorable alias --i-am-a-dummy. This requires UPDATE and DELETE to have either a WHERE clause or a LIMIT clause. Under the hood, the command-line client option just manipulates the sql_safe_updates session variable [2] to enforce the UPDATE and DELETE requirement, as well as a couple other unrelated variables to prevent overly-huge SELECTs.

It's not enabled by default out of the box, but some companies do override their configuration to enable it for new sessions, iirc Facebook did this.

[1] https://dev.mysql.com/doc/refman/8.4/en/mysql-tips.html#safe...

[2] https://dev.mysql.com/doc/refman/8.4/en/server-system-variab...