wasm_sql/sqldb.rs
1use sqlx::Pool;
2
3#[cfg(feature = "postgres")]
4pub(crate) type SqlDatabase = sqlx::Postgres;
5
6#[cfg(feature = "mysql")]
7pub(crate) type SqlDatabase = sqlx::Mysql;
8
9#[cfg(any(feature = "sqlite", feature = "sqlite-unbundled"))]
10pub(crate) type SqlDatabase = sqlx::Sqlite;
11
12pub struct SqlDB {
13 #[allow(dead_code)]
14 pub(crate) pool: Pool<SqlDatabase>,
15}
16
17impl SqlDB {
18 pub fn new(pool: Pool<SqlDatabase>) -> Self {
19 Self { pool: pool }
20 }
21}
22
23pub use sqlx;