pub struct StandardCommandTransaction {
pub multi: TransactionMultiVersion,
pub single: TransactionSingleVersion,
/* private fields */
}Expand description
An active command transaction that holds a multi command transaction and provides query/command access to single storage.
The transaction will auto-rollback on drop if not explicitly committed.
Fields§
§multi: TransactionMultiVersion§single: TransactionSingleVersionImplementations§
Source§impl StandardCommandTransaction
impl StandardCommandTransaction
Sourcepub fn new(
multi: TransactionMultiVersion,
single: TransactionSingleVersion,
cdc: TransactionCdc,
event_bus: EventBus,
catalog: MaterializedCatalog,
interceptors: Interceptors<Self>,
) -> Result<Self>
pub fn new( multi: TransactionMultiVersion, single: TransactionSingleVersion, cdc: TransactionCdc, event_bus: EventBus, catalog: MaterializedCatalog, interceptors: Interceptors<Self>, ) -> Result<Self>
Creates a new active command transaction with a pre-commit callback
pub fn event_bus(&self) -> &EventBus
Sourcepub fn commit(&mut self) -> Result<CommitVersion>
pub fn commit(&mut self) -> Result<CommitVersion>
Commit the transaction. Since single transactions are short-lived and auto-commit, this only commits the multi transaction.
Sourcepub fn cdc(&self) -> &TransactionCdc
pub fn cdc(&self) -> &TransactionCdc
Get access to the CDC transaction interface
Sourcepub fn pending_writes(&self) -> &PendingWrites
pub fn pending_writes(&self) -> &PendingWrites
Get access to the pending writes in this transaction
This allows checking for key conflicts when committing FlowTransactions to ensure they operate on non-overlapping keyspaces.
Sourcepub fn with_single_query<F, R>(&self, f: F) -> Result<R>where
F: FnOnce(&mut <TransactionSingleVersion as SingleVersionTransaction>::Query<'_>) -> Result<R>,
pub fn with_single_query<F, R>(&self, f: F) -> Result<R>where
F: FnOnce(&mut <TransactionSingleVersion as SingleVersionTransaction>::Query<'_>) -> Result<R>,
Execute a function with query access to the single transaction.
Sourcepub fn with_single_command<F, R>(&self, f: F) -> Result<R>where
F: FnOnce(&mut <TransactionSingleVersion as SingleVersionTransaction>::Command<'_>) -> Result<R>,
pub fn with_single_command<F, R>(&self, f: F) -> Result<R>where
F: FnOnce(&mut <TransactionSingleVersion as SingleVersionTransaction>::Command<'_>) -> Result<R>,
Execute a function with query access to the single transaction.
Sourcepub fn with_multi_query<F, R>(&self, f: F) -> Result<R>
pub fn with_multi_query<F, R>(&self, f: F) -> Result<R>
Execute a function with a query transaction view. This creates a new query transaction using the stored multi-version storage. The query transaction will operate independently but share the same single/CDC storage.