Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
backend ruleP1universalStack: sql
databaseportabilitysqlconfiguration
Do not hardcode the database/schema name in queries
Reference tables by name only; prefixing with a hardcoded schema/database name breaks in environments where the database is named differently.
PR: hegnar-investor-ws · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codesql
| 1 | SELECT COUNT(p.id) FROM app_prod.posts p JOIN app_prod.threads t ON t.id = p.thread_id |
Explanation (EN)
Objašnjenje (HR)
Good example
New codesql
| 1 | SELECT COUNT(p.id) FROM posts p JOIN threads t ON t.id = p.thread_id |
Explanation (EN)
Objašnjenje (HR)