MySQL database schema discovery

Tim Golden mail at timgolden.me.uk
Fri Mar 22 12:09:59 EDT 2013


On 22/03/2013 16:01, Roy Smith wrote:
> What are my options for MySQL schema discovery?  I want to be able to
> find all the tables in a database, and discover the names and types of
> each column (i.e. the standard schema discovery stuff).
> 
> PEP 249 doesn't seem to have any discovery methods.  Nor does MySQLdb
> appear to have any non-standard extentions for this.  I could probably
> do this with SQLAlchemy, but I'm trying to avoid that because it's so
> heavyweight.
> 

MySQL appears to support the standard(ish) INFORMATION_SCHEMA schema:

  http://dev.mysql.com/doc/refman/5.0/en/information-schema.html

TJG




More information about the Python-list mailing list