pub enum IsolationLevel {
ReadUncommitted,
ReadCommitted,
RepeatableRead,
Serializable,
}Expand description
v7.38 轴 4 — PG-standard isolation levels. SPG accepts all four
at parse time and tracks the selected value on the engine. The
actual semantic differentiation (REPEATABLE READ snapshot,
SERIALIZABLE SSI) lands in the v7.38 isolation framework train;
today every level reads as effective READ COMMITTED (which is
also how PG treats READ UNCOMMITTED — it silently upgrades to
READ COMMITTED). Default = ReadCommitted.
Variants§
Implementations§
Source§impl IsolationLevel
impl IsolationLevel
Sourcepub fn from_pg_name(name: &str) -> Option<Self>
pub fn from_pg_name(name: &str) -> Option<Self>
Canonical PG-style display name, as SHOW transaction_isolation
would return it. v7.39 (round 770, F31 tranche 6 #154) — PG
KEEPS the “read uncommitted” label (measured: BEGIN ISOLATION LEVEL READ UNCOMMITTED; SHOW transaction_isolation answers
read uncommitted) and only BEHAVES as read committed; the old
fold renamed the label too.
v7.39 — the MySQL display name, which is NOT the PG one: MySQL
hyphenates and upper-cases. Measured on MySQL 9.7.2 by setting
each level and reading @@transaction_isolation back:
READ-UNCOMMITTED / READ-COMMITTED / REPEATABLE-READ /
SERIALIZABLE (the last has no hyphen because it is one word).
This exists so the two MySQL surfaces cannot drift: both
SHOW VARIABLES and @@transaction_isolation used to carry
their own hard-coded literal, and the literals disagreed —
one said REPEATABLE-READ while the engine ran read committed.
v7.39 — parse what default_transaction_isolation holds. PG
accepts the SQL spellings and stores them lower-cased with a
space; anything else is not a level this understands and the
caller keeps its own default rather than guessing.
pub fn as_mysql_str(self) -> &'static str
pub fn as_pg_str(self) -> &'static str
Trait Implementations§
Source§impl Clone for IsolationLevel
impl Clone for IsolationLevel
Source§fn clone(&self) -> IsolationLevel
fn clone(&self) -> IsolationLevel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more