7 ms·
Or add a mandatory `where` for delete and update queries. To delete/update all, add `where 1=1` -------------------------------- p.s. In mysql I always add `
by est 3y ago
Or add a mandatory `where` for delete and update queries.
To delete/update all, add `where 1=1`
--------------------------------
p.s. In mysql I always add `limit 1` for every update. If `limit 99999` isn't enough you are probably doing it wrong.
- jandrese 3y agoOr just allow "limit unlimited" for those cases where you are working with lots of rows.
- chuckadams 3y agoJetbrains IDEs add a warning to updates or inserts without a "where" clause, and asks for confirmation when you try to run them.