mirror of
https://github.com/vrana/adminer.git
synced 2025-08-11 17:14:07 +02:00
Add helper for $connection2
This commit is contained in:
@@ -451,9 +451,7 @@ ORDER BY a.attnum") as $row
|
||||
}
|
||||
|
||||
function indexes($table, $connection2 = null) {
|
||||
if (!is_object($connection2)) {
|
||||
$connection2 = connection();
|
||||
}
|
||||
$connection2 = connection($connection2);
|
||||
$return = array();
|
||||
$table_oid = get_val("SELECT oid FROM pg_class WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema()) AND relname = " . q($table), 0, $connection2);
|
||||
$columns = get_key_vals("SELECT attnum, attname FROM pg_attribute WHERE attrelid = $table_oid AND attnum > 0", $connection2);
|
||||
|
@@ -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)) {
|
||||
|
Reference in New Issue
Block a user