function drush_sql_get_expanded_table_selection

6.x sql.drush.inc drush_sql_get_expanded_table_selection($db_spec, $site_record = NULL)

Get a list of all table names and expand input that may contain wildcards (`*`) if necessary so that the array returned only contains valid table names i.e. actual tables that exist, without a wildcard.

Parameters

$db_spec: For D5/D6, a $db_url. For D7+, a target in the default DB connection.

$site_record: Necessary for remote database.

Return value

array An array of tables with each table name in the appropriate element of the array.

3 calls to drush_sql_get_expanded_table_selection()
drush_archive_dump in commands/core/archive.drush.inc
Command callback. Generate site archive file.
drush_sql_dump in commands/sql/sql.drush.inc
Build a mysqldump/pg_dump/sqlite statement.
drush_sql_sync in commands/sql/sync.sql.inc

File

commands/sql/sql.drush.inc, line 449
Drush sql commands

Code

function drush_sql_get_expanded_table_selection($db_spec, $site_record = NULL) {
  $table_selection = drush_sql_get_table_selection();
  // Get the existing table names in the specified database.
  $db_tables = _drush_sql_get_db_table_list($db_spec, $site_record);
  if (isset($table_selection['skip'])) {
    $table_selection['skip'] = _drush_sql_expand_and_filter_tables($table_selection['skip'], $db_tables);
  }
  if (isset($table_selection['structure'])) {
    $table_selection['structure'] = _drush_sql_expand_and_filter_tables($table_selection['structure'], $db_tables);
  }
  if (isset($table_selection['tables'])) {
    $table_selection['tables'] = _drush_sql_expand_and_filter_tables($table_selection['tables'], $db_tables);
  }
  return $table_selection;
}