Skip to content

TypeScript · correctness

no-select-star

eslint:no-select-star

Disallow SELECT * in embedded SQL; it over-fetches and leaves the row contract implicit, so a schema change breaks row parsing silently.

Default
error
Fix
none
Languages
typescript

Why

Wildcard projections couple row shape and query cost to unrelated schema changes.

Fix

List every required column explicitly in the projection.

Before / after

Executed by this rule’s unit tests.

Before

Do not select every column

src/runs.ts · focus
db.prepare(`SELECT * FROM runs`).all();

After

Select the required columns

src/runs.ts · focus
db.prepare(`SELECT id, status FROM runs`).all();

Limits

  • Only statically visible embedded SQL is checked; function arguments such as COUNT(*) and stars inside EXISTS are excluded.

Message IDs

noSelectStar