query-builder-prisma 0.0.0-stage → 0.1.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.
@@ -0,0 +1,481 @@
1
+ /**
2
+ * Structural contracts — the ONLY knowledge this package has about Prisma.
3
+ *
4
+ * Nothing here imports Prisma. Any object exposing `findMany` + `count` with the
5
+ * standard Prisma delegate call shape satisfies these contracts — Prisma 5, 6, 7,
6
+ * 8, and (per ARCHITECTURE.md, invariant 2) any future version that keeps its
7
+ * public API.
8
+ */
9
+ /**
10
+ * Minimal structural contract every Prisma model delegate (e.g. `prisma.user`)
11
+ * already satisfies. Used only as an upper bound so the concrete delegate type is
12
+ * preserved at call sites while keeping our classes generic.
13
+ */
14
+ interface PrismaModelDelegate {
15
+ findMany: (...args: never[]) => unknown;
16
+ count: (...args: never[]) => unknown;
17
+ }
18
+ /** `findMany` arguments for the given delegate, derived from the delegate itself. */
19
+ type FindManyArgsOf<D extends PrismaModelDelegate> = NonNullable<Parameters<D['findMany']>[0]>;
20
+ /** `where` input of the model, derived from the delegate. */
21
+ type WhereOf<D extends PrismaModelDelegate> = NonNullable<FindManyArgsOf<D>['where']>;
22
+ /** `select` input of the model, derived from the delegate. */
23
+ type SelectOf<D extends PrismaModelDelegate> = NonNullable<FindManyArgsOf<D>['select']>;
24
+ /** `include` input of the model, derived from the delegate. */
25
+ type IncludeOf<D extends PrismaModelDelegate> = NonNullable<FindManyArgsOf<D>['include']>;
26
+ /** Scalar/relation keys that can be referenced from a model's `where` input. */
27
+ type WhereKeyOf<D extends PrismaModelDelegate> = keyof WhereOf<D> & string;
28
+ /** `orderBy` input of the model, derived from the delegate. */
29
+ type OrderByOf<D extends PrismaModelDelegate> = NonNullable<FindManyArgsOf<D>['orderBy']>;
30
+ /** Keys that can be used to order a model's results. */
31
+ type OrderKeyOf<D extends PrismaModelDelegate> = OrderByOf<D> extends infer O ? O extends readonly unknown[] ? keyof O[number] & string : keyof O & string : never;
32
+ /** The rows array `findMany` resolves to, derived from the delegate. */
33
+ type RowsOf<D extends PrismaModelDelegate> = Awaited<ReturnType<D['findMany']>>;
34
+ /** A single row of the model, derived from the delegate. */
35
+ type RowElementOf<D extends PrismaModelDelegate> = RowsOf<D> extends readonly (infer E)[] ? E : never;
36
+
37
+ /**
38
+ * Structural projection engine (ARCHITECTURE.md, invariant 3).
39
+ *
40
+ * Narrows the output type of `findMany` according to the accumulated
41
+ * `select`/`include` arguments — without importing a single Prisma type.
42
+ * Everything is derived from the model's own row type, which already encodes
43
+ * relation shapes, so this works on every Prisma version.
44
+ *
45
+ * Degradation rule: when Prisma's exact semantics can't be mirrored, the result
46
+ * is the *wider but correct* type — never a wrong one.
47
+ */
48
+
49
+ /** Keys of a select/include spec that are "on" (`true` or a nested spec). */
50
+ type TruthyKeys<S> = {
51
+ [K in keyof S]-?: NonNullable<S[K]> extends false ? never : K;
52
+ }[keyof S];
53
+ /**
54
+ * Apply a `select` spec to a row: only selected fields remain, nested selects
55
+ * recurse into relation element types.
56
+ */
57
+ type ApplySelect<Row, S> = {
58
+ [K in TruthyKeys<S> & keyof Row]: ProjectField<Row[K], S[K]>;
59
+ };
60
+ /**
61
+ * Apply an `include` spec to a row: all base fields stay, included relations are
62
+ * projected (recursively when the include carries a nested `select`), and a
63
+ * truthy `_count` widens in as `Record<string, number>` (audit F9 — the engine
64
+ * cannot know the selected relation keys, so it degrades wide, never wrong).
65
+ */
66
+ type ApplyInclude<Row, I> = Row & {
67
+ [K in TruthyKeys<I> & (keyof Row | '_count')]: K extends '_count' ? Record<string, number> : ProjectField<Row[K & keyof Row], I[K]>;
68
+ };
69
+ /** Project one field (`Field`) according to its select/include `Spec`. */
70
+ type ProjectField<Field, Spec> = Spec extends true ? Field : Spec extends {
71
+ select: infer Sub;
72
+ } ? ProjectNested<Field, Sub> : Spec extends {
73
+ include: infer Sub;
74
+ } ? ProjectNestedInclude<Field, Sub> : Field;
75
+ /**
76
+ * Project a relation field through a `select`. Only the selected keys remain.
77
+ * Lists map over their element; optionality (`| null | undefined`) is preserved
78
+ * exactly.
79
+ */
80
+ type ProjectNested<Field, Sub> = Field extends readonly (infer E)[] ? ApplySelect<E, Sub>[] : ApplySelect<NonNullable<Field>, Sub> | (undefined extends Field ? undefined : never) | (null extends Field ? null : never);
81
+ /**
82
+ * Project a relation field through an `include`. Unlike select, include keeps
83
+ * the relation's own fields — the element is intersected with its projection
84
+ * via `ApplyInclude` (audit F3). Lists map over their element; optionality is
85
+ * preserved exactly.
86
+ */
87
+ type ProjectNestedInclude<Field, Sub> = Field extends readonly (infer E)[] ? ApplyInclude<E, Sub>[] : ApplyInclude<NonNullable<Field>, Sub> | (undefined extends Field ? undefined : never) | (null extends Field ? null : never);
88
+ /**
89
+ * The row shape produced by a `findMany` call with the given accumulated args.
90
+ * With no `select`/`include`, this is the full model row (identity).
91
+ */
92
+ type ApplyProjection<Row, TArgs> = TArgs extends {
93
+ select: infer S;
94
+ } ? ApplySelect<Row, S> : TArgs extends {
95
+ include: infer I;
96
+ } ? ApplyInclude<Row, I> : Row;
97
+ /** The array a builder's `execute()` resolves to for the given delegate + args. */
98
+ type FindResultOf<D extends PrismaModelDelegate, TArgs> = ApplyProjection<RowElementOf<D>, TArgs>[];
99
+
100
+ /** Sort direction accepted by Prisma's `orderBy`. */
101
+ type SortOrder = 'asc' | 'desc';
102
+ /** Direction to walk through a cursor-paginated result set. */
103
+ type CursorDirection = 'forward' | 'backward';
104
+ /** A single numeric/date/string bound used by `QueryBuilder.range()`. */
105
+ type RangeBound = string | number | Date;
106
+ /** Open/closed bounds for one field path. Omitted bounds are skipped. */
107
+ interface RangeInput {
108
+ from?: RangeBound | undefined;
109
+ to?: RangeBound | undefined;
110
+ }
111
+ /** Offset pagination metadata returned by `executeWithMeta()`. */
112
+ interface PaginationMeta {
113
+ page: number;
114
+ limit: number;
115
+ total: number;
116
+ totalPage: number;
117
+ }
118
+ /**
119
+ * Metadata shape when `executeWithMeta({ includeTotal: false })` skips the
120
+ * `COUNT` query — the totals are unknown, not zero (audit G3).
121
+ */
122
+ interface PaginationMetaNoTotal {
123
+ page: number;
124
+ limit: number;
125
+ total: null;
126
+ totalPage: null;
127
+ }
128
+ /** Cursor pagination metadata returned by `executeWithCursor()`. */
129
+ interface CursorMeta {
130
+ limit: number;
131
+ /** Cursor to pass as `cursor` to fetch the next page (`null` if none). */
132
+ nextCursor: string | null;
133
+ /** Cursor to pass as `cursor` (with `direction: 'backward'`) for the previous page. */
134
+ prevCursor: string | null;
135
+ hasNextPage: boolean;
136
+ hasPrevPage: boolean;
137
+ }
138
+ /**
139
+ * A partial `where` whose values may also be `undefined`, so optional query
140
+ * params can be forwarded directly (they are stripped out at build time).
141
+ */
142
+ type FilterInput<D extends PrismaModelDelegate> = {
143
+ [K in WhereKeyOf<D>]?: WhereOf<D>[K] | undefined;
144
+ };
145
+
146
+ /**
147
+ * Per-database capability sets (ARCHITECTURE.md, invariant 4).
148
+ *
149
+ * Prisma-supported databases disagree on filter operators — most importantly,
150
+ * `mode: 'insensitive'` is only accepted on PostgreSQL, CockroachDB and MongoDB,
151
+ * and *throws* on MySQL, MariaDB, SQLite and SQL Server. Capability records let
152
+ * every builder method ask "what is allowed here?" instead of hardcoding
153
+ * database names.
154
+ */
155
+ interface DialectCapabilities {
156
+ /**
157
+ * Prisma accepts `mode: 'insensitive'` on string filters for this dialect
158
+ * (postgresql, cockroachdb, mongodb).
159
+ */
160
+ caseInsensitiveMode: boolean;
161
+ /**
162
+ * The database's default collation makes `contains` case-insensitive without
163
+ * any extra argument (mysql, mariadb, sqlserver). For sqlite this is `false`:
164
+ * ASCII `LIKE` is case-sensitive there, and Prisma offers no `mode`.
165
+ */
166
+ caseInsensitiveCollation: boolean;
167
+ }
168
+ /** Built-in capability sets, one per database Prisma supports (plus universal). */
169
+ declare const DIALECT_CAPABILITIES: {
170
+ postgresql: {
171
+ caseInsensitiveMode: true;
172
+ caseInsensitiveCollation: false;
173
+ };
174
+ cockroachdb: {
175
+ caseInsensitiveMode: true;
176
+ caseInsensitiveCollation: false;
177
+ };
178
+ mysql: {
179
+ caseInsensitiveMode: false;
180
+ caseInsensitiveCollation: true;
181
+ };
182
+ mariadb: {
183
+ caseInsensitiveMode: false;
184
+ caseInsensitiveCollation: true;
185
+ };
186
+ sqlite: {
187
+ caseInsensitiveMode: false;
188
+ caseInsensitiveCollation: false;
189
+ };
190
+ sqlserver: {
191
+ caseInsensitiveMode: false;
192
+ caseInsensitiveCollation: true;
193
+ };
194
+ mongodb: {
195
+ caseInsensitiveMode: true;
196
+ caseInsensitiveCollation: false;
197
+ };
198
+ /**
199
+ * Fallback used when no dialect is configured/detected. Only emits arguments
200
+ * that are valid on EVERY Prisma-supported database.
201
+ */
202
+ universal: {
203
+ caseInsensitiveMode: false;
204
+ caseInsensitiveCollation: false;
205
+ };
206
+ };
207
+ /** Names of the built-in dialects. */
208
+ type Dialect = keyof typeof DIALECT_CAPABILITIES;
209
+
210
+ /** Options accepted by the {@link QueryBuilder} constructor. */
211
+ interface QueryBuilderOptions<D extends PrismaModelDelegate> {
212
+ /** Seed `findMany` args, e.g. `{ where: { deletedAt: null } }` (prepended to every `where`). */
213
+ initialArgs?: FindManyArgsOf<D> | undefined;
214
+ /**
215
+ * Per-builder dialect override. When omitted: global `configureQueryBuilder()`
216
+ * config → registered auto-detector → `'universal'` (always-valid args).
217
+ */
218
+ dialect?: Dialect | undefined;
219
+ /**
220
+ * Throw on out-of-range pagination input instead of clamping silently:
221
+ * limits outside `[1, 1000]`, pages below 1, or a computed `skip` beyond
222
+ * `MAX_SKIP` (audits F12 / F18). Defaults to clamping.
223
+ */
224
+ strictNumbers?: boolean | undefined;
225
+ }
226
+ /** Meta type of {@link QueryBuilder.executeWithMeta} for the given options. */
227
+ type MetaOf<O extends {
228
+ includeTotal?: boolean;
229
+ }> = O['includeTotal'] extends false ? PaginationMetaNoTotal : PaginationMeta;
230
+ /** Thrown by {@link QueryBuilder.firstOrThrow} when no row matched. */
231
+ declare class NoResultError extends Error {
232
+ constructor();
233
+ }
234
+ /**
235
+ * Generic, reusable and fully type-safe query builder for any Prisma model
236
+ * delegate, on every Prisma version (see ARCHITECTURE.md).
237
+ *
238
+ * All option types (`where`, `select`, `include`, `orderBy`, ...) are inferred
239
+ * structurally from the delegate passed to the constructor — nothing is imported
240
+ * from Prisma, so no Prisma upgrade can ever break this class.
241
+ *
242
+ * The result type of `execute()` is narrowed by `.select()` / `.include()` via a
243
+ * structural projection engine, mirroring Prisma's own behaviour.
244
+ *
245
+ * @typeParam D - The Prisma model delegate, e.g. `typeof prisma.user`.
246
+ * @typeParam TArgs - Accumulated `findMany` args. Defaults to no projection.
247
+ *
248
+ * @example
249
+ * const result = await new QueryBuilder(prisma.user)
250
+ * .search({ searchText, fields: ['email', 'username'] })
251
+ * .filter({ role, status })
252
+ * .range({ createdAt: { from, to }, 'avatar.size': { from: min, to: max } })
253
+ * .sortBy({ sortBy: 'createdAt', sortOrder: 'desc' })
254
+ * .paginate({ page: 1, limit: 10 })
255
+ * .select({ id: true, email: true })
256
+ * .execute();
257
+ */
258
+ declare class QueryBuilder<D extends PrismaModelDelegate, TArgs = object> {
259
+ private readonly delegate;
260
+ private readonly dialect;
261
+ private readonly strictNumbers;
262
+ private readonly andConditions;
263
+ private customArgs;
264
+ /**
265
+ * The `initialArgs` seed `where` plus every `.custom({ where })`, AND-merged.
266
+ * Kept out of `customArgs` so a later `.custom({ where })` merges with the
267
+ * seed instead of replacing it (audit F2 — the seed carries safety filters).
268
+ */
269
+ private customWhere;
270
+ private orderByArg;
271
+ private selectArg;
272
+ private includeArg;
273
+ private page;
274
+ private limit;
275
+ private cursorActive;
276
+ private cursor;
277
+ private cursorLimit;
278
+ private cursorDirection;
279
+ private cursorField;
280
+ private cursorStrict;
281
+ /**
282
+ * @param delegate - The Prisma delegate to query (e.g. `prisma.user`).
283
+ * @param options - Optional seed args, a dialect override, or `strictNumbers`.
284
+ */
285
+ constructor(delegate: D, options?: QueryBuilderOptions<D>);
286
+ /**
287
+ * Case-insensitive `contains` across the provided string fields. No condition
288
+ * is added when `searchText` is empty or whitespace-only (audit G7).
289
+ *
290
+ * Dialect-aware: adds `mode: 'insensitive'` only where Prisma accepts it (see
291
+ * `caseInsensitiveMode` in `src/dialects/capabilities.ts`); everywhere else
292
+ * the bare `contains` relies on the database's collation, and where that is
293
+ * ASCII-only matching stays case-sensitive — Prisma offers no alternative
294
+ * there.
295
+ */
296
+ search(params: {
297
+ searchText?: string | undefined;
298
+ fields: WhereKeyOf<D>[];
299
+ }): this;
300
+ /**
301
+ * Adds an equality/operator filter. Accepts a partial Prisma `where` object;
302
+ * `undefined` values are ignored so optional query params are safe to pass.
303
+ */
304
+ filter(filters: FilterInput<D>): this;
305
+ /**
306
+ * Adds `gte`/`lte` range conditions. Keys may be dot-paths to reach relations
307
+ * or nested objects (e.g. `'avatar.size'`). Bounds left `undefined` are
308
+ * skipped; a field is only added when at least one bound is present.
309
+ */
310
+ range(ranges: Record<string, RangeInput>): this;
311
+ /** Adds an arbitrary, fully-typed Prisma `where` condition. */
312
+ where(condition: WhereOf<D>): this;
313
+ /**
314
+ * Sets `orderBy` from a single key. No-op when `sortBy` is not provided.
315
+ * Dot paths expand like `.range()` (`'avatar.size'` → `{ avatar: { size } }`,
316
+ * audit F6). For multi-key or nested relation sorts use {@link orderBy}.
317
+ */
318
+ sortBy(params: {
319
+ sortBy?: OrderKeyOf<D> | (string & {});
320
+ sortOrder?: SortOrder;
321
+ }): this;
322
+ /**
323
+ * Sets `orderBy` verbatim from the full Prisma shape: arrays for multi-key
324
+ * sorts, nested relation order objects. `.sortBy()` remains the single-key
325
+ * convenience — the latest of the two calls wins (audit G1).
326
+ */
327
+ orderBy(order: OrderByOf<D>): this;
328
+ /** Configures `skip`/`take` from a 1-based page number and page size. */
329
+ paginate(params: {
330
+ page?: number;
331
+ limit?: number;
332
+ }): this;
333
+ /**
334
+ * Configures cursor-based ("seek") pagination. Use {@link executeWithCursor}
335
+ * to run the query and obtain `next`/`prev` cursors.
336
+ *
337
+ * - `cursor` is the value of `cursorField` from the edge row of the previous
338
+ * page (omit it for the first page). Strings, numbers and Dates are
339
+ * accepted; Dates serialize to ISO-8601 in the returned cursors (audit F4).
340
+ * - `direction` walks `'forward'` (next) or `'backward'` (previous).
341
+ * - `cursorField` is the unique, sequential column to seek on (default `id`).
342
+ * Pair it with a matching {@link sortBy} for stable ordering.
343
+ * - `strict` spends one extra 1-row probe query to make `hasNextPage` /
344
+ * `hasPrevPage` exact instead of optimistic (audit F10).
345
+ *
346
+ * Takes precedence over {@link paginate} when both are set.
347
+ */
348
+ cursorPaginate(params: {
349
+ cursor?: string | number | Date | undefined;
350
+ limit?: number;
351
+ direction?: CursorDirection;
352
+ cursorField?: OrderKeyOf<D> | (string & {});
353
+ strict?: boolean;
354
+ }): this;
355
+ /**
356
+ * Projects fields with Prisma `select`. The result type of `execute()` is
357
+ * narrowed to exactly the selected shape. Clears any active `.include()`.
358
+ */
359
+ select<TSelect extends SelectOf<D>>(select: TSelect): QueryBuilder<D, Omit<TArgs, 'select' | 'include'> & {
360
+ select: TSelect;
361
+ }>;
362
+ /**
363
+ * Eager-loads relations with Prisma `include`. The result type of `execute()`
364
+ * is widened with the included relations. Clears any active `.select()`.
365
+ */
366
+ include<TInclude extends IncludeOf<D>>(include: TInclude): QueryBuilder<D, Omit<TArgs, 'select' | 'include'> & {
367
+ include: TInclude;
368
+ }>;
369
+ /**
370
+ * Merges raw `findMany` args, e.g. `cursor`, `distinct` or a custom `where`.
371
+ * Values that are `undefined` are stripped at any depth, so
372
+ * `custom({ distinct: undefined })` cannot overwrite an earlier value
373
+ * (audit F15). A custom `where` is AND-ed with the `initialArgs` seed and any
374
+ * previous custom `where` — it never replaces them (audit F2). Successive
375
+ * custom `where`s may nest `{ AND: [...] }` groups; Prisma treats that
376
+ * identically.
377
+ */
378
+ custom(args: FindManyArgsOf<D>): this;
379
+ /** The fully assembled `findMany` args. Useful for debugging or reuse. */
380
+ buildArgs(): FindManyArgsOf<D>;
381
+ /**
382
+ * Executes the query and returns the rows, typed from `.select()`/`.include()`.
383
+ *
384
+ * Tip: for 100% Prisma-native inference you can always run the passthrough
385
+ * `prisma.user.findMany(qb.buildArgs())` — same args, Prisma's own overloads.
386
+ */
387
+ execute(): Promise<FindResultOf<D, TArgs>>;
388
+ /** Executes the query and returns the first row, or `null` when none matched. */
389
+ first(): Promise<ApplyProjection<RowElementOf<D>, TArgs> | null>;
390
+ /** Like {@link first}, but throws {@link NoResultError} when nothing matched. */
391
+ firstOrThrow(): Promise<ApplyProjection<RowElementOf<D>, TArgs>>;
392
+ /** Counts rows matching the current filters (ignores pagination/projection). */
393
+ count(): Promise<number>;
394
+ /**
395
+ * Executes the query and returns the rows plus offset pagination metadata.
396
+ * When no pagination was configured, defaults to page 1, limit 10 so `meta`
397
+ * always describes the data actually returned. `count` and `findMany` run in
398
+ * parallel.
399
+ *
400
+ * Pass `{ includeTotal: false }` to skip the `COUNT` query entirely — `meta`
401
+ * then carries `total: null` / `totalPage: null` (audit G3).
402
+ *
403
+ * Throws when cursor pagination is configured — offset meta cannot describe a
404
+ * seek query, and the cursor over-fetch row would leak into `data` (audit F1).
405
+ * Use {@link executeWithCursor} instead.
406
+ */
407
+ executeWithMeta<O extends {
408
+ includeTotal?: boolean;
409
+ } = {
410
+ includeTotal?: boolean;
411
+ }>(opts?: O): Promise<{
412
+ meta: MetaOf<O>;
413
+ data: FindResultOf<D, TArgs>;
414
+ }>;
415
+ /**
416
+ * Executes a cursor-paginated query (see {@link cursorPaginate}) and returns
417
+ * the page rows plus `next`/`prev` cursors. Rows are always returned in the
418
+ * configured sort order, regardless of pagination `direction`.
419
+ *
420
+ * Throws when a `.select()` projection drops `cursorField` — the page cursors
421
+ * are derived from that field and would come out as `undefined` (audit F5).
422
+ */
423
+ executeWithCursor(): Promise<{
424
+ meta: CursorMeta;
425
+ data: FindResultOf<D, TArgs>;
426
+ }>;
427
+ /** strictNumbers: out-of-range limits throw instead of clamping (audit F12). */
428
+ private assertLimit;
429
+ private assertPage;
430
+ /** strictNumbers: a computed skip beyond MAX_SKIP throws (audit F18). */
431
+ private assertSkipCap;
432
+ /** A projection without the cursor field would derive cursors from `undefined` (audit F5). */
433
+ private assertCursorFieldProjected;
434
+ private buildWhere;
435
+ }
436
+
437
+ /**
438
+ * Register capabilities for a database - including ones Prisma adds in the
439
+ * future. No core code changes are ever required to support a new dialect.
440
+ */
441
+ declare function registerDialect(name: string, capabilities: DialectCapabilities): void;
442
+ /** Set the global default dialect for all builders that do not override it. */
443
+ declare function configureQueryBuilder(options: {
444
+ dialect?: string | undefined;
445
+ }): void;
446
+ /**
447
+ * Plug in an auto-detector (best-effort). It must never throw; an undefined
448
+ * result simply falls through to the built-in detector and then 'universal'.
449
+ */
450
+ declare function setDialectDetector(detector: () => string | undefined): void;
451
+ /** A dialect name plus the capabilities resolved for it. */
452
+ interface ResolvedDialect {
453
+ name: string;
454
+ capabilities: DialectCapabilities;
455
+ }
456
+ /**
457
+ * Resolve the active dialect per the documented precedence. An unregistered
458
+ * name resolves to `'universal'` — the reported name never lies about the
459
+ * capabilities actually applied (audit G8).
460
+ */
461
+ declare function resolveDialect(explicit?: string | undefined): ResolvedDialect;
462
+ /** Test helper: reset global configuration (registry entries are kept). */
463
+ declare function resetDialectConfig(): void;
464
+
465
+ /**
466
+ * Best-effort dialect auto-detection (M2 scope).
467
+ *
468
+ * v0 intentionally detects nothing and returns `undefined` → callers fall
469
+ * through to `'universal'`, which never emits an invalid argument on any
470
+ * database. Future heuristics (guarded property sniffing of the Prisma client)
471
+ * must keep the same contract: NEVER throw, NEVER guess wrong loudly — an
472
+ * unknown dialect must degrade to `'universal'`, not to a wrong guess.
473
+ *
474
+ * Users who know their database should prefer explicit configuration:
475
+ * configureQueryBuilder({ dialect: 'postgres' })
476
+ * or per builder:
477
+ * new QueryBuilder(prisma.user, { dialect: 'mongodb' })
478
+ */
479
+ declare function detectDialect(): Dialect | undefined;
480
+
481
+ export { type ApplyInclude, type ApplyProjection, type ApplySelect, type CursorDirection, type CursorMeta, DIALECT_CAPABILITIES, type Dialect, type DialectCapabilities, type FilterInput, type FindManyArgsOf, type FindResultOf, type IncludeOf, NoResultError, type OrderByOf, type OrderKeyOf, type PaginationMeta, type PaginationMetaNoTotal, type PrismaModelDelegate, QueryBuilder, type QueryBuilderOptions, type RangeBound, type RangeInput, type ResolvedDialect, type RowElementOf, type RowsOf, type SelectOf, type SortOrder, type WhereKeyOf, type WhereOf, configureQueryBuilder, detectDialect, registerDialect, resetDialectConfig, resolveDialect, setDialectDetector };