Skip to content

ST07 — Avoid NATURAL JOIN

Group: Structure · Auto-fixable: no

NATURAL JOIN joins on every column the two tables happen to share by name, so adding or renaming a column silently changes the join. State the columns with ON or USING.

bad: FROM a NATURAL JOIN b
good: FROM a JOIN b ON a.id = b.a_id

Disable this rule in banshee.toml:

[lint]
exclude = ["ST07"]

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