return preg_match("~^(columns|sql|status|table|drop_col)$~", $feature);
}
- $jush = "clickhouse";
- $types = array();
- $structured_types = array();
- foreach (array( //! arrays
- lang('Numbers') => array("Int8" => 3, "Int16" => 5, "Int32" => 10, "Int64" => 19, "UInt8" => 3, "UInt16" => 5, "UInt32" => 10, "UInt64" => 20, "Float32" => 7, "Float64" => 16, 'Decimal' => 38, 'Decimal32' => 9, 'Decimal64' => 18, 'Decimal128' => 38),
- lang('Date and time') => array("Date" => 13, "DateTime" => 20),
- lang('Strings') => array("String" => 0),
- lang('Binary') => array("FixedString" => 0),
- ) as $key => $val) {
- $types += $val;
- $structured_types[$key] = array_keys($val);
- }
- $unsigned = array();
- $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL");
- $functions = array();
- $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
- $edit_functions = array();
+ function driver_config() {
+ $types = array();
+ $structured_types = array();
+ foreach (array( //! arrays
+ lang('Numbers') => array("Int8" => 3, "Int16" => 5, "Int32" => 10, "Int64" => 19, "UInt8" => 3, "UInt16" => 5, "UInt32" => 10, "UInt64" => 20, "Float32" => 7, "Float64" => 16, 'Decimal' => 38, 'Decimal32' => 9, 'Decimal64' => 18, 'Decimal128' => 38),
+ lang('Date and time') => array("Date" => 13, "DateTime" => 20),
+ lang('Strings') => array("String" => 0),
+ lang('Binary') => array("FixedString" => 0),
+ ) as $key => $val) {
+ $types += $val;
+ $structured_types[$key] = array_keys($val);
+ }
+ return array(
+ 'jush' => "clickhouse",
+ 'types' => $types,
+ 'structured_types' => $structured_types,
+ 'unsigned' => array(),
+ 'operators' => array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"),
+ 'functions' => array(),
+ 'grouping' => array("avg", "count", "count distinct", "max", "min", "sum"),
+ 'edit_functions' => array(),
+ );
+ }
}
$drivers["elastic"] = "Elasticsearch (beta)";
if (isset($_GET["elastic"])) {
- $possible_drivers = array("json + allow_url_fopen");
define("DRIVER", "elastic");
if (function_exists('json_decode') && ini_bool('allow_url_fopen')) {
return $connection->last_id;
}
- $jush = "elastic";
- $operators = array("=", "query");
- $functions = array();
- $grouping = array();
- $edit_functions = array(array("json"));
- $types = array(); ///< @var array ($type => $maximum_unsigned_length, ...)
- $structured_types = array(); ///< @var array ($description => array($type, ...), ...)
- foreach (array(
- lang('Numbers') => array("long" => 3, "integer" => 5, "short" => 8, "byte" => 10, "double" => 20, "float" => 66, "half_float" => 12, "scaled_float" => 21),
- lang('Date and time') => array("date" => 10),
- lang('Strings') => array("string" => 65535, "text" => 65535),
- lang('Binary') => array("binary" => 255),
- ) as $key => $val) {
- $types += $val;
- $structured_types[$key] = array_keys($val);
+ function driver_config() {
+ $types = array();
+ $structured_types = array();
+ foreach (array(
+ lang('Numbers') => array("long" => 3, "integer" => 5, "short" => 8, "byte" => 10, "double" => 20, "float" => 66, "half_float" => 12, "scaled_float" => 21),
+ lang('Date and time') => array("date" => 10),
+ lang('Strings') => array("string" => 65535, "text" => 65535),
+ lang('Binary') => array("binary" => 255),
+ ) as $key => $val) {
+ $types += $val;
+ $structured_types[$key] = array_keys($val);
+ }
+ return array(
+ 'possible_drivers' => array("json + allow_url_fopen"),
+ 'jush' => "elastic",
+ 'operators' => array("=", "query"),
+ 'functions' => array(),
+ 'grouping' => array(),
+ 'edit_functions' => array(array("json")),
+ 'types' => $types,
+ 'structured_types' => $structured_types,
+ );
}
}
$drivers['firebird'] = 'Firebird (alpha)';
if (isset($_GET["firebird"])) {
- $possible_drivers = array("interbase");
define("DRIVER", "firebird");
if (extension_loaded("interbase") ) {
return preg_match("~^(columns|sql|status|table)$~", $feature);
}
- $jush = "firebird";
- $operators = array("=");
- $functions = array();
- $grouping = array();
- $edit_functions = array();
+ function driver_config() {
+ return array(
+ 'possible_drivers' => array("interbase"),
+ 'jush' => "firebird",
+ 'operators' => array("="),
+ 'functions' => array(),
+ 'grouping' => array(),
+ 'edit_functions' => array(),
+ );
+ }
}
$drivers["mongo"] = "MongoDB";
if (isset($_GET["mongo"])) {
- $possible_drivers = array("mongo", "mongodb");
define("DRIVER", "mongo");
if (class_exists('MongoDB\Driver\Manager')) {
return true;
}
- $jush = "mongo";
- $functions = array();
- $grouping = array();
- $edit_functions = array(array("json"));
+ function driver_config() {
+ return array(
+ 'possible_drivers' => array("mongo", "mongodb"),
+ 'jush' => "mongo",
+ 'functions' => array(),
+ 'grouping' => array(),
+ 'edit_functions' => array(array("json")),
+ );
+ }
}
$drivers["mssql"] = "MS SQL (beta)";
if (isset($_GET["mssql"])) {
- $possible_drivers = array("SQLSRV", "MSSQL", "PDO_DBLIB");
define("DRIVER", "mssql");
if (extension_loaded("sqlsrv")) {
class Min_DB {
return preg_match('~^(comment|columns|database|drop_col|indexes|descidx|scheme|sql|table|trigger|view|view_trigger)$~', $feature); //! routine|
}
- $jush = "mssql";
- $types = array();
- $structured_types = array();
- foreach (array( //! use sys.types
- lang('Numbers') => array("tinyint" => 3, "smallint" => 5, "int" => 10, "bigint" => 20, "bit" => 1, "decimal" => 0, "real" => 12, "float" => 53, "smallmoney" => 10, "money" => 20),
- lang('Date and time') => array("date" => 10, "smalldatetime" => 19, "datetime" => 19, "datetime2" => 19, "time" => 8, "datetimeoffset" => 10),
- lang('Strings') => array("char" => 8000, "varchar" => 8000, "text" => 2147483647, "nchar" => 4000, "nvarchar" => 4000, "ntext" => 1073741823),
- lang('Binary') => array("binary" => 8000, "varbinary" => 8000, "image" => 2147483647),
- ) as $key => $val) {
- $types += $val;
- $structured_types[$key] = array_keys($val);
- }
- $unsigned = array();
- $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL");
- $functions = array("len", "lower", "round", "upper");
- $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
- $edit_functions = array(
- array(
- "date|time" => "getdate",
- ), array(
- "int|decimal|real|float|money|datetime" => "+/-",
- "char|text" => "+",
- )
- );
+ function driver_config() {
+ $types = array();
+ $structured_types = array();
+ foreach (array( //! use sys.types
+ lang('Numbers') => array("tinyint" => 3, "smallint" => 5, "int" => 10, "bigint" => 20, "bit" => 1, "decimal" => 0, "real" => 12, "float" => 53, "smallmoney" => 10, "money" => 20),
+ lang('Date and time') => array("date" => 10, "smalldatetime" => 19, "datetime" => 19, "datetime2" => 19, "time" => 8, "datetimeoffset" => 10),
+ lang('Strings') => array("char" => 8000, "varchar" => 8000, "text" => 2147483647, "nchar" => 4000, "nvarchar" => 4000, "ntext" => 1073741823),
+ lang('Binary') => array("binary" => 8000, "varbinary" => 8000, "image" => 2147483647),
+ ) as $key => $val) {
+ $types += $val;
+ $structured_types[$key] = array_keys($val);
+ }
+ return array(
+ 'possible_drivers' => array("SQLSRV", "MSSQL", "PDO_DBLIB"),
+ 'jush' => "mssql",
+ 'types' => $types,
+ 'structured_types' => $structured_types,
+ 'unsigned' => array(),
+ 'operators' => array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"),
+ 'functions' => array("len", "lower", "round", "upper"),
+ 'grouping' => array("avg", "count", "count distinct", "max", "min", "sum"),
+ 'edit_functions' => array(
+ array(
+ "date|time" => "getdate",
+ ), array(
+ "int|decimal|real|float|money|datetime" => "+/-",
+ "char|text" => "+",
+ )
+ ),
+ );
+ }
}
$drivers = array("server" => "MySQL") + $drivers;
if (!defined("DRIVER")) {
- $possible_drivers = array("MySQLi", "MySQL", "PDO_MySQL");
define("DRIVER", "server"); // server - backwards compatibility
// MySQLi supports everything, MySQL doesn't support multiple result sets, PDO_MySQL doesn't support orgtable
if (extension_loaded("mysqli")) {
return $connection->result("SELECT @@max_connections");
}
- $jush = "sql"; ///< @var string JUSH identifier
- $types = array(); ///< @var array ($type => $maximum_unsigned_length, ...)
- $structured_types = array(); ///< @var array ($description => array($type, ...), ...)
- foreach (array(
- lang('Numbers') => array("tinyint" => 3, "smallint" => 5, "mediumint" => 8, "int" => 10, "bigint" => 20, "decimal" => 66, "float" => 12, "double" => 21),
- lang('Date and time') => array("date" => 10, "datetime" => 19, "timestamp" => 19, "time" => 10, "year" => 4),
- lang('Strings') => array("char" => 255, "varchar" => 65535, "tinytext" => 255, "text" => 65535, "mediumtext" => 16777215, "longtext" => 4294967295),
- lang('Lists') => array("enum" => 65535, "set" => 64),
- lang('Binary') => array("bit" => 20, "binary" => 255, "varbinary" => 65535, "tinyblob" => 255, "blob" => 65535, "mediumblob" => 16777215, "longblob" => 4294967295),
- lang('Geometry') => array("geometry" => 0, "point" => 0, "linestring" => 0, "polygon" => 0, "multipoint" => 0, "multilinestring" => 0, "multipolygon" => 0, "geometrycollection" => 0),
- ) as $key => $val) {
- $types += $val;
- $structured_types[$key] = array_keys($val);
+ /** Get driver config
+ * @return array array('possible_drivers' => , 'jush' => , 'types' => , 'structured_types' => , 'unsigned' => , 'operators' => , 'functions' => , 'grouping' => , 'edit_functions' => )
+ */
+ function driver_config() {
+ $types = array(); ///< @var array ($type => $maximum_unsigned_length, ...)
+ $structured_types = array(); ///< @var array ($description => array($type, ...), ...)
+ foreach (array(
+ lang('Numbers') => array("tinyint" => 3, "smallint" => 5, "mediumint" => 8, "int" => 10, "bigint" => 20, "decimal" => 66, "float" => 12, "double" => 21),
+ lang('Date and time') => array("date" => 10, "datetime" => 19, "timestamp" => 19, "time" => 10, "year" => 4),
+ lang('Strings') => array("char" => 255, "varchar" => 65535, "tinytext" => 255, "text" => 65535, "mediumtext" => 16777215, "longtext" => 4294967295),
+ lang('Lists') => array("enum" => 65535, "set" => 64),
+ lang('Binary') => array("bit" => 20, "binary" => 255, "varbinary" => 65535, "tinyblob" => 255, "blob" => 65535, "mediumblob" => 16777215, "longblob" => 4294967295),
+ lang('Geometry') => array("geometry" => 0, "point" => 0, "linestring" => 0, "polygon" => 0, "multipoint" => 0, "multilinestring" => 0, "multipolygon" => 0, "geometrycollection" => 0),
+ ) as $key => $val) {
+ $types += $val;
+ $structured_types[$key] = array_keys($val);
+ }
+ return array(
+ 'possible_drivers' => array("MySQLi", "MySQL", "PDO_MySQL"),
+ 'jush' => "sql", ///< @var string JUSH identifier
+ 'types' => $types,
+ 'structured_types' => $structured_types,
+ 'unsigned' => array("unsigned", "zerofill", "unsigned zerofill"), ///< @var array number variants
+ 'operators' => array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "FIND_IN_SET", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL"), ///< @var array operators used in select
+ 'functions' => array("char_length", "date", "from_unixtime", "lower", "round", "floor", "ceil", "sec_to_time", "time_to_sec", "upper"), ///< @var array functions used in select
+ 'grouping' => array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"), ///< @var array grouping functions used in select
+ 'edit_functions' => array( ///< @var array of array("$type|$type2" => "$function/$function2") functions used in editing, [0] - edit and insert, [1] - edit only
+ array(
+ "char" => "md5/sha1/password/encrypt/uuid",
+ "binary" => "md5/sha1",
+ "date|time" => "now",
+ ), array(
+ number_type() => "+/-",
+ "date" => "+ interval/- interval",
+ "time" => "addtime/subtime",
+ "char|text" => "concat",
+ )
+ ),
+ );
}
- $unsigned = array("unsigned", "zerofill", "unsigned zerofill"); ///< @var array number variants
- $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "FIND_IN_SET", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL"); ///< @var array operators used in select
- $functions = array("char_length", "date", "from_unixtime", "lower", "round", "floor", "ceil", "sec_to_time", "time_to_sec", "upper"); ///< @var array functions used in select
- $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"); ///< @var array grouping functions used in select
- $edit_functions = array( ///< @var array of array("$type|$type2" => "$function/$function2") functions used in editing, [0] - edit and insert, [1] - edit only
- array(
- "char" => "md5/sha1/password/encrypt/uuid",
- "binary" => "md5/sha1",
- "date|time" => "now",
- ), array(
- number_type() => "+/-",
- "date" => "+ interval/- interval",
- "time" => "addtime/subtime",
- "char|text" => "concat",
- )
- );
}
$drivers["oracle"] = "Oracle (beta)";
if (isset($_GET["oracle"])) {
- $possible_drivers = array("OCI8", "PDO_OCI");
define("DRIVER", "oracle");
if (extension_loaded("oci8")) {
class Min_DB {
return preg_match('~^(columns|database|drop_col|indexes|descidx|processlist|scheme|sql|status|table|variables|view|view_trigger)$~', $feature); //!
}
- $jush = "oracle";
- $types = array();
- $structured_types = array();
- foreach (array(
- lang('Numbers') => array("number" => 38, "binary_float" => 12, "binary_double" => 21),
- lang('Date and time') => array("date" => 10, "timestamp" => 29, "interval year" => 12, "interval day" => 28), //! year(), day() to second()
- lang('Strings') => array("char" => 2000, "varchar2" => 4000, "nchar" => 2000, "nvarchar2" => 4000, "clob" => 4294967295, "nclob" => 4294967295),
- lang('Binary') => array("raw" => 2000, "long raw" => 2147483648, "blob" => 4294967295, "bfile" => 4294967296),
- ) as $key => $val) {
- $types += $val;
- $structured_types[$key] = array_keys($val);
- }
- $unsigned = array();
- $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL");
- $functions = array("length", "lower", "round", "upper");
- $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
- $edit_functions = array(
- array( //! no parentheses
- "date" => "current_date",
- "timestamp" => "current_timestamp",
- ), array(
- "number|float|double" => "+/-",
- "date|timestamp" => "+ interval/- interval",
- "char|clob" => "||",
- )
- );
+ function driver_config() {
+ $types = array();
+ $structured_types = array();
+ foreach (array(
+ lang('Numbers') => array("number" => 38, "binary_float" => 12, "binary_double" => 21),
+ lang('Date and time') => array("date" => 10, "timestamp" => 29, "interval year" => 12, "interval day" => 28), //! year(), day() to second()
+ lang('Strings') => array("char" => 2000, "varchar2" => 4000, "nchar" => 2000, "nvarchar2" => 4000, "clob" => 4294967295, "nclob" => 4294967295),
+ lang('Binary') => array("raw" => 2000, "long raw" => 2147483648, "blob" => 4294967295, "bfile" => 4294967296),
+ ) as $key => $val) {
+ $types += $val;
+ $structured_types[$key] = array_keys($val);
+ }
+ return array(
+ 'possible_drivers' => array("OCI8", "PDO_OCI"),
+ 'jush' => "oracle",
+ 'types' => $types,
+ 'structured_types' => $structured_types,
+ 'unsigned' => array(),
+ 'operators' => array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL"),
+ 'functions' => array("length", "lower", "round", "upper"),
+ 'grouping' => array("avg", "count", "count distinct", "max", "min", "sum"),
+ 'edit_functions' => array(
+ array( //! no parentheses
+ "date" => "current_date",
+ "timestamp" => "current_timestamp",
+ ), array(
+ "number|float|double" => "+/-",
+ "date|timestamp" => "+ interval/- interval",
+ "char|clob" => "||",
+ )
+ ),
+ );
+ }
}
$drivers["pgsql"] = "PostgreSQL";
if (isset($_GET["pgsql"])) {
- $possible_drivers = array("PgSQL", "PDO_PgSQL");
define("DRIVER", "pgsql");
if (extension_loaded("pgsql")) {
class Min_DB {
return $connection->result("SHOW max_connections");
}
- $jush = "pgsql";
- $types = array();
- $structured_types = array();
- foreach (array( //! arrays
- lang('Numbers') => array("smallint" => 5, "integer" => 10, "bigint" => 19, "boolean" => 1, "numeric" => 0, "real" => 7, "double precision" => 16, "money" => 20),
- lang('Date and time') => array("date" => 13, "time" => 17, "timestamp" => 20, "timestamptz" => 21, "interval" => 0),
- lang('Strings') => array("character" => 0, "character varying" => 0, "text" => 0, "tsquery" => 0, "tsvector" => 0, "uuid" => 0, "xml" => 0),
- lang('Binary') => array("bit" => 0, "bit varying" => 0, "bytea" => 0),
- lang('Network') => array("cidr" => 43, "inet" => 43, "macaddr" => 17, "txid_snapshot" => 0),
- lang('Geometry') => array("box" => 0, "circle" => 0, "line" => 0, "lseg" => 0, "path" => 0, "point" => 0, "polygon" => 0),
- ) as $key => $val) { //! can be retrieved from pg_type
- $types += $val;
- $structured_types[$key] = array_keys($val);
- }
- $unsigned = array();
- $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid CSRF
- $functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
- $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
- $edit_functions = array(
- array(
- "char" => "md5",
- "date|time" => "now",
- ), array(
- number_type() => "+/-",
- "date|time" => "+ interval/- interval", //! escape
- "char|text" => "||",
- )
- );
+ function driver_config() {
+ $types = array();
+ $structured_types = array();
+ foreach (array( //! arrays
+ lang('Numbers') => array("smallint" => 5, "integer" => 10, "bigint" => 19, "boolean" => 1, "numeric" => 0, "real" => 7, "double precision" => 16, "money" => 20),
+ lang('Date and time') => array("date" => 13, "time" => 17, "timestamp" => 20, "timestamptz" => 21, "interval" => 0),
+ lang('Strings') => array("character" => 0, "character varying" => 0, "text" => 0, "tsquery" => 0, "tsvector" => 0, "uuid" => 0, "xml" => 0),
+ lang('Binary') => array("bit" => 0, "bit varying" => 0, "bytea" => 0),
+ lang('Network') => array("cidr" => 43, "inet" => 43, "macaddr" => 17, "txid_snapshot" => 0),
+ lang('Geometry') => array("box" => 0, "circle" => 0, "line" => 0, "lseg" => 0, "path" => 0, "point" => 0, "polygon" => 0),
+ ) as $key => $val) { //! can be retrieved from pg_type
+ $types += $val;
+ $structured_types[$key] = array_keys($val);
+ }
+ return array(
+ 'possible_drivers' => array("PgSQL", "PDO_PgSQL"),
+ 'jush' => "pgsql",
+ 'types' => $types,
+ 'structured_types' => $structured_types,
+ 'unsigned' => array(),
+ 'operators' => array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"), // no "SQL" to avoid CSRF
+ 'functions' => array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper"),
+ 'grouping' => array("avg", "count", "count distinct", "max", "min", "sum"),
+ 'edit_functions' => array(
+ array(
+ "char" => "md5",
+ "date|time" => "now",
+ ), array(
+ number_type() => "+/-",
+ "date|time" => "+ interval/- interval", //! escape
+ "char|text" => "||",
+ )
+ ),
+ );
+ }
}
$drivers["simpledb"] = "SimpleDB";
if (isset($_GET["simpledb"])) {
- $possible_drivers = array("SimpleXML + allow_url_fopen");
define("DRIVER", "simpledb");
if (class_exists('SimpleXMLElement') && ini_bool('allow_url_fopen')) {
return $return;
}
- $jush = "simpledb";
- $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "IS NOT NULL");
- $functions = array();
- $grouping = array("count");
- $edit_functions = array(array("json"));
+ function driver_config() {
+ return array(
+ 'possible_drivers' => array("SimpleXML + allow_url_fopen"),
+ 'jush' => "simpledb",
+ 'operators' => array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "IS NOT NULL"),
+ 'functions' => array(),
+ 'grouping' => array("count"),
+ 'edit_functions' => array(array("json")),
+ );
+ }
}
$drivers["sqlite2"] = "SQLite 2";
if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
- $possible_drivers = array((isset($_GET["sqlite"]) ? "SQLite3" : "SQLite"), "PDO_SQLite");
define("DRIVER", (isset($_GET["sqlite"]) ? "sqlite" : "sqlite2"));
if (class_exists(isset($_GET["sqlite"]) ? "SQLite3" : "SQLiteDatabase")) {
if (isset($_GET["sqlite"])) {
return preg_match('~^(columns|database|drop_col|dump|indexes|descidx|move_col|sql|status|table|trigger|variables|view|view_trigger)$~', $feature);
}
- $jush = "sqlite";
- $types = array("integer" => 0, "real" => 0, "numeric" => 0, "text" => 0, "blob" => 0);
- $structured_types = array_keys($types);
- $unsigned = array();
- $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"); // REGEXP can be user defined function
- $functions = array("hex", "length", "lower", "round", "unixepoch", "upper");
- $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum");
- $edit_functions = array(
- array(
- // "text" => "date('now')/time('now')/datetime('now')",
- ), array(
- "integer|real|numeric" => "+/-",
- // "text" => "date/time/datetime",
- "text" => "||",
- )
- );
+ function driver_config() {
+ return array(
+ 'possible_drivers' => array((isset($_GET["sqlite"]) ? "SQLite3" : "SQLite"), "PDO_SQLite"),
+ 'jush' => "sqlite",
+ 'types' => array("integer" => 0, "real" => 0, "numeric" => 0, "text" => 0, "blob" => 0),
+ 'structured_types' => array_keys($types),
+ 'unsigned' => array(),
+ 'operators' => array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"), // REGEXP can be user defined function
+ 'functions' => array("hex", "length", "lower", "round", "unixepoch", "upper"),
+ 'grouping' => array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"),
+ 'edit_functions' => array(
+ array(
+ // "text" => "date('now')/time('now')/datetime('now')",
+ ), array(
+ "integer|real|numeric" => "+/-",
+ // "text" => "date/time/datetime",
+ "text" => "||",
+ )
+ ),
+ );
+ }
}
include "../adminer/drivers/clickhouse.inc.php";
include "../adminer/drivers/mysql.inc.php"; // must be included as last driver
+$config = driver_config();
+$possible_drivers = $config['possible_drivers'];
+$jush = $config['jush'];
+$types = $config['types'];
+$structured_types = $config['structured_types'];
+$unsigned = $config['unsigned'];
+$operators = $config['operators'];
+$functions = $config['functions'];
+$grouping = $config['grouping'];
+$edit_functions = $config['edit_functions'];
+
define("SERVER", $_GET[DRIVER]); // read from pgsql=localhost
define("DB", $_GET["db"]); // for the sake of speed and size
define("ME", preg_replace('~\?.*~', '', relative_uri()) . '?'
<?php
-$VERSION = "4.7.10-dev";
+$VERSION = "4.8.0-dev";
-Adminer 4.7.10-dev:
+Adminer 4.8.0-dev:
Support function default values in insert (bug #713)
Allow SQL pseudo-function in insert
Skip date columns for non-date values in search anywhere