[DB-SIG] Getting schemas and other niceties

M.-A. Lemburg mal at lemburg.com
Sat Jul 19 16:16:56 EDT 2003

Fabien COUTANT wrote:
> OR mappers are a specific thing that depend on target language, object
> design and underlying data model, and I fully agree there should be nothing
> about them in a DB access API:  they deserve an layer/software on their
> own.
> Howver the data model is where a DB access API is concerned.  There is a
> whole class of software that deserves a schema access API:  OR mappers, DB
> designers / reverse-engineering tools, automatic code and web/GUI forms
> generator, and there are surely others.
> This class of software may be bigger than you think, and we, as application
> developers, would have greater choice and benefit if those tools were not
> limited each to a few DMBS, but instead worked using a common API.  Why are
> there so many Java tools about DB design, OR mapping, code or form
> generation ?  Because JDBC has standardized a schema introspection API !
> So why not doing the same with Python ?

Uhm, we already have such an interface: mxODBC provides these
interfaces for CPython and zxJDBC for Jython.

> Such an extension would be optional, written only once in a given driver,
> and would benefit a whole set of tools, so this would actually be easier
> to do than duplicating/understanding/debugging/etc code in each of those
> tools.
 > ...
>>W/r to the subject line, I think the best workable approach that
>>the industry has come up with is the ODBC approach to schema
> Don't know ODBC, only got my hands on JDBC.  I suppose they are similar wrt
> schema inspection.

Have a look at http://www.egenix.com/files/python/mxODBC.pdf
for a list of cursor level APIs for DB introspection. ODBC has
had these for a long time and they have proven to provide
everything you need for the class of software you describe
above. zxJDBC provides the same set of APIs on top of JDBC.

If we add optional DB-API extensions, then I'd suggest to
simply go with the set defined in the mxODBC docs.

Marc-Andre Lemburg

Professional Python Software directly from the Source  (#1, Jul 19 2003)
 >>> Python/Zope Products & Consulting ...         http://www.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
2003-07-01: Released mxODBC.Zope.DA for FreeBSD             1.0.6 beta 1

More information about the DB-SIG mailing list