orchid-orm 1.50.5 → 1.51.0

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.mjs CHANGED
@@ -2051,19 +2051,19 @@ const applyRelation = (table, qb, { relationName, relation, dbTable, otherDbTabl
2051
2051
  };
2052
2052
 
2053
2053
  function transaction(fnOrOptions, fn) {
2054
- return this.$queryBuilder.transaction(
2054
+ return this.$qb.transaction(
2055
2055
  fnOrOptions,
2056
2056
  fn
2057
2057
  );
2058
2058
  }
2059
2059
  function ensureTransaction(cb) {
2060
- return this.$queryBuilder.ensureTransaction(cb);
2060
+ return this.$qb.ensureTransaction(cb);
2061
2061
  }
2062
2062
  function isInTransaction() {
2063
- return this.$queryBuilder.isInTransaction();
2063
+ return this.$qb.isInTransaction();
2064
2064
  }
2065
2065
  function afterCommit(hook) {
2066
- this.$queryBuilder.afterCommit(hook);
2066
+ this.$qb.afterCommit(hook);
2067
2067
  }
2068
2068
 
2069
2069
  const orchidORM = ({
@@ -2085,7 +2085,7 @@ const orchidORM = ({
2085
2085
  if ("db" in options) {
2086
2086
  adapter = options.db.q.adapter;
2087
2087
  transactionStorage = options.db.internal.transactionStorage;
2088
- qb = options.db.queryBuilder;
2088
+ qb = options.db.qb;
2089
2089
  } else {
2090
2090
  adapter = "adapter" in options ? options.adapter : new Adapter(options);
2091
2091
  transactionStorage = new AsyncLocalStorage();
@@ -2103,8 +2103,10 @@ const orchidORM = ({
2103
2103
  $isInTransaction: isInTransaction,
2104
2104
  $afterCommit: afterCommit,
2105
2105
  $adapter: adapter,
2106
- $queryBuilder: qb,
2107
- $query: (...args) => qb.query(...args),
2106
+ $qb: qb,
2107
+ get $query() {
2108
+ return qb.query;
2109
+ },
2108
2110
  $queryArrays: (...args) => qb.queryArrays(...args),
2109
2111
  $with: qb.with.bind(qb),
2110
2112
  $withRecursive: qb.withRecursive.bind(qb),