aboutsummaryrefslogtreecommitdiff
path: root/src/garage
diff options
context:
space:
mode:
authorZdenek Crha <zdenek.crha@gmail.com>2024-01-22 20:38:14 +0100
committerZdenek Crha <zdenek.crha@gmail.com>2024-01-22 21:12:02 +0100
commit0eef8a69f0006de305281dd374cc63e7a46e4b80 (patch)
tree5a4282d7cc148d0566784aaceb1691753e29f38b /src/garage
parent74e72fc99690e24de498e42d87fc04a123f712d5 (diff)
downloadgarage-0eef8a69f0006de305281dd374cc63e7a46e4b80.tar.gz
garage-0eef8a69f0006de305281dd374cc63e7a46e4b80.zip
make all garage_db::Engine variants un-conditional
Having all Engine enum variants conditional causes compilation errors when *none* of the DB engine features is enabled. This is not an issue for full garage build, but affects crates that use garage_db as dependency. Change all variants to be present at all times. It solves compilation errors and also allows us to better differentiate between invalid DB engine name and engine with support not compiled in current binary.
Diffstat (limited to 'src/garage')
-rw-r--r--src/garage/cli/convert_db.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/garage/cli/convert_db.rs b/src/garage/cli/convert_db.rs
index 7307d1cf..044ccbb9 100644
--- a/src/garage/cli/convert_db.rs
+++ b/src/garage/cli/convert_db.rs
@@ -91,5 +91,13 @@ fn open_db(path: PathBuf, engine: Engine, open: &OpenDbOpt) -> Result<Db> {
let db = env_builder.open(&path)?;
Ok(lmdb_adapter::LmdbDb::init(db))
}
+
+ // Pattern is unreachable when all supported DB engines are compiled into binary. The allow
+ // attribute is added so that we won't have to change this match in case stop building
+ // support for one or more engines by default.
+ #[allow(unreachable_patterns)]
+ engine => Err(Error(
+ format!("Engine support not available in this build: {}", engine).into(),
+ )),
}
}