diff --git a/Cargo.lock b/Cargo.lock index 3c2da29..c705649 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -329,6 +329,25 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "include_dir" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" +dependencies = [ + "proc-macro2", + "quote", +] + [[package]] name = "itertools" version = "0.13.0" @@ -451,6 +470,7 @@ dependencies = [ "flate2", "generativity", "glob", + "include_dir", "libc", "pretty_assertions", "prettyplease", diff --git a/Cargo.toml b/Cargo.toml index b8b16ce..6f358ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,9 +11,11 @@ repository = "https://github.com/pgdogdev/pg_raw_parse" # Enables compile-time checks to verify that our enums are actually layout # identical to the C structures we're casting from. Requires a nightly compiler field_offset_assertions = [] +postgres-regress = ["dep:include_dir"] [dependencies] generativity = "1.2.1" +include_dir = { version = "0.7", optional = true } libc = "0.2.186" thiserror = "2.0.18" diff --git a/libpg_query b/libpg_query index aa71ad9..204fbdb 160000 --- a/libpg_query +++ b/libpg_query @@ -1 +1 @@ -Subproject commit aa71ad962b654c1d608c687232c047e48dba6452 +Subproject commit 204fbdbd3ed5f8691ab358e49f1fc5397b4679e2 diff --git a/src/lib.rs b/src/lib.rs index 0ed0cdb..e97597a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,6 +24,10 @@ pub use crate::error::{Error, Result}; pub use crate::node_enum::{Node, NodeMut}; pub use crate::owned::Owned; +#[cfg(feature = "postgres-regress")] +pub static POSTGRES_REGRESS: include_dir::Dir<'static> = + include_dir::include_dir!("$CARGO_MANIFEST_DIR/libpg_query/test/sql/postgres_regress"); + /// PostgreSQL version number whose parser sources are used by this crate. pub const POSTGRES_VERSION_NUM: u32 = raw::PG_VERSION_NUM;