Hub rules-sql

rules-sql

v3 public Verified

SQL

SQL is the standard language for relational database management. These rules govern query design, indexing strategies, and relational data modeling for AI-assisted database management.

@sigmashakeinc 2 pulls 9 rules published Apr 8, 2026 synced Oct 11, 2026 sigmashakeinc/rules/rulesets/rules-sql →
Severity
7 error 2 warn 0 info
demo.cast
SQL is the standard language for relational database management. These rules govern query design, indexing strategies, and relational data modeling for AI-assisted database management.

Rules index

9 governance rules

Indexed from the repository's .rules files, grouped by technology. Expand any rule to read the raw source.

sql

ask-alter-column-drop warning log

Removing a column is irreversible. Ensure all application code no longer references it before applying.

Rule source requires an active Pro or Enterprise subscription.
ask-truncate error log

TRUNCATE permanently deletes all rows and cannot be rolled back in some databases. Confirm this is intentional.

Rule source requires an active Pro or Enterprise subscription.
no-delete-without-where error block

DELETE without a WHERE clause removes all rows. Add a WHERE condition or use TRUNCATE explicitly.

Rule source requires an active Pro or Enterprise subscription.
no-drop-table-without-confirm error block

Destructive table removal without IF EXISTS will fail loudly if the table does not exist. Use IF EXISTS to make migrations idempotent.

Rule source requires an active Pro or Enterprise subscription.
no-grant-all-privileges error block

RISK: GRANT ALL ON *.* grants the target account full DDL+DML rights — a single compromised credential equals full database takeover. FIX: Grant only the minimum required privileges on specific tables.

Rule source requires an active Pro or Enterprise subscription.
no-sql-injection-concatenation-js error block

RISK: SQL built by template literal interpolation is a direct SQL injection sink (CWE-89). FIX: Use parameterized queries (? or placeholders with a bound params array) and never interpolate user data into SQL strings.

Rule source requires an active Pro or Enterprise subscription.
no-sql-injection-concatenation-python error block

RISK: SQL built with an f-string is a direct SQL injection sink (CWE-89). FIX: Pass bound parameters as the second argument to cursor.execute() using %s or ? placeholders — never build queries via f-strings.

Rule source requires an active Pro or Enterprise subscription.
no-update-without-where error block

UPDATE without a WHERE clause modifies every row. Add a WHERE condition to target specific rows.

Rule source requires an active Pro or Enterprise subscription.
warn-commented-where-clause warning log

RISK: A commented-out WHERE clause on a mutating statement suggests the filter was intentionally disabled — a common source of full-table accidents. FIX: Restore the WHERE clause or remove the statement if it is no longer needed.

Rule source requires an active Pro or Enterprise subscription.

Version metadata

Published metadata

The hash-locked record of this published ruleset. When source contents change, the maintainer resyncs and the version bumps.

Version
v3
Published
Apr 8, 2026
Source commits
0
Synced
Oct 11, 2026
Hash
a79f5a49edb45da4c2b5c3c68f83a42c73e93ceb5f41691a7ef3fcef79c84f47
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

Latest commits touching rulesets/rules-sql/.sigmashake/rules in sigmashakeinc/rules/rulesets/rules-sql. The published version only bumps when a maintainer resyncs.

No commit history available.