Skip to main content

toolu_orm_connection/
lib.rs

1//! Database connection trait and backend implementations for toolu-orm.
2//!
3//! ## Features
4//!
5//! Enable exactly one backend per consumer:
6//! - `libsql`    -- async libsql (Turso embedded replica)
7//! - `rusqlite`  -- sync rusqlite (native `DbConnectionBlocking`, wrapped with
8//!   spawn_blocking for `DbConnection`)
9//! - `postgres`  -- async tokio-postgres + deadpool connection pool
10
11pub mod blocking_trait_def;
12pub mod error;
13pub mod trait_def;
14
15#[cfg(feature = "libsql")]
16pub mod libsql_impl;
17
18#[cfg(feature = "rusqlite")]
19pub mod rusqlite_impl;
20
21#[cfg(feature = "postgres")]
22pub mod postgres_impl;
23
24pub use blocking_trait_def::DbConnectionBlocking;
25pub use error::DbError;
26pub use trait_def::DbConnection;
27
28#[cfg(feature = "libsql")]
29pub use libsql_impl::{Database, LibsqlConnection, RemoteConfig};
30
31#[cfg(feature = "rusqlite")]
32pub use rusqlite_impl::RusqliteConnection;
33
34#[cfg(feature = "postgres")]
35pub use postgres_impl::{PgConfig, PgConnection, PgDatabase, PgTransaction};