Expand description
Multi-backend database infrastructure.
Transactional writes go through sqlx’s Any driver, so the backend
(Postgres, MySQL, or SQLite) is selected from the connection URL scheme.
Analytical reads go through a pluggable Arrow-based engine (DuckDB or
DataFusion), behind feature flags.
ConnectionManager— sqlx connection pool with auto-create DBCache— DashMap-based concurrent key-value cache with named bucketsBaseHandler—execute_write(sqlx) /execute_read(Arrow) /execute_read_as(typed), plus transactional → analytical syncInitializationHandler— backend-aware DDL migration executor
§Example
use dbkit::ConnectionManager;
// The URL scheme selects the backend: postgres:// , mysql:// , sqlite://
let conn = ConnectionManager::new("postgres://localhost/myapp").await?;
// `pool()` yields a sqlx `AnyPool`, usable across all supported backends.
let _pool = conn.pool();Note: the write/read handlers and migration runner are being ported onto this pool; see the crate changelog for the current status.
Re-exports§
pub use config::Backend;pub use config::ConfigBuilder;pub use config::DbkitConfig;pub use config::SslMode;
Modules§
Structs§
- AnyRow
- Base
Handler - Core query executor: transactional writes via sqlx, and optionally
analytical reads via a pluggable [
ReadEngine] (DuckDB or DataFusion). - Cache
- Concurrent key-value cache with named buckets.
- Connection
Manager - Multi-backend connection pool with optional automatic database creation.
- Initialization
Handler - Batch DDL migration executor with tracking.
- Pool
Status - Snapshot of connection pool health.
Enums§
- DbValue
- A backend-neutral parameter value.
- Dbkit
Error - Fetch
Mode - How many rows to expect from a query.
- Query
Result - Result wrapper for write queries.
- WriteOp
- Unified write operation types.