[DB-SIG] Result Set Inconsistencies
Orr, Steve
sorr at rightnow.com
Wed Jul 16 13:58:53 EDT 2003
I know the spec calls for sequences but why? Why be vague on an API
"spec?" Intentional inconsistency? So if I'm developing against multiple
databases and I want consistent result sets I have to know the behavior
of each module and convert types? Seems weird to me.
I'm thinking results sets should always be a lists or I should be able
to specify how I want the result sets. I know there are lots of
differences in database engines and an API can't make all database
engines behave the same but it OUGHT to impose SOME consistency.
-----Original Message-----
From: Chris Cogdon [mailto:chris at cogdon.org]
Sent: Wednesday, July 16, 2003 12:42 PM
To: Orr, Steve
Cc: db-sig at python.org
Subject: Re: [DB-SIG] Result Set Inconsistencies
On Wednesday, Jul 16, 2003, at 11:36 US/Pacific, Orr, Steve wrote:
> Why the inconsistencies in .fetch* result sets?
>
> Module fetchall Result Set
> --------- -------------------
> MySQLdb tuple of tuples
> cx_Oracle list of tuples
> DCOracle2 list of lists
The DB-API2.0 specification specifies that 'sequences' be used. This
can mean tuples, lists or any other type that mimics the sequence
protocol. For Example, pyPgSQL returns a list of PgResultSets, which
operate like a sequence, but have other attributes too).
Therefore, there is no requirement to specifically use lists or tuples,
so the implementer is free to implement how he or she sees fit.
--
("`-/")_.-'"``-._ Chris Cogdon <chris at cogdon.org>
. . `; -._ )-;-,_`)
(v_,)' _ )`-.\ ``-'
_.- _..-_/ / ((.'
((,.-' ((,/ fL
More information about the DB-SIG
mailing list