Skip to main content

Module parse

Module parse 

Source
Expand description

Source-side parser: SQL bytes → IR.

This module accepts a directory of CREATE-style DDL files and produces a crate::ir::catalog::Catalog. Construction is I/O-free at the type level — the only I/O is performed by parse_directory on behalf of callers.

Re-exports§

pub use directives::FileDirectives;
pub use directives::extract_file_directives;
pub use error::ParseError;
pub use error::SourceLocation;
pub use statement::Statement;

Modules§

ast_canon
AST canonicalization pass for view and materialized view bodies.
builder
AST → IR builders.
cluster
Cluster-level source parser — per-file SQL router for cluster objects.
directives
-- @pgevolve file-level directives.
error
Errors raised by the source parser.
normalize_body
Statement-scope body canonicalization.
normalize_expr
Build NormalizedExpr values from pg_query AST nodes.
statement
Classify a top-level pg_query statement node into the v0.1 whitelist.

Functions§

parse_directory
Parse every *.sql file under root, recursively, and produce a fully- populated Catalog. Files matching any pattern in ignores are skipped.
parse_directory_with_locations
Like parse_directory but also returns the per-qname source-location map built during parsing. Used by the lint engine (Phase 10) to know which file each object was declared in.