function drush_sql_get_table_selection

8.0.x drush_sql_get_table_selection()
6.x drush_sql_get_table_selection()
7.x drush_sql_get_table_selection()
3.x drush_sql_get_table_selection()
4.x drush_sql_get_table_selection()
5.x drush_sql_get_table_selection()
master 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()
SqlBase::get_expanded_table_selection in lib/Drush/Sql/SqlBase.php
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.


commands/sql/, line 282
Drush sql commands


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,