Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Pygresql classic vs DB-API interface

Reply
Thread Tools

Pygresql classic vs DB-API interface

 
 
Steve Bergman
Guest
Posts: n/a
 
      09-19-2005
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PyQt + PygreSQL Neil Zanella Python 2 08-11-2004 07:19 PM
Anyone know a good Pygresql Tutorial for Interfacing betweenPython &Postgresql Chuck Amadi Python 4 06-19-2004 05:57 AM
How to use Python + PygreSQL on a WinXP system Radu Stanciu Python 2 02-18-2004 12:53 PM
Has anybody got PyGresql working on Python 2.3 or later? Benjamin Arai Python 0 02-01-2004 05:57 PM
pygresql trewornan Python 1 06-28-2003 02:55 AM



Advertisments