diff --git a/libsql/Cargo.toml b/libsql/Cargo.toml index f81b9b4f0e..824fb92951 100644 --- a/libsql/Cargo.toml +++ b/libsql/Cargo.toml @@ -59,8 +59,13 @@ core = [ "dep:bitflags", "dep:futures" ] +parser = [ + "dep:sqlite3-parser", + "dep:fallible-iterator" +] replication = [ "core", + "parser", "serde", "dep:tower", "dep:hyper", @@ -70,10 +75,8 @@ replication = [ "dep:bincode", "dep:bytemuck", "dep:bytes", - "dep:fallible-iterator", "dep:uuid", "dep:tokio-stream", - "dep:sqlite3-parser", "dep:parking_lot", "dep:tokio", "dep:tonic", @@ -85,11 +88,10 @@ replication = [ "dep:libsql-replication" ] hrana = [ + "parser", "serde", "dep:base64", "dep:serde_json", - "dep:sqlite3-parser", - "dep:fallible-iterator" ] serde = ["dep:serde"] remote = [ diff --git a/libsql/src/lib.rs b/libsql/src/lib.rs index 70ce89b1ff..d9d413a048 100644 --- a/libsql/src/lib.rs +++ b/libsql/src/lib.rs @@ -79,7 +79,9 @@ pub use params::params_from_iter; mod connection; mod database; -mod parser; +cfg_parser! { + mod parser; +} mod rows; mod statement; mod transaction; diff --git a/libsql/src/macros.rs b/libsql/src/macros.rs index 691801928a..ec119467bb 100644 --- a/libsql/src/macros.rs +++ b/libsql/src/macros.rs @@ -40,6 +40,16 @@ macro_rules! cfg_replication { } } +macro_rules! cfg_parser { + ($($item:item)*) => { + $( + #[cfg(feature = "parser")] + #[cfg_attr(docsrs, doc(cfg(feature = "parser")))] + $item + )* + } +} + macro_rules! cfg_hrana { ($($item:item)*) => { $(