Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am setting up some reports using DB API to query custom content fields, and rendering them in tables and charts. I am looking for a way to easily look up the names of tables and fields in the Drupal DB.

My Question: Is there a Devel-type module that provides an easy reference of the live DB schema?

Currently I'm using drush sql-cli and/or phpmyadmin, so the solution should be something simpler than that.

share|improve this question
up vote 2 down vote accepted

I think the Schema Module can handle that...

  • Schema documentation: hyperlinked display of the schema's embedded documentation explaining what each table and field is for.

I confess I haven't tried it but the module page mentions

the INFORMATION_SCHEMA database that the Schema module uses to inspect the database.

so I imagine it has the functionality you're looking for, plus inspection of the live db if you need it.

Or if you don't mind wading through a large krumo array you can always use drupal_get_schema()

share|improve this answer

You can list db tables with

  • mysql: show tables;
  • psql: \d

However, a better way to get field information would be via a Drupal module and use:

To get the detailed field and instance information.

Table information for each field is also stored in the info structure.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.