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