#include <userver/storages/sqlite/options.hpp>
SQLite transaction options.
Definition at line 15 of file options.hpp.
Public Types | |
enum | LockingMode { kDeferred , kImmediate , kExclusive } |
Locking mode for the transaction. More... | |
enum class | IsolationLevel { kSerializable , kReadUncommitted } |
Isolation level for the transaction. More... | |
Public Member Functions | |
constexpr | TransactionOptions (IsolationLevel lvl) |
constexpr | TransactionOptions (IsolationLevel lvl, LockingMode m) |
constexpr | TransactionOptions (LockingMode m) |
Static Public Member Functions | |
static constexpr TransactionOptions | Deferred () |
Creates a TransactionOptions instance with deferred locking mode. | |
Public Attributes | |
IsolationLevel | isolation_level = IsolationLevel::kSerializable |
LockingMode | mode = LockingMode::kDeferred |
|
strong |
Isolation level for the transaction.
SQLite supports limited isolation levels. Note that full support for READ UNCOMMITTED requires shared-cache mode.
Enumerator | |
---|---|
kSerializable | Default isolation level; ensures full isolation. |
kReadUncommitted | Allows reading uncommitted changes; requires shared-cache mode. |
Definition at line 31 of file options.hpp.
Locking mode for the transaction.
Determines how database locks are acquired during the transaction.
Enumerator | |
---|---|
kDeferred | Locks are acquired as needed (default behavior). |
kImmediate | Acquires a reserved lock immediately. |
kExclusive | Acquires an exclusive lock immediately. |
Definition at line 20 of file options.hpp.
|
inlineexplicitconstexpr |
Definition at line 40 of file options.hpp.
|
inlineconstexpr |
Definition at line 41 of file options.hpp.
|
inlineexplicitconstexpr |
Definition at line 42 of file options.hpp.
|
inlinestaticconstexpr |
Creates a TransactionOptions instance with deferred locking mode.
Definition at line 45 of file options.hpp.
IsolationLevel storages::sqlite::settings::TransactionOptions::isolation_level = IsolationLevel::kSerializable |
Definition at line 36 of file options.hpp.
LockingMode storages::sqlite::settings::TransactionOptions::mode = LockingMode::kDeferred |
Definition at line 37 of file options.hpp.