pg_fake_sqlparser
A fork of Apache DataFusion sqlparser-rs,
maintained for pg_fake. It carries parser and AST changes needed by the
in-memory PostgreSQL test double. This is an independently maintained fork,
not an official Apache release.
The published package is pg_fake_sqlparser; the Rust library name remains
sqlparser. It parses SQL into an abstract syntax tree (AST). It does not
execute SQL or validate database schemas.
Installation
[]
= { = "pg_fake_sqlparser", = "0.63.0" }
Keep the dependency key sqlparser, including when using the fork's macros.
use PostgreSqlDialect;
use Parser;
Features
stdandrecursive-protectionare enabled by default.visitorenables AST traversal and visitor derives.derive-dialectenables thederive_dialect!macro for custom dialects.serdeenables AST serialization and deserialization.
For example, enable AST traversal and custom dialects with:
= { = "pg_fake_sqlparser", = "0.63.0", = ["visitor", "derive-dialect"] }
Parser and derive versions
pg_fake_sqlparser 0.63.0 is paired with
pg_fake_sqlparser_derive 0.6.0. The parser pins that derive version exactly
and enables it through the visitor or derive-dialect features. Most users
should enable those features rather than depend directly on the derive crate.
The derive_dialect! macro reads the paired parser's dialect trait source.
It supports the repository's derive/ layout and Cargo registry directories
named pg_fake_sqlparser-0.63.0. Unversioned vendor directories are not
supported by this lookup.
When preparing a new parser version, update derive/parser-version, release
an appropriately versioned derive crate, and update the parser's exact derive
dependency together. The version-pairing test checks that the recorded parser
version matches the parser manifest. Fork release numbers and compatibility
are managed independently of upstream.
Documentation and development
Run the parser and derive tests, formatting check, and lints from the repository root:
License and attribution
Licensed under Apache-2.0. Upstream attribution is retained in
NOTICE.TXT and the source files. This fork includes modifications
for pg_fake; upstream authorship is preserved.