[PYTHON DB-SIG] Python Database API

Greg Stein gstein@microsoft.com
Tue, 15 Apr 1997 19:55:08 -0700


Hmm. I thought there was a spec for DBI (just checked... there is, but
it doesn't cover the "generic" exceptions). Personally, I have no
objections to your extensions, but I'd recommend ensuring that your
changes get propagated to the other DBAPI modules. It might be worth it
to have somebody step up as the "owner" of the DBI as a separate entity.
It would be available separately, but the modules simply repackage it.

If you could write a spec for your new DBI to go along with what you
code, and nobody has any objections, then we can plop that up onto the
web site.

I would say that any cursors associated with a closed connection become
unusable. Closing cursors should not have an impact on the connection.

I've never dealt with callproc. In truth, I'm not positive that it is
needed after all. It seems to be quite possible to simply use execute()
for store procedures in addition to (SQL) statements.

One interesting note: the ODBC module is apparently quite fast
relatively to other mechanisms available to Python for accessing
databases (e.g. ADO). You can *make* ADO go faster, but it takes a good
amount of fine tuning and voodoo. Empirically, the ODBC module is simple
to use (love that API!) and capable of being quite efficient.

To fetch/insert more than one row at a time, are you using the row count
from fetchmany() and/or the arraysize attribute?

-g

	-----Original Message-----
	From:	Anthony Baxter [SMTP:arb@connect.com.au]
	Sent:	Monday, April 14, 1997 9:31 PM
	To:	Greg Stein
	Cc:	'Mona E. Gamboa'; db-sig@python.org
	Subject:	Re: [PYTHON DB-SIG] Python Database API 


	>>> Greg Stein wrote
	> The API is stable and has not changed since then. There are
some changes
	> to DBI (as mentioned) that have not been documented yet. The
"spec" for
	> that can be found via the code of the various other modules
(odbc,
	> oracle, informix).

	FWIW, I'd like to fill in a few of the "not well defined yet"
bits - I'm
	currently rewriting the oracle module (amongst other things, to
get more
	than one row at a time, and to use the thread-safe interfaces of
Oracle 7.3)

	As far as I can see, there's no spec for the DBI stuff. I'd like
to
	be able to specify creation of dbiDates, using either a delta,
or a
	7-tuple, as produced by time.gmtime() and friends. The current
oracle
	module forces everything to be done in terms of localtime, which
is bad.

	Other things: currently the spec says connection.close() should
render
	the connection unusable, and any attempts to use the connection
should
	raise an exception. Should this also apply to any cursors
created from
	the connection?
	What about cursor.close()? Should that just nuke the current
cursor, or
	the connection it's attached to? 

	Has anyone done anything with connection.callproc() at all?

	Anthony

_______________
DB-SIG  - SIG on Tabular Databases in Python

send messages to: db-sig@python.org
administrivia to: db-sig-request@python.org
_______________