pub struct SqliteStoreBuilder { /* private fields */ }Expand description
Settings for SqliteStore, each with a safe default: full durability,
the system clock, 64 MiB caps on one state and one blob, 100 000 history
steps and 1 GiB of history state, a 5 000 ms busy timeout and secure
delete on. open validates them and opens the file.
Implementations§
Source§impl SqliteStoreBuilder
impl SqliteStoreBuilder
Sourcepub fn durability(self, durability: Durability) -> Self
pub fn durability(self, durability: Durability) -> Self
Sets how hard commits are pushed to disk.
Input: the level. Output: the builder. Default Durability::Full.
Sourcepub fn clock(self, clock: Arc<dyn Clock>) -> Self
pub fn clock(self, clock: Arc<dyn Clock>) -> Self
Sets the time source of the job queue. Share it with the runner’s io
so leases and due times agree. Input: the clock. Output: the builder.
Default SystemClock.
Sourcepub fn max_state_bytes(self, bytes: u64) -> Self
pub fn max_state_bytes(self, bytes: u64) -> Self
Sets the largest serialized checkpoint state save accepts, in bytes.
Input: 1 to 1 000 000 000. Output: the builder. Default 64 MiB.
Sourcepub fn max_blob_bytes(self, bytes: u64) -> Self
pub fn max_blob_bytes(self, bytes: u64) -> Self
Sets the largest blob put accepts, in bytes.
Input: 1 to 1 000 000 000. Output: the builder. Default 64 MiB.
Sourcepub fn max_history_steps(self, steps: u64) -> Self
pub fn max_history_steps(self, steps: u64) -> Self
Sets the most kept steps history returns before it errors.
Input: at least 1. Output: the builder. Default 100 000.
Sourcepub fn max_history_bytes(self, bytes: u64) -> Self
pub fn max_history_bytes(self, bytes: u64) -> Self
Sets the most serialized state bytes history returns in total
before it errors, so one call’s memory stays bounded.
Input: at least 1. Output: the builder. Default 1 GiB.
Sourcepub fn busy_timeout_ms(self, ms: u32) -> Self
pub fn busy_timeout_ms(self, ms: u32) -> Self
Sets how long a writer waits for another handle’s lock, in ms.
Input: 0 to i32::MAX, 0 fails at once; open refuses a larger
value. Output: the builder. Default 5 000.
Sourcepub fn secure_delete(self, on: bool) -> Self
pub fn secure_delete(self, on: bool) -> Self
Sets whether deleted rows are overwritten: SQLite secure_delete on
the connection and FTS5 secure-delete on the keyword index. A delete
is appended to the WAL, so the old text and vector stay in the files
until a checkpoint copies it back and the WAL is reset, at the latest
when the last handle closes. Cost: zeros over freed space, slower
deletes. The FTS5 option lives in the file: off is refused at
vectors once any handle turned it on. Input: on or off. Output:
the builder. Default on.
Sourcepub async fn open(self) -> Result<SqliteStore, CoreError>
pub async fn open(self) -> Result<SqliteStore, CoreError>
Validates the settings, creates the file when missing, refuses a
foreign or newer file and migrates an older one. Needs a tokio
runtime. Output: the store, or CoreError::Store.