SavepointDialect enum

SQL dialect used to emit SAVEPOINT statements within a transaction.

Different RDBMSs use incompatible syntax for nested savepoints:

  • SQL-92: SAVEPOINT name / ROLLBACK TO SAVEPOINT name / RELEASE SAVEPOINT name (PostgreSQL, MySQL, MariaDB, Oracle, SQLite, Db2, Snowflake, ...).
  • SQL Server: SAVE TRANSACTION name / ROLLBACK TRANSACTION name (no RELEASE — savepoints are released automatically on commit/rollback).

The native engine maps each value to the integer code below before sending it across the FFI boundary.

See also Transaction::begin_with_dialect (Rust) and the B2 fix in v3.1 that closed the gap where Dart could not reach the SQL Server dialect.

Inheritance
Available extensions

Values

auto → const SavepointDialect

Detect the right dialect at runtime by asking the live driver via SQLGetInfo(SQL_DBMS_NAME). SQL Server resolves to sqlServer; every other engine (PostgreSQL, MySQL, MariaDB, Oracle, SQLite, Db2, Snowflake, ...) resolves to sql92.

Recommended default since v3.1: callers no longer need to know which engine they are talking to.

const SavepointDialect(0)
sqlServer → const SavepointDialect

SQL Server / Sybase ASE syntax. Use when the connection is known to be SQL Server (or a Sybase variant that mimics it) and you want to skip the SQLGetInfo round-trip.

const SavepointDialect(1)
sql92 → const SavepointDialect

SQL-92 syntax (PostgreSQL, MySQL, MariaDB, Oracle, SQLite, Db2, Snowflake). Use when the connection is known not to be SQL Server.

const SavepointDialect(2)

Properties

code → int
Stable wire code passed to the native FFI odbc_transaction_begin.
final
hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

values → const List<SavepointDialect>
A constant List of the values in this enum, in order of their declaration.