split postgres query

This commit is contained in:
Jan Prochazka
2021-01-01 18:14:53 +01:00
parent fc79f5f07c
commit db7eb96360
4 changed files with 312 additions and 18 deletions

View File

@@ -24,23 +24,23 @@ const engineToMode = {
postgre: 'pgsql',
};
const COMMON_KEYWORDS = [
'select',
'where',
'update',
'delete',
'group',
'order',
'from',
'by',
'create',
'table',
'drop',
'alter',
'view',
'execute',
'procedure',
];
// const COMMON_KEYWORDS = [
// 'select',
// 'where',
// 'update',
// 'delete',
// 'group',
// 'order',
// 'from',
// 'by',
// 'create',
// 'table',
// 'drop',
// 'alter',
// 'view',
// 'execute',
// 'procedure',
// ];
export default function SqlEditor({
value = undefined,

View File

@@ -20,6 +20,7 @@ const COMMON_KEYWORDS = [
'execute',
'procedure',
'distinct',
'go',
];
export default function useCodeCompletion({ conid, database, tabVisible, currentEditorRef }) {
@@ -111,7 +112,7 @@ export default function useCodeCompletion({ conid, database, tabVisible, current
editor.execCommand('startAutocomplete');
}
if (e.args == ' ' && /((from)|(join))\s*$/i.test(line)) {
if (e.args == ' ' && /((from)|(join))\s*$/i.test(line)) {
editor.execCommand('startAutocomplete');
}
}