libpqxx
7.1.2
|
Result set containing data returned by a query or command. More...
#include <result.hxx>
Public Types | |
using | size_type = result_size_type |
using | difference_type = result_difference_type |
using | reference = row |
using | const_iterator = const_result_iterator |
using | pointer = const_iterator |
using | iterator = const_iterator |
using | const_reverse_iterator = const_reverse_result_iterator |
using | reverse_iterator = const_reverse_iterator |
Public Member Functions | |
result () noexcept | |
result (result const &rhs) noexcept=default | |
result & | operator= (result const &rhs) noexcept=default |
template<typename... TYPE> | |
auto | iter () const |
Iterate rows, reading them directly into a tuple of "TYPE...". More... | |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | crbegin () const |
const_reverse_iterator | rend () const |
const_reverse_iterator | crend () const |
const_iterator | begin () const noexcept |
const_iterator | cbegin () const noexcept |
const_iterator | end () const noexcept |
const_iterator | cend () const noexcept |
reference | front () const noexcept |
reference | back () const noexcept |
PQXX_PURE size_type | size () const noexcept |
PQXX_PURE bool | empty () const noexcept |
size_type | capacity () const noexcept |
void | swap (result &) noexcept |
row | operator[] (size_type i) const noexcept |
row | at (size_type) const |
void | clear () noexcept |
PQXX_PURE std::string const & | query () const noexcept |
Query that produced this result, if available (empty string otherwise) More... | |
PQXX_PURE oid | inserted_oid () const |
If command was INSERT of 1 row, return oid of inserted row. More... | |
PQXX_PURE size_type | affected_rows () const |
Comparisons | |
bool | operator== (result const &) const noexcept |
bool | operator!= (result const &rhs) const noexcept |
Column information | |
PQXX_PURE row_size_type | columns () const noexcept |
Number of columns in result. More... | |
row_size_type | column_number (char const col_name[]) const |
Number of given column (throws exception if it doesn't exist). More... | |
row_size_type | column_number (std::string const &name) const |
Number of given column (throws exception if it doesn't exist). More... | |
row_size_type | column_number (zview name) const |
Number of given column (throws exception if it doesn't exist). More... | |
char const * | column_name (row_size_type number) const |
Name of column with this number (throws exception if it doesn't exist) More... | |
oid | column_type (row_size_type col_num) const |
Return column's type, as an OID from the system catalogue. More... | |
template<typename STRING > | |
oid | column_type (STRING col_name) const |
Return column's type, as an OID from the system catalogue. More... | |
oid | column_table (row_size_type col_num) const |
What table did this column come from? More... | |
template<typename STRING > | |
oid | column_table (STRING col_name) const |
What table did this column come from? More... | |
row_size_type | table_column (row_size_type col_num) const |
What column in its table did this column come from? More... | |
template<typename STRING > | |
row_size_type | table_column (STRING col_name) const |
What column in its table did this column come from? More... | |
Friends | |
class | pqxx::internal::gate::result_pipeline |
class | pqxx::field |
class | pqxx::internal::gate::result_creation |
class | pqxx::internal::gate::result_connection |
class | pqxx::internal::gate::result_row |
class | pqxx::internal::gate::result_sql_cursor |
Result set containing data returned by a query or command.
This behaves as a container (as defined by the C++ standard library) and provides random access const iterators to iterate over its rows. A row can also be accessed by indexing a result R by the row's zero-based number:
Result sets in libpqxx are lightweight, reference-counted wrapper objects which are relatively small and cheap to copy. Think of a result object as a "smart pointer" to an underlying result set.
using pqxx::result::iterator = const_iterator |
using pqxx::result::pointer = const_iterator |
using pqxx::result::reference = row |
|
noexcept |
Referenced by pqxx::internal::clear_result().
|
defaultnoexcept |
pqxx::result::size_type pqxx::result::affected_rows | ( | ) | const |
If command was INSERT
, UPDATE
, or DELETE:
number of affected rows
INSERT
, UPDATE
, or DELETE
; zero for all other commands. References pqxx::to_string().
Referenced by pqxx::connection::get_variable().
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
char const * pqxx::result::column_name | ( | row_size_type | number | ) | const |
Name of column with this number (throws exception if it doesn't exist)
References pqxx::to_string().
Referenced by pqxx::row::column_number(), and pqxx::field::name().
pqxx::row::size_type pqxx::result::column_number | ( | char const | col_name[] | ) | const |
Number of given column (throws exception if it doesn't exist).
Referenced by pqxx::row::column_number().
row_size_type pqxx::result::column_number | ( | std::string const & | name | ) | const |
Number of given column (throws exception if it doesn't exist).
row_size_type pqxx::result::column_number | ( | zview | name | ) | const |
Number of given column (throws exception if it doesn't exist).
References pqxx::zview::c_str().
pqxx::oid pqxx::result::column_table | ( | row_size_type | col_num | ) | const |
What table did this column come from?
References pqxx::oid_none, and pqxx::to_string().
Referenced by pqxx::row::column_table(), and pqxx::field::table().
oid pqxx::result::column_table | ( | STRING | col_name | ) | const |
What table did this column come from?
pqxx::oid pqxx::result::column_type | ( | row_size_type | col_num | ) | const |
Return column's type, as an OID from the system catalogue.
References pqxx::oid_none, and pqxx::to_string().
Referenced by pqxx::row::column_type(), and pqxx::field::type().
oid pqxx::result::column_type | ( | STRING | col_name | ) | const |
Return column's type, as an OID from the system catalogue.
|
noexcept |
Number of columns in result.
pqxx::result::const_reverse_iterator pqxx::result::crbegin | ( | ) | const |
pqxx::result::const_reverse_iterator pqxx::result::crend | ( | ) | const |
|
noexcept |
Referenced by pqxx::transaction_base::exec_n(), and pqxx::icursor_iterator::operator==().
|
noexcept |
|
noexcept |
pqxx::oid pqxx::result::inserted_oid | ( | ) | const |
If command was INSERT
of 1 row, return oid of inserted row.
auto pqxx::result::iter | ( | ) | const |
Iterate rows, reading them directly into a tuple of "TYPE...".
Converts the fields to values of the given respective types.
Use this only with a ranged "for" loop. The iteration produces std::tuple<TYPE...> which you can "unpack" to a series of auto
variables.
|
noexcept |
|
noexcept |
|
noexcept |
Query that produced this result, if available (empty string otherwise)
pqxx::result::const_reverse_iterator pqxx::result::rbegin | ( | ) | const |
pqxx::result::const_reverse_iterator pqxx::result::rend | ( | ) | const |
|
noexcept |
|
noexcept |
Referenced by pqxx::row::swap().
pqxx::row::size_type pqxx::result::table_column | ( | row_size_type | col_num | ) | const |
What column in its table did this column come from?
References pqxx::to_string().
Referenced by pqxx::field::table_column(), and pqxx::row::table_column().
row_size_type pqxx::result::table_column | ( | STRING | col_name | ) | const |
What column in its table did this column come from?
References pqxx::internal::clear_result().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |