mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 04:26:01 +00:00
close dbhandles after shell script (missing tableReader)
This commit is contained in:
@@ -9,12 +9,15 @@ async function executeQuery({ connection = undefined, systemConnection = undefin
|
||||
|
||||
if (!driver) driver = requireEngineDriver(connection);
|
||||
const dbhan = systemConnection || (await connectUtility(driver, connection, 'script'));
|
||||
logger.info(`Connected.`);
|
||||
|
||||
await driver.script(dbhan, sql);
|
||||
try {
|
||||
logger.info(`Connected.`);
|
||||
|
||||
if (!systemConnection) {
|
||||
await driver.close(dbhan);
|
||||
await driver.script(dbhan, sql);
|
||||
} finally {
|
||||
if (!systemConnection) {
|
||||
await driver.close(dbhan);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user