You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today, I was bitten by this kind of bug once again. I think, it would be nice to detect this automatically. I can imagine an opt-in feature flag like require-where. It would inspect UpdateStatement/DeleteStatement before executing and return an error or panic with a message like this:
caught `UPDATE` without `WHERE`! If this is intentional, add a condition like `WHERE 1 = 1`. You can disable these checks by compiling SeaORM without `require-where` feature.
Maybe I'll take a shot at implementing this later.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Today, I was bitten by this kind of bug once again. I think, it would be nice to detect this automatically. I can imagine an opt-in feature flag like
require-where
. It would inspectUpdateStatement
/DeleteStatement
before executing and return an error or panic with a message like this:caught `UPDATE` without `WHERE`! If this is intentional, add a condition like `WHERE 1 = 1`. You can disable these checks by compiling SeaORM without `require-where` feature.
Maybe I'll take a shot at implementing this later.
Beta Was this translation helpful? Give feedback.
All reactions