Expand description
SQL parsing with mz_sql_parser.
Wraps mz_sql_parser to parse .sql files into AST statements, attaching
file-path context to error messages so that parse failures point back to
the originating source file.
ยงVariable Resolution and Parsing
parse_statements_with_context runs variable resolution before parsing:
- Resolve psql-style variables (
:foo,:'foo',:"foo") viasuper::variables::resolve_variables - Check for unresolved variables โ error or warning based on pragma
- Parse the resolved SQL via
mz_sql_parser - Wrap any parse errors with file path and SQL content for context
Structsยง
- Located
Statement - A parsed SQL statement paired with its byte offset within the source file.
Functionsยง
- parse_
statements_ ๐with_ context - Parse SQL statements and add file context to any errors.
- statement_
type_ ๐name - Get a human-readable name for a statement type.