TransactionContext

Trait TransactionContext 

Source
pub trait TransactionContext:
    CatalogDdl
    + Send
    + Sync {
    type Pager: Pager<Blob = EntryHandle> + Send + Sync + 'static;
    type Snapshot: TransactionCatalogSnapshot;

Show 19 methods // Required methods fn set_snapshot(&self, snapshot: TransactionSnapshot); fn snapshot(&self) -> TransactionSnapshot; fn table_column_specs( &self, table_name: &str, ) -> Result<Vec<PlanColumnSpec>, Error>; fn export_table_rows( &self, table_name: &str, ) -> Result<ExecutorRowBatch, Error>; fn get_batches_with_row_ids( &self, table_name: &str, filter: Option<Expr<'static, String>>, ) -> Result<Vec<RecordBatch>, Error>; fn execute_select( &self, plan: SelectPlan, ) -> Result<SelectExecution<Self::Pager>, Error>; fn apply_create_table_plan( &self, plan: CreateTablePlan, ) -> Result<TransactionResult<Self::Pager>, Error>; fn drop_table(&self, plan: DropTablePlan) -> Result<(), Error>; fn insert( &self, plan: InsertPlan, ) -> Result<TransactionResult<Self::Pager>, Error>; fn update( &self, plan: UpdatePlan, ) -> Result<TransactionResult<Self::Pager>, Error>; fn delete( &self, plan: DeletePlan, ) -> Result<TransactionResult<Self::Pager>, Error>; fn truncate( &self, plan: TruncatePlan, ) -> Result<TransactionResult<Self::Pager>, Error>; fn create_index( &self, plan: CreateIndexPlan, ) -> Result<TransactionResult<Self::Pager>, Error>; fn append_batches_with_row_ids( &self, table_name: &str, batches: Vec<RecordBatch>, ) -> Result<usize, Error>; fn table_names(&self) -> Vec<String>; fn table_id(&self, table_name: &str) -> Result<u16, Error>; fn catalog_snapshot(&self) -> Self::Snapshot; // Provided methods fn validate_commit_constraints(&self, _txn_id: u64) -> Result<(), Error> { ... } fn clear_transaction_state(&self, _txn_id: u64) { ... }
}
Expand description

A trait for transaction context operations.

This allows SessionTransaction to work with any context that implements these operations. The associated type Pager specifies the pager type this context uses.

Required Associated Types§

Source

type Pager: Pager<Blob = EntryHandle> + Send + Sync + 'static

The pager type used by this context

Source

type Snapshot: TransactionCatalogSnapshot

Snapshot representation returned by this context.

Required Methods§

Source

fn set_snapshot(&self, snapshot: TransactionSnapshot)

Update the snapshot used for MVCC visibility decisions.

Source

fn snapshot(&self) -> TransactionSnapshot

Get the snapshot currently associated with this context.

Source

fn table_column_specs( &self, table_name: &str, ) -> Result<Vec<PlanColumnSpec>, Error>

Get table column specifications

Source

fn export_table_rows(&self, table_name: &str) -> Result<ExecutorRowBatch, Error>

Export table rows for snapshotting

Source

fn get_batches_with_row_ids( &self, table_name: &str, filter: Option<Expr<'static, String>>, ) -> Result<Vec<RecordBatch>, Error>

Get batches with row IDs for seeding updates

Source

fn execute_select( &self, plan: SelectPlan, ) -> Result<SelectExecution<Self::Pager>, Error>

Execute a SELECT plan with this context’s pager type

Source

fn apply_create_table_plan( &self, plan: CreateTablePlan, ) -> Result<TransactionResult<Self::Pager>, Error>

Create a table from plan

Source

fn drop_table(&self, plan: DropTablePlan) -> Result<(), Error>

Drop a table

Source

fn insert( &self, plan: InsertPlan, ) -> Result<TransactionResult<Self::Pager>, Error>

Insert rows

Source

fn update( &self, plan: UpdatePlan, ) -> Result<TransactionResult<Self::Pager>, Error>

Update rows

Source

fn delete( &self, plan: DeletePlan, ) -> Result<TransactionResult<Self::Pager>, Error>

Delete rows

Source

fn truncate( &self, plan: TruncatePlan, ) -> Result<TransactionResult<Self::Pager>, Error>

Truncate table (delete all rows)

Source

fn create_index( &self, plan: CreateIndexPlan, ) -> Result<TransactionResult<Self::Pager>, Error>

Create an index

Source

fn append_batches_with_row_ids( &self, table_name: &str, batches: Vec<RecordBatch>, ) -> Result<usize, Error>

Append batches with row IDs

Source

fn table_names(&self) -> Vec<String>

Get table names for catalog snapshot

Source

fn table_id(&self, table_name: &str) -> Result<u16, Error>

Get table ID for a given table name (for conflict detection)

Source

fn catalog_snapshot(&self) -> Self::Snapshot

Get an immutable catalog snapshot for transaction isolation

Provided Methods§

Source

fn validate_commit_constraints(&self, _txn_id: u64) -> Result<(), Error>

Validate any pending commit-time constraints for this transaction.

Source

fn clear_transaction_state(&self, _txn_id: u64)

Clear any transaction-scoped state retained by the context.

Implementors§