[DB-SIG] Experiences with DB-API2.0
Fri, 21 Jun 2002 20:32:05 +0200
Tom Jenkins wrote:
> On Fri, 2002-06-21 at 04:35, M.-A. Lemburg wrote:
>>Dustin Sallings wrote:
>>> I'm not saying the DB API is the wrong direction, it's certainly
>>>helping, but it needs to get rid of ambiguities and fill in some blanks.
>>>Any place where there's room for the developer to make decisions that
>>>affect the way the API is used makes it difficult to write code against
>>>the API. Options are only good if they're all required (i.e. the five
>>>quoting techniques). That is to say, options for the user of the driver,
>>>not for the developer of the driver.
>>The freedom is needed so that you can support
>>more than just one backend, e.g. a flat file database is likely
>>to behave differently than a full blown SQL Server.
>>From a driver developer's point of view, but not from an application
> developer's point of view.
But the application developer has the freedom of choice and
that's only possible if there is something to choose from ;-)
>>> So, yeah, there are lots of drivers, but you have to learn how to
>>>use each one at least slightly differently. As long as this occurs, and
>>>as long as people have to change code when switching drivers, the API is
>>Maybe for you, but not for the majority. The DB API has a very
>>long success story. This is evidence enough for me that the
>>approach was the right one.
> I admit that version 1 is better than version 2. I also admit that
> version 2 is not the end-all, be-all.
>>Again, if you don't like dealing with multiple different
>>interface use mxODBC and talk to the database via ODBC.
> This would lock myself and my clients into a single commercial vendor
> solution. That is unacceptable.
Depends on how you see this: mxODBC takes a lot of work off
of your back, so there's less code to write, less support to
invest, less debugging, etc. I was only providing you with
a solution to what you think the problem is.
As I said before: there is freedom of choice.
In reality you'll rarely have to switch database backends for
applications and if you do, you'll make sure that the effort
needed to do this will be minimal (or well-payed ;-).
I do believe that the existing Python database interfaces for
the most common backends have high quality and provide you
with very good and stable interfaces.
CEO eGenix.com Software GmbH
Company & Consulting: http://www.egenix.com/
Python Software: http://www.egenix.com/files/python/
Meet us at EuroPython 2002: http://www.europython.org/