used transaction for save table data

This commit is contained in:
Jan Prochazka
2023-02-05 19:17:46 +01:00
parent 722789ca01
commit e9a01a1ffd
6 changed files with 38 additions and 10 deletions

View File

@@ -158,12 +158,12 @@ function resolveAnalysedPromises() {
afterAnalyseCallbacks = [];
}
async function handleRunScript({ msgid, sql }, skipReadonlyCheck = false) {
async function handleRunScript({ msgid, sql, useTransaction }, skipReadonlyCheck = false) {
await waitConnected();
const driver = requireEngineDriver(storedConnection);
try {
if (!skipReadonlyCheck) ensureExecuteCustomScript(driver);
await driver.script(systemConnection, sql);
await driver.script(systemConnection, sql, { useTransaction });
process.send({ msgtype: 'response', msgid });
} catch (err) {
process.send({ msgtype: 'response', msgid, errorMessage: err.message });