dsl-parse
SQL parser facade for duck-sqllsp.
Parses SQL into a unified Statement representation, so the rest of
duck-sqllsp never has to care which backend produced it.
Two backends sit behind one API:
- libpg_query (default) — the real PostgreSQL grammar, via FFI. This
is what gives PG-complete syntax coverage:
MERGE,FETCH FIRST,ON DELETE SET NULL (col), and the rest. - sqlparser — pure Rust, no C toolchain, and the fallback for MySQL / SQLite / MSSQL.
use ;
let file = parse;
assert_eq!;
split::split_statements slices a document on top-level semicolons
before parsing, so one syntax error does not poison the whole file — it
handles dollar-quoted bodies, nested block comments, and escapes.
Part of duck-sqllsp, a multi-dialect SQL language server. This crate is usable on its own.
Licensed MIT.