mirror of
https://github.com/vrana/adminer.git
synced 2025-08-11 17:14:07 +02:00
Driver specific view detection
This commit is contained in:
@@ -304,6 +304,10 @@ if (isset($_GET["mssql"])) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
function is_view($table_status) {
|
||||
return $table_status["Engine"] == "VIEW";
|
||||
}
|
||||
|
||||
function fk_support($table_status) {
|
||||
return true;
|
||||
}
|
||||
|
@@ -359,7 +359,6 @@ if (!defined("DRIVER")) {
|
||||
$row["Comment"] = preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["Comment"]);
|
||||
}
|
||||
if (!isset($row["Rows"])) {
|
||||
$row["Engine"] = "VIEW";
|
||||
$row["Comment"] = "";
|
||||
}
|
||||
if ($name != "") {
|
||||
@@ -370,6 +369,14 @@ if (!defined("DRIVER")) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Find out whether the identifier is view
|
||||
* @param array
|
||||
* @return bool
|
||||
*/
|
||||
function is_view($table_status) {
|
||||
return !isset($table_status["Rows"]);
|
||||
}
|
||||
|
||||
/** Check if table supports foreign keys
|
||||
* @param array result of table_status
|
||||
* @return bool
|
||||
|
@@ -202,6 +202,10 @@ UNION SELECT view_name, 'view' FROM user_views" . ($name != "" ? " WHERE view_na
|
||||
return $return;
|
||||
}
|
||||
|
||||
function is_view($table_status) {
|
||||
return $table_status["Engine"] == "view";
|
||||
}
|
||||
|
||||
function fk_support($table_status) {
|
||||
return true;
|
||||
}
|
||||
|
@@ -213,6 +213,10 @@ AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema(
|
||||
return ($name != "" ? $return[$name] : $return);
|
||||
}
|
||||
|
||||
function is_view($table_status) {
|
||||
return $table_status["Engine"] == "view";
|
||||
}
|
||||
|
||||
function fk_support($table_status) {
|
||||
return true;
|
||||
}
|
||||
|
@@ -262,6 +262,10 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
return ($name != "" ? $return[$name] : $return);
|
||||
}
|
||||
|
||||
function is_view($table_status) {
|
||||
return $table_status["Engine"] == "view";
|
||||
}
|
||||
|
||||
function fk_support($table_status) {
|
||||
global $connection;
|
||||
return !$connection->result("SELECT sqlite_compileoption_used('OMIT_FOREIGN_KEY')");
|
||||
|
Reference in New Issue
Block a user