pqb 0.3.2 → 0.3.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.esm.js CHANGED
@@ -1,27 +1,27 @@
1
1
  import { types, Pool } from 'pg';
2
2
 
3
- var __defProp$p = Object.defineProperty;
3
+ var __defProp$q = Object.defineProperty;
4
4
  var __defProps$l = Object.defineProperties;
5
5
  var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
6
- var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
7
- var __hasOwnProp$q = Object.prototype.hasOwnProperty;
8
- var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues$p = (a, b) => {
6
+ var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
7
+ var __hasOwnProp$r = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __spreadValues$q = (a, b) => {
11
11
  for (var prop in b || (b = {}))
12
- if (__hasOwnProp$q.call(b, prop))
13
- __defNormalProp$p(a, prop, b[prop]);
14
- if (__getOwnPropSymbols$q)
15
- for (var prop of __getOwnPropSymbols$q(b)) {
16
- if (__propIsEnum$q.call(b, prop))
17
- __defNormalProp$p(a, prop, b[prop]);
12
+ if (__hasOwnProp$r.call(b, prop))
13
+ __defNormalProp$q(a, prop, b[prop]);
14
+ if (__getOwnPropSymbols$r)
15
+ for (var prop of __getOwnPropSymbols$r(b)) {
16
+ if (__propIsEnum$r.call(b, prop))
17
+ __defNormalProp$q(a, prop, b[prop]);
18
18
  }
19
19
  return a;
20
20
  };
21
21
  var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
22
22
  const addColumnData = (q, key, value) => {
23
23
  const cloned = Object.create(q);
24
- cloned.data = __spreadProps$l(__spreadValues$p({}, q.data), { [key]: value });
24
+ cloned.data = __spreadProps$l(__spreadValues$q({}, q.data), { [key]: value });
25
25
  return cloned;
26
26
  };
27
27
  class ColumnType {
@@ -39,12 +39,12 @@ class ColumnType {
39
39
  foreignKey(fnOrTable, column, options = {}) {
40
40
  const cloned = Object.create(this);
41
41
  if (typeof fnOrTable === "string") {
42
- cloned.data = __spreadProps$l(__spreadValues$p({}, this.data), {
43
- foreignKey: __spreadValues$p({ table: fnOrTable, columns: [column] }, options)
42
+ cloned.data = __spreadProps$l(__spreadValues$q({}, this.data), {
43
+ foreignKey: __spreadValues$q({ table: fnOrTable, columns: [column] }, options)
44
44
  });
45
45
  } else {
46
- cloned.data = __spreadProps$l(__spreadValues$p({}, this.data), {
47
- foreignKey: __spreadValues$p({ fn: fnOrTable, columns: [column] }, options)
46
+ cloned.data = __spreadProps$l(__spreadValues$q({}, this.data), {
47
+ foreignKey: __spreadValues$q({ fn: fnOrTable, columns: [column] }, options)
48
48
  });
49
49
  }
50
50
  return cloned;
@@ -76,7 +76,7 @@ class ColumnType {
76
76
  return addColumnData(this, "index", options);
77
77
  }
78
78
  unique(options = {}) {
79
- return addColumnData(this, "index", __spreadProps$l(__spreadValues$p({}, options), { unique: true }));
79
+ return addColumnData(this, "index", __spreadProps$l(__spreadValues$q({}, options), { unique: true }));
80
80
  }
81
81
  comment(comment) {
82
82
  return addColumnData(this, "comment", comment);
@@ -203,21 +203,21 @@ const addValue = (values, value) => {
203
203
  return `$${values.length}`;
204
204
  };
205
205
 
206
- var __defProp$o = Object.defineProperty;
206
+ var __defProp$p = Object.defineProperty;
207
207
  var __defProps$k = Object.defineProperties;
208
208
  var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
209
- var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
210
- var __hasOwnProp$p = Object.prototype.hasOwnProperty;
211
- var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
212
- var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
213
- var __spreadValues$o = (a, b) => {
209
+ var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
210
+ var __hasOwnProp$q = Object.prototype.hasOwnProperty;
211
+ var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
212
+ var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
213
+ var __spreadValues$p = (a, b) => {
214
214
  for (var prop in b || (b = {}))
215
- if (__hasOwnProp$p.call(b, prop))
216
- __defNormalProp$o(a, prop, b[prop]);
217
- if (__getOwnPropSymbols$p)
218
- for (var prop of __getOwnPropSymbols$p(b)) {
219
- if (__propIsEnum$p.call(b, prop))
220
- __defNormalProp$o(a, prop, b[prop]);
215
+ if (__hasOwnProp$q.call(b, prop))
216
+ __defNormalProp$p(a, prop, b[prop]);
217
+ if (__getOwnPropSymbols$q)
218
+ for (var prop of __getOwnPropSymbols$q(b)) {
219
+ if (__propIsEnum$q.call(b, prop))
220
+ __defNormalProp$p(a, prop, b[prop]);
221
221
  }
222
222
  return a;
223
223
  };
@@ -307,14 +307,14 @@ const base = () => ({
307
307
  in: all.in(),
308
308
  notIn: all.notIn()
309
309
  });
310
- const numeric = () => __spreadProps$k(__spreadValues$o({}, base()), {
310
+ const numeric = () => __spreadProps$k(__spreadValues$p({}, base()), {
311
311
  lt: all.lt(),
312
312
  lte: all.lte(),
313
313
  gt: all.gt(),
314
314
  gte: all.gte(),
315
315
  between: all.between()
316
316
  });
317
- const text = () => __spreadProps$k(__spreadValues$o({}, base()), {
317
+ const text = () => __spreadProps$k(__spreadValues$p({}, base()), {
318
318
  contains: all.contains(),
319
319
  containsInsensitive: all.containsInsensitive(),
320
320
  startsWith: all.startsWith(),
@@ -322,7 +322,7 @@ const text = () => __spreadProps$k(__spreadValues$o({}, base()), {
322
322
  endsWith: all.endsWith(),
323
323
  endsWithInsensitive: all.endsWithInsensitive()
324
324
  });
325
- const json = () => __spreadProps$k(__spreadValues$o({}, base()), {
325
+ const json = () => __spreadProps$k(__spreadValues$p({}, base()), {
326
326
  jsonPath: all.jsonPath(),
327
327
  jsonSupersetOf: all.jsonSupersetOf(),
328
328
  jsonSubsetOf: all.jsonSubsetOf()
@@ -338,6 +338,12 @@ const Operators = {
338
338
  array: base()
339
339
  };
340
340
 
341
+ const defaultsKey = Symbol("defaults");
342
+ const queryTypeWithLimitOne = {
343
+ one: true,
344
+ oneOrThrow: true
345
+ };
346
+
341
347
  const pushDistinctSql = (ctx, distinct, quotedAs) => {
342
348
  ctx.sql.push("DISTINCT");
343
349
  if (distinct.length) {
@@ -690,21 +696,21 @@ const pushIn = (ands, prefix, quotedAs, values, arg) => {
690
696
  );
691
697
  };
692
698
 
693
- var __defProp$n = Object.defineProperty;
699
+ var __defProp$o = Object.defineProperty;
694
700
  var __defProps$j = Object.defineProperties;
695
701
  var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
696
- var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
697
- var __hasOwnProp$o = Object.prototype.hasOwnProperty;
698
- var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
699
- var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
700
- var __spreadValues$n = (a, b) => {
702
+ var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
703
+ var __hasOwnProp$p = Object.prototype.hasOwnProperty;
704
+ var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
705
+ var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
706
+ var __spreadValues$o = (a, b) => {
701
707
  for (var prop in b || (b = {}))
702
- if (__hasOwnProp$o.call(b, prop))
703
- __defNormalProp$n(a, prop, b[prop]);
704
- if (__getOwnPropSymbols$o)
705
- for (var prop of __getOwnPropSymbols$o(b)) {
706
- if (__propIsEnum$o.call(b, prop))
707
- __defNormalProp$n(a, prop, b[prop]);
708
+ if (__hasOwnProp$p.call(b, prop))
709
+ __defNormalProp$o(a, prop, b[prop]);
710
+ if (__getOwnPropSymbols$p)
711
+ for (var prop of __getOwnPropSymbols$p(b)) {
712
+ if (__propIsEnum$p.call(b, prop))
713
+ __defNormalProp$o(a, prop, b[prop]);
708
714
  }
709
715
  return a;
710
716
  };
@@ -712,7 +718,7 @@ var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
712
718
  const aggregateToSql = (ctx, model, item, quotedAs) => {
713
719
  var _a;
714
720
  const sql = [`${item.function}(`];
715
- ctx = __spreadProps$j(__spreadValues$n({}, ctx), { sql });
721
+ ctx = __spreadProps$j(__spreadValues$o({}, ctx), { sql });
716
722
  const options = item.options || EMPTY_OBJECT;
717
723
  if (options.distinct && !options.withinGroup)
718
724
  sql.push("DISTINCT ");
@@ -880,7 +886,7 @@ const selectToSql = (ctx, model, query, quotedAs) => {
880
886
  }
881
887
  };
882
888
  const pushSubQuerySql = (query, as, values, list) => {
883
- const { returnType } = query.query;
889
+ const { returnType = "all" } = query.query;
884
890
  switch (returnType) {
885
891
  case "all":
886
892
  case "one":
@@ -897,7 +903,6 @@ const pushSubQuerySql = (query, as, values, list) => {
897
903
  select[0] = { selectAs: { c: first } };
898
904
  query = query._wrap(query.__model.clone());
899
905
  query._getOptional(raw(`COALESCE(json_agg("c"), '[]')`));
900
- delete query.query.take;
901
906
  break;
902
907
  }
903
908
  case "rows":
@@ -1015,22 +1020,30 @@ const havingToSql = (ctx, model, query, quotedAs) => {
1015
1020
  };
1016
1021
 
1017
1022
  const pushWithSql = (ctx, withData) => {
1018
- withData.forEach((withItem) => {
1019
- const [name, options, query] = withItem;
1020
- let inner;
1021
- if (isRaw(query)) {
1022
- inner = getRaw(query, ctx.values);
1023
- } else {
1024
- inner = query.toSql({ values: ctx.values }).text;
1025
- }
1026
- ctx.sql.push(
1027
- `WITH ${options.recursive ? "RECURSIVE " : ""}${q(name)}${options.columns ? `(${options.columns.map(q).join(", ")})` : ""} AS ${options.materialized ? "MATERIALIZED " : options.notMaterialized ? "NOT MATERIALIZED " : ""}(${inner})`
1028
- );
1029
- });
1023
+ if (!withData.length)
1024
+ return;
1025
+ ctx.sql.push(
1026
+ "WITH",
1027
+ withData.map((withItem) => {
1028
+ const [name, options, query] = withItem;
1029
+ let inner;
1030
+ if (isRaw(query)) {
1031
+ inner = getRaw(query, ctx.values);
1032
+ } else {
1033
+ inner = query.toSql({ values: ctx.values }).text;
1034
+ }
1035
+ return `${options.recursive ? "RECURSIVE " : ""}${q(name)}${options.columns ? `(${options.columns.map(q).join(", ")})` : ""} AS ${options.materialized ? "MATERIALIZED " : options.notMaterialized ? "NOT MATERIALIZED " : ""}(${inner})`;
1036
+ }).join(", ")
1037
+ );
1030
1038
  };
1031
1039
 
1040
+ const checkIfASimpleQuery = (q) => {
1041
+ if (q.returnType && q.returnType !== "all")
1042
+ return false;
1043
+ const keys = Object.keys(q);
1044
+ return !keys.some((key) => queryKeysOfNotSimpleQuery.includes(key));
1045
+ };
1032
1046
  const queryKeysOfNotSimpleQuery = [
1033
- "take",
1034
1047
  "with",
1035
1048
  "as",
1036
1049
  "from",
@@ -1072,8 +1085,7 @@ const getFrom = (model, query, values) => {
1072
1085
  return `(${sql.text})`;
1073
1086
  }
1074
1087
  const q = query.from.query;
1075
- const keys = Object.keys(q);
1076
- if (keys.some((key) => queryKeysOfNotSimpleQuery.includes(key))) {
1088
+ if (!checkIfASimpleQuery(q)) {
1077
1089
  const sql = query.from.toSql({ values });
1078
1090
  return `(${sql.text})`;
1079
1091
  }
@@ -1329,8 +1341,9 @@ const makeSql = (model, { values = [] } = {}) => {
1329
1341
  if (query.order) {
1330
1342
  pushOrderBySql(ctx, quotedAs, query.order);
1331
1343
  }
1332
- if (query.take || query.limit !== void 0) {
1333
- sql.push(`LIMIT ${addValue(values, query.take ? 1 : query.limit)}`);
1344
+ const limit = queryTypeWithLimitOne[query.returnType] ? 1 : query.limit;
1345
+ if (limit) {
1346
+ sql.push(`LIMIT ${addValue(values, limit)}`);
1334
1347
  }
1335
1348
  if (query.offset) {
1336
1349
  sql.push(`OFFSET ${addValue(values, query.offset)}`);
@@ -1351,21 +1364,21 @@ const makeSql = (model, { values = [] } = {}) => {
1351
1364
  return { text: sql.join(" "), values };
1352
1365
  };
1353
1366
 
1354
- var __defProp$m = Object.defineProperty;
1367
+ var __defProp$n = Object.defineProperty;
1355
1368
  var __defProps$i = Object.defineProperties;
1356
1369
  var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
1357
- var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
1358
- var __hasOwnProp$n = Object.prototype.hasOwnProperty;
1359
- var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
1360
- var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1361
- var __spreadValues$m = (a, b) => {
1370
+ var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
1371
+ var __hasOwnProp$o = Object.prototype.hasOwnProperty;
1372
+ var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
1373
+ var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1374
+ var __spreadValues$n = (a, b) => {
1362
1375
  for (var prop in b || (b = {}))
1363
- if (__hasOwnProp$n.call(b, prop))
1364
- __defNormalProp$m(a, prop, b[prop]);
1365
- if (__getOwnPropSymbols$n)
1366
- for (var prop of __getOwnPropSymbols$n(b)) {
1367
- if (__propIsEnum$n.call(b, prop))
1368
- __defNormalProp$m(a, prop, b[prop]);
1376
+ if (__hasOwnProp$o.call(b, prop))
1377
+ __defNormalProp$n(a, prop, b[prop]);
1378
+ if (__getOwnPropSymbols$o)
1379
+ for (var prop of __getOwnPropSymbols$o(b)) {
1380
+ if (__propIsEnum$o.call(b, prop))
1381
+ __defNormalProp$n(a, prop, b[prop]);
1369
1382
  }
1370
1383
  return a;
1371
1384
  };
@@ -1385,7 +1398,7 @@ const joinTruthy = (...strings) => {
1385
1398
  return strings.filter((string) => string).join("");
1386
1399
  };
1387
1400
  const getClonedQueryData = (query) => {
1388
- const cloned = __spreadProps$i(__spreadValues$m({}, query), { [toSqlCacheKey]: void 0 });
1401
+ const cloned = __spreadProps$i(__spreadValues$n({}, query), { [toSqlCacheKey]: void 0 });
1389
1402
  for (const key in query) {
1390
1403
  if (Array.isArray(query[key])) {
1391
1404
  cloned[key] = [
@@ -1446,28 +1459,28 @@ var utils = /*#__PURE__*/Object.freeze({
1446
1459
  assignMethodsToClass: assignMethodsToClass
1447
1460
  });
1448
1461
 
1449
- var __defProp$l = Object.defineProperty;
1462
+ var __defProp$m = Object.defineProperty;
1450
1463
  var __defProps$h = Object.defineProperties;
1451
1464
  var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
1452
- var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
1453
- var __hasOwnProp$m = Object.prototype.hasOwnProperty;
1454
- var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
1455
- var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1456
- var __spreadValues$l = (a, b) => {
1465
+ var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
1466
+ var __hasOwnProp$n = Object.prototype.hasOwnProperty;
1467
+ var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
1468
+ var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1469
+ var __spreadValues$m = (a, b) => {
1457
1470
  for (var prop in b || (b = {}))
1458
- if (__hasOwnProp$m.call(b, prop))
1459
- __defNormalProp$l(a, prop, b[prop]);
1460
- if (__getOwnPropSymbols$m)
1461
- for (var prop of __getOwnPropSymbols$m(b)) {
1462
- if (__propIsEnum$m.call(b, prop))
1463
- __defNormalProp$l(a, prop, b[prop]);
1471
+ if (__hasOwnProp$n.call(b, prop))
1472
+ __defNormalProp$m(a, prop, b[prop]);
1473
+ if (__getOwnPropSymbols$n)
1474
+ for (var prop of __getOwnPropSymbols$n(b)) {
1475
+ if (__propIsEnum$n.call(b, prop))
1476
+ __defNormalProp$m(a, prop, b[prop]);
1464
1477
  }
1465
1478
  return a;
1466
1479
  };
1467
1480
  var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
1468
1481
  const setDataValue = (item, key, value) => {
1469
1482
  const cloned = Object.create(item);
1470
- cloned.data = __spreadProps$h(__spreadValues$l({}, item.data), { [key]: value });
1483
+ cloned.data = __spreadProps$h(__spreadValues$m({}, item.data), { [key]: value });
1471
1484
  return cloned;
1472
1485
  };
1473
1486
  function min(value) {
@@ -1497,7 +1510,7 @@ const setMethods = {
1497
1510
  size,
1498
1511
  nonempty
1499
1512
  };
1500
- const stringTypeMethods = () => __spreadProps$h(__spreadValues$l({}, arrayMethods), {
1513
+ const stringTypeMethods = () => __spreadProps$h(__spreadValues$m({}, arrayMethods), {
1501
1514
  email() {
1502
1515
  return setDataValue(this, "email", true);
1503
1516
  },
@@ -1968,21 +1981,21 @@ class EnumColumn extends ColumnType {
1968
1981
  }
1969
1982
  }
1970
1983
 
1971
- var __defProp$k = Object.defineProperty;
1984
+ var __defProp$l = Object.defineProperty;
1972
1985
  var __defProps$g = Object.defineProperties;
1973
1986
  var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
1974
- var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
1975
- var __hasOwnProp$l = Object.prototype.hasOwnProperty;
1976
- var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
1977
- var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1978
- var __spreadValues$k = (a, b) => {
1987
+ var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
1988
+ var __hasOwnProp$m = Object.prototype.hasOwnProperty;
1989
+ var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
1990
+ var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1991
+ var __spreadValues$l = (a, b) => {
1979
1992
  for (var prop in b || (b = {}))
1980
- if (__hasOwnProp$l.call(b, prop))
1981
- __defNormalProp$k(a, prop, b[prop]);
1982
- if (__getOwnPropSymbols$l)
1983
- for (var prop of __getOwnPropSymbols$l(b)) {
1984
- if (__propIsEnum$l.call(b, prop))
1985
- __defNormalProp$k(a, prop, b[prop]);
1993
+ if (__hasOwnProp$m.call(b, prop))
1994
+ __defNormalProp$l(a, prop, b[prop]);
1995
+ if (__getOwnPropSymbols$m)
1996
+ for (var prop of __getOwnPropSymbols$m(b)) {
1997
+ if (__propIsEnum$m.call(b, prop))
1998
+ __defNormalProp$l(a, prop, b[prop]);
1986
1999
  }
1987
2000
  return a;
1988
2001
  };
@@ -1990,42 +2003,42 @@ var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
1990
2003
  var __objRest$4 = (source, exclude) => {
1991
2004
  var target = {};
1992
2005
  for (var prop in source)
1993
- if (__hasOwnProp$l.call(source, prop) && exclude.indexOf(prop) < 0)
2006
+ if (__hasOwnProp$m.call(source, prop) && exclude.indexOf(prop) < 0)
1994
2007
  target[prop] = source[prop];
1995
- if (source != null && __getOwnPropSymbols$l)
1996
- for (var prop of __getOwnPropSymbols$l(source)) {
1997
- if (exclude.indexOf(prop) < 0 && __propIsEnum$l.call(source, prop))
2008
+ if (source != null && __getOwnPropSymbols$m)
2009
+ for (var prop of __getOwnPropSymbols$m(source)) {
2010
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$m.call(source, prop))
1998
2011
  target[prop] = source[prop];
1999
2012
  }
2000
2013
  return target;
2001
2014
  };
2002
2015
  const optional = (type) => {
2003
- return __spreadProps$g(__spreadValues$k({}, type), {
2004
- data: __spreadProps$g(__spreadValues$k({}, type.data), { optional: true })
2016
+ return __spreadProps$g(__spreadValues$l({}, type), {
2017
+ data: __spreadProps$g(__spreadValues$l({}, type.data), { optional: true })
2005
2018
  });
2006
2019
  };
2007
2020
  const required = (type) => {
2008
2021
  const _a = type.data, data = __objRest$4(_a, ["optional"]);
2009
- return __spreadProps$g(__spreadValues$k({}, type), {
2022
+ return __spreadProps$g(__spreadValues$l({}, type), {
2010
2023
  data
2011
2024
  });
2012
2025
  };
2013
2026
 
2014
- var __defProp$j = Object.defineProperty;
2027
+ var __defProp$k = Object.defineProperty;
2015
2028
  var __defProps$f = Object.defineProperties;
2016
2029
  var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
2017
- var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
2018
- var __hasOwnProp$k = Object.prototype.hasOwnProperty;
2019
- var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
2020
- var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2021
- var __spreadValues$j = (a, b) => {
2030
+ var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
2031
+ var __hasOwnProp$l = Object.prototype.hasOwnProperty;
2032
+ var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
2033
+ var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2034
+ var __spreadValues$k = (a, b) => {
2022
2035
  for (var prop in b || (b = {}))
2023
- if (__hasOwnProp$k.call(b, prop))
2024
- __defNormalProp$j(a, prop, b[prop]);
2025
- if (__getOwnPropSymbols$k)
2026
- for (var prop of __getOwnPropSymbols$k(b)) {
2027
- if (__propIsEnum$k.call(b, prop))
2028
- __defNormalProp$j(a, prop, b[prop]);
2036
+ if (__hasOwnProp$l.call(b, prop))
2037
+ __defNormalProp$k(a, prop, b[prop]);
2038
+ if (__getOwnPropSymbols$l)
2039
+ for (var prop of __getOwnPropSymbols$l(b)) {
2040
+ if (__propIsEnum$l.call(b, prop))
2041
+ __defNormalProp$k(a, prop, b[prop]);
2029
2042
  }
2030
2043
  return a;
2031
2044
  };
@@ -2033,42 +2046,42 @@ var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
2033
2046
  var __objRest$3 = (source, exclude) => {
2034
2047
  var target = {};
2035
2048
  for (var prop in source)
2036
- if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
2049
+ if (__hasOwnProp$l.call(source, prop) && exclude.indexOf(prop) < 0)
2037
2050
  target[prop] = source[prop];
2038
- if (source != null && __getOwnPropSymbols$k)
2039
- for (var prop of __getOwnPropSymbols$k(source)) {
2040
- if (exclude.indexOf(prop) < 0 && __propIsEnum$k.call(source, prop))
2051
+ if (source != null && __getOwnPropSymbols$l)
2052
+ for (var prop of __getOwnPropSymbols$l(source)) {
2053
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$l.call(source, prop))
2041
2054
  target[prop] = source[prop];
2042
2055
  }
2043
2056
  return target;
2044
2057
  };
2045
2058
  const nullable = (type) => {
2046
- return __spreadProps$f(__spreadValues$j({}, type), {
2047
- data: __spreadProps$f(__spreadValues$j({}, type.data), { nullable: true })
2059
+ return __spreadProps$f(__spreadValues$k({}, type), {
2060
+ data: __spreadProps$f(__spreadValues$k({}, type.data), { nullable: true })
2048
2061
  });
2049
2062
  };
2050
2063
  const notNullable = (type) => {
2051
2064
  const _a = type.data, data = __objRest$3(_a, ["nullable"]);
2052
- return __spreadProps$f(__spreadValues$j({}, type), {
2065
+ return __spreadProps$f(__spreadValues$k({}, type), {
2053
2066
  data
2054
2067
  });
2055
2068
  };
2056
2069
 
2057
- var __defProp$i = Object.defineProperty;
2070
+ var __defProp$j = Object.defineProperty;
2058
2071
  var __defProps$e = Object.defineProperties;
2059
2072
  var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
2060
- var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
2061
- var __hasOwnProp$j = Object.prototype.hasOwnProperty;
2062
- var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
2063
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2064
- var __spreadValues$i = (a, b) => {
2073
+ var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
2074
+ var __hasOwnProp$k = Object.prototype.hasOwnProperty;
2075
+ var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
2076
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2077
+ var __spreadValues$j = (a, b) => {
2065
2078
  for (var prop in b || (b = {}))
2066
- if (__hasOwnProp$j.call(b, prop))
2067
- __defNormalProp$i(a, prop, b[prop]);
2068
- if (__getOwnPropSymbols$j)
2069
- for (var prop of __getOwnPropSymbols$j(b)) {
2070
- if (__propIsEnum$j.call(b, prop))
2071
- __defNormalProp$i(a, prop, b[prop]);
2079
+ if (__hasOwnProp$k.call(b, prop))
2080
+ __defNormalProp$j(a, prop, b[prop]);
2081
+ if (__getOwnPropSymbols$k)
2082
+ for (var prop of __getOwnPropSymbols$k(b)) {
2083
+ if (__propIsEnum$k.call(b, prop))
2084
+ __defNormalProp$j(a, prop, b[prop]);
2072
2085
  }
2073
2086
  return a;
2074
2087
  };
@@ -2076,23 +2089,23 @@ var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
2076
2089
  var __objRest$2 = (source, exclude) => {
2077
2090
  var target = {};
2078
2091
  for (var prop in source)
2079
- if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
2092
+ if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
2080
2093
  target[prop] = source[prop];
2081
- if (source != null && __getOwnPropSymbols$j)
2082
- for (var prop of __getOwnPropSymbols$j(source)) {
2083
- if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
2094
+ if (source != null && __getOwnPropSymbols$k)
2095
+ for (var prop of __getOwnPropSymbols$k(source)) {
2096
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$k.call(source, prop))
2084
2097
  target[prop] = source[prop];
2085
2098
  }
2086
2099
  return target;
2087
2100
  };
2088
2101
  const nullish = (type) => {
2089
- return __spreadProps$e(__spreadValues$i({}, type), {
2090
- data: __spreadProps$e(__spreadValues$i({}, type.data), { nullable: true, optional: true })
2102
+ return __spreadProps$e(__spreadValues$j({}, type), {
2103
+ data: __spreadProps$e(__spreadValues$j({}, type.data), { nullable: true, optional: true })
2091
2104
  });
2092
2105
  };
2093
2106
  const notNullish = (type) => {
2094
2107
  const _a = type.data, data = __objRest$2(_a, ["nullable", "optional"]);
2095
- return __spreadProps$e(__spreadValues$i({}, type), {
2108
+ return __spreadProps$e(__spreadValues$j({}, type), {
2096
2109
  data
2097
2110
  });
2098
2111
  };
@@ -2112,21 +2125,21 @@ const union = (types) => {
2112
2125
  });
2113
2126
  };
2114
2127
 
2115
- var __defProp$h = Object.defineProperty;
2128
+ var __defProp$i = Object.defineProperty;
2116
2129
  var __defProps$d = Object.defineProperties;
2117
2130
  var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
2118
- var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
2119
- var __hasOwnProp$i = Object.prototype.hasOwnProperty;
2120
- var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
2121
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2122
- var __spreadValues$h = (a, b) => {
2131
+ var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
2132
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
2133
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
2134
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2135
+ var __spreadValues$i = (a, b) => {
2123
2136
  for (var prop in b || (b = {}))
2124
- if (__hasOwnProp$i.call(b, prop))
2125
- __defNormalProp$h(a, prop, b[prop]);
2126
- if (__getOwnPropSymbols$i)
2127
- for (var prop of __getOwnPropSymbols$i(b)) {
2128
- if (__propIsEnum$i.call(b, prop))
2129
- __defNormalProp$h(a, prop, b[prop]);
2137
+ if (__hasOwnProp$j.call(b, prop))
2138
+ __defNormalProp$i(a, prop, b[prop]);
2139
+ if (__getOwnPropSymbols$j)
2140
+ for (var prop of __getOwnPropSymbols$j(b)) {
2141
+ if (__propIsEnum$j.call(b, prop))
2142
+ __defNormalProp$i(a, prop, b[prop]);
2130
2143
  }
2131
2144
  return a;
2132
2145
  };
@@ -2158,22 +2171,22 @@ const baseTypeMethods = {
2158
2171
  return this;
2159
2172
  },
2160
2173
  transform(fn) {
2161
- return __spreadProps$d(__spreadValues$h({}, this), {
2174
+ return __spreadProps$d(__spreadValues$i({}, this), {
2162
2175
  chain: [...this.chain, ["transform", fn]]
2163
2176
  });
2164
2177
  },
2165
2178
  to(fn, type) {
2166
- return __spreadProps$d(__spreadValues$h({}, type), {
2179
+ return __spreadProps$d(__spreadValues$i({}, type), {
2167
2180
  chain: [...this.chain, ["to", fn, type], ...type.chain]
2168
2181
  });
2169
2182
  },
2170
2183
  refine(check) {
2171
- return __spreadProps$d(__spreadValues$h({}, this), {
2184
+ return __spreadProps$d(__spreadValues$i({}, this), {
2172
2185
  chain: [...this.chain, ["refine", check]]
2173
2186
  });
2174
2187
  },
2175
2188
  superRefine(check) {
2176
- return __spreadProps$d(__spreadValues$h({}, this), {
2189
+ return __spreadProps$d(__spreadValues$i({}, this), {
2177
2190
  chain: [...this.chain, ["superRefine", check]]
2178
2191
  });
2179
2192
  },
@@ -2186,7 +2199,7 @@ const baseTypeMethods = {
2186
2199
  },
2187
2200
  default(value) {
2188
2201
  const cloned = Object.create(this);
2189
- cloned.data = __spreadProps$d(__spreadValues$h({}, cloned.data), { default: value });
2202
+ cloned.data = __spreadProps$d(__spreadValues$i({}, cloned.data), { default: value });
2190
2203
  return cloned;
2191
2204
  },
2192
2205
  array() {
@@ -2194,34 +2207,34 @@ const baseTypeMethods = {
2194
2207
  }
2195
2208
  };
2196
2209
  const constructType = (type) => {
2197
- return __spreadValues$h(__spreadValues$h({}, baseTypeMethods), type);
2210
+ return __spreadValues$i(__spreadValues$i({}, baseTypeMethods), type);
2198
2211
  };
2199
2212
 
2200
- var __defProp$g = Object.defineProperty;
2213
+ var __defProp$h = Object.defineProperty;
2201
2214
  var __defProps$c = Object.defineProperties;
2202
2215
  var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
2203
- var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
2204
- var __hasOwnProp$h = Object.prototype.hasOwnProperty;
2205
- var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
2206
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2207
- var __spreadValues$g = (a, b) => {
2216
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
2217
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
2218
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
2219
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2220
+ var __spreadValues$h = (a, b) => {
2208
2221
  for (var prop in b || (b = {}))
2209
- if (__hasOwnProp$h.call(b, prop))
2210
- __defNormalProp$g(a, prop, b[prop]);
2211
- if (__getOwnPropSymbols$h)
2212
- for (var prop of __getOwnPropSymbols$h(b)) {
2213
- if (__propIsEnum$h.call(b, prop))
2214
- __defNormalProp$g(a, prop, b[prop]);
2222
+ if (__hasOwnProp$i.call(b, prop))
2223
+ __defNormalProp$h(a, prop, b[prop]);
2224
+ if (__getOwnPropSymbols$i)
2225
+ for (var prop of __getOwnPropSymbols$i(b)) {
2226
+ if (__propIsEnum$i.call(b, prop))
2227
+ __defNormalProp$h(a, prop, b[prop]);
2215
2228
  }
2216
2229
  return a;
2217
2230
  };
2218
2231
  var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
2219
2232
  const array = (element) => {
2220
- return constructType(__spreadValues$g({
2233
+ return constructType(__spreadValues$h({
2221
2234
  dataType: "array",
2222
2235
  element,
2223
2236
  deepPartial() {
2224
- return __spreadProps$c(__spreadValues$g({}, this), {
2237
+ return __spreadProps$c(__spreadValues$h({}, this), {
2225
2238
  element: this.element.deepPartial()
2226
2239
  });
2227
2240
  },
@@ -2231,21 +2244,21 @@ const array = (element) => {
2231
2244
  }, arrayMethods));
2232
2245
  };
2233
2246
 
2234
- var __defProp$f = Object.defineProperty;
2247
+ var __defProp$g = Object.defineProperty;
2235
2248
  var __defProps$b = Object.defineProperties;
2236
2249
  var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
2237
- var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
2238
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
2239
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
2240
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2241
- var __spreadValues$f = (a, b) => {
2250
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
2251
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
2252
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
2253
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2254
+ var __spreadValues$g = (a, b) => {
2242
2255
  for (var prop in b || (b = {}))
2243
- if (__hasOwnProp$g.call(b, prop))
2244
- __defNormalProp$f(a, prop, b[prop]);
2245
- if (__getOwnPropSymbols$g)
2246
- for (var prop of __getOwnPropSymbols$g(b)) {
2247
- if (__propIsEnum$g.call(b, prop))
2248
- __defNormalProp$f(a, prop, b[prop]);
2256
+ if (__hasOwnProp$h.call(b, prop))
2257
+ __defNormalProp$g(a, prop, b[prop]);
2258
+ if (__getOwnPropSymbols$h)
2259
+ for (var prop of __getOwnPropSymbols$h(b)) {
2260
+ if (__propIsEnum$h.call(b, prop))
2261
+ __defNormalProp$g(a, prop, b[prop]);
2249
2262
  }
2250
2263
  return a;
2251
2264
  };
@@ -2269,7 +2282,7 @@ const discriminatedUnion = (discriminator, options) => {
2269
2282
  partial.shape[discriminator] = option.shape[discriminator];
2270
2283
  newOptionsMap.set(key, partial);
2271
2284
  });
2272
- return __spreadProps$b(__spreadValues$f({}, this), {
2285
+ return __spreadProps$b(__spreadValues$g({}, this), {
2273
2286
  options: newOptionsMap
2274
2287
  });
2275
2288
  }
@@ -2298,21 +2311,21 @@ const instanceOf = (cls) => {
2298
2311
  });
2299
2312
  };
2300
2313
 
2301
- var __defProp$e = Object.defineProperty;
2314
+ var __defProp$f = Object.defineProperty;
2302
2315
  var __defProps$a = Object.defineProperties;
2303
2316
  var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
2304
- var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
2305
- var __hasOwnProp$f = Object.prototype.hasOwnProperty;
2306
- var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
2307
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2308
- var __spreadValues$e = (a, b) => {
2317
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
2318
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
2319
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
2320
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2321
+ var __spreadValues$f = (a, b) => {
2309
2322
  for (var prop in b || (b = {}))
2310
- if (__hasOwnProp$f.call(b, prop))
2311
- __defNormalProp$e(a, prop, b[prop]);
2312
- if (__getOwnPropSymbols$f)
2313
- for (var prop of __getOwnPropSymbols$f(b)) {
2314
- if (__propIsEnum$f.call(b, prop))
2315
- __defNormalProp$e(a, prop, b[prop]);
2323
+ if (__hasOwnProp$g.call(b, prop))
2324
+ __defNormalProp$f(a, prop, b[prop]);
2325
+ if (__getOwnPropSymbols$g)
2326
+ for (var prop of __getOwnPropSymbols$g(b)) {
2327
+ if (__propIsEnum$g.call(b, prop))
2328
+ __defNormalProp$f(a, prop, b[prop]);
2316
2329
  }
2317
2330
  return a;
2318
2331
  };
@@ -2324,7 +2337,7 @@ const lazy = (fn) => {
2324
2337
  return this.typeCache || (this.typeCache = fn());
2325
2338
  },
2326
2339
  deepPartial() {
2327
- return __spreadProps$a(__spreadValues$e({}, this), {
2340
+ return __spreadProps$a(__spreadValues$f({}, this), {
2328
2341
  typeCache: void 0,
2329
2342
  getter: () => this.getter().deepPartial()
2330
2343
  });
@@ -2337,21 +2350,21 @@ const literal = (value) => constructType({
2337
2350
  value
2338
2351
  });
2339
2352
 
2340
- var __defProp$d = Object.defineProperty;
2353
+ var __defProp$e = Object.defineProperty;
2341
2354
  var __defProps$9 = Object.defineProperties;
2342
2355
  var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
2343
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
2344
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
2345
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
2346
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2347
- var __spreadValues$d = (a, b) => {
2356
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
2357
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
2358
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
2359
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2360
+ var __spreadValues$e = (a, b) => {
2348
2361
  for (var prop in b || (b = {}))
2349
- if (__hasOwnProp$e.call(b, prop))
2350
- __defNormalProp$d(a, prop, b[prop]);
2351
- if (__getOwnPropSymbols$e)
2352
- for (var prop of __getOwnPropSymbols$e(b)) {
2353
- if (__propIsEnum$e.call(b, prop))
2354
- __defNormalProp$d(a, prop, b[prop]);
2362
+ if (__hasOwnProp$f.call(b, prop))
2363
+ __defNormalProp$e(a, prop, b[prop]);
2364
+ if (__getOwnPropSymbols$f)
2365
+ for (var prop of __getOwnPropSymbols$f(b)) {
2366
+ if (__propIsEnum$f.call(b, prop))
2367
+ __defNormalProp$e(a, prop, b[prop]);
2355
2368
  }
2356
2369
  return a;
2357
2370
  };
@@ -2362,7 +2375,7 @@ const map = (keyType, valueType) => {
2362
2375
  keyType,
2363
2376
  valueType,
2364
2377
  deepPartial() {
2365
- return __spreadProps$9(__spreadValues$d({}, this), {
2378
+ return __spreadProps$9(__spreadValues$e({}, this), {
2366
2379
  keyType: this.keyType.deepPartial(),
2367
2380
  valueType: this.valueType.deepPartial()
2368
2381
  });
@@ -2388,21 +2401,21 @@ const nativeEnum = (givenEnum) => {
2388
2401
  });
2389
2402
  };
2390
2403
 
2391
- var __defProp$c = Object.defineProperty;
2404
+ var __defProp$d = Object.defineProperty;
2392
2405
  var __defProps$8 = Object.defineProperties;
2393
2406
  var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
2394
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
2395
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
2396
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
2397
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2398
- var __spreadValues$c = (a, b) => {
2407
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
2408
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
2409
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
2410
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2411
+ var __spreadValues$d = (a, b) => {
2399
2412
  for (var prop in b || (b = {}))
2400
- if (__hasOwnProp$d.call(b, prop))
2401
- __defNormalProp$c(a, prop, b[prop]);
2402
- if (__getOwnPropSymbols$d)
2403
- for (var prop of __getOwnPropSymbols$d(b)) {
2404
- if (__propIsEnum$d.call(b, prop))
2405
- __defNormalProp$c(a, prop, b[prop]);
2413
+ if (__hasOwnProp$e.call(b, prop))
2414
+ __defNormalProp$d(a, prop, b[prop]);
2415
+ if (__getOwnPropSymbols$e)
2416
+ for (var prop of __getOwnPropSymbols$e(b)) {
2417
+ if (__propIsEnum$e.call(b, prop))
2418
+ __defNormalProp$d(a, prop, b[prop]);
2406
2419
  }
2407
2420
  return a;
2408
2421
  };
@@ -2415,12 +2428,12 @@ const object = (shape) => {
2415
2428
  catchAllType: void 0,
2416
2429
  extend(add) {
2417
2430
  return object(
2418
- Object.assign(__spreadValues$c({}, this.shape), add)
2431
+ Object.assign(__spreadValues$d({}, this.shape), add)
2419
2432
  );
2420
2433
  },
2421
2434
  merge(obj) {
2422
2435
  return object(
2423
- Object.assign(__spreadValues$c({}, this.shape), obj.shape)
2436
+ Object.assign(__spreadValues$d({}, this.shape), obj.shape)
2424
2437
  );
2425
2438
  },
2426
2439
  pick(...arr) {
@@ -2438,7 +2451,7 @@ const object = (shape) => {
2438
2451
  return object(picked);
2439
2452
  },
2440
2453
  partial(...arr) {
2441
- const mapped = __spreadValues$c({}, this.shape);
2454
+ const mapped = __spreadValues$d({}, this.shape);
2442
2455
  if (arr.length) {
2443
2456
  arr.forEach((key) => {
2444
2457
  mapped[key] = mapped[key].optional();
@@ -2455,48 +2468,48 @@ const object = (shape) => {
2455
2468
  for (const key in this.shape) {
2456
2469
  newShape[key] = optional(this.shape[key].deepPartial());
2457
2470
  }
2458
- return __spreadProps$8(__spreadValues$c({}, this), {
2471
+ return __spreadProps$8(__spreadValues$d({}, this), {
2459
2472
  shape: newShape
2460
2473
  });
2461
2474
  },
2462
2475
  passthrough() {
2463
- return __spreadProps$8(__spreadValues$c({}, this), {
2476
+ return __spreadProps$8(__spreadValues$d({}, this), {
2464
2477
  unknownKeys: "passthrough"
2465
2478
  });
2466
2479
  },
2467
2480
  strict() {
2468
- return __spreadProps$8(__spreadValues$c({}, this), {
2481
+ return __spreadProps$8(__spreadValues$d({}, this), {
2469
2482
  unknownKeys: "strict"
2470
2483
  });
2471
2484
  },
2472
2485
  strip() {
2473
- return __spreadProps$8(__spreadValues$c({}, this), {
2486
+ return __spreadProps$8(__spreadValues$d({}, this), {
2474
2487
  unknownKeys: "strip"
2475
2488
  });
2476
2489
  },
2477
2490
  catchAll(type) {
2478
- return __spreadProps$8(__spreadValues$c({}, this), {
2491
+ return __spreadProps$8(__spreadValues$d({}, this), {
2479
2492
  catchAllType: type
2480
2493
  });
2481
2494
  }
2482
2495
  });
2483
2496
  };
2484
2497
 
2485
- var __defProp$b = Object.defineProperty;
2498
+ var __defProp$c = Object.defineProperty;
2486
2499
  var __defProps$7 = Object.defineProperties;
2487
2500
  var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
2488
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
2489
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
2490
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
2491
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2492
- var __spreadValues$b = (a, b) => {
2501
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
2502
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
2503
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
2504
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2505
+ var __spreadValues$c = (a, b) => {
2493
2506
  for (var prop in b || (b = {}))
2494
- if (__hasOwnProp$c.call(b, prop))
2495
- __defNormalProp$b(a, prop, b[prop]);
2496
- if (__getOwnPropSymbols$c)
2497
- for (var prop of __getOwnPropSymbols$c(b)) {
2498
- if (__propIsEnum$c.call(b, prop))
2499
- __defNormalProp$b(a, prop, b[prop]);
2507
+ if (__hasOwnProp$d.call(b, prop))
2508
+ __defNormalProp$c(a, prop, b[prop]);
2509
+ if (__getOwnPropSymbols$d)
2510
+ for (var prop of __getOwnPropSymbols$d(b)) {
2511
+ if (__propIsEnum$d.call(b, prop))
2512
+ __defNormalProp$c(a, prop, b[prop]);
2500
2513
  }
2501
2514
  return a;
2502
2515
  };
@@ -2506,7 +2519,7 @@ const any = () => {
2506
2519
  dataType: "any"
2507
2520
  });
2508
2521
  };
2509
- const bigIntMethods = __spreadValues$b({
2522
+ const bigIntMethods = __spreadValues$c({
2510
2523
  dataType: "bigint"
2511
2524
  }, numberTypeMethods);
2512
2525
  const bigint = () => {
@@ -2532,19 +2545,19 @@ const nullType = () => {
2532
2545
  dataType: "null"
2533
2546
  });
2534
2547
  };
2535
- const numberMethods = __spreadProps$7(__spreadValues$b({}, numberTypeMethods), {
2548
+ const numberMethods = __spreadProps$7(__spreadValues$c({}, numberTypeMethods), {
2536
2549
  dataType: "number"
2537
2550
  });
2538
2551
  const number = () => {
2539
2552
  return constructType(numberMethods);
2540
2553
  };
2541
- const dateMethods = __spreadProps$7(__spreadValues$b({}, dateTypeMethods), {
2554
+ const dateMethods = __spreadProps$7(__spreadValues$c({}, dateTypeMethods), {
2542
2555
  dataType: "date"
2543
2556
  });
2544
2557
  const date = () => {
2545
2558
  return constructType(dateMethods);
2546
2559
  };
2547
- const stringMethods = __spreadProps$7(__spreadValues$b({}, stringTypeMethods()), {
2560
+ const stringMethods = __spreadProps$7(__spreadValues$c({}, stringTypeMethods()), {
2548
2561
  dataType: "string"
2549
2562
  });
2550
2563
  const string = () => {
@@ -2580,21 +2593,21 @@ const scalarTypes = {
2580
2593
  void: voidType
2581
2594
  };
2582
2595
 
2583
- var __defProp$a = Object.defineProperty;
2596
+ var __defProp$b = Object.defineProperty;
2584
2597
  var __defProps$6 = Object.defineProperties;
2585
2598
  var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
2586
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
2587
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
2588
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
2589
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2590
- var __spreadValues$a = (a, b) => {
2599
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
2600
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
2601
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
2602
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2603
+ var __spreadValues$b = (a, b) => {
2591
2604
  for (var prop in b || (b = {}))
2592
- if (__hasOwnProp$b.call(b, prop))
2593
- __defNormalProp$a(a, prop, b[prop]);
2594
- if (__getOwnPropSymbols$b)
2595
- for (var prop of __getOwnPropSymbols$b(b)) {
2596
- if (__propIsEnum$b.call(b, prop))
2597
- __defNormalProp$a(a, prop, b[prop]);
2605
+ if (__hasOwnProp$c.call(b, prop))
2606
+ __defNormalProp$b(a, prop, b[prop]);
2607
+ if (__getOwnPropSymbols$c)
2608
+ for (var prop of __getOwnPropSymbols$c(b)) {
2609
+ if (__propIsEnum$c.call(b, prop))
2610
+ __defNormalProp$b(a, prop, b[prop]);
2598
2611
  }
2599
2612
  return a;
2600
2613
  };
@@ -2606,38 +2619,38 @@ function record(...args) {
2606
2619
  keyType,
2607
2620
  valueType,
2608
2621
  deepPartial() {
2609
- return __spreadProps$6(__spreadValues$a({}, this), {
2622
+ return __spreadProps$6(__spreadValues$b({}, this), {
2610
2623
  valueType: this.valueType.deepPartial()
2611
2624
  });
2612
2625
  }
2613
2626
  });
2614
2627
  }
2615
2628
 
2616
- var __defProp$9 = Object.defineProperty;
2629
+ var __defProp$a = Object.defineProperty;
2617
2630
  var __defProps$5 = Object.defineProperties;
2618
2631
  var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
2619
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
2620
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
2621
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
2622
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2623
- var __spreadValues$9 = (a, b) => {
2632
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
2633
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
2634
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
2635
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2636
+ var __spreadValues$a = (a, b) => {
2624
2637
  for (var prop in b || (b = {}))
2625
- if (__hasOwnProp$a.call(b, prop))
2626
- __defNormalProp$9(a, prop, b[prop]);
2627
- if (__getOwnPropSymbols$a)
2628
- for (var prop of __getOwnPropSymbols$a(b)) {
2629
- if (__propIsEnum$a.call(b, prop))
2630
- __defNormalProp$9(a, prop, b[prop]);
2638
+ if (__hasOwnProp$b.call(b, prop))
2639
+ __defNormalProp$a(a, prop, b[prop]);
2640
+ if (__getOwnPropSymbols$b)
2641
+ for (var prop of __getOwnPropSymbols$b(b)) {
2642
+ if (__propIsEnum$b.call(b, prop))
2643
+ __defNormalProp$a(a, prop, b[prop]);
2631
2644
  }
2632
2645
  return a;
2633
2646
  };
2634
2647
  var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
2635
2648
  const set = (valueType) => {
2636
- return constructType(__spreadValues$9({
2649
+ return constructType(__spreadValues$a({
2637
2650
  dataType: "set",
2638
2651
  valueType,
2639
2652
  deepPartial() {
2640
- return __spreadProps$5(__spreadValues$9({}, this), {
2653
+ return __spreadProps$5(__spreadValues$a({}, this), {
2641
2654
  valueType: this.valueType.deepPartial()
2642
2655
  });
2643
2656
  },
@@ -2647,21 +2660,21 @@ const set = (valueType) => {
2647
2660
  }, setMethods));
2648
2661
  };
2649
2662
 
2650
- var __defProp$8 = Object.defineProperty;
2663
+ var __defProp$9 = Object.defineProperty;
2651
2664
  var __defProps$4 = Object.defineProperties;
2652
2665
  var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
2653
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
2654
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
2655
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
2656
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2657
- var __spreadValues$8 = (a, b) => {
2666
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
2667
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
2668
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
2669
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2670
+ var __spreadValues$9 = (a, b) => {
2658
2671
  for (var prop in b || (b = {}))
2659
- if (__hasOwnProp$9.call(b, prop))
2660
- __defNormalProp$8(a, prop, b[prop]);
2661
- if (__getOwnPropSymbols$9)
2662
- for (var prop of __getOwnPropSymbols$9(b)) {
2663
- if (__propIsEnum$9.call(b, prop))
2664
- __defNormalProp$8(a, prop, b[prop]);
2672
+ if (__hasOwnProp$a.call(b, prop))
2673
+ __defNormalProp$9(a, prop, b[prop]);
2674
+ if (__getOwnPropSymbols$a)
2675
+ for (var prop of __getOwnPropSymbols$a(b)) {
2676
+ if (__propIsEnum$a.call(b, prop))
2677
+ __defNormalProp$9(a, prop, b[prop]);
2665
2678
  }
2666
2679
  return a;
2667
2680
  };
@@ -2672,38 +2685,38 @@ const tuple = (items, rest = null) => {
2672
2685
  items,
2673
2686
  restType: rest,
2674
2687
  rest(rest2) {
2675
- return __spreadProps$4(__spreadValues$8({}, this), {
2688
+ return __spreadProps$4(__spreadValues$9({}, this), {
2676
2689
  restType: rest2
2677
2690
  });
2678
2691
  },
2679
2692
  deepPartial() {
2680
- return __spreadProps$4(__spreadValues$8({}, this), {
2693
+ return __spreadProps$4(__spreadValues$9({}, this), {
2681
2694
  items: this.items.map((item) => item.deepPartial())
2682
2695
  });
2683
2696
  }
2684
2697
  });
2685
2698
  };
2686
2699
 
2687
- var __defProp$7 = Object.defineProperty;
2700
+ var __defProp$8 = Object.defineProperty;
2688
2701
  var __defProps$3 = Object.defineProperties;
2689
2702
  var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
2690
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
2691
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
2692
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
2693
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2694
- var __spreadValues$7 = (a, b) => {
2703
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
2704
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
2705
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
2706
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2707
+ var __spreadValues$8 = (a, b) => {
2695
2708
  for (var prop in b || (b = {}))
2696
- if (__hasOwnProp$8.call(b, prop))
2697
- __defNormalProp$7(a, prop, b[prop]);
2698
- if (__getOwnPropSymbols$8)
2699
- for (var prop of __getOwnPropSymbols$8(b)) {
2700
- if (__propIsEnum$8.call(b, prop))
2701
- __defNormalProp$7(a, prop, b[prop]);
2709
+ if (__hasOwnProp$9.call(b, prop))
2710
+ __defNormalProp$8(a, prop, b[prop]);
2711
+ if (__getOwnPropSymbols$9)
2712
+ for (var prop of __getOwnPropSymbols$9(b)) {
2713
+ if (__propIsEnum$9.call(b, prop))
2714
+ __defNormalProp$8(a, prop, b[prop]);
2702
2715
  }
2703
2716
  return a;
2704
2717
  };
2705
2718
  var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
2706
- const jsonTypes = __spreadProps$3(__spreadValues$7({
2719
+ const jsonTypes = __spreadProps$3(__spreadValues$8({
2707
2720
  array,
2708
2721
  discriminatedUnion,
2709
2722
  enum: enumType,
@@ -2858,21 +2871,21 @@ const checkIfDataHasUpdatedAt = (data) => {
2858
2871
  });
2859
2872
  };
2860
2873
 
2861
- var __defProp$6 = Object.defineProperty;
2874
+ var __defProp$7 = Object.defineProperty;
2862
2875
  var __defProps$2 = Object.defineProperties;
2863
2876
  var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
2864
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
2865
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
2866
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
2867
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2868
- var __spreadValues$6 = (a, b) => {
2877
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
2878
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
2879
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
2880
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2881
+ var __spreadValues$7 = (a, b) => {
2869
2882
  for (var prop in b || (b = {}))
2870
- if (__hasOwnProp$7.call(b, prop))
2871
- __defNormalProp$6(a, prop, b[prop]);
2872
- if (__getOwnPropSymbols$7)
2873
- for (var prop of __getOwnPropSymbols$7(b)) {
2874
- if (__propIsEnum$7.call(b, prop))
2875
- __defNormalProp$6(a, prop, b[prop]);
2883
+ if (__hasOwnProp$8.call(b, prop))
2884
+ __defNormalProp$7(a, prop, b[prop]);
2885
+ if (__getOwnPropSymbols$8)
2886
+ for (var prop of __getOwnPropSymbols$8(b)) {
2887
+ if (__propIsEnum$8.call(b, prop))
2888
+ __defNormalProp$7(a, prop, b[prop]);
2876
2889
  }
2877
2890
  return a;
2878
2891
  };
@@ -2955,7 +2968,7 @@ const columnTypes = {
2955
2968
  columns: toArray(columns).map(
2956
2969
  (column) => typeof column === "string" ? { column } : column
2957
2970
  ),
2958
- options: __spreadProps$2(__spreadValues$6({}, options), { unique: true })
2971
+ options: __spreadProps$2(__spreadValues$7({}, options), { unique: true })
2959
2972
  };
2960
2973
  tableData.indexes.push(index);
2961
2974
  return emptyObject;
@@ -3000,17 +3013,17 @@ class TableSchema {
3000
3013
  }
3001
3014
  }
3002
3015
 
3003
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
3004
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
3005
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
3016
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
3017
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
3018
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
3006
3019
  var __objRest$1 = (source, exclude) => {
3007
3020
  var target = {};
3008
3021
  for (var prop in source)
3009
- if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
3022
+ if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
3010
3023
  target[prop] = source[prop];
3011
- if (source != null && __getOwnPropSymbols$6)
3012
- for (var prop of __getOwnPropSymbols$6(source)) {
3013
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
3024
+ if (source != null && __getOwnPropSymbols$7)
3025
+ for (var prop of __getOwnPropSymbols$7(source)) {
3026
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
3014
3027
  target[prop] = source[prop];
3015
3028
  }
3016
3029
  return target;
@@ -3115,11 +3128,6 @@ class TransactionAdapter {
3115
3128
  }
3116
3129
  }
3117
3130
 
3118
- const removeFromQuery = (q, key) => {
3119
- if (q.query)
3120
- delete q.query[key];
3121
- return q;
3122
- };
3123
3131
  const pushQueryArray = (q, key, value) => {
3124
3132
  if (!q.query[key])
3125
3133
  q.query[key] = value;
@@ -3150,7 +3158,6 @@ const setQueryObjectValue = (q, object, key, value) => {
3150
3158
  const getValueKey = Symbol("get");
3151
3159
  const _get = (q, returnType, arg) => {
3152
3160
  q.query.returnType = returnType;
3153
- q.query.take = true;
3154
3161
  if (typeof arg === "object" && isRaw(arg)) {
3155
3162
  addParserForRawExpression(q, getValueKey, arg);
3156
3163
  q.query.select = [arg];
@@ -3202,7 +3209,7 @@ class Then {
3202
3209
  }
3203
3210
  }
3204
3211
  const handleResult = async (q, result) => {
3205
- return parseResult(q, q.query.returnType, result);
3212
+ return parseResult(q, q.query.returnType || "all", result);
3206
3213
  };
3207
3214
  const then = async (q, resolve, reject) => {
3208
3215
  let sql;
@@ -3229,7 +3236,7 @@ const then = async (q, resolve, reject) => {
3229
3236
  if (q.query.log) {
3230
3237
  logData = q.query.log.beforeQuery(sql);
3231
3238
  }
3232
- const queryResult = await q.query.adapter[queryMethodByReturnType[q.query.returnType]](sql);
3239
+ const queryResult = await q.query.adapter[queryMethodByReturnType[q.query.returnType || "all"]](sql);
3233
3240
  if (q.query.log) {
3234
3241
  q.query.log.afterQuery(sql, logData);
3235
3242
  sql = void 0;
@@ -3250,7 +3257,7 @@ const then = async (q, resolve, reject) => {
3250
3257
  reject == null ? void 0 : reject(error);
3251
3258
  }
3252
3259
  };
3253
- const parseResult = (q, returnType, result) => {
3260
+ const parseResult = (q, returnType = "all", result) => {
3254
3261
  var _a, _b;
3255
3262
  switch (returnType) {
3256
3263
  case "all": {
@@ -3357,7 +3364,7 @@ const addParserForSelectItem = (q, as, key, arg) => {
3357
3364
  const rel = arg(q);
3358
3365
  const parsers = getQueryParsers(rel);
3359
3366
  if (parsers) {
3360
- if (rel.query.take) {
3367
+ if (queryTypeWithLimitOne[rel.query.returnType]) {
3361
3368
  addParserToQuery(q.query, key, (item) => parseRecord(parsers, item));
3362
3369
  } else {
3363
3370
  addParserToQuery(
@@ -3463,21 +3470,21 @@ class Select {
3463
3470
  }
3464
3471
  }
3465
3472
 
3466
- var __defProp$5 = Object.defineProperty;
3473
+ var __defProp$6 = Object.defineProperty;
3467
3474
  var __defProps$1 = Object.defineProperties;
3468
3475
  var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
3469
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
3470
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
3471
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
3472
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3473
- var __spreadValues$5 = (a, b) => {
3476
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
3477
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
3478
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
3479
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3480
+ var __spreadValues$6 = (a, b) => {
3474
3481
  for (var prop in b || (b = {}))
3475
- if (__hasOwnProp$5.call(b, prop))
3476
- __defNormalProp$5(a, prop, b[prop]);
3477
- if (__getOwnPropSymbols$5)
3478
- for (var prop of __getOwnPropSymbols$5(b)) {
3479
- if (__propIsEnum$5.call(b, prop))
3480
- __defNormalProp$5(a, prop, b[prop]);
3482
+ if (__hasOwnProp$6.call(b, prop))
3483
+ __defNormalProp$6(a, prop, b[prop]);
3484
+ if (__getOwnPropSymbols$6)
3485
+ for (var prop of __getOwnPropSymbols$6(b)) {
3486
+ if (__propIsEnum$6.call(b, prop))
3487
+ __defNormalProp$6(a, prop, b[prop]);
3481
3488
  }
3482
3489
  return a;
3483
3490
  };
@@ -3502,7 +3509,7 @@ const buildAggregateSelectItem = (functionName, arg, options) => {
3502
3509
  return {
3503
3510
  function: functionName,
3504
3511
  arg,
3505
- options: __spreadProps$1(__spreadValues$5({}, options), {
3512
+ options: __spreadProps$1(__spreadValues$6({}, options), {
3506
3513
  order: (options == null ? void 0 : options.order) ? Array.isArray(options.order) ? options.order : [options.order] : void 0,
3507
3514
  filter: options == null ? void 0 : options.filter,
3508
3515
  filterOr: options == null ? void 0 : options.filterOr
@@ -3517,7 +3524,6 @@ const parseIntOrNullColumn = new IntegerColumn().parse(
3517
3524
  );
3518
3525
  const get = (q) => {
3519
3526
  q.query.returnType = "valueOrThrow";
3520
- removeFromQuery(q, "take");
3521
3527
  const select = q.query.select;
3522
3528
  if (select.length > 1) {
3523
3529
  select[0] = select[select.length - 1];
@@ -3840,8 +3846,8 @@ class Clear {
3840
3846
  _clear(...clears) {
3841
3847
  clears.forEach((clear) => {
3842
3848
  if (clear === "where") {
3843
- removeFromQuery(this, "and");
3844
- removeFromQuery(this, "or");
3849
+ delete this.query.and;
3850
+ delete this.query.or;
3845
3851
  } else if (clear === "counters") {
3846
3852
  if ("type" in this.query && this.query.type === "update") {
3847
3853
  this.query.updateData = this.query.updateData.filter((item) => {
@@ -3862,7 +3868,7 @@ class Clear {
3862
3868
  });
3863
3869
  }
3864
3870
  } else {
3865
- removeFromQuery(this, clear);
3871
+ delete this.query[clear];
3866
3872
  }
3867
3873
  });
3868
3874
  return this;
@@ -4016,19 +4022,19 @@ class From {
4016
4022
  }
4017
4023
  }
4018
4024
 
4019
- var __defProp$4 = Object.defineProperty;
4020
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
4021
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
4022
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
4023
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4024
- var __spreadValues$4 = (a, b) => {
4025
+ var __defProp$5 = Object.defineProperty;
4026
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
4027
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
4028
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
4029
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4030
+ var __spreadValues$5 = (a, b) => {
4025
4031
  for (var prop in b || (b = {}))
4026
- if (__hasOwnProp$4.call(b, prop))
4027
- __defNormalProp$4(a, prop, b[prop]);
4028
- if (__getOwnPropSymbols$4)
4029
- for (var prop of __getOwnPropSymbols$4(b)) {
4030
- if (__propIsEnum$4.call(b, prop))
4031
- __defNormalProp$4(a, prop, b[prop]);
4032
+ if (__hasOwnProp$5.call(b, prop))
4033
+ __defNormalProp$5(a, prop, b[prop]);
4034
+ if (__getOwnPropSymbols$5)
4035
+ for (var prop of __getOwnPropSymbols$5(b)) {
4036
+ if (__propIsEnum$5.call(b, prop))
4037
+ __defNormalProp$5(a, prop, b[prop]);
4032
4038
  }
4033
4039
  return a;
4034
4040
  };
@@ -4036,15 +4042,15 @@ const processHavingArg = (arg) => {
4036
4042
  if ("__model" in arg || isRaw(arg)) {
4037
4043
  return arg;
4038
4044
  } else {
4039
- const processed = __spreadValues$4({}, arg);
4045
+ const processed = __spreadValues$5({}, arg);
4040
4046
  for (const fn in arg) {
4041
4047
  const data = arg[fn];
4042
4048
  if (typeof data === "object") {
4043
- processed[fn] = __spreadValues$4({}, data);
4049
+ processed[fn] = __spreadValues$5({}, data);
4044
4050
  for (const column in data) {
4045
4051
  const value = data[column];
4046
4052
  if (typeof value === "object") {
4047
- processed[fn][column] = __spreadValues$4({}, value);
4053
+ processed[fn][column] = __spreadValues$5({}, value);
4048
4054
  const options = value;
4049
4055
  if ("order" in options && options.order && !Array.isArray(options.order)) {
4050
4056
  processed[fn][column].order = [options.order];
@@ -4085,19 +4091,19 @@ class Having {
4085
4091
  }
4086
4092
  }
4087
4093
 
4088
- var __defProp$3 = Object.defineProperty;
4089
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
4090
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
4091
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
4092
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4093
- var __spreadValues$3 = (a, b) => {
4094
+ var __defProp$4 = Object.defineProperty;
4095
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
4096
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
4097
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
4098
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4099
+ var __spreadValues$4 = (a, b) => {
4094
4100
  for (var prop in b || (b = {}))
4095
- if (__hasOwnProp$3.call(b, prop))
4096
- __defNormalProp$3(a, prop, b[prop]);
4097
- if (__getOwnPropSymbols$3)
4098
- for (var prop of __getOwnPropSymbols$3(b)) {
4099
- if (__propIsEnum$3.call(b, prop))
4100
- __defNormalProp$3(a, prop, b[prop]);
4101
+ if (__hasOwnProp$4.call(b, prop))
4102
+ __defNormalProp$4(a, prop, b[prop]);
4103
+ if (__getOwnPropSymbols$4)
4104
+ for (var prop of __getOwnPropSymbols$4(b)) {
4105
+ if (__propIsEnum$4.call(b, prop))
4106
+ __defNormalProp$4(a, prop, b[prop]);
4101
4107
  }
4102
4108
  return a;
4103
4109
  };
@@ -4140,7 +4146,7 @@ const createInsertCtx = (q) => ({
4140
4146
  relations: q.relations
4141
4147
  });
4142
4148
  const getInsertSingleReturnType = (q) => {
4143
- const { select, returnType } = q.query;
4149
+ const { select, returnType = "all" } = q.query;
4144
4150
  if (select) {
4145
4151
  return returnType === "all" ? "one" : returnType;
4146
4152
  } else {
@@ -4160,7 +4166,7 @@ const handleInsertOneData = (q, data, ctx) => {
4160
4166
  const columnsMap = {};
4161
4167
  const defaults = q.query.defaults;
4162
4168
  if (defaults) {
4163
- data = __spreadValues$3(__spreadValues$3({}, defaults), data);
4169
+ data = __spreadValues$4(__spreadValues$4({}, defaults), data);
4164
4170
  }
4165
4171
  processInsertItem(data, 0, ctx, columns, columnsMap);
4166
4172
  const values = [columns.map((key) => data[key])];
@@ -4171,7 +4177,7 @@ const handleInsertManyData = (q, data, ctx) => {
4171
4177
  const columnsMap = {};
4172
4178
  const defaults = q.query.defaults;
4173
4179
  if (defaults) {
4174
- data = data.map((item) => __spreadValues$3(__spreadValues$3({}, defaults), item));
4180
+ data = data.map((item) => __spreadValues$4(__spreadValues$4({}, defaults), item));
4175
4181
  }
4176
4182
  data.forEach((item, i) => {
4177
4183
  processInsertItem(item, i, ctx, columns, columnsMap);
@@ -4669,10 +4675,9 @@ class Json {
4669
4675
  const q = this._wrap(this.__model.clone());
4670
4676
  q._getOptional(
4671
4677
  raw(
4672
- this.query.take ? `row_to_json("t".*)` : `COALESCE(json_agg(row_to_json("t".*)), '[]')`
4678
+ queryTypeWithLimitOne[this.query.returnType] ? `row_to_json("t".*)` : `COALESCE(json_agg(row_to_json("t".*)), '[]')`
4673
4679
  )
4674
4680
  );
4675
- delete q.query.take;
4676
4681
  return q;
4677
4682
  }
4678
4683
  jsonSet(column, path, value, options) {
@@ -4823,6 +4828,60 @@ class QueryLog {
4823
4828
  }
4824
4829
  }
4825
4830
 
4831
+ var __defProp$3 = Object.defineProperty;
4832
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
4833
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
4834
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
4835
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4836
+ var __spreadValues$3 = (a, b) => {
4837
+ for (var prop in b || (b = {}))
4838
+ if (__hasOwnProp$3.call(b, prop))
4839
+ __defNormalProp$3(a, prop, b[prop]);
4840
+ if (__getOwnPropSymbols$3)
4841
+ for (var prop of __getOwnPropSymbols$3(b)) {
4842
+ if (__propIsEnum$3.call(b, prop))
4843
+ __defNormalProp$3(a, prop, b[prop]);
4844
+ }
4845
+ return a;
4846
+ };
4847
+ const mergableObjects = {
4848
+ withShapes: true,
4849
+ parsers: true,
4850
+ defaults: true,
4851
+ joinedParsers: true
4852
+ };
4853
+ class MergeQueryMethods {
4854
+ merge(q) {
4855
+ return this.clone()._merge(q);
4856
+ }
4857
+ _merge(q) {
4858
+ const a = this.query;
4859
+ const b = q.query;
4860
+ for (const key in b) {
4861
+ const value = b[key];
4862
+ switch (typeof value) {
4863
+ case "boolean":
4864
+ case "string":
4865
+ case "number":
4866
+ a[key] = value;
4867
+ break;
4868
+ case "object":
4869
+ if (Array.isArray(value)) {
4870
+ a[key] = a[key] ? [...a[key], ...value] : value;
4871
+ } else if (mergableObjects[key]) {
4872
+ a[key] = a[key] ? __spreadValues$3(__spreadValues$3({}, a[key]), value) : value;
4873
+ } else {
4874
+ a[key] = value;
4875
+ }
4876
+ break;
4877
+ }
4878
+ }
4879
+ if (b.returnType)
4880
+ a.returnType = b.returnType;
4881
+ return this;
4882
+ }
4883
+ }
4884
+
4826
4885
  var __defProp$2 = Object.defineProperty;
4827
4886
  var __defProps = Object.defineProperties;
4828
4887
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
@@ -4989,7 +5048,7 @@ class Update {
4989
5048
  const relations = this.relations;
4990
5049
  const prependRelations = {};
4991
5050
  const appendRelations = {};
4992
- const originalReturnType = query.returnType;
5051
+ const originalReturnType = query.returnType || "all";
4993
5052
  for (const key in data) {
4994
5053
  if (relations[key]) {
4995
5054
  delete set[key];
@@ -5062,6 +5121,9 @@ class Update {
5062
5121
  return (q, result) => {
5063
5122
  var _a2, _b2;
5064
5123
  const all = resultOfTypeAll || result;
5124
+ if (q.query.returnType !== originalReturnType) {
5125
+ q.query.returnType = originalReturnType;
5126
+ }
5065
5127
  return (_b2 = (_a2 = relations[relationName]).nestedUpdate) == null ? void 0 : _b2.call(_a2, q, all, appendRelations[relationName]);
5066
5128
  };
5067
5129
  })
@@ -5231,7 +5293,6 @@ class QueryMethods {
5231
5293
  }
5232
5294
  _all() {
5233
5295
  this.query.returnType = "all";
5234
- removeFromQuery(this, "take");
5235
5296
  return this;
5236
5297
  }
5237
5298
  take() {
@@ -5239,7 +5300,6 @@ class QueryMethods {
5239
5300
  }
5240
5301
  _take() {
5241
5302
  this.query.returnType = "oneOrThrow";
5242
- this.query.take = true;
5243
5303
  return this;
5244
5304
  }
5245
5305
  takeOptional() {
@@ -5247,7 +5307,6 @@ class QueryMethods {
5247
5307
  }
5248
5308
  _takeOptional() {
5249
5309
  this.query.returnType = "one";
5250
- this.query.take = true;
5251
5310
  return this;
5252
5311
  }
5253
5312
  rows() {
@@ -5255,7 +5314,6 @@ class QueryMethods {
5255
5314
  }
5256
5315
  _rows() {
5257
5316
  this.query.returnType = "rows";
5258
- removeFromQuery(this, "take");
5259
5317
  return this;
5260
5318
  }
5261
5319
  pluck(select) {
@@ -5263,7 +5321,6 @@ class QueryMethods {
5263
5321
  }
5264
5322
  _pluck(select) {
5265
5323
  this.query.returnType = "pluck";
5266
- removeFromQuery(this, "take");
5267
5324
  this.query.select = [select];
5268
5325
  addParserForSelectItem(this, this.query.as || this.table, "pluck", select);
5269
5326
  return this;
@@ -5273,7 +5330,6 @@ class QueryMethods {
5273
5330
  }
5274
5331
  _exec() {
5275
5332
  this.query.returnType = "void";
5276
- removeFromQuery(this, "take");
5277
5333
  return this;
5278
5334
  }
5279
5335
  clone() {
@@ -5382,7 +5438,6 @@ class QueryMethods {
5382
5438
  const q = this._getOptional(raw("true"));
5383
5439
  q.query.notFoundDefault = false;
5384
5440
  q.query.coalesceValue = false;
5385
- delete q.query.take;
5386
5441
  return q;
5387
5442
  }
5388
5443
  truncate(options) {
@@ -5422,7 +5477,8 @@ applyMixins(QueryMethods, [
5422
5477
  QueryLog,
5423
5478
  QueryCallbacks,
5424
5479
  QueryUpsert,
5425
- QueryGet
5480
+ QueryGet,
5481
+ MergeQueryMethods
5426
5482
  ]);
5427
5483
 
5428
5484
  var __defProp = Object.defineProperty;
@@ -5466,7 +5522,6 @@ class Db {
5466
5522
  this.query = {
5467
5523
  adapter,
5468
5524
  handleResult,
5469
- returnType: "all",
5470
5525
  logger,
5471
5526
  log: logParamToLogObject(logger, options.log)
5472
5527
  };
@@ -5514,7 +5569,7 @@ const createDb = (_a) => {
5514
5569
  var _b = _a, {
5515
5570
  log,
5516
5571
  logger,
5517
- columnTypes: ct = columnTypes
5572
+ columnTypes: ct
5518
5573
  } = _b, options = __objRest(_b, [
5519
5574
  "log",
5520
5575
  "logger",
@@ -5549,10 +5604,8 @@ const createDb = (_a) => {
5549
5604
  return db;
5550
5605
  };
5551
5606
 
5552
- const defaultsKey = Symbol("defaults");
5553
-
5554
5607
  const relationQueryKey = Symbol("relationQuery");
5555
5608
  const isRequiredRelationKey = Symbol("isRequiredRelation");
5556
5609
 
5557
- export { Adapter, Aggregate, ArrayColumn, ArrayOfColumnsObjects, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, BoxColumn, ByteaColumn, CharColumn, CidrColumn, CircleColumn, Clear, ColumnInfoMethods, ColumnType, ColumnsObject, DateBaseColumn, DateColumn, DateTimeBaseClass, DateTimeWithTimeZoneBaseClass, Db, DecimalBaseColumn, DecimalColumn, Delete, DoublePrecisionColumn, EMPTY_OBJECT, EnumColumn, For, From, Having, InetColumn, Insert, IntegerBaseColumn, IntegerColumn, IntervalColumn, JSONColumn, JSONTextColumn, Join, Json, LimitedTextBaseColumn, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, MoneyColumn, MoreThanOneRowError, NotFoundError, NumberAsStringBaseColumn, NumberBaseColumn, OnConflictQueryBuilder, OnQueryBuilder, Operators, PathColumn, PluckResultColumnType, PointColumn, PolygonColumn, PormError, PormInternalError, QueryCallbacks, QueryGet, QueryLog, QueryMethods, QueryUpsert, RealColumn, Select, SerialColumn, SmallIntColumn, SmallSerialColumn, TableSchema, TextBaseColumn, TextColumn, Then, TimeColumn, TimeWithTimeZoneColumn, TimestampColumn, TimestampWithTimeZoneColumn, Transaction, TransactionAdapter, TsQueryColumn, TsVectorColumn, UUIDColumn, UnhandledTypeError, Union, Update, VarCharColumn, Where, WhereQueryBuilder, With, XMLColumn, addOr, addOrNot, addParserForRawExpression, addParserForSelectItem, addParserToQuery, addQueryOn, addQueryOrOn, addWhere, addWhereIn, addWhereNot, aggregate1FunctionNames, applyMixins, array, arrayToEnum, columnTypes, utils as columnUtils, constructType, createDb, createOperator, defaultsKey, discriminatedUnion, emptyObject, enumType, getClonedQueryData, getColumnTypes, getQueryAs, getQueryParsers, getRaw, getRawSql, getTableData, getValidEnumValues, getValueKey, handleResult, instanceOf, intersection, isRaw, isRequiredRelationKey, joinTruthy, jsonTypes, lazy, literal, logColors, logParamToLogObject, makeRegexToFindInSql, map, nativeEnum, newTableData, noop, notNullable, notNullish, nullable, nullish, object, optional, parseRecord, parseResult, processSelectArg, pushOrNewArray, pushOrNewArrayToObject, pushQueryArray, pushQueryOn, pushQueryOrOn, pushQueryValue, queryKeysOfNotSimpleQuery, queryMethodByReturnType, quote, raw, record, relationQueryKey, removeFromQuery, required, resetTableData, scalarTypes, set, setQueryObjectValue, toArray, toSql, toSqlCacheKey, tuple, union };
5610
+ export { Adapter, Aggregate, ArrayColumn, ArrayOfColumnsObjects, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, BoxColumn, ByteaColumn, CharColumn, CidrColumn, CircleColumn, Clear, ColumnInfoMethods, ColumnType, ColumnsObject, DateBaseColumn, DateColumn, DateTimeBaseClass, DateTimeWithTimeZoneBaseClass, Db, DecimalBaseColumn, DecimalColumn, Delete, DoublePrecisionColumn, EMPTY_OBJECT, EnumColumn, For, From, Having, InetColumn, Insert, IntegerBaseColumn, IntegerColumn, IntervalColumn, JSONColumn, JSONTextColumn, Join, Json, LimitedTextBaseColumn, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, MergeQueryMethods, MoneyColumn, MoreThanOneRowError, NotFoundError, NumberAsStringBaseColumn, NumberBaseColumn, OnConflictQueryBuilder, OnQueryBuilder, Operators, PathColumn, PluckResultColumnType, PointColumn, PolygonColumn, PormError, PormInternalError, QueryCallbacks, QueryGet, QueryLog, QueryMethods, QueryUpsert, RealColumn, Select, SerialColumn, SmallIntColumn, SmallSerialColumn, TableSchema, TextBaseColumn, TextColumn, Then, TimeColumn, TimeWithTimeZoneColumn, TimestampColumn, TimestampWithTimeZoneColumn, Transaction, TransactionAdapter, TsQueryColumn, TsVectorColumn, UUIDColumn, UnhandledTypeError, Union, Update, VarCharColumn, Where, WhereQueryBuilder, With, XMLColumn, addOr, addOrNot, addParserForRawExpression, addParserForSelectItem, addParserToQuery, addQueryOn, addQueryOrOn, addWhere, addWhereIn, addWhereNot, aggregate1FunctionNames, applyMixins, array, arrayToEnum, checkIfASimpleQuery, columnTypes, utils as columnUtils, constructType, createDb, createOperator, defaultsKey, discriminatedUnion, emptyObject, enumType, getClonedQueryData, getColumnTypes, getQueryAs, getQueryParsers, getRaw, getRawSql, getTableData, getValidEnumValues, getValueKey, handleResult, instanceOf, intersection, isRaw, isRequiredRelationKey, joinTruthy, jsonTypes, lazy, literal, logColors, logParamToLogObject, makeRegexToFindInSql, map, nativeEnum, newTableData, noop, notNullable, notNullish, nullable, nullish, object, optional, parseRecord, parseResult, processSelectArg, pushOrNewArray, pushOrNewArrayToObject, pushQueryArray, pushQueryOn, pushQueryOrOn, pushQueryValue, queryMethodByReturnType, queryTypeWithLimitOne, quote, raw, record, relationQueryKey, required, resetTableData, scalarTypes, set, setQueryObjectValue, toArray, toSql, toSqlCacheKey, tuple, union };
5558
5611
  //# sourceMappingURL=index.esm.js.map