sqlite-pool
Async connection pooling built on deadpool’s managed pool and interrupt handling for rusqlite.
Example (Connection pool)
use Config;
let pool = new
.max_size
.create_pool?;
// Within a Tokio runtime, e.g. async fn main:
let mut conn = pool.get.await?;
conn.execute_batch?;
Configuration
| Piece | Role |
|---|---|
path |
Database file path. |
open_flags |
Flags used when creating the rusqlite connection. Use Config::read_only for a common read-only preset. |
pool |
deadpool::managed::PoolConfig: max_size, timeouts, queue_mode. |
use Connection;
use ;
async
InterruptibleTransaction
InterruptibleTransaction wraps something that dereferences to rusqlite::Connection (often a Transaction) and wraps execute, prepare, prepare_cached, execute_batch, and iterator-style reads so operations can get interrupted after a configured timeout.