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
impl Clone for SqliteSettings
Source§fn clone(&self) -> SqliteSettings
fn clone(&self) -> SqliteSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SqliteSettings
impl Debug for SqliteSettings
Source§impl Default for SqliteSettings
impl Default for SqliteSettings
Source§fn default() -> SqliteSettings
fn default() -> SqliteSettings
Source§impl PartialEq for SqliteSettings
impl PartialEq for SqliteSettings
impl Eq for SqliteSettings
impl StructuralPartialEq for SqliteSettings
Auto Trait Implementations§
impl Freeze for SqliteSettings
impl RefUnwindSafe for SqliteSettings
impl Send for SqliteSettings
impl Sync for SqliteSettings
impl Unpin for SqliteSettings
impl UnsafeUnpin for SqliteSettings
impl UnwindSafe for SqliteSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.