1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-02-01 18:06:53 +01:00

fix(MySQL): procedures exportation

This commit is contained in:
Fabio Di Stasio 2022-02-16 12:58:24 +01:00
parent 832fb0fb03
commit 4276586e11
2 changed files with 5 additions and 4 deletions

View File

@ -285,7 +285,9 @@ ${footer}
const routine = routines[0];
const { sql_mode: sqlMode, 'Create Function': createProcedure } = routine;
const fieldName = `Create ${type === 'PROCEDURE' ? 'Procedure' : 'Function'}`;
const sqlMode = routine.sql_mode;
const createProcedure = routine[fieldName];
const startOffset = createProcedure.indexOf(type);
const procedureBody = createProcedure.substring(startOffset);
@ -302,7 +304,7 @@ ${footer}
}
async _queryStream (sql) {
console.log(sql);
if (process.env.NODE_ENV === 'development') console.log(sql);
const isPool = typeof this._client._connection.getConnection === 'function';
const connection = isPool ? await this._client._connection.getConnection() : this._client._connection;
const stream = connection.connection.query(sql).stream();

View File

@ -1,4 +1,3 @@
import { app } from 'electron';
import moment from 'moment';
import { BaseExporter } from '../BaseExporter';
@ -128,7 +127,7 @@ export class SqlExporter extends BaseExporter {
const serverVersion = await this.getServerVersion();
const header = `************************************************************
Antares - SQL Client
Version ${app.getVersion()}
Version ${process.env.PACKAGE_VERSION}
https://antares-sql.app/
https://github.com/Fabio286/antares