pub enum TransactionStatement {
Begin {
syntax: TransactionStart,
mode: Option<TransactionModeKind>,
block: Option<TransactionBlockKeyword>,
name: Option<Box<Ident>>,
modes: ThinVec<TransactionMode>,
meta: Meta,
},
Commit {
syntax: TransactionCommitKeyword,
block: Option<TransactionBlockKeyword>,
name: Option<Box<Ident>>,
chain: Option<bool>,
release: Option<bool>,
meta: Meta,
},
Rollback {
syntax: TransactionRollbackKeyword,
block: Option<TransactionBlockKeyword>,
name: Option<Box<Ident>>,
savepoint_keyword: bool,
to_savepoint: Option<Ident>,
chain: Option<bool>,
release: Option<bool>,
meta: Meta,
},
Savepoint {
name: Ident,
meta: Meta,
},
Release {
savepoint_keyword: bool,
savepoint: Ident,
meta: Meta,
},
SetCharacteristics {
modes: ThinVec<TransactionMode>,
meta: Meta,
},
}Expand description
A transaction-control statement (SQL:2016 §17).
The operational statements clients send to bound a transaction: START TRANSACTION (and its near-universal BEGIN alias), COMMIT, ROLLBACK
(optionally rewinding to a savepoint), SAVEPOINT, RELEASE SAVEPOINT, and
SET TRANSACTION characteristics.
One canonical shape per construct. BEGIN and START TRANSACTION
denote the same operation, so they share the Begin shape and a
TransactionStart tag records which spelling was written. The interchangeable
WORK / TRANSACTION block noise words on BEGIN/COMMIT/ROLLBACK carry no
meaning; a TransactionBlockKeyword tag records which (if any) was written so a
source-fidelity render replays it, while a target re-spell and the redacted
fingerprint drop it.
Variants§
Begin
A BEGIN / START TRANSACTION statement.
Fields
syntax: TransactionStartSource spelling used for the syntax.
mode: Option<TransactionModeKind>SQLite’s {DEFERRED | IMMEDIATE | EXCLUSIVE} transaction-mode modifier,
written between BEGIN and the optional TRANSACTION keyword. None
when the dialect does not admit one (or the statement omits it).
block: Option<TransactionBlockKeyword>The optional TRANSACTION / WORK block noise word after BEGIN or
START. None for a bare keyword. Standard START TRANSACTION records
Some(Transaction); dialect data controls whether START may omit the word
or use WORK.
modes: ThinVec<TransactionMode>modes in source order.
Commit
A COMMIT statement.
Fields
syntax: TransactionCommitKeywordSource spelling used for the commit operation.
block: Option<TransactionBlockKeyword>The optional TRANSACTION / WORK block noise word after COMMIT.
Rollback
ROLLBACK [WORK | TRANSACTION] [TO [SAVEPOINT] <name>].
to_savepoint is Some for the savepoint-rewind form and None for a
whole-transaction rollback.
Fields
syntax: TransactionRollbackKeywordSource spelling used for the rollback operation.
block: Option<TransactionBlockKeyword>The optional TRANSACTION / WORK block noise word after ROLLBACK.
savepoint_keyword: boolWhether the optional SAVEPOINT keyword was written before the savepoint
name (ROLLBACK TO SAVEPOINT x vs the bare ROLLBACK TO x). Meaningful
only when to_savepoint is Some; the canonical render emits SAVEPOINT.
chain: Option<bool>Some(true) for AND CHAIN, Some(false) for AND NO CHAIN; only valid for a
whole-transaction rollback.
Savepoint
A SAVEPOINT <name> statement.
Release
A RELEASE [SAVEPOINT] <name> statement.
Fields
SetCharacteristics
SET TRANSACTION <mode> [, ...]: set the current transaction’s
characteristics (distinct from the session SET).
Fields
modes: ThinVec<TransactionMode>modes in source order.
Trait Implementations§
Source§impl Clone for TransactionStatement
impl Clone for TransactionStatement
Source§fn clone(&self) -> TransactionStatement
fn clone(&self) -> TransactionStatement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransactionStatement
impl Debug for TransactionStatement
Source§impl<'de> Deserialize<'de> for TransactionStatement
impl<'de> Deserialize<'de> for TransactionStatement
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for TransactionStatement
Source§impl Hash for TransactionStatement
impl Hash for TransactionStatement
Source§impl PartialEq for TransactionStatement
impl PartialEq for TransactionStatement
Source§impl Render for TransactionStatement
impl Render for TransactionStatement
Source§fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
Source§fn operand_binding_power(&self) -> Option<BindingPower>
fn operand_binding_power(&self) -> Option<BindingPower>
None (the default) for a self-delimiting node — an atom, call, or
constructor — that never needs parentheses. Read moreSource§impl Serialize for TransactionStatement
impl Serialize for TransactionStatement
Source§impl Spanned for TransactionStatement
impl Spanned for TransactionStatement
impl StructuralPartialEq for TransactionStatement
Auto Trait Implementations§
impl Freeze for TransactionStatement
impl RefUnwindSafe for TransactionStatement
impl Send for TransactionStatement
impl Sync for TransactionStatement
impl Unpin for TransactionStatement
impl UnsafeUnpin for TransactionStatement
impl UnwindSafe for TransactionStatement
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DynAstExt for T
impl<T> DynAstExt for T
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&dyn Any for downcasting a node back to its concrete type.Source§fn dyn_clone(&self) -> Box<dyn DynAstExt>
fn dyn_clone(&self) -> Box<dyn DynAstExt>
Clone (whose
Self-returning signature cannot go through a vtable).Source§fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
PartialEq (whose &Self argument cannot go through a vtable). Equal
iff other holds the same concrete type and that type deems the values
equal; differently-typed nodes are never equal.