1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-24 15:12:51 +02:00

Prepare Elasticsearch

This commit is contained in:
Jakub Vrana
2013-07-09 17:38:13 -07:00
parent fc427f4f3a
commit b788a9e69b
13 changed files with 320 additions and 37 deletions

View File

@@ -769,7 +769,7 @@ username.form['auth[driver]'].onchange();
} else {
$this->databasesPrint($missing);
if (DB == "" || !$missing) {
echo "<p class='links'><a href='" . h(ME) . "sql='" . bold(isset($_GET["sql"])) . ">" . lang('SQL command') . "/" . lang('Import') . "</a><br>\n";
echo "<p class='links'>" . (support("sql") ? "<a href='" . h(ME) . "sql='" . bold(isset($_GET["sql"])) . ">" . lang('SQL command') . "/" . lang('Import') . "</a><br>\n" : "") . "";
if (support("dump")) {
echo "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "' id='dump'" . bold(isset($_GET["dump"])) . ">" . lang('Dump') . "</a><br>\n";
}

View File

@@ -63,6 +63,7 @@ include "../adminer/drivers/sqlite.inc.php";
include "../adminer/drivers/pgsql.inc.php";
include "../adminer/drivers/oracle.inc.php";
include "../adminer/drivers/mssql.inc.php";
include "../adminer/drivers/elastic.inc.php";
include "../adminer/drivers/simpledb.inc.php";
include "../adminer/drivers/mysql.inc.php"; // must be included as last driver

View File

@@ -10,6 +10,33 @@
$this->_conn = $connection;
}
/** Select data from table
* @param string
* @param array result of $adminer->selectColumnsProcess()[0]
* @param array result of $adminer->selectSearchProcess()
* @param array result of $adminer->selectColumnsProcess()[1]
* @param array result of $adminer->selectOrderProcess()
* @param int result of $adminer->selectLimitProcess()
* @param int index of page starting at zero
* @return Min_Result
*/
function select($table, $select, $where, $group, $order, $limit, $page) {
global $adminer, $jush;
$is_group = (count($group) < count($select));
$query = $adminer->selectQueryBuild($select, $where, $group, $order, $limit, $page);
if (!$query) {
$query = "SELECT" . limit(
($_GET["page"] != "last" && +$limit && $group && $is_group && $jush == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . implode(", ", $select) . "\nFROM " . table($table),
($where ? "\nWHERE " . implode(" AND ", $where) : "") . ($group && $is_group ? "\nGROUP BY " . implode(", ", $group) : "") . ($order ? "\nORDER BY " . implode(", ", $order) : ""),
($limit != "" ? +$limit : null),
($page ? $limit * $page : 0),
"\n"
);
}
echo $adminer->selectQuery($query);
return $this->_conn->query($query);
}
/** Delete data from table
* @param string
* @param string " WHERE ..."

View File

@@ -1,2 +1,2 @@
<?php
$VERSION = "3.7.2-dev";
$VERSION = "4.0.0-dev";