mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
refactor: improved the way how schema is passed to client classes
This commit is contained in:
@ -421,7 +421,10 @@ export default {
|
||||
table: 'data',
|
||||
view: 'data',
|
||||
trigger: 'trigger-props',
|
||||
triggerFunction: 'trigger-function-props'
|
||||
triggerFunction: 'trigger-function-props',
|
||||
function: 'function-props',
|
||||
routine: 'routine-props',
|
||||
scheduler: 'scheduler-props'
|
||||
};
|
||||
|
||||
this.newTab({
|
||||
|
@ -312,6 +312,7 @@ export default {
|
||||
async openCreateTableEditor (payload) {
|
||||
const params = {
|
||||
uid: this.connection.uid,
|
||||
schema: this.selectedSchema,
|
||||
...payload
|
||||
};
|
||||
|
||||
@ -376,6 +377,7 @@ export default {
|
||||
async openCreateViewEditor (payload) {
|
||||
const params = {
|
||||
uid: this.connection.uid,
|
||||
schema: this.selectedSchema,
|
||||
...payload
|
||||
};
|
||||
|
||||
@ -407,6 +409,7 @@ export default {
|
||||
async openCreateTriggerEditor (payload) {
|
||||
const params = {
|
||||
uid: this.connection.uid,
|
||||
schema: this.selectedSchema,
|
||||
...payload
|
||||
};
|
||||
|
||||
@ -439,6 +442,7 @@ export default {
|
||||
async openCreateRoutineEditor (payload) {
|
||||
const params = {
|
||||
uid: this.connection.uid,
|
||||
schema: this.selectedSchema,
|
||||
...payload
|
||||
};
|
||||
|
||||
@ -452,8 +456,8 @@ export default {
|
||||
uid: this.workspace.uid,
|
||||
schema: this.selectedSchema,
|
||||
elementName: payload.name,
|
||||
elementType: 'procedure',
|
||||
type: 'procedure-props'
|
||||
elementType: 'routine',
|
||||
type: 'routine-props'
|
||||
});
|
||||
}
|
||||
else
|
||||
@ -486,6 +490,7 @@ export default {
|
||||
async openCreateFunctionEditor (payload) {
|
||||
const params = {
|
||||
uid: this.connection.uid,
|
||||
schema: this.selectedSchema,
|
||||
...payload
|
||||
};
|
||||
|
||||
@ -509,6 +514,7 @@ export default {
|
||||
async openCreateTriggerFunctionEditor (payload) {
|
||||
const params = {
|
||||
uid: this.connection.uid,
|
||||
schema: this.selectedSchema,
|
||||
...payload
|
||||
};
|
||||
|
||||
@ -532,6 +538,7 @@ export default {
|
||||
async openCreateSchedulerEditor (payload) {
|
||||
const params = {
|
||||
uid: this.connection.uid,
|
||||
schema: this.selectedSchema,
|
||||
...payload
|
||||
};
|
||||
|
||||
|
@ -128,12 +128,14 @@ export default {
|
||||
case 'trigger':
|
||||
res = await Triggers.dropTrigger({
|
||||
uid: this.selectedWorkspace,
|
||||
schema: this.selectedSchema,
|
||||
trigger: this.selectedMisc.name
|
||||
});
|
||||
break;
|
||||
case 'procedure':
|
||||
res = await Routines.dropRoutine({
|
||||
uid: this.selectedWorkspace,
|
||||
schema: this.selectedSchema,
|
||||
routine: this.selectedMisc.name
|
||||
});
|
||||
break;
|
||||
@ -141,12 +143,14 @@ export default {
|
||||
case 'triggerFunction':
|
||||
res = await Functions.dropFunction({
|
||||
uid: this.selectedWorkspace,
|
||||
schema: this.selectedSchema,
|
||||
func: this.selectedMisc.name
|
||||
});
|
||||
break;
|
||||
case 'scheduler':
|
||||
res = await Schedulers.dropScheduler({
|
||||
uid: this.selectedWorkspace,
|
||||
schema: this.selectedSchema,
|
||||
scheduler: this.selectedMisc.name
|
||||
});
|
||||
break;
|
||||
@ -187,8 +191,8 @@ export default {
|
||||
async runRoutineCheck () {
|
||||
const params = {
|
||||
uid: this.selectedWorkspace,
|
||||
schema: this.workspace.breadcrumbs.schema,
|
||||
routine: this.workspace.breadcrumbs.procedure
|
||||
schema: this.selectedSchema,
|
||||
routine: this.selectedMisc.name
|
||||
};
|
||||
|
||||
try {
|
||||
@ -231,8 +235,8 @@ export default {
|
||||
async runFunctionCheck () {
|
||||
const params = {
|
||||
uid: this.selectedWorkspace,
|
||||
schema: this.workspace.breadcrumbs.schema,
|
||||
func: this.workspace.breadcrumbs.function
|
||||
schema: this.selectedSchema,
|
||||
func: this.selectedMisc.name
|
||||
};
|
||||
|
||||
try {
|
||||
@ -270,7 +274,7 @@ export default {
|
||||
sql = `SELECT \`${this.localElement.name}\` (${params.join(',')})`;
|
||||
}
|
||||
|
||||
this.newTab({ uid: this.workspace.uid, content: sql, autorun: true });
|
||||
this.newTab({ uid: this.workspace.uid, content: sql, type: 'query', autorun: true });
|
||||
this.closeContext();
|
||||
}
|
||||
}
|
||||
|
@ -243,9 +243,9 @@ export default {
|
||||
this.isSaving = true;
|
||||
const params = {
|
||||
uid: this.connection.uid,
|
||||
schema: this.schema,
|
||||
func: {
|
||||
...this.localFunction,
|
||||
schema: this.schema,
|
||||
oldName: this.originalFunction.name
|
||||
}
|
||||
};
|
||||
|
@ -242,9 +242,9 @@ export default {
|
||||
this.isSaving = true;
|
||||
const params = {
|
||||
uid: this.connection.uid,
|
||||
schema: this.schema,
|
||||
routine: {
|
||||
...this.localRoutine,
|
||||
schema: this.schema,
|
||||
oldName: this.originalRoutine.name
|
||||
}
|
||||
};
|
||||
|
@ -283,9 +283,9 @@ export default {
|
||||
this.isSaving = true;
|
||||
const params = {
|
||||
uid: this.connection.uid,
|
||||
schema: this.schema,
|
||||
scheduler: {
|
||||
...this.localScheduler,
|
||||
schema: this.schema,
|
||||
oldName: this.originalScheduler.name
|
||||
}
|
||||
};
|
||||
|
@ -293,9 +293,9 @@ export default {
|
||||
this.isSaving = true;
|
||||
const params = {
|
||||
uid: this.connection.uid,
|
||||
schema: this.schema,
|
||||
trigger: {
|
||||
...this.localTrigger,
|
||||
schema: this.schema,
|
||||
oldName: this.originalTrigger.name
|
||||
}
|
||||
};
|
||||
|
@ -216,9 +216,9 @@ export default {
|
||||
this.isSaving = true;
|
||||
const params = {
|
||||
uid: this.connection.uid,
|
||||
schema: this.schema,
|
||||
func: {
|
||||
...this.localFunction,
|
||||
schema: this.schema,
|
||||
oldName: this.originalFunction.name
|
||||
}
|
||||
};
|
||||
|
@ -307,9 +307,9 @@ export default {
|
||||
this.isSaving = true;
|
||||
const params = {
|
||||
uid: this.connection.uid,
|
||||
schema: this.schema,
|
||||
view: {
|
||||
...this.localView,
|
||||
schema: this.schema,
|
||||
oldName: this.originalView.name
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user