Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

pqxx Namespace Reference


Compounds

class  basic_ilostream
 Input stream that gets its data from a large object. More...

class  basic_lostream
 Stream that reads and writes a large object. More...

class  basic_olostream
 Output stream that writes data back to a large object. More...

class  basic_robusttransaction
class  basic_transaction
class  binarystring
 Reveals "unescaped" version of PostgreSQL bytea string. More...

class  cachedresult
class  connection
 Connection class; represents an immediate connection to a database. More...

class  connection_base
 connection_base abstract base class; represents a connection to a database. More...

class  PQAlloc
 Keep track of a libpq-allocated pointer to be free()d automatically. More...

class  fieldconverter
class  const_iterator
 Iterator for rows (tuples) in a query result set. More...

class  Cursor
 SQL cursor class. More...

class  dbtransaction
 Abstract base class responsible for bracketing a backend transaction. More...

class  field
 Reference to a field in a result set. More...

struct  isolation_traits
 Traits class to describe an isolation level; primarly for libpqxx's own use. More...

class  largeobject
 Identity of a large object. More...

class  largeobject_streambuf
 Streambuf to use large objects in standard I/O streams. More...

class  largeobjectaccess
 Accessor for large object's contents. More...

class  lazyconnection
 Lazy connection class; represents a deferred connection to a database. More...

class  nontransaction
 Simple "transaction" class offering no transactional integrity. More...

struct  noticer
 Base class for user-definable error/warning message processor. More...

struct  unknown_position
 Exception thrown when cursor position is requested, but is unknown. More...

class  result
 Query or command result set. More...

class  tuple
 Reference to one row in a result. More...

class  robusttransaction
 Slower, better fortified version of transaction. More...

class  tablereader
 Efficiently pull data directly out of a table. More...

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

class  tablewriter
 Efficiently write data directly to a database table. More...

class  transaction
 Standard back-end transaction, templatized on isolation level. More...

class  transaction_base
 Interface definition (and common code) for "transaction" classes. More...

class  transactor
 Wrapper for transactions that automatically restarts them on failure. More...

class  trigger
 "Observer" base class for trigger notifications. More...

class  unique

Typedefs

typedef cachedresult CachedResult
typedef connection Connection
typedef lazyconnection LazyConnection
typedef connection_base ConnectionItf
typedef largeobject LargeObject
typedef largeobjectaccess LargeObjectAccess
typedef basic_ilostream< char > ilostream
typedef basic_olostream< char > olostream
typedef basic_lostream< char > lostream
typedef nontransaction NonTransaction
typedef binarystring BinaryString
typedef result Result
typedef robusttransaction<
read_committed > 
RobustTransaction
typedef tablereader TableReader
typedef tablestream TableStream
typedef tablewriter TableWriter
typedef transaction< read_committed > Transaction
typedef transaction_base TransactionItf
typedef transactor< transaction<
read_committed > > 
Transactor
typedef trigger Trigger
typedef long result_size_type
typedef int tuple_size_type
typedef Oid oid
 PostgreSQL row identifier type.


Enumerations

enum  isolation_level { read_committed, serializable }
 Transaction isolation levels; PostgreSQL doesn't implement all SQL levels. More...


Functions

template<> PGSTD::string Classname (const transaction_base *)
 Human-readable class names for use by unique template.

template<> PGSTD::string Classname (const dbtransaction *)
 Human-readable class name for use by unique.

template<> PGSTD::string Classname (const nontransaction *)
 Human-readable class names for use by unique template.

template<typename STREAM> STREAM & operator<< (STREAM &S, const pqxx::result::field &F)
 Write a result field to any type of stream.

result::const_iterator operator+ (result::const_iterator::difference_type o, result::const_iterator i)
template<> PGSTD::string Classname (const basic_robusttransaction *)
 Human-readable class names for use by unique template.

template<isolation_level ISOLATIONLEVEL> PGSTD::string Classname (const robusttransaction< ISOLATIONLEVEL > *)
 Human-readable class names for use by unique template.

template<> PGSTD::string Classname (const basic_transaction *)
 Human-readable class name for use by unique.

template<isolation_level ISOLATIONLEVEL> PGSTD::string Classname (const transaction< ISOLATIONLEVEL > *)
 Human-readable class names for use by unique template.

template<> PGSTD::string Classname (const tablestream *)
 User-readable class name for use by unique.

template<typename T> const char * FmtString (T)
template<> const char * FmtString (short)
template<> const char * FmtString (unsigned short)
template<> const char * FmtString (int)
template<> const char * FmtString (long)
template<> const char * FmtString (float)
template<> const char * FmtString (double)
template<> const char * FmtString (char)
template<typename T> PGSTD::string ToString (const T &Obj)
 Convert object of built-in type to string.

