userver: ydb::Transaction Class Reference
Loading...
Searching...
No Matches
ydb::Transaction Class Referencefinal

#include <userver/ydb/transaction.hpp>

Detailed Description

Public Member Functions

 Transaction (Transaction &&) noexcept=default
 
 Transaction (const Transaction &)=delete
 
Transactionoperator= (Transaction &&)=delete
 
Transactionoperator= (const Transaction &)=delete
 
void Commit (OperationSettings settings={})
 
void Rollback ()
 
PreparedArgsBuilder GetBuilder () const
 
template<typename... Args>
ExecuteResponse Execute (const Query &query, Args &&... args)
 
template<typename... Args>
ExecuteResponse Execute (OperationSettings settings, const Query &query, Args &&... args)
 
ExecuteResponse Execute (OperationSettings settings, const Query &query, PreparedArgsBuilder &&builder)
 
ExecuteResponse Execute (QuerySettings query_settings, OperationSettings settings, const Query &query, PreparedArgsBuilder &&builder)
 

Member Function Documentation

◆ Commit()

void ydb::Transaction::Commit ( OperationSettings settings = {})

Commit the transaction. The options that are missing in settings are taken from the static config or driver defaults. settings can be overridden by dynamic config's options for Commit "query".

◆ Execute() [1/2]

template<typename... Args>
ExecuteResponse ydb::Transaction::Execute ( const Query & query,
Args &&... args )

Execute a single data query as a part of the transaction. Query parameters are passed in Args as "string key - value" pairs:

client.ExecuteDataQuery(query, "name1", value1, "name2", value2, ...);

Use ydb::PreparedArgsBuilder for storing a generic buffer of query params if needed.

Definition at line 93 of file transaction.hpp.

◆ Execute() [2/2]

template<typename... Args>
ExecuteResponse ydb::Transaction::Execute ( OperationSettings settings,
const Query & query,
Args &&... args )

Definition at line 100 of file transaction.hpp.

◆ Rollback()

void ydb::Transaction::Rollback ( )

Rollback the transaction. The operation settings are taken from Begin settings.


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