mirror of https://github.com/Fabio286/antares.git
fix: error with empty functions/procedures
This commit is contained in:
parent
49d71722e2
commit
f150508547
|
@ -433,6 +433,19 @@ export class MySQLClient extends AntaresCore {
|
|||
const results = await this.raw(sql);
|
||||
|
||||
return results.rows.map(row => {
|
||||
if (!row['Create Procedure']) {
|
||||
return {
|
||||
definer: null,
|
||||
sql: '',
|
||||
parameters: [],
|
||||
name: row.Procedure,
|
||||
comment: '',
|
||||
security: 'DEFINER',
|
||||
deterministic: false,
|
||||
dataAccess: 'CONTAINS SQL'
|
||||
};
|
||||
}
|
||||
|
||||
const parameters = row['Create Procedure']
|
||||
.match(/(?<=\().*?(?=\))/s)[0]
|
||||
.replaceAll('\r', '')
|
||||
|
@ -538,6 +551,21 @@ export class MySQLClient extends AntaresCore {
|
|||
const results = await this.raw(sql);
|
||||
|
||||
return results.rows.map(row => {
|
||||
if (!row['Create Function']) {
|
||||
return {
|
||||
definer: null,
|
||||
sql: '',
|
||||
parameters: [],
|
||||
name: row.Procedure,
|
||||
comment: '',
|
||||
security: 'DEFINER',
|
||||
deterministic: false,
|
||||
dataAccess: 'CONTAINS SQL',
|
||||
returns: 'INT',
|
||||
returnsLength: null
|
||||
};
|
||||
}
|
||||
|
||||
const parameters = row['Create Function']
|
||||
.match(/(?<=\().*?(?=\))/s)[0]
|
||||
.replaceAll('\r', '')
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
@close-context="closeContext"
|
||||
>
|
||||
<div
|
||||
v-if="selectedMisc.type === 'procedure'"
|
||||
v-if="['procedure', 'function'].includes(selectedMisc.type)"
|
||||
class="context-element disabled"
|
||||
@click="showRunModal"
|
||||
>
|
||||
|
|
|
@ -25,13 +25,14 @@ const arrayToFile = args => {
|
|||
break;
|
||||
}
|
||||
|
||||
const file = new Blob([content], { mime });
|
||||
const file = new Blob([content], { type: mime });
|
||||
const downloadLink = document.createElement('a');
|
||||
downloadLink.download = `${args.filename}.${args.type}`;
|
||||
downloadLink.href = window.URL.createObjectURL(file);
|
||||
downloadLink.style.display = 'none';
|
||||
document.body.appendChild(downloadLink);
|
||||
downloadLink.click();
|
||||
downloadLink.remove();
|
||||
};
|
||||
|
||||
export default arrayToFile;
|
||||
|
|
Loading…
Reference in New Issue