#include </data/code/userver/mysql/include/userver/storages/mysql/statement_result_set.hpp>
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 > | |
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 > | |
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. | |
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 276 of file statement_result_set.hpp.
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 285 of file statement_result_set.hpp.
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.
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.
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.
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.
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 266 of file statement_result_set.hpp.
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 271 of file statement_result_set.hpp.
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 397 of file statement_result_set.hpp.
|
friend |
Definition at line 177 of file statement_result_set.hpp.
|
friend |
Definition at line 180 of file statement_result_set.hpp.