Result set containing data returned by a query or command. More...
#include <result.hxx>
Public Types | |
typedef unsigned long | size_type |
typedef signed long | difference_type |
typedef row | reference |
typedef const_result_iterator | const_iterator |
typedef const_iterator | pointer |
typedef const_iterator | iterator |
typedef const_reverse_result_iterator | const_reverse_iterator |
typedef const_reverse_iterator | reverse_iterator |
Public Member Functions | |
result () PQXX_NOEXCEPT | |
result (const result &rhs) PQXX_NOEXCEPT | |
result & | operator= (const result &rhs) PQXX_NOEXCEPT |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | crbegin () const |
const_reverse_iterator | rend () const |
const_reverse_iterator | crend () const |
const_iterator | begin () const PQXX_NOEXCEPT |
const_iterator | cbegin () const PQXX_NOEXCEPT |
const_iterator | end () const PQXX_NOEXCEPT |
const_iterator | cend () const PQXX_NOEXCEPT |
reference | front () const PQXX_NOEXCEPT |
reference | back () const PQXX_NOEXCEPT |
PQXX_PURE size_type | size () const PQXX_NOEXCEPT |
PQXX_PURE bool | empty () const PQXX_NOEXCEPT |
size_type | capacity () const PQXX_NOEXCEPT |
void | swap (result &) PQXX_NOEXCEPT |
const row | operator[] (size_type i) const PQXX_NOEXCEPT |
const row | at (size_type) const |
void | clear () PQXX_NOEXCEPT |
PQXX_PURE const std::string & | query () const PQXX_NOEXCEPT |
Query that produced this result, if available (empty string otherwise). | |
PQXX_PURE oid | inserted_oid () const |
If command was INSERT of 1 row, return oid of inserted row. | |
PQXX_PURE size_type | affected_rows () const |
If command was INSERT , UPDATE , or DELETE: number of affected rows. | |
Comparisons | |
bool | operator== (const result &) const PQXX_NOEXCEPT |
bool | operator!= (const result &rhs) const PQXX_NOEXCEPT |
Column information | |
PQXX_PURE row::size_type | columns () const PQXX_NOEXCEPT |
Number of columns in result. | |
row::size_type | column_number (const char ColName[]) const |
Number of given column (throws exception if it doesn't exist). | |
row::size_type | column_number (const std::string &Name) const |
Number of given column (throws exception if it doesn't exist). | |
const char * | column_name (row::size_type Number) const |
Name of column with this number (throws exception if it doesn't exist). | |
oid | column_type (row::size_type ColNum) const |
Type of given column. | |
oid | column_type (int ColNum) const |
Type of given column. | |
oid | column_type (const std::string &ColName) const |
Type of given column. | |
oid | column_type (const char ColName[]) const |
Type of given column. | |
oid | column_table (row::size_type ColNum) const |
What table did this column come from? | |
oid | column_table (int ColNum) const |
What table did this column come from? | |
oid | column_table (const std::string &ColName) const |
What table did this column come from? | |
row::size_type | table_column (row::size_type ColNum) const |
What column in its table did this column come from? | |
row::size_type | table_column (int ColNum) const |
What column in its table did this column come from? | |
row::size_type | table_column (const std::string &ColName) const |
What column in its table did this column come from? | |
Friends | |
class | pqxx::field |
class | pqxx::internal::gate::result_creation |
class | pqxx::internal::gate::result_connection |
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:
for (result::size_type i=0; i < R.size(); ++i) Process(R[i]);
Result sets in libpqxx are lightweight, reference-counted wrapper objects (following the Proxy design pattern) that are small and cheap to copy. Think of a result object as a "smart pointer" to an underlying result set.
typedef signed long pqxx::result::difference_type |
typedef const_iterator pqxx::result::iterator |
typedef const_iterator pqxx::result::pointer |
typedef row pqxx::result::reference |
typedef unsigned long pqxx::result::size_type |
pqxx::result::result | ( | ) |
pqxx::result::result | ( | const result & | rhs | ) |
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. Referenced by pqxx::internal::sql_cursor::move().
References operator[](), and size().
reference pqxx::result::back | ( | ) | const |
pqxx::result::const_iterator pqxx::result::begin | ( | ) | const |
size_type pqxx::result::capacity | ( | ) | const |
pqxx::result::const_iterator pqxx::result::cbegin | ( | ) | const |
References begin().
const_result_iterator pqxx::result::cend | ( | ) | const |
References end().
void pqxx::result::clear | ( | ) |
Referenced by pqxx::icursor_iterator::operator++(), and pqxx::icursor_iterator::operator+=().
const char * 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().
row::size_type pqxx::result::column_number | ( | const std::string & | Name | ) | const |
Number of given column (throws exception if it doesn't exist).
References column_number().
Referenced by column_number().
pqxx::row::size_type pqxx::result::column_number | ( | const char | ColName[] | ) | const |
Number of given column (throws exception if it doesn't exist).
Referenced by pqxx::row::column_number().
oid pqxx::result::column_table | ( | const std::string & | ColName | ) | const |
oid pqxx::result::column_table | ( | int | ColNum | ) | const |
pqxx::oid pqxx::result::column_table | ( | row::size_type | ColNum | ) | const |
What table did this column come from?
References columns(), pqxx::oid_none, and pqxx::to_string().
Referenced by pqxx::row::column_table(), and pqxx::field::table().
oid pqxx::result::column_type | ( | const char | ColName[] | ) | const |
oid pqxx::result::column_type | ( | const std::string & | ColName | ) | const |
oid pqxx::result::column_type | ( | int | ColNum | ) | const |
pqxx::oid pqxx::result::column_type | ( | row::size_type | ColNum | ) | const |
Type of given column.
References pqxx::oid_none, and pqxx::to_string().
Referenced by pqxx::row::column_type(), and pqxx::field::type().
pqxx::row::size_type pqxx::result::columns | ( | ) | const |
Number of columns in result.
Referenced by column_table(), and table_column().
pqxx::result::const_reverse_iterator pqxx::result::crbegin | ( | ) | const |
References rbegin().
pqxx::result::const_reverse_iterator pqxx::result::crend | ( | ) | const |
References rend().
bool pqxx::result::empty | ( | ) | const |
Referenced by pqxx::icursor_iterator::operator<(), and pqxx::icursor_iterator::operator==().
const_result_iterator pqxx::result::end | ( | ) | const |
reference pqxx::result::front | ( | ) | const |
pqxx::oid pqxx::result::inserted_oid | ( | ) | const |
bool pqxx::result::operator!= | ( | const result & | rhs | ) | const |
bool pqxx::result::operator== | ( | const result & | rhs | ) | const |
const std::string & pqxx::result::query | ( | ) | const |
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 |
pqxx::result::size_type pqxx::result::size | ( | ) | const |
Referenced by at(), end(), and pqxx::internal::sql_cursor::fetch().
void pqxx::result::swap | ( | result & | rhs | ) |
row::size_type pqxx::result::table_column | ( | const std::string & | ColName | ) | const |
What column in its table did this column come from?
References table_column().
Referenced by table_column().
row::size_type pqxx::result::table_column | ( | int | ColNum | ) | const |
What column in its table did this column come from?
References table_column().
Referenced by table_column().
pqxx::row::size_type pqxx::result::table_column | ( | row::size_type | ColNum | ) | const |
What column in its table did this column come from?
References columns(), and pqxx::to_string().
Referenced by pqxx::row::table_column(), and pqxx::field::table_column().
friend class pqxx::field [friend] |
friend class pqxx::internal::gate::result_connection [friend] |
friend class pqxx::internal::gate::result_creation [friend] |
friend class pqxx::internal::gate::result_sql_cursor [friend] |