Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

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  broken_connection
 Exception class for lost backend connection. More...

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  dbtransaction
 Abstract base class responsible for bracketing a backend transaction. More...

class  in_doubt_error
 "Help, I don't know whether transaction was committed successfully!" 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...

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

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

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

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

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

class  robusttransaction
 Slightly slower, better-fortified version of transaction. More...

class  sql_error
 Exception class for failed queries. 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  tablewriter::fieldconverter
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
 Ensure proper opening/closing of GUEST objects related to a "host" object. More...


Typedefs

typedef basic_ilostream< char > ilostream
typedef basic_olostream< char > olostream
typedef basic_lostream< char > lostream
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 basic_ilostream<char> pqxx::ilostream
 

typedef basic_lostream<char> pqxx::lostream
 

typedef Oid pqxx::oid
 

PostgreSQL row identifier type.

typedef basic_olostream<char> pqxx::olostream
 

typedef long pqxx::result_size_type
 

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* FmtString long   ) 
 

template<>
const char* FmtString int   ) 
 

template<>
const char* FmtString unsigned  short  ) 
 

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 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 Sun Sep 21 01:09:26 2003 for libpqxx by doxygen 1.3.2