Chapter 3. Tutorial

Table of Contents

Before we begin programming
This document
C++ conventions
Setting up a connection
Performing a transaction
What's a Transaction?
Creating a transaction object
Ending a transaction
Executing queries
Getting query results
String conversions

Before we begin programming

This document

This frontend library builds on top of the libpq frontend library, which defines PostgreSQL's C API. Therefore this tutorial will sometimes refer to the libpq documentation rather than repeat what is said there. We did not do it this way to annoy you, but to keep the libpqxx documentation from falling out of date with any changes in the C frontend. Please bear with us.

If you're ever in doubt about how to use the basic features of libpqxx, take a look at the test suite in the test directory. The code there should help give you an idea.

Don't let that keep you from submitting a request for improved documentation though. Your questions define what this tutorial needs to say!

C++ conventions

All definitions in libpqxx reside in a namespace called pqxx.