Skip to main content

SqliteSettings

Struct SqliteSettings 

Source
pub struct SqliteSettings {
Show 16 fields pub busy_timeout: Option<Duration>, pub cache_size: Option<CacheSize>, pub cache_spill: Option<CacheSpill>, pub mmap_size: Option<u64>, pub temp_store: Option<TempStore>, pub threads: Option<u32>, pub journal_size_limit: Option<JournalSizeLimit>, pub wal_autocheckpoint: Option<WalAutocheckpoint>, pub automatic_index: Option<bool>, pub cell_size_check: Option<bool>, pub secure_delete: Option<SecureDelete>, pub fullfsync: Option<bool>, pub checkpoint_fullfsync: Option<bool>, pub analysis_limit: Option<AnalysisLimit>, pub page_size: Option<PageSize>, pub auto_vacuum: Option<AutoVacuum>,
}
Expand description

SQLite settings for every connection coven opens to the store’s database: the writer and the readers of a writable handle, and every connection of a read-only one. A setting left None keeps SQLite’s own default, except checkpoint_fullfsync on macOS and iOS, which coven turns on, and auto_vacuum, which is Incremental. Coven applies them as each connection opens, before any of its own statements.

The settings coven’s guarantees rest on have no field here: the journal mode, synchronous, the locking mode, foreign keys and the rest stay fixed (§4).

ⓘ
let _ = coven_database::SqliteSettings {
    journal_mode: None,
    ..Default::default()
};

Fields§

§busy_timeout: Option<Duration>

How long a connection waits for a lock another connection holds before failing with SQLITE_BUSY (PRAGMA busy_timeout), at most i32::MAX milliseconds. Unset keeps the 5 seconds rusqlite sets when it opens a connection. RESTART and TRUNCATE checkpoints wait this long for readers.

§cache_size: Option<CacheSize>

The size of each connection’s page cache (PRAGMA cache_size).

§cache_spill: Option<CacheSpill>

Whether, and past how many cached pages, a transaction writes changed pages to the file before it commits (PRAGMA cache_spill).

§mmap_size: Option<u64>

Bytes of the database read through memory-mapped I/O (PRAGMA mmap_size), at most i64::MAX. SQLite lowers it to the largest size it was built to map.

§temp_store: Option<TempStore>

Where temporary tables and indices are kept (PRAGMA temp_store). On Android, coven’s SQLite is built to keep them in memory whatever this says.

§threads: Option<u32>

Helper threads one statement may use to sort (PRAGMA threads), at most i32::MAX. SQLite lowers it to the most it was built to allow.

§journal_size_limit: Option<JournalSizeLimit>

The size SQLite truncates the WAL file to at the first commit after a checkpoint lets the WAL start over (PRAGMA journal_size_limit). Unset is coven’s 4 MiB.

§wal_autocheckpoint: Option<WalAutocheckpoint>

The WAL size at which coven checkpoints it, off the commit path; unset is SQLite’s 1000 pages (§4). The writer never checkpoints as it commits. A read-only handle’s own commits, which only its cache makes, checkpoint as SQLite’s PRAGMA wal_autocheckpoint does.

§automatic_index: Option<bool>

Whether the query planner may build a temporary index for one query (PRAGMA automatic_index).

§cell_size_check: Option<bool>

Whether SQLite checks each page’s cells for damage as it reads them (PRAGMA cell_size_check).

§secure_delete: Option<SecureDelete>

Whether deleted content is overwritten in the file (PRAGMA secure_delete).

§fullfsync: Option<bool>

Whether a commit’s sync on macOS and iOS also flushes the drive’s own cache, F_FULLFSYNC (PRAGMA fullfsync). Other platforms ignore it. Unset keeps SQLite’s default, off, so a power loss can lose the latest commits.

§checkpoint_fullfsync: Option<bool>

The same for checkpoints (PRAGMA checkpoint_fullfsync). Unset is on for macOS and iOS, so a power loss can’t leave the database file holding only part of a checkpoint after the WAL has started over.

§analysis_limit: Option<AnalysisLimit>

How many rows of each index ANALYZE reads (PRAGMA analysis_limit).

§page_size: Option<PageSize>

The page size a store’s database is created with (PRAGMA page_size). It is fixed once the file has its first page: an existing store keeps the size it was created with.

§auto_vacuum: Option<AutoVacuum>

The auto-vacuum mode a store’s database is created with (PRAGMA auto_vacuum). Like the page size, an existing store keeps its own. Unset is Incremental, and coven gives back free pages past 4 MiB each time a claim lands (§4).

Trait Implementations§

Source§

impl Clone for SqliteSettings

Source§

fn clone(&self) -> SqliteSettings

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 SqliteSettings

Source§

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

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

impl Default for SqliteSettings

Source§

fn default() -> SqliteSettings

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

impl PartialEq for SqliteSettings

Source§

fn eq(&self, other: &SqliteSettings) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for SqliteSettings

Source§

impl StructuralPartialEq for SqliteSettings

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

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> ErasedDestructor for T
where T: 'static,

§

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