pub enum TypeKind {
Enum {
labels: Vec<String>,
},
Composite {
fields: Vec<(String, ColumnTypeName)>,
field_user_types: Vec<Option<String>>,
},
}Expand description
v7.17.0 Phase 1.4 — flavour of the new type. Only ENUM is implemented; the variant set is open so Phase 1.5 (DOMAIN) and later (COMPOSITE, RANGE) can land without an AST shape migration.
v7.37.x (ζ-B Phase 1 composite accept) — added Composite for
CREATE TYPE name AS (field_name field_type, …). Phase 1
stores the field list in the catalog so PG dumps that emit
CREATE TYPE … AS (…) don’t error out; using a composite type
as a column type lands in Phase 2 (Value::Composite encoding +
ROW() literal + field-access syntax).
Variants§
Enum
AS ENUM ('a', 'b', …). Order is preserved (PG enum
labels are ordered).
Composite
AS (field_name field_type, …). Order matters; PG
composite literals are positional.
Fields
fields: Vec<(String, ColumnTypeName)>field_user_types: Vec<Option<String>>v7.39 (round 264) — parallel to fields: the raw type NAME
when a field’s type is not a builtin (i.e. another composite).
The parser already captures it; without carrying it here a
nested composite field resolved to the Text placeholder and
the inner record never became a record.