libpqxx
3.1.1
|
Efficiently pull data directly out of a table. More...
#include <tablereader.hxx>
Public Member Functions | |
tablereader (transaction_base &, const std::string &Name, const std::string &Null=std::string()) | |
template<typename ITER > | |
tablereader (transaction_base &, const std::string &Name, ITER begincolumns, ITER endcolumns) | |
Read only the given sequence of columns. | |
template<typename ITER > | |
tablereader (transaction_base &, const std::string &Name, ITER begincolumns, ITER endcolumns, const std::string &Null) | |
~tablereader () throw () | |
template<typename TUPLE > | |
tablereader & | operator>> (TUPLE &) |
operator bool () const throw () | |
bool | operator! () const throw () |
bool | get_raw_line (std::string &Line) |
Read a line of raw, unparsed table data. | |
template<typename TUPLE > | |
void | tokenize (std::string, TUPLE &) const |
virtual void | complete () |
Finish stream action, check for errors, and detach from transaction. | |
![]() | |
tablestream (transaction_base &Trans, const std::string &Null=std::string()) | |
virtual | ~tablestream ()=0 throw () |
![]() | |
transactionfocus (transaction_base &t) | |
![]() | |
namedclass (const std::string &Classname, const std::string &Name="") | |
const std::string & | name () const throw () |
const std::string & | classname () const throw () |
std::string | description () const |
Additional Inherited Members | |
![]() | |
const std::string & | NullStr () const |
bool | is_finished () const throw () |
void | base_close () |
![]() | |
template<typename ITER > | |
static std::string | columnlist (ITER colbegin, ITER colend) |
Construct a comma-separated column list from given sequence. | |
![]() | |
transaction_base & | m_Trans |
Efficiently pull data directly out of a table.
A tablereader provides efficient read access to a database table. This is not as flexible as a normal query using the result class however:
On the other hand, it can read rows of data and transform them into any container or container-like object that supports STL back-inserters. Since the tablereader has no knowledge of the types of data expected, it treats all fields as strings.
pqxx::tablereader::tablereader | ( | transaction_base & | T, |
const std::string & | Name, | ||
const std::string & | Null = std::string() |
||
) |
pqxx::tablereader::tablereader | ( | transaction_base & | T, |
const std::string & | Name, | ||
ITER | begincolumns, | ||
ITER | endcolumns | ||
) |
Read only the given sequence of columns.
References pqxx::tablestream::columnlist().
pqxx::tablereader::tablereader | ( | transaction_base & | T, |
const std::string & | Name, | ||
ITER | begincolumns, | ||
ITER | endcolumns, | ||
const std::string & | Null | ||
) |
References pqxx::tablestream::columnlist().
pqxx::tablereader::~tablereader | ( | ) | throw () |
|
virtual |
Finish stream action, check for errors, and detach from transaction.
It is recommended that you call this function before the tablestream's destructor is run. This function will check any final errors which may not become apparent until the transaction is committed otherwise.
As an added benefit, this will free up the transaction while the tablestream object itself still exists.
Implements pqxx::tablestream.
bool pqxx::tablereader::get_raw_line | ( | std::string & | Line | ) |
Read a line of raw, unparsed table data.
Line | Variable to hold the raw data line read from the table. |
Referenced by pqxx::tablewriter::operator<<().
pqxx::tablereader::operator bool | ( | ) | const throw () |
bool pqxx::tablereader::operator! | ( | ) | const throw () |
tablereader & pqxx::tablereader::operator>> | ( | TUPLE & | T | ) |
void pqxx::tablereader::tokenize | ( | std::string | Line, |
TUPLE & | T | ||
) | const |