$connectionInfo =
(new DatabaseConnectionInformation())->
assign($request->request->
all());
try { $connection =
$this->connectionFactory->
getConnection($connectionInfo, true
);
} catch (\Exception
) { return new JsonResponse();
} // No need for listing the following schemas
$ignoredSchemas =
['information_schema', 'performance_schema', 'sys', 'mysql'
];
$databaseNames =
$this->setupDatabaseAdapter->
getExistingDatabases($connection,
$ignoredSchemas);
$result =
[];
foreach ($databaseNames as $databaseName) { $result[$databaseName] =
$this->setupDatabaseAdapter->
getTableCount($connection,
$databaseName) > 0;
} return new JsonResponse($result);
}}