joist-core 2.3.0-next.99 → 2.4.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/build/EntityManager.cjs +1 -1
- package/build/EntityManager.cjs.map +1 -1
- package/build/EntityManager.d.cts +9 -8
- package/build/EntityManager.d.cts.map +1 -1
- package/build/EntityManager.d.mts +9 -8
- package/build/EntityManager.d.mts.map +1 -1
- package/build/EntityManager.js +1 -1
- package/build/EntityManager.js.map +1 -1
- package/build/dataloaders/findCountDataLoader.cjs +2 -0
- package/build/dataloaders/findCountDataLoader.cjs.map +1 -1
- package/build/dataloaders/findCountDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findCountDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findCountDataLoader.js +2 -0
- package/build/dataloaders/findCountDataLoader.js.map +1 -1
- package/build/dataloaders/findDataLoader.cjs +1 -0
- package/build/dataloaders/findDataLoader.cjs.map +1 -1
- package/build/dataloaders/findDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findDataLoader.js +2 -1
- package/build/dataloaders/findDataLoader.js.map +1 -1
- package/build/dataloaders/findIdsDataLoader.cjs +2 -0
- package/build/dataloaders/findIdsDataLoader.cjs.map +1 -1
- package/build/dataloaders/findIdsDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findIdsDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findIdsDataLoader.js +2 -0
- package/build/dataloaders/findIdsDataLoader.js.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.cjs +2 -0
- package/build/dataloaders/findPaginatedDataLoader.cjs.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.js +2 -0
- package/build/dataloaders/findPaginatedDataLoader.js.map +1 -1
- package/build/index.cjs +6 -3
- package/build/index.cjs.map +1 -1
- package/build/index.d.cts +6 -4
- package/build/index.d.cts.map +1 -1
- package/build/index.d.mts +6 -4
- package/build/index.d.mts.map +1 -1
- package/build/index.js +6 -5
- package/build/index.js.map +1 -1
- package/build/keys.cjs +6 -1
- package/build/keys.cjs.map +1 -1
- package/build/keys.d.cts +3 -1
- package/build/keys.d.cts.map +1 -1
- package/build/keys.d.mts +3 -1
- package/build/keys.d.mts.map +1 -1
- package/build/keys.js +6 -2
- package/build/keys.js.map +1 -1
- package/build/queries/find/QueryParser.cjs +1 -2
- package/build/queries/find/QueryParser.cjs.map +1 -1
- package/build/queries/find/QueryParser.d.cts.map +1 -1
- package/build/queries/find/QueryParser.d.mts.map +1 -1
- package/build/queries/find/QueryParser.js +2 -3
- package/build/queries/find/QueryParser.js.map +1 -1
- package/build/queries/find/QueryVisitor.cjs +17 -0
- package/build/queries/find/QueryVisitor.cjs.map +1 -1
- package/build/queries/find/QueryVisitor.d.cts +3 -1
- package/build/queries/find/QueryVisitor.d.cts.map +1 -1
- package/build/queries/find/QueryVisitor.d.mts +3 -1
- package/build/queries/find/QueryVisitor.d.mts.map +1 -1
- package/build/queries/find/QueryVisitor.js +17 -1
- package/build/queries/find/QueryVisitor.js.map +1 -1
- package/build/queries/sql/Expr.cjs +18 -1
- package/build/queries/sql/Expr.cjs.map +1 -1
- package/build/queries/sql/Expr.d.cts +13 -3
- package/build/queries/sql/Expr.d.cts.map +1 -1
- package/build/queries/sql/Expr.d.mts +13 -3
- package/build/queries/sql/Expr.d.mts.map +1 -1
- package/build/queries/sql/Expr.js +18 -2
- package/build/queries/sql/Expr.js.map +1 -1
- package/build/queries/sql/JoinTree.cjs +72 -0
- package/build/queries/sql/JoinTree.cjs.map +1 -0
- package/build/queries/sql/JoinTree.d.cts +107 -0
- package/build/queries/sql/JoinTree.d.cts.map +1 -0
- package/build/queries/sql/JoinTree.d.mts +107 -0
- package/build/queries/sql/JoinTree.d.mts.map +1 -0
- package/build/queries/sql/JoinTree.js +71 -0
- package/build/queries/sql/JoinTree.js.map +1 -0
- package/build/queries/sql/Tables.cjs +103 -6
- package/build/queries/sql/Tables.cjs.map +1 -1
- package/build/queries/sql/Tables.d.cts +72 -13
- package/build/queries/sql/Tables.d.cts.map +1 -1
- package/build/queries/sql/Tables.d.mts +72 -13
- package/build/queries/sql/Tables.d.mts.map +1 -1
- package/build/queries/sql/Tables.js +101 -10
- package/build/queries/sql/Tables.js.map +1 -1
- package/build/queries/sql/custom.cjs +52 -0
- package/build/queries/sql/custom.cjs.map +1 -0
- package/build/queries/sql/custom.d.cts +85 -0
- package/build/queries/sql/custom.d.cts.map +1 -0
- package/build/queries/sql/custom.d.mts +85 -0
- package/build/queries/sql/custom.d.mts.map +1 -0
- package/build/queries/sql/custom.js +49 -0
- package/build/queries/sql/custom.js.map +1 -0
- package/build/queries/sql/execute.cjs +68 -28
- package/build/queries/sql/execute.cjs.map +1 -1
- package/build/queries/sql/execute.d.cts +110 -11
- package/build/queries/sql/execute.d.cts.map +1 -1
- package/build/queries/sql/execute.d.mts +110 -11
- package/build/queries/sql/execute.d.mts.map +1 -1
- package/build/queries/sql/execute.js +69 -29
- package/build/queries/sql/execute.js.map +1 -1
- package/build/queries/sql/expressions/types.d.cts +5 -5
- package/build/queries/sql/expressions/types.d.cts.map +1 -1
- package/build/queries/sql/expressions/types.d.mts +5 -5
- package/build/queries/sql/expressions/types.d.mts.map +1 -1
- package/build/queries/sql/keywords.cjs +1 -1
- package/build/queries/sql/keywords.cjs.map +1 -1
- package/build/queries/sql/keywords.d.cts +1 -1
- package/build/queries/sql/keywords.d.mts +1 -1
- package/build/queries/sql/keywords.js +1 -1
- package/build/queries/sql/keywords.js.map +1 -1
- package/build/queries/sql/query.cjs +100 -38
- package/build/queries/sql/query.cjs.map +1 -1
- package/build/queries/sql/query.d.cts +96 -46
- package/build/queries/sql/query.d.cts.map +1 -1
- package/build/queries/sql/query.d.mts +96 -46
- package/build/queries/sql/query.d.mts.map +1 -1
- package/build/queries/sql/query.js +102 -40
- package/build/queries/sql/query.js.map +1 -1
- package/build/queries/valueFilters.cjs +28 -36
- package/build/queries/valueFilters.cjs.map +1 -1
- package/build/queries/valueFilters.d.cts +2 -4
- package/build/queries/valueFilters.d.cts.map +1 -1
- package/build/queries/valueFilters.d.mts +2 -4
- package/build/queries/valueFilters.d.mts.map +1 -1
- package/build/queries/valueFilters.js +29 -36
- package/build/queries/valueFilters.js.map +1 -1
- package/build/serde/serde.cjs.map +1 -1
- package/build/serde/serde.js.map +1 -1
- package/package.json +2 -2
|
@@ -5,8 +5,9 @@ import { EntityMetadata } from "../../EntityMetadata.mjs";
|
|
|
5
5
|
import { AliasAssigner } from "./AliasAssigner.mjs";
|
|
6
6
|
import { CheckInput, ExprFromInput, ExprInput, ExpressionSources, ExpressionValue } from "./expressions/types.mjs";
|
|
7
7
|
import "./expressions/expression.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { Table, TableBrand, TableFor, TableSourceBrand, referenceJoinSource, tableMgmt } from "./Tables.mjs";
|
|
9
|
+
import { BaseExpr, Expr, ExprContext, ExprLike, InnerJoin, LeftJoin, SqlFragment, selectKeyBrand } from "./Expr.mjs";
|
|
10
|
+
import { CheckJoinInput, TreeEntries } from "./JoinTree.mjs";
|
|
10
11
|
import { Entity } from "../../Entity.mjs";
|
|
11
12
|
//#region src/queries/sql/query.d.ts
|
|
12
13
|
/**
|
|
@@ -23,10 +24,10 @@ import { Entity } from "../../Entity.mjs";
|
|
|
23
24
|
* select: { name: a.first_name, n: bookStats.n },
|
|
24
25
|
* orderBy: { n: "DESC" },
|
|
25
26
|
* });
|
|
26
|
-
* // rows: { name: string; n: number |
|
|
27
|
+
* // rows: { name: string; n: number | undefined }[] (undefined because of the LEFT join)
|
|
27
28
|
*
|
|
28
|
-
* `em.query(pojo)` runs it. `select` decides the row type: a bare table returns entities,
|
|
29
|
-
* `{ key: expr }` object returns typed POJOs, a bare subquery returns
|
|
29
|
+
* `em.query(pojo)` runs it. `select` decides the row type: a bare table returns entities, an array of
|
|
30
|
+
* columns or a `{ key: expr }` object returns typed POJOs, and a bare subquery returns its rows.
|
|
30
31
|
*
|
|
31
32
|
* `query(pojo)` turns the *same* POJO into a value: a derived table with typed columns, a scalar
|
|
32
33
|
* expression, or an entity list. It is the one non-POJO step, and the subquery analog of `table(Author)`:
|
|
@@ -86,6 +87,12 @@ interface SubqueryBrand<R, Name extends string> {
|
|
|
86
87
|
}
|
|
87
88
|
/** Anything that can be a source or be joined: an entity table or a table-shaped subquery. */
|
|
88
89
|
type QuerySource = {
|
|
90
|
+
readonly [tableMgmt]: TableSourceBrand<string>;
|
|
91
|
+
} | {
|
|
92
|
+
readonly [subqueryBrand]: SubqueryBrand<any, string>;
|
|
93
|
+
};
|
|
94
|
+
/** A generated entity table or table-shaped subquery that supports `select: source`. */
|
|
95
|
+
type SelectableQuerySource = {
|
|
89
96
|
readonly [tableMgmt]: TableBrand<any, string>;
|
|
90
97
|
} | {
|
|
91
98
|
readonly [subqueryBrand]: SubqueryBrand<any, string>;
|
|
@@ -96,7 +103,14 @@ type QuerySource = {
|
|
|
96
103
|
* form, since a subquery has no FK metadata.
|
|
97
104
|
*/
|
|
98
105
|
type QueryJoin = InnerJoin<QuerySource, QueryCondition> | LeftJoin<QuerySource, QueryCondition>;
|
|
99
|
-
type
|
|
106
|
+
type QueryJoinList = readonly (QueryJoin | undefined)[];
|
|
107
|
+
/** A flat SQL join list or a domain relationship tree rooted at from. */
|
|
108
|
+
type QueryJoinInput = QueryJoinList | Readonly<Record<string, unknown>>;
|
|
109
|
+
/**
|
|
110
|
+
* Resolves tree bindings to join types for scope and result nullability.
|
|
111
|
+
* Deferring the extracted entry union avoids expanding recursive constraints in generic query signatures.
|
|
112
|
+
*/
|
|
113
|
+
type ResolvedJoins<F, J> = J extends QueryJoinList ? J : F extends TableFor<infer T extends Entity> ? TreeEntries<T, J> extends (infer E) ? readonly Extract<E, QueryJoin>[] : never : [];
|
|
100
114
|
/**
|
|
101
115
|
* A CTE declaration: a `query(...)` value with named columns, i.e. a POJO or set-operation select.
|
|
102
116
|
*
|
|
@@ -111,7 +125,7 @@ interface RecursiveOptions {
|
|
|
111
125
|
/** Defaults to `"all"`. `"distinct"` emits UNION, which stops a cyclic graph from looping forever. */
|
|
112
126
|
union?: "all" | "distinct";
|
|
113
127
|
}
|
|
114
|
-
/** An expression order-by entry. An undefined order prunes
|
|
128
|
+
/** An expression order-by entry, also returned by `expr.asc()` and `expr.desc()`. An undefined order prunes it. */
|
|
115
129
|
type ExpressionOrderBy = {
|
|
116
130
|
readonly sort: ExprLike<unknown>;
|
|
117
131
|
readonly order: "ASC" | "DESC" | undefined;
|
|
@@ -124,9 +138,9 @@ type OrderByDirection = "ASC" | "DESC" | "ASC NULLS FIRST" | "ASC NULLS LAST" |
|
|
|
124
138
|
* The keys are the keys of a POJO/subquery `select` (rendered as SQL output-column names, so ordering
|
|
125
139
|
* by an aggregate does not repeat its expression), or the entity's sortable fields in entity mode.
|
|
126
140
|
* An `undefined` direction prunes the entry, like any other condition. For expressions that are not
|
|
127
|
-
* in `select`, mix in `{ sort, order }` entries in the array form.
|
|
141
|
+
* in `select`, mix in `expr.asc()`/`expr.desc()` or `{ sort, order }` entries in the array form.
|
|
128
142
|
*/
|
|
129
|
-
type OrderByKeys<S> = S extends {
|
|
143
|
+
type OrderByKeys<S> = S extends readonly NamedSelectExpression[] ? { readonly [K in SelectKey<S[number]>]?: OrderByDirection | undefined; } : S extends {
|
|
130
144
|
readonly [tableMgmt]: {
|
|
131
145
|
readonly __entity: infer T;
|
|
132
146
|
};
|
|
@@ -137,12 +151,20 @@ type OrderByKey<S> = S extends unknown ? keyof OrderByKeys<S> : never;
|
|
|
137
151
|
type CheckedExpressionOrderBy<S> = ExpressionOrderBy & (string extends OrderByKey<S> ? unknown : [S] extends [{
|
|
138
152
|
readonly [tableMgmt]: unknown;
|
|
139
153
|
}] ? unknown : { readonly [K in Exclude<OrderByKey<S>, keyof ExpressionOrderBy>]?: never; });
|
|
140
|
-
/** The
|
|
141
|
-
type QuerySelect =
|
|
154
|
+
/** The select shapes: a source, scalar expression, named column array, or POJO naming result columns. */
|
|
155
|
+
type QuerySelect = SelectableQuerySource | ExprLike<unknown> | readonly NamedSelectExpression[] | Record<string, SelectExpression>;
|
|
142
156
|
/** A named projection value may be an existing expression or an inline expression literal. */
|
|
143
157
|
type SelectExpression = ExprLike<unknown> | ExprInput;
|
|
158
|
+
/** A physical or subquery column that retains the field name used for array-select result rows. */
|
|
159
|
+
type NamedSelectExpression = ExprLike<unknown> & {
|
|
160
|
+
readonly [selectKeyBrand]: string;
|
|
161
|
+
};
|
|
162
|
+
/** Extracts the table property name carried by a column expression for array selects. */
|
|
163
|
+
type SelectKey<S> = S extends {
|
|
164
|
+
readonly [selectKeyBrand]: infer K extends string;
|
|
165
|
+
} ? K : never;
|
|
144
166
|
/** Checks expression literals only inside named projections. */
|
|
145
|
-
type CheckSelect<S> = S extends QuerySource | ExprLike<unknown> ? unknown : { readonly [K in keyof S]: S[K] extends ExprInput ? CheckInput<S[K]> : unknown; };
|
|
167
|
+
type CheckSelect<S> = S extends QuerySource | ExprLike<unknown> | readonly NamedSelectExpression[] ? unknown : { readonly [K in keyof S]: S[K] extends ExprInput ? CheckInput<S[K]> : unknown; };
|
|
146
168
|
/**
|
|
147
169
|
* Everything but the source, in SQL evaluation order: FROM/JOIN, WHERE, GROUP BY, HAVING, SELECT,
|
|
148
170
|
* ORDER BY, LIMIT.
|
|
@@ -150,7 +172,7 @@ type CheckSelect<S> = S extends QuerySource | ExprLike<unknown> ? unknown : { re
|
|
|
150
172
|
* `S` and `J` are generic so callers keep the literal shape of `select` and `join`; the defaults let
|
|
151
173
|
* a standalone object use `satisfies Query` (or `satisfies Clauses` for a source-less fragment).
|
|
152
174
|
*/
|
|
153
|
-
interface Clauses<S extends QuerySelect = QuerySelect, J extends
|
|
175
|
+
interface Clauses<S extends QuerySelect = QuerySelect, J extends QueryJoinInput = QueryJoinInput> {
|
|
154
176
|
/**
|
|
155
177
|
* CTEs to include in a `WITH` clause, declared as `query(...)` values; either a single value or an array.
|
|
156
178
|
*
|
|
@@ -160,13 +182,18 @@ interface Clauses<S extends QuerySelect = QuerySelect, J extends QueryJoins = Qu
|
|
|
160
182
|
* the same pruning `join` gets (see "Pruning"); `pruneJoins: false` keeps every CTE.
|
|
161
183
|
*/
|
|
162
184
|
with?: WithInput;
|
|
185
|
+
/** A flat join list, or a domain relationship tree rooted at the entity table in from. */
|
|
163
186
|
join?: J;
|
|
164
|
-
/**
|
|
165
|
-
|
|
187
|
+
/**
|
|
188
|
+
* An `{ and: [...] }` or `{ or: [...] }` group, an exists/notExists query, or a bare condition such as `a.age.gte(18)`.
|
|
189
|
+
*
|
|
190
|
+
* Arrays are shorthand for `{ and: [...] }`; undefined conditions are pruned.
|
|
191
|
+
*/
|
|
192
|
+
where?: QueryCondition | readonly (QueryCondition | undefined)[];
|
|
166
193
|
groupBy?: readonly ExprLike<any>[];
|
|
167
194
|
having?: QueryCondition;
|
|
168
195
|
select: S;
|
|
169
|
-
orderBy?: readonly (CheckedExpressionOrderBy<S> | OrderByKeys<S> | undefined)[] | OrderByKeys<S>;
|
|
196
|
+
orderBy?: readonly (CheckedExpressionOrderBy<S> | OrderByKeys<S> | undefined)[] | CheckedExpressionOrderBy<S> | OrderByKeys<S>;
|
|
170
197
|
limit?: number;
|
|
171
198
|
offset?: number;
|
|
172
199
|
distinct?: boolean;
|
|
@@ -181,7 +208,7 @@ interface Clauses<S extends QuerySelect = QuerySelect, J extends QueryJoins = Qu
|
|
|
181
208
|
softDeletes?: "include" | "exclude";
|
|
182
209
|
}
|
|
183
210
|
/** A whole query: `Clauses` plus its source. `query(q)` turns it into a value; `em.query(q)` runs it. */
|
|
184
|
-
interface Query<S extends QuerySelect = QuerySelect, J extends
|
|
211
|
+
interface Query<S extends QuerySelect = QuerySelect, J extends QueryJoinInput = QueryJoinInput> extends Clauses<S, J>, Partial<Record<SetOperation | MutationKey | "ctes", never>> {
|
|
185
212
|
from: QuerySource;
|
|
186
213
|
}
|
|
187
214
|
/**
|
|
@@ -246,7 +273,7 @@ type FirstOperand<Q> = OperandsOf<Q>[0];
|
|
|
246
273
|
* Resolves the named rows of an ordinary or compound read operand, including its LEFT join nullability.
|
|
247
274
|
*
|
|
248
275
|
* I.e. a query from Author `a` with a LEFT-joined Book `b` and `select: { title: b.title }` has row type
|
|
249
|
-
* `{ title: string |
|
|
276
|
+
* `{ title: string | undefined }`, even though Book.title is required. A reusable `query(...)` value already
|
|
250
277
|
* stores that row type in its brand; a nested compound combines its own operands recursively.
|
|
251
278
|
*/
|
|
252
279
|
type ReadQueryRow<Q> = SetOperand extends Q ? unknown : Q extends {
|
|
@@ -255,13 +282,13 @@ type ReadQueryRow<Q> = SetOperand extends Q ? unknown : Q extends {
|
|
|
255
282
|
};
|
|
256
283
|
} ? R : Q extends {
|
|
257
284
|
select: infer S;
|
|
258
|
-
} ? QueryRow<S, "join" extends keyof Q ? Extract<Q[keyof Q & "join"],
|
|
285
|
+
} ? QueryRow<S, ResolvedJoins<Q[keyof Q & "from"], "join" extends keyof Q ? Extract<Q[keyof Q & "join"], QueryJoinInput> : []>> : [OperandsOf<Q>] extends [never] ? never : SetQueryRow<Q>;
|
|
259
286
|
/**
|
|
260
287
|
* UNION combines each column's values; INTERSECT and EXCEPT conservatively retain the left row.
|
|
261
288
|
*
|
|
262
289
|
* I.e. Author first names projected as `{ name: string }` unioned with LEFT-joined Book titles projected
|
|
263
|
-
* as `{ name: string |
|
|
264
|
-
* left retains `{ name: string }`; it neither adds the right side's
|
|
290
|
+
* as `{ name: string | undefined }` produce `{ name: string | undefined }`. EXCEPT with those Author names on
|
|
291
|
+
* the left retains `{ name: string }`; it neither adds the right side's absence nor promises narrower values.
|
|
265
292
|
*
|
|
266
293
|
* The outer conditional distributes over a TypeScript union of alternative queries. I.e. a runtime
|
|
267
294
|
* choice between an Author-name UNION and a Book-order EXCEPT must retain `{ name: string } | { order: number }`.
|
|
@@ -343,7 +370,7 @@ type CheckReadQuery<Q> = SetOperand extends Q ? unknown : Q extends readonly unk
|
|
|
343
370
|
} ? { readonly [K in keyof Q]: K extends typeof entityQueryBrand ? unknown : never; } : Q extends {
|
|
344
371
|
readonly from: unknown;
|
|
345
372
|
readonly select: unknown;
|
|
346
|
-
} ? { readonly [K in keyof Q]: K extends "select" ? CheckSelect<Q[K]> : K extends keyof Clauses | "from" | "as" ? unknown : never; } : { readonly [K in keyof Q]: K extends SetOperation ? Q[K] extends readonly unknown[] ? CheckReadQuery<Q[K]> : unknown : K extends "with" | "orderBy" | "limit" | "offset" | "as" ? unknown : never; };
|
|
373
|
+
} ? CheckJoinInput<Q["from"], "join" extends keyof Q ? Exclude<Q[keyof Q & "join"], undefined> : []> & { readonly [K in keyof Q]: K extends "select" ? CheckSelect<Q[K]> : K extends keyof Clauses | "from" | "as" ? unknown : never; } : { readonly [K in keyof Q]: K extends SetOperation ? Q[K] extends readonly unknown[] ? CheckReadQuery<Q[K]> : unknown : K extends "with" | "orderBy" | "limit" | "offset" | "as" ? unknown : never; };
|
|
347
374
|
/** The type-level name of a table or subquery, i.e. `"Author"` or `"book_stats"`. */
|
|
348
375
|
type NameOf<A> = A extends {
|
|
349
376
|
readonly [tableMgmt]: {
|
|
@@ -369,30 +396,31 @@ type InheritedLeft<X, Left> = X extends {
|
|
|
369
396
|
type NullableSources<X, Left = LeftJoined<X>> = [Exclude<InheritedLeft<X, Left>, Left>] extends [never] ? Left : NullableSources<X, Left | InheritedLeft<X, Left>>;
|
|
370
397
|
/**
|
|
371
398
|
* Asks: is this expression's source key among the LEFT-joined sources in this query's join list? If
|
|
372
|
-
* yes,
|
|
399
|
+
* yes, SQL can return NULL, so `R` becomes `R | null`; if no, `R` is unchanged.
|
|
373
400
|
*
|
|
374
401
|
* I.e. `MaybeNull<number, "book_stats", [LeftJoin<typeof bookStats>]>` is `number | null`,
|
|
375
402
|
* because `book_stats` is in `NullableSources<J[number]>`; with an inner join it stays `number`.
|
|
376
403
|
* Default references from nullable sources are included transitively.
|
|
377
404
|
*
|
|
378
405
|
* Source-less expressions (`Src` is `never`, i.e. `b.id.count()`) are never nullified. Untracked ones
|
|
379
|
-
* (`Src` is `string`, i.e. a
|
|
406
|
+
* (`Src` is `string`, i.e. a table whose entity type is not statically known) might come from any left-joined table,
|
|
380
407
|
* so they are conservatively nullified whenever the query has a left join at all.
|
|
381
408
|
*
|
|
382
409
|
* `string` must never be a *table's* name: `Extract<"Author", string>` matches, so one left-joined
|
|
383
410
|
* table named `string` would nullify every column in the query. That is why anonymous subqueries
|
|
384
411
|
* share the literal sentinel `"?"` instead.
|
|
385
412
|
*/
|
|
386
|
-
type MaybeNull<R, Src extends string, J extends
|
|
413
|
+
type MaybeNull<R, Src extends string, J extends QueryJoinList> = string extends Src ? [NullableSources<J[number]>] extends [never] ? R : R | null : [Extract<Src, NullableSources<J[number]>>] extends [never] ? R : R | null;
|
|
387
414
|
/**
|
|
388
415
|
* The result row for a query with select `S` and joins `J`.
|
|
389
416
|
*
|
|
390
417
|
* - entity mode (`select: a`) is the entity
|
|
391
418
|
* - subquery mode (`select: bookStats`) is the subquery's row, i.e. `select *`
|
|
392
419
|
* - single expression (`select: b.id.count()`) is that expression's value, used by scalar subqueries
|
|
420
|
+
* - column array mode uses each column's field name as the result key
|
|
393
421
|
* - POJO mode is a mapped type over the select keys, with left-join nullability applied
|
|
394
422
|
*/
|
|
395
|
-
type QueryRow<S, J extends
|
|
423
|
+
type QueryRow<S, J extends QueryJoinList = []> = S extends {
|
|
396
424
|
readonly [tableMgmt]: {
|
|
397
425
|
readonly __entity: infer T;
|
|
398
426
|
};
|
|
@@ -400,7 +428,25 @@ type QueryRow<S, J extends QueryJoins = []> = S extends {
|
|
|
400
428
|
readonly [subqueryBrand]: {
|
|
401
429
|
readonly __row: infer R;
|
|
402
430
|
};
|
|
403
|
-
} ? R : S extends ExprLike<unknown> ? ExpressionValue<S, J> : { -readonly [K in keyof S]: S[K] extends SelectExpression ? ExpressionValue<S[K] extends ExprInput ? ExprFromInput<S[K]> : S[K], J
|
|
431
|
+
} ? R : S extends ExprLike<unknown> ? QueryResultValue<ExpressionValue<S, J>> : S extends readonly NamedSelectExpression[] ? { -readonly [E in S[number] as SelectKey<E>]: QueryResultValue<ExpressionValue<E, J>>; } : { -readonly [K in keyof S]: S[K] extends SelectExpression ? QueryResultValue<ExpressionValue<S[K] extends ExprInput ? ExprFromInput<S[K]> : S[K], J>> : never; };
|
|
432
|
+
/**
|
|
433
|
+
* Converts top-level SQL NULL to Joist's public undefined convention.
|
|
434
|
+
*
|
|
435
|
+
* Column metadata and expressions retain `T | null` because null is an explicit SQL value used by
|
|
436
|
+
* predicates, assignments, and functions such as COALESCE. Undefined instead means an omitted input.
|
|
437
|
+
* Keeping that distinction also lets reusable queries become SQL expressions without changing domains.
|
|
438
|
+
* The conversion therefore happens only at the executed-row boundary; nested array and JSON nulls remain null.
|
|
439
|
+
*/
|
|
440
|
+
type QueryResultValue<V> = Exclude<V, null> | (null extends V ? undefined : never);
|
|
441
|
+
/**
|
|
442
|
+
* Restores SQL NULL when a public query result is reused as an expression or mutation source.
|
|
443
|
+
*
|
|
444
|
+
* A future alternative is to retain both domains on every expression, i.e.
|
|
445
|
+
* `Expr<Sql, Src extends string = string, Result = QueryResultValue<Sql>>`. QueryRow could then use Result
|
|
446
|
+
* while predicates and reusable queries use Sql, avoiding this reverse conversion without making the
|
|
447
|
+
* common expression declaration verbose.
|
|
448
|
+
*/
|
|
449
|
+
type SqlExpressionValue<V> = Exclude<V, undefined> | (undefined extends V ? null : never);
|
|
404
450
|
/**
|
|
405
451
|
* A table-shaped query: one `Expr` per select key, each tagged with the table's name as its `Src`,
|
|
406
452
|
* plus a brand carrying the row type. This is the direct analog of `Table<T>`: `Table<T>` maps physical
|
|
@@ -408,7 +454,9 @@ type QueryRow<S, J extends QueryJoins = []> = S extends {
|
|
|
408
454
|
*/
|
|
409
455
|
type Subquery<R, Name extends string> = {
|
|
410
456
|
readonly [subqueryBrand]: SubqueryBrand<R, Name>;
|
|
411
|
-
} & { readonly [K in keyof R]: Expr<R[K]
|
|
457
|
+
} & { readonly [K in keyof R]: Expr<SqlExpressionValue<R[K]>, Name> & {
|
|
458
|
+
readonly [selectKeyBrand]: Extract<K, string>;
|
|
459
|
+
}; };
|
|
412
460
|
/** An entity-mode query (`select: a`): runnable, but it has no columns to reference. */
|
|
413
461
|
type EntityQuery<T extends Entity> = {
|
|
414
462
|
readonly [entityQueryBrand]: {
|
|
@@ -416,7 +464,7 @@ type EntityQuery<T extends Entity> = {
|
|
|
416
464
|
};
|
|
417
465
|
} & Partial<Record<MutationKey | "with" | "ctes", never>>;
|
|
418
466
|
/** A scalar/list query that remains distinguishable from ordinary expressions for EXISTS. */
|
|
419
|
-
type ScalarQuery<R> = Expr<R | null, never> & {
|
|
467
|
+
type ScalarQuery<R> = Expr<SqlExpressionValue<R> | null, never> & {
|
|
420
468
|
readonly [scalarQueryBrand]: true;
|
|
421
469
|
};
|
|
422
470
|
/**
|
|
@@ -447,7 +495,7 @@ type NotWidened<S> = QuerySelect extends S ? {
|
|
|
447
495
|
select: "select was typed too generically; use `satisfies Query` instead of `: Query`";
|
|
448
496
|
} : unknown;
|
|
449
497
|
/** What `query()` returns, by select shape: an entity list, a scalar/list subquery, or a derived table. */
|
|
450
|
-
type QueryValue<S, J extends
|
|
498
|
+
type QueryValue<S, J extends QueryJoinList, Name extends string> = S extends {
|
|
451
499
|
readonly [tableMgmt]: {
|
|
452
500
|
readonly __entity: infer T extends Entity;
|
|
453
501
|
};
|
|
@@ -458,7 +506,7 @@ type JoinedName<X> = X extends {
|
|
|
458
506
|
} ? NameOf<A> : X extends {
|
|
459
507
|
readonly left: infer A;
|
|
460
508
|
} ? NameOf<A> : never;
|
|
461
|
-
type InScope<F, J extends
|
|
509
|
+
type InScope<F, J extends QueryJoinList> = NameOf<F> | JoinedName<J[number]>;
|
|
462
510
|
/**
|
|
463
511
|
* Asks, for every column of a POJO select: is its source key among `from` + `join` at all? If no, the
|
|
464
512
|
* query reads from a table it never joined, and that select key's type becomes an error message.
|
|
@@ -474,18 +522,20 @@ type InScope<F, J extends QueryJoins> = NameOf<F> | JoinedName<J[number]>;
|
|
|
474
522
|
* `S` to `never` when `select` is missing, and a distributive conditional over `never` would swallow the
|
|
475
523
|
* whole parameter type.
|
|
476
524
|
*/
|
|
477
|
-
type CheckScope<S, F, J extends
|
|
525
|
+
type CheckScope<S, F, J extends QueryJoinInput> = [S] extends [never] ? unknown : [S] extends [QuerySource] ? NameOf<S> extends NameOf<F> ? unknown : {
|
|
478
526
|
select: `'${NameOf<S> & string}' is a joined source, not the from; select its columns individually`;
|
|
527
|
+
} : [S] extends [readonly NamedSelectExpression[]] ? {
|
|
528
|
+
select: { [K in keyof S]: CheckExpressionScope<S[K], InScope<F, ResolvedJoins<F, J>>>; };
|
|
479
529
|
} : [S] extends [Record<string, SelectExpression>] ? {
|
|
480
|
-
select: { [K in keyof S]: CheckExpressionScope<S[K], InScope<F, J
|
|
530
|
+
select: { [K in keyof S]: CheckExpressionScope<S[K], InScope<F, ResolvedJoins<F, J>>>; };
|
|
481
531
|
} : unknown;
|
|
482
532
|
/** Includes columns nested in inline CASE values and fallbacks in the existing scope check. */
|
|
483
533
|
type CheckExpressionScope<V, Scope> = string extends ExpressionSources<V> ? unknown : [Exclude<ExpressionSources<V>, Scope>] extends [never] ? unknown : `table '${Exclude<ExpressionSources<V>, Scope> & string}' is not in from/join`;
|
|
484
534
|
/** The one argument type `query()` and `em.query()` share: a `Query` POJO plus its source, name, and checks. */
|
|
485
|
-
type QueryArg<F extends QuerySource, S extends QuerySelect, J extends
|
|
535
|
+
type QueryArg<F extends QuerySource, S extends QuerySelect, J extends QueryJoinInput, Name extends string> = Query<S, J> & {
|
|
486
536
|
from: F;
|
|
487
537
|
as?: Name;
|
|
488
|
-
} & CheckScope<S, F, J> & NotWidened<S> & {
|
|
538
|
+
} & CheckScope<S, F, J> & NoInfer<CheckJoinInput<F, J>> & NotWidened<S> & {
|
|
489
539
|
select: CheckSelect<NoInfer<S>>;
|
|
490
540
|
};
|
|
491
541
|
/**
|
|
@@ -509,17 +559,17 @@ type QueryArg<F extends QuerySource, S extends QuerySelect, J extends QueryJoins
|
|
|
509
559
|
declare function query<const Q extends SetQuery<readonly SetOperand[]>, Name extends string = "?">(q: Q & CheckSetQuery<Q> & {
|
|
510
560
|
as?: Name;
|
|
511
561
|
}): Subquery<SetQueryRow<Q>, Name>;
|
|
512
|
-
declare function query<F extends QuerySource, const S extends QuerySelect = never, J extends
|
|
562
|
+
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>;
|
|
513
563
|
/**
|
|
514
|
-
* Builds a query value only when its user-supplied `where`
|
|
564
|
+
* Builds a query value only when its user-supplied `where` or join-tree filters survive pruning.
|
|
515
565
|
*
|
|
516
566
|
* Missing or empty conditions prune the value, including nested groups and `pruneIfUndefined`.
|
|
517
|
-
*
|
|
567
|
+
* Alias-only joins, HAVING, and implicit soft-delete/STI conditions do not keep the value alive.
|
|
518
568
|
*
|
|
519
569
|
* I.e. `queryMaybe({ from: b, where: b.authorId.eq(enabled ? a.id : undefined), select: b.id })`
|
|
520
570
|
* returns `undefined` when `enabled` is false, so an enclosing `notExists` also prunes.
|
|
521
571
|
*/
|
|
522
|
-
declare function queryMaybe<F extends QuerySource, const S extends QuerySelect = never, J extends
|
|
572
|
+
declare function queryMaybe<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> | undefined;
|
|
523
573
|
/**
|
|
524
574
|
* Declares a `WITH RECURSIVE` CTE from its two terms, and returns the CTE as a readable value.
|
|
525
575
|
*
|
|
@@ -544,7 +594,7 @@ declare function queryMaybe<F extends QuerySource, const S extends QuerySelect =
|
|
|
544
594
|
*
|
|
545
595
|
* Unlike `query()`, the name is required, because the step term must name it.
|
|
546
596
|
*/
|
|
547
|
-
declare function recursiveQuery<Name extends string, F extends QuerySource, const S extends QuerySelect, J extends
|
|
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: Subquery<QueryRow<S, ResolvedJoins<F, J>>, Name>) => SetOperand, opts?: RecursiveOptions): Subquery<QueryRow<S, ResolvedJoins<F, J>>, Name>;
|
|
548
598
|
/**
|
|
549
599
|
* Builds a SQL expression from a tagged template.
|
|
550
600
|
*
|
|
@@ -558,9 +608,9 @@ declare function recursiveQuery<Name extends string, F extends QuerySource, cons
|
|
|
558
608
|
* // Selecting this expression keeps the join to Book b.
|
|
559
609
|
* sql.number`${b.order} * ${2}`
|
|
560
610
|
*
|
|
561
|
-
* // Reference an unmodeled column;
|
|
562
|
-
*
|
|
563
|
-
* sql.condition`${
|
|
611
|
+
* // Reference an unmodeled column; prefer the table's own `column`, which keeps its source key.
|
|
612
|
+
* a.column<string>("ts_search")
|
|
613
|
+
* sql.condition`${a.column("ts_search")} @@ plainto_tsquery(${term})`
|
|
564
614
|
* ```
|
|
565
615
|
*/
|
|
566
616
|
declare function sql<R = unknown>(strings: TemplateStringsArray, ...values: unknown[]): Expr<R, never>;
|
|
@@ -578,7 +628,6 @@ declare namespace sql {
|
|
|
578
628
|
var booleanArray: (strings: TemplateStringsArray, ...values: unknown[]) => Expr<boolean[], never>;
|
|
579
629
|
var booleanArrayOrNull: (strings: TemplateStringsArray, ...values: unknown[]) => Expr<boolean[] | null, never>;
|
|
580
630
|
var condition: (strings: TemplateStringsArray, ...values: unknown[]) => SqlCondition;
|
|
581
|
-
var ref: <R = unknown>(source: QuerySource, column: string) => Expr<R, string>;
|
|
582
631
|
}
|
|
583
632
|
/**
|
|
584
633
|
* Parses `arg` (a `Query` POJO or `query(...)` value) into a runnable `Plan`.
|
|
@@ -598,7 +647,7 @@ declare function isReadQueryValue(arg: unknown): boolean;
|
|
|
598
647
|
* Compiles scalar or nonempty named expression projections, shared by SELECT and mutation RETURNING.
|
|
599
648
|
* Source-shaped values need read hydration/source rules and are deliberately excluded here.
|
|
600
649
|
*/
|
|
601
|
-
declare function projectionToSql(select: unknown, ctx: Ctx): {
|
|
650
|
+
declare function projectionToSql(select: unknown, ctx: Ctx, joins?: QueryJoinList): {
|
|
602
651
|
selects: SqlFragment[];
|
|
603
652
|
decodeRows: Plan["decodeRows"];
|
|
604
653
|
output: QueryOutput;
|
|
@@ -661,6 +710,7 @@ declare class SubqueryColumnExpr extends BaseExpr {
|
|
|
661
710
|
private key;
|
|
662
711
|
private inner;
|
|
663
712
|
constructor(handle: SubqueryHandle, key: string, inner: BaseExpr);
|
|
713
|
+
get [selectKeyBrand](): string;
|
|
664
714
|
toSql(ctx: ExprContext): SqlFragment;
|
|
665
715
|
decode(value: unknown): unknown;
|
|
666
716
|
encode(value: unknown): unknown;
|
|
@@ -790,5 +840,5 @@ declare function pruneCtes(ctes: ParsedCte[], referenced: Set<string>): ParsedCt
|
|
|
790
840
|
*/
|
|
791
841
|
declare function withFragment(ctes: ParsedCte[]): SqlFragment;
|
|
792
842
|
//#endregion
|
|
793
|
-
export { CheckReadQuery, CheckScope, CheckSetQuery, Clauses, CompatibleValue, Ctx, EntityHydrator, EntityQuery, ExistsQuery, ExpressionOrderBy, MaybeNull, NameOf, NotWidened, OrderByDirection, OrderByKeys, ParsedCte, Plan, Query, QueryArg, QueryCondition, QueryJoin,
|
|
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, parseUserQuery, projectionToSql, pruneCtes, query, queryMaybe, recursiveQuery, registerCtes, scalarQueryBrand, sql, subqueryBrand, withFragment };
|
|
794
844
|
//# sourceMappingURL=query.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.mts","names":[],"sources":["../../../src/queries/sql/query.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"query.d.mts","names":[],"sources":["../../../src/queries/sql/query.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2Ga;cACA;cACA;;KAGD,cAAc,4BAA4B,YAAY;YAAsB;;;;;;;;;KAS5E,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,cAAc,GAAG;WACvB,OAAO;WACP,QAAQ;;;KAIP;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;;EAEf;;;KAIU;WACD,MAAM;WACN;WACA;;KAGC;;;;;;;;;KAgBA,YAAY,KAEtB,mBAAmB,sCACH,KAAK,UAAU,cAAc,kCAEzC;YAAsB;aAAuB,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