fix: only do checks for included drivers

This commit is contained in:
əlemi 2024-01-03 23:23:21 +01:00
parent 6daf50a81e
commit 632a4a179c
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -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"),
}