Skip to main content

TransactionSyntax

Struct TransactionSyntax 

Source
pub struct TransactionSyntax {
Show 26 fields pub start_transaction: bool, pub start_transaction_block_optional: bool, pub transaction_work_keyword: bool, pub begin_transaction_keyword: bool, pub commit_transaction_keyword: bool, pub rollback_transaction_keyword: bool, pub transaction_name: bool, pub begin_transaction_modes: bool, pub transaction_savepoints: bool, pub set_transaction: bool, pub transaction_isolation_mode: bool, pub transaction_access_mode: bool, pub transaction_deferrable_mode: bool, pub start_transaction_isolation_mode: bool, pub start_transaction_deferrable_mode: bool, pub start_transaction_consistent_snapshot: bool, pub transaction_multiple_modes: bool, pub transaction_modes_require_commas: bool, pub transaction_modes_reject_duplicates: bool, pub abort_transaction_alias: bool, pub end_transaction_alias: bool, pub transaction_release: bool, pub transaction_chain: bool, pub release_savepoint_keyword_optional: bool, pub begin_transaction_mode: bool, pub xa_transactions: bool,
}
Expand description

Dialect-owned transaction-control (TCL) syntax accepted by the parser.

Transaction openers, completers, savepoints, mode lists, and XA distributed-transaction forms — the SQL transaction-control family. Split out of UtilitySyntax so utility statement-head gates (COPY/PRAGMA/SHOW siblings) are not mixed with TCL grammar and narrowing validators. Statement-head flags that open TCL statements (start_transaction, set_transaction, xa_transactions, …) are still consumed by parser::statement_dispatch / parser::tcl; mode-list validators are read by the TCL body parser.

Fields§

§start_transaction: bool

Accept the standard START TRANSACTION transaction opener. Some engines, notably SQLite, expose only BEGIN and reject the START spelling.

§start_transaction_block_optional: bool

Accept START [TRANSACTION | WORK] with the transaction block word omitted or spelled WORK. When off, the standard START TRANSACTION spelling remains mandatory. DuckDB accepts all three spellings; PostgreSQL requires TRANSACTION after START.

§transaction_work_keyword: bool

Accept WORK as the optional transaction block word on BEGIN, COMMIT, and ROLLBACK. START WORK is controlled by start_transaction_block_optional.

§begin_transaction_keyword: bool

Accept TRANSACTION as the optional block word after BEGIN.

§commit_transaction_keyword: bool

Accept TRANSACTION as the optional block word after COMMIT.

§rollback_transaction_keyword: bool

Accept TRANSACTION as the optional block word after ROLLBACK.

§transaction_name: bool

Accept SQLite’s optional transaction name immediately after an explicit TRANSACTION block word (BEGIN TRANSACTION name, COMMIT TRANSACTION name, or ROLLBACK TRANSACTION name).

§begin_transaction_modes: bool

Accept a standard transaction-mode list after BEGIN [WORK | TRANSACTION].

§transaction_savepoints: bool

Accept transaction savepoint statements: SAVEPOINT, RELEASE, and ROLLBACK TO. This controls the complete savepoint statement family.

§set_transaction: bool

Accept SET TRANSACTION <mode> [, ...].

§transaction_isolation_mode: bool

Accept ISOLATION LEVEL <level> in a transaction mode list.

§transaction_access_mode: bool

Accept READ ONLY / READ WRITE in a transaction mode list.

§transaction_deferrable_mode: bool

Accept DEFERRABLE / NOT DEFERRABLE in a transaction mode list.

§start_transaction_isolation_mode: bool

Accept ISOLATION LEVEL <level> after START TRANSACTION. When off, the isolation form can remain available to SET TRANSACTION.

§start_transaction_deferrable_mode: bool

Accept [NOT] DEFERRABLE after START TRANSACTION. When off, the form can remain available to SET TRANSACTION.

§start_transaction_consistent_snapshot: bool

Accept MySQL’s WITH CONSISTENT SNAPSHOT START TRANSACTION characteristic.

§transaction_multiple_modes: bool

Accept more than one transaction mode, separated by an optional comma.

§transaction_modes_require_commas: bool

ON rejects a missing comma between adjacent transaction modes (MySQL). PostgreSQL permits bare whitespace between modes when this is off.

§transaction_modes_reject_duplicates: bool

ON rejects a repeated transaction-mode kind in one list (MySQL: each characteristic category at most once).

