Chapter 9. A Simpler C API - libpgeasy

   

Chapter 9. A Simpler C API ”libpgeasy

The libpq library is very powerful. In fact, libpq is the basis for most of the other PostgreSQL APIs ”the other APIs translate a high-level request into a set of calls to the libpq library. The power behind libpq comes at the price of complexity. libpgeasy lets you avoid that complexity by acting as a lightweight wrapper around the more commonly used libpq functions. The simplicity afforded by the use of libpgeasy often comes at the expense of functionality.

The functions provided by the libpgeasy library use the same data structures used by libpq. For example, when you connect to a database using libpgeasy, you get back a PGconn * ; that's the same data type that you get when you connect to a database using libpq. This means that you can mix and match calls to libpq and libpgeasy, taking advantage of the power of libpq and the simplicity of libpgeasy.

Although the data types of libpq and libpqeasy may be similar, the design philosophies of libpq and libpgeasy are very different. libpq is designed to provide access to all the features of the PostgreSQL server. Libpgeasy, on the other hand, is designed to provide a simple interface to the most commonly used PostgreSQL features.

   


PostgreSQL
PostgreSQL (2nd Edition)
ISBN: 0672327562
EAN: 2147483647
Year: 2005
Pages: 220
Authors: Korry Douglas

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net