diff --git a/backend/Cargo.toml b/backend/Cargo.toml index e0da7b4..2d55a2a 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -5,6 +5,10 @@ license = "GPL-3.0-only" version = "2.0.0" edition = "2021" +[features] +sql-adaptor = [] +datastore-adaptor = [] + [workspace] members = ["common", "adaptors/*"] diff --git a/backend/src/adaptors.rs b/backend/src/adaptors.rs index 95d280b..2010922 100644 --- a/backend/src/adaptors.rs +++ b/backend/src/adaptors.rs @@ -8,6 +8,8 @@ pub async fn create_adaptor() -> datastore_adaptor::DatastoreAdaptor { datastore_adaptor::DatastoreAdaptor::new().await } +#[cfg(not(feature = "sql-adaptor"))] +#[cfg(not(feature = "datastore-adaptor"))] pub async fn create_adaptor() -> memory_adaptor::MemoryAdaptor { memory_adaptor::MemoryAdaptor::new().await }