pub struct SqliteStoreConfig { /* private fields */ }
Expand description
A configuration structure used for opening a store.
Implementations§
Source§impl SqliteStoreConfig
impl SqliteStoreConfig
Sourcepub fn new<P>(path: P) -> Self
pub fn new<P>(path: P) -> Self
Create a new SqliteStoreConfig
with a path representing the
directory containing the store database.
Sourcepub fn passphrase(self, passphrase: Option<&str>) -> Self
pub fn passphrase(self, passphrase: Option<&str>) -> Self
Define the passphrase if the store is encoded.
Sourcepub fn pool_max_size(self, max_size: usize) -> Self
pub fn pool_max_size(self, max_size: usize) -> Self
Define the maximum pool size for deadpool_sqlite
.
See deadpool_sqlite::PoolConfig::max_size
to learn more.
Sourcepub fn optimize(self, optimize: bool) -> Self
pub fn optimize(self, optimize: bool) -> Self
Optimize the database.
The SQLite documentation recommends to run this regularly and after any schema change. The easiest is to do it consistently when the store is constructed, after eventual migrations.
See PRAGMA optimize
to learn more.
The default value is true
.
Sourcepub fn cache_size(self, cache_size: u32) -> Self
pub fn cache_size(self, cache_size: u32) -> Self
Define the maximum size in bytes the SQLite cache can use.
See PRAGMA cache_size
to learn more.
The default value is 2Mib.
Sourcepub fn journal_size_limit(self, limit: u32) -> Self
pub fn journal_size_limit(self, limit: u32) -> Self
Limit the size of the WAL file, in bytes.
By default, while the DB connections of the databases are open, the
size of the WAL file can keep increasing depending on
the size needed for the transactions. A critical case is VACUUM
which basically writes the content of the DB file to the WAL file
before writing it back to the DB file, so we end up taking twice the
size of the database.
By setting this limit, the WAL file is truncated after its content is written to the database, if it is bigger than the limit.
See PRAGMA journal_size_limit
to learn more. The value limit
corresponds to N
in PRAGMA journal_size_limit = N
.
The default value is 10Mib.
Trait Implementations§
Source§impl Clone for SqliteStoreConfig
impl Clone for SqliteStoreConfig
Source§fn clone(&self) -> SqliteStoreConfig
fn clone(&self) -> SqliteStoreConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for SqliteStoreConfig
impl RefUnwindSafe for SqliteStoreConfig
impl Send for SqliteStoreConfig
impl Sync for SqliteStoreConfig
impl Unpin for SqliteStoreConfig
impl UnwindSafe for SqliteStoreConfig
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<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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