Setup features for conditional compilation

This commit is contained in:
Ben Grant 2023-05-15 18:33:32 +10:00
parent 1a8db405de
commit 2ba96cc9cb
2 changed files with 6 additions and 0 deletions

View file

@ -5,6 +5,10 @@ license = "GPL-3.0-only"
version = "2.0.0"
edition = "2021"
[features]
sql-adaptor = []
datastore-adaptor = []
[workspace]
members = ["common", "adaptors/*"]

View file

@ -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
}