pqb 0.42.2 → 0.42.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -5126,6 +5126,7 @@ declare class Transaction {
5126
5126
  * ```
5127
5127
  */
5128
5128
  ensureTransaction<Result>(this: PickQueryQAndInternal, cb: () => Promise<Result>): Promise<Result>;
5129
+ isInTransaction(): boolean;
5129
5130
  }
5130
5131
 
5131
5132
  type AfterHook<Select extends PropertyKey[], Shape extends QueryColumns> = QueryAfterHook<{
package/dist/index.js CHANGED
@@ -4285,6 +4285,10 @@ class Transaction {
4285
4285
  return cb();
4286
4286
  return Transaction.prototype.transaction.call(this, cb);
4287
4287
  }
4288
+ isInTransaction() {
4289
+ const trx = this.internal.transactionStorage.getStore();
4290
+ return !!(trx && (!trx.testTransactionCount || trx.transactionId >= trx.testTransactionCount));
4291
+ }
4288
4292
  }
4289
4293
  const runAfterCommit = async (afterCommit, result) => {
4290
4294
  if (afterCommit) {