pqb 0.42.6 → 0.42.8

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
@@ -1,4 +1,4 @@
1
- import { ExpressionTypeMethod, Expression, RawSQLBase, emptyObject, isTemplateLiteralArgs, ColumnTypeBase, setColumnData, pushColumnData, quoteObjectKey, toArray, singleQuote, addCode, singleQuoteArray, objectHasValues, toSnakeCase, columnDefaultArgumentToCode, columnErrorMessagesToCode, getValueKey, emptyArray, addValue, isExpression, joinTruthy, stringDataToCode, getDefaultLanguage, dateDataToCode, returnArg as returnArg$1, noop, pushOrNewArrayToObject, arrayDataToCode, numberDataToCode, logColors, applyTransforms, callWithThis, setParserToQuery, isRawSQL, pushOrNewArray, setDefaultNowFn, setDefaultLanguage, setCurrentColumnName, makeTimestampsHelpers, setAdapterConnectRetry, isObjectEmpty, ValExpression, applyMixins, snakeCaseKey } from 'orchid-core';
1
+ import { ExpressionTypeMethod, Expression, RawSQLBase, emptyObject, isTemplateLiteralArgs, ColumnTypeBase, setColumnData, pushColumnData, templateLiteralSQLToCode, quoteObjectKey, toArray, emptyArray, singleQuote, addCode, singleQuoteArray, objectHasValues, toSnakeCase, columnDefaultArgumentToCode, columnErrorMessagesToCode, getValueKey, addValue, isExpression, joinTruthy, stringDataToCode, getDefaultLanguage, dateDataToCode, returnArg as returnArg$1, noop, pushOrNewArrayToObject, arrayDataToCode, numberDataToCode, logColors, applyTransforms, callWithThis, setParserToQuery, isRawSQL, pushOrNewArray, setDefaultNowFn, setDefaultLanguage, setCurrentColumnName, makeTimestampsHelpers, setAdapterConnectRetry, isObjectEmpty, ValExpression, applyMixins, snakeCaseKey } from 'orchid-core';
2
2
  import pg from 'pg';
3
3
  import { inspect } from 'node:util';
4
4
  import { AsyncLocalStorage } from 'node:async_hooks';
@@ -329,6 +329,58 @@ class ColumnType extends ColumnTypeBase {
329
329
  name: typeof args[0] === "string" ? args[0] : void 0
330
330
  });
331
331
  }
332
+ /**
333
+ * Add [EXCLUDE constraint](https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-EXCLUDE) to the column.
334
+ *
335
+ * ```ts
336
+ * import { change } from '../dbScript';
337
+ *
338
+ * change(async (db) => {
339
+ * await db.createTable('table', (t) => ({
340
+ * // exclude rows with overlapping time ranges, && is for the `WITH` operator
341
+ * timeRange: t.type('tstzrange').exclude('&&'),
342
+ * // with a database-level name:
343
+ * timeRange: t.type('tstzrange').exclude('&&', 'no_overlap'),
344
+ * // with options:
345
+ * timeRange: t.type('tstzrange').exclude('&&', { ...options }),
346
+ * // with name and options:
347
+ * name: t.type('tstzrange').exclude('&&', 'no_overlap', { ...options }),
348
+ * }));
349
+ * });
350
+ * ```
351
+ *
352
+ * Possible options are:
353
+ *
354
+ * ```ts
355
+ * interface ExcludeColumnOptions {
356
+ * // specify collation:
357
+ * collate?: string;
358
+ * // see `opclass` in the Postgres document for creating the index
359
+ * opclass?: string;
360
+ * // specify index order such as ASC NULLS FIRST, DESC NULLS LAST
361
+ * order?: string;
362
+ * // algorithm to use such as GIST, GIN
363
+ * using?: string;
364
+ * // EXCLUDE creates an index under the hood, include columns to the index
365
+ * include?: MaybeArray<string>;
366
+ * // see "storage parameters" in the Postgres document for creating an index, for example, 'fillfactor = 70'
367
+ * with?: string;
368
+ * // The tablespace in which to create the constraint. If not specified, default_tablespace is consulted, or temp_tablespaces for indexes on temporary tables.
369
+ * tablespace?: string;
370
+ * // WHERE clause to filter records for the constraint
371
+ * where?: string;
372
+ * // for dropping the index at a down migration
373
+ * dropMode?: DropMode;
374
+ * }
375
+ * ```
376
+ */
377
+ exclude(...args) {
378
+ return pushColumnData(this, "excludes", {
379
+ with: args[0],
380
+ options: (typeof args[1] === "string" ? args[2] : args[1]) ?? emptyObject,
381
+ name: typeof args[1] === "string" ? args[1] : void 0
382
+ });
383
+ }
332
384
  comment(comment) {
333
385
  return setColumnData(this, "comment", comment);
334
386
  }
