diff --git a/package.json b/package.json index be751107..c41b9713 100644 --- a/package.json +++ b/package.json @@ -67,8 +67,7 @@ "vue-i18n": "^8.22.2", "vue-the-mask": "^0.11.1", "vuedraggable": "^2.24.3", - "vuex": "^3.6.0", - "vuex-persist": "^3.1.3" + "vuex": "^3.6.0" }, "devDependencies": { "babel-eslint": "^10.1.0", diff --git a/src/renderer/components/QueryEditor.vue b/src/renderer/components/QueryEditor.vue index 9f931653..b16966f8 100644 --- a/src/renderer/components/QueryEditor.vue +++ b/src/renderer/components/QueryEditor.vue @@ -81,6 +81,34 @@ export default { }) : []; }, + functions () { + return this.workspace + ? this.workspace.structure.filter(schema => schema.name === this.schema) + .reduce((acc, curr) => { + acc.push(...curr.functions); + return acc; + }, []).map(func => { + return { + name: `${func.name}()`, + type: 'function' + }; + }) + : []; + }, + schedulers () { + return this.workspace + ? this.workspace.structure.filter(schema => schema.name === this.schema) + .reduce((acc, curr) => { + acc.push(...curr.schedulers); + return acc; + }, []).map(scheduler => { + return { + name: scheduler.name, + type: 'scheduler' + }; + }) + : []; + }, mode () { switch (this.workspace.client) { case 'mysql': @@ -160,7 +188,9 @@ export default { [ ...this.tables, ...this.triggers, - ...this.procedures + ...this.procedures, + ...this.functions, + ...this.schedulers ].forEach(el => { completions.push({ value: el.name, diff --git a/src/renderer/libs/ext-language_tools.js b/src/renderer/libs/ext-language_tools.js index 1035abb4..8751b95c 100644 --- a/src/renderer/libs/ext-language_tools.js +++ b/src/renderer/libs/ext-language_tools.js @@ -1245,6 +1245,12 @@ ace.define('ace/autocomplete/popup', ['require', 'exports', 'module', 'ace/virtu case 'routine': iconClass = 'mdi-sync-circle'; break; + case 'function': + iconClass = 'mdi-arrow-right-bold-box'; + break; + case 'scheduler': + iconClass = 'mdi-calendar-clock'; + break; case 'keyword': iconClass = 'mdi-cube'; break; diff --git a/src/renderer/store/index.js b/src/renderer/store/index.js index b92b049d..7bee55b5 100644 --- a/src/renderer/store/index.js +++ b/src/renderer/store/index.js @@ -2,7 +2,6 @@ import Vue from 'vue'; import Vuex from 'vuex'; -import VuexPersist from 'vuex-persist'; import application from './modules/application.store'; import settings from './modules/settings.store'; @@ -12,15 +11,6 @@ import notifications from './modules/notifications.store'; import ipcUpdates from './plugins/ipcUpdates'; -const vuexLocalStorage = new VuexPersist({ - key: 'application', // The key to store the state on in the storage provider. - storage: window.localStorage, - reducer: state => ({ - connections: state.connections, - settings: state.settings - }) -}); - Vue.use(Vuex); export default new Vuex.Store({ @@ -33,7 +23,6 @@ export default new Vuex.Store({ notifications }, plugins: [ - vuexLocalStorage.plugin, ipcUpdates ] });