diff --git a/src/main/libs/clients/MySQLClient.js b/src/main/libs/clients/MySQLClient.js index a1339322..c570d413 100644 --- a/src/main/libs/clients/MySQLClient.js +++ b/src/main/libs/clients/MySQLClient.js @@ -440,9 +440,12 @@ export class MySQLClient extends AntaresCore { .split(',') .map(el => { const param = el.split(' '); + const type = param[2] ? param[2].replace(')', '').split('(') : ['', null]; + return { name: param[1] ? param[1].replaceAll('`', '') : '', - type: param[2] ? param[2].replace(',', '') : '', + type: type[0], + length: +type[1], context: param[0] ? param[0].replace('\n', '') : '' }; }).filter(el => el.name); @@ -509,7 +512,7 @@ export class MySQLClient extends AntaresCore { */ async createRoutine (routine) { const parameters = routine.parameters.reduce((acc, curr) => { - acc.push(`${curr.context} \`${curr.name}\` ${curr.type}`); + acc.push(`${curr.context} \`${curr.name}\` ${curr.type}${curr.length ? `(${curr.length})` : ''}`); return acc; }, []).join(','); diff --git a/src/renderer/components/WorkspaceExploreBarMiscContext.vue b/src/renderer/components/WorkspaceExploreBarMiscContext.vue index 97cc48c4..05efaf6e 100644 --- a/src/renderer/components/WorkspaceExploreBarMiscContext.vue +++ b/src/renderer/components/WorkspaceExploreBarMiscContext.vue @@ -37,6 +37,7 @@ import { mapGetters, mapActions } from 'vuex'; import BaseContextMenu from '@/components/BaseContextMenu'; import ConfirmModal from '@/components/BaseConfirmModal'; import Triggers from '@/ipc-api/Triggers'; +import Routines from '@/ipc-api/Routines'; export default { name: 'WorkspaceExploreBarMiscContext', @@ -66,7 +67,8 @@ export default { switch (this.selectedMisc.type) { case 'trigger': return this.$t('message.deleteTrigger'); - + case 'procedure': + return this.$t('message.deleteRoutine'); default: return ''; } @@ -106,12 +108,12 @@ export default { trigger: this.selectedMisc.name }); break; - // case 'procedure': - // res = await Tables.dropProcedure({ - // uid: this.selectedWorkspace, - // procedure: this.selectedMisc.name - // }); - // break; + case 'procedure': + res = await Routines.dropRoutine({ + uid: this.selectedWorkspace, + routine: this.selectedMisc.name + }); + break; // case 'schedules': // res = await Tables.dropScheduler({ // uid: this.selectedWorkspace, diff --git a/src/renderer/components/WorkspacePropsRoutineParamsModal.vue b/src/renderer/components/WorkspacePropsRoutineParamsModal.vue index c494112a..aeb8c86b 100644 --- a/src/renderer/components/WorkspacePropsRoutineParamsModal.vue +++ b/src/renderer/components/WorkspacePropsRoutineParamsModal.vue @@ -48,7 +48,7 @@