How to query for a list of tables in a secondary database
$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.