mirror of
https://github.com/vrana/adminer.git
synced 2025-08-07 15:16:44 +02:00
SQLite: Detect auto_increment primary key
This commit is contained in:
@@ -333,6 +333,13 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
$return[""]["descs"][] = (preg_match('~DESC~i', $match[5]) ? '1' : null);
|
||||
}
|
||||
}
|
||||
if (!$return) {
|
||||
foreach (fields($table) as $name => $field) {
|
||||
if ($field["primary"]) {
|
||||
$return[""] = array("type" => "PRIMARY", "columns" => array($name), "lengths" => array(), "descs" => array());
|
||||
}
|
||||
}
|
||||
}
|
||||
$sqls = get_key_vals("SELECT name, sql FROM sqlite_master WHERE type = 'index' AND tbl_name = " . q($table), $connection2);
|
||||
foreach (get_rows("PRAGMA index_list(" . table($table) . ")", $connection2) as $row) {
|
||||
$name = $row["name"];
|
||||
|
Reference in New Issue
Block a user