sqlflufflisted
Install: claude install-skill lciacci/tessera
# sqlfluff — SQL linting
On-demand. Loads when you touch `.sql`, not every session (ADR-0012, principle #15).
## Run it
```bash
uvx sqlfluff lint --config .sqlfluff path/to/file.sql # no install needed
uvx sqlfluff lint --dialect postgres file.sql # if the project has no .sqlfluff
```
`uvx` is deliberate: no dependency to install, pin, or unwind. If the project has a
`.sqlfluff`, use it — it encodes decisions someone already made.
## Read the output like this, or you will waste a session
**sqlfluff's default output is mostly noise, and the noise is load-bearing to understand.**
Measured on settempo (2026-07-21, the corpus that produced ADR-0012): 206 violations, of
which **185 (89%) were whitespace and indentation.** The shipped `.sqlfluff` sets
`exclude_rules = layout` for exactly this reason. If you find yourself reading `LT01`/`LT02`
complaints, you are running without the project config.
Of the 21 that survived the layout filter, **14 were wrong**:
| Rule | What it said | Why it was wrong |
|---|---|---|
| `RF05` special chars in identifier | flagged `create policy "Users own their shows"` | Quoted, space-containing policy names are **idiomatic Supabase RLS**. Not a defect. |
| `PG01` index locking | demanded `CONCURRENTLY` on every `CREATE INDEX` | It was a **fresh-install script** — tables created empty in the same file. `CONCURRENTLY` cannot run inside a transaction, and there is nothing to lock. The advice was actively harmful. |
**So: do not