pub struct SqlitePrimitiveStorage { /* private fields */ }Expand description
SQLite-based primitive storage implementation with MVCC versioning.
Uses SQLite for persistent storage with a single connection protected by Mutex. Tables use (key, version) composite primary key for multi-version support.
Implementations§
Source§impl SqlitePrimitiveStorage
impl SqlitePrimitiveStorage
Sourcepub fn new(config: SqliteConfig) -> Self
pub fn new(config: SqliteConfig) -> Self
Create a new SQLite primitive storage with the given configuration.
Sourcepub fn incremental_vacuum(&self)
pub fn incremental_vacuum(&self)
Run incremental vacuum to return freed pages to the OS.
Sourcepub fn shrink_memory(&self)
pub fn shrink_memory(&self)
Release unused memory back to the allocator.
Trait Implementations§
Source§impl Clone for SqlitePrimitiveStorage
impl Clone for SqlitePrimitiveStorage
Source§fn clone(&self) -> SqlitePrimitiveStorage
fn clone(&self) -> SqlitePrimitiveStorage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl TierStorage for SqlitePrimitiveStorage
impl TierStorage for SqlitePrimitiveStorage
Source§fn get(
&self,
table: EntryKind,
key: &[u8],
version: CommitVersion,
) -> Result<Option<CowVec<u8>>>
fn get( &self, table: EntryKind, key: &[u8], version: CommitVersion, ) -> Result<Option<CowVec<u8>>>
Get the value for a key at or before the given version.
Source§fn contains(
&self,
table: EntryKind,
key: &[u8],
version: CommitVersion,
) -> Result<bool>
fn contains( &self, table: EntryKind, key: &[u8], version: CommitVersion, ) -> Result<bool>
Check if a key exists at or before the given version.
Source§fn set(
&self,
version: CommitVersion,
batches: HashMap<EntryKind, Vec<(CowVec<u8>, Option<CowVec<u8>>)>>,
) -> Result<()>
fn set( &self, version: CommitVersion, batches: HashMap<EntryKind, Vec<(CowVec<u8>, Option<CowVec<u8>>)>>, ) -> Result<()>
Write entries to multiple tables atomically at the given version. Read more
Source§fn range_next(
&self,
table: EntryKind,
cursor: &mut RangeCursor,
start: Bound<&[u8]>,
end: Bound<&[u8]>,
version: CommitVersion,
batch_size: usize,
) -> Result<RangeBatch>
fn range_next( &self, table: EntryKind, cursor: &mut RangeCursor, start: Bound<&[u8]>, end: Bound<&[u8]>, version: CommitVersion, batch_size: usize, ) -> Result<RangeBatch>
Fetch the next batch of entries in key order at or before version. Read more
Source§fn range_rev_next(
&self,
table: EntryKind,
cursor: &mut RangeCursor,
start: Bound<&[u8]>,
end: Bound<&[u8]>,
version: CommitVersion,
batch_size: usize,
) -> Result<RangeBatch>
fn range_rev_next( &self, table: EntryKind, cursor: &mut RangeCursor, start: Bound<&[u8]>, end: Bound<&[u8]>, version: CommitVersion, batch_size: usize, ) -> Result<RangeBatch>
Fetch the next batch of entries in reverse key order at or before version. Read more
Source§fn ensure_table(&self, table: EntryKind) -> Result<()>
fn ensure_table(&self, table: EntryKind) -> Result<()>
Ensure a table exists (creates if needed). Read more
impl TierBackend for SqlitePrimitiveStorage
Auto Trait Implementations§
impl Freeze for SqlitePrimitiveStorage
impl !RefUnwindSafe for SqlitePrimitiveStorage
impl Send for SqlitePrimitiveStorage
impl Sync for SqlitePrimitiveStorage
impl Unpin for SqlitePrimitiveStorage
impl UnsafeUnpin for SqlitePrimitiveStorage
impl !UnwindSafe for SqlitePrimitiveStorage
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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 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>
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