pqb 0.43.5 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -196,9 +196,11 @@ type WhereJsonPathEqualsItem = [
196
196
  ];
197
197
  interface WhereOnItem {
198
198
  joinFrom: WhereOnJoinItem;
199
+ from: string;
199
200
  joinTo: WhereOnJoinItem;
201
+ to: string;
200
202
  useOuterAliases?: true;
201
- on: [leftFullColumn: string, rightFullColumn: string] | [leftFullColumn: string, op: string, rightFullColumn: string];
203
+ op?: string;
202
204
  }
203
205
  type WhereOnJoinItem = {
204
206
  table?: string;
@@ -404,7 +406,7 @@ interface CommonQueryData {
404
406
  log?: QueryLogObject;
405
407
  logger: QueryLogger;
406
408
  autoPreparedStatements?: boolean;
407
- [toSQLCacheKey]?: Sql;
409
+ sqlCache?: Sql;
408
410
  transform?: QueryDataTransform[];
409
411
  language?: string;
410
412
  subQuery?: number;
@@ -3298,7 +3300,7 @@ interface DefaultSchemaConfig extends ColumnSchemaConfig<ColumnType> {
3298
3300
  dateAsDate<T extends ColumnType>(this: T): ParseColumn<T, unknown, Date>;
3299
3301
  enum<U extends string, T extends readonly [U, ...U[]]>(dataType: string, type: T): EnumColumn<DefaultSchemaConfig, unknown, U, T>;
3300
3302
  array<Item extends ArrayColumnValue>(item: Item): ArrayColumn<DefaultSchemaConfig, Item, unknown, unknown, unknown>;
3301
- json<T>(): JSONColumn<unknown extends T ? MaybeArray<string | number | boolean | RecordUnknown> : T, DefaultSchemaConfig>;
3303
+ json<T>(): JSONColumn<unknown extends T ? MaybeArray<string | number | boolean | object> : T, DefaultSchemaConfig>;
3302
3304
  inputSchema(): undefined;
3303
3305
  outputSchema(): undefined;
3304
3306
  querySchema(): undefined;
@@ -3661,8 +3663,6 @@ interface ToSQLCtx {
3661
3663
  values: unknown[];
3662
3664
  aliasValue?: true;
3663
3665
  }
3664
- type toSQLCacheKey = typeof toSQLCacheKey;
3665
- declare const toSQLCacheKey: unique symbol;
3666
3666
  interface ToSQLOptions {
3667
3667
  clearCache?: boolean;
3668
3668
  values?: unknown[];
@@ -3718,7 +3718,7 @@ declare const makeRegexToFindInSql: (value: string) => RegExp;
3718
3718
  * @param q - main query object to pass to a callback as argument
3719
3719
  * @param cb - sub-query callback
3720
3720
  */
3721
- declare const resolveSubQueryCallback: (q: ToSQLQuery, cb: (q: ToSQLQuery) => ToSQLQuery) => ToSQLQuery;
3721
+ declare const resolveSubQueryCallbackV2: (q: ToSQLQuery, cb: (q: ToSQLQuery) => ToSQLQuery) => ToSQLQuery;
3722
3722
  /**
3723
3723
  * After getting a query from a sub-query callback,
3724
3724
  * join it to the main query in case it's a relation query.
@@ -5445,9 +5445,7 @@ type MergeQuery<T extends PickQueryMetaResultReturnTypeWithDataWindows, Q extend
5445
5445
  [K in keyof T['meta'] | keyof Q['meta']]: K extends 'selectable' ? Q['meta']['selectable'] & Omit<T['meta']['selectable'], keyof Q['meta']['selectable']> : K extends 'hasWhere' | 'hasSelect' ? T['meta'][K] & Q['meta'][K] : K extends keyof Q['meta'] ? Q['meta'][K] : T['meta'][K];
5446
5446
  } : K extends 'result' ? MergeQueryResult<T, Q> : K extends 'returnType' ? Q['returnType'] extends undefined ? T['returnType'] : Q['returnType'] : K extends 'then' ? QueryThenByQuery<Q['returnType'] extends undefined ? T : Q, MergeQueryResult<T, Q>> : K extends 'windows' ? Q['windows'] & Omit<T['windows'], keyof Q['windows']> : K extends 'withData' ? Q['withData'] & Omit<T['withData'], keyof Q['withData']> : T[K];
5447
5447
  };
5448
- type MergeQueryResult<T extends PickQueryMetaResult, Q extends PickQueryMetaResult> = T['meta']['hasSelect'] extends true ? Q['meta']['hasSelect'] extends true ? {
5449
- [K in keyof T['result'] | keyof Q['result']]: K extends keyof Q['result'] ? Q['result'][K] : T['result'][K];
5450
- } : T['result'] : Q['result'];
5448
+ type MergeQueryResult<T extends PickQueryMetaResult, Q extends PickQueryMetaResult> = T['meta']['hasSelect'] extends true ? Q['meta']['hasSelect'] extends true ? Omit<T['result'], keyof Q['result']> & Q['result'] : T['result'] : Q['result'];
5451
5449
  declare class MergeQueryMethods {
5452
5450
  merge<T extends PickQueryMetaResultReturnTypeWithDataWindows, Q extends PickQueryMetaResultReturnTypeWithDataWindows>(this: T, q: Q): MergeQuery<T, Q>;
5453
5451
  }
@@ -6134,7 +6132,7 @@ type UpdateData<T extends UpdateSelf> = EmptyObject extends T['relations'] ? {
6134
6132
  } : {
6135
6133
  [K in keyof T['inputType'] | keyof T['relations']]?: K extends keyof T['inputType'] ? UpdateColumn<T, K> : UpdateRelationData<T, T['relations'][K]['relationConfig']>;
6136
6134
  };
6137
- type UpdateColumn<T extends UpdateSelf, Key extends keyof T['inputType']> = T['inputType'][Key] | QueryOrExpression<T['inputType'][Key]> | ((q: {
6135
+ type UpdateColumn<T extends UpdateSelf, Key extends keyof T['inputType']> = T['inputType'][Key] | ((q: {
6138
6136
  [K in keyof T['relations'] | keyof T]: K extends keyof T['relations'] ? T['relations'][K] : K extends keyof T ? T[K] : never;
6139
6137
  }) => QueryOrExpression<T['inputType'][Key]>);
6140
6138
  type UpdateRelationData<T extends UpdateSelf, Rel extends RelationConfigBase> = T['returnType'] extends undefined | 'all' ? Rel['dataForUpdate'] : Rel['dataForUpdateOne'];
@@ -6219,7 +6217,7 @@ declare class Update {
6219
6217
  *
6220
6218
  * // use query that returns a single value
6221
6219
  * // returning multiple values will result in Postgres error
6222
- * column3: db.otherTable.get('someColumn'),
6220
+ * column3: () => db.otherTable.get('someColumn'),
6223
6221
  *
6224
6222
  * // select a single value from a related record
6225
6223
  * fromRelation: (q) => q.relatedTable.get('someColumn'),
@@ -6236,16 +6234,16 @@ declare class Update {
6236
6234
  * ```ts
6237
6235
  * await db.table.where({ ...conditions }).update({
6238
6236
  * // `column` will be set to a value of the `otherColumn` of the created record.
6239
- * column: db.otherTable.get('otherColumn').create({ ...data }),
6237
+ * column: () => db.otherTable.get('otherColumn').create({ ...data }),
6240
6238
  *
6241
6239
  * // `column2` will be set to a value of the `otherColumn` of the updated record.
6242
- * column2: db.otherTable
6240
+ * column2: () => db.otherTable
6243
6241
  * .get('otherColumn')
6244
6242
  * .findBy({ ...conditions })
6245
6243
  * .update({ key: 'value' }),
6246
6244
  *
6247
6245
  * // `column3` will be set to a value of the `otherColumn` of the deleted record.
6248
- * column3: db.otherTable
6246
+ * column3: () => db.otherTable
6249
6247
  * .get('otherColumn')
6250
6248
  * .findBy({ ...conditions })
6251
6249
  * .delete(),
@@ -7094,16 +7092,23 @@ type OrderArgKey<T extends OrderArgSelf> = {
7094
7092
  type GroupArgs<T extends PickQueryResult> = ({
7095
7093
  [K in keyof T['result']]: T['result'][K]['dataType'] extends 'array' | 'object' | 'runtimeComputed' ? never : K;
7096
7094
  }[keyof T['result']] | Expression)[];
7097
- interface QueryHelper<T extends PickQueryMetaShape, Args extends any[], Result> {
7098
- <Q extends {
7099
- returnType: QueryReturnType;
7100
- meta: QueryMetaBase & {
7101
- selectable: Omit<T['meta']['selectable'], `${AliasOrTable<T>}.${Extract<keyof T['shape'], string>}`>;
7102
- };
7103
- result: QueryColumns;
7104
- windows: EmptyObject;
7105
- withData: WithDataItems;
7106
- }>(q: Q, ...args: Args): Result extends PickQueryMetaResultReturnTypeWithDataWindows ? MergeQuery<Q, Result> : Result;
7095
+ interface QueryHelperQuery<T extends PickQueryMetaShape> {
7096
+ returnType: QueryReturnType;
7097
+ meta: QueryMetaBase & {
7098
+ selectable: Omit<T['meta']['selectable'], `${AliasOrTable<T>}.${Extract<keyof T['shape'], string>}`>;
7099
+ };
7100
+ result: QueryColumns;
7101
+ windows: EmptyObject;
7102
+ withData: WithDataItems;
7103
+ }
7104
+ interface IsQueryHelper {
7105
+ isQueryHelper: true;
7106
+ args: unknown[];
7107
+ result: unknown;
7108
+ }
7109
+ interface QueryHelper<T extends PickQueryMetaShape, Args extends any[], Result> extends IsQueryHelper {
7110
+ <Q extends QueryHelperQuery<T>>(q: Q, ...args: Args): Result extends PickQueryMetaResultReturnTypeWithDataWindows ? MergeQuery<Q, Result> : Result;
7111
+ args: Args;
7107
7112
  result: Result;
7108
7113
  }
7109
7114
  type QueryHelperResult<T extends QueryHelper<PickQueryMetaShape, any[], unknown>> = T['result'];
@@ -7567,50 +7572,6 @@ declare class QueryMethods<ColumnTypes> {
7567
7572
  * ```
7568
7573
  */
7569
7574
  none<T>(this: T): T;
7570
- /**
7571
- * `modify` allows modifying the query with your function:
7572
- *
7573
- * ```ts
7574
- * const doSomethingWithQuery = (q: typeof db.table) => {
7575
- * // can use all query methods
7576
- * return q.select('name').where({ active: true }).order({ createdAt: 'DESC' });
7577
- * };
7578
- *
7579
- * const record = await db.table.select('id').modify(doSomethingWithQuery).find(1);
7580
- *
7581
- * record.id; // id was selected before `modify`
7582
- * record.name; // name was selected by the function
7583
- * ```
7584
- *
7585
- * It's possible to apply different `select`s inside the function, and then the result type will be a union of all possibilities:
7586
- *
7587
- * Use this sparingly as it complicates dealing with the result.
7588
- *
7589
- * ```ts
7590
- * const doSomethingWithQuery = (q: typeof db.table) => {
7591
- * if (Math.random() > 0.5) {
7592
- * return q.select('one');
7593
- * } else {
7594
- * return q.select('two');
7595
- * }
7596
- * };
7597
- *
7598
- * const record = await db.table.modify(doSomethingWithQuery).find(1);
7599
- *
7600
- * // TS error: we don't know for sure if the `one` was selected.
7601
- * record.one;
7602
- *
7603
- * // use `in` operator to disambiguate the result type
7604
- * if ('one' in record) {
7605
- * record.one;
7606
- * } else {
7607
- * record.two;
7608
- * }
7609
- * ```
7610
- *
7611
- * @param fn - function to modify the query with. The result type will be merged with the main query as if the `merge` method was used.
7612
- */
7613
- modify<T extends PickQueryMetaResultReturnTypeWithDataWindowsTable<string | undefined>, Arg extends PickQueryMetaResultReturnTypeWithDataWindowsTable<T['table']>, Result>(this: T, fn: (q: Arg) => Result): Result extends PickQueryMetaResultReturnTypeWithDataWindows ? MergeQuery<T, Result> : Result;
7614
7575
  /**
7615
7576
  * Use `makeHelper` to make a query helper - a function where you can modify the query, and reuse this function across different places.
7616
7577
  *
@@ -7663,6 +7624,63 @@ declare class QueryMethods<ColumnTypes> {
7663
7624
  * @param fn - helper function
7664
7625
  */
7665
7626
  makeHelper<T extends PickQueryMetaShape, Args extends unknown[], Result>(this: T, fn: (q: T, ...args: Args) => Result): QueryHelper<T, Args, Result>;
7627
+ /**
7628
+ * `modify` allows modifying the query with helpers defined with {@link makeHelper}:
7629
+ *
7630
+ * ```ts
7631
+ * const helper = db.table.makeHelper((q) => {
7632
+ * // all query methods are available
7633
+ * return q.select('name').where({ active: true }).order({ createdAt: 'DESC' });
7634
+ * });
7635
+ *
7636
+ * const record = await db.table.select('id').modify(helper).find(1);
7637
+ *
7638
+ * record.id; // id was selected before `modify`
7639
+ * record.name; // name was selected by the function
7640
+ * ```
7641
+ *
7642
+ * When the helper result isn't certain, it will result in a union of all possibilities.
7643
+ * Use this sparingly as it complicates dealing with the result.
7644
+ *
7645
+ * ```ts
7646
+ * const helper = db.table((q) => {
7647
+ * if (Math.random() > 0.5) {
7648
+ * return q.select('one');
7649
+ * } else {
7650
+ * return q.select('two');
7651
+ * }
7652
+ * });
7653
+ *
7654
+ * const record = await db.table.modify(helper).find(1);
7655
+ *
7656
+ * // TS error: we don't know for sure if the `one` was selected.
7657
+ * record.one;
7658
+ *
7659
+ * // use `in` operator to disambiguate the result type
7660
+ * if ('one' in record) {
7661
+ * record.one;
7662
+ * } else {
7663
+ * record.two;
7664
+ * }
7665
+ * ```
7666
+ *
7667
+ * You can define and pass parameters:
7668
+ *
7669
+ * ```ts
7670
+ * const helper = db.table.makeHelper((q, select: 'id' | 'name') => {
7671
+ * return q.select(select);
7672
+ * });
7673
+ *
7674
+ * const record = await db.table.modify(helper, 'id').find(1);
7675
+ * // record has type { id: number } | { name: string }
7676
+ * if ('id' in record) {
7677
+ * record.id;
7678
+ * }
7679
+ * ```
7680
+ *
7681
+ * @param fn - function to modify the query with. The result type will be merged with the main query as if the `merge` method was used.
7682
+ */
7683
+ modify<T extends PickQueryMetaResultReturnTypeWithDataWindows, Fn extends IsQueryHelper>(this: T, fn: Fn, ...args: Fn['args']): Fn['result'] extends PickQueryMetaResultReturnTypeWithDataWindows ? MergeQuery<T, Fn['result']> : Fn['result'];
7666
7684
  /**
7667
7685
  * Narrows a part of the query output type.
7668
7686
  * Use with caution, type-safety isn't guaranteed with it.
@@ -7841,9 +7859,6 @@ interface PickQueryMetaResultRelationsWithDataReturnTypeShape extends PickQueryM
7841
7859
  }
7842
7860
  interface PickQueryMetaResultReturnTypeWithDataWindows extends PickQueryMetaResultReturnType, PickQueryWithData, PickQueryWindows {
7843
7861
  }
7844
- interface PickQueryMetaResultReturnTypeWithDataWindowsTable<Table extends string | undefined> extends PickQueryMetaResultReturnType, PickQueryWithData, PickQueryWindows {
7845
- table: Table;
7846
- }
7847
7862
  interface PickQueryQAndInternal extends PickQueryQ, PickQueryInternal {
7848
7863
  }
7849
7864
  interface PickQueryQAndBaseQuery extends PickQueryQ, PickQueryBaseQuery {
@@ -8581,6 +8596,14 @@ declare const pushQueryArray: <T extends {
8581
8596
  * @param value - new element to push
8582
8597
  */
8583
8598
  declare const pushQueryValue: <T extends PickQueryQ>(q: T, key: string, value: unknown) => T;
8599
+ /**
8600
+ * Push new element into array in the query data - immutable version
8601
+ *
8602
+ * @param q - query
8603
+ * @param key - key to get the array
8604
+ * @param value - new element to push
8605
+ */
8606
+ declare const pushQueryValueImmutable: <T extends PickQueryQ>(q: T, key: string, value: unknown) => T;
8584
8607
  /**
8585
8608
  * Set value into the object in query data, create the object if it doesn't yet exist.
8586
8609
  *
@@ -8741,4 +8764,4 @@ type CopyResult<T extends PickQueryMeta> = SetQueryKind<T, 'copy'>;
8741
8764
  */
8742
8765
  declare function copyTableData<T extends PickQueryMetaShape>(query: T, arg: CopyArg<T>): CopyResult<T>;
8743
8766
 
8744
- export { Adapter, type AdapterConfig, type AdapterOptions, type AddQueryDefaults, AfterCommitError, type AfterCommitErrorFulfilledResult, type AfterCommitErrorRejectedResult, type AfterCommitErrorResult, type AfterHook, type AggregateArgTypes, AggregateMethods, type AggregateOptions, type AliasOrTable, ArrayColumn, type ArrayColumnValue, type ArrayData, AsMethods, type AsQueryArg, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, type BooleanQueryColumn, BoxColumn, ByteaColumn, type ChangeCountArg, CidrColumn, CircleColumn, CitextColumn, Clear, type ClearStatement, type ColumnData, type ColumnDataGenerated, type ColumnFromDbParams, type ColumnInfoQueryData, ColumnRefExpression, ColumnType, type ColumnsByType, type ColumnsShape, type ColumnsShapeToNullableObject, type ColumnsShapeToObject, type ColumnsShapeToObjectArray, type ColumnsShapeToPluck, type CommonQueryData, ComputedColumn, type ComputedColumns, type ComputedColumnsFromOptions, type ComputedMethods, type ComputedOptionsFactory, type CopyOptions, type CopyQueryData, Create, type CreateBelongsToData, type CreateColumn, type CreateCtx, type CreateData, type CreateKind, type CreateMethodsNames, type CreateRelationsData, type CreateRelationsDataOmittingFKeys, type CreateResult, type CreateSelf, CustomTypeColumn, DateBaseColumn, DateColumn, type DateColumnInput, DateTimeBaseClass, DateTimeTzBaseClass, Db, type DbDomainArg, type DbDomainArgRecord, type DbExtension, type DbOptions, type DbResult, type DbSharedOptions, type DbTableConstructor, type DbTableOptionScopes, type DbTableOptions, DecimalColumn, type DecimalColumnData, type DefaultColumnTypes, type DefaultSchemaConfig, Delete, type DeleteArgs, type DeleteMethodsNames, type DeleteQueryData, type DeleteResult, DomainColumn, DoublePrecisionColumn, DynamicRawSQL, EnumColumn, ExpressionMethods, type ExpressionOutput, FnExpression, type FnExpressionArgs, type FnExpressionArgsPairs, type FnExpressionArgsValue, For, type FromArg, FromMethods, type FromQuerySelf, type FromResult, type GeneratorIgnore, type GetArg, type GetColumnInfo, type GetResult, type GetResultOptional, type GetStringArg, type GroupArgs, type HandleResult, Having, type HavingItem, type HookAction, type HookSelectArg, type IdentityColumn, InetColumn, type InsertQueryData, IntegerBaseColumn, IntegerColumn, IntervalColumn, type IsolationLevel, JSONColumn, JSONTextColumn, Join, type JoinArgToQuery, type JoinArgs, type JoinCallback, type JoinFirstArg, type JoinItem, type JoinItemArgs, type JoinLateralItem, type JoinLateralResult, type JoinQueryBuilder, type JoinQueryMethod, type JoinResult, type JoinedParsers, type JoinedShapes, JsonMethods, LimitedTextBaseColumn, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, type MapTableScopesOption, type MergeQuery, MergeQueryMethods, MoneyColumn, MoreThanOneRowError, type NoPrimaryKeyOption, type NonUniqDataItem, NotFoundError, NumberAsStringBaseColumn, NumberBaseColumn, type NumberColumnData, type NumericColumns, type OnConflictMerge, OnConflictQueryBuilder, type OnConflictSet, type OnConflictTarget, OnMethods, type Operator, Operators, type OperatorsAny, type OperatorsArray, type OperatorsBoolean, type OperatorsDate, type OperatorsJson, type OperatorsNumber, type OperatorsText, type OperatorsTime, type OrCreateArg, OrExpression, OrchidOrmError, OrchidOrmInternalError, type OrderArg, type OrderArgSelf, type OrderArgs, type OrderItem, type OrderTsQueryConfig, type Over, PathColumn, type PickColumnData, type PickQueryBaseQuery, type PickQueryColumnTypes, type PickQueryDataShapeAndJoinedShapes, type PickQueryInternal, type PickQueryMetaRelations, type PickQueryMetaRelationsResult, type PickQueryMetaResultRelations, type PickQueryMetaResultRelationsWindows, type PickQueryMetaResultRelationsWindowsColumnTypes, type PickQueryMetaResultRelationsWithDataReturnType, type PickQueryMetaResultRelationsWithDataReturnTypeShape, type PickQueryMetaResultReturnTypeWithDataWindows, type PickQueryMetaResultReturnTypeWithDataWindowsTable, type PickQueryMetaShapeRelationsWithData, type PickQueryMetaTable, type PickQueryMetaTableShape, type PickQueryMetaTableShapeReturnTypeWithData, type PickQueryMetaWithData, type PickQueryMetaWithDataColumnTypes, type PickQueryQ, type PickQueryQAndBaseQuery, type PickQueryQAndInternal, type PickQueryRelations, type PickQueryRelationsWithData, type PickQueryResultColumnTypes, type PickQueryShapeResultSinglePrimaryKey, type PickQueryShapeSinglePrimaryKey, type PickQuerySinglePrimaryKey, type PickQueryWindows, type PickQueryWithData, type PickQueryWithDataColumnTypes, PointColumn, PolygonColumn, PostgisGeographyPointColumn, type PostgisPoint, type Query, type QueryAfterHook, type QueryArraysResult, type QueryBatchResult, type QueryBeforeHook, type QueryComputedArg, type QueryData, type QueryDataFromItem, type QueryDataJoinTo, type QueryDefaultReturnData, QueryError, type QueryErrorName, QueryGet, type QueryGetSelf, type QueryHelperResult, QueryHooks, type QueryIfResultThen, type QueryInternal, QueryLog, type QueryMetaHasSelect, type QueryMetaHasWhere, QueryMethods, type QueryOrExpression, type QueryOrExpressionBooleanOrNullResult, type QueryResult, type QueryScopeData, type QueryScopes, type QuerySourceItem, QueryUpsertOrCreate, RawSQL, RealColumn, type RecordOfColumnsShapeBase, RefExpression, type RelationConfigBase, type RelationConfigDataForCreate, type RelationJoinQuery, type RelationQueryBase, type RelationsBase, type RuntimeComputedQueryColumn, type SearchArg, SearchMethods, type SearchWeight, type SearchWeightRecord, Select, type SelectArg, type SelectArgs, type SelectAs, type SelectAsValue, type SelectItem, type SelectQueryData, type SelectSubQueryResult, type SelectableFromShape, type SelectableOfType, type SelectableOrExpression, type SelectableOrExpressionOfType, type SelectableOrExpressions, SerialColumn, type SerialColumnData, type SetQueryKind, type SetQueryKindResult, type SetQueryReturnsAll, type SetQueryReturnsAllKind, type SetQueryReturnsAllKindResult, type SetQueryReturnsColumnInfo, type SetQueryReturnsColumnKind, type SetQueryReturnsColumnKindResult, type SetQueryReturnsColumnOptional, type SetQueryReturnsColumnOrThrow, type SetQueryReturnsOne, type SetQueryReturnsOneKind, type SetQueryReturnsOneKindResult, type SetQueryReturnsOneOptional, type SetQueryReturnsPluck, type SetQueryReturnsPluckColumn, type SetQueryReturnsPluckColumnKind, type SetQueryReturnsPluckColumnKindResult, type SetQueryReturnsRowCount, type SetQueryReturnsRowCountMany, type SetQueryReturnsRows, type SetQueryReturnsValueOptional, type SetQueryReturnsValueOrThrow, type SetQueryReturnsVoid, type SetQueryReturnsVoidKind, type SetQueryTableAlias, type ShapeColumnPrimaryKeys, type ShapeUniqueColumns, type SimpleJoinItem, type SimpleJoinItemNonSubQueryArgs, SmallIntColumn, SmallSerialColumn, type SortDir, type SqlFn, SqlMethod, StringColumn$1 as StringColumn, TableData, type TableDataFn, type TableDataInput, type TableDataItem, type TableDataItemsUniqueColumnTuples, type TableDataItemsUniqueColumns, type TableDataItemsUniqueConstraints, type TableDataMethods, TextBaseColumn, TextColumn, type TextColumnData, Then, TimeColumn, TimestampColumn, TimestampTZColumn, type ToSQLCtx, type ToSQLOptions, type ToSQLQuery, Transaction, TransactionAdapter, type TransactionOptions, TransformMethods, type TruncateQueryData, TsQueryColumn, TsVectorColumn, type TypeParsers, UUIDColumn, UnhandledTypeError, Union, type UnionArgs, type UnionItem, type UnionKind, type UnionSet, type UniqueConstraints, type UniqueQueryTypeOrExpression, type UniqueTableDataItem, UnknownColumn, Update, type UpdateArg, type UpdateCtx, type UpdateCtxCollect, type UpdateData, type UpdateQueryData, type UpdateQueryDataItem, type UpdateQueryDataObject, type UpdateSelf, type UpdatedAtDataInjector, type UpsertResult, type UpsertThis, VarCharColumn, VirtualColumn, Where, type WhereArg, type WhereArgs, type WhereInArg, type WhereInColumn, type WhereInItem, type WhereInValues, type WhereItem, type WhereJsonPathEqualsItem, type WhereNotArgs, type WhereOnItem, type WhereOnJoinItem, type WhereQueryBuilder, type WhereResult, type WhereSearchItem, type WhereSearchResult, type WindowArg, type WindowArgDeclaration, type WindowDeclaration, type WindowItem, type WithArgsOptions, type WithConfigs, type WithDataItem, type WithDataItems, type WithItem, WithMethods, type WithOptions, type WithQueryBuilder, type WithRecursiveOptions, type WithResult, type WithSqlResult, type WrapQueryArg, 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, 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, saveSearchAlias, setColumnDefaultParse, setColumnEncode, setColumnParse, setColumnParseNull, setParserForSelectedString, setQueryObjectValue, setQueryOperators, simplifyColumnDefault, sqlFn, sqlQueryArgsToExpression, tableDataMethods, templateLiteralToSQL, testTransaction, throwIfJoinLateral, throwIfNoWhere, toSQL, toSQLCacheKey };
8767
+ export { Adapter, type AdapterConfig, type AdapterOptions, type AddQueryDefaults, AfterCommitError, type AfterCommitErrorFulfilledResult, type AfterCommitErrorRejectedResult, type AfterCommitErrorResult, type AfterHook, type AggregateArgTypes, AggregateMethods, type AggregateOptions, type AliasOrTable, ArrayColumn, type ArrayColumnValue, type ArrayData, AsMethods, type AsQueryArg, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, type BooleanQueryColumn, BoxColumn, ByteaColumn, type ChangeCountArg, CidrColumn, CircleColumn, CitextColumn, Clear, type ClearStatement, type ColumnData, type ColumnDataGenerated, type ColumnFromDbParams, type ColumnInfoQueryData, ColumnRefExpression, ColumnType, type ColumnsByType, type ColumnsShape, type ColumnsShapeToNullableObject, type ColumnsShapeToObject, type ColumnsShapeToObjectArray, type ColumnsShapeToPluck, type CommonQueryData, ComputedColumn, type ComputedColumns, type ComputedColumnsFromOptions, type ComputedMethods, type ComputedOptionsFactory, type CopyOptions, type CopyQueryData, Create, type CreateBelongsToData, type CreateColumn, type CreateCtx, type CreateData, type CreateKind, type CreateMethodsNames, type CreateRelationsData, type CreateRelationsDataOmittingFKeys, type CreateResult, type CreateSelf, CustomTypeColumn, DateBaseColumn, DateColumn, type DateColumnInput, DateTimeBaseClass, DateTimeTzBaseClass, Db, type DbDomainArg, type DbDomainArgRecord, type DbExtension, type DbOptions, type DbResult, type DbSharedOptions, type DbTableConstructor, type DbTableOptionScopes, type DbTableOptions, DecimalColumn, type DecimalColumnData, type DefaultColumnTypes, type DefaultSchemaConfig, Delete, type DeleteArgs, type DeleteMethodsNames, type DeleteQueryData, type DeleteResult, DomainColumn, DoublePrecisionColumn, DynamicRawSQL, EnumColumn, ExpressionMethods, type ExpressionOutput, FnExpression, type FnExpressionArgs, type FnExpressionArgsPairs, type FnExpressionArgsValue, For, type FromArg, FromMethods, type FromQuerySelf, type FromResult, type GeneratorIgnore, type GetArg, type GetColumnInfo, type GetResult, type GetResultOptional, type GetStringArg, type GroupArgs, type HandleResult, Having, type HavingItem, type HookAction, type HookSelectArg, type IdentityColumn, InetColumn, type InsertQueryData, IntegerBaseColumn, IntegerColumn, IntervalColumn, type IsolationLevel, JSONColumn, JSONTextColumn, Join, type JoinArgToQuery, type JoinArgs, type JoinCallback, type JoinFirstArg, type JoinItem, type JoinItemArgs, type JoinLateralItem, type JoinLateralResult, type JoinQueryBuilder, type JoinQueryMethod, type JoinResult, type JoinedParsers, type JoinedShapes, JsonMethods, LimitedTextBaseColumn, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, type MapTableScopesOption, type MergeQuery, MergeQueryMethods, MoneyColumn, MoreThanOneRowError, type NoPrimaryKeyOption, type NonUniqDataItem, NotFoundError, NumberAsStringBaseColumn, NumberBaseColumn, type NumberColumnData, type NumericColumns, type OnConflictMerge, OnConflictQueryBuilder, type OnConflictSet, type OnConflictTarget, OnMethods, type Operator, Operators, type OperatorsAny, type OperatorsArray, type OperatorsBoolean, type OperatorsDate, type OperatorsJson, type OperatorsNumber, type OperatorsText, type OperatorsTime, type OrCreateArg, OrExpression, OrchidOrmError, OrchidOrmInternalError, type OrderArg, type OrderArgSelf, type OrderArgs, type OrderItem, type OrderTsQueryConfig, type Over, PathColumn, type PickColumnData, type PickQueryBaseQuery, type PickQueryColumnTypes, type PickQueryDataShapeAndJoinedShapes, type PickQueryInternal, type PickQueryMetaRelations, type PickQueryMetaRelationsResult, type PickQueryMetaResultRelations, type PickQueryMetaResultRelationsWindows, type PickQueryMetaResultRelationsWindowsColumnTypes, type PickQueryMetaResultRelationsWithDataReturnType, type PickQueryMetaResultRelationsWithDataReturnTypeShape, type PickQueryMetaResultReturnTypeWithDataWindows, type PickQueryMetaShapeRelationsWithData, type PickQueryMetaTable, type PickQueryMetaTableShape, type PickQueryMetaTableShapeReturnTypeWithData, type PickQueryMetaWithData, type PickQueryMetaWithDataColumnTypes, type PickQueryQ, type PickQueryQAndBaseQuery, type PickQueryQAndInternal, type PickQueryRelations, type PickQueryRelationsWithData, type PickQueryResultColumnTypes, type PickQueryShapeResultSinglePrimaryKey, type PickQueryShapeSinglePrimaryKey, type PickQuerySinglePrimaryKey, type PickQueryWindows, type PickQueryWithData, type PickQueryWithDataColumnTypes, PointColumn, PolygonColumn, PostgisGeographyPointColumn, type PostgisPoint, type Query, type QueryAfterHook, type QueryArraysResult, type QueryBatchResult, type QueryBeforeHook, type QueryComputedArg, type QueryData, type QueryDataFromItem, type QueryDataJoinTo, type QueryDefaultReturnData, QueryError, type QueryErrorName, QueryGet, type QueryGetSelf, type QueryHelperResult, QueryHooks, type QueryIfResultThen, type QueryInternal, QueryLog, type QueryMetaHasSelect, type QueryMetaHasWhere, QueryMethods, type QueryOrExpression, type QueryOrExpressionBooleanOrNullResult, type QueryResult, type QueryScopeData, type QueryScopes, type QuerySourceItem, QueryUpsertOrCreate, RawSQL, RealColumn, type RecordOfColumnsShapeBase, RefExpression, type RelationConfigBase, type RelationConfigDataForCreate, type RelationJoinQuery, type RelationQueryBase, type RelationsBase, type RuntimeComputedQueryColumn, type SearchArg, SearchMethods, type SearchWeight, type SearchWeightRecord, Select, type SelectArg, type SelectArgs, type SelectAs, type SelectAsValue, type SelectItem, type SelectQueryData, type SelectSubQueryResult, type SelectableFromShape, type SelectableOfType, type SelectableOrExpression, type SelectableOrExpressionOfType, type SelectableOrExpressions, SerialColumn, type SerialColumnData, type SetQueryKind, type SetQueryKindResult, type SetQueryReturnsAll, type SetQueryReturnsAllKind, type SetQueryReturnsAllKindResult, type SetQueryReturnsColumnInfo, type SetQueryReturnsColumnKind, type SetQueryReturnsColumnKindResult, type SetQueryReturnsColumnOptional, type SetQueryReturnsColumnOrThrow, type SetQueryReturnsOne, type SetQueryReturnsOneKind, type SetQueryReturnsOneKindResult, type SetQueryReturnsOneOptional, type SetQueryReturnsPluck, type SetQueryReturnsPluckColumn, type SetQueryReturnsPluckColumnKind, type SetQueryReturnsPluckColumnKindResult, type SetQueryReturnsRowCount, type SetQueryReturnsRowCountMany, type SetQueryReturnsRows, type SetQueryReturnsValueOptional, type SetQueryReturnsValueOrThrow, type SetQueryReturnsVoid, type SetQueryReturnsVoidKind, type SetQueryTableAlias, type ShapeColumnPrimaryKeys, type ShapeUniqueColumns, type SimpleJoinItem, type SimpleJoinItemNonSubQueryArgs, SmallIntColumn, SmallSerialColumn, type SortDir, type SqlFn, SqlMethod, StringColumn$1 as StringColumn, TableData, type TableDataFn, type TableDataInput, type TableDataItem, type TableDataItemsUniqueColumnTuples, type TableDataItemsUniqueColumns, type TableDataItemsUniqueConstraints, type TableDataMethods, TextBaseColumn, TextColumn, type TextColumnData, Then, TimeColumn, TimestampColumn, TimestampTZColumn, type ToSQLCtx, type ToSQLOptions, type ToSQLQuery, Transaction, TransactionAdapter, type TransactionOptions, TransformMethods, type TruncateQueryData, TsQueryColumn, TsVectorColumn, type TypeParsers, UUIDColumn, UnhandledTypeError, Union, type UnionArgs, type UnionItem, type UnionKind, type UnionSet, type UniqueConstraints, type UniqueQueryTypeOrExpression, type UniqueTableDataItem, UnknownColumn, Update, type UpdateArg, type UpdateCtx, type UpdateCtxCollect, type UpdateData, type UpdateQueryData, type UpdateQueryDataItem, type UpdateQueryDataObject, type UpdateSelf, type UpdatedAtDataInjector, type UpsertResult, type UpsertThis, VarCharColumn, VirtualColumn, Where, type WhereArg, type WhereArgs, type WhereInArg, type WhereInColumn, type WhereInItem, type WhereInValues, type WhereItem, type WhereJsonPathEqualsItem, type WhereNotArgs, type WhereOnItem, type WhereOnJoinItem, type WhereQueryBuilder, type WhereResult, type WhereSearchItem, type WhereSearchResult, type WindowArg, type WindowArgDeclaration, type WindowDeclaration, type WindowItem, type WithArgsOptions, type WithConfigs, type WithDataItem, type WithDataItems, type WithItem, WithMethods, type WithOptions, type WithQueryBuilder, type WithRecursiveOptions, type WithResult, type WithSqlResult, type WrapQueryArg, 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, 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, pushQueryValueImmutable, pushTableDataCode, queryFrom, queryFromSql, queryJson, queryMethodByReturnType, queryTypeWithLimitOne, queryWrap, raw, referencesArgsToCode, resolveSubQueryCallbackV2, rollbackSql, saveSearchAlias, setColumnDefaultParse, setColumnEncode, setColumnParse, setColumnParseNull, setParserForSelectedString, setQueryObjectValue, setQueryOperators, simplifyColumnDefault, sqlFn, sqlQueryArgsToExpression, tableDataMethods, templateLiteralToSQL, testTransaction, throwIfJoinLateral, throwIfNoWhere, toSQL };