Skip to content

CV10 — LIKE without a wildcard is just =

Group: Convention · Auto-fixable: yes

A LIKE pattern with no % or _ matches exactly one string, so it is an equality test written the slow way. = is clearer and index-friendly. Only plain LIKE is rewritten (ILIKE/NOT LIKE differ from =).

bad: WHERE status LIKE 'active'
good: WHERE status = 'active'

Disable this rule in banshee.toml:

[lint]
exclude = ["CV10"]

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