template<> PGSTD::string ToString (const PGSTD::string &Obj)
template<> PGSTD::string ToString (const char *const &Obj)
template<> PGSTD::string ToString (char *const &Obj)
template<> PGSTD::string ToString (const bool &Obj)
template<> PGSTD::string ToString (const short &Obj)
template<> PGSTD::string ToString (const unsigned short &Obj)
template<typename T> void FromString (const char Str[], T &Obj)
 Convert string to object of built-in type.

template<> void FromString (const char Str[], PGSTD::string &Obj)
template<> void FromString (const char Str[], const char *&Obj)
template<> void FromString (const char Str[], bool &Obj)
template<typename T> PGSTD::string Quote (const T &Obj, bool EmptyIsNull)
 Quote string for use in SQL.

template<> PGSTD::string Quote (const PGSTD::string &Obj, bool EmptyIsNull)
 std::string version, on which the other versions are built

template<> PGSTD::string Quote (const char *const &Obj, bool EmptyIsNull)
template<int LEN> PGSTD::string Quote (const char(&Obj)[LEN], bool EmptyIsNull)
 Specialization for string constants.

template<typename T> PGSTD::string Quote (T Obj)
 Quote string for use in SQL.

template<typename T> PGSTD::string Classname (const T *)
 Return user-readable name for a class. Specialize this whereever used.


Variables

const oid oid_none = InvalidOid
 The "null" oid.


Typedef Documentation

typedef binarystring pqxx::BinaryString
 

Deprecated:
For compatibility with old BinaryString class

typedef cachedresult pqxx::CachedResult
 

Deprecated:
For compatibility with the old CachedResult class

typedef connection pqxx::Connection
 

Deprecated:
For compatibility with old Connection class

typedef connection_base pqxx::ConnectionItf
 

What is now connection_base used to be called ConnectionItf. This was changed to convey its role in a way more consistent with the C++ standard library.

typedef basic_ilostream<char> pqxx::ilostream
 

typedef largeobject pqxx::LargeObject
 

Deprecated:
For compatibility with old LargeObject class

typedef largeobjectaccess pqxx::LargeObjectAccess
 

Deprecated:
For compatibility with old LargeObjectAccess class

typedef lazyconnection pqxx::LazyConnection
 

Deprecated:
For compatibility with old LazyConnection class

typedef basic_lostream<char> pqxx::lostream
 

typedef nontransaction pqxx::NonTransaction
 

Deprecated:
For compatibility with the old NonTransaction class

typedef Oid pqxx::oid
 

PostgreSQL row identifier type.

typedef basic_olostream<char> pqxx::olostream
 

typedef result pqxx::Result
 

Deprecated:
For compatibility with old Result class

typedef long pqxx::result_size_type
 

typedef robusttransaction<read_committed> pqxx::RobustTransaction
 

Deprecated:
For compatibility with old RobustTransaction class

typedef tablereader pqxx::TableReader
 

Deprecated:
For compatibility with the old TableReader class

typedef tablestream pqxx::TableStream
 

Deprecated:
For compatibility with the old TableStream class

typedef tablewriter pqxx::TableWriter
 

Deprecated:
For compatibility with the old TableWriter class

typedef transaction<read_committed> pqxx::Transaction
 

Deprecated:
Compatibility with the old Transaction class

typedef transaction_base pqxx::TransactionItf
 

What is now transaction_base used to be called TransactionItf. This was changed to convey its role in a way more consistent with the C++ standard library.

typedef transactor<transaction<read_committed> > pqxx::Transactor
 

Deprecated:
For compatibility with the old Transactor class

typedef trigger pqxx::Trigger
 

Deprecated:
For compatibility with the old Trigger class

typedef int pqxx::tuple_size_type
 


Enumeration Type Documentation

enum pqxx::isolation_level
 

Transaction isolation levels; PostgreSQL doesn't implement all SQL levels.

The only levels implemented in postgres are read_committed and serializable; SQL also defines read_uncommitted and repeatable_read. Unless you're bent on using nasty tricks to communicate between ongoing transactions and such, you won't really need isolation levels for anything except performance optimization. In that case, you can safely emulate read_uncommitted by using read_committed and repeatable_read by using serializable. In general, serializable is the safest choice.

Enumeration values:
read_committed 
serializable 


Function Documentation

template<typename T>
PGSTD::string Classname const T *   
 

Return user-readable name for a class. Specialize this whereever used.

