mirror of
https://github.com/vrana/adminer.git
synced 2025-08-20 05:11:25 +02:00
New plugin: AI prompt in SQL command creating the queries with Google Gemini
This commit is contained in:
@@ -263,6 +263,11 @@ class Adminer {
|
||||
return shorten_utf8(trim($query), 1000);
|
||||
}
|
||||
|
||||
/** Print HTML code just before the Execute button in SQL command
|
||||
*/
|
||||
function sqlPrintAfter() {
|
||||
}
|
||||
|
||||
/** Description of a row in a table
|
||||
* @param string
|
||||
* @return string SQL expression, empty string for no description
|
||||
|
@@ -245,6 +245,11 @@ class Plugins extends Adminer {
|
||||
return $this->applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function sqlPrintAfter() {
|
||||
$args = func_get_args();
|
||||
return $this->applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function rowDescription($table) {
|
||||
$args = func_get_args();
|
||||
return $this->applyPlugin(__FUNCTION__, $args);
|
||||
|
@@ -235,7 +235,9 @@ if (!isset($_GET["import"])) {
|
||||
echo "<p>";
|
||||
textarea("query", $q, 20);
|
||||
echo script(($_POST ? "" : "qs('textarea').focus();\n") . "qs('#form').onsubmit = partial(sqlSubmit, qs('#form'), '" . js_escape(remove_from_uri("sql|limit|error_stops|only_errors|history")) . "');");
|
||||
echo "<p>$execute\n";
|
||||
echo "<p>";
|
||||
$adminer->sqlPrintAfter();
|
||||
echo "$execute\n";
|
||||
echo lang('Limit rows') . ": <input type='number' name='limit' class='size' value='" . h($_POST ? $_POST["limit"] : $_GET["limit"]) . "'>\n";
|
||||
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user