Skip to content

SF02 — DELETE can affect all rows

Group: Safety · Auto-fixable: no

A DELETE 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: DELETE FROM sessions; risky: DELETE FROM sessions WHERE TRUE; safe: DELETE FROM sessions WHERE expires_at < now();

Disable this rule in banshee.toml:

[lint]
exclude = ["SF02"]

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