#include <userver/storages/postgres/result_set.hpp>
PostgreSQL result set.
Provides random access to rows via indexing operations and bidirectional iteration via iterators.
Definition at line 200 of file result_set.hpp.
Public Types | |
using | size_type = std::size_t |
using | difference_type = std::ptrdiff_t |
Public Member Functions | |
Forward iteration | |
const_iterator | cbegin () const & |
const_iterator | begin () const & |
const_iterator | cend () const & |
const_iterator | end () const & |
const_iterator | cbegin () const &&=delete |
const_iterator | begin () const &&=delete |
const_iterator | cend () const &&=delete |
const_iterator | end () const &&=delete |
Reverse iteration | |
const_reverse_iterator | crbegin () const & |
const_reverse_iterator | rbegin () const & |
const_reverse_iterator | crend () const & |
const_reverse_iterator | rend () const & |
const_reverse_iterator | crbegin () const &&=delete |
const_reverse_iterator | rbegin () const &&=delete |
const_reverse_iterator | crend () const &&=delete |
const_reverse_iterator | rend () const &&=delete |
reference | Front () const & |
reference | Back () const & |
reference | Front () const &&=delete |
reference | Back () const &&=delete |
reference | operator[] (size_type index) const & |
Access a row by index. | |
reference | operator[] (size_type index) const &&=delete |
ResultSet metadata access | |
size_type | FieldCount () const |
RowDescription | GetRowDescription () const & |
RowDescription | GetRowDescription () const &&=delete |
Static Public Attributes | |
static constexpr size_type | npos = std::numeric_limits<size_type>::max() |
Row container concept | |
using | const_iterator = ConstRowIterator |
using | const_reverse_iterator = ReverseConstRowIterator |
using | value_type = Row |
using | reference = value_type |
using | pointer = const_iterator |
ResultSet (std::shared_ptr< detail::ResultWrapper > pimpl) | |
size_type | Size () const |
Number of rows in the result set. | |
bool | IsEmpty () const |
size_type | RowsAffected () const |
std::string | CommandStatus () const |
Typed results | |
template<typename T, typename Tag> | |
class | TypedResultSet |
class | ConnectionImpl |
template<typename T> | |
auto | AsSetOf () const |
Get a wrapper for iterating over a set of typed results. For more information see uPg: Typed PostgreSQL results. | |
template<typename T> | |
auto | AsSetOf (RowTag) const |
template<typename T> | |
auto | AsSetOf (FieldTag) const |
template<typename Container> | |
Container | AsContainer () const |
Extract data into a container. For more information see uPg: Typed PostgreSQL results. | |
template<typename Container> | |
Container | AsContainer (RowTag) const |
template<typename T> | |
auto | AsSingleRow () const |
Extract first row into user type. A single row result set is expected, will throw an exception when result set size != 1. | |
template<typename T> | |
auto | AsSingleRow (RowTag) const |
template<typename T> | |
auto | AsSingleRow (FieldTag) const |
template<typename T> | |
std::optional< T > | AsOptionalSingleRow () const |
Extract first row into user type. | |
template<typename T> | |
std::optional< T > | AsOptionalSingleRow (RowTag) const |
template<typename T> | |
std::optional< T > | AsOptionalSingleRow (FieldTag) const |
Definition at line 208 of file result_set.hpp.
Definition at line 209 of file result_set.hpp.
using storages::postgres::ResultSet::difference_type = std::ptrdiff_t |
Definition at line 203 of file result_set.hpp.
Definition at line 213 of file result_set.hpp.
Definition at line 212 of file result_set.hpp.
using storages::postgres::ResultSet::size_type = std::size_t |
Definition at line 202 of file result_set.hpp.
Definition at line 211 of file result_set.hpp.
|
inlineexplicit |
Definition at line 216 of file result_set.hpp.
Container storages::postgres::ResultSet::AsContainer | ( | ) | const |
Extract data into a container. For more information see uPg: Typed PostgreSQL results.
Definition at line 351 of file result_set.hpp.
Container storages::postgres::ResultSet::AsContainer | ( | RowTag | ) | const |
Definition at line 370 of file result_set.hpp.
std::optional< T > storages::postgres::ResultSet::AsOptionalSingleRow | ( | ) | const |
Extract first row into user type.
exception | when result set size > 1 |
Definition at line 412 of file result_set.hpp.
std::optional< T > storages::postgres::ResultSet::AsOptionalSingleRow | ( | FieldTag | ) | const |
Definition at line 422 of file result_set.hpp.
std::optional< T > storages::postgres::ResultSet::AsOptionalSingleRow | ( | RowTag | ) | const |
Definition at line 417 of file result_set.hpp.
auto storages::postgres::ResultSet::AsSetOf | ( | ) | const |
Get a wrapper for iterating over a set of typed results. For more information see uPg: Typed PostgreSQL results.
Definition at line 327 of file result_set.hpp.
auto storages::postgres::ResultSet::AsSetOf | ( | FieldTag | ) | const |
Definition at line 340 of file result_set.hpp.
auto storages::postgres::ResultSet::AsSetOf | ( | RowTag | ) | const |
Definition at line 332 of file result_set.hpp.
auto storages::postgres::ResultSet::AsSingleRow | ( | ) | const |
Extract first row into user type. A single row result set is expected, will throw an exception when result set size != 1.
Definition at line 389 of file result_set.hpp.
auto storages::postgres::ResultSet::AsSingleRow | ( | FieldTag | ) | const |
Definition at line 403 of file result_set.hpp.
auto storages::postgres::ResultSet::AsSingleRow | ( | RowTag | ) | const |
Definition at line 394 of file result_set.hpp.
|
inline |
Definition at line 230 of file result_set.hpp.
|
inline |
Definition at line 232 of file result_set.hpp.
|
inline |
Definition at line 270 of file result_set.hpp.
|
inline |
Definition at line 220 of file result_set.hpp.
reference storages::postgres::ResultSet::operator[] | ( | size_type | index | ) | const & |
Access a row by index.
RowIndexOutOfBounds | if index is out of bounds |
|
inline |
Definition at line 243 of file result_set.hpp.
|
inline |
Definition at line 245 of file result_set.hpp.
|
friend |
Definition at line 321 of file result_set.hpp.
|
friend |
Definition at line 320 of file result_set.hpp.
|
staticconstexpr |
Definition at line 204 of file result_set.hpp.