Skip to content

SF01 — UPDATE can affect all rows

Group: Safety · Auto-fixable: no

An UPDATE can affect all rows if its WHERE clause is absent or always true. Use a predicate that scopes the change to the intended rows.

risky: UPDATE patient SET active = false; risky: UPDATE patient SET active = false WHERE 1 = 1; 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.