Rindle docs and package mapSkip to main content

OpenOptions

Struct OpenOptions 

Source
pub struct OpenOptions {
    pub plan_queries: bool,
    pub operator_storage: OperatorStorage,
    pub journal: JournalMode,
    pub wal_autocheckpoint: Option<u32>,
    pub foreign_keys: ForeignKeys,
}
Expand description

Everything an opener can be configured with, in one struct-with-Default — so every combination (planner × operator storage × journal) is expressible without a ladder of positional open_with_* rungs. Taken by Db::open_with, Cluster::open_with, and ClusterConsumer::open_with; the named rungs (open, open_with_planning, open_with_journal, …) are conveniences that fill one field each.

// An explicitly-wal2 store with the defaults otherwise:
let db = Db::open_with(
    "app.db",
    OpenOptions {
        journal: JournalMode::Wal2,
        ..OpenOptions::default()
    },
).unwrap();

Fields§

§plan_queries: bool

Run the cost-based join-flip planner at query registration (default true, matching open). Result-preserving; the plan is frozen per registration.

§operator_storage: OperatorStorage

Where stateful operators keep scratch state (default in-process memory).

§journal: JournalMode

The journal mode a fresh (or explicitly-wal2) store gets (design 306 D5; default JournalMode::Wal). JournalMode::Wal2 is a requirement, not a preference — the opener fails if the store does not end up in wal2.

§wal_autocheckpoint: Option<u32>

PRAGMA wal_autocheckpoint for the writer connection, in pages (design 410 §3.5). None (the default) leaves SQLite’s own default of 1000 pages — what every server-side opener wants. Some(0) disables the automatic checkpoint entirely, so the WAL folds back only on an explicit maintain pass: the embedded/mobile posture, where an unpredictable checkpoint landing inside whichever commit happens to cross the threshold is worse than a deliberate one at a moment the app picks (gesture end, idle, backgrounding). Connection-local, so it must be re-passed at every open.

§foreign_keys: ForeignKeys

Whether SQLite enforces declared foreign keys on this store’s read-write connections (default ForeignKeys::Enforced, matching the vendored build’s compile-time default).

ForeignKeys::Enforced is the origin posture — right for an embedded Db, a directly-driven Cluster, and the standalone daemon’s write plane, where a violated constraint is the application’s bug. An apply plane — a follower replaying a master’s journal — passes ForeignKeys::Unenforced, because those rows were validated upstream, arrive in the stream’s order rather than a topological one, and carry the authority’s cascade effects as ordinary row changes that must not be re-run locally. See [rindle_writeplane::foreign_keys] for the full argument, and Cluster::foreign_key_audit for the audit that proves referential integrity either way.

Trait Implementations§

Source§

impl Clone for OpenOptions

Source§

fn clone(&self) -> OpenOptions

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for OpenOptions

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for OpenOptions

Source§

fn default() -> OpenOptions

Returns the “default value” for a type. Read more
Source§

impl Copy for OpenOptions

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,