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

pull/2053/head
Fabian-Lars 7 months ago committed by GitHub
parent 90ef77c872
commit d402c3865a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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