[DB-SIG] Asymmetry in DB-API 2.0 types

M.-A. Lemburg mal at lemburg.com
Wed Jun 4 10:38:56 EDT 2003


Harald Meland wrote:
> Hi,
> 
> as the current DB-API stands, the types it mentions can be constructed
> via standard calls, but there's no standard module-independent way to
> decipher such types.
> 
> An example: It's reasonably easy to pass a DateTime object as a bind
> argument to .execute() in a driver-independent way.  However, if I'd
> like to get the date part of a DateTime object returned from a query,
> I'll have to jump through module-specific hoops.

True.

> Is this still another case of "this can't or shouldn't be handled by
> the driver, but by a (hypothetical) separate layer on top of the
> drivers", or is there interest in extending the type definitions in
> the DB-API to include deciphering features?

The driver output values are driver dependent and there's nothing
much the API spec could do about this because not all databases
support all different kinds of data types and it is not even
clear for which result columns a specific data type is needed
or desired.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Software directly from the Source  (#1, Jun 04 2003)
 >>> Python/Zope Products & Consulting ...         http://www.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
EuroPython 2003, Charleroi, Belgium:                        20 days left




More information about the DB-SIG mailing list