#include <tablewriter.hxx>
Inheritance diagram for pqxx::tablewriter:
Public Types | |
typedef unsigned | size_type |
Public Member Functions | |
tablewriter (transaction_base &, const PGSTD::string &WName, const PGSTD::string &Null=PGSTD::string()) | |
template<typename ITER> | |
tablewriter (transaction_base &, const PGSTD::string &WName, ITER begincolumns, ITER endcolumns) | |
Write only the given sequence of columns. | |
template<typename ITER> | |
tablewriter (transaction_base &, const PGSTD::string &WName, ITER begincolumns, ITER endcolumns, const PGSTD::string &Null) | |
~tablewriter () throw () | |
template<typename IT> | |
void | insert (IT Begin, IT End) |
template<typename TUPLE> | |
void | insert (const TUPLE &) |
template<typename IT> | |
void | push_back (IT Begin, IT End) |
template<typename TUPLE> | |
void | push_back (const TUPLE &) |
void | reserve (size_type) |
template<typename TUPLE> | |
tablewriter & | operator<< (const TUPLE &) |
tablewriter & | operator<< (tablereader &) |
Copy table from one database to another. | |
template<typename IT> | |
PGSTD::string | generate (IT Begin, IT End) const |
Translate tuple of data to a string in DBMS-specific format. | |
template<typename TUPLE> | |
PGSTD::string | generate (const TUPLE &) const |
virtual void | complete () |
Finish stream action, check for errors, and detach from transaction. |
A tablewriter provides a Spartan but efficient way of writing data tuples into a table. It provides a plethora of STL-like insertion methods: it has insert() methods, push_back(), as well as an overloaded insertion operator (<<
), and it supports inserters created by std::back_inserter(). All of these are templatized so you can use any container type or iterator range to feed tuples into the table.
Note that in each case, a container or range represents the fields of a single tuple--not a collection of tuples.
typedef unsigned pqxx::tablewriter::size_type |
pqxx::tablewriter::tablewriter | ( | transaction_base & | , | |
const PGSTD::string & | WName, | |||
const PGSTD::string & | Null = PGSTD::string() | |||
) |
pqxx::tablewriter::tablewriter | ( | transaction_base & | , | |
const PGSTD::string & | WName, | |||
ITER | begincolumns, | |||
ITER | endcolumns | |||
) |
Write only the given sequence of columns.
pqxx::tablewriter::tablewriter | ( | transaction_base & | , | |
const PGSTD::string & | WName, | |||
ITER | begincolumns, | |||
ITER | endcolumns, | |||
const PGSTD::string & | Null | |||
) |
pqxx::tablewriter::~tablewriter | ( | ) | throw () |
void pqxx::tablewriter::insert | ( | IT | Begin, | |
IT | End | |||
) |
void pqxx::tablewriter::insert | ( | const TUPLE & | ) |
void pqxx::tablewriter::push_back | ( | IT | Begin, | |
IT | End | |||
) |
void pqxx::tablewriter::push_back | ( | const TUPLE & | ) |
void pqxx::tablewriter::reserve | ( | size_type | ) |
tablewriter & pqxx::tablewriter::operator<< | ( | const TUPLE & | ) |
pqxx::tablewriter & pqxx::tablewriter::operator<< | ( | tablereader & | ) |
Copy table from one database to another.
PGSTD::string pqxx::tablewriter::generate | ( | IT | Begin, | |
IT | End | |||
) | const |
Translate tuple of data to a string in DBMS-specific format.
PGSTD::string pqxx::tablewriter::generate | ( | const TUPLE & | ) | const |
void pqxx::tablewriter::complete | ( | ) | [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.