pub struct SQLiteKeyValueStore { /* private fields */ }Expand description
SQLite physical implementation of KeyValueStore.
Implementations§
Source§impl SQLiteKeyValueStore
impl SQLiteKeyValueStore
pub fn open(path: &Path) -> SQLiteResult<Self>
pub fn open_in_memory() -> SQLiteResult<Self>
pub fn new(conn: ManagedConnection) -> SQLiteResult<Self>
pub fn connection(&self) -> ManagedConnection
Sourcepub fn new_session(&self) -> Self
pub fn new_session(&self) -> Self
Create an isolated transaction session over the same SQLite database.
Trait Implementations§
Source§impl Clone for SQLiteKeyValueStore
impl Clone for SQLiteKeyValueStore
Source§fn clone(&self) -> SQLiteKeyValueStore
fn clone(&self) -> SQLiteKeyValueStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl KeyValueStore for SQLiteKeyValueStore
impl KeyValueStore for SQLiteKeyValueStore
fn storage_identity( &self, ) -> StorageBackendResult<Option<PersistentStorageIdentity>>
Source§fn open_session(&self) -> StorageBackendResult<Arc<dyn KeyValueStore>>
fn open_session(&self) -> StorageBackendResult<Arc<dyn KeyValueStore>>
Open an independent transaction session over the same logical store. The default keeps simple test/custom stores source-compatible while making the missing MVCC capability explicit when a persistent engine needs a committed reader alongside a pinned statement snapshot.
fn get(&self, key: &[u8]) -> StorageBackendResult<Option<Vec<u8>>>
fn contains_key(&self, key: &[u8]) -> StorageBackendResult<bool>
fn put(&self, key: &[u8], value: &[u8]) -> StorageBackendResult<()>
fn delete(&self, key: &[u8]) -> StorageBackendResult<()>
fn scan_prefix( &self, prefix: &[u8], ) -> StorageBackendResult<Vec<(Vec<u8>, Vec<u8>)>>
Source§fn scan_prefix_after(
&self,
prefix: &[u8],
after: Option<&[u8]>,
limit: usize,
) -> StorageBackendResult<Vec<(Vec<u8>, Vec<u8>)>>
fn scan_prefix_after( &self, prefix: &[u8], after: Option<&[u8]>, limit: usize, ) -> StorageBackendResult<Vec<(Vec<u8>, Vec<u8>)>>
Return at most
limit key/value pairs in key order, strictly after
after when supplied. This is the bounded value cursor used by large
format migrations and other paged consumers.Source§fn scan_prefix_keys_after(
&self,
prefix: &[u8],
after: Option<&[u8]>,
limit: usize,
) -> StorageBackendResult<Vec<Vec<u8>>>
fn scan_prefix_keys_after( &self, prefix: &[u8], after: Option<&[u8]>, limit: usize, ) -> StorageBackendResult<Vec<Vec<u8>>>
Return at most
limit keys in key order, strictly after after when
it is present. Backends should override this method with a key-only,
bounded range scan so cursor consumers neither materialize the entire
prefix nor read values they do not need on every page.fn first_prefix_after( &self, prefix: &[u8], after: Option<&[u8]>, ) -> StorageBackendResult<Option<(Vec<u8>, Vec<u8>)>>
fn delete_prefix(&self, prefix: &[u8]) -> StorageBackendResult<usize>
fn batch(&self) -> Box<dyn KeyValueBatch + '_>
fn begin_transaction(&self) -> StorageBackendResult<()>
fn begin_read_transaction(&self) -> StorageBackendResult<()>
fn in_transaction(&self) -> bool
fn transaction_has_written(&self) -> StorageBackendResult<bool>
fn change_version(&self) -> StorageBackendResult<Option<u64>>
fn change_version_monitor_is_nonblocking(&self) -> StorageBackendResult<bool>
fn pin_transaction_snapshot(&self) -> StorageBackendResult<()>
fn commit_transaction(&self) -> StorageBackendResult<()>
fn rollback_transaction(&self) -> StorageBackendResult<()>
fn savepoint(&self, name: &str) -> StorageBackendResult<()>
fn release_savepoint(&self, name: &str) -> StorageBackendResult<()>
fn rollback_to_savepoint(&self, name: &str) -> StorageBackendResult<()>
Auto Trait Implementations§
impl !RefUnwindSafe for SQLiteKeyValueStore
impl !UnwindSafe for SQLiteKeyValueStore
impl Freeze for SQLiteKeyValueStore
impl Send for SQLiteKeyValueStore
impl Sync for SQLiteKeyValueStore
impl Unpin for SQLiteKeyValueStore
impl UnsafeUnpin for SQLiteKeyValueStore
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