Skip to content

All Rules

The SQL lexicon provides 61 rules: 7 lint rules and 54 post-synth checks.

IDSeverityCategoryDescription
SQLCH001errorcorrectnessthe DDL in a ClickHouse template (database, table, view, dictionary, func, user, role, policy, grant) does not parse, or holds another statement than its tag.
SQLCH002errorcorrectnessa Nullable column in a table’s sort key or primary key.
SQLCH003errorcorrectnessa column written as $\{events.kind\} instead of $\{events.columns.kind\}.
SQLPG001errorcorrectnessthe DDL in a Postgres template does not parse, or does not hold
SQLPG002errorcorrectnessa column written as $\{events.kind\} instead of $\{events.columns.kind\}.
SQLPG003warningcorrectnessan object named in a string where Postgres reads a regclass:
SQLPG004errorcorrectnessa declared extension the configured provider does not allow.

Post-synth checks validate the serialized output after the build pipeline completes.

IDDescription
SQL101Two exports declare the same object
SQLCH101A ClickHouse object names an engine the pinned server does not have
SQLCH102A PRIMARY KEY is not a prefix of ORDER BY
SQLCH103An engine’s version, sign or is_deleted column has an unsupported type
SQLCH104A MergeTree engine argument names a column the table does not declare
SQLCH105A table key clause names a column the table does not declare
SQLCH106A skip index expression names a column the table does not declare
SQLCH107A TTL expression is built on a column that is not a Date or DateTime
SQLCH108CREATE OR REPLACE TABLE in a database that is not Atomic
SQLCH109A materialized view selects *
SQLCH110A materialized view writes a column its TO target does not declare
SQLCH111A String column limited to a few values is not LowCardinality
SQLCH112A PARTITION BY expression is finer than a day
SQLCH113A MergeTree table declares no sort key
SQLCH114A column codec is not one the pinned server has
SQLCH115A secret- or PII-named column carries no comment, TTL or encryption
SQLCH116A view is SQL SECURITY DEFINER with no DEFINER
SQLCH117A MergeTree setting is obsolete at the pinned server
SQLCH118A MergeTree setting is not one the pinned server has
SQLCH119An object uses a deprecated or experimental engine
SQLCH120A MergeTree engine uses the deprecated positional arguments
SQLCH121A column type names a family the pinned server does not have
SQLCH122A column type’s parameters do not fit its family
SQLCH123A Nullable wraps a type ClickHouse does not allow inside Nullable
SQLCH124A table declares a column twice
SQLCH125A codec parameter is outside what the codec takes
SQLCH126A GRANT column list names a column the table does not declare
SQLCH127An expression calls a function the pinned server does not have
SQLPG101A table declares no primary key
SQLPG102A foreign key’s referencing columns have no index
SQLPG103A serial column where an identity column is preferred
SQLPG104A timestamp column without time zone
SQLPG105A json column where jsonb fits
SQLPG106A char(n) column
SQLPG107A money column
SQLPG108A varchar(n) column with a habitual length limit
SQLPG109An index duplicates a constraint or another index
SQLPG110A btree index is a prefix of another index
SQLPG111A materialized view has no unique index, so it cannot refresh concurrently
SQLPG112A secret- or PII-named column with no comment on it or its table
SQLPG113An object is in the public schema though the project declares schemas
SQLPG114A storage parameter the object’s kind or the target major does not accept
SQLPG115A feature newer than the target major
SQLPG116An extension the target major no longer ships
SQLPG117A view without security_invoker runs with its owner’s privileges
SQLPG118A table uses INHERITS where declarative partitioning replaced it
SQLPG119A column, domain or sequence type the target major does not have
SQLPG120A type modifier that does not fit the type
SQLPG121An identity column whose type is not smallint, integer or bigint
SQLPG122A table declares a column twice, or an enum lists a label twice
SQLPG123A key, index or grant column list names a column the table does not declare
SQLPG124A foreign key names a column the referenced table lacks, or one of another type category
SQLPG125An index access method or operator class the target major does not have, or not for that method
SQLPG126An expression calls a function the target major does not have