Database API explanation

Thomas A. Bryan tbryan at python.net
Fri Feb 18 23:43:05 EST 2000


Skip Montanaro wrote:
> 
>     Egbert> I need some help or explanation on the Python Database API
>     Egbert> Specification [12].0 especially how to use them with MySQL, but
>     Egbert> of course some general tutorial is very welcome as well.

> Having overcome the same hurdle with some help from the list, I'll toss out
> a few things I learned.

It is largely empty at the moment, but it would be great if some 
enthusiastic Python DB programmers would add to 

http://starship.python.net/~tbryan/Database/Snippets/

It's a FAQ wizard for collecting fragments of DB code.  Once it 
reaches some critical mass, then we can point newbie Python DB 
programmers to it...

I'm still waiting for some spare time to play with Python and 
databases, but I haven't even touched mxODBC since summer.

Here's an echo from the past:

My Goal: 
The Python DB-API Code Fragment Library will act as a repository for code
fragments (short and long) showing how to use a DB-API compliant database
extension.  It will also act as a repository for code showing the quirks
and exceptions when using specific databases and their extensions.  This
code library is maintained by its users.  That is, if you want to add an
example, please do!  If you find and entry that no longer works, fix it.

Organization: 
Section 1. general info about Python, the DB-API, 
Section 2. generic code for all DB-API compliant databases/modules;
 hopefully the largest section some day, code in this section should 
 work with any Python interface that has fully implemented the spec
Section 3+. specific info about using various databases from Python.
 The first entry is always general info about options for accessing 
 the database from Python (ODBC, one or more extension modules, etc.).
 The following entries should show code that illustrates that database's 
 quirks/deviations from the API or the quirks/deviations of specific 
 extension modules for using that database.

I decided to organize the sections by databaes instead of by python
extension module.  I thought that a DB user would find it easier to locate
the information that he needs that way.  I reserved section one for
non-code stuff...just info about the code library and such.  I also
reserved the first entry of every section for some info about using a
specific database with python (which modules are available, from where,
etc.)

Please add code, modify code, make the code library grow, send me
suggestions (at tbryan at python.net), and generally just get excited about
databases and Python for a few weeks.  A few weeks of fervor followed by a
long idle period where we all neglect the library still leaves a nice
library for newbies to steal code from. :)

The password for changes is:
albatross


---Tom



More information about the Python-list mailing list