select-star-no-schema¶
Default severity: error
What it does¶
Flags SELECT * when no schema is configured.
Why is this bad?¶
Without a schema the columns behind * are unknown, so the row type can't
be right.
Example¶
from sqlty import SQL
# error: [select-star-no-schema] "SELECT * used but no schema available"
q = SQL[tuple[str]]("--sql\nSELECT * FROM users")
Open in playgroundConfigure a schema or list the
columns with casts. The annotation is not compared with an inferred type, and check --fix does not change it.