userver: storages::mysql::StatementResultSet Class Reference
Loading...
Searching...
No Matches
storages::mysql::StatementResultSet Class Referencefinal

#include </data/code/userver/mysql/include/userver/storages/mysql/statement_result_set.hpp>

Detailed Description

A wrapper for statement execution result.

This type can't be constructed in user code and is always retrieved from storages::mysql::Cluster or storages::mysql::Transaction methods.

Definition at line 37 of file statement_result_set.hpp.

Public Member Functions

 StatementResultSet (impl::StatementFetcher &&fetcher, tracing::Span &&span)
 
 StatementResultSet (infra::ConnectionPtr &&connection, impl::StatementFetcher &&fetcher, tracing::Span &&span)
 
 StatementResultSet (const StatementResultSet &other)=delete
 
 StatementResultSet (StatementResultSet &&other) noexcept
 
template<typename T >
std::vector< T > AsVector () &&
 Parse statement result set as std::vector<T>. T is expected to be an aggregate of supported types. See MySQL supported types for better understanding of T requirements.
 
template<typename T >
std::vector< T > AsVector (FieldTag) &&
 Parse statement result set as std::vector<T>. Result set is expected to have a single column, T is expected to be one of supported types. See MySQL supported types for supported typed.
 
template<typename Container >
Container AsContainer () &&
 Parse statement result set as Container<T>. T is expected to be an aggregate of supported types, Container is expected to meet std::Container requirements. See MySQL supported types for better understanding of Container::value_type requirements.
 
template<typename Container >
Container AsContainer (FieldTag) &&
 Parse statement result as Container<T>. Result set is expected to have a single column, T is expected to be one of supported types, Container is expected to meed std::Container requirements. See MySQL supported types for supported types.
 
template<typename T >
AsSingleRow () &&
 Parse statement result as T. Result set is expected to have a single row, T is expected to be an aggregate of supported types. See MySQL supported types for better understanding of T requirements.
 
template<typename T >
AsSingleField () &&
 Parse statement result as T. Result set is expected to have a single row and a single column, T is expected to be one of supported types. See MySQL supported types for supported types.
 
template<typename T >
std::optional< T > AsOptionalSingleRow () &&
 Parse statement result as std::optional<T>. Result set is expected to have not more than one row, T is expected to be an aggregate of supported types. See MySQL supported types for better understanding of T requirements.
 
template<typename T >
std::optional< T > AsOptionalSingleField () &&
 Parse statement result as T. Result set is expected to have not more than one row, T is expected to be one of supported types. See MySQL supported types for supported types.
 
template<typename DbType >
MappedStatementResultSet< DbType > MapFrom () &&
 Converts to an interface for on-the-flight mapping statement result set from DbType. DbType is expected to be an aggregate of supported types. See MySQL supported types for better understanding of DbType requirements.
 
ExecutionResult AsExecutionResult () &&
 Get statement execution metadata.
 

Member Function Documentation

◆ AsContainer() [1/2]

template<typename Container >
Container storages::mysql::StatementResultSet::AsContainer ( ) &&

Parse statement result set as Container<T>. T is expected to be an aggregate of supported types, Container is expected to meet std::Container requirements. See MySQL supported types for better understanding of Container::value_type requirements.

UINVARIANTs on columns count mismatch or types mismatch.

Definition at line 278 of file statement_result_set.hpp.

◆ AsContainer() [2/2]

template<typename Container >
Container storages::mysql::StatementResultSet::AsContainer ( FieldTag ) &&

Parse statement result as Container<T>. Result set is expected to have a single column, T is expected to be one of supported types, Container is expected to meed std::Container requirements. See MySQL supported types for supported types.

UINVARIANTs on columns count not being equal to 1 or type mismatch.

Definition at line 286 of file statement_result_set.hpp.

◆ AsOptionalSingleField()

template<typename T >
std::optional< T > storages::mysql::StatementResultSet::AsOptionalSingleField ( ) &&

Parse statement result as T. Result set is expected to have not more than one row, T is expected to be one of supported types. See MySQL supported types for supported types.

UINVARIANTs on columns count not being equal to 1 or type mismatch. throws if result set contains more than one row.

Definition at line 321 of file statement_result_set.hpp.

◆ AsOptionalSingleRow()

template<typename T >
std::optional< T > storages::mysql::StatementResultSet::AsOptionalSingleRow ( ) &&

Parse statement result as std::optional<T>. Result set is expected to have not more than one row, T is expected to be an aggregate of supported types. See MySQL supported types for better understanding of T requirements.

UINVARIANTs on columns count mismatch or types mismatch. throws if result set contains more than one row.

Definition at line 316 of file statement_result_set.hpp.

◆ AsSingleField()

template<typename T >
T storages::mysql::StatementResultSet::AsSingleField ( ) &&

Parse statement result as T. Result set is expected to have a single row and a single column, T is expected to be one of supported types. See MySQL supported types for supported types.

UINVARIANTs on columns count not being equal to 1 or type mismatch. throws if result set is empty of contains more than one row.

Definition at line 305 of file statement_result_set.hpp.

◆ AsSingleRow()

template<typename T >
T storages::mysql::StatementResultSet::AsSingleRow ( ) &&

Parse statement result as T. Result set is expected to have a single row, T is expected to be an aggregate of supported types. See MySQL supported types for better understanding of T requirements.

UINVARIANTs on columns count mismatch or types mismatch. throws if result set is empty or contains more than one row.

Definition at line 294 of file statement_result_set.hpp.

◆ AsVector() [1/2]

template<typename T >
std::vector< T > storages::mysql::StatementResultSet::AsVector ( ) &&

Parse statement result set as std::vector<T>. T is expected to be an aggregate of supported types. See MySQL supported types for better understanding of T requirements.

UINVARIANTs on columns count mismatch or types mismatch.

Definition at line 268 of file statement_result_set.hpp.

◆ AsVector() [2/2]

template<typename T >
std::vector< T > storages::mysql::StatementResultSet::AsVector ( FieldTag ) &&

Parse statement result set as std::vector<T>. Result set is expected to have a single column, T is expected to be one of supported types. See MySQL supported types for supported typed.

UINVARIANTs on columns count not being equal to 1 or type mismatch.

Definition at line 273 of file statement_result_set.hpp.

◆ MapFrom()

template<typename DbType >
MappedStatementResultSet< DbType > storages::mysql::StatementResultSet::MapFrom ( ) &&

Converts to an interface for on-the-flight mapping statement result set from DbType. DbType is expected to be an aggregate of supported types. See MySQL supported types for better understanding of DbType requirements.

Definition at line 392 of file statement_result_set.hpp.

Friends And Related Symbol Documentation

◆ CursorResultSet

template<typename T >
friend class CursorResultSet
friend

Definition at line 175 of file statement_result_set.hpp.

◆ MappedStatementResultSet

template<typename DbType >
friend class MappedStatementResultSet
friend

Definition at line 178 of file statement_result_set.hpp.


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