Skip to content

Commit

Permalink
extract sqlite3-parser to its own feature referenced by replication/h…
Browse files Browse the repository at this point in the history
…rana
  • Loading branch information
Horusiath committed Nov 13, 2023
1 parent 7d1d2d5 commit 5f9b4dd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
10 changes: 6 additions & 4 deletions libsql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ core = [
"dep:bitflags",
"dep:futures"
]
parser = [
"dep:sqlite3-parser",
"dep:fallible-iterator"
]
replication = [
"core",
"parser",
"serde",
"dep:tower",
"dep:hyper",
Expand All @@ -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",
Expand All @@ -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 = [
Expand Down
4 changes: 3 additions & 1 deletion libsql/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions libsql/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)*) => {
$(
Expand Down

0 comments on commit 5f9b4dd

Please sign in to comment.