[DB-SIG] Experiences with DB-API2.0

Dustin Sallings dustin@spy.net
Thu, 20 Jun 2002 09:25:50 -0700


Around 07:54 on Jun 20, 2002, Tom Jenkins said:

# Same thing here Horst.  Also exception handling is difficult as each has
# their own exception types.
#
# This is one of the reasons why I'm now subscribed on this list.  We're a
# big postgres & python company (with Access mixed in <groan>).  Having
# seamless switching between adapters is important to us.
#
# I figured it wasn't right of me to bitch without doing any work to fix
# it.  So when 3.0 api gets discussed, I plan on being here.

	Not to sound all AOLish, but this is my exact experience.  I came
to python from Java, and I've found that many of the APIs seem much less
well designed.  Honestly, I believe the python community should try to
leverage some of the design from JDBC.  All exception types are covered,
there's no ambiguity (hard to write a DB indepdent lib when you have to
figure out at runtime which of the five quoting styles the driver wants
and have queries and code ready to deal with each one).

	I think a good start would be telling the drivers exactly what to
do in any given circumstance rather than leaving it up to the developer to
decide.  It would be nice, for example, if thread safety were clearly
defined for all modules rather than giving the driver developer a choice
of options.

	I also believe a proper resultset object would be a huge
improvement over list results.  I saw a proposal come through here that
looked pretty good, but it still allowed ambiguity (result rows were
accessible via __getitem__ *or* direct attributes on the row, I think the
latter is a bad idea because it wouldn't work in all situations).

	Unfortunately, I haven't had the time to implement what I think
would make life easier yet.

--
SPY                      My girlfriend asked me which one I like better.
pub  1024/3CAE01D5 1994/11/03 Dustin Sallings <dustin@spy.net>
|    Key fingerprint =  87 02 57 08 02 D0 DA D6  C8 0F 3E 65 51 98 D8 BE
L_______________________ I hope the answer won't upset her. ____________