Skip to main content

SqliteStoreBuilder

Struct SqliteStoreBuilder 

Source
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

Source

pub fn durability(self, durability: Durability) -> Self

Sets how hard commits are pushed to disk. Input: the level. Output: the builder. Default Durability::Full.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for SqliteStoreBuilder

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SqliteStoreBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for SqliteStoreBuilder

§

impl !UnwindSafe for SqliteStoreBuilder

§

impl Forget for SqliteStoreBuilder

§

impl Freeze for SqliteStoreBuilder
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, *const ArcInner<dyn Clock> is !null: Freeze, PhantomData<ArcInner<dyn Clock>>: Freeze,

§

impl Move for SqliteStoreBuilder

§

impl Send for SqliteStoreBuilder
where RawVecInner: Send, Arc<dyn Clock>: Send,

§

impl Sync for SqliteStoreBuilder
where RawVecInner: Sync, Arc<dyn Clock>: Sync,

§

impl Unpin for SqliteStoreBuilder
where *const u8 is !null: Unpin, Arc<dyn Clock>: Unpin,

§

impl UnsafeUnpin for SqliteStoreBuilder
where *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *const ArcInner<dyn Clock> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Clock>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.