@@ -362,7 +414,21 @@ class ColumnType extends ColumnTypeBase {
362
414
  */
363
415
  generated(...args) {
364
416
  const sql = raw(...args);
365
- return setColumnData(this, "generated", (...args2) => sql.toSQL(...args2));
417
+ return setColumnData(this, "generated", {
418
+ toSQL(ctx, quoted) {
419
+ return sql.toSQL(ctx, quoted);
420
+ },
421
+ toCode() {
422
+ let sql2 = ".generated";
423
+ if (Array.isArray(args[0])) {
424
+ sql2 += templateLiteralSQLToCode(args);
425
+ } else {
426
+ const { raw: raw2, values } = args[0];
427
+ sql2 += `({ raw: '${raw2.replace(/'/g, "\\'")}'${values ? `, values: ${JSON.stringify(values)}` : ""} })`;
428
+ }
429
+ return sql2;
430
+ }
431
+ });
366
432
  }
367
433
  }
368
434
 
@@ -439,20 +505,12 @@ const columnsShapeToCode = (ctx, shape) => {
439
505
  return code;
440
506
  };
441
507
  const pushTableDataCode = (code, ast) => {
442
- const lines = [];
443
- if (ast.primaryKey) {
444
- lines.push([primaryKeyInnerToCode(ast.primaryKey, "t") + ","]);
445
- }
446
- if (ast.indexes) {
447
- for (const index of ast.indexes) {
448
- lines.push(indexToCode(index, "t"));
449
- }
450
- }
451
- if (ast.constraints) {
452
- for (const constraint of ast.constraints) {
453
- lines.push(constraintToCode(constraint, "t", true));
454
- }
455
- }
508
+ const lines = [
509
+ ast.primaryKey && [primaryKeyInnerToCode(ast.primaryKey, "t") + ","],
510
+ ...ast.indexes?.map((x) => indexToCode(x, "t")) || emptyArray,
511
+ ...ast.excludes?.map((x) => excludeToCode(x, "t")) || emptyArray,
512
+ ...ast.constraints?.map((x) => constraintToCode(x, "t", true)) || emptyArray
513
+ ].filter((x) => !!x);
456
514
  if (lines.length > 1) {
457
515
  code.push("(t) => [", ...lines, "],");
458
516
  } else if (lines[0].length === 1 && typeof lines[0][0] === "string") {
@@ -466,18 +524,17 @@ const primaryKeyInnerToCode = (primaryKey, t) => {
466
524
  const name = primaryKey.name;
467
525
  return `${t}.primaryKey([${primaryKey.columns.map(singleQuote).join(", ")}]${name ? `, ${singleQuote(name)}` : ""})`;
468
526
  };
469
- const indexToCode = (index, t, prefix) => {
470
- const code = indexInnerToCode(index, t);
527
+ const indexOrExcludeToCode = (innerToCode) => (item, t, prefix) => {
528
+ const code = innerToCode(item, t);
471
529
  if (prefix) code[0] = prefix + code[0];
472
530
  const last = code[code.length - 1];
473
531
  if (typeof last === "string" && !last.endsWith(",")) addCode(code, ",");
474
532
  return code;
475
533
  };
476
534
  const indexInnerToCode = (index, t) => {
477
- const code = [];
478
- code.push(
535
+ const code = [
479
536
  `${t}.${index.options.tsVector ? "searchIndex" : index.options.unique ? "unique" : "index"}(`
480
- );
537
+ ];
481
538
  const columnOptions = ["collate", "opclass", "order", "weight"];
482
539
  const indexOptionsKeys = [
483
540
  index.options.tsVector ? "unique" : void 0,
@@ -568,6 +625,54 @@ const indexInnerToCode = (index, t) => {
568
625
  }
569
626
  return code;
570
627
  };
628
+ const indexToCode = indexOrExcludeToCode(indexInnerToCode);
629
+ const excludeInnerToCode = (item, t) => {
630
+ const code = [`${t}.exclude(`];
631
+ const columnOptions = ["collate", "opclass", "order", "with"];
632
+ const optionsKeys = [
633
+ "using",
634
+ "include",
635
+ "with",
636
+ "tablespace",
637
+ "where",
638
+ "dropMode"
639
+ ];
640
+ const hasOptions = optionsKeys.some((key) => key && item.options[key]);
641
+ const objects = [];
642
+ for (const column of item.columns) {
643
+ const expr = "column" in column ? column.column : column.expression;
644
+ const props = [
645
+ `${"column" in column ? "column" : "expression"}: ${singleQuote(expr)},`
646
+ ];
647
+ for (const key of columnOptions) {
648
+ const value = column[key];
649
+ if (value !== void 0) {
650
+ props.push(`${key}: ${singleQuote(value)},`);
651
+ }
652
+ }
653
+ objects.push("{", props, "},");
654
+ }
655
+ code.push(["[", objects, hasOptions || item.name ? "]," : "]"]);
656
+ if (item.name) {
657
+ addCode(code, ` ${singleQuote(item.name)},`);
658
+ }
659
+ if (hasOptions) {
660
+ code.push(["{"]);
661
+ const options = [];
662
+ for (const key of optionsKeys) {
663
+ if (!key) continue;
664
+ const value = item.options[key];
665
+ if (value === null || value === void 0) continue;
666
+ options.push(
667
+ `${key}: ${Array.isArray(value) ? singleQuoteArray(value) : typeof value === "string" ? singleQuote(value) : value},`
668
+ );
669
+ }
670
+ code.push([options, "},"]);
671
+ }
672
+ code.push("),");
673
+ return code;
674
+ };
675
+ const excludeToCode = indexOrExcludeToCode(excludeInnerToCode);
571
676
  const constraintToCode = (item, t, m, prefix) => {
572
677
  const code = constraintInnerToCode(item, t, m);
573
678
  if (prefix) code[0] = prefix + code[0];
@@ -656,25 +761,22 @@ const foreignKeyArgumentToCode = ({
656
761
  }
657
762
  return code;
658
763
  };
659
- const columnIndexesToCode = (indexes) => {
764
+ const columnIndexesToCode = (items) => {
660
765
  const code = [];
661
- for (const { options, name } of indexes) {
766
+ for (const { options, name } of items) {
662
767
  addCode(code, `.${options.unique ? "unique" : "index"}(`);
663
- const arr = [];
664
- if (options.collate) arr.push(`collate: ${singleQuote(options.collate)},`);
665
- if (options.opclass) arr.push(`opclass: ${singleQuote(options.opclass)},`);
666
- if (options.order) arr.push(`order: ${singleQuote(options.order)},`);
667
- if (name) arr.push(`name: ${singleQuote(name)},`);
668
- if (options.using) arr.push(`using: ${singleQuote(options.using)},`);
669
- if (options.include)
670
- arr.push(
671
- `include: ${typeof options.include === "string" ? singleQuote(options.include) : `[${options.include.map(singleQuote).join(", ")}]`},`
672
- );
673
- if (options.nullsNotDistinct) arr.push(`nullsNotDistinct: true,`);
674
- if (options.with) arr.push(`with: ${singleQuote(options.with)},`);
675
- if (options.tablespace)
676
- arr.push(`tablespace: ${singleQuote(options.tablespace)},`);
677
- if (options.where) arr.push(`where: ${singleQuote(options.where)},`);
768
+ const arr = [
769
+ options.collate && `collate: ${singleQuote(options.collate)},`,
770
+ options.opclass && `opclass: ${singleQuote(options.opclass)},`,
771
+ options.order && `order: ${singleQuote(options.order)},`,
772
+ name && `name: ${singleQuote(name)},`,
773
+ options.using && `using: ${singleQuote(options.using)},`,
774
+ options.include && `include: ${typeof options.include === "string" ? singleQuote(options.include) : `[${options.include.map(singleQuote).join(", ")}]`},`,
775
+ options.nullsNotDistinct && `nullsNotDistinct: true,`,
776
+ options.with && `with: ${singleQuote(options.with)},`,
777
+ options.tablespace && `tablespace: ${singleQuote(options.tablespace)},`,
778
+ options.where && `where: ${singleQuote(options.where)},`
779
+ ].filter((x) => !!x);
678
780
  if (arr.length) {
679
781
  addCode(code, "{");
680
782
  addCode(code, arr);
@@ -684,6 +786,30 @@ const columnIndexesToCode = (indexes) => {
684
786
  }
685
787
  return code;
686
788
  };
789
+ const columnExcludesToCode = (items) => {
790
+ const code = [];
791
+ for (const { options, name, with: w } of items) {
792
+ addCode(code, `.exclude('${w}'`);
793
+ const arr = [
794
+ options.collate && `collate: ${singleQuote(options.collate)},`,
795
+ options.opclass && `opclass: ${singleQuote(options.opclass)},`,
796
+ options.order && `order: ${singleQuote(options.order)},`,
797
+ name && `name: ${singleQuote(name)},`,
798
+ options.using && `using: ${singleQuote(options.using)},`,
799
+ options.include && `include: ${typeof options.include === "string" ? singleQuote(options.include) : `[${options.include.map(singleQuote).join(", ")}]`},`,
800
+ options.with && `with: ${singleQuote(options.with)},`,
801
+ options.tablespace && `tablespace: ${singleQuote(options.tablespace)},`,
802
+ options.where && `where: ${singleQuote(options.where)},`
803
+ ].filter((x) => !!x);
804
+ if (arr.length) {
805
+ addCode(code, ", {");
806
+ addCode(code, arr);
807
+ addCode(code, "}");
808
+ }
809
+ addCode(code, ")");
810
+ }
811
+ return code;
812
+ };
687
813
  const columnCheckToCode = (ctx, { sql, name }, columnName) => {
688
814
  return `.check(${sql.toCode(ctx.t)}${name && name !== `${ctx.table}_${columnName}_check` ? `, { name: '${name}' }` : ""})`;
689
815
  };
@@ -726,6 +852,9 @@ const columnCode = (type, ctx, key, code) => {
726
852
  } else {
727
853
  code[0].unshift(prepend);
728
854
  }
855
+ if (data.generated) {
856
+ addCode(code, data.generated.toCode());
857
+ }
729
858
  if (data.primaryKey) {
730
859
  addCode(
731
860
  code,
@@ -760,6 +889,11 @@ const columnCode = (type, ctx, key, code) => {
760
889
  addCode(code, part);
761
890
  }
762
891
  }
892
+ if (data.excludes) {
893
+ for (const part of columnExcludesToCode(data.excludes)) {
894
+ addCode(code, part);
895
+ }
896
+ }
763
897
  if (data.comment) addCode(code, `.comment(${singleQuote(data.comment)})`);
764
898
  if (data.check) {
765
899
  addCode(code, columnCheckToCode(ctx, data.check, name));
@@ -1320,32 +1454,59 @@ class TsVectorColumn extends ColumnType {
1320
1454
  * @param args
1321
1455
  */
1322
1456
  generated(...args) {
1323
- return setColumnData(this, "generated", (ctx, quotedAs) => {
1457
+ const arg = args[0];
1458
+ if (typeof arg === "object" && "raw" in arg) {
1459
+ return super.generated(...args);
1460
+ }
1461
+ const toSQL = (ctx) => {
1324
1462
  const first = args[0];
1325
- if (typeof first === "string" || !("raw" in first)) {
1326
- const target = typeof first === "string" ? args[1] : first;
1327
- const language = typeof first === "string" ? first : this.defaultLanguage;
1328
- const { snakeCase } = ctx;
1329
- let sql;
1330
- if (Array.isArray(target)) {
1331
- const columns = target.length === 1 ? `"${snakeCase ? toSnakeCase(target[0]) : target[0]}"` : target.map(
1332
- (column) => `coalesce("${snakeCase ? toSnakeCase(column) : column}", '')`
1333
- ).join(` || ' ' || `);
1334
- sql = `to_tsvector('${language}', ${columns})`;
1463
+ const target = typeof first === "string" ? args[1] : first;
1464
+ const language = typeof first === "string" ? first : this.defaultLanguage;
1465
+ const { snakeCase } = ctx;
1466
+ let sql;
1467
+ if (Array.isArray(target)) {
1468
+ const columns = target.length === 1 ? `"${snakeCase ? toSnakeCase(target[0]) : target[0]}"` : target.map(
1469
+ (column) => `coalesce("${snakeCase ? toSnakeCase(column) : column}", '')`
1470
+ ).join(` || ' ' || `);
1471
+ sql = `to_tsvector('${language}', ${columns})`;
1472
+ } else {
1473
+ for (const key in target) {
1474
+ sql = (sql ? sql + " || " : "(") + `setweight(to_tsvector('${language}', coalesce("${snakeCase ? toSnakeCase(key) : key}", '')), '${target[key]}')`;
1475
+ }
1476
+ if (sql) {
1477
+ sql += ")";
1335
1478
  } else {
1336
- for (const key in target) {
1337
- sql = (sql ? sql + " || " : "(") + `setweight(to_tsvector('${language}', coalesce("${snakeCase ? toSnakeCase(key) : key}", '')), '${target[key]}')`;
1338
- }
1339
- if (sql) {
1340
- sql += ")";
1341
- } else {
1342
- throw new Error("Empty target in the text search generated column");
1343
- }
1479
+ throw new Error("Empty target in the text search generated column");
1344
1480
  }
1345
- return sql;
1481
+ }
1482
+ return sql;
1483
+ };
1484
+ const toCode = () => {
1485
+ let code = ".generated(";
1486
+ const first = args[0];
1487
+ let target;
1488
+ if (typeof first === "string") {
1489
+ code += `'${first}', `;
1490
+ target = args[1];
1346
1491
  } else {
1347
- return raw(...args).toSQL(ctx, quotedAs);
1492
+ target = args[0];
1348
1493
  }
1494
+ if (Array.isArray(target)) {
1495
+ code += `[${target.map((x) => `'${x}'`).join(", ")}]`;
1496
+ } else {
1497
+ const pairs = [];
1498
+ for (const key in target) {
1499
+ pairs.push(
1500
+ `${quoteObjectKey(key)}: '${target[key]}'`
1501
+ );
1502
+ }
1503
+ code += `{ ${pairs.join(", ")} }`;
1504
+ }
1505
+ return code + ")";
1506
+ };
1507
+ return setColumnData(this, "generated", {
1508
+ toSQL,
1509
+ toCode
1349
1510
  });
1350
1511
  }
1351
1512
  }
@@ -11984,6 +12145,19 @@ const tableDataMethods = {
11984
12145
  input.index.options.tsVector = true;
11985
12146
  return input;
11986
12147
  },
12148
+ exclude(columns, ...[first, second]) {
12149
+ if (typeof first === "string") {
12150
+ const options = second ?? {};
12151
+ return {
12152
+ exclude: { columns, options, name: first }
12153
+ };
12154
+ } else {
12155
+ const options = first ?? {};
12156
+ return {
12157
+ exclude: { columns, options }
12158
+ };
12159
+ }
12160
+ },
11987
12161
  foreignKey(columns, fnOrTable, foreignColumns, options) {
11988
12162
  return {
11989
12163
  constraint: {
@@ -12015,15 +12189,13 @@ const parseTableDataInput = (tableData, item) => {
12015
12189
  if (item.primaryKey) {
12016
12190
  tableData.primaryKey = item.primaryKey;
12017
12191
  } else if (item.index) {
12018
- const index = item.index;
12019
- for (let i = index.columns.length - 1; i >= 0; i--) {
12020
- if (typeof index.columns[i] === "string") {
12021
- index.columns[i] = {
12022
- column: index.columns[i]
12023
- };
12024
- }
12025
- }
12026
- (tableData.indexes ?? (tableData.indexes = [])).push(item.index);
12192
+ (tableData.indexes ?? (tableData.indexes = [])).push(
12193
+ parseIndexOrExclude(item.index)
12194
+ );
12195
+ } else if (item.exclude) {
12196
+ (tableData.excludes ?? (tableData.excludes = [])).push(
12197
+ parseIndexOrExclude(item.exclude)
12198
+ );
12027
12199
  } else if (item.constraint) {
12028
12200
  (tableData.constraints ?? (tableData.constraints = [])).push(item.constraint);
12029
12201
  if (item.constraint.references?.options?.dropMode) {
@@ -12031,6 +12203,16 @@ const parseTableDataInput = (tableData, item) => {
12031
12203
  }
12032
12204
  }
12033
12205
  };
12206
+ const parseIndexOrExclude = (item) => {
12207
+ for (let i = item.columns.length - 1; i >= 0; i--) {
12208
+ if (typeof item.columns[i] === "string") {
12209
+ item.columns[i] = {
12210
+ column: item.columns[i]
12211
+ };
12212
+ }
12213
+ }
12214
+ return item;
12215
+ };
12034
12216
 
12035
12217
  const anyShape = {};
12036
12218
  class Db extends QueryMethods {
@@ -12496,5 +12678,5 @@ function copyTableData(query, arg) {
12496
12678
  return q;
12497
12679
  }
12498
12680
 
12499
- 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, PostgisGeographyPointColumn, 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, _clone, _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, _queryResolveAlias, _queryRows, _querySelect, _queryTake, _queryTakeOptional, _queryUnion, _queryUpdate, _queryUpdateOrThrow, _queryUpdateRaw, _queryWhere, _queryWhereExists, _queryWhereIn, _queryWhereNot, _queryWhereNotOneOf, _queryWhereNotSql, _queryWhereOneOf, _queryWhereSql, addColumnParserToQuery, addParserForRawExpression, addParserForSelectItem, addQueryOn, anyShape, applyComputedColumns, checkIfASimpleQuery, cloneQuery, cloneQueryBaseUnscoped, columnCheckToCode, columnCode, columnForeignKeysToCode, columnIndexesToCode, columnsShapeToCode, commitSql$1 as commitSql, constraintInnerToCode, constraintToCode, copyTableData, countSelect, createDb, defaultSchemaConfig, escapeForLog, escapeForMigration, escapeString, extendQuery, filterResult, foreignKeyArgumentToCode, getClonedQueryData, getColumnInfo, getColumnTypes, getFullColumnTable, getPrimaryKeys, getQueryAs, getShapeFromSelect, getSqlText, handleResult, identityToCode, indexInnerToCode, indexToCode, instantiateColumn, isDefaultTimeStamp, isQueryReturnsAll, isSelectingCount, joinSubQuery, logParamToLogObject, makeColumnTypes, makeColumnsByType, makeFnExpression, makeRegexToFindInSql, makeSQL, parseRecord, parseTableData, parseTableDataInput, postgisTypmodToSql, primaryKeyInnerToCode, processComputedBatches, processComputedResult, processSelectArg, pushLimitSQL, pushQueryArray, pushQueryOn, pushQueryOnForOuter, pushQueryOrOn, pushQueryValue, pushTableDataCode, queryFrom, queryFromSql, queryJson, queryMethodByReturnType, queryTypeWithLimitOne, queryWrap, raw, referencesArgsToCode, resolveSubQueryCallback, rollbackSql$1 as rollbackSql, saveSearchAlias, setColumnDefaultParse, setColumnEncode, setColumnParse, setColumnParseNull, setParserForSelectedString, setQueryObjectValue, setQueryOperators, simplifyColumnDefault, sqlFn, sqlQueryArgsToExpression, tableDataMethods, templateLiteralToSQL, testTransaction, throwIfJoinLateral, throwIfNoWhere, toSQL, toSQLCacheKey };
12681
+ 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, PostgisGeographyPointColumn, 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, _clone, _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, _queryResolveAlias, _queryRows, _querySelect, _queryTake, _queryTakeOptional, _queryUnion, _queryUpdate, _queryUpdateOrThrow, _queryUpdateRaw, _queryWhere, _queryWhereExists, _queryWhereIn, _queryWhereNot, _queryWhereNotOneOf, _queryWhereNotSql, _queryWhereOneOf, _queryWhereSql, addColumnParserToQuery, addParserForRawExpression, addParserForSelectItem, addQueryOn, anyShape, applyComputedColumns, checkIfASimpleQuery, cloneQuery, cloneQueryBaseUnscoped, columnCheckToCode, columnCode, columnExcludesToCode, columnForeignKeysToCode, columnIndexesToCode, columnsShapeToCode, commitSql$1 as commitSql, constraintInnerToCode, constraintToCode, copyTableData, countSelect, createDb, defaultSchemaConfig, escapeForLog, escapeForMigration, escapeString, excludeInnerToCode, excludeToCode, extendQuery, filterResult, foreignKeyArgumentToCode, getClonedQueryData, getColumnInfo, getColumnTypes, getFullColumnTable, getPrimaryKeys, getQueryAs, getShapeFromSelect, getSqlText, handleResult, identityToCode, indexInnerToCode, indexToCode, instantiateColumn, isDefaultTimeStamp, isQueryReturnsAll, isSelectingCount, joinSubQuery, logParamToLogObject, makeColumnTypes, makeColumnsByType, makeFnExpression, makeRegexToFindInSql, makeSQL, parseRecord, parseTableData, parseTableDataInput, postgisTypmodToSql, primaryKeyInnerToCode, processComputedBatches, processComputedResult, processSelectArg, pushLimitSQL, pushQueryArray, pushQueryOn, pushQueryOnForOuter, pushQueryOrOn, pushQueryValue, pushTableDataCode, queryFrom, queryFromSql, queryJson, queryMethodByReturnType, queryTypeWithLimitOne, queryWrap, raw, referencesArgsToCode, resolveSubQueryCallback, rollbackSql$1 as rollbackSql, saveSearchAlias, setColumnDefaultParse, setColumnEncode, setColumnParse, setColumnParseNull, setParserForSelectedString, setQueryObjectValue, setQueryOperators, simplifyColumnDefault, sqlFn, sqlQueryArgsToExpression, tableDataMethods, templateLiteralToSQL, testTransaction, throwIfJoinLateral, throwIfNoWhere, toSQL, toSQLCacheKey };
12500
12682
  //# sourceMappingURL=index.mjs.map