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;pub use analytical::arrow;
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.
- Click
House Source - A handle to a ClickHouse server queried over HTTP.
- Connection
Manager - Multi-backend connection pool with optional automatic database creation.
- Initialization
Handler - Batch DDL migration executor with tracking.
- PgHandler
- Core query executor for native Postgres: rich-typed transactional writes via sqlx, and row-mapped analytical reads via DuckDB.
- PgRow
- Implementation of
Rowfor PostgreSQL. - Pool
Status - Snapshot of connection pool health.
- Record
Batch - A two-dimensional batch of column-oriented data with a defined schema.
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.
Traits§
- Read
Engine - An analytical query engine that returns columnar Arrow data.
- Remote
Sink - A remote analytical store you can bulk-load Arrow data into.
- Remote
Sink Ext - Typed writing for any
RemoteSink. - Remote
Source - An external analytical database queried over the network, returning Arrow.
- Remote
Source Ext - Typed querying for any
RemoteSource. - Row
- Represents a single row from the database.