pub struct SessionTransaction<BaseCtx, StagingCtx>where
BaseCtx: TransactionContext + 'static,
StagingCtx: TransactionContext + 'static,{ /* private fields */ }Expand description
Transaction state for the runtime context.
This struct manages the lifecycle of a single transaction, tracking:
- Operations to replay on commit
- Tables created/dropped/accessed within the transaction
- Foreign key constraints for validation
- Transaction isolation via MVCC snapshots
Implementations§
Source§impl<BaseCtx, StagingCtx> SessionTransaction<BaseCtx, StagingCtx>where
BaseCtx: TransactionContext + 'static,
StagingCtx: TransactionContext + 'static,
impl<BaseCtx, StagingCtx> SessionTransaction<BaseCtx, StagingCtx>where
BaseCtx: TransactionContext + 'static,
StagingCtx: TransactionContext + 'static,
pub fn new( base_context: Arc<BaseCtx>, staging: Arc<StagingCtx>, txn_manager: Arc<TxnIdManager>, ) -> Self
Sourcepub fn execute_select(
&mut self,
plan: SelectPlan,
) -> LlkvResult<SelectExecution<StagingCtx::Pager>>
pub fn execute_select( &mut self, plan: SelectPlan, ) -> LlkvResult<SelectExecution<StagingCtx::Pager>>
Execute a SELECT query within transaction isolation. For tables created in this transaction: read from staging. For existing tables: read from BASE with MVCC visibility filtering.
Sourcepub fn execute_operation(
&mut self,
operation: PlanOperation,
) -> LlkvResult<TransactionResult<StagingCtx::Pager>>
pub fn execute_operation( &mut self, operation: PlanOperation, ) -> LlkvResult<TransactionResult<StagingCtx::Pager>>
Execute an operation in the transaction staging context
Sourcepub fn operations(&self) -> &[PlanOperation]
pub fn operations(&self) -> &[PlanOperation]
Get the operations queued for commit
Auto Trait Implementations§
impl<BaseCtx, StagingCtx> Freeze for SessionTransaction<BaseCtx, StagingCtx>
impl<BaseCtx, StagingCtx> !RefUnwindSafe for SessionTransaction<BaseCtx, StagingCtx>
impl<BaseCtx, StagingCtx> Send for SessionTransaction<BaseCtx, StagingCtx>
impl<BaseCtx, StagingCtx> Sync for SessionTransaction<BaseCtx, StagingCtx>
impl<BaseCtx, StagingCtx> Unpin for SessionTransaction<BaseCtx, StagingCtx>
impl<BaseCtx, StagingCtx> !UnwindSafe for SessionTransaction<BaseCtx, StagingCtx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more