Skip to content

SF02 — DELETE without WHERE affects all rows

Group: Safety · Auto-fixable: no

A DELETE with no WHERE clause empties the table. Add a WHERE clause unless you truly intend to remove every row (in which case TRUNCATE is usually clearer).

risky: DELETE FROM sessions; 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.