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

M.-A. Lemburg mal at lemburg.com
Fri Jun 6 19:47:37 EDT 2003


Harald Meland wrote:
> [M.-A. Lemburg]
> 
> 
>>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.
> 
> Wouldn't it be possible to extend the current specification for
> e.g. DATETIME:
> 
>    DATETIME
>      This type object is used to describe date/time columns in a
>      database.

Note that DATETIME is a type object, not the object being returned
itself. DATETIME (and the others) are only meant to be able to
provide a common ground for the cursor.description tuple entries --
nothing more.

There are no standard date/time objects defined in the spec. Many
DB-API modules use mxDateTime, some return strings, some time.time()
integers, etc. In the future some may also use the Python datetime
module's objects.

Again, DB-API modules are low-level interfaces and you are
asking for higher level standardizations which should really
go into your abstraction layer rather then the spec.

-- 
Marc-Andre Lemburg
eGenix.com

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




More information about the DB-SIG mailing list