#[non_exhaustive]pub enum Isolation {
ReadUncommitted,
ReadCommitted,
RepeatableRead,
Serializable,
}Expand description
A SQL-standard isolation level, as asked for.
keelson accepts a level on an engine only when that engine actually runs
the transaction at it. It never substitutes a neighbouring level and calls
it success — see TxOptions::plan for the per-engine table and the
refusals.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ReadUncommitted
Dirty reads permitted. MySQL only here: PostgreSQL accepts the syntax and runs READ COMMITTED, SQLite has nothing weaker than serializable, and both of those are refused rather than faked.
ReadCommitted
Each statement sees rows committed before it began. PostgreSQL’s default; MySQL supports it; SQLite cannot offer it.
RepeatableRead
A transaction-wide snapshot. MySQL/InnoDB’s default. Same name, two
semantics: PostgreSQL raises a serialization failure when a
transaction writes a row changed since its snapshot, while InnoDB’s
consistent read silently coexists with locking reads and UPDATE
taking the current row — the classic lost-update shape.
Serializable
PostgreSQL: true serializability (predicate locks, 40001 on
conflict). MySQL: REPEATABLE READ with every plain SELECT promoted
to a locking read. SQLite: what you always get.