Pygresql classic vs DB-API interface

Discussion in 'Python' started by Steve Bergman, Sep 19, 2005.

  1. I am relatively new to python and am developing an application using
    mod_python/pygresql/postgresql.

    Being attracted to the idea of database portability, I started out using
    the DB-API 2.0 compliant pgdb module. However, I am finding it to be
    pretty clunky compared to the classic pg interface.
    It just doesn't seem "pythonic" to me. Chief among my concerns is the
    way it won't return results as a dictionary, so I have to address the
    data using cryptic numeric indeces. To be fair, the 3rd party dtuple
    module lets me use dictionaries, but it still seems a bit clunky. Also,
    insertion into a table seems unnecessarily ugly. With the classic
    interface, I just pass a tablename and a dictionary and let the
    interface deal with it. With pgdb, if I want to do something like that
    I've got to write my own code to do it. Or does DB-API and pyformat
    allow me to do this in a more elegant way of which I am unaware?

    I still like the portability of pgdb though. So, does anyone have any
    recommendations? Perhaps a module that does for inserts and updates
    kind of what dtuple does for selects?

    Thank you for any guidance.

    Steve Bergman
     
    Steve Bergman, Sep 19, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. trewornan

    pygresql

    trewornan, Jun 28, 2003, in forum: Python
    Replies:
    1
    Views:
    803
    Skip Montanaro
    Jun 28, 2003
  2. Benjamin Arai
    Replies:
    0
    Views:
    291
    Benjamin Arai
    Feb 1, 2004
  3. Radu Stanciu
    Replies:
    2
    Views:
    369
    =?ISO-8859-1?Q?Gerhard_H=E4ring?=
    Feb 18, 2004
  4. Chuck Amadi
    Replies:
    4
    Views:
    882
    =?ISO-8859-1?Q?Gerhard_H=E4ring?=
    Jun 19, 2004
  5. Neil Zanella

    PyQt + PygreSQL

    Neil Zanella, Aug 10, 2004, in forum: Python
    Replies:
    2
    Views:
    818
    Neil Zanella
    Aug 11, 2004
Loading...

Share This Page