Fixed compile without SQL dbs
This commit is contained in:
@@ -234,10 +234,7 @@ impl Stores {
|
||||
|
||||
// Add SQL queries as lookup stores
|
||||
for (store_id, lookup_store) in self.stores.iter().filter_map(|(id, store)| {
|
||||
if matches!(
|
||||
store,
|
||||
Store::MySQL(_) | Store::PostgreSQL(_) | Store::SQLite(_)
|
||||
) {
|
||||
if store.is_sql() {
|
||||
Some((id.clone(), LookupStore::from(store.clone())))
|
||||
} else {
|
||||
None
|
||||
|
||||
@@ -352,6 +352,13 @@ impl LookupStore {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn is_sql(&self) -> bool {
|
||||
match self {
|
||||
LookupStore::Store(store) => store.is_sql(),
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum LookupValue<T> {
|
||||
|
||||
@@ -677,6 +677,18 @@ impl Store {
|
||||
pub fn is_none(&self) -> bool {
|
||||
matches!(self, Self::None)
|
||||
}
|
||||
|
||||
pub fn is_sql(&self) -> bool {
|
||||
match self {
|
||||
#[cfg(feature = "sqlite")]
|
||||
Store::SQLite(_) => true,
|
||||
#[cfg(feature = "postgres")]
|
||||
Store::PostgreSQL(_) => true,
|
||||
#[cfg(feature = "mysql")]
|
||||
Store::MySQL(_) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for Store {
|
||||
|
||||
Reference in New Issue
Block a user