userver: storages::mysql::MappedStatementResultSet< DbType > Class Template Reference
Loading...
Searching...
No Matches
storages::mysql::MappedStatementResultSet< DbType > Class Template Reference

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

Detailed Description

template<typename DbType>
class storages::mysql::MappedStatementResultSet< DbType >

An interface for on-the-flight mapping statement result set from DbType into whatever type you provide without additional allocations.

DbType is expected to be either an aggregate of supported types or a supported type itself for methods taking FieldTag; DbType is expected to match DB representation - same amount of columns (1 for FieldTag overload) and matching types.

You are expected to provide a converter function T Convert(DbType&&, storages::mysql::convert:To<T>) in either T's namespace or storages::mysql::convert namespace

Definition at line 204 of file statement_result_set.hpp.

Public Member Functions

 MappedStatementResultSet (StatementResultSet &&result_set)
 
template<typename T >
std::vector< T > AsVector () &&
 Parse statement result set as std::vector<T> using provided converter function. 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> using provided converter function. See MySQL supported types for supported types.
 
template<typename Container >
Container AsContainer () &&
 Parse statement result set as Container<T> using provided converter function. See MySQL supported types for better understanding of Container::value_type requirements.
 
template<typename Container >
Container AsContainer (FieldTag) &&
 Parse statement result set as Container<T> using provided converter function. See MySQL supported types for supported types.
 
template<typename T >
AsSingleRow () &&
 
template<typename T >
std::optional< T > AsOptionalSingleRow () &&
 

Constructor & Destructor Documentation

◆ MappedStatementResultSet()

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

Definition at line 361 of file statement_result_set.hpp.

Member Function Documentation

◆ AsContainer() [1/2]

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

Parse statement result set as Container<T> using provided converter function. See MySQL supported types for better understanding of Container::value_type requirements.

UINVARIANTs on columns count mismatch or types mismatch for DbType.

Definition at line 381 of file statement_result_set.hpp.

◆ AsContainer() [2/2]

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

Parse statement result set as Container<T> using provided converter function. See MySQL supported types for supported types.

UINVARIANTs on columns count not being 1 or types mismatch for DbType.

Definition at line 387 of file statement_result_set.hpp.

◆ AsOptionalSingleRow()

template<typename DbType >
template<typename T >
std::optional< T > storages::mysql::MappedStatementResultSet< DbType >::AsOptionalSingleRow ( ) &&
inline

Definition at line 255 of file statement_result_set.hpp.

◆ AsSingleRow()

template<typename DbType >
template<typename T >
T storages::mysql::MappedStatementResultSet< DbType >::AsSingleRow ( ) &&
inline

Definition at line 246 of file statement_result_set.hpp.

◆ AsVector() [1/2]

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

Parse statement result set as std::vector<T> using provided converter function. See MySQL supported types for better understanding of T requirements.

UINVARIANTs on columns count mismatch or types mismatch for DbType.

Definition at line 369 of file statement_result_set.hpp.

◆ AsVector() [2/2]

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

Parse statement result set as std::vector<T> using provided converter function. See MySQL supported types for supported types.

UINVARIANTs on columns count not being 1 or types mismatch for DbType.

Definition at line 375 of file statement_result_set.hpp.


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