Skip to content

Commit d402c38

Browse files
authored
fix(sql): more explicit error if no driver is enabled (tauri-apps#2047)
1 parent 90ef77c commit d402c38

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugins/sql/src/wrapper.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ impl DbPool {
104104
}
105105
Ok(Self::Postgres(Pool::connect(conn_url).await?))
106106
}
107+
#[cfg(not(any(feature = "sqlite", feature = "postgres", feature = "mysql")))]
108+
_ => Err(crate::Error::InvalidDbUrl(format!(
109+
"{conn_url} - No database driver enabled!"
110+
))),
111+
#[cfg(any(feature = "sqlite", feature = "postgres", feature = "mysql"))]
107112
_ => Err(crate::Error::InvalidDbUrl(conn_url.to_string())),
108113
}
109114
}

0 commit comments

Comments
 (0)