mirror of https://github.com/Fabio286/antares.git
fix: error on schema export
This commit is contained in:
parent
addd9fba28
commit
1d151e9349
|
@ -1,5 +1,4 @@
|
|||
import * as antares from 'common/interfaces/antares';
|
||||
import { webContents } from 'electron';
|
||||
import mysql from 'mysql2/promise';
|
||||
import * as pg from 'pg';
|
||||
import SSH2Promise from 'ssh2-promise';
|
||||
|
@ -7,8 +6,8 @@ import SSH2Promise from 'ssh2-promise';
|
|||
const queryLogger = ({ sql, cUid }: {sql: string; cUid: string}) => {
|
||||
// Remove comments, newlines and multiple spaces
|
||||
const escapedSql = sql.replace(/(\/\*(.|[\r\n])*?\*\/)|(--(.*|[\r\n]))/gm, '').replace(/\s\s+/g, ' ');
|
||||
if (webContents) {
|
||||
const mainWindow = webContents.fromId(1);
|
||||
if (process.type !== undefined) {
|
||||
const mainWindow = require('electron').webContents.fromId(1);
|
||||
mainWindow.send('query-log', { cUid, sql: escapedSql, date: new Date() });
|
||||
}
|
||||
if (process.env.NODE_ENV === 'development') console.log(escapedSql);
|
||||
|
|
Loading…
Reference in New Issue