userver: storages::sqlite::settings::TransactionOptions Struct Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
storages::sqlite::settings::TransactionOptions Struct Reference

#include <userver/storages/sqlite/options.hpp>

Detailed Description

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
 

Member Enumeration Documentation

◆ IsolationLevel

Isolation level for the transaction.

SQLite supports limited isolation levels. Note that full support for READ UNCOMMITTED requires shared-cache mode.

See also
https://www.sqlite.org/isolation.html
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.

◆ LockingMode

Locking mode for the transaction.

Determines how database locks are acquired during the transaction.

See also
https://www.sqlite.org/lang_transaction.html
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.

Constructor & Destructor Documentation

◆ TransactionOptions() [1/3]

storages::sqlite::settings::TransactionOptions::TransactionOptions ( IsolationLevel lvl)
inlineexplicitconstexpr

Definition at line 40 of file options.hpp.

◆ TransactionOptions() [2/3]

storages::sqlite::settings::TransactionOptions::TransactionOptions ( IsolationLevel lvl,
LockingMode m )
inlineconstexpr

Definition at line 41 of file options.hpp.

◆ TransactionOptions() [3/3]

storages::sqlite::settings::TransactionOptions::TransactionOptions ( LockingMode m)
inlineexplicitconstexpr

Definition at line 42 of file options.hpp.

Member Function Documentation

◆ Deferred()

static constexpr TransactionOptions storages::sqlite::settings::TransactionOptions::Deferred ( )
inlinestaticconstexpr

Creates a TransactionOptions instance with deferred locking mode.

Definition at line 45 of file options.hpp.

Member Data Documentation

◆ isolation_level

IsolationLevel storages::sqlite::settings::TransactionOptions::isolation_level = IsolationLevel::kSerializable

Definition at line 36 of file options.hpp.

◆ mode

LockingMode storages::sqlite::settings::TransactionOptions::mode = LockingMode::kDeferred

Definition at line 37 of file options.hpp.


The documentation for this struct was generated from the following file: