Chapter 2. Class overview

To work with libpqxx™, you need to be aware of at least the following classes. These are all introduced in a dedicated namespace, pqxx:

I would also like to use this opportunity to plug the esc function, which you should use whenever you want to include a variable as a string in your SQL (eg. insert it into a text field in a table). See below.

There are other classes that may be of interest to you, but which you don't necessarily need to be aware of for writing programs. You will probably want to look them up at some point when it becomes necessary to figure out complex compiler warnings.

Some of the classes you may become interested in fairly quickly are:

Finally, there are also some functions that you may want to know about, that live alone in the pqxx namespace without being part of any class:



[1] Actually libpqxx™ provides three classes doing this at various levels of reliability, called nontransaction, transaction, and robusttransaction for no, standard, and best reliability respectively. You probably shouldn't mess with robusttransaction though, because it comes with complications.