[DB-SIG] adodbapi return datetime

M.-A. Lemburg mal at egenix.com
Tue Feb 10 19:14:11 CET 2009

On 2009-02-10 18:42, William Dode wrote:
> On 10-02-2009, Robert Brewer wrote:
>> Vernon Cole wrote:
>>> Should adodbapi be changed so that datetime.datetime is
>>> the default return type for SQL date-time columns?
>> Almost certainly at the next major version.

It's probably better to make this an explicit choice.

> For me the weird problem of a different behaviour if mx is installed or 
> not is enough to change this in a minor version.
> The question will be, what to do if the release stay compatible with 
> python < 2.3
> iirc Guido argued to put this (datetime by default) in the dbapi spec 
> isn'it ?

The DB-API allows the module to make a choice of which implementation
to use. mxDateTime has been the defacto standard for many years, so
there's a lot of code out there relying on it and mxDateTime is
still very much alive.

Database modules are free to support more than just one way to interface
to date/time values in databases, e.g. Unix ticks, time tuples,
strings, mxDateTime, datetime module, custom types, etc. The spec
itself doesn't mandate a default.

You have the same situation for monetary values, decimal values,
blobs and text.

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Feb 10 2009)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611

More information about the DB-SIG mailing list