Skip to content

CV08 — Prefer LEFT JOIN over RIGHT JOIN

Group: Convention · Auto-fixable: no

A RIGHT JOIN can always be rewritten as a LEFT JOIN by swapping the joined tables, which keeps the reading order (left-to-right) aligned with the join direction and is easier to follow.

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

Disable this rule in banshee.toml:

[lint]
exclude = ["CV08"]

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