[DB-SIG] adodbapi return datetime

Vernon Cole vernondcole at gmail.com
Tue Feb 10 17:12:21 CET 2009


This is a poll:

Should adodbapi be changed so that datetime.datetime is the default return
type for SQL date-time columns?
(The present implementation will default to mx.DateTime if present.)

My feeling is "yes", because
  1) the Python 3.0 version of pywin32 will return COM date-times as
datetime.datetime
  2) mx.DateTime is not (yet?) available on Python 3.0 nor IronPython
  3) as William said, it IS weird to silently change when mxbase is loaded.

But, I am worried about breaking existing code if I change the default.

Your comments solicited...
--
VC

On Tue, Feb 10, 2009 at 8:49 AM, William Dode <wilk at flibuste.net> wrote:

> On 10-02-2009, Vernon Cole wrote:
>
> > William:
> > It has always seemed to me that the syntax you tried should work. Perhaps
> > someday, some "real" Python guru will explain to me why sometimes it does
> > not, and maybe even tell me how to fix it. Perhaps the module definition
> is
> > not done quite right, I dunno? Try adding an extra level of depth to your
> > module reference, and I think you may find that it works.
> >
> adodbapi.adodbapi.dateconverter =
> adodbapi.adodbapi.pythonDateTimeConverter()
>
> >
> > Looks weird to me and I don't understand it, but try it.
>
> It works ! thanks you to answer so quickly.
>
> Do you plan to make datetime the default ?
>
> It's weird that with python >= 2.3 the behaviour will silently change if
> we add mx package !
>
> --
> William Dodé - http://flibuste.net
> Informaticien Indépendant
>
> _______________________________________________
> DB-SIG maillist  -  DB-SIG at python.org
> http://mail.python.org/mailman/listinfo/db-sig
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/db-sig/attachments/20090210/599f8a3b/attachment.htm>


More information about the DB-SIG mailing list