template<>
PGSTD::string Classname const tablestream  
 

User-readable class name for use by unique.

template<isolation_level ISOLATIONLEVEL>
PGSTD::string Classname const transaction< ISOLATIONLEVEL > *   
 

Human-readable class names for use by unique template.

template<>
PGSTD::string Classname const basic_transaction  
 

Human-readable class name for use by unique.

template<isolation_level ISOLATIONLEVEL>
PGSTD::string Classname const robusttransaction< ISOLATIONLEVEL > *   
 

Human-readable class names for use by unique template.

template<>
PGSTD::string Classname const basic_robusttransaction  
 

Human-readable class names for use by unique template.

template<>
PGSTD::string Classname const nontransaction  
 

Human-readable class names for use by unique template.

template<>
PGSTD::string Classname const dbtransaction  
 

Human-readable class name for use by unique.

template<>
PGSTD::string Classname const transaction_base  
 

Human-readable class names for use by unique template.

template<>
const char* FmtString char   
 

template<>
const char* FmtString double   
 

template<>
const char* FmtString float   
 

template<>
const char * pqxx::FmtString long    double
 

template<>
const char* FmtString int   
 

template<>
const char * pqxx::FmtString unsigned    char
 

template<>
const char* FmtString short   
 

template<typename T>
const char* FmtString  
 

C-style format strings for various built-in types. Only allowed for certain types, for which this function is explicitly specialized below.

template<>
void FromString const char    Str[],
bool &    Obj
 

template<>
void FromString const char    Str[],
const char *&    Obj
 

template<>
void FromString const char    Str[],
PGSTD::string &    Obj
 

template<typename T>
void FromString const char    Str[],
T &    Obj
 

Convert string to object of built-in type.

Caution: the conversion is done using the currently active locale, whereas PostgreSQL delivers values in the "default" (C) locale. This means that if you intend to use this function from a locale that doesn't understand the data types in question (particularly numeric types like float and int) in default C format, you'll need to switch back to the C locale before the call. This should be fixed at some point in the future.

result::const_iterator operator+ result::const_iterator::difference_type    o,
result::const_iterator    i
 

template<typename STREAM>
STREAM& operator<< STREAM &    S,
const pqxx::result::field   F
 

Write a result field to any type of stream.

This can be convenient when writing a field to an output stream. More importantly, it lets you write a field to e.g. a stringstream which you can then use to read, format and convert the field in ways that to() does not support.

Example: parse a field into a variable of the nonstandard "long long" type.

extern result R; long long L; stringstream S;

// Write field's string into S S << R[0][0];

// Parse contents of S into L S >> L;

template<typename T>
PGSTD::string Quote   Obj
 

Quote string for use in SQL.

This version of the function never generates null values.

template<int LEN>
PGSTD::string Quote const char &    Obj[LEN],
bool    EmptyIsNull
 

Specialization for string constants.

This specialization is a little complicated, because string constants are of the type char[], not of type const char * as one might expect. Note that the size of the array is part of the type, for which reason we need it in our template here.

template<>
PGSTD::string Quote const char *const &    Obj,
bool    EmptyIsNull
 

In the special case of const char *, the null pointer is represented as the null value.

template<>
PGSTD::string Quote const PGSTD::string &    Obj,
bool    EmptyIsNull
 

std::string version, on which the other versions are built

template<typename T>
PGSTD::string pqxx::Quote const T &    Obj,
bool    EmptyIsNull
 

Quote string for use in SQL.

Generate SQL-quoted version of string. If EmptyIsNull is set, an empty string will generate the null value rather than an empty string.

template<>
PGSTD::string ToString const unsigned short &    Obj
 

template<>
PGSTD::string ToString const short &    Obj
 

template<>
PGSTD::string ToString const bool &    Obj
 

template<>
PGSTD::string ToString char *const &    Obj
 

template<>
PGSTD::string ToString const char *const &    Obj
 

template<>
PGSTD::string ToString const PGSTD::string &    Obj
 

template<typename T>
PGSTD::string ToString const T &    Obj
 

Convert object of built-in type to string.

Caution: the conversion is done using the currently active locale, whereas PostgreSQL expects values in the "default" (C) locale. This means that if you intend to use this function from a locale that renders the data types in question (particularly numeric types like float and int) differently from the C default, you'll need to switch back to the C locale before the call. This should be fixed at some point in the future.


Variable Documentation

const oid pqxx::oid_none = InvalidOid
 

The "null" oid.


Generated on Sat Jun 7 00:49:35 2003 for libpqxx by doxygen1.3-rc3