Skip to main content

sql_middleware/typed/any/
mod.rs

1//! Backend-neutral `AnyIdle` and `AnyTx` enum wrappers.
2
3#[cfg(feature = "mssql")]
4use crate::mssql::typed::{Idle as MsIdle, InTx as MsInTx, MssqlTypedConnection};
5#[cfg(feature = "postgres")]
6use crate::postgres::typed::{Idle as PgIdle, InTx as PgInTx, PgConnection};
7#[cfg(feature = "sqlite")]
8use crate::sqlite::typed::{Idle as SqIdle, InTx as SqInTx, SqliteTypedConnection};
9#[cfg(feature = "turso")]
10use crate::turso::typed::{Idle as TuIdle, InTx as TuInTx, TursoConnection};
11
12mod ops;
13mod queryable;
14
15/// Backend-neutral idle wrapper.
16pub enum AnyIdle {
17    #[cfg(feature = "postgres")]
18    Postgres(PgConnection<PgIdle>),
19    #[cfg(feature = "sqlite")]
20    Sqlite(SqliteTypedConnection<SqIdle>),
21    #[cfg(feature = "mssql")]
22    Mssql(MssqlTypedConnection<MsIdle>),
23    #[cfg(feature = "turso")]
24    Turso(TursoConnection<TuIdle>),
25}
26
27/// Backend-neutral tx wrapper.
28pub enum AnyTx {
29    #[cfg(feature = "postgres")]
30    Postgres(PgConnection<PgInTx>),
31    #[cfg(feature = "sqlite")]
32    Sqlite(SqliteTypedConnection<SqInTx>),
33    #[cfg(feature = "mssql")]
34    Mssql(MssqlTypedConnection<MsInTx>),
35    #[cfg(feature = "turso")]
36    Turso(TursoConnection<TuInTx>),
37}