From 632a4a179c2709c4141d827e2b4e6db714bec784 Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 3 Jan 2024 23:23:21 +0100 Subject: [PATCH] fix: only do checks for included drivers --- src/storage.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/storage.rs b/src/storage.rs index 3178e89..d4d07ec 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -54,9 +54,15 @@ impl StorageProvider { let db = sqlx::AnyPool::connect(dest).await?; match db.acquire().await?.backend_name() { + #[cfg(feature = "postgres")] sqlx::Postgres::NAME => { sqlx::query(POSTGRES_SCHEMA).execute(&db).await?; }, + + #[cfg(feature = "sqlite")] sqlx::Sqlite::NAME => { sqlx::query(SQLITE_SCHEMA).execute(&db).await?; }, + + #[cfg(feature = "mysql")] sqlx::MySql::NAME => { sqlx::query(SQLITE_SCHEMA).execute(&db).await?; }, // TODO will this work? + _ => tracing::warn!("could not ensure schema: unsupported database type"), }