Skip to main content

rullst_orm/
db.rs

1use crate::database::RullstDatabase;
2
3/// Re-exporting Transaction so users use `rullst_orm::db::Transaction`
4pub type Transaction<'a> = sqlx::Transaction<'a, RullstDatabase>;
5
6/// Re-exporting Pool for connection pool usage
7#[cfg(not(any(
8    feature = "strict-postgres",
9    feature = "strict-mysql",
10    feature = "strict-sqlite"
11)))]
12pub type Pool = sqlx::AnyPool;
13
14#[cfg(feature = "strict-postgres")]
15pub type Pool = sqlx::PgPool;
16
17#[cfg(all(feature = "strict-mysql", not(feature = "strict-postgres")))]
18pub type Pool = sqlx::MySqlPool;
19
20#[cfg(all(
21    feature = "strict-sqlite",
22    not(feature = "strict-postgres"),
23    not(feature = "strict-mysql")
24))]
25pub type Pool = sqlx::SqlitePool;