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

pull/2047/head
FabianLars 9 months ago
parent 90ef77c872
commit 4a6d80b106
No known key found for this signature in database

@ -104,6 +104,11 @@ impl DbPool {
} }
Ok(Self::Postgres(Pool::connect(conn_url).await?)) 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())), _ => Err(crate::Error::InvalidDbUrl(conn_url.to_string())),
} }
} }

Loading…
Cancel
Save