SQLite connection manager with a single writer and pooled readers.
Uses WAL mode for concurrent reads during writes. The writer is serialized through a GenServer to respect SQLite's single-writer constraint.
Summary
Functions
Create a consistent backup of this database using VACUUM INTO.
Returns a specification to start this module under a supervisor.
Get the database path.
Execute a read query using a reader connection from the pool.
Execute a write query (INSERT, UPDATE, DELETE) through the serialized writer.
Execute multiple write queries in a single transaction.
Types
Functions
@spec backup(server(), Path.t()) :: query_result()
Create a consistent backup of this database using VACUUM INTO.
Returns a specification to start this module under a supervisor.
See Supervisor.
Get the database path.
@spec read(server(), String.t(), list()) :: query_result()
Execute a read query using a reader connection from the pool.
@spec start_link(keyword()) :: GenServer.on_start()
@spec write(server(), String.t(), list()) :: query_result()
Execute a write query (INSERT, UPDATE, DELETE) through the serialized writer.
@spec write_transaction(server(), (term() -> result)) :: {:ok, result} | {:error, term()} when result: term()
Execute multiple write queries in a single transaction.