## Adminer dev
+- Autocomplete SQL commands
- Do not edit NULL values by Modify (bug #967)
- PostgreSQL: Support COPY FROM stdin in SQL query (bug #942)
- MySQL: Display number of found rows in group queries (regression from 5.1.1)
function syntaxHighlighting(array $tables): void {
// this is matched by compile.php
echo script_src("../externals/jush/modules/jush.js");
+ echo script_src("../externals/jush/modules/jush-autocomplete-sql.js");
echo script_src("../externals/jush/modules/jush-textarea.js");
echo script_src("../externals/jush/modules/jush-txt.js");
echo script_src("../externals/jush/modules/jush-js.js");
foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
echo "jushLinks.$val = jushLinks." . JUSH . ";\n";
}
+ $tablesColumns = array_fill_keys(array_keys($tables), array());
+ foreach (driver()->allFields() as $table => $fields) {
+ foreach ($fields as $field) {
+ $tablesColumns[$table][] = $field["field"];
+ }
+ }
+ echo "autocompleter = jush.autocompleteSql('" . idf_escape("") . "', " . json_encode($tablesColumns) . ");\n";
}
echo "</script>\n";
}
'use strict'; // Adminer specific functions
+let autocompleter; // set in adminer.inc.php
+
/** Load syntax highlighting
* @param string first three characters of database system version
* @param [string]
adminerHighlighter = els => jush.highlight_tag(els, 0);
for (const tag of qsa('textarea')) {
if (/(^|\s)jush-/.test(tag.className)) {
- const pre = jush.textarea(tag);
+ const pre = jush.textarea(tag, autocompleter);
if (pre) {
setupSubmitHighlightInput(pre);
tag.onchange = () => {