function drush_sql_get_table_selection

8.0.x sql.drush.inc drush_sql_get_table_selection()
6.x sql.drush.inc drush_sql_get_table_selection()
7.x sql.drush.inc drush_sql_get_table_selection()
3.x sql.drush.inc drush_sql_get_table_selection()
4.x sql.drush.inc drush_sql_get_table_selection()
5.x sql.drush.inc drush_sql_get_table_selection()
master sql.drush.inc drush_sql_get_table_selection()

Construct an array that places table names in appropriate buckets based on whether the table is to be skipped, included for structure only, or have structure and data dumped. The keys of the array are:

  • skip: tables to be skipped completed in the dump
  • structure: tables to only have their structure i.e. DDL dumped
  • tables: tables to have structure and data dumped

Return value

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

1 call to drush_sql_get_table_selection()
drush_sql_get_expanded_table_selection in commands/sql/sql.drush.inc
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.

File

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

Code

function drush_sql_get_table_selection() {
  // Skip large core tables if instructed.  Used by 'sql-drop/sql-dump/sql-sync' commands.
  $skip_tables = _drush_sql_get_raw_table_list('skip-tables');
  // Skip any structure-tables as well.
  $structure_tables = _drush_sql_get_raw_table_list('structure-tables');
  // Dump only the specified tables.  Takes precedence over skip-tables and structure-tables.
  $tables = _drush_sql_get_raw_table_list('tables');

  return array(
    'skip' => $skip_tables,
    'structure' => $structure_tables,
    'tables' => $tables,
  );
}