 |
Kea
1.5.0
|
Go to the documentation of this file.
6 #ifndef PGSQL_CONNECTION_H
7 #define PGSQL_CONNECTION_H
12 #include <boost/scoped_ptr.hpp>
151 operator PGresult*()
const {
158 operator bool()
const {
194 if (pgconn_ != NULL) {
203 if (pgconn_ != NULL) {
209 pgconn_ = connection;
216 operator PGconn*()
const {
223 operator bool()
const {
232 class PgSqlConnection;
413 operator PGconn*()
const {
420 operator bool()
const {
429 #endif // PGSQL_CONNECTION_H
void checkStatementError(const PgSqlResult &r, PgSqlTaggedStatement &statement) const
Checks result of the r object.
void rollback()
Rollback Transactions.
const char * text
Text representation of the actual query.
void rowColCheck(int row, int col) const
Determines if both a row and column index are valid.
void prepareStatement(const PgSqlTaggedStatement &statement)
Prepare Single Statement.
Common PgSql Connector Pool.
const size_t PGSQL_MAX_PARAMETERS_IN_QUERY
Define a PostgreSQL statement.
int getRows() const
Returns the number of rows in the result set.
virtual ~PgSqlConnection()
Destructor.
~PgSqlHolder()
Destructor.
void rowCheck(int row) const
Determines if a row index is valid.
const char * name
Short name of the query.
int nbparams
Number of parameters for a given query.
void openDatabase()
Open Database.
const uint32_t PG_SCHEMA_VERSION_MAJOR
Define PostgreSQL backend version: 5.0.
PgSqlTransaction(PgSqlConnection &conn)
Constructor.
void colCheck(int col) const
Determines if a column index is valid.
PgSqlHolder()
Constructor.
~PgSqlTransaction()
Destructor.
Defines the logger used by the top-level component of kea-dhcp-ddns.
PgSqlHolder conn_
PgSql connection handle.
int getCols() const
Returns the number of columns in the result set.
Postgresql connection handle Holder.
RAII object representing a PostgreSQL transaction.
PgSqlResult(PGresult *result)
Constructor.
const uint32_t PG_SCHEMA_VERSION_MINOR
RAII wrapper for PostgreSQL Result sets.
void startTransaction()
Start a transaction.
const Oid types[PGSQL_MAX_PARAMETERS_IN_QUERY]
OID types.
bool compareError(const PgSqlResult &r, const char *error_state)
Checks a result set's SQL state against an error state.
PgSqlConnection(const ParameterMap ¶meters)
Constructor.
void commit()
Commits transaction.
Common database connection class.
static const char DUPLICATE_KEY[]
Define the PgSql error state for a duplicate key error.
std::map< std::string, std::string > ParameterMap
Database configuration parameter map.
const size_t OID_TIMESTAMP
~PgSqlResult()
Destructor.
void prepareStatements(const PgSqlTaggedStatement *start_statement, const PgSqlTaggedStatement *end_statement)
Prepare statements.
void commit()
Commit Transactions.
const size_t OID_NONE
Constants for PostgreSQL data types These are defined by PostgreSQL in <catalog/pg_type....
std::string getColumnLabel(const int col) const
Fetches the name of the column in a result set.
void setConnection(PGconn *connection)
Sets the connection to the value given.