Hello,

I've been using libpqxx to access a Postgres database for the last few
months, and I wrote a set of classes to wrap around libpqxx, which
gradually evolved into a small set of classes and class templates.
These allow database tables and rows of tables to be represented as
"real" C++ objects, which you can interact with using normal class
methods.

Basically, it's an abstraction layer to separate the SQL SELECT,
INSERT, UPDATE and DELETE commands from the user of the classes, so
the classes become "database aware": the user of the class doesn't
need to be aware of the database interaction going on under the hood.
Database relationships such as joins using foreign keys and table
inheritance may be expressed using C++ inheritance.

The "table" classes take a pqxx::Connection in their constructors and
an optional pqxx::Transaction (they can run in either transaction or
auto-commit modes).


The current version of the library is available from:
http://www.whinlatter.uklinux.net/libpqxx-object-0.1.0.tar.bz2
This includes an API reference and a short tutorial explaining how it
is intended to be used. It's not yet completely perfect, but it does
its job. I'm now looking at additional ways to wrap the functionality
of libpqxx.

Are there any similar libraries in existence (either for Postgres or
any other DBMS)? (I'm looking to pinch some ideas ;-)


If it would be of interest, you are welcome to include this in your
libpqxx library, or as a separate project on GBorg (I'll relicense it
under the standard Postgres licence).


Regards,
Roger

- --
Roger Leigh

Printing on GNU/Linux? http://gimp-print.sourceforge.net/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.

Search Discussions

  • Roger Leigh at Nov 7, 2003 at 10:23 am
    Hello,

    I've been using libpqxx to access a Postgres database for the last few
    months, and I wrote a set of classes to wrap around libpqxx, which
    gradually evolved into a small set of classes and class templates.
    These allow database tables and rows of tables to be represented as
    "real" C++ objects, which you can interact with using normal class
    methods.

    Basically, it's an abstraction layer to separate the SQL SELECT,
    INSERT, UPDATE and DELETE commands from the user of the classes, so
    the classes become "database aware": the user of the class doesn't
    need to be aware of the database interaction going on under the hood.
    Database relationships such as joins using foreign keys and table
    inheritance may be expressed using C++ inheritance.

    The "table" classes take a pqxx::Connection in their constructors and
    an optional pqxx::Transaction (they can run in either transaction or
    auto-commit modes).


    The current version of the library is available from:
    http://www.whinlatter.uklinux.net/libpqxx-object-0.1.0.tar.bz2
    This includes an API reference and a short tutorial explaining how it
    is intended to be used. It's not yet completely perfect, but it does
    its job. I'm now looking at additional ways to wrap the functionality
    of libpqxx.

    Are there any similar libraries in existence (either for Postgres or
    any other DBMS)? (I'm looking to pinch some ideas ;-)


    If it would be of interest, you are welcome to include this in your
    libpqxx library, or as a separate project on GBorg (I'll relicense it
    under the standard Postgres licence).


    Regards,
    Roger

    - --
    Roger Leigh

    Printing on GNU/Linux? http://gimp-print.sourceforge.net/
    GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedNov 6, '03 at 9:17a
activeNov 7, '03 at 10:23a
posts2
users2
websitepostgresql.org...
irc#postgresql

2 users in discussion

Roger Leigh: 1 post Roger Leigh: 1 post

People

Translate

site design / logo © 2021 Grokbase