mirror of
https://github.com/danog/sql.git
synced 2024-11-26 20:15:08 +01:00
TransactionIsolation helper methods
This commit is contained in:
parent
4f5449c828
commit
dcbe6ff712
@ -8,4 +8,24 @@ enum TransactionIsolation
|
|||||||
case Committed;
|
case Committed;
|
||||||
case Repeatable;
|
case Repeatable;
|
||||||
case Serializable;
|
case Serializable;
|
||||||
|
|
||||||
|
public function getLabel(): string
|
||||||
|
{
|
||||||
|
return match ($this) {
|
||||||
|
self::Uncommitted => 'Uncommitted',
|
||||||
|
self::Committed => 'Committed',
|
||||||
|
self::Repeatable => 'Repeatable',
|
||||||
|
self::Serializable => 'Serializable',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toSql(): string
|
||||||
|
{
|
||||||
|
return match ($this) {
|
||||||
|
self::Uncommitted => 'READ UNCOMMITTED',
|
||||||
|
self::Committed => 'READ COMMITTED',
|
||||||
|
self::Repeatable => 'REPEATABLE READ',
|
||||||
|
self::Serializable => 'SERIALIZABLE',
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user