1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-11 17:14:07 +02:00

Move possible drivers and JUSH to Driver

This commit is contained in:
Jakub Vrana
2025-03-06 14:27:58 +01:00
parent 049536da90
commit 5fdaae27dc
14 changed files with 38 additions and 83 deletions

View File

@@ -279,6 +279,9 @@ if (isset($_GET["mongo"])) {
class Driver extends SqlDriver {
static $possibleDrivers = array("mongodb");
static $jush = "mongo";
var $editFunctions = array(array("json"));
var $operators = array(
@@ -532,11 +535,4 @@ if (isset($_GET["mongo"])) {
}
return true;
}
function driver_config() {
return array(
'possible_drivers' => array("mongodb"),
'jush' => "mongo",
);
}
}

View File

@@ -186,6 +186,9 @@ if (isset($_GET["mssql"])) {
class Driver extends SqlDriver {
static $possibleDrivers = array("SQLSRV", "PDO_SQLSRV", "PDO_DBLIB");
static $jush = "mssql";
var $editFunctions = array(
array(
"date|time" => "getdate",
@@ -704,11 +707,4 @@ WHERE sys1.xtype = 'TR' AND sys2.name = " . q($table)) as $row
function support($feature) {
return preg_match('~^(check|comment|columns|database|drop_col|dump|indexes|descidx|scheme|sql|table|trigger|view|view_trigger)$~', $feature); //! routine|
}
function driver_config() {
return array(
'possible_drivers' => array("SQLSRV", "PDO_SQLSRV", "PDO_DBLIB"),
'jush' => "mssql",
);
}
}

View File

@@ -281,6 +281,9 @@ if (!defined("DRIVER")) {
class Driver extends SqlDriver {
static $possibleDrivers = array("MySQLi", "MySQL", "PDO_MySQL");
static $jush = "sql"; ///< @var string JUSH identifier
var $unsigned = array("unsigned", "zerofill", "unsigned zerofill");
var $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "FIND_IN_SET", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL");
var $functions = array("char_length", "date", "from_unixtime", "lower", "round", "floor", "ceil", "sec_to_time", "time_to_sec", "upper");
@@ -1196,14 +1199,4 @@ if (!defined("DRIVER")) {
global $connection;
return $connection->result("SELECT @@max_connections");
}
/** Get driver config
* @return array ['possible_drivers' => , 'jush' => ]
*/
function driver_config() {
return array(
'possible_drivers' => array("MySQLi", "MySQL", "PDO_MySQL"),
'jush' => "sql", ///< @var string JUSH identifier
);
}
}

View File

@@ -141,6 +141,9 @@ if (isset($_GET["oracle"])) {
class Driver extends SqlDriver {
static $possibleDrivers = array("OCI8", "PDO_OCI");
static $jush = "oracle";
var $editFunctions = array(
array( //! no parentheses
"date" => "current_date",
@@ -544,11 +547,4 @@ ORDER BY PROCESS
function support($feature) {
return preg_match('~^(columns|database|drop_col|indexes|descidx|processlist|scheme|sql|status|table|variables|view)$~', $feature); //!
}
function driver_config() {
return array(
'possible_drivers' => array("OCI8", "PDO_OCI"),
'jush' => "oracle",
);
}
}

View File

@@ -196,6 +196,9 @@ if (isset($_GET["pgsql"])) {
class Driver extends SqlDriver {
static $possibleDrivers = array("PgSQL", "PDO_PgSQL");
static $jush = "pgsql";
var $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid CSRF
var $functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
var $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
@@ -935,11 +938,4 @@ AND typelem = 0"
global $connection;
return $connection->result("SHOW max_connections");
}
function driver_config() {
return array(
'possible_drivers' => array("PgSQL", "PDO_PgSQL"),
'jush' => "pgsql",
);
}
}

View File

@@ -127,6 +127,9 @@ if (isset($_GET["sqlite"])) {
class Driver extends SqlDriver {
static $possibleDrivers = array("SQLite3", "PDO_SQLite");
static $jush = "sqlite";
protected $types = array(array("integer" => 0, "real" => 0, "numeric" => 0, "text" => 0, "blob" => 0));
var $editFunctions = array(
@@ -737,11 +740,4 @@ if (isset($_GET["sqlite"])) {
function support($feature) {
return preg_match('~^(check|columns|database|drop_col|dump|indexes|descidx|move_col|sql|status|table|trigger|variables|view|view_trigger)$~', $feature);
}
function driver_config() {
return array(
'possible_drivers' => array("SQLite3", "PDO_SQLite"),
'jush' => "sqlite",
);
}
}