Setup features for conditional compilation
This commit is contained in:
parent
1a8db405de
commit
2ba96cc9cb
|
|
@ -5,6 +5,10 @@ license = "GPL-3.0-only"
|
|||
version = "2.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[features]
|
||||
sql-adaptor = []
|
||||
datastore-adaptor = []
|
||||
|
||||
[workspace]
|
||||
members = ["common", "adaptors/*"]
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue