How to query for a list of tables in a secondary database I'm working on some Functional tests on a secondary database. Part of the tear down process is to drop tables in the secondary database. How do a make a query like 'show tables' where I can iterate through them and conditionally drop a table when I want to? I've got a connection to the database, like this:

$conn = Database::getConnection('default', 'civicrm_test');
$database = $conn-&gt;getConnectionOptions()['database'];


I was looking at Connection->query() but it doesn't seem to return the results? Is there a different way to get the list of tables so I can return them and act on them individually?
$conn = Database::getConnection('default', 'civicrm_test');
$database = $conn-&gt;getConnectionOptions()['database'];
$conn-&gt;query("SET FOREIGN_KEY_CHECKS = 0");
$tables = $conn-&gt;query('SHOW TABLES')-&gt;fetchAll();
foreach ($tables as $table_result) {
  $table = $table_result-&gt;{"Tables_in_$database"};
  $conn-&gt;query("DROP TABLE $table");
}
$conn-&gt;query("SET FOREIGN_KEY_CHECKS = 1");
$conn-&gt;destroy();


I only needed to disable/enable foreign key checks, because I needed to. Others may not need to.