Library for investigating database schemas?

M

Mario T. Lanza

I'm wondering what libraries are available for accessing the most
comprehensive information for a database schema. In particular, I want
information on:

* columns per table
* foreign keys
* column constraints (uniqueness, etc.)
* indexes

I am not sure if this information is accessible via ActiveRecord (some
is regarding the columns) or via DBI.

I will be using a MySQL database (and have heard about
http://www.tmtm.org/en/mysql/ruby/), but I would rather work with a
generic library providing a standard API that is database agnostic.
Also, I know I can get to this information by querying the database
INFORMATION_SCHEMA directly, but, again, I would rather the library be
oblivious to the underlying database and simply provide the schema
information.

Does such a library exist?

Thanks.
Mario T. Lanza
 
C

Clifford Heath

Mario said:
I'm wondering what libraries are available for accessing the most
comprehensive information for a database schema.

As you found, ActiveRecord already fetches column names. The extra
features you've asked for are variously implemented in gems, in
particular composite keys, magic models and DrySQL.

Clifford Heath.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top