Skip to main content

Module humanized_type

Module humanized_type 

Source
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§

HumanizedTypeError 🔒

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 s when it is exactly prefixclose, where close is the bracket matching the one prefix ends with and lands on the final character.
find_top_level 🔒
Offset of the first needle that 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.