[DB-SIG] Remaining issues with DB API 2.0

Greg Stein gstein@lyra.org
Wed, 31 Mar 1999 17:47:56 -0800

Andy Dustman wrote:
> ...
> All of which leads us back to connect(), which we have now established
> (yay) is completely database-dependent, so we acknowledge that interface
> can't cover everything, which is no real embarassment. This really means
> that there should be some design principles involved in writing database
> applications.
> The result of this is, I really only have one module in the system that I
> have to modify. If I really wanted to, I could make a new module (or
> convert to a package) and subclass only a few methods to make it
> compatible with the new database. But then, I shouldn't be depending on
> either hasattr() for capability testing; I should RTFM. Some rewriting
> when switching databases is going to be inevitable, even if I'm using the
> same interface (i.e. mxODBC).


All excellent points, and this is precisely why I view the task of the
DBAPI to be "make them similar enough to allow Python programmers to
easily jump from one to the next" rather than "all database interaction
is truly portable".

For the latter, you can't even use SQL despite its "standardization".


Greg Stein, http://www.lyra.org/