pqb 0.52.3 → 0.53.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
@@ -3,6 +3,7 @@ import * as orchid_core from 'orchid-core';
3
3
  import { QueryResultRow, AdapterConfigBase, AdapterBase, QueryInput, SingleSqlItem, Sql, IsQuery, PickQueryTableMetaResult, PickQueryShape, PickQueryTable, PickQueryMetaReturnType, RecordUnknown, Expression, MaybeArray, ColumnTypesBase, TemplateLiteralArgs, QueryColumn, EmptyObject, QueryColumns, MaybePromise, FnUnknownToUnknown, QueryMetaBase, QueryReturnType, RecordString, ColumnsShapeBase, ColumnsParsers, HookSelect, BatchParsers, QueryLogObject, QueryLogger, QueryDataTransform, ExpressionChain, ColumnSchemaConfig, RawSQLBase, RawSQLValues, ExpressionTypeMethod, DynamicSQLArg, ExpressionData, StaticSQLArgs, SQLQueryArgs, EmptyTuple, PickQueryMeta, PickQueryMetaResultReturnType, QueryColumnToNullable, QueryThenByQuery, ColumnShapeInput, SelectableBase, PickQueryMetaShape, PickQueryTableMetaResultShape, PickQueryMetaResultWindows, PickOutputTypeAndOperators, PickQueryResult, ValExpression, PickOutputType, QueryThen, DateColumnData, ColumnToCodeCtx, Code, TimeInterval, ColumnTypeSchemaArg, ColumnDataBase, ArrayMethodsData, ForeignKeyTable, ColumnNameOfTable, BaseNumberData, PickColumnBaseData, ColumnWithDefault, StringTypeData, PrimaryKeyColumn, ColumnTypeBase, ParseColumn, ParseNullColumn, EncodeColumn, QueryColumnsInit, QueryLogOptions, DefaultSelectColumns, DefaultSelectOutput, QueryThenShallowSimplifyArr, QueryCatch, TransactionState, QueryColumnOfDataType, PickQueryUniqueProperties, PickQueryMetaResult, PickQueryTableMetaResultInputType, UnionToIntersection, AfterCommitStandaloneHook, getValueKey, QueryThenByReturnType, QueryMetaIsSubQuery, PickQueryReturnType, QueryReturnTypeAll, QueryReturnTypeOptional, QueryThenShallowSimplifyOptional, QueryThenShallowSimplify, PickQueryResultReturnType, PickQueryResultReturnTypeUniqueColumns, PickQueryTableMetaShape, QueryInternalBase, PickType, RecordKeyTrue, ColumnShapeOutput, OperatorsNullable, UniqueColumn, TimestampHelpers, ShallowSimplify, Codes, ColumnDataCheckBase } from 'orchid-core';
4
4
  import { inspect } from 'node:util';
5
5
  import { AsyncLocalStorage } from 'node:async_hooks';
6
+ import { QueryResult as QueryResult$1, QueryBuilder as QueryBuilder$1, QueryInternal as QueryInternal$1, Adapter as Adapter$1, QueryData as QueryData$1 } from 'pqb';
6
7
 
