A PostgreSQL connection. More...
#include <Wt/Dbo/backend/Postgres>
Public Member Functions | |
Postgres (const std::string &db) | |
Opens a new PostgreSQL backend connection. | |
~Postgres () | |
Destructor. | |
PGconn * | connection () |
Returns the underlying connection. | |
virtual void | executeSql (const std::string &sql) |
Executes an SQL statement. | |
virtual void | startTransaction () |
Starts a transaction. | |
virtual void | commitTransaction () |
Commits a transaction. | |
virtual void | rollbackTransaction () |
Rolls back a transaction. | |
virtual SqlStatement * | prepareStatement (const std::string &sql) |
Prepares a statement. | |
Methods that return dialect information | |
virtual std::string | autoincrementSql () const |
Returns the 'autoincrement' SQL type modifier. | |
virtual std::string | autoincrementType () const |
Returns the 'autoincrement' SQL type. | |
virtual std::string | autoincrementInsertSuffix () const |
Returns the suffix for an 'autoincrement' insert statement. | |
virtual const char * | dateTimeType (SqlDateTimeType type) const |
Returns the date/time type. | |
virtual const char * | blobType () const |
Returns the blob type. |
A PostgreSQL connection.
This class provides the backend implementation for PostgreSQL databases.
Wt::Dbo::backend::Postgres::Postgres | ( | const std::string & | db ) |
Opens a new PostgreSQL backend connection.
The db
may be any of the values supported by PQconnectdb().
Wt::Dbo::backend::Postgres::~Postgres | ( | ) |
Destructor.
Closes the connection.
std::string Wt::Dbo::backend::Postgres::autoincrementInsertSuffix | ( | ) | const [virtual] |
Returns the suffix for an 'autoincrement' insert statement.
This is appended to the insert
statement, since some back-ends need to be indicated that they should return the autoincrement id.
Implements Wt::Dbo::SqlConnection.
std::string Wt::Dbo::backend::Postgres::autoincrementSql | ( | ) | const [virtual] |
Returns the 'autoincrement' SQL type modifier.
This is used by Session::createTables() to create the id column.
Implements Wt::Dbo::SqlConnection.
std::string Wt::Dbo::backend::Postgres::autoincrementType | ( | ) | const [virtual] |
Returns the 'autoincrement' SQL type.
This is used by Session::createTables() to create the id column.
Implements Wt::Dbo::SqlConnection.
const char * Wt::Dbo::backend::Postgres::blobType | ( | ) | const [virtual] |
Returns the blob type.
Implements Wt::Dbo::SqlConnection.
void Wt::Dbo::backend::Postgres::commitTransaction | ( | ) | [virtual] |
const char * Wt::Dbo::backend::Postgres::dateTimeType | ( | SqlDateTimeType | type ) | const [virtual] |
Returns the date/time type.
Implements Wt::Dbo::SqlConnection.
void Wt::Dbo::backend::Postgres::executeSql | ( | const std::string & | sql ) | [virtual] |
Executes an SQL statement.
This is a convenience method for preparing a statement, executing it, and deleting it.
Reimplemented from Wt::Dbo::SqlConnection.
SqlStatement * Wt::Dbo::backend::Postgres::prepareStatement | ( | const std::string & | sql ) | [virtual] |
void Wt::Dbo::backend::Postgres::rollbackTransaction | ( | ) | [virtual] |
Rolls back a transaction.
This function rolls back a transaction.
Implements Wt::Dbo::SqlConnection.
void Wt::Dbo::backend::Postgres::startTransaction | ( | ) | [virtual] |