[DB-SIG] Next Version [was Re: Preparing statement API]

Stuart 'Zen' Bishop zen@cs.rmit.edu.au
Sat, 29 Jan 2000 10:30:57 +1100 (EST)


On Fri, 28 Jan 2000, Greg Stein wrote:

> Capability discovery of the underlying database is very database-specific.
> We have not defined any functions like that.

I understand this, and have not suggested anything that is particularly
RDBMS specific. 

A common parmstyle could easily be faked with regular expressions (although 
I agree this would be best left up to a higher abstraction layer - perhaps
a db library included with a future python distribution).

At the moment, an autocommit mode _cannot_ be handled at a higher abstraction
layer by checking for the existance of the rollback method and explicitly
calling commit after every transaction if autocommit mode is on. For reasons
why, have a look at footnote 3 of the API. Perhaps the addition of a module
global 'transactionsupport'.
    0 - No rollback
    1 - rollback to last commit

Higher integers would be used if the API ever supports more advanced
transaction mechanisms (are any of these standard?). This module global
cannot be assumed to be a constant, on account of the 'dynamically configured
interfaces' mentioned in footnote 3. Not that I can think of any that exist :-)

Could we have a Footnote stating that a higher level abstraction layer 
is envisaged to add functionality such as:
    autocommit
    generic parameter style
    minimum thread safety (?)
    advanced row retrieval (rows returned as dictionary or user specified
    class)
    other frequent requests as approved :-)

BTW - is anyone working on this, or should I sketch out an API for
general mirth and ridicule?

> Unlike ODBC, the DBAPI is actually intended to be something of a
> least-common-denominator. Capabilities and extensions that are specific to
> a database can be implemented by that specific database provider. Trying
> to create an entirely generic API for database interaction is very tough,
> and is beyond the scope of what most people would like to see. DBAPI
> provides a minimum set of functionality and creates a very good level of
> consistency between the different providers.

Its not too tough though, as we have the advantages of being able to
steal ideas from Perl's DBI which has been in production for ages now,
as well as the advantages of Python (exception handling makes an interface
like this sooo much cleaner).

-- 
 ___
   //     Zen (alias Stuart Bishop)     Work: zen@cs.rmit.edu.au
  // E N  Senior Systems Alchemist      Play: zen@shangri-la.dropbear.id.au
 //__     Computer Science, RMIT 	 WWW: http://www.cs.rmit.edu.au/~zen