Loxahatchee  v0.0.1-1346
Lox Convenience C++ Library
Lox::PQDB Class Reference

PostgreSQL database class with simplified access to libpq++. More...

#include <LoxPQDB.hpp>

Inheritance diagram for Lox::PQDB:
Collaboration diagram for Lox::PQDB:

Public Member Functions

 PQDB (const std::string &connectionString)
 Construtor. More...
 
 PQDB (const std::string &user, const std::string &password, const std::string &hostaddr, const std::string &application_name, const std::string &dbname)
 Constructor. More...
 
virtual ~PQDB (void)
 Destructor. More...
 
virtual DBResult exec (const std::string &sql)
 Run a simple query that doesn't need a transaction. More...
 
virtual DBResult exec1 (const std::string &sql)
 Similar to exec(), but ensures there is exactly 1 result. Will throw if there isn't exactly a single row. More...
 

Detailed Description

PostgreSQL database class with simplified access to libpq++.

Provide easy-to-use database access to PostgreSQL via libpqxx. The PQDB objects represent not the database, but a single connection to an existing database. Multiple PQDB objects can be instantiated, and each one will create a unique connection to the back-end database.

Constructor & Destructor Documentation

Lox::PQDB::PQDB ( const std::string &  connectionString)

Construtor.

Lox::PQDB::PQDB ( const std::string &  user,
const std::string &  password,
const std::string &  hostaddr,
const std::string &  application_name,
const std::string &  dbname 
)

Constructor.

Lox::PQDB::~PQDB ( void  )
virtual

Destructor.

Member Function Documentation

Lox::DBResult Lox::PQDB::exec ( const std::string &  sql)
virtual

Run a simple query that doesn't need a transaction.

References LOX_CATCH_DISPLAY_AND_RETRHOW.

Lox::DBResult Lox::PQDB::exec1 ( const std::string &  sql)
virtual

Similar to exec(), but ensures there is exactly 1 result. Will throw if there isn't exactly a single row.

References LOX_WHERE.


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