§abort_transaction_alias: bool

Accept ABORT as an exact ROLLBACK synonym.

§end_transaction_alias: bool

Accept END as an exact COMMIT synonym.

§transaction_release: bool

Accept MySQL’s COMMIT|ROLLBACK [NO] RELEASE completion modifier.

§transaction_chain: bool

Accept COMMIT AND [NO] CHAIN and whole-transaction ROLLBACK AND [NO] CHAIN. PostgreSQL and SQL-standard transaction chaining; off where the engine grammar lacks it.

§release_savepoint_keyword_optional: bool

Accept RELEASE <name> without the SAVEPOINT keyword. When off, RELEASE SAVEPOINT <name> remains available with transaction savepoints.

§begin_transaction_mode: bool

Accept SQLite’s {DEFERRED | IMMEDIATE | EXCLUSIVE} transaction-mode modifier between BEGIN and the optional TRANSACTION keyword (stored on TransactionStatement::Begin’s mode field). On for SQLite/Lenient; off elsewhere. PostgreSQL’s BEGIN takes its own, differently-shaped modifier set (ISOLATION LEVEL … / READ ONLY|WRITE / [NOT] DEFERRABLE, the existing TransactionMode list), deliberately not modelled here, so it stays off there and the leading modifier keyword falls through to today’s error (engine-probed: pg_query rejects BEGIN DEFERRED/BEGIN IMMEDIATE/BEGIN EXCLUSIVE).

§xa_transactions: bool

Accept the MySQL XA distributed-transaction family — XA {START | BEGIN} xid [JOIN | RESUME], XA END xid [SUSPEND [FOR MIGRATE]], XA PREPARE xid, XA COMMIT xid [ONE PHASE], XA ROLLBACK xid, and XA RECOVER [CONVERT XID] (the X/Open two-phase-commit verbs; sql_yacc.yy xa:). One flag gates the whole family because it is a single dialect unit reached through one unique leading XA keyword (the kill leading-keyword-gate precedent, not a keyword shared with another dialect). On for MySQL and the Lenient superset (a pure addition there — no other dialect claims XA); off elsewhere, where the leading XA keyword is not dispatched and surfaces as an unknown statement. Live mysql:8.4.10: every grammar-valid form answers ER_UNSUPPORTED_PS 1295 (recognized, not preparable over the wire). See XaStatement.

Implementations§

Source§

impl TransactionSyntax

Source

pub const ANSI: Self

Transaction-control surface for the ANSI preset (split from UtilitySyntax).

Source§

impl TransactionSyntax

Source

pub const DATABRICKS: Self

Available on crate feature databricks only.

Transaction-control surface for the DATABRICKS preset (split from UtilitySyntax).

Source§

impl TransactionSyntax

Source

pub const DUCKDB: Self

Available on crate feature duckdb only.

Transaction-control surface for the DUCKDB preset (split from UtilitySyntax).

Source§

impl TransactionSyntax

Source

pub const LENIENT: Self

Available on crate feature lenient only.

Transaction-control surface for the LENIENT preset (split from UtilitySyntax).

Source§

impl TransactionSyntax

Source

pub const MYSQL: Self

Available on crate feature mysql only.

Transaction-control surface for the MYSQL preset (split from UtilitySyntax).

Source§

impl TransactionSyntax

Source

pub const POSTGRES: Self

Available on crate feature postgres only.

Transaction-control surface for the POSTGRES preset (split from UtilitySyntax).

Source§

impl TransactionSyntax

Source

pub const QUILTDB: Self

Available on crate feature quiltdb only.

Transaction-control surface for the QUILTDB preset (split from UtilitySyntax).

Source§

impl TransactionSyntax

Source

pub const SNOWFLAKE: Self

Available on crate feature snowflake only.

Transaction-control surface for the SNOWFLAKE preset (split from UtilitySyntax).

Source§

impl TransactionSyntax

Source

pub const SQLITE: Self

Available on crate feature sqlite only.

Transaction-control surface for the SQLITE preset (split from UtilitySyntax).

Trait Implementations§

Source§

impl Clone for TransactionSyntax

Source§

fn clone(&self) -> TransactionSyntax

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for TransactionSyntax

Source§

impl Debug for TransactionSyntax

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for TransactionSyntax

Source§

impl PartialEq for TransactionSyntax

Source§

fn eq(&self, other: &TransactionSyntax) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TransactionSyntax

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.