[DB-SIG] Asymmetry in DB-API 2.0 types
Harald.Meland at usit.uio.no
Fri Jun 6 02:38:33 EDT 2003
> A standard way to access date, time and datetime objects is, in my
> opinion, a good idea. Most of the drivers I use work with mxDateTime
> but that can cause issues for some people because of the license.
There seems to be no license problem with mxDateTime; however, I would
still feel more comfortable if the DB-API spec included a
specification of what API the various types must support, rather than
*requiring* all driver modules to use a specific third-party module
for e.g. DateTime objects.
Of course, such an type object API specification for DateTime objects
should coincide with (a subset of) the currently recommended
implementation, i.e. mxDateTime.
Now, when all that's said, I also would mention that I think it would
be beneficial if similar type object APIs were hammered out for the
other standard types (STRING, BINARY, NUMBER and ROWID).
As the DB-API spec stands, I'm not sure that it'll always be safe to
treat objects for which "type(object) is driver.STRING" as Python
strings (even though I would be somewhat surprised if I found a driver
where that wasn't the case).
More information about the DB-SIG