pqb 0.54.3 → 0.55.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 +54 -237
- package/dist/index.js +377 -360
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +349 -323
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PoolConfig, Pool, PoolClient } from 'pg';
|
|
2
2
|
import * as orchid_core from 'orchid-core';
|
|
3
|
-
import { QueryResultRow, AdapterConfigBase, AdapterBase, QueryInput, SingleSqlItem, Sql,
|
|
3
|
+
import { QueryResultRow, AdapterConfigBase, AdapterBase, QueryInput, SingleSqlItem, Sql, Expression, MaybeArray, IsQuery, RecordUnknown, ColumnTypesBase, RelationConfigBase, TemplateLiteralArgs, QueryOrExpression, QueryColumn, EmptyObject, QueryColumns, MaybePromise, FnUnknownToUnknown, RelationsBase, QueryMetaBase, QueryReturnType, RecordString, ColumnsShapeBase, ColumnsParsers, QueryHookUtils, PickQueryInputType, PickQueryTable, QueryDataBase, HookSelect, BatchParsers, QueryLogObject, QueryLogger, QueryDataTransform, ExpressionChain, DelayedRelationSelect, QueryDataAliases, ColumnSchemaConfig, RawSQLBase, RawSQLValues, ExpressionTypeMethod, DynamicSQLArg, ExpressionData, StaticSQLArgs, SQLQueryArgs, PickQueryRelationsWithData, PickQueryTableMetaResult, PickQueryMetaShapeRelationsWithData, EmptyTuple, PickQueryMeta, WithDataItem, PickQueryMetaResultReturnType, QueryColumnToNullable, QueryThenByQuery, PickQueryMetaResultRelationsWithDataReturnTypeShape, PickQueryMetaColumnTypes, ColumnShapeInput, SelectableBase, PickQueryMetaShape, AliasOrTable, PickQueryMetaResultRelationsWithDataReturnType, PickQueryTableMetaResultShape, PickQueryMetaResultRelationsWindows, PickQueryMetaResultWindows, PickOutputTypeAndOperators, PickQueryResult, PickQueryResultColumnTypes, PickQueryColumnTypes, PickQueryShape, ValExpression, PickQueryMetaResultRelationsWindowsColumnTypes, PickOutputType, QueryThen, PickQueryMetaRelations, PickQueryRelations, PickQueryMetaRelationsResultReturnType, DateColumnData, ColumnToCodeCtx, Code, TimeInterval, ColumnTypeSchemaArg, ColumnDataBase, ArrayMethodsData, ForeignKeyTable, ColumnNameOfTable, BaseNumberData, PickColumnBaseData, ColumnWithDefault, StringTypeData, PrimaryKeyColumn, ColumnTypeBase, ParseColumn, ParseNullColumn, EncodeColumn, QueryColumnsInit, QueryLogOptions, DefaultSelectColumns, DefaultSelectOutput, QueryThenShallowSimplifyArr, QueryErrorName, QueryError, QueryCatch, TransactionState, PickQueryMetaTable, QueryColumnOfDataType, AsQueryArg, SetQueryTableAlias, PickQueryUniqueProperties, RelationConfigDataForCreate, PickQueryMetaResult, PickQueryMetaTableShapeReturnTypeWithData, WithDataItems, PickQueryTableMetaResultInputType, UnionToIntersection, OrchidOrmError, AfterCommitStandaloneHook, PickQueryMetaResultReturnTypeWithDataWindowsThen, getValueKey, QueryThenByReturnType, QueryMetaIsSubQuery, PickQueryReturnType, PickQueryWithDataColumnTypes, PickQueryMetaWithDataColumnTypes, QueryReturnTypeAll, QueryReturnTypeOptional, QueryThenShallowSimplifyOptional, QueryThenShallowSimplify, PickQueryResultReturnType, PickQueryShapeResultReturnTypeSinglePrimaryKey, PickQueryResultReturnTypeUniqueColumns, PickQueryTableMetaResultReturnTypeWithDataWindowsThen, PickQueryMetaShapeRelationsReturnType, PickQueryTableMetaShape, QueryInternalBase, QueryBase, IsQueries, PickType, RecordKeyTrue, ColumnShapeOutput, OperatorsNullable, PickQueryMetaReturnType, UniqueColumn, TimestampHelpers, ShallowSimplify, Codes, ColumnDataCheckBase } from 'orchid-core';
|
|
4
4
|
import { QueryResult as QueryResult$1, QueryBuilder as QueryBuilder$1, QueryInternal as QueryInternal$1, Adapter as Adapter$1, QueryData as QueryData$1, UpsertThis as UpsertThis$1, UpsertResult as UpsertResult$1 } from 'pqb';
|
|
5
5
|
import { inspect } from 'node:util';
|
|
6
6
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
@@ -56,35 +56,6 @@ declare class TransactionAdapter implements Adapter {
|
|
|
56
56
|
close(): Promise<void>;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
interface RelationJoinQuery {
|
|
60
|
-
(joiningQuery: IsQuery, baseQuery: IsQuery): IsQuery;
|
|
61
|
-
}
|
|
62
|
-
interface RelationConfigQuery extends PickQueryTableMetaResult, PickQueryShape, PickQueryTable {
|
|
63
|
-
}
|
|
64
|
-
interface RelationConfigBase {
|
|
65
|
-
returnsOne: boolean;
|
|
66
|
-
query: RelationConfigQuery;
|
|
67
|
-
joinQuery: RelationJoinQuery;
|
|
68
|
-
reverseJoin: RelationJoinQuery;
|
|
69
|
-
params: unknown;
|
|
70
|
-
queryRelated(params: unknown): unknown;
|
|
71
|
-
modifyRelatedQuery?(relatedQuery: IsQuery): (query: IsQuery) => void;
|
|
72
|
-
maybeSingle: PickQueryMetaReturnType;
|
|
73
|
-
omitForeignKeyInCreate: PropertyKey;
|
|
74
|
-
dataForCreate?: RelationConfigDataForCreate;
|
|
75
|
-
optionalDataForCreate: unknown;
|
|
76
|
-
dataForUpdate: unknown;
|
|
77
|
-
dataForUpdateOne: unknown;
|
|
78
|
-
primaryKeys: string[];
|
|
79
|
-
}
|
|
80
|
-
interface RelationConfigDataForCreate {
|
|
81
|
-
columns: PropertyKey;
|
|
82
|
-
nested: RecordUnknown;
|
|
83
|
-
}
|
|
84
|
-
interface RelationsBase {
|
|
85
|
-
[K: string]: RelationConfigBase;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
59
|
declare const checkIfASimpleQuery: (q: Query) => boolean;
|
|
89
60
|
interface WithItem {
|
|
90
61
|
n: string;
|
|
@@ -353,7 +324,8 @@ interface HandleResult {
|
|
|
353
324
|
(q: Query, returnType: QueryReturnType, result: QueryResult, isSubQuery?: true): MaybePromise<unknown>;
|
|
354
325
|
}
|
|
355
326
|
type WithItems = (WithItem | undefined)[];
|
|
356
|
-
interface
|
|
327
|
+
interface QueryData extends QueryDataBase {
|
|
328
|
+
type: undefined | 'upsert' | 'insert' | 'update' | 'delete' | 'truncate' | 'columnInfo' | 'copy';
|
|
357
329
|
adapter: Adapter;
|
|
358
330
|
shape: ColumnsShape;
|
|
359
331
|
patchResult?(q: Query, hookSelect: HookSelect | undefined, queryResult: QueryResult): Promise<void>;
|
|
@@ -379,9 +351,9 @@ interface CommonQueryData {
|
|
|
379
351
|
};
|
|
380
352
|
joinedForSelect?: string;
|
|
381
353
|
innerJoinLateral?: true;
|
|
382
|
-
outerAliases?: RecordString;
|
|
383
354
|
schema?: string;
|
|
384
355
|
select?: SelectItem[];
|
|
356
|
+
selectRelation?: boolean;
|
|
385
357
|
selectCache?: {
|
|
386
358
|
sql: string;
|
|
387
359
|
aliases: string[];
|
|
@@ -397,8 +369,6 @@ interface CommonQueryData {
|
|
|
397
369
|
*/
|
|
398
370
|
getColumn?: QueryColumn;
|
|
399
371
|
expr?: Expression;
|
|
400
|
-
as?: string;
|
|
401
|
-
aliases?: RecordString;
|
|
402
372
|
from?: MaybeArray<QueryDataFromItem>;
|
|
403
373
|
sources?: {
|
|
404
374
|
[K: string]: QuerySourceItem;
|
|
@@ -459,13 +429,12 @@ interface CommonQueryData {
|
|
|
459
429
|
hookSelect?: HookSelect;
|
|
460
430
|
};
|
|
461
431
|
targetHookSelect: HookSelect;
|
|
432
|
+
delayedRelationSelect: DelayedRelationSelect;
|
|
462
433
|
};
|
|
463
434
|
outerQuery?: Query;
|
|
464
435
|
hookCreateSet?: RecordUnknown[];
|
|
465
436
|
hookUpdateSet?: RecordUnknown[];
|
|
466
|
-
|
|
467
|
-
interface SelectQueryData extends CommonQueryData {
|
|
468
|
-
type: undefined | 'upsert';
|
|
437
|
+
/** select and upsert **/
|
|
469
438
|
distinct?: SelectableOrExpression[];
|
|
470
439
|
only?: boolean;
|
|
471
440
|
join?: JoinItem[];
|
|
@@ -484,17 +453,23 @@ interface SelectQueryData extends CommonQueryData {
|
|
|
484
453
|
tableNames?: string[] | Expression;
|
|
485
454
|
mode?: 'NO WAIT' | 'SKIP LOCKED';
|
|
486
455
|
};
|
|
487
|
-
|
|
488
|
-
interface InsertQueryData extends CommonQueryData {
|
|
489
|
-
type: 'insert';
|
|
456
|
+
/** insert **/
|
|
490
457
|
columns: string[];
|
|
491
458
|
values: InsertQueryDataObjectValues | InsertQueryDataFromValues;
|
|
492
|
-
join?: JoinItem[];
|
|
493
459
|
onConflict?: {
|
|
494
460
|
target?: OnConflictTarget;
|
|
495
461
|
set?: OnConflictSet$1;
|
|
496
462
|
merge?: OnConflictMerge;
|
|
497
463
|
};
|
|
464
|
+
/** update **/
|
|
465
|
+
updateData: UpdateQueryDataItem[];
|
|
466
|
+
/** truncate **/
|
|
467
|
+
restartIdentity?: boolean;
|
|
468
|
+
cascade?: boolean;
|
|
469
|
+
/** column info **/
|
|
470
|
+
column?: string;
|
|
471
|
+
/** copy **/
|
|
472
|
+
copy: CopyOptions;
|
|
498
473
|
}
|
|
499
474
|
type InsertQueryDataObjectValues = unknown[][];
|
|
500
475
|
type InsertQueryDataFromValues = {
|
|
@@ -511,27 +486,6 @@ interface UpdatedAtDataInjector {
|
|
|
511
486
|
(data: UpdateQueryDataItem[]): UpdateQueryDataObject | void;
|
|
512
487
|
}
|
|
513
488
|
type UpdateQueryDataItem = UpdateQueryDataObject | UpdatedAtDataInjector;
|
|
514
|
-
interface UpdateQueryData extends CommonQueryData {
|
|
515
|
-
type: 'update';
|
|
516
|
-
updateData: UpdateQueryDataItem[];
|
|
517
|
-
}
|
|
518
|
-
interface DeleteQueryData extends CommonQueryData {
|
|
519
|
-
type: 'delete';
|
|
520
|
-
join?: JoinItem[];
|
|
521
|
-
}
|
|
522
|
-
interface TruncateQueryData extends CommonQueryData {
|
|
523
|
-
type: 'truncate';
|
|
524
|
-
restartIdentity?: boolean;
|
|
525
|
-
cascade?: boolean;
|
|
526
|
-
}
|
|
527
|
-
interface ColumnInfoQueryData extends CommonQueryData {
|
|
528
|
-
type: 'columnInfo';
|
|
529
|
-
column?: string;
|
|
530
|
-
}
|
|
531
|
-
interface CopyQueryData extends CommonQueryData {
|
|
532
|
-
type: 'copy';
|
|
533
|
-
copy: CopyOptions;
|
|
534
|
-
}
|
|
535
489
|
type CopyOptions<Column = string> = {
|
|
536
490
|
columns?: Column[];
|
|
537
491
|
format?: 'text' | 'csv' | 'binary';
|
|
@@ -554,68 +508,11 @@ type CopyOptions<Column = string> = {
|
|
|
554
508
|
program: string;
|
|
555
509
|
};
|
|
556
510
|
});
|
|
557
|
-
type QueryData = SelectQueryData | InsertQueryData | UpdateQueryData | DeleteQueryData | TruncateQueryData | ColumnInfoQueryData | CopyQueryData;
|
|
558
511
|
interface PickQueryDataShapeAndJoinedShapes {
|
|
559
512
|
shape: ColumnsShapeBase;
|
|
560
513
|
joinedShapes?: JoinedShapes;
|
|
561
514
|
}
|
|
562
|
-
interface PickQueryDataShapeAndJoinedShapesAndAliases extends PickQueryDataShapeAndJoinedShapes {
|
|
563
|
-
aliases?: RecordString;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
declare abstract class OrchidOrmError extends Error {
|
|
567
|
-
}
|
|
568
|
-
/**
|
|
569
|
-
* When we search for a single record, and it is not found, it can either throw an error, or return `undefined`.
|
|
570
|
-
*
|
|
571
|
-
* Unlike other database libraries, `Orchid ORM` decided to throw errors by default when using methods `take`, `find`, `findBy`, `get` and the record is not found.
|
|
572
|
-
* It is a [good practice](https://github.com/goldbergyoni/nodebestpractices/blob/master/sections/errorhandling/centralizedhandling.md) to catch common errors in a centralized place (see [global error handling](https://orchid-orm.netlify.app/guide/error-handling.html#global-error-handling)), and this allows for a more concise code.
|
|
573
|
-
*
|
|
574
|
-
* If it's more suitable to get the `undefined` value instead of throwing, use `takeOptional`, `findOptional`, `findByOptional`, `getOptional` instead.
|
|
575
|
-
*/
|
|
576
|
-
declare class NotFoundError extends OrchidOrmError {
|
|
577
|
-
#private;
|
|
578
|
-
constructor(query: Query, message?: string);
|
|
579
|
-
get query(): Query;
|
|
580
|
-
}
|
|
581
|
-
declare class OrchidOrmInternalError extends Error {
|
|
582
|
-
#private;
|
|
583
|
-
data?: RecordUnknown | undefined;
|
|
584
|
-
constructor(query: Query, message?: string, data?: RecordUnknown | undefined);
|
|
585
|
-
get query(): Query;
|
|
586
|
-
}
|
|
587
|
-
type QueryErrorName = 'parseComplete' | 'bindComplete' | 'closeComplete' | 'noData' | 'portalSuspended' | 'replicationStart' | 'emptyQuery' | 'copyDone' | 'copyData' | 'rowDescription' | 'parameterDescription' | 'parameterStatus' | 'backendKeyData' | 'notification' | 'readyForQuery' | 'commandComplete' | 'dataRow' | 'copyInResponse' | 'copyOutResponse' | 'authenticationOk' | 'authenticationMD5Password' | 'authenticationCleartextPassword' | 'authenticationSASL' | 'authenticationSASLContinue' | 'authenticationSASLFinal' | 'error' | 'notice';
|
|
588
|
-
declare abstract class QueryError<T extends PickQueryShape = PickQueryShape> extends OrchidOrmInternalError {
|
|
589
|
-
message: string;
|
|
590
|
-
name: QueryErrorName;
|
|
591
|
-
stack: string | undefined;
|
|
592
|
-
code: string | undefined;
|
|
593
|
-
detail: string | undefined;
|
|
594
|
-
severity: string | undefined;
|
|
595
|
-
hint: string | undefined;
|
|
596
|
-
position: string | undefined;
|
|
597
|
-
internalPosition: string | undefined;
|
|
598
|
-
internalQuery: string | undefined;
|
|
599
|
-
where: string | undefined;
|
|
600
|
-
schema: string | undefined;
|
|
601
|
-
table: string | undefined;
|
|
602
|
-
column: string | undefined;
|
|
603
|
-
dataType: string | undefined;
|
|
604
|
-
constraint: string | undefined;
|
|
605
|
-
file: string | undefined;
|
|
606
|
-
line: string | undefined;
|
|
607
|
-
routine: string | undefined;
|
|
608
|
-
get isUnique(): boolean;
|
|
609
|
-
columnsCache?: {
|
|
610
|
-
[K in keyof T['shape']]?: true;
|
|
611
|
-
};
|
|
612
|
-
get columns(): { [K in keyof T["shape"]]?: true | undefined; };
|
|
613
|
-
}
|
|
614
|
-
declare class MoreThanOneRowError extends OrchidOrmInternalError {
|
|
615
|
-
constructor(query: Query, message?: string);
|
|
616
|
-
}
|
|
617
|
-
declare class UnhandledTypeError extends OrchidOrmInternalError {
|
|
618
|
-
constructor(query: Query, value: never);
|
|
515
|
+
interface PickQueryDataShapeAndJoinedShapesAndAliases extends PickQueryDataShapeAndJoinedShapes, QueryDataAliases {
|
|
619
516
|
}
|
|
620
517
|
|
|
621
518
|
declare const templateLiteralToSQL: (template: TemplateLiteralArgs, ctx: ToSQLCtx, quotedAs?: string) => string;
|
|
@@ -3718,11 +3615,6 @@ declare class Db<Table extends string | undefined = undefined, Shape extends Que
|
|
|
3718
3615
|
* @param args - SQL template literal, or an object { raw: string, values?: unknown[] }
|
|
3719
3616
|
*/
|
|
3720
3617
|
queryArrays<R extends any[] = any[]>(...args: SQLQueryArgs): Promise<QueryArraysResult<R>>;
|
|
3721
|
-
/**
|
|
3722
|
-
* In snake case mode, or when columns have custom names,
|
|
3723
|
-
* use this method to exchange a db column name to its runtime key.
|
|
3724
|
-
*/
|
|
3725
|
-
columnNameToKey(name: string): string | undefined;
|
|
3726
3618
|
}
|
|
3727
3619
|
interface DbTableConstructor<ColumnTypes> {
|
|
3728
3620
|
<Table extends string, Shape extends QueryColumnsInit, Data extends MaybeArray<TableDataItem>, Options extends DbTableOptions<ColumnTypes, Table, Shape>>(table: Table, shape?: ((t: ColumnTypes) => Shape) | Shape, tableData?: TableDataFn<Shape, Data>, options?: Options): Db<Table, Shape, keyof ShapeColumnPrimaryKeys<Shape> extends never ? never : ShapeColumnPrimaryKeys<Shape>, ShapeUniqueColumns<Shape> | TableDataItemsUniqueColumns<Shape, Data>, TableDataItemsUniqueColumnTuples<Shape, Data>, UniqueConstraints<Shape> | TableDataItemsUniqueConstraints<Data>, ColumnTypes, Shape & ComputedColumnsFromOptions<Options['computed']>, MapTableScopesOption<Options>>;
|
|
@@ -3827,14 +3719,16 @@ interface ToSqlOptionsInternal extends ToSQLOptions {
|
|
|
3827
3719
|
aliasValue?: true;
|
|
3828
3720
|
skipBatchCheck?: true;
|
|
3829
3721
|
}
|
|
3830
|
-
interface ToSQLCtx extends ToSqlOptionsInternal {
|
|
3722
|
+
interface ToSQLCtx extends ToSqlOptionsInternal, ToSQLOptions {
|
|
3831
3723
|
qb: QueryBuilder;
|
|
3832
3724
|
q: QueryData;
|
|
3833
3725
|
sql: string[];
|
|
3834
3726
|
values: unknown[];
|
|
3727
|
+
delayedRelationSelect?: DelayedRelationSelect;
|
|
3835
3728
|
}
|
|
3836
3729
|
interface ToSQLOptions {
|
|
3837
3730
|
values?: unknown[];
|
|
3731
|
+
hasNonSelect?: boolean;
|
|
3838
3732
|
}
|
|
3839
3733
|
interface ToSQLQuery {
|
|
3840
3734
|
__isQuery: Query['__isQuery'];
|
|
@@ -3852,11 +3746,10 @@ interface ToSQLQuery {
|
|
|
3852
3746
|
shape: Query['shape'];
|
|
3853
3747
|
}
|
|
3854
3748
|
declare const toSQL: (table: ToSQLQuery, options?: ToSqlOptionsInternal) => Sql;
|
|
3855
|
-
declare function pushLimitSQL(sql: string[], values: unknown[], q:
|
|
3749
|
+
declare function pushLimitSQL(sql: string[], values: unknown[], q: QueryData): void;
|
|
3856
3750
|
|
|
3857
3751
|
declare const getSqlText: (sql: Sql) => string;
|
|
3858
3752
|
|
|
3859
|
-
type AliasOrTable<T extends PickQueryMetaTable> = T['meta']['as'] extends string ? T['meta']['as'] : T['table'] extends string ? T['table'] : never;
|
|
3860
3753
|
type SelectableOrExpression<T extends PickQueryMeta = PickQueryMeta, C extends QueryColumn = QueryColumn> = '*' | keyof T['meta']['selectable'] | Expression<C>;
|
|
3861
3754
|
type SelectableOrExpressions<T extends {
|
|
3862
3755
|
meta: {
|
|
@@ -4360,10 +4253,7 @@ declare class AggregateMethods {
|
|
|
4360
4253
|
cumeDist<T extends PickQueryMetaResultRelationsWindows>(this: T, over?: Over<T>): NullableNumberReturn<T>;
|
|
4361
4254
|
}
|
|
4362
4255
|
|
|
4363
|
-
|
|
4364
|
-
declare const _queryAs: <T extends PickQueryMetaTableShape, As extends string>(self: T, as: As) => SetQueryTableAlias<T, As>;
|
|
4365
|
-
declare const _queryResolveAlias: (aliases: RecordString, as: string) => string;
|
|
4366
|
-
declare abstract class AsMethods {
|
|
4256
|
+
declare abstract class QueryAsMethods {
|
|
4367
4257
|
/**
|
|
4368
4258
|
* Sets table alias:
|
|
4369
4259
|
*
|
|
@@ -5935,7 +5825,7 @@ type WithSqlResult<T extends PickQueryWithDataColumnTypes, Name extends string,
|
|
|
5935
5825
|
} : K extends keyof T['withData'] ? T['withData'][K] : never;
|
|
5936
5826
|
} : T[K];
|
|
5937
5827
|
};
|
|
5938
|
-
declare const moveQueryValueToWith: (q: Query, withStore: object, value: Query,
|
|
5828
|
+
declare const moveQueryValueToWith: (q: Query, withStore: object, value: Query, withKey: string | number, set?: RecordUnknown, key?: string) => string | undefined;
|
|
5939
5829
|
declare class WithMethods {
|
|
5940
5830
|
/**
|
|
5941
5831
|
* Use `with` to add a Common Table Expression (CTE) to the query.
|
|
@@ -6015,6 +5905,33 @@ declare class WithMethods {
|
|
|
6015
5905
|
* .join('secondTable', 'secondTable.someId', 'firstTable.id')
|
|
6016
5906
|
* .select('firstTable.column', 'secondTable.column');
|
|
6017
5907
|
* ```
|
|
5908
|
+
*
|
|
5909
|
+
* ## creating records using `with` values
|
|
5910
|
+
*
|
|
5911
|
+
* You can use values returned from `with` statements when creating records:
|
|
5912
|
+
*
|
|
5913
|
+
* ```ts
|
|
5914
|
+
* db.table
|
|
5915
|
+
* .with('created', () => db.someTable.create(data).select('one', 'two'))
|
|
5916
|
+
* .create({
|
|
5917
|
+
* column: (q) => q.from('created').get('one'),
|
|
5918
|
+
* otherColumn: (q) => q.from('created').get('two'),
|
|
5919
|
+
* });
|
|
5920
|
+
*
|
|
5921
|
+
* // A record in `with` is created once, its values are used to create two records
|
|
5922
|
+
* db.table
|
|
5923
|
+
* .with('created', () => db.someTable.create(data).select('one', 'two'))
|
|
5924
|
+
* .createMany([
|
|
5925
|
+
* {
|
|
5926
|
+
* column: (q) => q.from('created').get('one'),
|
|
5927
|
+
* otherColumn: (q) => q.from('created').get('two'),
|
|
5928
|
+
* },
|
|
5929
|
+
* {
|
|
5930
|
+
* column: (q) => q.from('created').get('one'),
|
|
5931
|
+
* otherColumn: (q) => q.from('created').get('two'),
|
|
5932
|
+
* },
|
|
5933
|
+
* ]);
|
|
5934
|
+
* ```
|
|
6018
5935
|
*/
|
|
6019
5936
|
with<T extends PickQueryMetaWithDataColumnTypes, Name extends string, Q>(this: T, name: Name, query: Q | ((q: WithQueryBuilder<T>) => Q)): WithResult<T, Name, Q extends PickQueryResult ? Q : never>;
|
|
6020
5937
|
with<T extends PickQueryMetaWithDataColumnTypes, Name extends string, Q extends PickQueryResult>(this: T, name: Name, options: WithArgsOptions, query: Q | ((q: WithQueryBuilder<T>) => Q)): WithResult<T, Name, Q>;
|
|
@@ -6287,7 +6204,6 @@ interface UpdateCtx {
|
|
|
6287
6204
|
collect?: UpdateCtxCollect;
|
|
6288
6205
|
}
|
|
6289
6206
|
interface UpdateCtxCollect {
|
|
6290
|
-
keys: string[];
|
|
6291
6207
|
data: RecordUnknown;
|
|
6292
6208
|
}
|
|
6293
6209
|
declare const _queryChangeCounter: <T extends UpdateSelf>(self: T, op: string, data: ChangeCountArg<T>) => never;
|
|
@@ -7322,7 +7238,7 @@ interface SubQueryReturningSingle extends QueryMetaIsSubQuery {
|
|
|
7322
7238
|
returnType: 'one' | 'oneOrThrow';
|
|
7323
7239
|
}
|
|
7324
7240
|
type WrapQueryArg = FromQuerySelf;
|
|
7325
|
-
interface QueryMethods<ColumnTypes> extends
|
|
7241
|
+
interface QueryMethods<ColumnTypes> extends QueryAsMethods, AggregateMethods, Select, FromMethods, Join, WithMethods, Union, JsonMethods, QueryCreate, Update, Delete, Transaction, For, Where, SearchMethods, Clear, Having, QueryLog, QueryHooks, QueryUpsert, QueryOrCreate, QueryGet, MergeQueryMethods, SqlMethod<ColumnTypes>, TransformMethods, QueryMap, ScopeMethods, SoftDeleteMethods, ExpressionMethods {
|
|
7326
7242
|
}
|
|
7327
7243
|
declare class QueryMethods<ColumnTypes> {
|
|
7328
7244
|
/**
|
|
@@ -7974,8 +7890,6 @@ interface QueryInternal<SinglePrimaryKey = any, UniqueColumns = any, UniqueColum
|
|
|
7974
7890
|
generatorIgnore?: GeneratorIgnore;
|
|
7975
7891
|
tableData: TableData;
|
|
7976
7892
|
nowSQL?: string;
|
|
7977
|
-
primaryKeys?: string[];
|
|
7978
|
-
columnNameToKeyMap?: Map<string, string>;
|
|
7979
7893
|
callbackArg?: Query;
|
|
7980
7894
|
}
|
|
7981
7895
|
type SelectableFromShape<Shape extends QueryColumns, Table extends string | undefined> = {
|
|
@@ -7989,20 +7903,9 @@ type SelectableFromShape<Shape extends QueryColumns, Table extends string | unde
|
|
|
7989
7903
|
column: Shape[K];
|
|
7990
7904
|
};
|
|
7991
7905
|
};
|
|
7992
|
-
interface
|
|
7993
|
-
table: string;
|
|
7994
|
-
shape: QueryColumns;
|
|
7995
|
-
}
|
|
7996
|
-
interface WithDataItems {
|
|
7997
|
-
[K: string]: WithDataItem;
|
|
7998
|
-
}
|
|
7999
|
-
interface Queries {
|
|
8000
|
-
[K: string]: Query;
|
|
8001
|
-
}
|
|
8002
|
-
interface Query extends QueryMethods<unknown> {
|
|
7906
|
+
interface Query extends QueryBase, QueryMethods<unknown> {
|
|
8003
7907
|
__isQuery: true;
|
|
8004
7908
|
result: QueryColumns;
|
|
8005
|
-
table?: string;
|
|
8006
7909
|
withData: WithDataItems;
|
|
8007
7910
|
baseQuery: Query;
|
|
8008
7911
|
internal: QueryInternal;
|
|
@@ -8010,28 +7913,14 @@ interface Query extends QueryMethods<unknown> {
|
|
|
8010
7913
|
returnType: QueryReturnType;
|
|
8011
7914
|
qb: QueryBuilder;
|
|
8012
7915
|
columnTypes: unknown;
|
|
8013
|
-
shape: QueryColumns;
|
|
8014
7916
|
inputType: RecordUnknown;
|
|
8015
7917
|
q: QueryData;
|
|
8016
7918
|
then: QueryThen<unknown>;
|
|
8017
7919
|
catch: QueryCatch;
|
|
8018
7920
|
windows: EmptyObject;
|
|
8019
7921
|
relations: RelationsBase;
|
|
8020
|
-
relationQueries:
|
|
7922
|
+
relationQueries: IsQueries;
|
|
8021
7923
|
error: new (message: string, length: number, name: QueryErrorName) => QueryError;
|
|
8022
|
-
columnNameToKey(name: string): string | undefined;
|
|
8023
|
-
}
|
|
8024
|
-
interface PickQueryWithData {
|
|
8025
|
-
withData: WithDataItems;
|
|
8026
|
-
}
|
|
8027
|
-
interface PickQueryWindows {
|
|
8028
|
-
windows: EmptyObject;
|
|
8029
|
-
}
|
|
8030
|
-
interface PickQueryRelations {
|
|
8031
|
-
relations: RelationsBase;
|
|
8032
|
-
}
|
|
8033
|
-
interface PickQueryRelationQueries {
|
|
8034
|
-
relationQueries: Queries;
|
|
8035
7924
|
}
|
|
8036
7925
|
interface PickQueryQ {
|
|
8037
7926
|
q: QueryData;
|
|
@@ -8042,71 +7931,10 @@ interface PickQueryInternal {
|
|
|
8042
7931
|
interface PickQueryBaseQuery {
|
|
8043
7932
|
baseQuery: Query;
|
|
8044
7933
|
}
|
|
8045
|
-
interface PickQueryMetaRelations extends PickQueryMeta, PickQueryRelations {
|
|
8046
|
-
}
|
|
8047
|
-
interface PickQueryMetaRelationsResult extends PickQueryMetaRelations, PickQueryResult {
|
|
8048
|
-
}
|
|
8049
|
-
interface PickQueryMetaRelationsReturnType extends PickQueryMetaRelationsResult, PickQueryResultReturnType {
|
|
8050
|
-
}
|
|
8051
|
-
interface PickQueryMetaShapeRelationsReturnType extends PickQueryMetaRelationsReturnType, PickQueryShape {
|
|
8052
|
-
}
|
|
8053
|
-
interface PickQueryMetaRelationsResultReturnType extends PickQueryMetaRelationsReturnType, PickQueryResult {
|
|
8054
|
-
}
|
|
8055
|
-
interface PickQueryMetaResultRelations extends PickQueryResult, PickQueryMeta, PickQueryRelations {
|
|
8056
|
-
}
|
|
8057
|
-
interface PickQueryMetaResultRelationsWindows extends PickQueryMetaResultRelations, PickQueryWindows {
|
|
8058
|
-
}
|
|
8059
|
-
interface PickQueryColumnTypes {
|
|
8060
|
-
columnTypes: unknown;
|
|
8061
|
-
}
|
|
8062
|
-
interface PickQueryMetaColumnTypes extends PickQueryMeta, PickQueryColumnTypes {
|
|
8063
|
-
}
|
|
8064
|
-
interface PickQueryMetaResultRelationsWindowsColumnTypes extends PickQueryMetaResultRelationsWindows, PickQueryColumnTypes {
|
|
8065
|
-
}
|
|
8066
|
-
interface PickQueryWithDataColumnTypes extends PickQueryWithData, PickQueryColumnTypes {
|
|
8067
|
-
}
|
|
8068
|
-
interface PickQueryResultColumnTypes extends PickQueryResult, PickQueryColumnTypes {
|
|
8069
|
-
}
|
|
8070
|
-
interface PickQueryMetaWithDataColumnTypes extends PickQueryMeta, PickQueryWithData, PickQueryColumnTypes {
|
|
8071
|
-
}
|
|
8072
|
-
interface PickQueryMetaTable extends PickQueryMeta, PickQueryTable {
|
|
8073
|
-
}
|
|
8074
|
-
interface PickQueryMetaTableShape extends PickQueryMetaTable, PickQueryShape {
|
|
8075
|
-
}
|
|
8076
|
-
interface PickQueryMetaWithData extends PickQueryMeta, PickQueryWithData {
|
|
8077
|
-
}
|
|
8078
|
-
interface PickQueryRelationsWithData extends PickQueryWithData, PickQueryRelations {
|
|
8079
|
-
}
|
|
8080
|
-
interface PickQueryMetaShapeRelationsWithData extends PickQueryMeta, PickQueryShape, PickQueryRelations, PickQueryWithData {
|
|
8081
|
-
}
|
|
8082
|
-
interface PickQueryMetaResultRelationsWithDataReturnType extends PickQueryMeta, PickQueryResult, PickQueryRelations, PickQueryWithData, PickQueryReturnType {
|
|
8083
|
-
}
|
|
8084
|
-
interface PickQueryMetaTableShapeReturnTypeWithData extends PickQueryMetaTableShape, PickQueryReturnType, PickQueryMetaWithData {
|
|
8085
|
-
}
|
|
8086
|
-
interface PickQueryMetaResultRelationsWithDataReturnTypeShape extends PickQueryMetaResultRelationsWithDataReturnType, PickQueryShape {
|
|
8087
|
-
}
|
|
8088
|
-
interface PickQueryMetaResultReturnTypeWithDataWindows extends PickQueryMetaResultReturnType, PickQueryWithData, PickQueryWindows {
|
|
8089
|
-
}
|
|
8090
|
-
interface PickQueryMetaResultReturnTypeWithDataWindowsThen extends PickQueryMetaResultReturnTypeWithDataWindows {
|
|
8091
|
-
then: unknown;
|
|
8092
|
-
}
|
|
8093
|
-
interface PickQueryTableMetaResultReturnTypeWithDataWindowsThen extends PickQueryMetaResultReturnTypeWithDataWindowsThen, PickQueryTable {
|
|
8094
|
-
}
|
|
8095
7934
|
interface PickQueryQAndInternal extends PickQueryQ, PickQueryInternal {
|
|
8096
7935
|
}
|
|
8097
7936
|
interface PickQueryQAndBaseQuery extends PickQueryQ, PickQueryBaseQuery {
|
|
8098
7937
|
}
|
|
8099
|
-
interface PickQuerySinglePrimaryKey {
|
|
8100
|
-
internal: {
|
|
8101
|
-
singlePrimaryKey: unknown;
|
|
8102
|
-
};
|
|
8103
|
-
}
|
|
8104
|
-
interface PickQueryShapeSinglePrimaryKey extends PickQueryShape, PickQuerySinglePrimaryKey {
|
|
8105
|
-
}
|
|
8106
|
-
interface PickQueryShapeResultSinglePrimaryKey extends PickQueryShapeSinglePrimaryKey, PickQueryResult {
|
|
8107
|
-
}
|
|
8108
|
-
interface PickQueryShapeResultReturnTypeSinglePrimaryKey extends PickQueryShapeResultSinglePrimaryKey, PickQueryReturnType {
|
|
8109
|
-
}
|
|
8110
7938
|
type SelectableOfType<T extends PickQueryMeta, Type> = {
|
|
8111
7939
|
[K in keyof T['meta']['selectable']]: T['meta']['selectable'][K]['column']['type'] extends Type | null ? K : never;
|
|
8112
7940
|
}[keyof T['meta']['selectable']];
|
|
@@ -8234,16 +8062,6 @@ type SetQueryKindResult<T extends PickQueryMetaReturnType, Kind extends string,
|
|
|
8234
8062
|
[K in keyof T['meta']]: K extends 'kind' ? Kind : T['meta'][K];
|
|
8235
8063
|
} : K extends 'result' ? Result : K extends 'then' ? QueryThenByQuery<T, Result> : T[K];
|
|
8236
8064
|
};
|
|
8237
|
-
type SetQueryTableAlias<T extends PickQueryMetaTableShape, As extends string> = {
|
|
8238
|
-
[K in keyof T]: K extends 'meta' ? {
|
|
8239
|
-
[K in keyof T['meta'] | 'as']: K extends 'as' ? As : K extends 'selectable' ? Omit<T['meta']['selectable'], `${AliasOrTable<T>}.${keyof T['shape'] & string}`> & {
|
|
8240
|
-
[K in keyof T['shape'] & string as `${As}.${K}`]: {
|
|
8241
|
-
as: K;
|
|
8242
|
-
column: T['shape'][K];
|
|
8243
|
-
};
|
|
8244
|
-
} : T['meta'][K];
|
|
8245
|
-
} : T[K];
|
|
8246
|
-
};
|
|
8247
8065
|
interface ReturnsQueryOrExpression<T> {
|
|
8248
8066
|
(): QueryOrExpression<T>;
|
|
8249
8067
|
}
|
|
@@ -8863,7 +8681,6 @@ declare const saveAliasedShape: (q: IsQuery, as: string, key: 'joinedShapes' | '
|
|
|
8863
8681
|
* @param methods - methods to add
|
|
8864
8682
|
*/
|
|
8865
8683
|
declare const extendQuery: <T extends PickQueryQAndBaseQuery, Methods extends RecordUnknown>(q: T, methods: Methods) => T & Methods;
|
|
8866
|
-
declare const getPrimaryKeys: (q: IsQuery) => string[];
|
|
8867
8684
|
declare const _queryAll: <T extends PickQueryResult>(q: T) => SetQueryReturnsAll<T>;
|
|
8868
8685
|
declare const _queryTake: <T extends PickQueryResultReturnType>(query: T) => QueryTake<T>;
|
|
8869
8686
|
declare const _queryTakeOptional: <T extends PickQueryResultReturnType>(query: T) => QueryTakeOptional<T>;
|
|
@@ -8998,4 +8815,4 @@ type CopyResult<T extends PickQueryMeta> = SetQueryKind<T, 'copy'>;
|
|
|
8998
8815
|
*/
|
|
8999
8816
|
declare function copyTableData<T extends PickQueryMetaShape>(query: T, arg: CopyArg<T>): CopyResult<T>;
|
|
9000
8817
|
|
|
9001
|
-
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, type CreateBelongsToData, type CreateColumn, type CreateCtx, type CreateData, 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, type InsertQueryDataFromValues, type InsertQueryDataObjectValues, 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$1 as OnConflictSet, type OnConflictTarget, OnMethods, type Operator, Operators, type OperatorsAny, type OperatorsArray, type OperatorsBoolean, type OperatorsDate, type OperatorsJson, type OperatorsNumber, type OperatorsText, type OperatorsTime, 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 QueryBeforeHookInternal, type QueryBuilder, type QueryComputedArg, QueryCreate, 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 QueryOrExpressionBooleanOrNullResult, type QueryResult, type QueryScopeData, type QueryScopes, type QuerySourceItem, type QueryTake, type QueryTakeOptional, QueryUpsert, 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, type WithItems, 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, _queryDefaults, _queryDelete, _queryExec, _queryFindBy, _queryFindByOptional, _queryGet, _queryGetOptional, _queryHookAfterCreate, _queryHookAfterCreateCommit, _queryHookAfterDelete, _queryHookAfterDeleteCommit, _queryHookAfterQuery, _queryHookAfterSave, _queryHookAfterUpdate, _queryHookAfterUpdateCommit, _queryHookBeforeCreate, _queryHookBeforeDelete, _queryHookBeforeQuery, _queryHookBeforeSave, _queryHookBeforeUpdate, _queryInsert, _queryInsertFrom, _queryInsertMany, _queryInsertManyFrom, _queryJoinOn, _queryJoinOnJsonPathEquals, _queryJoinOrOn, _queryOr, _queryOrNot, _queryResolveAlias, _queryRows, _querySelect, _queryTake, _queryTakeOptional, _queryUnion, _queryUpdate, _queryUpdateOrThrow, _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, moveQueryValueToWith, parseRecord, parseTableData, parseTableDataInput, performQuery, postgisTypmodToSql, primaryKeyInnerToCode, processComputedBatches, processComputedResult, processSelectArg, pushLimitSQL, pushQueryArrayImmutable, pushQueryOn, pushQueryOnForOuter, pushQueryOrOn, pushTableDataCode, queryFrom, queryFromSql, queryJson, queryMethodByReturnType, queryTypeWithLimitOne, queryWrap, raw, referencesArgsToCode, resolveSubQueryCallbackV2, rollbackSql, saveAliasedShape, setColumnDefaultParse, setColumnEncode, setColumnParse, setColumnParseNull, setParserForSelectedString, setQueryObjectValueImmutable, setQueryOperators, simplifyColumnDefault, sqlFn, sqlQueryArgsToExpression, tableDataMethods, templateLiteralToSQL, testTransaction, throwIfJoinLateral, throwIfNoWhere, toSQL };
|
|
8818
|
+
export { Adapter, type AdapterConfig, type AdapterOptions, type AddQueryDefaults, AfterCommitError, type AfterCommitErrorFulfilledResult, type AfterCommitErrorHandler, type AfterCommitErrorRejectedResult, type AfterCommitErrorResult, type AfterHook, type AggregateArgTypes, AggregateMethods, type AggregateOptions, ArrayColumn, type ArrayColumnValue, type ArrayData, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, type BooleanQueryColumn, BoxColumn, ByteaColumn, type ChangeCountArg, CidrColumn, CircleColumn, CitextColumn, Clear, type ClearStatement, type ColumnData, type ColumnDataGenerated, type ColumnFromDbParams, ColumnRefExpression, ColumnType, type ColumnsByType, type ColumnsShape, type ColumnsShapeToNullableObject, type ColumnsShapeToObject, type ColumnsShapeToObjectArray, type ColumnsShapeToPluck, ComputedColumn, type ComputedColumns, type ComputedColumnsFromOptions, type ComputedMethods, type ComputedOptionsConfig, type ComputedOptionsFactory, type CopyOptions, type CreateBelongsToData, type CreateColumn, type CreateCtx, type CreateData, 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 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 InsertQueryDataFromValues, type InsertQueryDataObjectValues, 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, type NoPrimaryKeyOption, type NonUniqDataItem, NumberAsStringBaseColumn, NumberBaseColumn, type NumberColumnData, type NumericColumns, type OnConflictMerge, OnConflictQueryBuilder, type OnConflictSet$1 as OnConflictSet, type OnConflictTarget, OnMethods, type Operator, Operators, type OperatorsAny, type OperatorsArray, type OperatorsBoolean, type OperatorsDate, type OperatorsJson, type OperatorsNumber, type OperatorsText, type OperatorsTime, OrExpression, type OrderArg, type OrderArgSelf, type OrderArgs, type OrderItem, type OrderTsQueryConfig, type Over, PathColumn, type PickColumnData, type PickQueryBaseQuery, type PickQueryDataShapeAndJoinedShapes, type PickQueryDataShapeAndJoinedShapesAndAliases, type PickQueryInternal, type PickQueryQ, type PickQueryQAndBaseQuery, type PickQueryQAndInternal, PointColumn, PolygonColumn, PostgisGeographyPointColumn, type PostgisPoint, type Query, type QueryAfterHook, type QueryArraysResult, QueryAsMethods, type QueryBatchResult, type QueryBeforeHook, type QueryBeforeHookInternal, type QueryBuilder, type QueryComputedArg, QueryCreate, type QueryData, type QueryDataFromItem, type QueryDataJoinTo, type QueryDefaultReturnData, QueryGet, type QueryGetSelf, type QueryHelperResult, QueryHooks, type QueryIfResultThen, type QueryInternal, QueryLog, type QueryMetaHasSelect, type QueryMetaHasWhere, QueryMethods, type QueryOrExpressionBooleanOrNullResult, type QueryResult, type QueryScopeData, type QueryScopes, type QuerySourceItem, type QueryTake, type QueryTakeOptional, QueryUpsert, RawSQL, RealColumn, type RecordOfColumnsShapeBase, RefExpression, type ReturnsQueryOrExpression, type RuntimeComputedQueryColumn, type SearchArg, SearchMethods, type SearchWeight, type SearchWeightRecord, Select, type SelectArg, type SelectArgs, type SelectAs, type SelectAsValue, type SelectItem, 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 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, TsQueryColumn, TsVectorColumn, type TypeParsers, UUIDColumn, 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 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 WithItem, type WithItems, WithMethods, type WithOptions, type WithQueryBuilder, type WithRecursiveOptions, type WithResult, type WithSqlResult, type WrapQueryArg, XMLColumn, _clone, _getSelectableColumn, _initQueryBuilder, _queryAfterSaveCommit, _queryAll, _queryChangeCounter, _queryCreate, _queryCreateFrom, _queryCreateMany, _queryCreateManyFrom, _queryDefaults, _queryDelete, _queryExec, _queryFindBy, _queryFindByOptional, _queryGet, _queryGetOptional, _queryHookAfterCreate, _queryHookAfterCreateCommit, _queryHookAfterDelete, _queryHookAfterDeleteCommit, _queryHookAfterQuery, _queryHookAfterSave, _queryHookAfterUpdate, _queryHookAfterUpdateCommit, _queryHookBeforeCreate, _queryHookBeforeDelete, _queryHookBeforeQuery, _queryHookBeforeSave, _queryHookBeforeUpdate, _queryInsert, _queryInsertFrom, _queryInsertMany, _queryInsertManyFrom, _queryJoinOn, _queryJoinOnJsonPathEquals, _queryJoinOrOn, _queryOr, _queryOrNot, _queryRows, _querySelect, _queryTake, _queryTakeOptional, _queryUnion, _queryUpdate, _queryUpdateOrThrow, _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, getQueryAs, getShapeFromSelect, getSqlText, handleResult, identityToCode, indexInnerToCode, indexToCode, isDefaultTimeStamp, isInUserTransaction, isQueryReturnsAll, isSelectingCount, joinSubQuery, logParamToLogObject, makeColumnTypes, makeColumnsByType, makeFnExpression, moveQueryValueToWith, parseRecord, parseTableData, parseTableDataInput, performQuery, postgisTypmodToSql, primaryKeyInnerToCode, processComputedBatches, processComputedResult, processSelectArg, pushLimitSQL, pushQueryArrayImmutable, pushQueryOn, pushQueryOnForOuter, pushQueryOrOn, pushTableDataCode, queryFrom, queryFromSql, queryJson, queryMethodByReturnType, queryTypeWithLimitOne, queryWrap, raw, referencesArgsToCode, resolveSubQueryCallbackV2, rollbackSql, saveAliasedShape, setColumnDefaultParse, setColumnEncode, setColumnParse, setColumnParseNull, setParserForSelectedString, setQueryObjectValueImmutable, setQueryOperators, simplifyColumnDefault, sqlFn, sqlQueryArgsToExpression, tableDataMethods, templateLiteralToSQL, testTransaction, throwIfJoinLateral, throwIfNoWhere, toSQL };
|