[PYTHON DB-SIG] database API

Greg Stein gstein@microsoft.com
Sat, 12 Oct 1996 21:46:50 -0700


>----------
>From: 	Thomas Breuel[SMTP:tmb@best.com]
>Sent: 	Saturday, October 12, 1996 8:54 PM
>To: 	Greg Stein; Thomas Breuel; Thomas Breuel; db-sig@python.org; aaron
>watters
>Subject: 	RE: [PYTHON DB-SIG] database API
>
>But the interface is different from similar interfaces in other
>languages: it has eliminated one or two important concepts and instead
>hints to the implementor at providing additional functionality behind
>the scenes.  That has several consequences:

Please suggest improvements and corrections to the spec if you find
shortcomings. That will help everybody -- users and implementors alike.

> -- experienced users familiar with analogous APIs in other
>    languages will be confused about how functionality they
>    know from other APIs is provided by the PyDB API

This is true and an unfortunate consequence. It was decided to create an
API more Pythonish than representative of existing (C-based) APIs.

> -- the API will give less guidance to novice users as to
>    what the underlying abstractions actually are, since
>    some of them are hidden

Users don't need to know the underlying abstractions. They just need
access to the data in their database. They need to understand the
abstractions exposed by PyDB, not the database.

> -- implementors will receive less guidance about what is
>    expected from a high quality implementation, since some
>    of the abstractions required aren't made explicit

Please point these out, then, so we can get the current spec updated
with as much information as possible. The ODBC implementation, at least,
can help steer people towards the right direction when implementing.
Unfortunately, it is not the highest quality implementation (there is no
implicit cursor on the connection and I'm not sure that it reuses
cursors and data binding areas fully). When somebody finds they need
that, then they can implement it and redistribute the updates. If nobody
ever does, then that means the current implementation is satisfactory
for users (i.e. why build more than people actually need?)

> -- PyDB will probably be looked at as being somewhat inferior
>    to other database APIs

I've never seen it that way and I've seen a number of APIs. I find the
interface quite refreshing to use. There is no way you could get me to
write database code in anything besides Python, and the reason is solely
based on the ease of use of the PyDB API.

>I think the current PyDB spec makes Python a less attractive choice
>than a PyDB spec that would be more closely modeled on ODBC or JDBC.
>Most of the potential users are not going to be familiar with Python or
>PyDB, but they probably do know ODBC or JDBC.

A number of people have used the ODBC version to quite some success. The
underlying question here is whether you are trying to attract people to
using Python to perform database operations, or trying to fulfill Python
users' needs for database operations. I believe that we fulfilled the
latter.

>    In particular, forgive me for being a moron again, but where was
>    that python/db spec? last time I looked at the python.org site it
>    didn't show. (reply privately with url somebody or everybody,
>    please - I wanna try out the ODBC module, and if it works maybe put
>    it to real use with MSAccess on Tuesday...)

http://www.python.org/sigs/db-sig/DatabaseAPI.html. I tried to fix up
the pages the other weekend, but ran into some problems. Ken fixed it
and I should be able to fix up the pages.

>I don't have the URL handy; I'll try and send it out next time I log
>into my work machine.  I have also sketched out a PyDB interface
>analogous to JDBC, which I may include for people to look at.
>While the JDBC spec is relatively long, most of that is because
>of the profusion of statically typed methods required to satisfy
>Java's static type checker; those drop out in a "PyDBC" interface,
>and something like that turns out not to be more complex than the
>current PyDB interface.

Please post your spec to this forum. It would be good to actually see an
alternative.

Also, wouldn't it be PDBC ?  :-)

-g


=================
DB-SIG  - SIG on Tabular Databases in Python

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