By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,171 Members | 776 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,171 IT Pros & Developers. It's quick & easy.

Pygresql classic vs DB-API interface

P: n/a
I am relatively new to python and am developing an application using

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
Sep 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.