Search docs
Docs searchValidation rule
Back to Rule CatalogAP-DQR-002Data & Query RiskBroad SELECT * usage in query path
Flags broad SELECT * usage in paths where explicit projection is safer.
warningviolationNo auto-fix
How to fix
- Replace SELECT * with explicit columns.
- Keep sensitive columns out of read models unless required.
- Update tests or snapshots that assumed the broad result shape.
What it means
A query returns every column instead of declaring the data it needs.
Why it matters
Broad projection increases data exposure, payload size, and accidental coupling to schema changes.
Common causes
- Temporary debugging SQL became permanent.
- Repository methods were copied from exploratory queries.
- A query grew without revisiting its projection.
Example bad pattern
SELECT * FROM account_summaryExample good pattern
SELECT account_id, balance_cents, status FROM account_summaryRelated files/config
apps/api/srcdb/sql
Related CLI commands
archpilot validatearchpilot validate --ci
Related docs