Comparing version 33.2.0 to 33.3.0
@@ -53,3 +53,3 @@ import type { DbDict } from 'kmore-types'; | ||
*/ | ||
transaction(id?: PropertyKey): Promise<Knex.Transaction & { | ||
transaction(id?: PropertyKey, config?: Knex.TransactionConfig): Promise<Knex.Transaction & { | ||
kmoreTrxId: symbol; | ||
@@ -56,0 +56,0 @@ }>; |
@@ -100,7 +100,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
*/ | ||
async transaction(id) { | ||
async transaction(id, config) { | ||
const kmoreTrxId = typeof id === 'symbol' | ||
? id | ||
: id ? Symbol(id) : Symbol(Date.now().toString()); | ||
const trx = await this.dbh.transaction(); | ||
: id ? Symbol(id) : Symbol(Date.now()); | ||
const trx = await this.dbh.transaction(void 0, config); | ||
Object.defineProperty(trx, 'kmoreTrxId', { | ||
@@ -107,0 +107,0 @@ ...defaultPropDescriptor, |
{ | ||
"name": "kmore", | ||
"author": "waiting", | ||
"version": "33.2.0", | ||
"version": "33.3.0", | ||
"description": "A SQL query builder based on knex with powerful TypeScript type support", | ||
@@ -76,3 +76,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "f35ed527c92e95627ff13e47c273bb5b6da6bc84" | ||
"gitHead": "a435ff4a6d65356f44f034b68895225bd421f498" | ||
} |
@@ -140,8 +140,12 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
*/ | ||
async transaction(id?: PropertyKey): Promise<Knex.Transaction & { kmoreTrxId: symbol }> { | ||
async transaction( | ||
id?: PropertyKey, | ||
config?: Knex.TransactionConfig, | ||
): Promise<Knex.Transaction & { kmoreTrxId: symbol }> { | ||
const kmoreTrxId = typeof id === 'symbol' | ||
? id | ||
: id ? Symbol(id) : Symbol(Date.now().toString()) | ||
: id ? Symbol(id) : Symbol(Date.now()) | ||
const trx = await this.dbh.transaction() | ||
const trx = await this.dbh.transaction(void 0, config) | ||
@@ -148,0 +152,0 @@ Object.defineProperty(trx, 'kmoreTrxId', { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
130630
2103