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 ruleP0universalStack: sql
sqldata-losssafetycleanup
Never DROP an entire table in routine cleanup code
Cleanup/checkpoint logic should delete only the targeted rows, never drop the whole table.
PR: hegnar-journalist-boost · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codesql
| 1 | DROP TABLE checkpoints; -- to 'clear' state |
Explanation (EN)
Objašnjenje (HR)
Good example
New codesql
| 1 | DELETE FROM checkpoints WHERE thread_id = $1; |
Explanation (EN)
Objašnjenje (HR)