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:
parse– top-level entry point.Dialect– which SQL flavour to use.- The AST types in
ast–Statement,SelectStmt, etc. ParsedFile,ParseError– result envelopes.
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.