unknown-columns
What it does
Section titled “What it does”Reports a wildcard of the outermost query that resolves to a table: a * over a table, or over a subquery or common table that has one itself.
Why it matters
Section titled “Why it matters”The columns of the result are whatever the table has now. A column added or reordered in the table changes the result of the query, and clients that read the result by position or by name break.
To fix, list the columns.
Example
Section titled “Example”select * from t;...Configuration
Section titled “Configuration”sql: lint: rules: unknown-columns: warn # off (default), warn, errorEnabled by the presets: sql/sqlfluff.
Suppress one line with sudsy-disable-next-line unknown-columns in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| sqlfluff | AM04 |
full |