On 2007-05-15 21:00, Robert Brewer wrote: > M.-A. Lemburg wrote: >> On 2007-05-15 19:58, Art Protin wrote: >>> No, this can not be done in a standard way above the DB-API >>> level. There is nothing in the DB-API specification that can >>> be used in a DBMS independent manner, that would be assured >>> of producing the answers. One would need to presume that all >>> DBMSs have SQL access to the systems tables and ours for >>> one does not. >> This depends on the database backend. Most of them provide >> system tables with the needed information in one form or >> another. >> >> Others don't and require using special interfaces (at C level). >> >> It's difficult to standardize. ODBC has gotten this pretty well >> sorted out, IMHO, but emulating it in the DB API would be >> quite difficult for the module authors. > > It's not so much that making a standard interface is hard (SQLAlchemy, > for example, and my Dejavu/Geniusql do this quite well).
Well, it's finding the right attributes / selectors for the meta data that's hard. After all, the meta data should be as detailed as possible, but not to a point where the majority of backends wouldn't be able to support the interface or where writing the interface for the meta data would require too much work (for little value). > It's that such > interfaces are then called "Object-Relational Mappers" [1] and are > pretty universally shunned as an arena for standardization. I think we'd just need to standardize this at the DB-API level if there are a significant number of database backends that don't allow querying this meta data via cursor.execute(). Looking at your provider implementations: http://projects.amor.org/geniusql/browser/trunk/geniusql/providers it appears as if most databases do support this kind of introspection. While for some you are using ADO (which essentially uses the same meta data catalog API as ODBC), I think those can also be covered using direct SELECT queries into the system tables. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, May 15 2007) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 _______________________________________________ DB-SIG maillist - DB-SIG@python.org http://mail.python.org/mailman/listinfo/db-sig