You are here

function drush_schema_inspect in Schema 7

Same name and namespace in other branches
  1. 8 schema.drush.inc \drush_schema_inspect()
  2. 6 schema.drush.inc \drush_schema_inspect()

Implements drush_COMMANDFILE_COMMANDNAME().

File

./schema.drush.inc, line 55
Schema drush commands.

Code

function drush_schema_inspect() {
  $args = func_get_args();
  $names = explode(',', $args[0]);
  $connection = drush_get_option('connection');
  if (!$connection) {
    $connection = 'default';
  }
  foreach ($names as $name) {
    if ($table = schema_dbobject($connection)
      ->inspect(NULL, $name)) {
      $output = schema_phpprint_table($name, $table[$name]);
      drush_print($output);
    }
    else {
      drush_set_error(dt('Mising table: @table', array(
        '@table' => $name,
      )));
    }
  }
}