[DB-SIG] Proposal: Standardized way to get database schema

Keating, Tim TKeating@origin.ea.com
Wed, 21 Aug 2002 10:55:43 -0500


I love this idea. The only issue I have with the proposed interface is that
it pays homage to an aspect of the DB API that I don't particularly like --
specifically, the separation of items from their descriptions. I understand
that this may have been done in the core API for performance reasons, but I
still find myself having to write some really ugly, non-pythonic code to
e.g. extract data from a row using the column name.

I would very much prefer to see the DB Schema API rely on ADTs for Tables,
Columns etc. that can be browsed in a more natural way, particularly in
light of the fact that schema inspection is not likely to be a frequent
activity.

TK

-----Original Message-----
From: Fabien COUTANT [mailto:fcoutant@freesurf.fr] 
Sent: Wednesday, August 21, 2002 1:29 AM
To: db-sig@python.org
Subject: [DB-SIG] Proposal: Standardized way to get database schema


Hello,

I want to go on the idea of standardizing the way
to introspect a database
schema.

Following the suggestion from Marcos Sanchez
Provencio, I wrote a suggestion for
an API
extension that provides schema introspection.

What I did:
- tried to conform to the
current spirit of the
    API.
- took some ideas from Brian Zimmer
- directly modified HTML since
it's the only
    document I have.
- am not sure whether multi-schema support should
    be kept,
since there is otherwise no support
    for it in the rest of the API.
- the parts about
primary/foreign keys, procedures
    and indexes are incomplete.  I just gave the
    idea.
- not
sure of the exact list of SQL kinds that
    should be included.  I don't remember the
    standard
perfectly...

I hope this can be a starting point, as there
is some work remaining.

NB:
Since I have wrapping problems with my
webmail, I have to include the diff as a
MIME
attachment.  Sorry for the inconvenience.

-- 
Hope this helps,
Fabien.