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, 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 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: any value, 0 fails at once. 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, so a
removed chunk’s text and vector leave the file. Cost: every delete
writes zeros over freed space, more disk writes and slower deletes.
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.