7
8
  interface TypeParsers {
8
9
  [K: number]: (input: string) => unknown;
@@ -3466,6 +3467,75 @@ declare class SoftDeleteMethods {
3466
3467
  hardDelete<T extends QueryWithSoftDelete>(this: T, ..._args: DeleteArgs<T>): DeleteResult<T>;
3467
3468
  }
3468
3469
 
3470
+ interface DbSqlQuery {
3471
+ <T extends QueryResultRow = QueryResultRow>(...args: SQLQueryArgs): Promise<QueryResult$1<T>>;
3472
+ /**
3473
+ * Returns an array of records:
3474
+ *
3475
+ * ```ts
3476
+ * const array: T[] = await db.$query.records<T>`SELECT * FROM table`;
3477
+ * ```
3478
+ */
3479
+ records<T extends RecordUnknown = RecordUnknown>(...args: SQLQueryArgs): Promise<T[]>;
3480
+ /**
3481
+ * Returns a single record, throws [NotFoundError](/guide/error-handling) if not found.
3482
+ *
3483
+ * ```ts
3484
+ * const one: T = await db.$query.take<T>`SELECT * FROM table LIMIT 1`;
3485
+ * ```
3486
+ */
3487
+ take<T extends RecordUnknown = RecordUnknown>(...args: SQLQueryArgs): Promise<T>;
3488
+ /**
3489
+ * Returns a single record or `undefined` when not found.
3490
+ *
3491
+ * ```ts
3492
+ * const maybeOne: T | undefined = await db.$query
3493
+ * .takeOptional<T>`SELECT * FROM table LIMIT 1`;
3494
+ * ```
3495
+ */
3496
+ takeOptional<T extends RecordUnknown = RecordUnknown>(...args: SQLQueryArgs): Promise<T | undefined>;
3497
+ /**
3498
+ * Returns array of tuples of the values:
3499
+ *
3500
+ * ```ts
3501
+ * const arrayOfTuples: [number, string][] = await db.$query.rows<
3502
+ * [number, string]
3503
+ * >`SELECT id, name FROM table`;
3504
+ * ```
3505
+ */
3506
+ rows<T extends unknown[]>(...args: SQLQueryArgs): Promise<T[]>;
3507
+ /**
3508
+ * Returns a flat array of values for a single column:
3509
+ *
3510
+ * ```ts
3511
+ * const strings: string[] = await db.$query.pluck<string>`SELECT name FROM table`;
3512
+ * ```
3513
+ */
3514
+ pluck<T>(...args: SQLQueryArgs): Promise<T[]>;
3515
+ /**
3516
+ * Returns a single value, throws [NotFoundError](/guide/error-handling) if not found.
3517
+ *
3518
+ * ```ts
3519
+ * const value: number = await db.$query.get<number>`SELECT 1`;
3520
+ * ```
3521
+ */
3522
+ get<T>(...args: SQLQueryArgs): Promise<T>;
3523
+ /**
3524
+ * Returns a single value or `undefined` when not found.
3525
+ *
3526
+ * ```ts
3527
+ * const value: number | undefined = await db.$query.getOptional<number>`SELECT 1`;
3528
+ * ```
3529
+ */
3530
+ getOptional<T>(...args: SQLQueryArgs): Promise<T | undefined>;
3531
+ }
3532
+ declare const performQuery: <Result = QueryResult$1<any>>(q: {
3533
+ qb: QueryBuilder$1;
3534
+ internal: QueryInternal$1;
3535
+ adapter: Adapter$1;
3536
+ q: QueryData$1;
3537
+ }, args: SQLQueryArgs, method: 'query' | 'arrays') => Promise<Result>;
3538
+
3469
3539
  type ShapeColumnPrimaryKeys<Shape extends QueryColumnsInit> = {
3470
3540
  [K in {
3471
3541
  [K in keyof Shape]: Shape[K]['data']['primaryKey'] extends string ? K : never;
@@ -3550,10 +3620,12 @@ interface TableMeta<Table extends string | undefined, Shape extends QueryColumns
3550
3620
  selectable: SelectableFromShape<ShapeWithComputed, Table>;
3551
3621
  defaultSelect: DefaultSelectColumns<Shape>;
3552
3622
  }
3553
- declare const anyShape: QueryColumnsInit;
3623
+ interface QueryBuilder extends Query {
3624
+ returnType: undefined;
3625
+ }
3554
3626
  declare class Db<Table extends string | undefined = undefined, Shape extends QueryColumnsInit = QueryColumnsInit, PrimaryKeys = never, UniqueColumns = never, UniqueColumnTuples = never, UniqueConstraints = never, ColumnTypes = DefaultColumnTypes<ColumnSchemaConfig>, ShapeWithComputed extends QueryColumnsInit = Shape, Scopes extends RecordUnknown | undefined = EmptyObject> extends QueryMethods<ColumnTypes> implements Query {
3555
3627
  adapter: Adapter;
3556
- queryBuilder: Db;
3628
+ qb: QueryBuilder;
3557
3629
  table: Table;
3558
3630
  shape: ShapeWithComputed;
3559
3631
  columnTypes: ColumnTypes;
@@ -3578,7 +3650,7 @@ declare class Db<Table extends string | undefined = undefined, Shape extends Que
3578
3650
  [K in keyof Shape]: Shape[K]['data']['unique'] extends string ? K : never;
3579
3651
  }[keyof Shape] | keyof PrimaryKeys, UniqueColumnTuples, UniqueConstraints>;
3580
3652
  catch: QueryCatch;
3581
- constructor(adapter: Adapter, queryBuilder: Db, table: Table, shape: ShapeWithComputed, columnTypes: ColumnTypes, transactionStorage: AsyncLocalStorage<TransactionState>, options: DbTableOptions<ColumnTypes, Table, ShapeWithComputed>, tableData?: TableData);
3653
+ constructor(adapter: Adapter, qb: QueryBuilder, table: Table, shape: ShapeWithComputed, columnTypes: ColumnTypes, transactionStorage: AsyncLocalStorage<TransactionState>, options: DbTableOptions<ColumnTypes, Table, ShapeWithComputed>, tableData?: TableData);
3582
3654
  [inspect.custom](): string;
3583
3655
  /**
3584
3656
  * Use `query` to perform raw SQL queries.
@@ -3620,9 +3692,10 @@ declare class Db<Table extends string | undefined = undefined, Shape extends Que
3620
3692
  *
3621
3693
  * @param args - SQL template literal, or an object { raw: string, values?: unknown[] }
3622
3694
  */
3623
- query<T extends QueryResultRow = QueryResultRow>(...args: SQLQueryArgs): Promise<QueryResult<T>>;
3695
+ get query(): DbSqlQuery;
3696
+ private _query?;
3624
3697
  /**
3625
- * The same as the {@link query}, but returns an array of arrays instead of objects:
3698
+ * Performs a SQL query, returns a db result with array of arrays instead of objects:
3626
3699
  *
3627
3700
  * ```ts
3628
3701
  * const value = 1;
@@ -3743,7 +3816,7 @@ declare const createDb: <SchemaConfig extends ColumnSchemaConfig<ColumnTypeBase<
3743
3816
  declare const _initQueryBuilder: (adapter: Adapter, columnTypes: unknown, transactionStorage: AsyncLocalStorage<TransactionState>, commonOptions: DbTableOptions<unknown, undefined, QueryColumns>, options: DbSharedOptions) => Db;
3744
3817
 
3745
3818
  interface ToSQLCtx {
3746
- queryBuilder: Db;
3819
+ qb: QueryBuilder;
3747
3820
  q: QueryData;
3748
3821
  sql: string[];
3749
3822
  values: unknown[];
@@ -3758,7 +3831,7 @@ interface ToSqlOptionsInternal extends ToSQLOptions {
3758
3831
  interface ToSQLQuery {
3759
3832
  __isQuery: Query['__isQuery'];
3760
3833
  q: Query['q'];
3761
- queryBuilder: Query['queryBuilder'];
3834
+ qb: Query['qb'];
3762
3835
  table?: Query['table'];
3763
3836
  internal: QueryInternal;
3764
3837
  relations: Query['relations'];
@@ -4447,7 +4520,7 @@ declare class Create {
4447
4520
  * `create` and `insert` can be used in {@link WithMethods.with} expressions:
4448
4521
  *
4449
4522
  * ```ts
4450
- * db.$queryBuilder
4523
+ * db.$qb
4451
4524
  * // create a record in one table
4452
4525
  * .with('a', db.table.select('id').create(data))
4453
4526
  * // create a record in other table using the first table record id
@@ -4927,7 +5000,7 @@ declare class Delete {
4927
5000
  * `delete` can be used in {@link WithMethods.with} expressions:
4928
5001
  *
4929
5002
  * ```ts
4930
- * db.$queryBuilder
5003
+ * db.$qb
4931
5004
  * // delete a record in one table
4932
5005
  * .with('a', db.table.find(1).select('id').delete())
4933
5006
  * // delete a record in other table using the first table record id
@@ -5918,7 +5991,7 @@ declare class WithMethods {
5918
5991
  /**
5919
5992
  * Use `with` to add a Common Table Expression (CTE) to the query.
5920
5993
  *
5921
- * `with` can be chained to any table on `db` instance, or to `db.$queryBuilder`,
5994
+ * `with` can be chained to any table on `db` instance, or to `db.$qb`,
5922
5995
  * note that in the latter case it won't have customized column types to use for typing SQL.
5923
5996
  *
5924
5997
  * ```ts
@@ -5929,8 +6002,8 @@ declare class WithMethods {
5929
6002
  * q.select({ column: (q) => sql`123`.type((t) => t.customColumn()) }),
5930
6003
  * );
5931
6004
  *
5932
- * // only default columns are available when using off `$queryBuilder`
5933
- * db.$queryBuilder.with('x', (q) =>
6005
+ * // only default columns are available when using off `$qb`
6006
+ * db.$qb.with('x', (q) =>
5934
6007
  * q.select({ column: (q) => sql`123`.type((t) => t.integer()) }),
5935
6008
  * );
5936
6009
  * ```
@@ -5977,7 +6050,7 @@ declare class WithMethods {
5977
6050
  * One `WITH` expression can reference the other:
5978
6051
  *
5979
6052
  * ```ts
5980
- * db.$queryBuilder
6053
+ * db.$qb
5981
6054
  * .with('a', db.table.select('id', 'name'))
5982
6055
  * .with('b', (q) => q.from('a').where({ key: 'value' }))
5983
6056
  * .from('b');
@@ -6001,7 +6074,7 @@ declare class WithMethods {
6001
6074
  *
6002
6075
  * For example, it is useful for loading a tree of categories, where one category can include many other categories.
6003
6076
  *
6004
- * Similarly to [with](#with), `withRecursive` can be chained to any table or `db.$queryBuilder`.
6077
+ * Similarly to [with](#with), `withRecursive` can be chained to any table or `db.$qb`.
6005
6078
  *
6006
6079
  * For the first example, consider the employee table, an employee may or may not have a manager.
6007
6080
  *
@@ -6019,7 +6092,7 @@ declare class WithMethods {
6019
6092
  * The task is to load all subordinates of the manager with the id 1.
6020
6093
  *
6021
6094
  * ```ts
6022
- * db.$queryBuilder
6095
+ * db.$qb
6023
6096
  * .withRecursive(
6024
6097
  * 'subordinates',
6025
6098
  * // the base, anchor query: find the manager to begin recursion with
@@ -6042,7 +6115,7 @@ declare class WithMethods {
6042
6115
  * You can customize it by passing options after the name.
6043
6116
  *
6044
6117
  * ```ts
6045
- * db.$queryBuilder
6118
+ * db.$qb
6046
6119
  * .withRecursive(
6047
6120
  * 'subordinates',
6048
6121
  * {
@@ -6062,7 +6135,7 @@ declare class WithMethods {
6062
6135
  * ```ts
6063
6136
  * import { sql } from './baseTable';
6064
6137
  *
6065
- * db.$queryBuilder
6138
+ * db.$qb
6066
6139
  * .withRecursive(
6067
6140
  * 't',
6068
6141
  * // select `1 AS n` for the base query
@@ -6088,7 +6161,7 @@ declare class WithMethods {
6088
6161
  /**
6089
6162
  * Use `withSql` to add a Common Table Expression (CTE) based on a custom SQL.
6090
6163
  *
6091
- * Similarly to [with](#with), `withRecursive` can be chained to any table or `db.$queryBuilder`.
6164
+ * Similarly to [with](#with), `withRecursive` can be chained to any table or `db.$qb`.
6092
6165
  *
6093
6166
  * ```ts
6094
6167
  * import { sql } from './baseTable';
@@ -6401,7 +6474,7 @@ declare class Update {
6401
6474
  * `update` can be used in {@link WithMethods.with} expressions:
6402
6475
  *
6403
6476
  * ```ts
6404
- * db.$queryBuilder
6477
+ * db.$qb
6405
6478
  * // update record in one table
6406
6479
  * .with('a', db.table.find(1).select('id').update(data))
6407
6480
  * // update record in other table using the first table record id
@@ -7971,7 +8044,7 @@ interface Query extends QueryMethods<unknown> {
7971
8044
  internal: QueryInternal;
7972
8045
  meta: QueryMetaBase<EmptyObject>;
7973
8046
  returnType: QueryReturnType;
7974
- queryBuilder: Db;
8047
+ qb: QueryBuilder;
7975
8048
  columnTypes: unknown;
7976
8049
  shape: QueryColumns;
7977
8050
  inputType: RecordUnknown;
@@ -8788,10 +8861,7 @@ declare const setColumnParseNull: (column: ColumnTypeBase, fn: () => unknown, nu
8788
8861
  declare const setColumnEncode: (column: ColumnTypeBase, fn: (input: any) => unknown, inputSchema?: unknown) => any;
8789
8862
  declare const getColumnBaseType: (column: ColumnTypeBase, domainsMap: DbStructureDomainsMap, type: string) => string;
8790
8863
 
8791
- type Value = any;
8792
- declare const escapeForLog: (value: Value) => string;
8793
- declare const escapeForMigration: (value: Value) => string;
8794
- declare const escapeString: (value: string) => string;
8864
+ declare const anyShape: QueryColumnsInit;
8795
8865
 
8796
8866
  /**
8797
8867
  * Call `.clone()` on a supposed query object
@@ -8850,8 +8920,13 @@ declare const _queryExec: <T extends IsQuery>(q: T) => never;
8850
8920
  declare const _queryRows: <T extends PickQueryResult>(q: T) => SetQueryReturnsRows<T>;
8851
8921
  declare const getFullColumnTable: (q: IsQuery, column: string, index: number, as: string | getValueKey | undefined) => string;
8852
8922
 
8923
+ type Value = any;
8924
+ declare const escapeForLog: (value: Value) => string;
8925
+ declare const escapeForMigration: (value: Value) => string;
8926
+ declare const escapeString: (value: string) => string;
8927
+
8853
8928
  type Arg = {
8854
- $queryBuilder: Query;
8929
+ $qb: Query;
8855
8930
  } | Query;
8856
8931
  declare const testTransaction: {
8857
8932
  /**
@@ -8972,4 +9047,4 @@ type CopyResult<T extends PickQueryMeta> = SetQueryKind<T, 'copy'>;
8972
9047
  */
8973
9048
  declare function copyTableData<T extends PickQueryMetaShape>(query: T, arg: CopyArg<T>): CopyResult<T>;
8974
9049
 
8975
- export { Adapter, type AdapterConfig, type AdapterOptions, type AddQueryDefaults, AfterCommitError, type AfterCommitErrorFulfilledResult, type AfterCommitErrorHandler, 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 ComputedOptionsConfig, 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 DbStructureDomainsMap, 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 GeneratedColumn, 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 JoinLateralResult, type JoinQueryBuilder, type JoinQueryMethod, type JoinResult, type JoinResultRequireMain, 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 PickQueryDataShapeAndJoinedShapesAndAliases, type PickQueryInternal, type PickQueryMetaColumnTypes, type PickQueryMetaRelations, type PickQueryMetaRelationsResult, type PickQueryMetaRelationsResultReturnType, type PickQueryMetaRelationsReturnType, type PickQueryMetaResultRelations, type PickQueryMetaResultRelationsWindows, type PickQueryMetaResultRelationsWindowsColumnTypes, type PickQueryMetaResultRelationsWithDataReturnType, type PickQueryMetaResultRelationsWithDataReturnTypeShape, type PickQueryMetaResultReturnTypeWithDataWindows, type PickQueryMetaResultReturnTypeWithDataWindowsThen, type PickQueryMetaShapeRelationsReturnType, type PickQueryMetaShapeRelationsWithData, type PickQueryMetaTable, type PickQueryMetaTableShape, type PickQueryMetaTableShapeReturnTypeWithData, type PickQueryMetaWithData, type PickQueryMetaWithDataColumnTypes, type PickQueryQ, type PickQueryQAndBaseQuery, type PickQueryQAndInternal, type PickQueryRelationQueries, type PickQueryRelations, type PickQueryRelationsWithData, type PickQueryResultColumnTypes, type PickQueryShapeResultReturnTypeSinglePrimaryKey, type PickQueryShapeResultSinglePrimaryKey, type PickQueryShapeSinglePrimaryKey, type PickQuerySinglePrimaryKey, type PickQueryTableMetaResultReturnTypeWithDataWindowsThen, type PickQueryWindows, type PickQueryWithData, type PickQueryWithDataColumnTypes, PointColumn, PolygonColumn, PostgisGeographyPointColumn, type PostgisPoint, type Queries, 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, type QueryTake, type QueryTakeOptional, QueryUpsertOrCreate, RawSQL, RealColumn, type RecordOfColumnsShapeBase, RefExpression, type RelationConfigBase, type RelationConfigDataForCreate, type RelationConfigQuery, type RelationJoinQuery, type RelationsBase, type ReturnsQueryOrExpression, 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 SetQueryReturnsOneKind, type SetQueryReturnsOneKindResult, 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 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, _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, _runAfterCommitHooks, addColumnParserToQuery, addParserForRawExpression, addParserForSelectItem, addQueryOn, anyShape, applyComputedColumns, assignDbDataToColumn, checkIfASimpleQuery, cloneQueryBaseUnscoped, columnCheckToCode, columnCode, columnExcludesToCode, columnForeignKeysToCode, columnIndexesToCode, columnsShapeToCode, commitSql, constraintInnerToCode, constraintToCode, copyTableData, countSelect, createDb, defaultSchemaConfig, escapeForLog, escapeForMigration, escapeString, excludeInnerToCode, excludeToCode, extendQuery, filterResult, foreignKeyArgumentToCode, getClonedQueryData, getColumnBaseType, getColumnInfo, getColumnTypes, getFullColumnTable, getPrimaryKeys, getQueryAs, getShapeFromSelect, getSqlText, handleResult, identityToCode, indexInnerToCode, indexToCode, isDefaultTimeStamp, isInUserTransaction, isQueryReturnsAll, isSelectingCount, joinSubQuery, logParamToLogObject, makeColumnTypes, makeColumnsByType, makeFnExpression, makeRegexToFindInSql, parseRecord, parseTableData, parseTableDataInput, postgisTypmodToSql, primaryKeyInnerToCode, processComputedBatches, processComputedResult, processSelectArg, pushLimitSQL, pushQueryArrayImmutable, pushQueryOn, pushQueryOnForOuter, pushQueryOrOn, pushQueryValueImmutable, pushTableDataCode, queryFrom, queryFromSql, queryJson, queryMethodByReturnType, queryTypeWithLimitOne, queryWrap, raw, referencesArgsToCode, resolveSubQueryCallbackV2, rollbackSql, saveSearchAlias, setColumnDefaultParse, setColumnEncode, setColumnParse, setColumnParseNull, setParserForSelectedString, setQueryObjectValueImmutable, setQueryOperators, simplifyColumnDefault, sqlFn, sqlQueryArgsToExpression, tableDataMethods, templateLiteralToSQL, testTransaction, throwIfJoinLateral, throwIfNoWhere, toSQL };
9050
+ export { Adapter, type AdapterConfig, type AdapterOptions, type AddQueryDefaults, AfterCommitError, type AfterCommitErrorFulfilledResult, type AfterCommitErrorHandler, 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 ComputedOptionsConfig, 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 DbSqlQuery, type DbStructureDomainsMap, 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 GeneratedColumn, 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 JoinLateralResult, type JoinQueryBuilder, type JoinQueryMethod, type JoinResult, type JoinResultRequireMain, 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 PickQueryDataShapeAndJoinedShapesAndAliases, type PickQueryInternal, type PickQueryMetaColumnTypes, type PickQueryMetaRelations, type PickQueryMetaRelationsResult, type PickQueryMetaRelationsResultReturnType, type PickQueryMetaRelationsReturnType, type PickQueryMetaResultRelations, type PickQueryMetaResultRelationsWindows, type PickQueryMetaResultRelationsWindowsColumnTypes, type PickQueryMetaResultRelationsWithDataReturnType, type PickQueryMetaResultRelationsWithDataReturnTypeShape, type PickQueryMetaResultReturnTypeWithDataWindows, type PickQueryMetaResultReturnTypeWithDataWindowsThen, type PickQueryMetaShapeRelationsReturnType, type PickQueryMetaShapeRelationsWithData, type PickQueryMetaTable, type PickQueryMetaTableShape, type PickQueryMetaTableShapeReturnTypeWithData, type PickQueryMetaWithData, type PickQueryMetaWithDataColumnTypes, type PickQueryQ, type PickQueryQAndBaseQuery, type PickQueryQAndInternal, type PickQueryRelationQueries, type PickQueryRelations, type PickQueryRelationsWithData, type PickQueryResultColumnTypes, type PickQueryShapeResultReturnTypeSinglePrimaryKey, type PickQueryShapeResultSinglePrimaryKey, type PickQueryShapeSinglePrimaryKey, type PickQuerySinglePrimaryKey, type PickQueryTableMetaResultReturnTypeWithDataWindowsThen, type PickQueryWindows, type PickQueryWithData, type PickQueryWithDataColumnTypes, PointColumn, PolygonColumn, PostgisGeographyPointColumn, type PostgisPoint, type Queries, type Query, type QueryAfterHook, type QueryArraysResult, type QueryBatchResult, type QueryBeforeHook, type QueryBuilder, 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, type QueryTake, type QueryTakeOptional, QueryUpsertOrCreate, RawSQL, RealColumn, type RecordOfColumnsShapeBase, RefExpression, type RelationConfigBase, type RelationConfigDataForCreate, type RelationConfigQuery, type RelationJoinQuery, type RelationsBase, type ReturnsQueryOrExpression, 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 SetQueryReturnsOneKind, type SetQueryReturnsOneKindResult, 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 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, _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, _runAfterCommitHooks, addColumnParserToQuery, addParserForRawExpression, addParserForSelectItem, addQueryOn, anyShape, applyComputedColumns, assignDbDataToColumn, checkIfASimpleQuery, cloneQueryBaseUnscoped, columnCheckToCode, columnCode, columnExcludesToCode, columnForeignKeysToCode, columnIndexesToCode, columnsShapeToCode, commitSql, constraintInnerToCode, constraintToCode, copyTableData, countSelect, createDb, defaultSchemaConfig, escapeForLog, escapeForMigration, escapeString, excludeInnerToCode, excludeToCode, extendQuery, filterResult, foreignKeyArgumentToCode, getClonedQueryData, getColumnBaseType, getColumnInfo, getColumnTypes, getFullColumnTable, getPrimaryKeys, getQueryAs, getShapeFromSelect, getSqlText, handleResult, identityToCode, indexInnerToCode, indexToCode, isDefaultTimeStamp, isInUserTransaction, isQueryReturnsAll, isSelectingCount, joinSubQuery, logParamToLogObject, makeColumnTypes, makeColumnsByType, makeFnExpression, makeRegexToFindInSql, parseRecord, parseTableData, parseTableDataInput, performQuery, postgisTypmodToSql, primaryKeyInnerToCode, processComputedBatches, processComputedResult, processSelectArg, pushLimitSQL, pushQueryArrayImmutable, pushQueryOn, pushQueryOnForOuter, pushQueryOrOn, pushQueryValueImmutable, pushTableDataCode, queryFrom, queryFromSql, queryJson, queryMethodByReturnType, queryTypeWithLimitOne, queryWrap, raw, referencesArgsToCode, resolveSubQueryCallbackV2, rollbackSql, saveSearchAlias, setColumnDefaultParse, setColumnEncode, setColumnParse, setColumnParseNull, setParserForSelectedString, setQueryObjectValueImmutable, setQueryOperators, simplifyColumnDefault, sqlFn, sqlQueryArgsToExpression, tableDataMethods, templateLiteralToSQL, testTransaction, throwIfJoinLateral, throwIfNoWhere, toSQL };