[DB-SIG] Request: Standardized way to get database schema
Fabien COUTANT
fcoutant@freesurf.fr
Wed, 14 Aug 2002 16:12:01 +0200
Hello,
I'm currently thinking about writing a python based database schema editor, as well as thin helper classes
for database <-> (Gtk) GUI interactions.
I had a quick look outside, to see some approaching tools already exist, but those tools are always specific
to some database (mostly MySQL/PostgreSQL). What I want is a tool that only relies on DB-API standard
drivers.
For my tool I need schema introspection features. Unfortunately, all databases have this feature available,
but always in a specific way. I expected that DB-API would provide a standard way to access those
informations, but it doesn't. Is there any reason for this ?
Wouldn't it be interesting and valuable (I'm pretty sure I'm not the only one missing this feature) to work on a
DB-API extension (or a new version) for this ?
There is not that much information to get if you want to remain standard w.r.t SQL:
- list of tables,
- list of columns for each table,
- list of primary/foreign keys for each table (with target table, and source and target columns)
- standard characteristics of columns (type, nullable, default value)
- indexes for each table
--
Hope this helps,
Fabien.