aboutsummaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-09-08 15:50:56 +0200
committerAlex Auvolat <alex@adnab.me>2022-09-08 15:50:56 +0200
commit7f54706b95beb033820924e77e18f21f241d223e (patch)
tree26fc26ebb80e15a1ca64edd03efc9fac758274d0 /src/db
parent907054775dc71a10a92ab96112889db9113130ab (diff)
parentd9d199a6c9c0ae2a6ee2b04103c78ef1eb311956 (diff)
downloadgarage-7f54706b95beb033820924e77e18f21f241d223e.tar.gz
garage-7f54706b95beb033820924e77e18f21f241d223e.zip
Merge branch 'lx-perf-improvements' into netapp-stream-body
Diffstat (limited to 'src/db')
-rw-r--r--src/db/Cargo.toml9
-rw-r--r--src/db/lib.rs7
2 files changed, 13 insertions, 3 deletions
diff --git a/src/db/Cargo.toml b/src/db/Cargo.toml
index f697054b..62dda2ca 100644
--- a/src/db/Cargo.toml
+++ b/src/db/Cargo.toml
@@ -21,9 +21,9 @@ err-derive = "0.3"
hexdump = "0.1"
tracing = "0.1.30"
-heed = "0.11"
-rusqlite = { version = "0.27", features = ["bundled"] }
-sled = "0.34"
+heed = { version = "0.11", default-features = false, features = ["lmdb"], optional = true }
+rusqlite = { version = "0.27", optional = true }
+sled = { version = "0.34", optional = true }
# cli deps
clap = { version = "3.1.18", optional = true, features = ["derive", "env"] }
@@ -33,4 +33,7 @@ pretty_env_logger = { version = "0.4", optional = true }
mktemp = "0.4"
[features]
+bundled-libs = [ "rusqlite/bundled" ]
cli = ["clap", "pretty_env_logger"]
+lmdb = [ "heed" ]
+sqlite = [ "rusqlite" ]
diff --git a/src/db/lib.rs b/src/db/lib.rs
index f185114e..d96586be 100644
--- a/src/db/lib.rs
+++ b/src/db/lib.rs
@@ -1,8 +1,15 @@
#[macro_use]
+#[cfg(feature = "sqlite")]
extern crate tracing;
+#[cfg(not(any(feature = "lmdb", feature = "sled", feature = "sqlite")))]
+compile_error!("Must activate the Cargo feature for at least one DB engine: lmdb, sled or sqlite.");
+
+#[cfg(feature = "lmdb")]
pub mod lmdb_adapter;
+#[cfg(feature = "sled")]
pub mod sled_adapter;
+#[cfg(feature = "sqlite")]
pub mod sqlite_adapter;
pub mod counted_tree_hack;