Python Database Objects (PDO) 1.2.0 Released

Jon Franz jfranz at neurokode.com
Tue Nov 18 14:15:10 EST 2003


> I havent looked at the other DBAPI implementations lately, but with
> MySQLdb you can set the cursor type to DictCursor, and then you get
> back a sequence of dictionaries with the field names as the dict keys.

This is true, but unfortunately it isn't standard behavior according to the
DBAPI 2.0 spec (pep 249).
Since it isn't standard, it seems everyone that does provide it
in the module provides it a different way.- if they provide it at all.

With PDO you get this functionality everytime, with no need to change
your code when you switch databases and DBAPI modules to get it.
Plus, PDO's implementation of acccess-by-name uses less memory
than a sequence of mapping objects - excluding the case of very small
(1-3 record) results, that is.  I can exapnd upon how/why if people
are curious.

 cheers.

~Jon Franz
NeuroKode Labs, LLC






More information about the Python-list mailing list