pqb 0.39.2 → 0.39.4

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
@@ -117,25 +117,25 @@ const sqlFn = (...args) => {
117
117
  return (...args2) => new RawSQL(args2, arg);
118
118
  };
119
119
 
120
- var __defProp$l = Object.defineProperty;
121
- var __defProps$b = Object.defineProperties;
122
- var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
123
- var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
124
- var __hasOwnProp$m = Object.prototype.hasOwnProperty;
125
- var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
126
- var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
127
- var __spreadValues$l = (a, b) => {
120
+ var __defProp$m = Object.defineProperty;
121
+ var __defProps$d = Object.defineProperties;
122
+ var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
123
+ var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
124
+ var __hasOwnProp$n = Object.prototype.hasOwnProperty;
125
+ var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
126
+ var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
127
+ var __spreadValues$m = (a, b) => {
128
128
  for (var prop in b || (b = {}))
129
- if (__hasOwnProp$m.call(b, prop))
130
- __defNormalProp$l(a, prop, b[prop]);
131
- if (__getOwnPropSymbols$m)
132
- for (var prop of __getOwnPropSymbols$m(b)) {
133
- if (__propIsEnum$m.call(b, prop))
134
- __defNormalProp$l(a, prop, b[prop]);
129
+ if (__hasOwnProp$n.call(b, prop))
130
+ __defNormalProp$m(a, prop, b[prop]);
131
+ if (__getOwnPropSymbols$n)
132
+ for (var prop of __getOwnPropSymbols$n(b)) {
133
+ if (__propIsEnum$n.call(b, prop))
134
+ __defNormalProp$m(a, prop, b[prop]);
135
135
  }
136
136
  return a;
137
137
  };
138
- var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
138
+ var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
139
139
  class ColumnType extends ColumnTypeBase {
140
140
  /**
141
141
  * Mark the column as a primary key.
@@ -334,13 +334,13 @@ class ColumnType extends ColumnTypeBase {
334
334
  */
335
335
  searchIndex(...args) {
336
336
  return pushColumnData(this, "indexes", {
337
- options: __spreadValues$l(__spreadValues$l({}, typeof args[0] === "string" ? args[1] : args[0]), this.dataType === "tsvector" ? { using: "GIN" } : { tsVector: true }),
337
+ options: __spreadValues$m(__spreadValues$m({}, typeof args[0] === "string" ? args[1] : args[0]), this.dataType === "tsvector" ? { using: "GIN" } : { tsVector: true }),
338
338
  name: typeof args[0] === "string" ? args[0] : void 0
339
339
  });
340
340
  }
341
341
  unique(...args) {
342
342
  return pushColumnData(this, "indexes", {
343
- options: __spreadProps$b(__spreadValues$l({}, typeof args[0] === "string" ? args[1] : args[0]), {
343
+ options: __spreadProps$d(__spreadValues$m({}, typeof args[0] === "string" ? args[1] : args[0]), {
344
344
  unique: true
345
345
  }),
346
346
  name: typeof args[0] === "string" ? args[0] : void 0
@@ -383,25 +383,25 @@ class ColumnType extends ColumnTypeBase {
383
383
  }
384
384
  }
385
385
 
386
- var __defProp$k = Object.defineProperty;
387
- var __defProps$a = Object.defineProperties;
388
- var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
389
- var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
390
- var __hasOwnProp$l = Object.prototype.hasOwnProperty;
391
- var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
392
- var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
393
- var __spreadValues$k = (a, b) => {
386
+ var __defProp$l = Object.defineProperty;
387
+ var __defProps$c = Object.defineProperties;
388
+ var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
389
+ var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
390
+ var __hasOwnProp$m = Object.prototype.hasOwnProperty;
391
+ var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
392
+ var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
393
+ var __spreadValues$l = (a, b) => {
394
394
  for (var prop in b || (b = {}))
395
- if (__hasOwnProp$l.call(b, prop))
396
- __defNormalProp$k(a, prop, b[prop]);
397
- if (__getOwnPropSymbols$l)
398
- for (var prop of __getOwnPropSymbols$l(b)) {
399
- if (__propIsEnum$l.call(b, prop))
400
- __defNormalProp$k(a, prop, b[prop]);
395
+ if (__hasOwnProp$m.call(b, prop))
396
+ __defNormalProp$l(a, prop, b[prop]);
397
+ if (__getOwnPropSymbols$m)
398
+ for (var prop of __getOwnPropSymbols$m(b)) {
399
+ if (__propIsEnum$m.call(b, prop))
400
+ __defNormalProp$l(a, prop, b[prop]);
401
401
  }
402
402
  return a;
403
403
  };
404
- var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
404
+ var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
405
405
  const knownDefaults = {
406
406
  current_timestamp: "now()",
407
407
  "transaction_timestamp()": "now()"
@@ -417,7 +417,7 @@ const simplifyColumnDefault = (value) => {
417
417
  const instantiateColumn = (typeFn, params) => {
418
418
  const column = typeFn();
419
419
  const { dateTimePrecision } = params;
420
- Object.assign(column.data, __spreadProps$a(__spreadValues$k({}, params), {
420
+ Object.assign(column.data, __spreadProps$c(__spreadValues$l({}, params), {
421
421
  dateTimePrecision: (
422
422
  // 0 is default for date, 6 is default for timestamp
423
423
  dateTimePrecision && dateTimePrecision !== 6 ? dateTimePrecision : void 0
@@ -856,25 +856,25 @@ const getSqlText = (sql) => {
856
856
  throw new Error(`Batch SQL is not supported in this query`);
857
857
  };
858
858
 
859
- var __defProp$j = Object.defineProperty;
860
- var __defProps$9 = Object.defineProperties;
861
- var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
862
- var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
863
- var __hasOwnProp$k = Object.prototype.hasOwnProperty;
864
- var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
865
- var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
866
- var __spreadValues$j = (a, b) => {
859
+ var __defProp$k = Object.defineProperty;
860
+ var __defProps$b = Object.defineProperties;
861
+ var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
862
+ var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
863
+ var __hasOwnProp$l = Object.prototype.hasOwnProperty;
864
+ var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
865
+ var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
866
+ var __spreadValues$k = (a, b) => {
867
867
  for (var prop in b || (b = {}))
868
- if (__hasOwnProp$k.call(b, prop))
869
- __defNormalProp$j(a, prop, b[prop]);
870
- if (__getOwnPropSymbols$k)
871
- for (var prop of __getOwnPropSymbols$k(b)) {
872
- if (__propIsEnum$k.call(b, prop))
873
- __defNormalProp$j(a, prop, b[prop]);
868
+ if (__hasOwnProp$l.call(b, prop))
869
+ __defNormalProp$k(a, prop, b[prop]);
870
+ if (__getOwnPropSymbols$l)
871
+ for (var prop of __getOwnPropSymbols$l(b)) {
872
+ if (__propIsEnum$l.call(b, prop))
873
+ __defNormalProp$k(a, prop, b[prop]);
874
874
  }
875
875
  return a;
876
876
  };
877
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
877
+ var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
878
878
  function setQueryOperators(query, operators) {
879
879
  const q = query.q;
880
880
  if (q.operators !== operators) {
@@ -963,7 +963,7 @@ const base = {
963
963
  (key, value, ctx, quotedAs) => `NOT ${key} IN ${quoteValue$1(value, ctx, quotedAs)}`
964
964
  )
965
965
  };
966
- const boolean = __spreadProps$9(__spreadValues$j({}, base), {
966
+ const boolean = __spreadProps$b(__spreadValues$k({}, base), {
967
967
  and: make(
968
968
  (key, value, ctx, quotedAs) => `${key} AND ${value.q.expr.toSQL(ctx, quotedAs)}`
969
969
  ),
@@ -971,7 +971,7 @@ const boolean = __spreadProps$9(__spreadValues$j({}, base), {
971
971
  (key, value, ctx, quotedAs) => `(${key}) OR (${value.q.expr.toSQL(ctx, quotedAs)})`
972
972
  )
973
973
  });
974
- const numeric = __spreadProps$9(__spreadValues$j({}, base), {
974
+ const numeric = __spreadProps$b(__spreadValues$k({}, base), {
975
975
  lt: make(
976
976
  (key, value, ctx, quotedAs) => `${key} < ${quoteValue$1(value, ctx, quotedAs)}`
977
977
  ),
@@ -992,7 +992,7 @@ const numeric = __spreadProps$9(__spreadValues$j({}, base), {
992
992
  )}`
993
993
  )
994
994
  });
995
- const text = __spreadProps$9(__spreadValues$j({}, base), {
995
+ const text = __spreadProps$b(__spreadValues$k({}, base), {
996
996
  contains: make(
997
997
  (key, value, ctx, quotedAs) => `${key} ILIKE '%' || ${quoteLikeValue(value, ctx, quotedAs)} || '%'`
998
998
  ),
@@ -1014,7 +1014,7 @@ const text = __spreadProps$9(__spreadValues$j({}, base), {
1014
1014
  });
1015
1015
  const encodeJsonPath = (ctx, path) => addValue(ctx.values, `{${Array.isArray(path) ? path.join(", ") : path}}`);
1016
1016
  const jsonPathQueryOp = (key, [path, options], ctx) => `jsonb_path_query_first(${key}, ${addValue(ctx.values, path)}${(options == null ? void 0 : options.vars) ? `, ${addValue(ctx.values, JSON.stringify(options.vars))}${options.silent ? ", true" : ""}` : (options == null ? void 0 : options.silent) ? ", NULL, true" : ""})`;
1017
- const json = __spreadProps$9(__spreadValues$j({}, base), {
1017
+ const json = __spreadProps$b(__spreadValues$k({}, base), {
1018
1018
  jsonPathQueryFirst: Object.assign(
1019
1019
  function(path, options) {
1020
1020
  var _a, _b, _c, _d, _e;
@@ -1264,25 +1264,25 @@ class BigSerialColumn extends NumberAsStringBaseColumn {
1264
1264
  }
1265
1265
  }
1266
1266
 
1267
- var __defProp$i = Object.defineProperty;
1268
- var __defProps$8 = Object.defineProperties;
1269
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
1270
- var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
1271
- var __hasOwnProp$j = Object.prototype.hasOwnProperty;
1272
- var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
1273
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1274
- var __spreadValues$i = (a, b) => {
1267
+ var __defProp$j = Object.defineProperty;
1268
+ var __defProps$a = Object.defineProperties;
1269
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
1270
+ var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
1271
+ var __hasOwnProp$k = Object.prototype.hasOwnProperty;
1272
+ var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
1273
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1274
+ var __spreadValues$j = (a, b) => {
1275
1275
  for (var prop in b || (b = {}))
1276
- if (__hasOwnProp$j.call(b, prop))
1277
- __defNormalProp$i(a, prop, b[prop]);
1278
- if (__getOwnPropSymbols$j)
1279
- for (var prop of __getOwnPropSymbols$j(b)) {
1280
- if (__propIsEnum$j.call(b, prop))
1281
- __defNormalProp$i(a, prop, b[prop]);
1276
+ if (__hasOwnProp$k.call(b, prop))
1277
+ __defNormalProp$j(a, prop, b[prop]);
1278
+ if (__getOwnPropSymbols$k)
1279
+ for (var prop of __getOwnPropSymbols$k(b)) {
1280
+ if (__propIsEnum$k.call(b, prop))
1281
+ __defNormalProp$j(a, prop, b[prop]);
1282
1282
  }
1283
1283
  return a;
1284
1284
  };
1285
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
1285
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
1286
1286
  class TextBaseColumn extends ColumnType {
1287
1287
  constructor(schema, schemaType = schema.stringSchema()) {
1288
1288
  super(schema, schemaType);
@@ -1336,7 +1336,7 @@ class StringColumn extends VarCharColumn {
1336
1336
  }
1337
1337
  }
1338
1338
  const textColumnToCode = (column, ctx, key) => {
1339
- const data = __spreadValues$i({}, column.data);
1339
+ const data = __spreadValues$j({}, column.data);
1340
1340
  let args = "";
1341
1341
  const hasMax = data.maxArg !== void 0 && data.max === data.maxArg;
1342
1342
  if (data.minArg !== void 0 && data.min === data.minArg || hasMax) {
@@ -1640,7 +1640,7 @@ class UUIDColumn extends ColumnType {
1640
1640
  key,
1641
1641
  `uuid()`,
1642
1642
  // don't output the default default
1643
- data.default instanceof RawSQLBase && data.default._sql === uuidDefaultSQL ? __spreadProps$8(__spreadValues$i({}, data), { default: void 0 }) : data
1643
+ data.default instanceof RawSQLBase && data.default._sql === uuidDefaultSQL ? __spreadProps$a(__spreadValues$j({}, data), { default: void 0 }) : data
1644
1644
  );
1645
1645
  }
1646
1646
  }
@@ -2041,26 +2041,33 @@ var __privateSet = (obj, member, value, setter) => {
2041
2041
  setter ? setter.call(obj, value) : member.set(obj, value);
2042
2042
  return value;
2043
2043
  };
2044
- var _query;
2044
+ var _query, _query2;
2045
2045
  class OrchidOrmError extends Error {
2046
2046
  }
2047
2047
  class NotFoundError extends OrchidOrmError {
2048
2048
  constructor(query, message = "Record is not found") {
2049
2049
  super(message);
2050
- this.query = query;
2050
+ // `#query` is private to prevent it from serializing to not cause problems to test runner reports
2051
+ __privateAdd(this, _query, void 0);
2052
+ __privateSet(this, _query, query);
2053
+ }
2054
+ get query() {
2055
+ return __privateGet(this, _query);
2051
2056
  }
2052
2057
  }
2058
+ _query = new WeakMap();
2053
2059
  class OrchidOrmInternalError extends Error {
2054
2060
  constructor(query, message) {
2055
2061
  super(message);
2056
- __privateAdd(this, _query, void 0);
2057
- __privateSet(this, _query, query);
2062
+ // `#query` is private to prevent it from serializing to not cause problems to test runner reports
2063
+ __privateAdd(this, _query2, void 0);
2064
+ __privateSet(this, _query2, query);
2058
2065
  }
2059
2066
  get query() {
2060
- return __privateGet(this, _query);
2067
+ return __privateGet(this, _query2);
2061
2068
  }
2062
2069
  }
2063
- _query = new WeakMap();
2070
+ _query2 = new WeakMap();
2064
2071
  class QueryError extends OrchidOrmInternalError {
2065
2072
  get isUnique() {
2066
2073
  return this.code === "23505";
@@ -2416,25 +2423,25 @@ const pushIn = (ctx, query, ands, quotedAs, arg) => {
2416
2423
  ands.push(`${multiple ? `(${columnsSql})` : columnsSql} IN ${value}`);
2417
2424
  };
2418
2425
 
2419
- var __defProp$h = Object.defineProperty;
2420
- var __defProps$7 = Object.defineProperties;
2421
- var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
2422
- var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
2423
- var __hasOwnProp$i = Object.prototype.hasOwnProperty;
2424
- var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
2425
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2426
- var __spreadValues$h = (a, b) => {
2426
+ var __defProp$i = Object.defineProperty;
2427
+ var __defProps$9 = Object.defineProperties;
2428
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
2429
+ var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
2430
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
2431
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
2432
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2433
+ var __spreadValues$i = (a, b) => {
2427
2434
  for (var prop in b || (b = {}))
2428
- if (__hasOwnProp$i.call(b, prop))
2429
- __defNormalProp$h(a, prop, b[prop]);
2430
- if (__getOwnPropSymbols$i)
2431
- for (var prop of __getOwnPropSymbols$i(b)) {
2432
- if (__propIsEnum$i.call(b, prop))
2433
- __defNormalProp$h(a, prop, b[prop]);
2435
+ if (__hasOwnProp$j.call(b, prop))
2436
+ __defNormalProp$i(a, prop, b[prop]);
2437
+ if (__getOwnPropSymbols$j)
2438
+ for (var prop of __getOwnPropSymbols$j(b)) {
2439
+ if (__propIsEnum$j.call(b, prop))
2440
+ __defNormalProp$i(a, prop, b[prop]);
2434
2441
  }
2435
2442
  return a;
2436
2443
  };
2437
- var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
2444
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
2438
2445
  const processJoinItem = (ctx, table, query, args, quotedAs) => {
2439
2446
  let target;
2440
2447
  let on;
@@ -2496,8 +2503,8 @@ const processJoinItem = (ctx, table, query, args, quotedAs) => {
2496
2503
  const whereSql = whereToSql(
2497
2504
  ctx,
2498
2505
  q,
2499
- __spreadProps$7(__spreadValues$h({}, q.q), {
2500
- joinedShapes: __spreadProps$7(__spreadValues$h(__spreadValues$h({}, query.joinedShapes), q.q.joinedShapes), {
2506
+ __spreadProps$9(__spreadValues$i({}, q.q), {
2507
+ joinedShapes: __spreadProps$9(__spreadValues$i(__spreadValues$i({}, query.joinedShapes), q.q.joinedShapes), {
2501
2508
  [table.q.as || table.table]: table.q.shape
2502
2509
  })
2503
2510
  }),
@@ -2644,25 +2651,25 @@ const getIsJoinSubQuery = (query) => {
2644
2651
  return false;
2645
2652
  };
2646
2653
 
2647
- var __defProp$g = Object.defineProperty;
2648
- var __defProps$6 = Object.defineProperties;
2649
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
2650
- var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
2651
- var __hasOwnProp$h = Object.prototype.hasOwnProperty;
2652
- var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
2653
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2654
- var __spreadValues$g = (a, b) => {
2654
+ var __defProp$h = Object.defineProperty;
2655
+ var __defProps$8 = Object.defineProperties;
2656
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
2657
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
2658
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
2659
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
2660
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2661
+ var __spreadValues$h = (a, b) => {
2655
2662
  for (var prop in b || (b = {}))
2656
- if (__hasOwnProp$h.call(b, prop))
2657
- __defNormalProp$g(a, prop, b[prop]);
2658
- if (__getOwnPropSymbols$h)
2659
- for (var prop of __getOwnPropSymbols$h(b)) {
2660
- if (__propIsEnum$h.call(b, prop))
2661
- __defNormalProp$g(a, prop, b[prop]);
2663
+ if (__hasOwnProp$i.call(b, prop))
2664
+ __defNormalProp$h(a, prop, b[prop]);
2665
+ if (__getOwnPropSymbols$i)
2666
+ for (var prop of __getOwnPropSymbols$i(b)) {
2667
+ if (__propIsEnum$i.call(b, prop))
2668
+ __defNormalProp$h(a, prop, b[prop]);
2662
2669
  }
2663
2670
  return a;
2664
2671
  };
2665
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
2672
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
2666
2673
  const processJoinArgs = (joinTo, first, args, joinSubQuery, whereExists) => {
2667
2674
  var _a;
2668
2675
  if (typeof first === "string") {
@@ -2699,13 +2706,13 @@ const processJoinArgs = (joinTo, first, args, joinSubQuery, whereExists) => {
2699
2706
  logger: joinToQ.logger
2700
2707
  };
2701
2708
  j.baseQuery = j;
2702
- const joinedShapes = __spreadProps$6(__spreadValues$g({}, joinToQ.joinedShapes), {
2709
+ const joinedShapes = __spreadProps$8(__spreadValues$h({}, joinToQ.joinedShapes), {
2703
2710
  [joinToQ.as || joinTo.table]: joinTo.shape
2704
2711
  });
2705
2712
  const r = args[0](
2706
2713
  makeJoinQueryBuilder(
2707
2714
  j,
2708
- j.q.joinedShapes ? __spreadValues$g(__spreadValues$g({}, j.q.joinedShapes), joinedShapes) : joinedShapes,
2715
+ j.q.joinedShapes ? __spreadValues$h(__spreadValues$h({}, j.q.joinedShapes), joinedShapes) : joinedShapes,
2709
2716
  joinTo
2710
2717
  )
2711
2718
  );
@@ -2732,16 +2739,16 @@ const processJoinArgs = (joinTo, first, args, joinSubQuery, whereExists) => {
2732
2739
  pushQueryArray(q, "or", query.or);
2733
2740
  }
2734
2741
  if (query.scopes) {
2735
- q.q.scopes = __spreadValues$g(__spreadValues$g({}, q.q.scopes), query.scopes);
2742
+ q.q.scopes = __spreadValues$h(__spreadValues$h({}, q.q.scopes), query.scopes);
2736
2743
  }
2737
2744
  }
2738
- const joinedShapes = __spreadProps$6(__spreadValues$g({}, joinTo.q.joinedShapes), {
2745
+ const joinedShapes = __spreadProps$8(__spreadValues$h({}, joinTo.q.joinedShapes), {
2739
2746
  [joinTo.q.as || joinTo.table]: joinTo.shape
2740
2747
  });
2741
2748
  const r = args0(
2742
2749
  makeJoinQueryBuilder(
2743
2750
  q,
2744
- q.q.joinedShapes ? __spreadValues$g(__spreadValues$g({}, q.q.joinedShapes), joinedShapes) : joinedShapes,
2751
+ q.q.joinedShapes ? __spreadValues$h(__spreadValues$h({}, q.q.joinedShapes), joinedShapes) : joinedShapes,
2745
2752
  joinTo
2746
2753
  )
2747
2754
  );
@@ -2789,25 +2796,25 @@ const _queryNone = (q) => {
2789
2796
  };
2790
2797
  const isQueryNone = (q) => q.then === noneMethods.then;
2791
2798
 
2792
- var __defProp$f = Object.defineProperty;
2793
- var __defProps$5 = Object.defineProperties;
2794
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
2795
- var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
2796
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
2797
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
2798
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2799
- var __spreadValues$f = (a, b) => {
2799
+ var __defProp$g = Object.defineProperty;
2800
+ var __defProps$7 = Object.defineProperties;
2801
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
2802
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
2803
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
2804
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
2805
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2806
+ var __spreadValues$g = (a, b) => {
2800
2807
  for (var prop in b || (b = {}))
2801
- if (__hasOwnProp$g.call(b, prop))
2802
- __defNormalProp$f(a, prop, b[prop]);
2803
- if (__getOwnPropSymbols$g)
2804
- for (var prop of __getOwnPropSymbols$g(b)) {
2805
- if (__propIsEnum$g.call(b, prop))
2806
- __defNormalProp$f(a, prop, b[prop]);
2808
+ if (__hasOwnProp$h.call(b, prop))
2809
+ __defNormalProp$g(a, prop, b[prop]);
2810
+ if (__getOwnPropSymbols$h)
2811
+ for (var prop of __getOwnPropSymbols$h(b)) {
2812
+ if (__propIsEnum$h.call(b, prop))
2813
+ __defNormalProp$g(a, prop, b[prop]);
2807
2814
  }
2808
2815
  return a;
2809
2816
  };
2810
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
2817
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
2811
2818
  const _join = (query, require2, type, first, args) => {
2812
2819
  var _a, _b, _c, _d;
2813
2820
  let joinKey;
@@ -2852,7 +2859,7 @@ const _join = (query, require2, type, first, args) => {
2852
2859
  computeds = w == null ? void 0 : w.computeds;
2853
2860
  if (shape) {
2854
2861
  if (!require2)
2855
- shape = __spreadValues$f({}, shape);
2862
+ shape = __spreadValues$g({}, shape);
2856
2863
  parsers = {};
2857
2864
  for (const key in shape) {
2858
2865
  const parser = shape[key].parseFn;
@@ -2952,7 +2959,7 @@ const _joinLateral = (self, type, arg, cb, as) => {
2952
2959
  t.table = arg;
2953
2960
  t.shape = w.shape;
2954
2961
  t.computeds = w.computeds;
2955
- t.q = __spreadProps$5(__spreadValues$f({}, t.q), {
2962
+ t.q = __spreadProps$7(__spreadValues$g({}, t.q), {
2956
2963
  shape: w.shape
2957
2964
  });
2958
2965
  t.baseQuery = t;
@@ -3271,12 +3278,46 @@ class QueryLog {
3271
3278
  }
3272
3279
  }
3273
3280
 
3281
+ var __defProp$f = Object.defineProperty;
3282
+ var __defProps$6 = Object.defineProperties;
3283
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
3284
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
3285
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
3286
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
3287
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3288
+ var __spreadValues$f = (a, b) => {
3289
+ for (var prop in b || (b = {}))
3290
+ if (__hasOwnProp$g.call(b, prop))
3291
+ __defNormalProp$f(a, prop, b[prop]);
3292
+ if (__getOwnPropSymbols$g)
3293
+ for (var prop of __getOwnPropSymbols$g(b)) {
3294
+ if (__propIsEnum$g.call(b, prop))
3295
+ __defNormalProp$f(a, prop, b[prop]);
3296
+ }
3297
+ return a;
3298
+ };
3299
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
3274
3300
  const commitSql$1 = {
3275
3301
  text: "COMMIT"
3276
3302
  };
3277
3303
  const rollbackSql$1 = {
3278
3304
  text: "ROLLBACK"
3279
3305
  };
3306
+ class AfterCommitError extends OrchidOrmError {
3307
+ constructor(result, hookResults) {
3308
+ super("After commit hooks have failed");
3309
+ this.result = result;
3310
+ this.hookResults = hookResults;
3311
+ }
3312
+ }
3313
+ const _afterCommitError = (result, hookResults, catchAfterCommitError) => {
3314
+ const err = new AfterCommitError(result, hookResults);
3315
+ if (catchAfterCommitError) {
3316
+ catchAfterCommitError(err);
3317
+ } else {
3318
+ throw err;
3319
+ }
3320
+ };
3280
3321
  class Transaction {
3281
3322
  async transaction(cbOrOptions, cb) {
3282
3323
  var _a;
@@ -3322,7 +3363,10 @@ class Transaction {
3322
3363
  const result = await this.q.adapter.transaction(sql, callback);
3323
3364
  if (log)
3324
3365
  log.afterQuery(commitSql$1, logData);
3325
- await runAfterCommit(trx.afterCommit);
3366
+ await runAfterCommit(
3367
+ trx.afterCommit,
3368
+ result
3369
+ );
3326
3370
  return result;
3327
3371
  } catch (err) {
3328
3372
  if (log)
@@ -3356,7 +3400,8 @@ class Transaction {
3356
3400
  log.afterQuery(sql, logData);
3357
3401
  if (transactionId === trx.testTransactionCount) {
3358
3402
  await runAfterCommit(
3359
- trx.afterCommit
3403
+ trx.afterCommit,
3404
+ result
3360
3405
  );
3361
3406
  }
3362
3407
  return result;
@@ -3366,17 +3411,37 @@ class Transaction {
3366
3411
  }
3367
3412
  }
3368
3413
  }
3369
- const runAfterCommit = async (afterCommit) => {
3414
+ const runAfterCommit = async (afterCommit, result) => {
3370
3415
  if (afterCommit) {
3371
3416
  const promises = [];
3417
+ let catchAfterCommitError;
3372
3418
  for (let i = 0, len = afterCommit.length; i < len; i += 3) {
3373
- const result = afterCommit[i];
3419
+ const result2 = afterCommit[i];
3374
3420
  const q = afterCommit[i + 1];
3421
+ if (q.q.catchAfterCommitError) {
3422
+ catchAfterCommitError = q.q.catchAfterCommitError;
3423
+ }
3375
3424
  for (const fn of afterCommit[i + 2]) {
3376
- promises.push(fn(result, q));
3425
+ try {
3426
+ promises.push(fn(result2, q));
3427
+ } catch (err) {
3428
+ promises.push(Promise.reject(err));
3429
+ }
3377
3430
  }
3378
3431
  }
3379
- await Promise.all(promises);
3432
+ const hookResults = await Promise.allSettled(promises);
3433
+ if (hookResults.some((result2) => result2.status === "rejected")) {
3434
+ const resultsWithNames = [];
3435
+ let r = 0;
3436
+ for (let i = 0, len = afterCommit.length; i < len; i += 3) {
3437
+ for (const fn of afterCommit[i + 2]) {
3438
+ resultsWithNames.push(__spreadProps$6(__spreadValues$f({}, hookResults[r++]), {
3439
+ name: fn.name
3440
+ }));
3441
+ }
3442
+ }
3443
+ _afterCommitError(result, resultsWithNames, catchAfterCommitError);
3444
+ }
3380
3445
  }
3381
3446
  };
3382
3447
 
@@ -3433,8 +3498,8 @@ const finalizeNestedHookSelect = (batches, returnType, tempColumns, renames, key
3433
3498
  };
3434
3499
 
3435
3500
  var __defProp$e = Object.defineProperty;
3436
- var __defProps$4 = Object.defineProperties;
3437
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
3501
+ var __defProps$5 = Object.defineProperties;
3502
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
3438
3503
  var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
3439
3504
  var __hasOwnProp$f = Object.prototype.hasOwnProperty;
3440
3505
  var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
@@ -3450,7 +3515,7 @@ var __spreadValues$e = (a, b) => {
3450
3515
  }
3451
3516
  return a;
3452
3517
  };
3453
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
3518
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
3454
3519
  class ComputedColumn {
3455
3520
  constructor(kind, deps, fn) {
3456
3521
  this.kind = kind;
@@ -3467,7 +3532,7 @@ const applyComputedColumns = (q, fn) => {
3467
3532
  for (const key in computed) {
3468
3533
  const item = computed[key];
3469
3534
  if (item instanceof ComputedColumn) {
3470
- q.q.computeds = __spreadProps$4(__spreadValues$e({}, q.q.computeds), { [key]: item });
3535
+ q.q.computeds = __spreadProps$5(__spreadValues$e({}, q.q.computeds), { [key]: item });
3471
3536
  } else {
3472
3537
  (q.shape[key] = item.result.value || UnknownColumn.instance).data.computed = item;
3473
3538
  }
@@ -3576,6 +3641,8 @@ const saveBatchComputed = (key, result, res, blanks) => {
3576
3641
  };
3577
3642
 
3578
3643
  var __defProp$d = Object.defineProperty;
3644
+ var __defProps$4 = Object.defineProperties;
3645
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
3579
3646
  var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
3580
3647
  var __hasOwnProp$e = Object.prototype.hasOwnProperty;
3581
3648
  var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
@@ -3591,6 +3658,7 @@ var __spreadValues$d = (a, b) => {
3591
3658
  }
3592
3659
  return a;
3593
3660
  };
3661
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
3594
3662
  const queryMethodByReturnType = {
3595
3663
  undefined: "query",
3596
3664
  all: "query",
@@ -3811,15 +3879,36 @@ const then = async (q, adapter, trx, beforeHooks, afterHooks, afterCommitHooks,
3811
3879
  )
3812
3880
  );
3813
3881
  }
3814
- if (afterCommitHooks && trx) {
3815
- ((_c = trx.afterCommit) != null ? _c : trx.afterCommit = []).push(
3816
- result,
3817
- q,
3818
- afterCommitHooks
3819
- );
3820
- } else if (afterCommitHooks) {
3821
- const args = [result, q];
3822
- await Promise.all(afterCommitHooks.map(callAfterHook, args));
3882
+ if (afterCommitHooks) {
3883
+ if (trx && // when inside test transactions, push to a transaction only unless it's the outer user transaction.
3884
+ (!trx.testTransactionCount || trx.transactionId + 1 > trx.testTransactionCount)) {
3885
+ ((_c = trx.afterCommit) != null ? _c : trx.afterCommit = []).push(
3886
+ result,
3887
+ q,
3888
+ afterCommitHooks
3889
+ );
3890
+ } else {
3891
+ const promises = [];
3892
+ for (const fn of afterCommitHooks) {
3893
+ try {
3894
+ promises.push(
3895
+ fn(result, q)
3896
+ );
3897
+ } catch (err) {
3898
+ promises.push(Promise.reject(err));
3899
+ }
3900
+ }
3901
+ const hookResults = await Promise.allSettled(promises);
3902
+ if (hookResults.some((result2) => result2.status === "rejected")) {
3903
+ _afterCommitError(
3904
+ result,
3905
+ hookResults.map((result2, i) => __spreadProps$4(__spreadValues$d({}, result2), {
3906
+ name: afterCommitHooks[i].name
3907
+ })),
3908
+ q.q.catchAfterCommitError
3909
+ );
3910
+ }
3911
+ }
3823
3912
  }
3824
3913
  } else if (query.after) {
3825
3914
  const args = [result, q];
@@ -8435,6 +8524,32 @@ class QueryHooks {
8435
8524
  cb
8436
8525
  );
8437
8526
  }
8527
+ /**
8528
+ * Add `catchAfterCommitError` to the query to catch possible errors that are coming from after commit hooks.
8529
+ *
8530
+ * When it is used, the transaction will return its result disregarding of a failed hook.
8531
+ *
8532
+ * Without `catchAfterCommitError`, the transaction function throws and won't return result.
8533
+ * Result is still accessible from the error object [AfterCommitError](#AfterCommitError).
8534
+ *
8535
+ * ```ts
8536
+ * const result = await db
8537
+ * .$transaction(async () => {
8538
+ * return db.table.create(data);
8539
+ * })
8540
+ * .catchAfterCommitError((err) => {
8541
+ * // err is instance of AfterCommitError (see below)
8542
+ * });
8543
+ *
8544
+ * // result is available even if an after commit hook has failed
8545
+ * result.id;
8546
+ * ```
8547
+ */
8548
+ catchAfterCommitError(fn) {
8549
+ const q = this.clone();
8550
+ q.q.catchAfterCommitError = fn;
8551
+ return q;
8552
+ }
8438
8553
  }
8439
8554
 
8440
8555
  class Join {
@@ -12889,5 +13004,5 @@ function copyTableData(query, arg) {
12889
13004
  return q;
12890
13005
  }
12891
13006
 
12892
- export { Adapter, AggregateMethods, ArrayColumn, AsMethods, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, BoxColumn, ByteaColumn, CidrColumn, CircleColumn, CitextColumn, Clear, ColumnRefExpression, ColumnType, ComputedColumn, Create, CustomTypeColumn, DateBaseColumn, DateColumn, DateTimeBaseClass, DateTimeTzBaseClass, Db, DecimalColumn, Delete, DomainColumn, DoublePrecisionColumn, DynamicRawSQL, EnumColumn, ExpressionMethods, FnExpression, For, FromMethods, Having, InetColumn, IntegerBaseColumn, IntegerColumn, IntervalColumn, JSONColumn, JSONTextColumn, Join, JsonMethods, LimitedTextBaseColumn, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, MergeQueryMethods, MoneyColumn, MoreThanOneRowError, NotFoundError, NumberAsStringBaseColumn, NumberBaseColumn, OnConflictQueryBuilder, OnMethods, Operators, OrExpression, OrchidOrmError, OrchidOrmInternalError, PathColumn, PointColumn, PolygonColumn, QueryBase, QueryError, QueryGet, QueryHooks, QueryLog, QueryMethods, QueryUpsertOrCreate, RawSQL, RealColumn, RefExpression, SearchMethods, Select, SerialColumn, SmallIntColumn, SmallSerialColumn, SqlMethod, StringColumn, TextBaseColumn, TextColumn, Then, TimeColumn, TimestampColumn, TimestampTZColumn, Transaction, TransactionAdapter, TransformMethods, TsQueryColumn, TsVectorColumn, UUIDColumn, UnhandledTypeError, Union, UnknownColumn, Update, VarCharColumn, VirtualColumn, Where, WithMethods, XMLColumn, _getSelectableColumn, _initQueryBuilder, _queryAfterSaveCommit, _queryAll, _queryAs, _queryChangeCounter, _queryCreate, _queryCreateFrom, _queryCreateMany, _queryCreateManyFrom, _queryCreateManyRaw, _queryCreateRaw, _queryDefaults, _queryDelete, _queryExec, _queryFindBy, _queryFindByOptional, _queryGet, _queryGetOptional, _queryHookAfterCreate, _queryHookAfterCreateCommit, _queryHookAfterDelete, _queryHookAfterDeleteCommit, _queryHookAfterQuery, _queryHookAfterSave, _queryHookAfterUpdate, _queryHookAfterUpdateCommit, _queryHookBeforeCreate, _queryHookBeforeDelete, _queryHookBeforeQuery, _queryHookBeforeSave, _queryHookBeforeUpdate, _queryInsert, _queryInsertFrom, _queryInsertMany, _queryInsertManyFrom, _queryInsertManyRaw, _queryInsertRaw, _queryJoinOn, _queryJoinOnJsonPathEquals, _queryJoinOrOn, _queryOr, _queryOrNot, _queryRows, _querySelect, _queryTake, _queryTakeOptional, _queryUnion, _queryUpdate, _queryUpdateOrThrow, _queryUpdateRaw, _queryWhere, _queryWhereExists, _queryWhereIn, _queryWhereNot, _queryWhereNotOneOf, _queryWhereNotSql, _queryWhereOneOf, _queryWhereSql, addParserForRawExpression, addParserForSelectItem, addQueryOn, anyShape, applyComputedColumns, checkIfASimpleQuery, cloneQuery, cloneQueryBaseUnscoped, columnCheckToCode, columnCode, columnForeignKeysToCode, columnIndexesToCode, columnsShapeToCode, commitSql$1 as commitSql, constraintInnerToCode, constraintToCode, copyTableData, countSelect, createDb, defaultSchemaConfig, extendQuery, filterResult, foreignKeyArgumentToCode, getClonedQueryData, getColumnInfo, getColumnTypes, getPrimaryKeys, getQueryAs, getShapeFromSelect, getSqlText, handleResult, identityToCode, indexInnerToCode, indexToCode, instantiateColumn, isDefaultTimeStamp, isQueryReturnsAll, isSelectingCount, joinSubQuery, logParamToLogObject, makeColumnTypes, makeColumnsByType, makeFnExpression, makeRegexToFindInSql, makeSQL, parseRecord, parseTableData, parseTableDataInput, primaryKeyInnerToCode, processComputedBatches, processComputedResult, processSelectArg, pushLimitSQL, pushQueryArray, pushQueryOn, pushQueryOnForOuter, pushQueryOrOn, pushQueryValue, pushTableDataCode, queryFrom, queryFromSql, queryJson, queryMethodByReturnType, queryTypeWithLimitOne, queryWrap, quote, quoteString, raw, referencesArgsToCode, resolveSubQueryCallback, rollbackSql$1 as rollbackSql, saveSearchAlias, setParserForSelectedString, setQueryObjectValue, setQueryOperators, simplifyColumnDefault, sqlFn, sqlQueryArgsToExpression, tableDataMethods, templateLiteralToSQL, testTransaction, throwIfNoWhere, toSQL, toSQLCacheKey };
13007
+ export { Adapter, AfterCommitError, AggregateMethods, ArrayColumn, AsMethods, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, BoxColumn, ByteaColumn, CidrColumn, CircleColumn, CitextColumn, Clear, ColumnRefExpression, ColumnType, ComputedColumn, Create, CustomTypeColumn, DateBaseColumn, DateColumn, DateTimeBaseClass, DateTimeTzBaseClass, Db, DecimalColumn, Delete, DomainColumn, DoublePrecisionColumn, DynamicRawSQL, EnumColumn, ExpressionMethods, FnExpression, For, FromMethods, Having, InetColumn, IntegerBaseColumn, IntegerColumn, IntervalColumn, JSONColumn, JSONTextColumn, Join, JsonMethods, LimitedTextBaseColumn, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, MergeQueryMethods, MoneyColumn, MoreThanOneRowError, NotFoundError, NumberAsStringBaseColumn, NumberBaseColumn, OnConflictQueryBuilder, OnMethods, Operators, OrExpression, OrchidOrmError, OrchidOrmInternalError, PathColumn, PointColumn, PolygonColumn, QueryBase, QueryError, QueryGet, QueryHooks, QueryLog, QueryMethods, QueryUpsertOrCreate, RawSQL, RealColumn, RefExpression, SearchMethods, Select, SerialColumn, SmallIntColumn, SmallSerialColumn, SqlMethod, StringColumn, TextBaseColumn, TextColumn, Then, TimeColumn, TimestampColumn, TimestampTZColumn, Transaction, TransactionAdapter, TransformMethods, TsQueryColumn, TsVectorColumn, UUIDColumn, UnhandledTypeError, Union, UnknownColumn, Update, VarCharColumn, VirtualColumn, Where, WithMethods, XMLColumn, _afterCommitError, _getSelectableColumn, _initQueryBuilder, _queryAfterSaveCommit, _queryAll, _queryAs, _queryChangeCounter, _queryCreate, _queryCreateFrom, _queryCreateMany, _queryCreateManyFrom, _queryCreateManyRaw, _queryCreateRaw, _queryDefaults, _queryDelete, _queryExec, _queryFindBy, _queryFindByOptional, _queryGet, _queryGetOptional, _queryHookAfterCreate, _queryHookAfterCreateCommit, _queryHookAfterDelete, _queryHookAfterDeleteCommit, _queryHookAfterQuery, _queryHookAfterSave, _queryHookAfterUpdate, _queryHookAfterUpdateCommit, _queryHookBeforeCreate, _queryHookBeforeDelete, _queryHookBeforeQuery, _queryHookBeforeSave, _queryHookBeforeUpdate, _queryInsert, _queryInsertFrom, _queryInsertMany, _queryInsertManyFrom, _queryInsertManyRaw, _queryInsertRaw, _queryJoinOn, _queryJoinOnJsonPathEquals, _queryJoinOrOn, _queryOr, _queryOrNot, _queryRows, _querySelect, _queryTake, _queryTakeOptional, _queryUnion, _queryUpdate, _queryUpdateOrThrow, _queryUpdateRaw, _queryWhere, _queryWhereExists, _queryWhereIn, _queryWhereNot, _queryWhereNotOneOf, _queryWhereNotSql, _queryWhereOneOf, _queryWhereSql, addParserForRawExpression, addParserForSelectItem, addQueryOn, anyShape, applyComputedColumns, checkIfASimpleQuery, cloneQuery, cloneQueryBaseUnscoped, columnCheckToCode, columnCode, columnForeignKeysToCode, columnIndexesToCode, columnsShapeToCode, commitSql$1 as commitSql, constraintInnerToCode, constraintToCode, copyTableData, countSelect, createDb, defaultSchemaConfig, extendQuery, filterResult, foreignKeyArgumentToCode, getClonedQueryData, getColumnInfo, getColumnTypes, getPrimaryKeys, getQueryAs, getShapeFromSelect, getSqlText, handleResult, identityToCode, indexInnerToCode, indexToCode, instantiateColumn, isDefaultTimeStamp, isQueryReturnsAll, isSelectingCount, joinSubQuery, logParamToLogObject, makeColumnTypes, makeColumnsByType, makeFnExpression, makeRegexToFindInSql, makeSQL, parseRecord, parseTableData, parseTableDataInput, primaryKeyInnerToCode, processComputedBatches, processComputedResult, processSelectArg, pushLimitSQL, pushQueryArray, pushQueryOn, pushQueryOnForOuter, pushQueryOrOn, pushQueryValue, pushTableDataCode, queryFrom, queryFromSql, queryJson, queryMethodByReturnType, queryTypeWithLimitOne, queryWrap, quote, quoteString, raw, referencesArgsToCode, resolveSubQueryCallback, rollbackSql$1 as rollbackSql, saveSearchAlias, setParserForSelectedString, setQueryObjectValue, setQueryOperators, simplifyColumnDefault, sqlFn, sqlQueryArgsToExpression, tableDataMethods, templateLiteralToSQL, testTransaction, throwIfNoWhere, toSQL, toSQLCacheKey };
12893
13008
  //# sourceMappingURL=index.mjs.map