@naturalcycles/db-lib
Advanced tools
Comparing version 9.2.0 to 9.2.1
@@ -5,3 +5,3 @@ /// <reference types="node" /> | ||
import { AjvSchema, ObjectSchema, ReadableTyped } from '@naturalcycles/nodejs-lib'; | ||
import { DBModelType, DBPatch, DBTransaction, RunQueryResult } from '../db.model'; | ||
import { CommonDBTransactionOptions, DBModelType, DBPatch, DBTransaction, RunQueryResult } from '../db.model'; | ||
import { DBQuery, RunnableDBQuery } from '../query/dbQuery'; | ||
@@ -173,3 +173,3 @@ import { CommonDaoCfg, CommonDaoCreateOptions, CommonDaoOptions, CommonDaoSaveBatchOptions, CommonDaoSaveOptions, CommonDaoStreamDeleteOptions, CommonDaoStreamForEachOptions, CommonDaoStreamOptions, CommonDaoStreamSaveOptions } from './common.dao.model'; | ||
ping(): Promise<void>; | ||
runInTransaction(fn: CommonDaoTransactionFn): Promise<void>; | ||
runInTransaction(fn: CommonDaoTransactionFn, opt?: CommonDBTransactionOptions): Promise<void>; | ||
protected logResult(started: number, op: string, res: any, table: string): void; | ||
@@ -176,0 +176,0 @@ protected logSaveResult(started: number, op: string, table: string): void; |
@@ -994,3 +994,3 @@ "use strict"; | ||
} | ||
async runInTransaction(fn) { | ||
async runInTransaction(fn, opt) { | ||
await this.cfg.db.runInTransaction(async (tx) => { | ||
@@ -1005,3 +1005,3 @@ const daoTx = new CommonDaoTransaction(tx, this.cfg.logger); | ||
} | ||
}); | ||
}, opt); | ||
} | ||
@@ -1008,0 +1008,0 @@ logResult(started, op, res, table) { |
@@ -43,3 +43,3 @@ { | ||
}, | ||
"version": "9.2.0", | ||
"version": "9.2.1", | ||
"description": "Lowest Common Denominator API to supported Databases", | ||
@@ -46,0 +46,0 @@ "keywords": [ |
@@ -46,3 +46,9 @@ import { Transform } from 'node:stream' | ||
import { DBLibError } from '../cnst' | ||
import { DBModelType, DBPatch, DBTransaction, RunQueryResult } from '../db.model' | ||
import { | ||
CommonDBTransactionOptions, | ||
DBModelType, | ||
DBPatch, | ||
DBTransaction, | ||
RunQueryResult, | ||
} from '../db.model' | ||
import { DBQuery, RunnableDBQuery } from '../query/dbQuery' | ||
@@ -1335,3 +1341,6 @@ import { | ||
async runInTransaction(fn: CommonDaoTransactionFn): Promise<void> { | ||
async runInTransaction( | ||
fn: CommonDaoTransactionFn, | ||
opt?: CommonDBTransactionOptions, | ||
): Promise<void> { | ||
await this.cfg.db.runInTransaction(async tx => { | ||
@@ -1346,3 +1355,3 @@ const daoTx = new CommonDaoTransaction(tx, this.cfg.logger!) | ||
} | ||
}) | ||
}, opt) | ||
} | ||
@@ -1349,0 +1358,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
428919
11239