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 (wrapped with spawn_blocking)
8//! - `postgres`  -- async tokio-postgres + deadpool connection pool
9
10pub mod error;
11pub mod trait_def;
12
13#[cfg(feature = "libsql")]
14pub mod libsql_impl;
15
16#[cfg(feature = "rusqlite")]
17pub mod rusqlite_impl;
18
19#[cfg(feature = "postgres")]
20pub mod postgres_impl;
21
22pub use error::DbError;
23pub use trait_def::DbConnection;
24
25#[cfg(feature = "libsql")]
26pub use libsql_impl::{Database, LibsqlConnection, RemoteConfig};
27
28#[cfg(feature = "rusqlite")]
29pub use rusqlite_impl::RusqliteConnection;
30
31#[cfg(feature = "postgres")]
32pub use postgres_impl::{PgConfig, PgConnection, PgDatabase, PgTransaction};