From d402c3865a1727aa24c0eee5d5614652c1a57d74 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Wed, 13 Nov 2024 23:43:58 +0100 Subject: [PATCH] fix(sql): more explicit error if no driver is enabled (#2047) --- plugins/sql/src/wrapper.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/sql/src/wrapper.rs b/plugins/sql/src/wrapper.rs index 90631dac..d47b2d1c 100644 --- a/plugins/sql/src/wrapper.rs +++ b/plugins/sql/src/wrapper.rs @@ -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())), } }