@@ -645,6 +645,48 @@ nesting, so Go codegen renders `[][]int32` as the legacy path does.
645645DuckDB's ` INTEGER[][] ` and ClickHouse's ` Array(Array(Int32)) ` produce the
646646same rows and output, with ` int32 ` in ClickHouse's case.
647647
648+ ## As implemented
649+
650+ The design above is implemented, engine by engine, with these departures
651+ and details settled on the way:
652+
653+ - The three per-dialect hooks are registered by an engine package at init,
654+ by the name its ` dialect.json ` records, and looked up by that name, so a
655+ catalog restored from the cache — which runs no seed — has them:
656+ ` core.RegisterCanonicalizer ` , ` core.RegisterUserTypeBase ` (SQLite's
657+ affinity rule, applied when the schema declares a family the seed does
658+ not list) and ` core.RegisterResultType ` (ClickHouse's ` toDecimal64(x, 4) `
659+ and ` toDateTime64(x, 3) ` ).
660+ - SQLite's ` dialect.json ` says ` "alias": "base" ` , which makes each alias in
661+ its ` types.jsonl ` a type of its own standing on the type it aliases,
662+ rather than another spelling of it.
663+ - An engine hands the core either a spelling (` TypeName.Spelling ` , read by
664+ ` ParseTypeExpr ` , which also reads words after a closing parenthesis as
665+ part of the name, as in ` decimal(10,2) unsigned ` ) or a name with
666+ ` Typmods ` and ` ArrayBounds ` , where an integer constant is an integer
667+ argument, a bare ` ast.String ` is an identifier and a quoted constant a
668+ string. ` ColumnDef.IsUnsigned ` and ` ColumnDef.Vals ` add MySQL's unsigned
669+ and enum members. ` ParamRef.Name ` carries the name a ` {name:Type} `
670+ placeholder gives itself.
671+ - A cast is NULL when its operand is, or when its type says so, as
672+ ` Nullable(String) ` does; a cast of a placeholder types the placeholder
673+ and takes its name and source from what it is compared with.
674+ - MySQL types ` CAST(x AS CHAR(10)) ` as ` varchar(10) ` and `CAST(x AS
675+ BINARY(8))` as ` varbinary(8)`, which is what its metadata and a view over
676+ the cast both report, rather than the ` char(10) ` the table above
677+ proposed. ` goldeneye ` reads a table column's type from ` COLUMN_TYPE ` , in
678+ the relations seed and in the analyze check, and compares an expression
679+ by family alone, since the wire carries no arguments.
680+ - SQLite reports a cast to a spelling that is not a storage class, such as
681+ ` DECIMAL(5,2) ` , as that spelling, while the value's storage class is what
682+ a run would show; the check's cases keep to storage classes.
683+ - DuckDB's ` JSON ` is grouped under ` varchar ` by ` duckdb_types() ` 's logical
684+ type, so a JSON column reports ` varchar ` ; a named enum reports its name,
685+ not its labels, since the canonicalizer cannot see the catalog. A
686+ GoogleSQL array or struct constructor in a select list is still untyped.
687+ - PostgreSQL's ` relations.jsonl ` still spells array columns as ` pg_type `
688+ does (` _text ` ), which the canonicalizer reads as ` array(text) ` .
689+
648690## Order of work
649691
6506921 . The tables and the interning entry point: ` sql_type.expr ` , ` family_oid ` ,
0 commit comments