Object Coverage
Each row is a CREATE command a pinned server has, or one form of a command where chant treats the forms apart (CREATE TYPE ... AS ENUM is declared, CREATE TYPE ... AS RANGE is not). The commands come from the servers’ own sources at each pinned version (scripts/sql-create-commands.ts), and a test fails when a pinned server has a command with no row here, so a new server release cannot add a kind nobody looked at.
- declared: a tag declares it, and import writes it as that declaration.
- referenced: the environment’s, and never declared: a declaration names one, and chant never reads its values. A ClickHouse named collection is one (#4395):
ENGINE = S3(lake_creds, format = 'Parquet')nameslake_creds, the build records the name, andchant sql planfails when the server has no collection of that name.chant import --from <env>lists the server’s SQL-defined collections as prerequisites and imports the rest. See Named collections. - refused: no declaration holds it yet.
chant import --from <env>fails when the server has one, naming every such object (kind, schema, name) at once, andchant import schema.sqlfails on the statement. Nothing is left out without a word. - out of scope: the environment’s, not a schema’s: import never reads it.
--skip-undeclarable (--parser-option skipUndeclarable for a file) imports everything else and lists the refused objects as warnings, for an adopter who keeps those objects by hand for now:
chant import --from prod --skip-undeclarablechant import schema.sql --parser-option skipUndeclarableWhat a managed provider, an extension or the server’s configuration files define is never refused: an extension’s aggregates and casts are the extension’s, declared with it, and a quota from users.xml is the server’s. An import with --type, --name or --owned asks only for objects chant can hold, and does not look for the rest.
Postgres
Section titled “Postgres”Pinned majors: 14.24, 15.19, 16.15, 17.11, 18.6. 33 declared, 11 refused, 2 out of scope.
| Command | Kind | Status | Declared by, or why not |
|---|---|---|---|
CREATE ACCESS METHOD | access method | refused | no tag declares an access method; an extension usually installs one, and the extension is declared instead |
CREATE AGGREGATE | aggregate | declared | Postgres::Aggregate |
CREATE CAST | cast | declared | Postgres::Cast: the database’s, named by its two types; read where a type or its function is in scope |
CREATE COLLATION | collation | declared | Postgres::Collation |
CREATE CONVERSION | conversion | refused | no tag declares an encoding conversion |
CREATE DATABASE | database | out of scope | a project’s schema lives in one database, which the environment provides (sql.profiles.<env>) |
CREATE DOMAIN | domain | declared | Postgres::Domain |
CREATE EVENT TRIGGER | event trigger | declared | Postgres::EventTrigger: the database’s, not a schema’s; creating one takes a superuser |
CREATE EXTENSION | extension | declared | Postgres::Extension |
CREATE FOREIGN DATA WRAPPER | foreign data wrapper | declared | Postgres::ForeignDataWrapper: the database’s, not a schema’s; creating one takes a superuser; one an extension installs comes with the extension; an option that holds a credential is refused |
CREATE FOREIGN TABLE | foreign table | declared | Postgres::ForeignTable: its own tag, not table: another CREATE and ALTER, no key, index or storage clauses; its server cannot be altered; one that is a partition, inherits or has a generated column is not declared; an option that holds a credential is refused |
CREATE FUNCTION | function | declared | Postgres::Function |
CREATE FUNCTION (RETURN or BEGIN ATOMIC body) | routine with a SQL-standard body | refused | the server stores a SQL-standard body parsed and prints it back rewritten, so a declaration cannot be compared with it; declare the routine with a string body (AS $$ … $$) |
CREATE GROUP | group | declared | Postgres::Role: an alias of CREATE ROLE |
CREATE INDEX | index | declared | Postgres::Index |
CREATE LANGUAGE | procedural language | refused | no tag declares a procedural language; an extension installs one, and the extension is declared instead |
CREATE MATERIALIZED VIEW | materialized view | declared | Postgres::MaterializedView |
CREATE OPERATOR | operator | declared | Postgres::Operator: identified by its name and operand types; RESTRICT and JOIN change in place, and from 17 so does setting a commutator or negator or turning on HASHES or MERGES; anything else is a drop and a create |
CREATE OPERATOR CLASS | operator class | declared | Postgres::OperatorClass: identified by its name and index method; a change is a drop and a create, since ALTER OPERATOR CLASS only renames or moves it; its own family, named as the class, comes with it |
CREATE OPERATOR FAMILY | operator family | declared | Postgres::OperatorFamily: identified by its name and index method; its members come with the classes that name it, and loose members added with ALTER OPERATOR FAMILY are not declared |
CREATE POLICY | policy | declared | Postgres::Policy: read where the profile manages access (sql.profiles.<env>.access) |
CREATE PROCEDURE | procedure | declared | Postgres::Procedure |
CREATE PUBLICATION | publication | declared | Postgres::Publication: the database’s, not a schema’s; a table of it may carry a column list and row filter from 15 |
CREATE ROLE | role | declared | Postgres::Role: import reads only the roles a build declares, since a role is the cluster’s |
CREATE RULE | rule | refused | no tag declares a rewrite rule; a view’s own rule is the view’s |
CREATE SCHEMA | schema | declared | Postgres::Schema |
CREATE SEQUENCE | sequence | declared | Postgres::Sequence |
CREATE SERVER | foreign server | declared | Postgres::ForeignServer: the database’s, not a schema’s; its user mappings are refused, so credentials stay out of the declaration |
CREATE STATISTICS | extended statistics | declared | Postgres::Statistics |
CREATE SUBSCRIPTION | subscription | refused | a subscription’s connection string carries a credential, and creating one opens a replication slot on the publisher, outside this database; the environment makes it |
CREATE TABLE | table | declared | Postgres::Table |
CREATE TABLE AS | table from a query | declared | Postgres::Table: the server keeps no query, so the table it made reads as a CREATE TABLE |
CREATE TABLESPACE | tablespace | out of scope | a tablespace is the cluster’s, a directory on the server; a table’s TABLESPACE clause is kept |
CREATE TEXT SEARCH CONFIGURATION | text search configuration | declared | Postgres::TextSearchConfiguration: PARSER and its ADD MAPPING statements; COPY is refused, since it copies mappings chant does not read; mappings change in place, the parser by drop and create |
CREATE TEXT SEARCH DICTIONARY | text search dictionary | declared | Postgres::TextSearchDictionary: a template and its options; options change in place, the template by drop and create |
CREATE TEXT SEARCH PARSER | text search parser | refused | no tag declares a text search parser; one is C code an extension installs |
CREATE TEXT SEARCH TEMPLATE | text search template | refused | no tag declares a text search template; one is C code an extension installs |
CREATE TRANSFORM | transform | refused | no tag declares a transform; an extension installs one |
CREATE TRIGGER | trigger | declared | Postgres::Trigger |
CREATE TYPE (AS ENUM) | enum type | declared | Postgres::Enum |
CREATE TYPE (AS (…)) | composite type | declared | Postgres::CompositeType |
CREATE TYPE (AS RANGE) | range type | declared | Postgres::RangeType: its multirange type comes with it (MULTIRANGE_TYPE_NAME) |
CREATE TYPE (INPUT, OUTPUT, or a shell type) | base type | refused | no tag declares a base type; its input and output functions are C code an extension installs |
CREATE USER | user | declared | Postgres::Role: an alias of CREATE ROLE … LOGIN |
CREATE USER MAPPING | user mapping | refused | a user mapping carries the remote user and password, which the environment supplies and a declaration never holds |
CREATE VIEW | view | declared | Postgres::View |
ClickHouse
Section titled “ClickHouse”Pinned release: 26.8.15.10. 12 declared, 1 referenced, 6 refused, 1 out of scope.
| Command | Kind | Status | Declared by, or why not |
|---|---|---|---|
CREATE DATABASE | database | declared | ClickHouse::Database |
CREATE DICTIONARY | dictionary | declared | ClickHouse::Dictionary |
CREATE FUNCTION | SQL function | declared | ClickHouse::Function |
CREATE FUNCTION (LANGUAGE WASM, or with a driver) | non-SQL function | refused | only a SQL function (CREATE FUNCTION f AS (x) -> …) is declared |
CREATE HANDLER | HTTP handler | refused | an HTTP handler is server-level configuration, not a schema object |
CREATE INDEX | index | declared | ClickHouse::Table: an index is part of its table: SHOW CREATE TABLE prints it, and the table’s declaration holds it |
CREATE MASKING POLICY | masking policy | refused | masking policies are available only in ClickHouse Cloud, not on the pinned server |
CREATE NAMED COLLECTION | named collection | referenced | a named collection holds credentials (a password, a secret key), which are the environment’s: chant never declares one or reads its values. An engine, a table function or a dictionary SOURCE names it, a plan checks that it exists, and import lists the server’s as prerequisites |
CREATE QUOTA | quota | declared | ClickHouse::Quota: import reads only the access objects a build declares |
CREATE RESOURCE | workload resource | refused | a resource is server-level scheduling (a disk’s reads or writes), configured with the server, not a schema object |
CREATE ROLE | role | declared | ClickHouse::Role: import reads only the access objects a build declares |
CREATE ROW POLICY | row policy | declared | ClickHouse::RowPolicy: import reads only the access objects a build declares |
CREATE SETTINGS PROFILE | settings profile | declared | ClickHouse::SettingsProfile: import reads only the access objects a build declares |
CREATE TABLE | table | declared | ClickHouse::Table |
CREATE TABLE (TEMPORARY) | temporary table | out of scope | a temporary table lives in one session |
CREATE USER | user | declared | ClickHouse::User: import reads only the access objects a build declares |
CREATE VIEW | view | declared | ClickHouse::View |
CREATE VIEW (MATERIALIZED) | materialized view | declared | ClickHouse::MaterializedView |
CREATE WINDOW VIEW | window view | refused | a window view is experimental, and the pinned server refuses it under its default query analyzer |
CREATE WORKLOAD | workload | refused | a workload is server-level scheduling, configured with the server, not a schema object |
MySQL 8.0.40, and Aurora MySQL 3. 5 declared, 5 refused, 9 out of scope. MySQL’s commands are the reference manual’s CREATE statements at that release, as its column types are; no server source is read.
| Command | Kind | Status | Declared by, or why not |
|---|---|---|---|
CREATE DATABASE | database | declared | MySQL::Database |
CREATE EVENT | event | refused | an event runs SQL on a schedule; chant declares no scheduled work |
CREATE FUNCTION | stored function | refused | a stored function’s body is a program, and chant declares no MySQL routines |
CREATE FUNCTION (loadable (SONAME)) | loadable function | out of scope | a loadable function is a library installed on the server, not a schema object |
CREATE INDEX | index | declared | MySQL::Table: an index is part of its table: SHOW CREATE TABLE prints it, and the table’s declaration holds it. A CREATE INDEX in a file of DDL is read into its table |
CREATE LOGFILE GROUP | logfile group | out of scope | a logfile group belongs to NDB Cluster’s storage, not to a schema |
CREATE PROCEDURE | stored procedure | refused | a stored procedure’s body is a program, and chant declares no MySQL routines |
CREATE RESOURCE GROUP | resource group | out of scope | a resource group is server-level thread scheduling, not a schema object |
CREATE ROLE | role | out of scope | accounts and roles are the server’s, and the MySQL dialect declares no access |
CREATE SCHEMA | schema | declared | MySQL::Database: CREATE SCHEMA is a synonym of CREATE DATABASE |
CREATE SERVER | federated server | out of scope | a server definition holds another server’s credentials, which are the environment’s |
CREATE SPATIAL REFERENCE SYSTEM | spatial reference system | out of scope | a spatial reference system is server-wide data, not a schema object |
CREATE TABLE | table | declared | MySQL::Table |
CREATE TABLE (TEMPORARY) | temporary table | out of scope | a temporary table lives in one session |
CREATE TABLE (PARTITION BY) | partitioned table | refused | chant does not plan partition changes, so a partitioned table is not declared |
CREATE TABLESPACE | tablespace | out of scope | a tablespace is storage the server’s operator manages, not a schema object |
CREATE TRIGGER | trigger | refused | a trigger’s body is a program, and chant declares no MySQL triggers |
CREATE USER | user | out of scope | accounts are the server’s, and the MySQL dialect declares no access |
CREATE VIEW | view | declared | MySQL::View |
Declaring a refused kind
Section titled “Declaring a refused kind”A kind becomes declarable in three steps: a tag that declares it, the catalog reader reading it (src/postgres/live/catalog.ts, src/clickhouse/live/catalog.ts, src/mysql/live/catalog.ts), and its row flipped to declared with the entity type, its reason taken out. The row’s flip is what stops import refusing the kind. After moving a pin, run npx tsx scripts/sql-create-commands.ts and give each new command a row.