[DB-SIG] Optional DB API Extensions

M.-A. Lemburg mal@lemburg.com
Fri, 26 Oct 2001 14:46:04 +0200

Andy Dustman wrote:
> On Tue, 2001-10-23 at 11:04, M.-A. Lemburg wrote:
> >     Cursor Attribute .rownumber
> Now implemented in MySQLdb (was cursor._pos).
> >     Cursor Method .scroll(value[,mode='relative'])
> Currently I have cursor.seek() and cursor.tell(), which work as the file
> object methods.

Hmm, not a bad idea... following the file interface here (except
that .tell() is already available through .rownumber).
> >    Cursor Attribute .messages
> >    Connection Attribute .messages
> Not really sold on these yet, particularly the last one. Presently you
> can turn Warnings off, and look at cursor._info (or connection.info())
> for the last message.

The error handling callback thingie I mentioned in one of the 
replies would go a long way here... it basically provides a way
for the user to add her own error handler which then raises
exceptions, adds messages to the list etc.

The reason I added the above attributes is to give these handlers
a standard location to put their messages and the user a standard
place to look for them.

About connection.messages -- you may not need this since you only
support one database, in mxODBC however there can be a whole
number of different databases connected to the system, and then
there's the ODBC manager which deals with these too, so 
connection.messages is really important for mxODBC (esp. at
connection time, since so many things can go wrong at that
stage due to misconfigurations etc.).

Thanks for you input,
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
Consulting & Company:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/