Skip to main content

Module create_sql

Module create_sql 

Source
Expand description

Decoders for catalog create_sql strings.

Each function parses a persisted create_sql and returns a JSON value with the fields a builtin catalog view projects. Errors are human-readable strings.

Structsยง

PostgresPublicationDetailsSubset ๐Ÿ”’
Minimal decoder for ProtoPostgresSourcePublicationDetails. The canonical proto lives in mz-storage-types, which depends on this crate via mz-expr, so we redeclare the two tags we read here. Upstream tag renumbers slip past silently. The mz_postgres_sources lockdown SLTs catch them.

Functionsยง

cluster_id ๐Ÿ”’
connection_details
Extracts connection-detail metadata from a catalog create_sql.
format_name ๐Ÿ”’
item_details
Parses a catalog create_sql string into a JSON object.
item_id ๐Ÿ”’
item_references
Extracts the catalog item references from a catalog create_sql string as a JSONB object.
kafka_source_details
Extracts kafka source configuration (topic, group id prefix, connection id) from a catalog create_sql. Returns:
option_string ๐Ÿ”’
Extracts the string form of a WithOptionValue, matching how the planner coerces option values. The blanket TryFromValue<WithOptionValue<T>> impl in src/sql/src/plan/with_options.rs accepts a quoted string, a bare identifier, and a 1-part unresolved item name, all yielding a string. Any other variant yields None.
parse_single_statement ๐Ÿ”’
Parses sql, which must contain exactly one statement.
postgres_source_details
Extracts postgres source publication details (slot, timeline_id) from a catalog create_sql. Returns:
source_export_details
Extracts source-export (source table) metadata from a catalog create_sql.