libpqxx  3.1.1
pqxx::tablestream Class Reference

Base class for streaming data to/from database tables. More...

#include <tablestream.hxx>

Inheritance diagram for pqxx::tablestream:
pqxx::internal::transactionfocus pqxx::internal::namedclass pqxx::tablereader pqxx::tablewriter

Public Member Functions

 tablestream (transaction_base &Trans, const std::string &Null=std::string())
virtual ~tablestream ()=0 throw ()
virtual void complete ()=0
 Finish stream action, check for errors, and detach from transaction.
- Public Member Functions inherited from pqxx::internal::transactionfocus
 transactionfocus (transaction_base &t)
- Public Member Functions inherited from pqxx::internal::namedclass
 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

Protected Member Functions

const std::string & NullStr () const
bool is_finished () const throw ()
void base_close ()
- Protected Member Functions inherited from pqxx::internal::transactionfocus
void register_me ()
void unregister_me () throw ()
void reg_pending_error (const std::string &) throw ()
bool registered () const throw ()

Static Protected Member Functions

template<typename ITER >
static std::string columnlist (ITER colbegin, ITER colend)
 Construct a comma-separated column list from given sequence.

Additional Inherited Members

- Protected Attributes inherited from pqxx::internal::transactionfocus
transaction_basem_Trans

Detailed Description

Base class for streaming data to/from database tables.

A Tablestream enables optimized batch read or write access to a database table using PostgreSQL's COPY TO STDOUT and COPY FROM STDIN commands, respectively. These capabilities are implemented by its subclasses tablereader and tablewriter.

A Tablestream exists in the context of a transaction, and no other streams or queries may be applied to that transaction as long as the stream remains open.

Constructor & Destructor Documentation

pqxx::tablestream::tablestream ( transaction_base Trans,
const std::string &  Null = std::string() 
)
explicit

References tablestream().

Referenced by tablestream().

pqxx::tablestream::~tablestream ( ) throw ()
pure virtual

Member Function Documentation

void pqxx::tablestream::base_close ( )
protected
template<typename ITER >
std::string pqxx::tablestream::columnlist ( ITER  colbegin,
ITER  colend 
)
staticprotected

Construct a comma-separated column list from given sequence.

References pqxx::separated_list().

Referenced by pqxx::tablereader::tablereader(), and pqxx::tablewriter::tablewriter().

virtual void pqxx::tablestream::complete ( )
pure 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 for 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.

Implemented in pqxx::tablewriter, and pqxx::tablereader.

bool pqxx::tablestream::is_finished ( ) const throw ()
protected
const std::string& pqxx::tablestream::NullStr ( ) const
protected

The documentation for this class was generated from the following files: