diff --git a/src/main/libs/exporters/sql/MysqlExporter.js b/src/main/libs/exporters/sql/MysqlExporter.js index d9a14ba0..467e9b79 100644 --- a/src/main/libs/exporters/sql/MysqlExporter.js +++ b/src/main/libs/exporters/sql/MysqlExporter.js @@ -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(); diff --git a/src/main/libs/exporters/sql/SqlExporter.js b/src/main/libs/exporters/sql/SqlExporter.js index 0d11e000..21164201 100644 --- a/src/main/libs/exporters/sql/SqlExporter.js +++ b/src/main/libs/exporters/sql/SqlExporter.js @@ -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