public function Sqlmysql::listTables

8.0.x Sqlmysql.php public Sqlmysql::listTables()
7.x Sqlmysql.php public Sqlmysql::listTables()
master Sqlmysql.php public Sqlmysql::listTables()

Extract the name of all existing tables in the given database.

Return value

array|null An array of table names which exist in the current database.

Overrides SqlBase::listTables

File

lib/Drush/Sql/Sqlmysql.php, line 112

Namespace

Drush\Sql

Class

Sqlmysql

Code

public function listTables() {
  $current = drush_get_context('DRUSH_SIMULATE');
  drush_set_context('DRUSH_SIMULATE', FALSE);
  $return = $this->query('SHOW TABLES;');
  $tables = drush_shell_exec_output();
  drush_set_context('DRUSH_SIMULATE', $current);
  return $tables;
}