pub struct SqliteProvider { /* private fields */ }Implementations§
Source§impl SqliteProvider
impl SqliteProvider
Sourcepub fn new(path: impl AsRef<Path>) -> EFResult<Self>
pub fn new(path: impl AsRef<Path>) -> EFResult<Self>
Creates a provider for a file-based SQLite database with a connection pool (default 8 connections). WAL mode and a 5s busy timeout are applied to every pooled connection.
Note: :memory: (without URI) is special-cased to delegate to
new_in_memory because SQLite :memory:
databases are per-connection — a pool would give each connection its
own isolated database. URI-form shared in-memory DBs (e.g.
file::memory:?cache=shared) intentionally use Pooled mode.
Sourcepub fn new_in_memory() -> EFResult<Self>
pub fn new_in_memory() -> EFResult<Self>
Creates a provider for an in-memory SQLite database.
Uses a single shared connection (Arc<Mutex<Connection>>) because
SQLite :memory: databases are per-connection — a pool would give
each connection its own isolated database. This preserves the
pre-v1.4 behavior: each new_in_memory() call creates a fresh,
independent database with full test isolation.