CppDB
PostgreSQL Backend - "postgresql"

PostgreSQL backend allows to connect to PostgreSQL database. It uses libpq C client API.

Connection String

The driver name is "postgresql", cppdb::session::engine() returns "posgresql"

PostgreSQL connection properties are passed as it to libpq. So for full list you should refer to the libpq manual

The most used properties are:

Special Properties

PostgreSQL backend has additional internal property that define how to treat blob objects: "@blob"

The possible values are:

Implementation Details

Prepared statements are implemented using PQexecPrepared API, while unprepared statements use PQexecParams API.

When using PostgreSQL large objects "@blob=lo" - the default - you should access them only during transaction, otherwise the operations would fail. It is very good idea to use lo module that helps handing object lifetime as cppdb backend is not aware of statement type you use and it can't decide whether new object should be created in insert statement or same object should be updated. So "lo" module is your friend.

You may also use bytea if want to have a semantics similar to other RDBMSs Blobs.

Fetching last insert id should be done using non-empty sequence name, i.e. using cppdb::statement::sequence_last() and it is fetched using "SELECT currval(?)" statement.

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator