pub struct TxnBridge<S: KVStore> { /* private fields */ }Expand description
TxnBridge provides SQL-friendly transaction handles on top of a KVStore.
Implementations§
Source§impl<S: KVStore> TxnBridge<S>
impl<S: KVStore> TxnBridge<S>
Sourcepub fn runtime_stats(&self) -> Option<RuntimeStats>
pub fn runtime_stats(&self) -> Option<RuntimeStats>
Returns the underlying store’s runtime statistics.
Sourcepub fn set_memory_limit_bytes(&self, limit: Option<usize>) -> CoreResult<()>
pub fn set_memory_limit_bytes(&self, limit: Option<usize>) -> CoreResult<()>
Applies a memory-limit setting to the underlying store.
Sourcepub fn set_cache_capacity_bytes(&self, capacity: usize) -> CoreResult<()>
pub fn set_cache_capacity_bytes(&self, capacity: usize) -> CoreResult<()>
Applies a cache-capacity setting to the underlying store.
Sourcepub fn clear_cache(&self) -> CoreResult<usize>
pub fn clear_cache(&self) -> CoreResult<usize>
Clears the underlying cache.
Sourcepub fn begin_read(&self) -> Result<SqlTransaction<'_, S>>
pub fn begin_read(&self) -> Result<SqlTransaction<'_, S>>
Begin a read-only transaction.
Sourcepub fn begin_write(&self) -> Result<SqlTransaction<'_, S>>
pub fn begin_write(&self) -> Result<SqlTransaction<'_, S>>
Begin a read-write transaction.
pub fn wrap_external<'a, 'b, 'c>( txn: &'a mut S::Transaction<'b>, mode: TxnMode, overlay: &'c mut CatalogOverlay, ) -> BorrowedSqlTransaction<'a, 'b, 'c, S>
Sourcepub fn with_read_txn<R, F>(&self, f: F) -> Result<R>
pub fn with_read_txn<R, F>(&self, f: F) -> Result<R>
Execute a read-only transaction with automatic commit.
The closure receives a SqlTransaction that provides access to table and index storage.
The transaction is automatically committed on success or rolled back on error.
Sourcepub fn with_write_txn<R, F>(&self, f: F) -> Result<R>
pub fn with_write_txn<R, F>(&self, f: F) -> Result<R>
Execute a read-write transaction with automatic commit.
The closure receives a SqlTransaction that provides access to table and index storage.
The transaction is automatically committed on success or rolled back on error.
Sourcepub fn with_write_txn_explicit<R, F>(&self, f: F) -> Result<R>
pub fn with_write_txn_explicit<R, F>(&self, f: F) -> Result<R>
Execute a read-write transaction with explicit commit control.
Returns (result, should_commit) from the closure. If should_commit is true,
the transaction is committed; otherwise it is rolled back.