SYNC: fixed backup & restore under SSH tunnel #1092

This commit is contained in:
SPRINX0\prochazka
2025-04-08 17:10:07 +02:00
committed by Diflow
parent e35f9eb75b
commit cff219674f

View File

@@ -37,6 +37,8 @@ const loadModelTransform = require('../utility/loadModelTransform');
const exportDbModelSql = require('../utility/exportDbModelSql');
const axios = require('axios');
const { callTextToSqlApi, callCompleteOnCursorApi, callRefactorSqlQueryApi } = require('../utility/authProxy');
const { decryptConnection } = require('../utility/crypting');
const { getSshTunnel } = require('../utility/sshTunnel');
const logger = getLogger('databaseConnections');
@@ -619,9 +621,23 @@ module.exports = {
command,
{ conid, database, outputFile, inputFile, options, selectedTables, skippedTables, argsFormat }
) {
const connection = await connections.getCore({ conid });
const sourceConnection = await connections.getCore({ conid });
let connection = decryptConnection(sourceConnection);
const driver = requireEngineDriver(connection);
if (connection.useSshTunnel) {
const tunnel = await getSshTunnel(connection);
if (tunnel.state == 'error') {
throw new Error(tunnel.message);
}
connection = {
...connection,
server: tunnel.localHost,
port: tunnel.localPort,
}
}
const settingsValue = await config.getSettings();
const externalTools = {};