joist-core 2.4.0-next.2 → 2.4.0-next.21
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/build/EntityManager.cjs +25 -11
- package/build/EntityManager.cjs.map +1 -1
- package/build/EntityManager.d.cts +11 -4
- package/build/EntityManager.d.cts.map +1 -1
- package/build/EntityManager.d.mts +11 -4
- package/build/EntityManager.d.mts.map +1 -1
- package/build/EntityManager.js +25 -13
- package/build/EntityManager.js.map +1 -1
- package/build/EntityMetadata.cjs +0 -1
- package/build/EntityMetadata.cjs.map +1 -1
- package/build/EntityMetadata.d.cts +8 -4
- package/build/EntityMetadata.d.cts.map +1 -1
- package/build/EntityMetadata.d.mts +8 -4
- package/build/EntityMetadata.d.mts.map +1 -1
- package/build/EntityMetadata.js +0 -1
- package/build/EntityMetadata.js.map +1 -1
- package/build/IndexManager.cjs +23 -5
- package/build/IndexManager.cjs.map +1 -1
- package/build/IndexManager.d.cts.map +1 -1
- package/build/IndexManager.d.mts.map +1 -1
- package/build/IndexManager.js +23 -5
- package/build/IndexManager.js.map +1 -1
- package/build/batchloaders/populateBatchLoader.cjs +2 -2
- package/build/batchloaders/populateBatchLoader.js +2 -2
- package/build/batchloaders/recursiveChildrenBatchLoader.cjs +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.js +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.cjs +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.js +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.cjs +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.js +1 -1
- package/build/config.cjs +74 -1
- package/build/config.cjs.map +1 -1
- package/build/config.d.cts +83 -2
- package/build/config.d.cts.map +1 -1
- package/build/config.d.mts +83 -2
- package/build/config.d.mts.map +1 -1
- package/build/config.js +74 -1
- package/build/config.js.map +1 -1
- package/build/configure.cjs +6 -2
- package/build/configure.cjs.map +1 -1
- package/build/configure.d.cts.map +1 -1
- package/build/configure.d.mts.map +1 -1
- package/build/configure.js +6 -2
- package/build/configure.js.map +1 -1
- package/build/dataloaders/findDataLoader.cjs +1 -1
- package/build/dataloaders/findDataLoader.js +1 -1
- package/build/dataloaders/findOrCreateDataLoader.cjs +6 -2
- package/build/dataloaders/findOrCreateDataLoader.cjs.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.js +7 -3
- package/build/dataloaders/findOrCreateDataLoader.js.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.cjs +1 -1
- package/build/dataloaders/findPaginatedDataLoader.js +1 -1
- package/build/defaults.cjs +2 -2
- package/build/defaults.js +2 -2
- package/build/fields.cjs +1 -0
- package/build/fields.cjs.map +1 -1
- package/build/fields.d.cts.map +1 -1
- package/build/fields.d.mts.map +1 -1
- package/build/fields.js +1 -0
- package/build/fields.js.map +1 -1
- package/build/index.cjs +13 -8
- package/build/index.cjs.map +1 -1
- package/build/index.d.cts +4 -3
- package/build/index.d.cts.map +1 -1
- package/build/index.d.mts +4 -3
- package/build/index.d.mts.map +1 -1
- package/build/index.js +13 -10
- package/build/index.js.map +1 -1
- package/build/json.cjs +3 -3
- package/build/json.js +3 -3
- package/build/loading/loadHints.cjs +1 -1
- package/build/loading/loadHints.js +1 -1
- package/build/loading/withLoaded.cjs +2 -2
- package/build/loading/withLoaded.js +2 -2
- package/build/newTestInstance.cjs +1 -0
- package/build/newTestInstance.cjs.map +1 -1
- package/build/newTestInstance.d.cts.map +1 -1
- package/build/newTestInstance.d.mts.map +1 -1
- package/build/newTestInstance.js +1 -0
- package/build/newTestInstance.js.map +1 -1
- package/build/preloading/partitionHint.cjs +1 -1
- package/build/preloading/partitionHint.js +1 -1
- package/build/queries/sql/execute.cjs +68 -89
- package/build/queries/sql/execute.cjs.map +1 -1
- package/build/queries/sql/execute.d.cts +35 -18
- package/build/queries/sql/execute.d.cts.map +1 -1
- package/build/queries/sql/execute.d.mts +35 -18
- package/build/queries/sql/execute.d.mts.map +1 -1
- package/build/queries/sql/execute.js +70 -91
- package/build/queries/sql/execute.js.map +1 -1
- package/build/queries/sql/query.cjs +77 -30
- package/build/queries/sql/query.cjs.map +1 -1
- package/build/queries/sql/query.d.cts +64 -21
- package/build/queries/sql/query.d.cts.map +1 -1
- package/build/queries/sql/query.d.mts +64 -21
- package/build/queries/sql/query.d.mts.map +1 -1
- package/build/queries/sql/query.js +75 -30
- package/build/queries/sql/query.js.map +1 -1
- package/build/reactivity/ReactionsManager.cjs +168 -2
- package/build/reactivity/ReactionsManager.cjs.map +1 -1
- package/build/reactivity/ReactionsManager.d.cts +54 -1
- package/build/reactivity/ReactionsManager.d.cts.map +1 -1
- package/build/reactivity/ReactionsManager.d.mts +54 -1
- package/build/reactivity/ReactionsManager.d.mts.map +1 -1
- package/build/reactivity/ReactionsManager.js +169 -3
- package/build/reactivity/ReactionsManager.js.map +1 -1
- package/build/reactivity/reactiveHints.cjs +3 -3
- package/build/reactivity/reactiveHints.cjs.map +1 -1
- package/build/reactivity/reactiveHints.d.cts.map +1 -1
- package/build/reactivity/reactiveHints.d.mts.map +1 -1
- package/build/reactivity/reactiveHints.js +3 -3
- package/build/reactivity/reactiveHints.js.map +1 -1
- package/build/relations/AsyncReactiveField.cjs +3 -3
- package/build/relations/AsyncReactiveField.js +3 -3
- package/build/relations/LazyField.cjs +14 -0
- package/build/relations/LazyField.cjs.map +1 -1
- package/build/relations/LazyField.d.cts +6 -0
- package/build/relations/LazyField.d.cts.map +1 -1
- package/build/relations/LazyField.d.mts +6 -0
- package/build/relations/LazyField.d.mts.map +1 -1
- package/build/relations/LazyField.js +14 -0
- package/build/relations/LazyField.js.map +1 -1
- package/build/relations/ReactiveField.cjs +2 -2
- package/build/relations/ReactiveField.js +2 -2
- package/build/relations/ReactiveManyToMany.cjs +1 -1
- package/build/relations/ReactiveManyToMany.js +1 -1
- package/build/relations/ReactiveReference.cjs +1 -1
- package/build/relations/ReactiveReference.js +1 -1
- package/build/relations/RecursiveCollection.cjs +3 -3
- package/build/relations/RecursiveCollection.js +3 -3
- package/build/relations/hasProperty.cjs +2 -2
- package/build/relations/hasProperty.js +2 -2
- package/build/relations/index.cjs +5 -5
- package/build/relations/index.js +5 -5
- package/build/resurrection.cjs +11 -1
- package/build/resurrection.cjs.map +1 -1
- package/build/resurrection.d.cts +4 -1
- package/build/resurrection.d.cts.map +1 -1
- package/build/resurrection.d.mts +4 -1
- package/build/resurrection.d.mts.map +1 -1
- package/build/resurrection.js +11 -2
- package/build/resurrection.js.map +1 -1
- package/build/transitions.cjs +89 -0
- package/build/transitions.cjs.map +1 -0
- package/build/transitions.d.cts +110 -0
- package/build/transitions.d.cts.map +1 -0
- package/build/transitions.d.mts +110 -0
- package/build/transitions.d.mts.map +1 -0
- package/build/transitions.js +84 -0
- package/build/transitions.js.map +1 -0
- package/package.json +2 -2
|
@@ -47,7 +47,7 @@ declare const subqueryBrand: unique symbol;
|
|
|
47
47
|
declare const entityQueryBrand: unique symbol;
|
|
48
48
|
declare const scalarQueryBrand: unique symbol;
|
|
49
49
|
/** A query(...) value with any projection, for EXISTS and NOT EXISTS predicates. */
|
|
50
|
-
type ExistsQuery =
|
|
50
|
+
type ExistsQuery = QueryTable<unknown, string> | EntityQuery<Entity> | {
|
|
51
51
|
readonly [scalarQueryBrand]: true;
|
|
52
52
|
};
|
|
53
53
|
/**
|
|
@@ -80,22 +80,24 @@ type QueryCondition = SqlPredicate | UnbrandedPredicate | (({
|
|
|
80
80
|
and?: never;
|
|
81
81
|
or?: never;
|
|
82
82
|
};
|
|
83
|
-
/** Phantom type information carried by a table-shaped
|
|
84
|
-
interface
|
|
83
|
+
/** Phantom type information carried by a table-shaped `query(...)` value. */
|
|
84
|
+
interface QueryTableBrand<R, Name extends string> {
|
|
85
85
|
readonly __row: R;
|
|
86
86
|
readonly __name: Name;
|
|
87
87
|
}
|
|
88
|
+
/** @deprecated Renamed to `QueryTableBrand`; a `query(...)` value is a table shape, not only a subquery. */
|
|
89
|
+
type SubqueryBrand<R, Name extends string> = QueryTableBrand<R, Name>;
|
|
88
90
|
/** Anything that can be a source or be joined: an entity table or a table-shaped subquery. */
|
|
89
91
|
type QuerySource = {
|
|
90
92
|
readonly [tableMgmt]: TableSourceBrand<string>;
|
|
91
93
|
} | {
|
|
92
|
-
readonly [subqueryBrand]:
|
|
94
|
+
readonly [subqueryBrand]: QueryTableBrand<any, string>;
|
|
93
95
|
};
|
|
94
96
|
/** A generated entity table or table-shaped subquery that supports `select: source`. */
|
|
95
97
|
type SelectableQuerySource = {
|
|
96
98
|
readonly [tableMgmt]: TableBrand<any, string>;
|
|
97
99
|
} | {
|
|
98
|
-
readonly [subqueryBrand]:
|
|
100
|
+
readonly [subqueryBrand]: QueryTableBrand<any, string>;
|
|
99
101
|
};
|
|
100
102
|
/**
|
|
101
103
|
* A join entry (see `InnerJoin`/`LeftJoin` in `Expr.ts`): the expanded `{ inner: b, on }` form, or the
|
|
@@ -117,7 +119,7 @@ type ResolvedJoins<F, J> = J extends QueryJoinList ? J : F extends TableFor<infe
|
|
|
117
119
|
* Entity-mode and scalar `query(...)` shapes are excluded: a CTE must be a table shape, so it needs
|
|
118
120
|
* columns.
|
|
119
121
|
*/
|
|
120
|
-
type WithSource =
|
|
122
|
+
type WithSource = QueryTable<unknown, string>;
|
|
121
123
|
/** One CTE or an array of them; an `undefined` entry prunes, like any other clause. */
|
|
122
124
|
type WithInput = WithSource | readonly (WithSource | undefined)[];
|
|
123
125
|
/** How a recursive CTE combines its two terms: `UNION ALL` keeps every row, `UNION` drops duplicates. */
|
|
@@ -227,7 +229,7 @@ type MutationKey = "insert" | "update" | "delete" | "values" | "set" | "returnin
|
|
|
227
229
|
* I.e. `{ from: a, select: { id: a.id } }` and its `query(...)` value can contribute Author IDs to a
|
|
228
230
|
* union. `{ from: a, select: a.id }` cannot: even one-column set operands must give that column a name.
|
|
229
231
|
*/
|
|
230
|
-
type SetOperand = Query<Record<string, SelectExpression> |
|
|
232
|
+
type SetOperand = Query<Record<string, SelectExpression> | QueryTable<unknown, string>> | QueryTable<unknown, string> | SetQuery<readonly SetOperand[]>;
|
|
231
233
|
/**
|
|
232
234
|
* SQL-shaped compound input; use `satisfies SetQuery` to retain the operands' literal row types.
|
|
233
235
|
*
|
|
@@ -364,7 +366,7 @@ type CheckSetQuery<Q extends SetQuery<readonly SetOperand[]>> = Q extends unknow
|
|
|
364
366
|
* I.e. an INSERT source with `select: { title: b.title }` and `ctes: [...]` must not silently discard the CTEs.
|
|
365
367
|
*/
|
|
366
368
|
type CheckReadQuery<Q> = SetOperand extends Q ? unknown : Q extends readonly unknown[] ? { readonly [I in keyof Q]: CheckReadQuery<Q[I]>; } : Q extends {
|
|
367
|
-
readonly [subqueryBrand]:
|
|
369
|
+
readonly [subqueryBrand]: QueryTableBrand<infer R, string>;
|
|
368
370
|
} ? { readonly [K in keyof Q]: K extends keyof R | typeof subqueryBrand ? unknown : never; } : Q extends {
|
|
369
371
|
readonly [entityQueryBrand]: unknown;
|
|
370
372
|
} ? { readonly [K in keyof Q]: K extends typeof entityQueryBrand ? unknown : never; } : Q extends {
|
|
@@ -450,13 +452,17 @@ type SqlExpressionValue<V> = Exclude<V, undefined> | (undefined extends V ? null
|
|
|
450
452
|
/**
|
|
451
453
|
* A table-shaped query: one `Expr` per select key, each tagged with the table's name as its `Src`,
|
|
452
454
|
* plus a brand carrying the row type. This is the direct analog of `Table<T>`: `Table<T>` maps physical
|
|
453
|
-
* columns to expressions, `
|
|
455
|
+
* columns to expressions, `QueryTable<Row, Name>` maps the inner query's select keys to expressions.
|
|
456
|
+
*
|
|
457
|
+
* It is a table, not only a subquery: the same value can be the `from`, be joined, or be a `with` entry.
|
|
454
458
|
*/
|
|
455
|
-
type
|
|
456
|
-
readonly [subqueryBrand]:
|
|
459
|
+
type QueryTable<R, Name extends string> = {
|
|
460
|
+
readonly [subqueryBrand]: QueryTableBrand<R, Name>;
|
|
457
461
|
} & { readonly [K in keyof R]: Expr<SqlExpressionValue<R[K]>, Name> & {
|
|
458
462
|
readonly [selectKeyBrand]: Extract<K, string>;
|
|
459
463
|
}; };
|
|
464
|
+
/** @deprecated Renamed to `QueryTable`; the value is a table shape, usable as a `with` entry too. */
|
|
465
|
+
type Subquery<R, Name extends string> = QueryTable<R, Name>;
|
|
460
466
|
/** An entity-mode query (`select: a`): runnable, but it has no columns to reference. */
|
|
461
467
|
type EntityQuery<T extends Entity> = {
|
|
462
468
|
readonly [entityQueryBrand]: {
|
|
@@ -481,7 +487,7 @@ type ScalarQuery<R> = Expr<SqlExpressionValue<R> | null, never> & {
|
|
|
481
487
|
* `em.query()` alike:
|
|
482
488
|
*
|
|
483
489
|
* const narrow = { from: a, select: { name: a.first_name } } satisfies Query;
|
|
484
|
-
* query(narrow); //
|
|
490
|
+
* query(narrow); // QueryTable<{ name: string }, "?">
|
|
485
491
|
*
|
|
486
492
|
* const widened: Query = { from: a, select: { name: a.first_name } };
|
|
487
493
|
* query(widened);
|
|
@@ -499,7 +505,7 @@ type QueryValue<S, J extends QueryJoinList, Name extends string> = S extends {
|
|
|
499
505
|
readonly [tableMgmt]: {
|
|
500
506
|
readonly __entity: infer T extends Entity;
|
|
501
507
|
};
|
|
502
|
-
} ? EntityQuery<T> : S extends ExprLike<unknown> ? ScalarQuery<QueryRow<S, J>> :
|
|
508
|
+
} ? EntityQuery<T> : S extends ExprLike<unknown> ? ScalarQuery<QueryRow<S, J>> : QueryTable<QueryRow<S, J>, Name>;
|
|
503
509
|
/** The names of every alias in scope for a query: the source alias plus every joined alias. */
|
|
504
510
|
type JoinedName<X> = X extends {
|
|
505
511
|
readonly inner: infer A;
|
|
@@ -558,7 +564,7 @@ type QueryArg<F extends QuerySource, S extends QuerySelect, J extends QueryJoinI
|
|
|
558
564
|
*/
|
|
559
565
|
declare function query<const Q extends SetQuery<readonly SetOperand[]>, Name extends string = "?">(q: Q & CheckSetQuery<Q> & {
|
|
560
566
|
as?: Name;
|
|
561
|
-
}):
|
|
567
|
+
}): QueryTable<SetQueryRow<Q>, Name>;
|
|
562
568
|
declare function query<F extends QuerySource, const S extends QuerySelect = never, J extends QueryJoinInput = [], Name extends string = "?">(q: QueryArg<F, S, J, Name>): QueryValue<S, ResolvedJoins<F, J>, Name>;
|
|
563
569
|
/**
|
|
564
570
|
* Builds a query value only when its user-supplied `where` or join-tree filters survive pruning.
|
|
@@ -594,7 +600,7 @@ declare function queryMaybe<F extends QuerySource, const S extends QuerySelect =
|
|
|
594
600
|
*
|
|
595
601
|
* Unlike `query()`, the name is required, because the step term must name it.
|
|
596
602
|
*/
|
|
597
|
-
declare function recursiveQuery<Name extends string, F extends QuerySource, const S extends QuerySelect, J extends QueryJoinInput>(name: Name, base: QueryArg<F, S, J, Name>, step: (self:
|
|
603
|
+
declare function recursiveQuery<Name extends string, F extends QuerySource, const S extends QuerySelect, J extends QueryJoinInput>(name: Name, base: QueryArg<F, S, J, Name>, step: (self: QueryTable<QueryRow<S, ResolvedJoins<F, J>>, Name>) => SetOperand, opts?: RecursiveOptions): QueryTable<QueryRow<S, ResolvedJoins<F, J>>, Name>;
|
|
598
604
|
/**
|
|
599
605
|
* Builds a SQL expression from a tagged template.
|
|
600
606
|
*
|
|
@@ -635,7 +641,7 @@ declare namespace sql {
|
|
|
635
641
|
* `EntityManager.query` runs the plan; this module deliberately does not import `EntityManager` (see
|
|
636
642
|
* `EntityHydrator`), so it parses and hands back `{ sql, bindings, decodeRows }` instead of executing.
|
|
637
643
|
*/
|
|
638
|
-
declare function
|
|
644
|
+
declare function parseRootQuery(arg: unknown): Plan;
|
|
639
645
|
/**
|
|
640
646
|
* Parses a read that sits inside another statement, i.e. an INSERT's SELECT source, so it resolves that
|
|
641
647
|
* statement's CTEs and shares its alias space instead of generating names that could collide with them.
|
|
@@ -689,9 +695,12 @@ declare class SubqueryHandle {
|
|
|
689
695
|
constructor(q: AnyReadQuery, recursive?: boolean);
|
|
690
696
|
get q(): AnyReadQuery;
|
|
691
697
|
/**
|
|
692
|
-
* Gives a recursive CTE its finished body.
|
|
693
|
-
*
|
|
694
|
-
*
|
|
698
|
+
* Gives a recursive CTE its finished body.
|
|
699
|
+
*
|
|
700
|
+
* `recursiveQuery(name, base, step)` cannot hand us the real body up front: it has to call `step` to
|
|
701
|
+
* get it, and `step` needs this handle first, because the recursive half of the query references the
|
|
702
|
+
* CTE's own columns. So the handle starts out holding `base` alone, and the real body, `base UNION
|
|
703
|
+
* step`, arrives here afterwards. Either way PostgreSQL takes the CTE's column names from `base`.
|
|
695
704
|
*/
|
|
696
705
|
setBody(q: AnyReadQuery): void;
|
|
697
706
|
get name(): string | undefined;
|
|
@@ -699,7 +708,19 @@ declare class SubqueryHandle {
|
|
|
699
708
|
columnKeys(): string[];
|
|
700
709
|
/** The inner expression behind `key`, for its decoder/encoder. */
|
|
701
710
|
columnExpr(key: string): BaseExpr;
|
|
702
|
-
/**
|
|
711
|
+
/**
|
|
712
|
+
* The output columns, in order, with the codec for each; worked out without generating any SQL.
|
|
713
|
+
*
|
|
714
|
+
* Cached, because the answer is expensive to work out and gets asked for a lot:
|
|
715
|
+
*
|
|
716
|
+
* - `queryOutput` re-checks the whole query, converts a `join: { books: ... }` relationship tree
|
|
717
|
+
* back into a flat list of joins, and repeats all of that for every operand of a set query.
|
|
718
|
+
* - A `query(...)` value has no real properties. `bookStats.n` runs a `Proxy` get that builds a new
|
|
719
|
+
* column expression, and building one needs this method's answer to find `n`. So selecting two of
|
|
720
|
+
* a value's columns asked for the whole shape twice, before parsing then asked a third time.
|
|
721
|
+
*
|
|
722
|
+
* `setBody` is the only thing that changes the shape, so it is the only thing that clears this.
|
|
723
|
+
*/
|
|
703
724
|
output(): QueryOutput;
|
|
704
725
|
column(key: string): SubqueryColumnExpr;
|
|
705
726
|
describe(): string;
|
|
@@ -812,6 +833,18 @@ declare function injectedConditions(source: {
|
|
|
812
833
|
* against the context first.
|
|
813
834
|
*/
|
|
814
835
|
declare function conditionToSql(cond: QueryCondition | undefined, ctx: Ctx, topLevel: boolean): SqlFragment | undefined;
|
|
836
|
+
/**
|
|
837
|
+
* Accepts only own enumerable POJO fields, so nothing a caller supplied can be silently ignored: the
|
|
838
|
+
* compilers read these POJOs back with `Object.entries`/`Object.keys`, which skip inherited,
|
|
839
|
+
* non-enumerable, and symbol keys, so a field hidden behind one of those would never reach the SQL.
|
|
840
|
+
* I.e. an UPDATE whose `set` carries `title` on a prototype would leave `title` unchanged and still
|
|
841
|
+
* report success.
|
|
842
|
+
*
|
|
843
|
+
* Conditions, mutation clauses, and assignment POJOs all share this rule; `allowed` may include symbol
|
|
844
|
+
* keys, i.e. a condition's predicate brand and SQL resolver. Read-query clauses instead use
|
|
845
|
+
* `validateQueryKeys`, which walks the prototype chain and reports mutation clauses by name.
|
|
846
|
+
*/
|
|
847
|
+
declare function checkPojoKeys(value: object, allowed: readonly PropertyKey[], description: string): void;
|
|
815
848
|
/**
|
|
816
849
|
* Names and parses each `with` entry, in declaration order.
|
|
817
850
|
*
|
|
@@ -824,6 +857,16 @@ declare function conditionToSql(cond: QueryCondition | undefined, ctx: Ctx, topL
|
|
|
824
857
|
declare function registerCtes(q: {
|
|
825
858
|
with?: WithInput;
|
|
826
859
|
}, ctx: Ctx, assigner: AliasAssigner): ParsedCte[];
|
|
860
|
+
/**
|
|
861
|
+
* Puts a statement's surviving `with` entries in front of it, dropping the ones nothing reads.
|
|
862
|
+
*
|
|
863
|
+
* `referenced` is the aliases the rest of the statement used. The WITH clause leads the statement, so
|
|
864
|
+
* its bindings lead the statement's bindings too.
|
|
865
|
+
*/
|
|
866
|
+
declare function prependCtes(ctes: ParsedCte[], referenced: Set<string>, sql: string, bindings: any[]): {
|
|
867
|
+
sql: string;
|
|
868
|
+
bindings: any[];
|
|
869
|
+
};
|
|
827
870
|
/**
|
|
828
871
|
* Drops the CTEs that nothing reads, given the aliases the rest of the statement referenced.
|
|
829
872
|
*
|
|
@@ -840,5 +883,5 @@ declare function pruneCtes(ctes: ParsedCte[], referenced: Set<string>): ParsedCt
|
|
|
840
883
|
*/
|
|
841
884
|
declare function withFragment(ctes: ParsedCte[]): SqlFragment;
|
|
842
885
|
//#endregion
|
|
843
|
-
export { CheckReadQuery, CheckScope, CheckSetQuery, Clauses, CompatibleValue, Ctx, EntityHydrator, EntityQuery, ExistsQuery, ExpressionOrderBy, MaybeNull, NameOf, NamedSelectExpression, NotWidened, OrderByDirection, OrderByKeys, ParsedCte, Plan, Query, QueryArg, QueryCondition, QueryJoin, QueryJoinInput, QueryJoinList, QueryOutput, QueryRow, QuerySelect, QuerySource, QueryValue, ReadQueryRow, RecursiveOptions, ResolvedJoins, ScalarQuery, SelectExpression, SetOperand, SetOperation, SetQuery, SetQueryRow, SqlExpressionValue, Subquery, SubqueryBrand, SubqueryHandle, WithInput, WithSource, conditionToSql, entityQueryBrand, injectedConditions, isReadQueryValue, parseNestedQuery,
|
|
886
|
+
export { CheckReadQuery, CheckScope, CheckSetQuery, Clauses, CompatibleValue, Ctx, EntityHydrator, EntityQuery, ExistsQuery, ExpressionOrderBy, MaybeNull, NameOf, NamedSelectExpression, NotWidened, OrderByDirection, OrderByKeys, ParsedCte, Plan, Query, QueryArg, QueryCondition, QueryJoin, QueryJoinInput, QueryJoinList, QueryOutput, QueryRow, QuerySelect, QuerySource, QueryTable, QueryTableBrand, QueryValue, ReadQueryRow, RecursiveOptions, ResolvedJoins, ScalarQuery, SelectExpression, SetOperand, SetOperation, SetQuery, SetQueryRow, SqlExpressionValue, Subquery, SubqueryBrand, SubqueryHandle, WithInput, WithSource, checkPojoKeys, conditionToSql, entityQueryBrand, injectedConditions, isReadQueryValue, parseNestedQuery, parseRootQuery, prependCtes, projectionToSql, pruneCtes, query, queryMaybe, recursiveQuery, registerCtes, scalarQueryBrand, sql, subqueryBrand, withFragment };
|
|
844
887
|
//# sourceMappingURL=query.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.cts","names":[],"sources":["../../../src/queries/sql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;;;;;;;;;EAoBzB,UAAU;EAIV,OAAO,cAAc;EAIrB;;;cAMI,2BAA2B;UAErB;UACA;UACA;EAHV,YACU,QAAQ,gBACR,aACA,OAAO;OAKZ;EAIL,MAAM,KAAK,cAAc;EAMzB,OAAO;EAIP,OAAO;MAIH,cAAc;MAId;MAIA;;;;;;;;;cAicO,eAAe;WAqBf,UAAU;UACX;UArBF;;;;;;UAMA;;;;;;UAMA;;UAEA;;UAEA;WACC,WAAS;EAElB,YACW,UAAU,eACX,QAAQ;;;;;EAOlB,SAAS,gBAAgB;;EAUzB,WAAW,gBAAgB;;EAK3B,WAAW;;;;;;;;EAcX,YAAY;;;;;;;MAUR,iBAAiB;EAIrB,iBAAiB,QAAQ;;EAKzB,aAAa;;;;;;;;;EAYb,OAAO;EASP,SAAS;EAWT,eAAe,MAAM,iBAAiB;;;UA2BvB;EACf;EACA,MAAM;;EAEN;;;;;;;;;;iBAoNc,mBACd;EAAU,MAAM;EAA4B;GAC5C,qCACC;;;;;;;iBAiSa,eAAe,MAAM,4BAA4B,KAAK,KAAK,oBAAoB;;;;;;;;;;;;iBAuI/E,cAAc,eAAe,kBAAkB,eAAe;;;;;;;;;;iBA0J9D,aAAa;EAAK,OAAO;GAAa,KAAK,KAAK,UAAU,gBAAgB;;;;;;;iBAmC1E,YACd,MAAM,aACN,YAAY,aACZ,aACA;EACG;EAAa;;;;;;;;;iBAcF,UAAU,MAAM,aAAa,YAAY,cAAc;;;;;;;iBAiBvD,aAAa,MAAM,cAAc"}
|
|
@@ -47,7 +47,7 @@ declare const subqueryBrand: unique symbol;
|
|
|
47
47
|
declare const entityQueryBrand: unique symbol;
|
|
48
48
|
declare const scalarQueryBrand: unique symbol;
|
|
49
49
|
/** A query(...) value with any projection, for EXISTS and NOT EXISTS predicates. */
|
|
50
|
-
type ExistsQuery =
|
|
50
|
+
type ExistsQuery = QueryTable<unknown, string> | EntityQuery<Entity> | {
|
|
51
51
|
readonly [scalarQueryBrand]: true;
|
|
52
52
|
};
|
|
53
53
|
/**
|
|
@@ -80,22 +80,24 @@ type QueryCondition = SqlPredicate | UnbrandedPredicate | (({
|
|
|
80
80
|
and?: never;
|
|
81
81
|
or?: never;
|
|
82
82
|
};
|
|
83
|
-
/** Phantom type information carried by a table-shaped
|
|
84
|
-
interface
|
|
83
|
+
/** Phantom type information carried by a table-shaped `query(...)` value. */
|
|
84
|
+
interface QueryTableBrand<R, Name extends string> {
|
|
85
85
|
readonly __row: R;
|
|
86
86
|
readonly __name: Name;
|
|
87
87
|
}
|
|
88
|
+
/** @deprecated Renamed to `QueryTableBrand`; a `query(...)` value is a table shape, not only a subquery. */
|
|
89
|
+
type SubqueryBrand<R, Name extends string> = QueryTableBrand<R, Name>;
|
|
88
90
|
/** Anything that can be a source or be joined: an entity table or a table-shaped subquery. */
|
|
89
91
|
type QuerySource = {
|
|
90
92
|
readonly [tableMgmt]: TableSourceBrand<string>;
|
|
91
93
|
} | {
|
|
92
|
-
readonly [subqueryBrand]:
|
|
94
|
+
readonly [subqueryBrand]: QueryTableBrand<any, string>;
|
|
93
95
|
};
|
|
94
96
|
/** A generated entity table or table-shaped subquery that supports `select: source`. */
|
|
95
97
|
type SelectableQuerySource = {
|
|
96
98
|
readonly [tableMgmt]: TableBrand<any, string>;
|
|
97
99
|
} | {
|
|
98
|
-
readonly [subqueryBrand]:
|
|
100
|
+
readonly [subqueryBrand]: QueryTableBrand<any, string>;
|
|
99
101
|
};
|
|
100
102
|
/**
|
|
101
103
|
* A join entry (see `InnerJoin`/`LeftJoin` in `Expr.ts`): the expanded `{ inner: b, on }` form, or the
|
|
@@ -117,7 +119,7 @@ type ResolvedJoins<F, J> = J extends QueryJoinList ? J : F extends TableFor<infe
|
|
|
117
119
|
* Entity-mode and scalar `query(...)` shapes are excluded: a CTE must be a table shape, so it needs
|
|
118
120
|
* columns.
|
|
119
121
|
*/
|
|
120
|
-
type WithSource =
|
|
122
|
+
type WithSource = QueryTable<unknown, string>;
|
|
121
123
|
/** One CTE or an array of them; an `undefined` entry prunes, like any other clause. */
|
|
122
124
|
type WithInput = WithSource | readonly (WithSource | undefined)[];
|
|
123
125
|
/** How a recursive CTE combines its two terms: `UNION ALL` keeps every row, `UNION` drops duplicates. */
|
|
@@ -227,7 +229,7 @@ type MutationKey = "insert" | "update" | "delete" | "values" | "set" | "returnin
|
|
|
227
229
|
* I.e. `{ from: a, select: { id: a.id } }` and its `query(...)` value can contribute Author IDs to a
|
|
228
230
|
* union. `{ from: a, select: a.id }` cannot: even one-column set operands must give that column a name.
|
|
229
231
|
*/
|
|
230
|
-
type SetOperand = Query<Record<string, SelectExpression> |
|
|
232
|
+
type SetOperand = Query<Record<string, SelectExpression> | QueryTable<unknown, string>> | QueryTable<unknown, string> | SetQuery<readonly SetOperand[]>;
|
|
231
233
|
/**
|
|
232
234
|
* SQL-shaped compound input; use `satisfies SetQuery` to retain the operands' literal row types.
|
|
233
235
|
*
|
|
@@ -364,7 +366,7 @@ type CheckSetQuery<Q extends SetQuery<readonly SetOperand[]>> = Q extends unknow
|
|
|
364
366
|
* I.e. an INSERT source with `select: { title: b.title }` and `ctes: [...]` must not silently discard the CTEs.
|
|
365
367
|
*/
|
|
366
368
|
type CheckReadQuery<Q> = SetOperand extends Q ? unknown : Q extends readonly unknown[] ? { readonly [I in keyof Q]: CheckReadQuery<Q[I]>; } : Q extends {
|
|
367
|
-
readonly [subqueryBrand]:
|
|
369
|
+
readonly [subqueryBrand]: QueryTableBrand<infer R, string>;
|
|
368
370
|
} ? { readonly [K in keyof Q]: K extends keyof R | typeof subqueryBrand ? unknown : never; } : Q extends {
|
|
369
371
|
readonly [entityQueryBrand]: unknown;
|
|
370
372
|
} ? { readonly [K in keyof Q]: K extends typeof entityQueryBrand ? unknown : never; } : Q extends {
|
|
@@ -450,13 +452,17 @@ type SqlExpressionValue<V> = Exclude<V, undefined> | (undefined extends V ? null
|
|
|
450
452
|
/**
|
|
451
453
|
* A table-shaped query: one `Expr` per select key, each tagged with the table's name as its `Src`,
|
|
452
454
|
* plus a brand carrying the row type. This is the direct analog of `Table<T>`: `Table<T>` maps physical
|
|
453
|
-
* columns to expressions, `
|
|
455
|
+
* columns to expressions, `QueryTable<Row, Name>` maps the inner query's select keys to expressions.
|
|
456
|
+
*
|
|
457
|
+
* It is a table, not only a subquery: the same value can be the `from`, be joined, or be a `with` entry.
|
|
454
458
|
*/
|
|
455
|
-
type
|
|
456
|
-
readonly [subqueryBrand]:
|
|
459
|
+
type QueryTable<R, Name extends string> = {
|
|
460
|
+
readonly [subqueryBrand]: QueryTableBrand<R, Name>;
|
|
457
461
|
} & { readonly [K in keyof R]: Expr<SqlExpressionValue<R[K]>, Name> & {
|
|
458
462
|
readonly [selectKeyBrand]: Extract<K, string>;
|
|
459
463
|
}; };
|
|
464
|
+
/** @deprecated Renamed to `QueryTable`; the value is a table shape, usable as a `with` entry too. */
|
|
465
|
+
type Subquery<R, Name extends string> = QueryTable<R, Name>;
|
|
460
466
|
/** An entity-mode query (`select: a`): runnable, but it has no columns to reference. */
|
|
461
467
|
type EntityQuery<T extends Entity> = {
|
|
462
468
|
readonly [entityQueryBrand]: {
|
|
@@ -481,7 +487,7 @@ type ScalarQuery<R> = Expr<SqlExpressionValue<R> | null, never> & {
|
|
|
481
487
|
* `em.query()` alike:
|
|
482
488
|
*
|
|
483
489
|
* const narrow = { from: a, select: { name: a.first_name } } satisfies Query;
|
|
484
|
-
* query(narrow); //
|
|
490
|
+
* query(narrow); // QueryTable<{ name: string }, "?">
|
|
485
491
|
*
|
|
486
492
|
* const widened: Query = { from: a, select: { name: a.first_name } };
|
|
487
493
|
* query(widened);
|
|
@@ -499,7 +505,7 @@ type QueryValue<S, J extends QueryJoinList, Name extends string> = S extends {
|
|
|
499
505
|
readonly [tableMgmt]: {
|
|
500
506
|
readonly __entity: infer T extends Entity;
|
|
501
507
|
};
|
|
502
|
-
} ? EntityQuery<T> : S extends ExprLike<unknown> ? ScalarQuery<QueryRow<S, J>> :
|
|
508
|
+
} ? EntityQuery<T> : S extends ExprLike<unknown> ? ScalarQuery<QueryRow<S, J>> : QueryTable<QueryRow<S, J>, Name>;
|
|
503
509
|
/** The names of every alias in scope for a query: the source alias plus every joined alias. */
|
|
504
510
|
type JoinedName<X> = X extends {
|
|
505
511
|
readonly inner: infer A;
|
|
@@ -558,7 +564,7 @@ type QueryArg<F extends QuerySource, S extends QuerySelect, J extends QueryJoinI
|
|
|
558
564
|
*/
|
|
559
565
|
declare function query<const Q extends SetQuery<readonly SetOperand[]>, Name extends string = "?">(q: Q & CheckSetQuery<Q> & {
|
|
560
566
|
as?: Name;
|
|
561
|
-
}):
|
|
567
|
+
}): QueryTable<SetQueryRow<Q>, Name>;
|
|
562
568
|
declare function query<F extends QuerySource, const S extends QuerySelect = never, J extends QueryJoinInput = [], Name extends string = "?">(q: QueryArg<F, S, J, Name>): QueryValue<S, ResolvedJoins<F, J>, Name>;
|
|
563
569
|
/**
|
|
564
570
|
* Builds a query value only when its user-supplied `where` or join-tree filters survive pruning.
|
|
@@ -594,7 +600,7 @@ declare function queryMaybe<F extends QuerySource, const S extends QuerySelect =
|
|
|
594
600
|
*
|
|
595
601
|
* Unlike `query()`, the name is required, because the step term must name it.
|
|
596
602
|
*/
|
|
597
|
-
declare function recursiveQuery<Name extends string, F extends QuerySource, const S extends QuerySelect, J extends QueryJoinInput>(name: Name, base: QueryArg<F, S, J, Name>, step: (self:
|
|
603
|
+
declare function recursiveQuery<Name extends string, F extends QuerySource, const S extends QuerySelect, J extends QueryJoinInput>(name: Name, base: QueryArg<F, S, J, Name>, step: (self: QueryTable<QueryRow<S, ResolvedJoins<F, J>>, Name>) => SetOperand, opts?: RecursiveOptions): QueryTable<QueryRow<S, ResolvedJoins<F, J>>, Name>;
|
|
598
604
|
/**
|
|
599
605
|
* Builds a SQL expression from a tagged template.
|
|
600
606
|
*
|
|
@@ -635,7 +641,7 @@ declare namespace sql {
|
|
|
635
641
|
* `EntityManager.query` runs the plan; this module deliberately does not import `EntityManager` (see
|
|
636
642
|
* `EntityHydrator`), so it parses and hands back `{ sql, bindings, decodeRows }` instead of executing.
|
|
637
643
|
*/
|
|
638
|
-
declare function
|
|
644
|
+
declare function parseRootQuery(arg: unknown): Plan;
|
|
639
645
|
/**
|
|
640
646
|
* Parses a read that sits inside another statement, i.e. an INSERT's SELECT source, so it resolves that
|
|
641
647
|
* statement's CTEs and shares its alias space instead of generating names that could collide with them.
|
|
@@ -689,9 +695,12 @@ declare class SubqueryHandle {
|
|
|
689
695
|
constructor(q: AnyReadQuery, recursive?: boolean);
|
|
690
696
|
get q(): AnyReadQuery;
|
|
691
697
|
/**
|
|
692
|
-
* Gives a recursive CTE its finished body.
|
|
693
|
-
*
|
|
694
|
-
*
|
|
698
|
+
* Gives a recursive CTE its finished body.
|
|
699
|
+
*
|
|
700
|
+
* `recursiveQuery(name, base, step)` cannot hand us the real body up front: it has to call `step` to
|
|
701
|
+
* get it, and `step` needs this handle first, because the recursive half of the query references the
|
|
702
|
+
* CTE's own columns. So the handle starts out holding `base` alone, and the real body, `base UNION
|
|
703
|
+
* step`, arrives here afterwards. Either way PostgreSQL takes the CTE's column names from `base`.
|
|
695
704
|
*/
|
|
696
705
|
setBody(q: AnyReadQuery): void;
|
|
697
706
|
get name(): string | undefined;
|
|
@@ -699,7 +708,19 @@ declare class SubqueryHandle {
|
|
|
699
708
|
columnKeys(): string[];
|
|
700
709
|
/** The inner expression behind `key`, for its decoder/encoder. */
|
|
701
710
|
columnExpr(key: string): BaseExpr;
|
|
702
|
-
/**
|
|
711
|
+
/**
|
|
712
|
+
* The output columns, in order, with the codec for each; worked out without generating any SQL.
|
|
713
|
+
*
|
|
714
|
+
* Cached, because the answer is expensive to work out and gets asked for a lot:
|
|
715
|
+
*
|
|
716
|
+
* - `queryOutput` re-checks the whole query, converts a `join: { books: ... }` relationship tree
|
|
717
|
+
* back into a flat list of joins, and repeats all of that for every operand of a set query.
|
|
718
|
+
* - A `query(...)` value has no real properties. `bookStats.n` runs a `Proxy` get that builds a new
|
|
719
|
+
* column expression, and building one needs this method's answer to find `n`. So selecting two of
|
|
720
|
+
* a value's columns asked for the whole shape twice, before parsing then asked a third time.
|
|
721
|
+
*
|
|
722
|
+
* `setBody` is the only thing that changes the shape, so it is the only thing that clears this.
|
|
723
|
+
*/
|
|
703
724
|
output(): QueryOutput;
|
|
704
725
|
column(key: string): SubqueryColumnExpr;
|
|
705
726
|
describe(): string;
|
|
@@ -812,6 +833,18 @@ declare function injectedConditions(source: {
|
|
|
812
833
|
* against the context first.
|
|
813
834
|
*/
|
|
814
835
|
declare function conditionToSql(cond: QueryCondition | undefined, ctx: Ctx, topLevel: boolean): SqlFragment | undefined;
|
|
836
|
+
/**
|
|
837
|
+
* Accepts only own enumerable POJO fields, so nothing a caller supplied can be silently ignored: the
|
|
838
|
+
* compilers read these POJOs back with `Object.entries`/`Object.keys`, which skip inherited,
|
|
839
|
+
* non-enumerable, and symbol keys, so a field hidden behind one of those would never reach the SQL.
|
|
840
|
+
* I.e. an UPDATE whose `set` carries `title` on a prototype would leave `title` unchanged and still
|
|
841
|
+
* report success.
|
|
842
|
+
*
|
|
843
|
+
* Conditions, mutation clauses, and assignment POJOs all share this rule; `allowed` may include symbol
|
|
844
|
+
* keys, i.e. a condition's predicate brand and SQL resolver. Read-query clauses instead use
|
|
845
|
+
* `validateQueryKeys`, which walks the prototype chain and reports mutation clauses by name.
|
|
846
|
+
*/
|
|
847
|
+
declare function checkPojoKeys(value: object, allowed: readonly PropertyKey[], description: string): void;
|
|
815
848
|
/**
|
|
816
849
|
* Names and parses each `with` entry, in declaration order.
|
|
817
850
|
*
|
|
@@ -824,6 +857,16 @@ declare function conditionToSql(cond: QueryCondition | undefined, ctx: Ctx, topL
|
|
|
824
857
|
declare function registerCtes(q: {
|
|
825
858
|
with?: WithInput;
|
|
826
859
|
}, ctx: Ctx, assigner: AliasAssigner): ParsedCte[];
|
|
860
|
+
/**
|
|
861
|
+
* Puts a statement's surviving `with` entries in front of it, dropping the ones nothing reads.
|
|
862
|
+
*
|
|
863
|
+
* `referenced` is the aliases the rest of the statement used. The WITH clause leads the statement, so
|
|
864
|
+
* its bindings lead the statement's bindings too.
|
|
865
|
+
*/
|
|
866
|
+
declare function prependCtes(ctes: ParsedCte[], referenced: Set<string>, sql: string, bindings: any[]): {
|
|
867
|
+
sql: string;
|
|
868
|
+
bindings: any[];
|
|
869
|
+
};
|
|
827
870
|
/**
|
|
828
871
|
* Drops the CTEs that nothing reads, given the aliases the rest of the statement referenced.
|
|
829
872
|
*
|
|
@@ -840,5 +883,5 @@ declare function pruneCtes(ctes: ParsedCte[], referenced: Set<string>): ParsedCt
|
|
|
840
883
|
*/
|
|
841
884
|
declare function withFragment(ctes: ParsedCte[]): SqlFragment;
|
|
842
885
|
//#endregion
|
|
843
|
-
export { CheckReadQuery, CheckScope, CheckSetQuery, Clauses, CompatibleValue, Ctx, EntityHydrator, EntityQuery, ExistsQuery, ExpressionOrderBy, MaybeNull, NameOf, NamedSelectExpression, NotWidened, OrderByDirection, OrderByKeys, ParsedCte, Plan, Query, QueryArg, QueryCondition, QueryJoin, QueryJoinInput, QueryJoinList, QueryOutput, QueryRow, QuerySelect, QuerySource, QueryValue, ReadQueryRow, RecursiveOptions, ResolvedJoins, ScalarQuery, SelectExpression, SetOperand, SetOperation, SetQuery, SetQueryRow, SqlExpressionValue, Subquery, SubqueryBrand, SubqueryHandle, WithInput, WithSource, conditionToSql, entityQueryBrand, injectedConditions, isReadQueryValue, parseNestedQuery,
|
|
886
|
+
export { CheckReadQuery, CheckScope, CheckSetQuery, Clauses, CompatibleValue, Ctx, EntityHydrator, EntityQuery, ExistsQuery, ExpressionOrderBy, MaybeNull, NameOf, NamedSelectExpression, NotWidened, OrderByDirection, OrderByKeys, ParsedCte, Plan, Query, QueryArg, QueryCondition, QueryJoin, QueryJoinInput, QueryJoinList, QueryOutput, QueryRow, QuerySelect, QuerySource, QueryTable, QueryTableBrand, QueryValue, ReadQueryRow, RecursiveOptions, ResolvedJoins, ScalarQuery, SelectExpression, SetOperand, SetOperation, SetQuery, SetQueryRow, SqlExpressionValue, Subquery, SubqueryBrand, SubqueryHandle, WithInput, WithSource, checkPojoKeys, conditionToSql, entityQueryBrand, injectedConditions, isReadQueryValue, parseNestedQuery, parseRootQuery, prependCtes, projectionToSql, pruneCtes, query, queryMaybe, recursiveQuery, registerCtes, scalarQueryBrand, sql, subqueryBrand, withFragment };
|
|
844
887
|
//# sourceMappingURL=query.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.mts","names":[],"sources":["../../../src/queries/sql/query.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2Ga;cACA;cACA;;KAGD,cAAc,
|
|
1
|
+
{"version":3,"file":"query.d.mts","names":[],"sources":["../../../src/queries/sql/query.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2Ga;cACA;cACA;;KAGD,cAAc,8BAA8B,YAAY;YAAsB;;;;;;;;;KAS9E,iBACR,eACA;EAEM,eAAe;EAA+B;EAAY;EAAgB;;EAC1E,cAAc;EAA+B;EAAa;EAAgB;;EAC1E;;EACJ,QAAQ;EAAyB;EAAmB;EAAa;;EACjE,WAAW;EAAyB;EAAgB;EAAa;;;UAGtD,gBAAgB,GAAG;WACzB,OAAO;WACP,QAAQ;;;KAIP,cAAc,GAAG,uBAAuB,gBAAgB,GAAG;;KAG3D;YACI,YAAY;;YACZ,gBAAgB;;;KAG3B;YACW,YAAY;;YACZ,gBAAgB;;;;;;;KAOpB,YAAY,UAAU,aAAa,kBAAkB,SAAS,aAAa;KAC3E,0BAA0B;;KAG1B,iBAAiB,gBAAgB,SAAS;;;;;KAM1C,cAAc,GAAG,KAAK,UAAU,gBACxC,IACA,UAAU,eAAe,UAAU,UACjC,YAAY,GAAG,kBAAiB,cACrB,QAAQ,GAAG;;;;;;;KAUhB,aAAa;;KAGb,YAAY,uBAAuB;;UAG9B;;EA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