Skip to content

SF01 — UPDATE without WHERE affects all rows

Group: Safety · Auto-fixable: no

An UPDATE with no WHERE clause rewrites every row in the table. This is occasionally intended but far more often a mistake; add a WHERE clause to scope the change.

risky: UPDATE patient SET active = false; safe: UPDATE patient SET active = false WHERE id = 42;

Disable this rule in banshee.toml:

[lint]
exclude = ["SF01"]

Or silence one line with -- noqa: SF01. See Linting.