#include <userver/storages/sqlite/result_set.hpp>
A proxy for statement execution result.
This type can't be constructed in user code and is always retrieved from storages::sqlite::Client, storages::sqlite::Transaction or storages::sqlite::Savepoint methods.
Definition at line 24 of file result_set.hpp.
Public Member Functions | |
ResultSet (impl::ResultWrapperPtr pimpl) | |
ResultSet (const ResultSet &other)=delete | |
ResultSet (ResultSet &&other) noexcept | |
ResultSet & | operator= (ResultSet &&) 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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
ExecutionResult | AsExecutionResult () && |
Get statement execution metadata. | |
std::optional< T > storages::sqlite::ResultSet::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.
Throw exceptions on columns count not being equal to 1 or type mismatch. throws if result set contains more than one row.
Definition at line 163 of file result_set.hpp.
std::optional< T > storages::sqlite::ResultSet::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.
Throw exceptions on columns count mismatch or types mismatch. throws if result set contains more than one row.
Definition at line 150 of file result_set.hpp.
T storages::sqlite::ResultSet::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.
Throw exceptions 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 141 of file result_set.hpp.
T storages::sqlite::ResultSet::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.
Throw exceptions on columns count mismatch or types mismatch. throws if result set is empty or contains more than one row.
Definition at line 132 of file result_set.hpp.
std::vector< T > storages::sqlite::ResultSet::AsVector | ( | ) | && |
Parse statement result set as std::vector<T>. T is expected to be an aggregate of supported types.
Throw exceptions on columns count mismatch or types mismatch.
Definition at line 118 of file result_set.hpp.
std::vector< T > storages::sqlite::ResultSet::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.
Throw exceptions on columns count not being equal to 1 or type mismatch.
Definition at line 125 of file result_set.hpp.
|
friend |
Definition at line 108 of file result_set.hpp.