Expand description
Decoding Materialize’s humanized type syntax.
pg_typeof is the only server surface that describes an anonymous record,
and it describes it the way EXPLAIN does: record(a: integer,b: text?),
where a trailing ? marks a nullable field. This module turns that back
into a DataType so mz-deploy lock can record the real type.
The syntax is not designed to be read back. Field names are rendered unquoted, so a name containing a delimiter is genuinely ambiguous; such a type is rejected rather than guessed at, and the caller falls back to the catalog’s lossy spelling.
Structs§
Constants§
- AMBIGUOUS 🔒
- Characters that would make a field name ambiguous in unquoted output.
Functions§
- depth_
at 🔒 - Bracket depth immediately before byte offset
at. - enclosed 🔒
- The body of
swhen it is exactlyprefix…close, wherecloseis the bracket matching the oneprefixends with and lands on the final character. - find_
top_ 🔒level - Offset of the first
needlethat is not inside brackets. - parse 🔒
- Parse a type as rendered by
pg_typeof. - parse_
field 🔒 - parse_
inner 🔒 - split_
top_ 🔒level - Split on commas that are not inside brackets.