[DB-SIG] DB-API Spec. 1.1a1
Hannu Krosing
hannu@trust.ee
Wed, 03 Dec 1997 17:15:31 +0200
M.-A. Lemburg wrote:
> Please have a look:
>
> http://starship.skyport.net/~lemburg/DatabaseAPI-1.1.html
>
> I've so far added the exceptions (under new names though) that
> the odbc module introduced and clearified a few other things.
Good to see somebody working on it again
> Most significant change:
> - dbi-type objects must now only be "equal" to the values returned
> in cursor.description. This is to allow more than one value returned
> there to be matched by one of the dbi-objects.
can't we still have _one_ dbi module, that the db modules also use so that
we can still do the 'is' comparison.this is needed for exceptions anyhow.
Also, considering the new packaging scheme in 1.5, the db interface might
also be restructured to use the new scheme.
so that it will actually be db.interface or something
> Points to discuss (apart from the above):
> - Do we really need display_size and internal_size in the description ?
> Python has it's own formatting, so these values aren't really that
> interesting.
We will need something like max_size (for varchars for example), this would
probably be equal to the display_size. The internal size is probably
useless, except for passing to some other modules I can't imagine right now
;)
> - The date/time format. I'd opt for making different alternatives
> available which can be chosen on a per execute basis, e.g. you
> can set the format prior to each execute(), but the format then
> applies to all parameters. There should be new functions in dbi
> for interfacing to these formats and a way to set the default
> format (per connection).
I think that the dbiDate should be defined for tuple or three args as well
(that's the format that I use most of the time) and
dbiTime and dbiDateTime also added.
also, for example Postgres has several additional datatypes (geometric,
array, ...), so should we also add descriptors for them into the dbi
module.
or could we use an approach like os.path does, meaning that each db module
has a member called dbi, that may or may not be the universal dbi module
(on linux os.path is in fact module 'posixpath'). In case the db.dbi is not
same as global dbi, it should at least import the global one and reexpose
the imported type and exception objects.
Hannu Krosing
_______________
DB-SIG - SIG on Tabular Databases in Python
send messages to: db-sig@python.org
administrivia to: db-sig-request@python.org
_______________