fix(sql): more explicit error if no driver is enabled (#2047)

This commit is contained in:
Fabian-Lars authored and GitHub committed 2024-11-13 23:43:58 +01:00
1 parent 90ef77c872
commit d402c3865a
1 file changed
+5
+5
View File
@@ -104,6 +104,11 @@ impl DbPool {
}
Ok(Self::Postgres(Pool::connect(conn_url).await?))
}
#[cfg(not(any(feature = "sqlite", feature = "postgres", feature = "mysql")))]
_ => Err(crate::Error::InvalidDbUrl(format!(
"{conn_url} - No database driver enabled!"
))),
#[cfg(any(feature = "sqlite", feature = "postgres", feature = "mysql"))]
_ => Err(crate::Error::InvalidDbUrl(conn_url.to_string())),
}
}