[PYTHON DB-SIG] API conformant sybase module
Wed, 08 Jan 1997 08:26:32 -0500
I don't mean to change the subject, but while there is some
activity I'd like to ask a question. Why was it decided for the
API to return a list of tuples? At my previous place of employment
(the Jackson Labortory on the Mouse Genome Database Project), we
were using one of the early Sybase modules, hacked to our own
specification (read pre-DBAPI). It always seemed natural to us
to have rows from the database returned as dictionaries.
As a result when I started working with the mSQL module, and more
recently the Oracle module (both of which are great btw! Thanks to
those who developed them!) at my current job, it was a suprise
to me to find that there was no option for returning a list of
dictionaries. I altered the mSQL module to add this function
(and notified it's maintainer), and added a python function to
my own Oracle library, that acts as an interface to the Oracle
module, to convert rows to dictionaries if the caller so desires.
I don't mind the way I've done it, though it seems less efficient
in the case of Oracle to be converting rows to a different data
structure once in Python, instead of in the Oracle module itself.
I would be interested in hearing why it isn't part of the API, and
peoples' thoughts on the value of this functionality. I've always
found it very useful.
Scientific Software Engineer
DB-SIG - SIG on Tabular Databases in Python
send messages to: email@example.com
administrivia to: firstname.lastname@example.org