Skip to main content

Crate dsl_parse

Crate dsl_parse 

Source
Expand description

SQL parser facade for duck-sqllsp.

Wraps existing battle-tested SQL parsers (currently sqlparser, with pg_query planned behind a feature flag) and normalises their output into a single small AST. Every downstream crate in this workspace depends only on this internal AST, so changing parser backends is a one-crate diff.

Public surface:

Re-exports§

pub use dialect::Dialect;
pub use error::ParseError;
pub use parsed_file::ParsedFile;
pub use ast::*;

Modules§

ast
The internal AST shape consumed by every downstream crate.
backend
Parser backends. pg_query (libpg_query FFI) is the default – 100% Postgres syntax coverage. sqlparser (pure Rust) is the fallback for environments without a C toolchain.
dialect
SQL dialect selector.
error
Parser error envelope. One per failed top-level statement.
parsed_file
Top-level result type returned by parse.
plpgsql
PL/pgSQL function body parser.
split
Split a SQL document on top-level semicolons.

Functions§

parse
Parse a whole SQL document. Always succeeds; per-statement errors are collected into ParsedFile::errors.