Skip to main content

SQLiteKeyValueStore

Struct SQLiteKeyValueStore 

Source
pub struct SQLiteKeyValueStore { /* private fields */ }
Expand description

SQLite physical implementation of KeyValueStore.

Implementations§

Source§

impl SQLiteKeyValueStore

Source

pub fn open(path: &Path) -> SQLiteResult<Self>

Source

pub fn open_in_memory() -> SQLiteResult<Self>

Source

pub fn new(conn: ManagedConnection) -> SQLiteResult<Self>

Source

pub fn connection(&self) -> ManagedConnection

Source

pub fn new_session(&self) -> Self

Create an isolated transaction session over the same SQLite database.

Trait Implementations§

Source§

impl Clone for SQLiteKeyValueStore

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl KeyValueStore for SQLiteKeyValueStore

Source§

fn contains_prefix_budgeted( &self, prefix: &[u8], control: &StorageReadControl, ) -> StorageBackendResult<bool>

Test prefix existence under the read allowance. Providers that materialize values should implement a key-only probe.
Source§

fn visit_value( &self, key: &[u8], control: &StorageReadControl, visit: &mut ValueReadVisitor<'_>, ) -> StorageBackendResult<()>

Visit one borrowed value under the retained read. Providers reserve any temporary encoded payload before fetching it; callbacks must not reenter the store.
Source§

fn visit_prefix_after( &self, prefix: &[u8], after: Option<&[u8]>, limit: usize, control: &StorageReadControl, visit: &mut KeyValueReadVisitor<'_>, ) -> StorageBackendResult<()>

Visit at most limit entries in key order, strictly after after when supplied. Encoded values remain borrowed from their provider owner and callbacks must not reenter the store.
Source§

fn storage_identity( &self, ) -> StorageBackendResult<Option<PersistentStorageIdentity>>

Source§

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.
Source§

fn get(&self, key: &[u8]) -> StorageBackendResult<Option<Vec<u8>>>

Source§

fn contains_key(&self, key: &[u8]) -> StorageBackendResult<bool>

Source§

fn put(&self, key: &[u8], value: &[u8]) -> StorageBackendResult<()>

Source§

fn delete(&self, key: &[u8]) -> StorageBackendResult<()>

Source§

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>)>>

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>>>

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.
Source§

fn first_prefix_after( &self, prefix: &[u8], after: Option<&[u8]>, ) -> StorageBackendResult<Option<(Vec<u8>, Vec<u8>)>>

Source§

fn delete_prefix(&self, prefix: &[u8]) -> StorageBackendResult<usize>

Source§

fn batch(&self) -> Box<dyn KeyValueBatch + '_>

Source§

fn begin_transaction(&self) -> StorageBackendResult<()>

Source§

fn begin_read_transaction(&self) -> StorageBackendResult<()>

Source§

fn begin_upgradeable_transaction(&self) -> StorageBackendResult<()>

Source§

fn in_transaction(&self) -> bool

Source§

fn transaction_has_written(&self) -> StorageBackendResult<bool>

Source§

fn change_version(&self) -> StorageBackendResult<Option<u64>>

Source§

fn change_version_monitor_is_nonblocking(&self) -> StorageBackendResult<bool>

Source§

fn pin_transaction_snapshot(&self) -> StorageBackendResult<()>

Source§

fn commit_transaction(&self) -> StorageBackendResult<()>

Source§

fn rollback_transaction(&self) -> StorageBackendResult<()>

Source§

fn savepoint(&self, name: &str) -> StorageBackendResult<()>

Source§

fn release_savepoint(&self, name: &str) -> StorageBackendResult<()>

Source§

fn rollback_to_savepoint(&self, name: &str) -> StorageBackendResult<()>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.