public function SqlBase::get_expanded_table_selection

8.0.x SqlBase.php public SqlBase::get_expanded_table_selection()
7.x SqlBase.php public SqlBase::get_expanded_table_selection()
master SqlBase.php public SqlBase::get_expanded_table_selection()

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.

Return value

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

1 call to SqlBase::get_expanded_table_selection()
SqlBase::dump in lib/Drush/Sql/SqlBase.php

File

lib/Drush/Sql/SqlBase.php, line 315

Namespace

Drush\Sql

Class

SqlBase

Code

public function get_expanded_table_selection() {
  $table_selection = drush_sql_get_table_selection();
  // Get the existing table names in the specified database.
  $db_tables = $this->listTables();
  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;
}