occam-sqllisted
Install: claude install-skill stephenoffer/occam
# SQL
Read the actual manifest and conventions before choosing commands, and use the ecosystem's established tools. Don't translate patterns from another language mechanically.
- **Injection:** use parameters. Dynamic identifiers need an allow-list, since parameters can't bind them.
- **Dialect:** check the actual engine and version. Type affinity, `NULL` ordering, collation, date functions, and integer versus real division all differ.
- **NULL:** three-valued logic means `NOT IN` with a NULL returns no rows, and aggregates skip NULLs. `COUNT(*)` and `COUNT(col)` differ.
- **Joins and grouping:** a one-to-many join multiplies rows and silently inflates sums. Check the grain before aggregating.
- **Time, money and text:** store money as integer minor units or an exact decimal, not float. Be explicit about timezone and what a day boundary means. Text ordering and comparison depend on collation, and ISO date strings sort correctly only when uniformly formatted.
- **Transactions and plans:** know the isolation level, wrap multi-statement changes, and consider lock duration in migrations. Read the query plan for anything large, and ship schema and code changes in a deployable order, with a backfill plan.
- **Concurrent writers:** Read Committed allows lost updates, and Repeatable Read still allows write skew, plus lost updates in MySQL, where PostgreSQL aborts the second writer instead. Pick the level or the lock for the invariant. Update a counter in one statement (`SET n = n +