From d1297a0085fd54967817816efaeed5770a887bbf Mon Sep 17 00:00:00 2001 From: Fabio Di Stasio Date: Mon, 27 Feb 2023 10:43:51 +0100 Subject: [PATCH] fix: error with import/export tools, fixes #541 --- src/main/libs/clients/MySQLClient.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/libs/clients/MySQLClient.ts b/src/main/libs/clients/MySQLClient.ts index 07f104b6..b26ebffa 100644 --- a/src/main/libs/clients/MySQLClient.ts +++ b/src/main/libs/clients/MySQLClient.ts @@ -1,14 +1,10 @@ import * as antares from 'common/interfaces/antares'; import * as mysql from 'mysql2/promise'; -import * as Store from 'electron-store'; import { AntaresCore } from '../AntaresCore'; import dataTypes from 'common/data-types/mysql'; import SSH2Promise = require('ssh2-promise'); import SSHConfig from 'ssh2-promise/lib/sshConfig'; -Store.initRenderer(); -const settingsStore = new Store({ name: 'settings' }); - export class MySQLClient extends AntaresCore { private _schema?: string; private _runningConnections: Map; @@ -309,10 +305,15 @@ export class MySQLClient extends AntaresCore { const triggersArr: ShowTriggersResult[] = []; let schemaSize = 0; + const Store = require('electron-store'); + + Store.initRenderer(); + const settingsStore = new Store({ name: 'settings' }); + for (const db of filteredDatabases) { if (!schemas.has(db.Database)) continue; - const showTableSize = settingsStore.get('show_table_size'); + const showTableSize = settingsStore.get('show_table_size', false); if (showTableSize) { let { rows: tables } = await this.raw>(`