orchid-orm 1.37.3 → 1.37.5

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
@@ -191,6 +191,9 @@ declare function transaction<Result>(this: {
191
191
  declare function ensureTransaction<Result>(this: {
192
192
  $queryBuilder: Db;
193
193
  }, cb: () => Promise<Result>): Promise<Result>;
194
+ declare function isInTransaction(this: {
195
+ $queryBuilder: Db;
196
+ }): boolean;
194
197
 
195
198
  interface FromQuery extends Query {
196
199
  returnType: 'all';
@@ -206,6 +209,10 @@ type OrchidORM<T extends TableClasses = TableClasses> = {
206
209
  * @see import('pqb').Transaction.prototype.ensureTransaction
207
210
  */
208
211
  $ensureTransaction: typeof ensureTransaction;
212
+ /**
213
+ * @see import('pqb').Transaction.prototype.ensureTransaction
214
+ */
215
+ $isInTransaction: typeof isInTransaction;
209
216
  $adapter: Adapter;
210
217
  $queryBuilder: Db;
211
218
  /**
package/dist/index.js CHANGED
@@ -1790,6 +1790,9 @@ function transaction(fnOrOptions, fn) {
1790
1790
  function ensureTransaction(cb) {
1791
1791
  return this.$queryBuilder.ensureTransaction(cb);
1792
1792
  }
1793
+ function isInTransaction() {
1794
+ return this.$queryBuilder.isInTransaction();
1795
+ }
1793
1796
 
1794
1797
  var __defProp$1 = Object.defineProperty;
1795
1798
  var __defProps = Object.defineProperties;
@@ -1862,6 +1865,7 @@ const orchidORM = (_a, tables) => {
1862
1865
  const result = {
1863
1866
  $transaction: transaction,
1864
1867
  $ensureTransaction: ensureTransaction,
1868
+ $isInTransaction: isInTransaction,
1865
1869
  $adapter: adapter,
1866
1870
  $queryBuilder: qb,
1867
1871
  $query: (...args) => qb.query(...args),