pub enum JournalMode {
Wal,
Mvcc,
}Expand description
Selects the durability + concurrency story a database operates
under. Toggled by PRAGMA journal_mode = … (see
crate::sql::pragma::execute_pragma).
JournalMode::Wal(default) — every read goes through the legacy table → pager path; every write fsyncs a per-page commit frame. This is the only mode pre-Phase-11 builds knew about, and it’s what file-format-v5 + WAL-format-v2 files produce by default.JournalMode::Mvcc— opts the database into Phase 11’s multi-version concurrency control. Enables snapshot-isolated reads (consultMvStorefirst, fall back to the pager) andBEGIN CONCURRENTwrites (Phase 11.4). On-disk format is unchanged; the WAL header’sclock_high_waterbyte range carries the persisted clock value either way.
Phase 11.3 ships the parser surface and the per-database
setting; the read path doesn’t change behaviour yet. The
Mvcc value is observable via the PRAGMA read form so callers
can confirm the toggle landed.
Variants§
Wal
Default — legacy WAL-backed pager. Every commit fsyncs a
page-level frame; every read consults staged → wal_cache → on_disk.
Mvcc
Phase 11 MVCC + BEGIN CONCURRENT. Same on-disk format as
Wal; the in-memory MvStore sits in front of the pager
for reads, and writes go through commit-time validation.
Implementations§
Source§impl JournalMode
impl JournalMode
Sourcepub fn from_str_lossless(s: &str) -> Option<Self>
pub fn from_str_lossless(s: &str) -> Option<Self>
Parses a PRAGMA value (case-insensitive). Returns None for
unrecognized inputs so the caller can surface a typed
unknown journal_mode error with the bad string.
Trait Implementations§
Source§impl Clone for JournalMode
impl Clone for JournalMode
Source§fn clone(&self) -> JournalMode
fn clone(&self) -> JournalMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JournalMode
impl Debug for JournalMode
Source§impl Default for JournalMode
impl Default for JournalMode
Source§fn default() -> JournalMode
fn default() -> JournalMode
Source§impl Display for JournalMode
impl Display for JournalMode
Source§impl PartialEq for JournalMode
impl PartialEq for JournalMode
Source§fn eq(&self, other: &JournalMode) -> bool
fn eq(&self, other: &JournalMode) -> bool
self and other values to be equal, and is used by ==.impl Copy for JournalMode
impl Eq for JournalMode
impl StructuralPartialEq for JournalMode
Auto Trait Implementations§
impl Freeze for JournalMode
impl RefUnwindSafe for JournalMode
impl Send for JournalMode
impl Sync for JournalMode
impl Unpin for JournalMode
impl UnsafeUnpin for JournalMode
impl UnwindSafe for JournalMode
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.