PostgreSQL result set. More...
#include <userver/storages/postgres/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 psql_typed_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 psql_typed_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 |
PostgreSQL result set.
Provides random access to rows via indexing operations and bidirectional iteration via iterators.
Definition at line 562 of file result_set.hpp.
Definition at line 570 of file result_set.hpp.
Definition at line 571 of file result_set.hpp.
using storages::postgres::ResultSet::difference_type = std::ptrdiff_t |
Definition at line 565 of file result_set.hpp.
Definition at line 575 of file result_set.hpp.
Definition at line 574 of file result_set.hpp.
using storages::postgres::ResultSet::size_type = std::size_t |
Definition at line 564 of file result_set.hpp.
Definition at line 573 of file result_set.hpp.
|
inlineexplicit |
Definition at line 578 of file result_set.hpp.
Container storages::postgres::ResultSet::AsContainer | ( | ) | const |
Extract data into a container. For more information see psql_typed_results.
Definition at line 932 of file result_set.hpp.
Container storages::postgres::ResultSet::AsContainer | ( | RowTag | ) | const |
Definition at line 945 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 psql_typed_results.
Definition at line 903 of file result_set.hpp.
auto storages::postgres::ResultSet::AsSetOf | ( | FieldTag | ) | const |
Definition at line 917 of file result_set.hpp.
auto storages::postgres::ResultSet::AsSetOf | ( | RowTag | ) | const |
Definition at line 908 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 958 of file result_set.hpp.
auto storages::postgres::ResultSet::AsSingleRow | ( | FieldTag | ) | const |
Definition at line 972 of file result_set.hpp.
auto storages::postgres::ResultSet::AsSingleRow | ( | RowTag | ) | const |
Definition at line 963 of file result_set.hpp.
|
inline |
Definition at line 593 of file result_set.hpp.
|
inline |
Definition at line 595 of file result_set.hpp.
|
inline |
Definition at line 633 of file result_set.hpp.
|
inline |
Definition at line 583 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 606 of file result_set.hpp.
|
inline |
Definition at line 608 of file result_set.hpp.
|
friend |
Definition at line 673 of file result_set.hpp.
|
friend |
Definition at line 672 of file result_set.hpp.
|
staticconstexpr |
Definition at line 566 of file result_set.hpp.