1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-06 22:56:46 +02:00

Add helper for $connection2

This commit is contained in:
Jakub Vrana
2025-03-29 22:21:18 +01:00
parent 291ae7f1ac
commit 9b6943d5af
3 changed files with 9 additions and 16 deletions

View File

@@ -270,9 +270,7 @@ if (isset($_GET["sqlite"])) {
}
function indexes($table, $connection2 = null) {
if (!is_object($connection2)) {
$connection2 = connection();
}
$connection2 = connection($connection2);
$return = array();
$sql = get_val("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = " . q($table), 0, $connection2);
if (preg_match('~\bPRIMARY\s+KEY\s*\((([^)"]+|"[^"]*"|`[^`]*`)++)~i', $sql, $match)) {