|
| | result () noexcept |
| |
| | result (result const &rhs) noexcept=default |
| |
| result & | operator= (result const &rhs) noexcept=default |
| | Assign one result to another. More...
|
| |
| 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 |
| | Exchange two result values in an exception-safe manner. More...
|
| |
| row | operator[] (size_type i) const noexcept |
| | Index a row by number. More...
|
| |
| row | at (size_type) const |
| | Index a row by number, but check that the row number is valid. More...
|
| |
| field | at (size_type, row_size_type) const |
| | Index a field by row number and column number. More...
|
| |
| void | clear () noexcept |
| | Let go of the result's data. More...
|
| |
| 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 an INSERT of 1 row, return oid of the inserted row. More...
|
| |
| PQXX_PURE size_type | affected_rows () const |
| | If command was INSERT, UPDATE, or DELETE: number of affected rows. More...
|
| |
|
You can compare results for equality. Beware: this is a very strict, dumb comparison. The smallest difference between two results (such as a string "Foo" versus a string "foo") will make them unequal.
|
| bool | operator== (result const &) const noexcept |
| | Compare two results for equality. More...
|
| |
| bool | operator!= (result const &rhs) const noexcept |
| | Compare two results for inequality. More...
|
| |
|
| PQXX_PURE row_size_type | columns () const noexcept |
| | Number of columns in result. 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...
|
| |
| oid | column_type (zview 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...
|
| |
| oid | column_table (zview 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...
|
| |
| row_size_type | table_column (zview col_name) const |
| | What column in its table did this column come from? More...
|
| |
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. You can also access a row by indexing a result R by the row's zero-based number:
for (result::size_type i=0; i < std::size(R); ++i) Process(R[i]);
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.
- Warning
- The result set that a result object points to is not thread-safe. If you copy a result object, it still refers to the same underlying result set. So never copy, destroy, query, or otherwise access a result while another thread may be copying, destroying, querying, or otherwise accessing the same result set–even if it is doing so through a different result object!
template<typename... TYPE>
| 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.