@prisma/orm-family-sql 8.0.0-rc.18-dev.3 → 8.0.0-rc.18-dev.5

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.
Files changed (49) hide show
  1. package/dist/builder.d.mts +1 -1
  2. package/dist/builder__runtime.d.mts +3 -3
  3. package/dist/builder__runtime.mjs +1 -1
  4. package/dist/builder__types.d.mts +3 -2
  5. package/dist/collection-methods-BnR4UjcW-tiz3frtf.d.mts +77 -0
  6. package/dist/collection-methods-BnR4UjcW-tiz3frtf.d.mts.map +1 -0
  7. package/dist/collection-methods-DoBrRR69.d.mts +1 -0
  8. package/dist/{db-BmrN9nRS-DEogPltL.d.mts → db-BmrN9nRS-CDq1n2be.d.mts} +3 -2
  9. package/dist/db-BmrN9nRS-CDq1n2be.d.mts.map +1 -0
  10. package/dist/{index-qr6LA3dl.d.mts → index-CmKqLvvO.d.mts} +4 -4
  11. package/dist/{index-qr6LA3dl.d.mts.map → index-CmKqLvvO.d.mts.map} +1 -1
  12. package/dist/{index-reference-CflkzYSd.d.mts → index-reference-DJX-CNsb-D2qUlYq2.d.mts} +12 -3
  13. package/dist/index-reference-DJX-CNsb-D2qUlYq2.d.mts.map +1 -0
  14. package/dist/{index-reference-D693Lu-E.mjs → index-reference-DR62gjQS.mjs} +16 -3
  15. package/dist/index-reference-DR62gjQS.mjs.map +1 -0
  16. package/dist/index-reference-ZZrszBDq.d.mts +1 -0
  17. package/dist/orm-client.d.mts +63 -17
  18. package/dist/orm-client.d.mts.map +1 -1
  19. package/dist/orm-client.mjs +349 -341
  20. package/dist/orm-client.mjs.map +1 -1
  21. package/dist/{prepared-statement-Bs9TKj5u-CInk8vXF.d.mts → prepared-statement-BwHkxfuI-CKkkrS6r.d.mts} +9 -6
  22. package/dist/prepared-statement-BwHkxfuI-CKkkrS6r.d.mts.map +1 -0
  23. package/dist/{query-lane-context-C2AXsoFa-COSQOvZz.d.mts → query-lane-context-C42-u9L1-Bxa4DkI_.d.mts} +7 -2
  24. package/dist/query-lane-context-C42-u9L1-Bxa4DkI_.d.mts.map +1 -0
  25. package/dist/query-lane-context-DW5q2RAY.d.mts +1 -0
  26. package/dist/relational-core.d.mts +3 -3
  27. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  28. package/dist/relational-core__codec-descriptor-registry.d.mts +1 -1
  29. package/dist/relational-core__collection-methods.d.mts +3 -0
  30. package/dist/relational-core__collection-methods.mjs +1 -0
  31. package/dist/relational-core__index-reference.d.mts +3 -2
  32. package/dist/relational-core__index-reference.mjs +2 -2
  33. package/dist/relational-core__query-lane-context.d.mts +2 -2
  34. package/dist/relational-core__types.d.mts +2 -2
  35. package/dist/runtime.d.mts +3 -3
  36. package/dist/runtime.mjs +2 -1
  37. package/dist/runtime.mjs.map +1 -1
  38. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  39. package/dist/types-BkA6tyT-.d.mts +1 -0
  40. package/dist/{types-D09NAayg-CNrpjo7Z.d.mts → types-Cl4MLNrS-lbf-K25i.d.mts} +3 -3
  41. package/dist/{types-D09NAayg-CNrpjo7Z.d.mts.map → types-Cl4MLNrS-lbf-K25i.d.mts.map} +1 -1
  42. package/package.json +19 -18
  43. package/dist/db-BmrN9nRS-DEogPltL.d.mts.map +0 -1
  44. package/dist/index-reference-CflkzYSd.d.mts.map +0 -1
  45. package/dist/index-reference-D693Lu-E.mjs.map +0 -1
  46. package/dist/prepared-statement-Bs9TKj5u-CInk8vXF.d.mts.map +0 -1
  47. package/dist/query-lane-context-BsZs5lvB.d.mts +0 -1
  48. package/dist/query-lane-context-C2AXsoFa-COSQOvZz.d.mts.map +0 -1
  49. package/dist/types-DAkmn9FV.d.mts +0 -1
@@ -1,4 +1,4 @@
1
1
  import { o as Expression, x as ScopeField } from "./expression-Ck1wys3N-RNyviMcU.mjs";
2
2
  import { a as Subquery, r as Functions } from "./functions-CJ8Yf8uL.mjs";
3
- import { C as WhereFilter, S as UpdateQuery, d as QueryContext, g as SelectQuery, h as Scope, i as DeleteQuery, l as InsertQuery, m as ResolveRow, o as GatedMethod, r as Db, s as GroupedQuery, t as AggregateFunctions, y as TableProxy } from "./db-BmrN9nRS-DEogPltL.mjs";
3
+ import { C as WhereFilter, S as UpdateQuery, d as QueryContext, g as SelectQuery, h as Scope, i as DeleteQuery, l as InsertQuery, m as ResolveRow, o as GatedMethod, r as Db, s as GroupedQuery, t as AggregateFunctions, y as TableProxy } from "./db-BmrN9nRS-CDq1n2be.mjs";
4
4
  export type { AggregateFunctions, Db, DeleteQuery, Expression, Functions, GatedMethod, GroupedQuery, InsertQuery, QueryContext, ResolveRow, Scope, ScopeField, SelectQuery, Subquery, TableProxy, UpdateQuery, WhereFilter };
@@ -5,9 +5,9 @@ import { l as RawCodecInferer } from "./expression-Ck1wys3N-RNyviMcU.mjs";
5
5
  import { t as ExpressionImpl } from "./expression-CNBCbbzU-BG3rv8Wb.mjs";
6
6
  import "./expression-DWcDQHh9.mjs";
7
7
  import { s as createFunctions } from "./functions-CJ8Yf8uL.mjs";
8
- import { a as FieldProxy, b as TableProxyContract, d as QueryContext, f as RawLane, h as Scope, r as Db, t as AggregateFunctions } from "./db-BmrN9nRS-DEogPltL.mjs";
9
- import { a as SqlAggregateDescriptorRegistry, n as ExecutionContext } from "./query-lane-context-C2AXsoFa-COSQOvZz.mjs";
10
- import "./query-lane-context-BsZs5lvB.mjs";
8
+ import { a as FieldProxy, b as TableProxyContract, d as QueryContext, f as RawLane, h as Scope, r as Db, t as AggregateFunctions } from "./db-BmrN9nRS-CDq1n2be.mjs";
9
+ import { a as SqlAggregateDescriptorRegistry, n as ExecutionContext } from "./query-lane-context-C42-u9L1-Bxa4DkI_.mjs";
10
+ import "./query-lane-context-DW5q2RAY.mjs";
11
11
  import { Contract } from "@prisma/orm-framework/contract/types";
12
12
  //#region ../../../2-sql/4-lanes/sql-builder/dist/runtime/index.d.mts
13
13
  //#region src/runtime/field-proxy.d.ts
@@ -4,7 +4,7 @@ import { C as lockStrengthCapabilities, S as lockOptionCapabilities, w as lockWa
4
4
  import { i as createRawSql, s as toExpr, t as ExpressionImpl } from "./expression-impl-B-XNINxr-vYwKVFeP.mjs";
5
5
  import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-CYK0Wzja.mjs";
6
6
  import { t as createFunctions } from "./functions-0YWByawj.mjs";
7
- import { t as createIndexReferences } from "./index-reference-D693Lu-E.mjs";
7
+ import { t as createIndexReferences } from "./index-reference-DR62gjQS.mjs";
8
8
  import { assertAnnotationsApplicable } from "@prisma/orm-framework/components/runtime";
9
9
  //#region ../../../2-sql/4-lanes/sql-builder/dist/runtime/index.mjs
10
10
  /**
@@ -1,5 +1,6 @@
1
1
  import { o as Expression, x as ScopeField } from "./expression-Ck1wys3N-RNyviMcU.mjs";
2
2
  import { a as Subquery, r as Functions, t as BooleanCodecType } from "./functions-CJ8Yf8uL.mjs";
3
- import { t as IndexReference } from "./index-reference-CflkzYSd.mjs";
4
- import { C as WhereFilter, S as UpdateQuery, _ as TableInAnyNamespace, b as TableProxyContract, c as IndexReferences, d as QueryContext, f as RawLane, g as SelectQuery, h as Scope, i as DeleteQuery, l as InsertQuery, m as ResolveRow, n as ContractRawTag, o as GatedMethod, p as RawTagFor, r as Db, s as GroupedQuery, t as AggregateFunctions, u as Namespace, v as TableNamesAcrossNamespaces, x as UnboundTables, y as TableProxy } from "./db-BmrN9nRS-DEogPltL.mjs";
3
+ import { t as IndexReference } from "./index-reference-DJX-CNsb-D2qUlYq2.mjs";
4
+ import "./index-reference-ZZrszBDq.mjs";
5
+ import { C as WhereFilter, S as UpdateQuery, _ as TableInAnyNamespace, b as TableProxyContract, c as IndexReferences, d as QueryContext, f as RawLane, g as SelectQuery, h as Scope, i as DeleteQuery, l as InsertQuery, m as ResolveRow, n as ContractRawTag, o as GatedMethod, p as RawTagFor, r as Db, s as GroupedQuery, t as AggregateFunctions, u as Namespace, v as TableNamesAcrossNamespaces, x as UnboundTables, y as TableProxy } from "./db-BmrN9nRS-CDq1n2be.mjs";
5
6
  export type { AggregateFunctions, BooleanCodecType, ContractRawTag, Db, DeleteQuery, Expression, Functions, GatedMethod, GroupedQuery, IndexReference, IndexReferences, InsertQuery, Namespace, QueryContext, RawLane, RawTagFor, ResolveRow, Scope, ScopeField, SelectQuery, Subquery, TableInAnyNamespace, TableNamesAcrossNamespaces, TableProxy, TableProxyContract, UnboundTables, UpdateQuery, WhereFilter };
@@ -0,0 +1,77 @@
1
+ import { r as StorageTable } from "./storage-table-WXeVNycx-BCwDhdq5.mjs";
2
+ import "./types-Uv3oTMAb.mjs";
3
+ import { t as IndexReference } from "./index-reference-DJX-CNsb-D2qUlYq2.mjs";
4
+ import { ContractField, ContractRelation } from "@prisma/orm-framework/contract/types";
5
+ //#region ../../../2-sql/4-lanes/relational-core/dist/collection-methods-BnR4UjcW.d.mts
6
+ //#region src/collection-methods.d.ts
7
+ /**
8
+ * One model, as a contribution's type half reads it: the contract's target, the model's name, its fields with their codec ids and type parameters, its relations, and its storage table with columns and indexes.
9
+ */
10
+ interface CollectionMethodModelType {
11
+ readonly target: string;
12
+ readonly name: string;
13
+ readonly fields: object;
14
+ readonly relations: object;
15
+ readonly table: {
16
+ readonly columns: object;
17
+ readonly indexes: readonly unknown[];
18
+ };
19
+ }
20
+ /**
21
+ * One contributed method, as the type half declares it: its parameter list, and whether it adds a filter and an order. A method that only sometimes filters declares `filters: false`.
22
+ */
23
+ interface ContributedMethodSignature {
24
+ readonly parameters: readonly unknown[];
25
+ readonly filters: boolean;
26
+ readonly orders: boolean;
27
+ }
28
+ /**
29
+ * The type half of a contribution. The ORM client fills `model` with one model's `CollectionMethodModelType` and reads `methods` back: the model's methods by name. An implementation computes `methods` from `this['model']`.
30
+ */
31
+ interface CollectionMethodContributionType {
32
+ readonly model: CollectionMethodModelType;
33
+ readonly methods: {
34
+ readonly [name: string]: ContributedMethodSignature;
35
+ };
36
+ }
37
+ /**
38
+ * The type halves of the contributions, keyed by the id of their run-time half. A package adds its type half by declaration merging on this module, published as `@prisma/orm-family-sql/relational-core/collection-methods`, in a module that its entry points type-export from.
39
+ */
40
+ interface CollectionMethodRegistry {
41
+ /** Keeps the interface from being empty, which would make it a type alias that cannot be merged. */
42
+ readonly __collectionMethodRegistry?: never;
43
+ }
44
+ /** The id of a contribution whose type half is registered in `CollectionMethodRegistry`. */
45
+ type CollectionMethodContributionId = Exclude<keyof CollectionMethodRegistry, '__collectionMethodRegistry'>;
46
+ /** The second argument of an ORM `where` or `orderBy` callback, as a contributed method reads it. */
47
+ interface CollectionMethodTools {
48
+ readonly fns: Readonly<Record<string, (...args: never[]) => unknown>>;
49
+ readonly indexes: Readonly<Record<string, IndexReference>>;
50
+ }
51
+ /**
52
+ * The collection a contributed method refines, seen only through `where` and `orderBy`. Their callbacks receive the ORM's model accessor, whose fields have their query operations, and `{ fns, indexes }`.
53
+ */
54
+ interface CollectionMethodReceiver {
55
+ where(condition: (model: unknown, tools: CollectionMethodTools) => unknown): CollectionMethodReceiver;
56
+ orderBy(order: (model: unknown, tools: CollectionMethodTools) => unknown): CollectionMethodReceiver;
57
+ }
58
+ /** A contributed method's body: refines `collection` with the method's arguments. */
59
+ type CollectionMethodBody = (collection: CollectionMethodReceiver, ...args: never[]) => CollectionMethodReceiver;
60
+ /** One model, as a contribution's run-time half reads it. */
61
+ interface CollectionMethodModel {
62
+ readonly target: string;
63
+ readonly name: string;
64
+ readonly fields: Readonly<Record<string, ContractField>>;
65
+ readonly relations: Readonly<Record<string, ContractRelation>>;
66
+ readonly table: StorageTable;
67
+ }
68
+ /**
69
+ * The run-time half of a contribution. `methodsFor` returns one model's methods by name; the ORM client calls it once for each model of the contract. `id` is the key its type half registers under in `CollectionMethodRegistry`.
70
+ */
71
+ interface CollectionMethodContribution {
72
+ readonly id: string;
73
+ methodsFor(model: CollectionMethodModel): Readonly<Record<string, CollectionMethodBody>>;
74
+ }
75
+ //#endregion
76
+ export { CollectionMethodModel as a, CollectionMethodRegistry as c, CollectionMethodContributionType as i, CollectionMethodTools as l, CollectionMethodContribution as n, CollectionMethodModelType as o, CollectionMethodContributionId as r, CollectionMethodReceiver as s, CollectionMethodBody as t, ContributedMethodSignature as u };
77
+ //# sourceMappingURL=collection-methods-BnR4UjcW-tiz3frtf.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection-methods-BnR4UjcW-tiz3frtf.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/collection-methods-BnR4UjcW.d.mts"],"mappings":";;;;;;;;;UAOU;WACC;WACA;WACA;WACA;WACA;aACE;aACA;;;;;;UAMH;WACC;WACA;WACA;;;;;UAKD;WACC,OAAO;WACP;cACG,eAAe;;;;;;UAMnB;;WAEC;;;KAGN,iCAAiC,cAAc;;UAE1C;WACC,KAAK,SAAS,mBAAmB;WACjC,SAAS,SAAS,eAAe;;;;;UAKlC;EACR,MAAM,YAAY,gBAAgB,OAAO,oCAAoC;EAC7E,QAAQ,QAAQ,gBAAgB,OAAO,oCAAoC;;;KAGxE,wBAAwB,YAAY,6BAA6B,kBAAkB;;UAE9E;WACC;WACA;WACA,QAAQ,SAAS,eAAe;WAChC,WAAW,SAAS,eAAe;WACnC,OAAO;;;;;UAKR;WACC;EACT,WAAW,OAAO,wBAAwB,SAAS,eAAe"}
@@ -0,0 +1 @@
1
+ import "./collection-methods-BnR4UjcW-tiz3frtf.mjs";
@@ -7,7 +7,8 @@ import { C as TraitExpression, S as StorageColumnScopeField, c as RawAffectedCou
7
7
  import "./expression-DWcDQHh9.mjs";
8
8
  import { a as Subquery, r as Functions, t as BooleanCodecType } from "./functions-CJ8Yf8uL.mjs";
9
9
  import { c as LockOptionCapabilities, l as LockStrengthCapabilities, u as LockWaitOptions } from "./ast-Dp6lQXUX.mjs";
10
- import { r as TableIndexReferences } from "./index-reference-CflkzYSd.mjs";
10
+ import { r as TableIndexReferences } from "./index-reference-DJX-CNsb-D2qUlYq2.mjs";
11
+ import "./index-reference-ZZrszBDq.mjs";
11
12
  import "./plan-_8dKi13Q.mjs";
12
13
  import { AnnotationValue, OperationKind, ValidAnnotations } from "@prisma/orm-framework/components/runtime";
13
14
  //#region ../../../2-sql/4-lanes/sql-builder/dist/db-BmrN9nRS.d.mts
@@ -530,4 +531,4 @@ type Namespace<C extends TableProxyContract, NsId extends string & keyof C['stor
530
531
  type Db<C extends TableProxyContract> = { readonly [Ns in keyof C['storage']['namespaces'] & string]: Namespace<C, Ns>; };
531
532
  //#endregion
532
533
  export { WhereFilter as C, UpdateQuery as S, TableInAnyNamespace as _, FieldProxy as a, TableProxyContract as b, IndexReferences as c, QueryContext as d, RawLane as f, SelectQuery as g, Scope as h, DeleteQuery as i, InsertQuery as l, ResolveRow as m, ContractRawTag as n, GatedMethod as o, RawTagFor as p, Db as r, GroupedQuery as s, AggregateFunctions as t, Namespace as u, TableNamesAcrossNamespaces as v, UnboundTables as x, TableProxy as y };
533
- //# sourceMappingURL=db-BmrN9nRS-DEogPltL.d.mts.map
534
+ //# sourceMappingURL=db-BmrN9nRS-CDq1n2be.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db-BmrN9nRS-CDq1n2be.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/sql-builder/dist/db-BmrN9nRS.d.mts"],"mappings":";;;;;;;;;;;;;;;KAQK,YAAY,cAAc,UAAU,UAAU,qBAAqB,WAAW;cACrE;KACT,OAAO,QAAQ,WAAW,IAAI,EAAE;KAChC,WAAW,cAAc;KACzB,aAAa,eAAe;KAC5B;EACH,UAAU;EACV,YAAY,eAAe;;KAExB,WAAW,YAAY,YAAY;YAC5B;IACR,UAAU;IACV,YAAY,OAAO,OAAO;;EAE5B,qBAAqB;EACrB,YAAY;;KAET,aAAa,qBAAqB,cAAc;EACnD,UAAU,yBAAyB;EACnC,eAAe,KAAK,OAAO,yBAAyB;;KAEjD,yBAAyB,UAAU,mBAAqB,WAAW,eAAe,wBAAwB,aAAa;KACvH,YAAY,UAAU,OAAO,UAAU;EAC1C,UAAU,OAAO,KAAK,qBAAqB,i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mBAAmB,kBAAkB,2BAA2B,SAAS,kBAAkB,2BAA2B,OAAO,uBAAuB;KAC3Q,eAAe,UAAU,oBAAoB,qBAAqB,uBAAuB,kBAAkB,2BAA2B,OAAO;KAC7I,UAAU,UAAU,oBAAoB,4BAA4B,0CAA0C,cAAc,kBAAkB,2BAA2B,kBAAkB,WAAW,GAAG,MAAM;;;;;;;;;KAS/M,GAAG,UAAU,kCAAkC,YAAY,sCAAsC,UAAU,GAAG"}
@@ -5,9 +5,9 @@ import { n as SqlQueryPlan } from "./plan-cGEaSXHv-j0w37mVT.mjs";
5
5
  import { t as Adapter } from "./ast-Dp6lQXUX.mjs";
6
6
  import { t as SqlExecutionPlan } from "./sql-execution-plan-C7XauPPu-eskZJbmm.mjs";
7
7
  import "./plan-_8dKi13Q.mjs";
8
- import { t as CodecDescriptorRegistry } from "./query-lane-context-C2AXsoFa-COSQOvZz.mjs";
9
- import "./query-lane-context-BsZs5lvB.mjs";
10
- import { A as SqlMiddleware } from "./prepared-statement-Bs9TKj5u-CInk8vXF.mjs";
8
+ import { t as CodecDescriptorRegistry } from "./query-lane-context-C42-u9L1-Bxa4DkI_.mjs";
9
+ import "./query-lane-context-DW5q2RAY.mjs";
10
+ import { A as SqlMiddleware } from "./prepared-statement-BwHkxfuI-CKkkrS6r.mjs";
11
11
  import { Contract } from "@prisma/orm-framework/contract/types";
12
12
  import { ActivityEndedResult as ActivityEndedResult$1, ActivityFinalizedResult as ActivityFinalizedResult$1, ExecuteInterceptResult as ExecuteInterceptResult$1, QueryInterceptResult as QueryInterceptResult$1, RuntimeActivity as RuntimeActivity$1, RuntimeLog as Log, StatementActivity, StatementEnded, TransactionActivity, TransactionEnded } from "@prisma/orm-framework/components/runtime";
13
13
  //#region ../../../2-sql/5-runtime/dist/index.d.mts
@@ -81,4 +81,4 @@ interface LintsOptions {
81
81
  declare function lints(options?: LintsOptions): SqlMiddleware;
82
82
  //#endregion
83
83
  export { lowerSqlPlan as _, LintsOptions as a, RuntimeActivity$1 as c, TransactionActivity as d, TransactionEnded as f, lints as g, extractCodecIds as h, ExecuteInterceptResult$1 as i, StatementActivity as l, createAstCodecRegistry as m, ActivityFinalizedResult$1 as n, Log as o, budgets as p, BudgetsOptions as r, QueryInterceptResult$1 as s, ActivityEndedResult$1 as t, StatementEnded as u, validateCodecRegistryCompleteness as v, validateContractCodecMappings as y };
84
- //# sourceMappingURL=index-qr6LA3dl.d.mts.map
84
+ //# sourceMappingURL=index-CmKqLvvO.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-qr6LA3dl.d.mts","names":[],"sources":["../../../../2-sql/5-runtime/dist/index.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;iBAiBiB,uBAAuB,aAAa,0BAA0B;;;iBAG9D,gBAAgB,UAAU,SAAS,cAAc;iBACjD,8BAA8B,UAAU,yBAAyB,UAAU,SAAS;iBACpF,kCAAkC,UAAU,yBAAyB,UAAU,SAAS;;;;;;;;;;;;iBAYxF,aAAa,KAAK,SAAS,QAAQ,aAAa,SAAS,aAAa,mBAAmB,UAAU,SAAS,aAAa,WAAW,aAAa,OAAO,iBAAiB;;;UAGhL;WACC;WACA;WACA,YAAY;WACZ;WACA;aACE;aACA;;;iBAGI,QAAQ,UAAU,iBAAiB;;;UAG1C;WACC;aACE;aACA;aACA;aACA;aACA;;WAEF;;;;;;;;;;;;;;;;iBAgBM,MAAM,UAAU,eAAe"}
1
+ {"version":3,"file":"index-CmKqLvvO.d.mts","names":[],"sources":["../../../../2-sql/5-runtime/dist/index.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;iBAiBiB,uBAAuB,aAAa,0BAA0B;;;iBAG9D,gBAAgB,UAAU,SAAS,cAAc;iBACjD,8BAA8B,UAAU,yBAAyB,UAAU,SAAS;iBACpF,kCAAkC,UAAU,yBAAyB,UAAU,SAAS;;;;;;;;;;;;iBAYxF,aAAa,KAAK,SAAS,QAAQ,aAAa,SAAS,aAAa,mBAAmB,UAAU,SAAS,aAAa,WAAW,aAAa,OAAO,iBAAiB;;;UAGhL;WACC;WACA;WACA,YAAY;WACZ;WACA;aACE;aACA;;;iBAGI,QAAQ,UAAU,iBAAiB;;;UAG1C;WACC;aACE;aACA;aACA;aACA;aACA;;WAEF;;;;;;;;;;;;;;;;iBAgBM,MAAM,UAAU,eAAe"}
@@ -1,7 +1,7 @@
1
1
  import { t as Index } from "./sql-index-ByAAE7K8-BpbPBWPD.mjs";
2
2
  import "./types-Uv3oTMAb.mjs";
3
3
  import { S as StorageColumnScopeField, o as Expression, x as ScopeField } from "./expression-Ck1wys3N-RNyviMcU.mjs";
4
- //#region ../../../2-sql/4-lanes/relational-core/dist/exports/index-reference.d.mts
4
+ //#region ../../../2-sql/4-lanes/relational-core/dist/index-reference-DJX-CNsb.d.mts
5
5
  //#region src/index-reference.d.ts
6
6
  /**
7
7
  * An index of a table as a query reads it: its columns, bound to the table's alias, its type and its options. A query operation that searches what an index covers, such as Postgres's `fullTextMatches`, takes it in place of the columns and settings the index was built with.
@@ -33,6 +33,12 @@ type IndexOptionsOf<I> = I extends {
33
33
  /** The indexes of `I` whose authored name is `Key`. */
34
34
  type IndexesNamed<I, Key> = I extends unknown ? AuthoredIndexName<I> extends Key ? I : never : never;
35
35
  type IsUnion<T, Whole = T> = T extends unknown ? ([Whole] extends [T] ? false : true) : never;
36
+ /** The authored names of the indexes in `I` of type `Type`, leaving out a name another index in `I` shares. */
37
+ type UniqueIndexNamesOfType<I, Type extends string> = { [Key in AuthoredIndexName<Extract<I, {
38
+ readonly type: Type;
39
+ }>>]: true extends IsUnion<IndexesNamed<I, Key>> ? never : Key; }[AuthoredIndexName<Extract<I, {
40
+ readonly type: Type;
41
+ }>>];
36
42
  /**
37
43
  * A storage table's indexes, keyed by the name the contract source gave each: the `name:` prefix, or the `map:` name. An unnamed index, such as a derived foreign-key backing index, appears under its default prefix. A name that more than one index shares is left out, as reading it is refused at runtime.
38
44
  */
@@ -49,10 +55,13 @@ interface IndexReferencesInput {
49
55
  /** The column of the table as this query reads it: under the table's alias, with its codec. */
50
56
  readonly column: (columnName: string) => Expression<ScopeField>;
51
57
  }
58
+ type NamedIndex = Pick<Index, 'name' | 'prefix' | 'type'>;
59
+ /** The authored names of the indexes of type `type`, leaving out a name another index shares. The run-time counterpart of `UniqueIndexNamesOfType`. */
60
+ declare function uniqueIndexNamesOfType(indexes: ReadonlyArray<NamedIndex>, type: string): readonly string[];
52
61
  /**
53
62
  * The index references of a table, keyed by authored name. A name more than one index shares throws `ORM.ARGUMENT_INVALID` when it is read.
54
63
  */
55
64
  declare function createIndexReferences(input: IndexReferencesInput): Readonly<Record<string, IndexReference>>;
56
65
  //#endregion
57
- export { createIndexReferences as i, IndexReferencesInput as n, TableIndexReferences as r, IndexReference as t };
58
- //# sourceMappingURL=index-reference-CflkzYSd.d.mts.map
66
+ export { createIndexReferences as a, UniqueIndexNamesOfType as i, IndexReferencesInput as n, uniqueIndexNamesOfType as o, TableIndexReferences as r, IndexReference as t };
67
+ //# sourceMappingURL=index-reference-DJX-CNsb-D2qUlYq2.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-reference-DJX-CNsb-D2qUlYq2.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/index-reference-DJX-CNsb.d.mts"],"mappings":";;;;;;;;UAMU,eAAe,gBAAgB,SAAS,eAAe,WAAW,gBAAgB,SAAS,eAAe,WAAW,eAAe,sDAAsD,gBAAgB,SAAS,uCAAuC,SAAS;;WAElQ,SAAS;WACT,MAAM;WACN,SAAS;;;KAGf,kBAAkB,KAAK;WACjB,cAAc;IACrB,SAAS;WACF,YAAY;IACnB;KACC,uBAAuB,SAAS,KAAK;WAC/B,eAAe;gBACV,UAAU,uBAAuB,qBAAqB,UAAU,QAAQ;WAC7E;WACA;IACP,WAAW,wBAAwB,QAAQ,+BAA+B;KACzE,YAAY,KAAK;WACX,YAAY;IACnB;KACC,eAAe,KAAK;WACd,eAAe,gBAAgB;IACtC;;KAEC,aAAa,GAAG,OAAO,oBAAoB,kBAAkB,WAAW,MAAM;KAC9E,QAAQ,GAAG,QAAQ,KAAK,sBAAsB,gBAAgB;;KAE9D,uBAAuB,GAAG,0BAA0B,OAAO,kBAAkB,QAAQ;WAC/E,MAAM;mBACE,QAAQ,aAAa,GAAG,gBAAgB,OAAO,kBAAkB,QAAQ;WACjF,MAAM;;;;;KAKZ,qBAAqB,SAAS;WACxB,yBAAyB;WACzB,eAAe;gBACV,OAAO,kBAAkB,mBAAmB,QAAQ,aAAa,GAAG,gBAAgB,MAAM,eAAe,uBAAuB,SAAS,aAAa,GAAG,OAAO,YAAY,aAAa,GAAG,OAAO,eAAe,aAAa,GAAG;UACxO;WACC;WACA;WACA;aACE,SAAS,cAAc,KAAK;;;WAG9B,SAAS,uBAAuB,WAAW;;KAEjD,aAAa,KAAK;;iBAEN,uBAAuB,SAAS,cAAc,aAAa;;;;iBAI3D,sBAAsB,OAAO,uBAAuB,SAAS,eAAe"}
@@ -1,12 +1,25 @@
1
1
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
2
2
  //#region ../../../2-sql/4-lanes/relational-core/dist/exports/index-reference.mjs
3
+ /** The name the contract source gave an index: the prefix of a wire name, or an exact (`map:`) name. */
4
+ function authoredIndexName(index) {
5
+ return index.prefix ?? index.name;
6
+ }
7
+ /** The authored names of the indexes of type `type`, leaving out a name another index shares. The run-time counterpart of `UniqueIndexNamesOfType`. */
8
+ function uniqueIndexNamesOfType(indexes, type) {
9
+ const counts = /* @__PURE__ */ new Map();
10
+ for (const index of indexes) {
11
+ const name = authoredIndexName(index);
12
+ counts.set(name, (counts.get(name) ?? 0) + 1);
13
+ }
14
+ return indexes.filter((index) => index.type === type && counts.get(authoredIndexName(index)) === 1).map(authoredIndexName);
15
+ }
3
16
  /**
4
17
  * The index references of a table, keyed by authored name. A name more than one index shares throws `ORM.ARGUMENT_INVALID` when it is read.
5
18
  */
6
19
  function createIndexReferences(input) {
7
20
  const byName = /* @__PURE__ */ new Map();
8
21
  for (const index of input.table.indexes) {
9
- const authoredName = index.prefix ?? index.name;
22
+ const authoredName = authoredIndexName(index);
10
23
  const columns = Object.fromEntries((index.columns ?? []).map((column) => [column, input.column(column)]));
11
24
  const reference = Object.freeze({
12
25
  columns: Object.freeze(columns),
@@ -37,6 +50,6 @@ function ambiguousIndexName(input, authoredName) {
37
50
  });
38
51
  }
39
52
  //#endregion
40
- export { createIndexReferences as t };
53
+ export { uniqueIndexNamesOfType as n, createIndexReferences as t };
41
54
 
42
- //# sourceMappingURL=index-reference-D693Lu-E.mjs.map
55
+ //# sourceMappingURL=index-reference-DR62gjQS.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-reference-DR62gjQS.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/index-reference.mjs"],"sourcesContent":["import { structuredError } from \"@internal/utils/structured-error\";\n//#region src/index-reference.ts\n/** The name the contract source gave an index: the prefix of a wire name, or an exact (`map:`) name. */\nfunction authoredIndexName(index) {\n\treturn index.prefix ?? index.name;\n}\n/** The authored names of the indexes of type `type`, leaving out a name another index shares. The run-time counterpart of `UniqueIndexNamesOfType`. */\nfunction uniqueIndexNamesOfType(indexes, type) {\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const index of indexes) {\n\t\tconst name = authoredIndexName(index);\n\t\tcounts.set(name, (counts.get(name) ?? 0) + 1);\n\t}\n\treturn indexes.filter((index) => index.type === type && counts.get(authoredIndexName(index)) === 1).map(authoredIndexName);\n}\n/**\n* The index references of a table, keyed by authored name. A name more than one index shares throws `ORM.ARGUMENT_INVALID` when it is read.\n*/\nfunction createIndexReferences(input) {\n\tconst byName = /* @__PURE__ */ new Map();\n\tfor (const index of input.table.indexes) {\n\t\tconst authoredName = authoredIndexName(index);\n\t\tconst columns = Object.fromEntries((index.columns ?? []).map((column) => [column, input.column(column)]));\n\t\tconst reference = Object.freeze({\n\t\t\tcolumns: Object.freeze(columns),\n\t\t\ttype: index.type,\n\t\t\toptions: index.options\n\t\t});\n\t\tbyName.set(authoredName, [...byName.get(authoredName) ?? [], reference]);\n\t}\n\tconst references = {};\n\tfor (const [authoredName, [reference, ...others]] of byName) Object.defineProperty(references, authoredName, {\n\t\tenumerable: true,\n\t\tget: () => {\n\t\t\tif (others.length > 0) throw ambiguousIndexName(input, authoredName);\n\t\t\treturn reference;\n\t\t}\n\t});\n\treturn Object.freeze(references);\n}\nfunction ambiguousIndexName(input, authoredName) {\n\treturn structuredError(\"ORM.ARGUMENT_INVALID\", `Table \"${input.tableName}\" has more than one index named \"${authoredName}\".`, {\n\t\twhy: \"An index is read by the name its contract source gave it, and these indexes share that name.\",\n\t\tfix: `Give each of these indexes of table \"${input.tableName}\" its own name in the contract source.`,\n\t\tmeta: {\n\t\t\tnamespaceId: input.namespaceId,\n\t\t\ttableName: input.tableName,\n\t\t\tindex: authoredName\n\t\t}\n\t});\n}\n//#endregion\nexport { createIndexReferences, uniqueIndexNamesOfType };\n\n//# sourceMappingURL=index-reference.mjs.map"],"mappings":";;;AAGA,SAAS,kBAAkB,OAAO;CACjC,OAAO,MAAM,UAAU,MAAM;AAC9B;;AAEA,SAAS,uBAAuB,SAAS,MAAM;CAC9C,MAAM,yBAAyB,IAAI,IAAI;CACvC,KAAK,MAAM,SAAS,SAAS;EAC5B,MAAM,OAAO,kBAAkB,KAAK;EACpC,OAAO,IAAI,OAAO,OAAO,IAAI,IAAI,KAAK,KAAK,CAAC;CAC7C;CACA,OAAO,QAAQ,QAAQ,UAAU,MAAM,SAAS,QAAQ,OAAO,IAAI,kBAAkB,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,iBAAiB;AAC1H;;;;AAIA,SAAS,sBAAsB,OAAO;CACrC,MAAM,yBAAyB,IAAI,IAAI;CACvC,KAAK,MAAM,SAAS,MAAM,MAAM,SAAS;EACxC,MAAM,eAAe,kBAAkB,KAAK;EAC5C,MAAM,UAAU,OAAO,aAAa,MAAM,WAAW,CAAC,EAAA,CAAG,KAAK,WAAW,CAAC,QAAQ,MAAM,OAAO,MAAM,CAAC,CAAC,CAAC;EACxG,MAAM,YAAY,OAAO,OAAO;GAC/B,SAAS,OAAO,OAAO,OAAO;GAC9B,MAAM,MAAM;GACZ,SAAS,MAAM;EAChB,CAAC;EACD,OAAO,IAAI,cAAc,CAAC,GAAG,OAAO,IAAI,YAAY,KAAK,CAAC,GAAG,SAAS,CAAC;CACxE;CACA,MAAM,aAAa,CAAC;CACpB,KAAK,MAAM,CAAC,cAAc,CAAC,WAAW,GAAG,YAAY,QAAQ,OAAO,eAAe,YAAY,cAAc;EAC5G,YAAY;EACZ,WAAW;GACV,IAAI,OAAO,SAAS,GAAG,MAAM,mBAAmB,OAAO,YAAY;GACnE,OAAO;EACR;CACD,CAAC;CACD,OAAO,OAAO,OAAO,UAAU;AAChC;AACA,SAAS,mBAAmB,OAAO,cAAc;CAChD,OAAO,gBAAgB,wBAAwB,UAAU,MAAM,UAAU,mCAAmC,aAAa,KAAK;EAC7H,KAAK;EACL,KAAK,wCAAwC,MAAM,UAAU;EAC7D,MAAM;GACL,aAAa,MAAM;GACnB,WAAW,MAAM;GACjB,OAAO;EACR;CACD,CAAC;AACF"}
@@ -0,0 +1 @@
1
+ import "./index-reference-DJX-CNsb-D2qUlYq2.mjs";
@@ -8,14 +8,17 @@ import { C as TraitExpression, g as RawSqlInterpolation, i as CodecTypesBase, o
8
8
  import "./expression-DWcDQHh9.mjs";
9
9
  import { n as BuiltinFunctions, t as BooleanCodecType } from "./functions-CJ8Yf8uL.mjs";
10
10
  import { c as LockOptionCapabilities, l as LockStrengthCapabilities, u as LockWaitOptions } from "./ast-Dp6lQXUX.mjs";
11
- import { r as TableIndexReferences, t as IndexReference } from "./index-reference-CflkzYSd.mjs";
11
+ import { r as TableIndexReferences, t as IndexReference } from "./index-reference-DJX-CNsb-D2qUlYq2.mjs";
12
+ import "./index-reference-ZZrszBDq.mjs";
12
13
  import "./plan-_8dKi13Q.mjs";
13
- import { n as ExecutionContext } from "./query-lane-context-C2AXsoFa-COSQOvZz.mjs";
14
- import "./query-lane-context-BsZs5lvB.mjs";
15
- import { h as RuntimeScope, o as ComputeColumnJsType } from "./types-D09NAayg-CNrpjo7Z.mjs";
16
- import "./types-DAkmn9FV.mjs";
17
- import { i as Declaration, l as ParamsFromDeclaration, m as PreparedStatement, p as PreparedFor, t as BindSiteParams, w as RuntimeQueryable$1, y as Runtime } from "./prepared-statement-Bs9TKj5u-CInk8vXF.mjs";
18
- import "./index-qr6LA3dl.mjs";
14
+ import { c as CollectionMethodRegistry, r as CollectionMethodContributionId, u as ContributedMethodSignature } from "./collection-methods-BnR4UjcW-tiz3frtf.mjs";
15
+ import { n as ExecutionContext } from "./query-lane-context-C42-u9L1-Bxa4DkI_.mjs";
16
+ import "./query-lane-context-DW5q2RAY.mjs";
17
+ import { h as RuntimeScope, o as ComputeColumnJsType } from "./types-Cl4MLNrS-lbf-K25i.mjs";
18
+ import "./types-BkA6tyT-.mjs";
19
+ import "./collection-methods-DoBrRR69.mjs";
20
+ import { i as Declaration, l as ParamsFromDeclaration, m as PreparedStatement, p as PreparedFor, t as BindSiteParams, w as RuntimeQueryable$1, y as Runtime } from "./prepared-statement-BwHkxfuI-CKkkrS6r.mjs";
21
+ import "./index-CmKqLvvO.mjs";
19
22
  import { CodecDescriptorRef, ScalarFieldDeclarationBuilder } from "@prisma/orm-framework/components/codec";
20
23
  import { Contract } from "@prisma/orm-framework/contract/types";
21
24
  import { AnnotationValue, AsyncIterableResult, MetaBuilder, OperationKind, ResultType, RuntimeExecuteOptions } from "@prisma/orm-framework/components/runtime";
@@ -493,6 +496,16 @@ type OrmFunctionsOf<CT extends Record<string, {
493
496
  type OrmFunctions<TContract extends Contract<SqlStorage>> = OrmFunctionsOf<ExtractCodecTypes<TContract>, ExtractQueryOperationTypes<TContract>>;
494
497
  /** The indexes of the table a model is stored in, keyed by the name the contract source gave each. */
495
498
  type ModelIndexReferences<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = string extends NsId ? Readonly<Record<string, IndexReference>> : TableIndexReferences<NamespaceTableDef<TContract, ModelTableName<TContract, ModelName, NsId> & string, ResolvedNsId<TContract, ModelName, NsId>>>;
499
+ /** One model as a collection method contribution reads it: the contract's target, the model's fields and relations, and its storage table. */
500
+ type CollectionMethodModelTypeOf<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string> = {
501
+ readonly target: TContract['target'];
502
+ readonly name: ModelName;
503
+ readonly fields: FieldsOf<TContract, ModelName, NsId>;
504
+ readonly relations: ModelDef<TContract, ModelName, NsId> extends {
505
+ readonly relations: infer Relations extends object;
506
+ } ? Relations : Record<string, never>;
507
+ readonly table: NamespaceTableDef<TContract, ModelTableName<TContract, ModelName, NsId> & string, ResolvedNsId<TContract, ModelName, NsId>>;
508
+ };
496
509
  /** The second argument of a `where` or `orderBy` callback: the SQL query builder's functions, and the model's indexes. */
497
510
  interface ModelCallbackTools<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> {
498
511
  readonly fns: OrmFunctions<TContract>;
@@ -921,8 +934,8 @@ type ModelRelations<TContract extends Contract<SqlStorage>, ModelName extends st
921
934
  type ExactRecord<T> = T extends Record<string, unknown> ? string extends keyof T ? Record<string, never> : T : Record<string, never>;
922
935
  type RelationsOf<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = ExactRecord<ModelRelations<TContract, ModelName, NsId>>;
923
936
  type RelationNames<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = (string extends keyof RelationsOf<TContract, ModelName, NsId> ? never : { [K in keyof RelationsOf<TContract, ModelName, NsId>]: RelationsOf<TContract, ModelName, NsId>[K] extends never ? never : K; }[keyof RelationsOf<TContract, ModelName, NsId>]) & string;
924
- type IsUnion<T, Whole = T> = T extends Whole ? ([Whole] extends [T] ? false : true) : never;
925
- type IsSingletonString<T> = [T] extends [string] ? string extends T ? false : IsUnion<T> extends true ? false : true : false;
937
+ type IsUnion$1<T, Whole = T> = T extends Whole ? ([Whole] extends [T] ? false : true) : never;
938
+ type IsSingletonString<T> = [T] extends [string] ? string extends T ? false : IsUnion$1<T> extends true ? false : true : false;
926
939
  type VariantDeclaredRelationKeys<TContract extends Contract<SqlStorage>, ModelName extends string, VariantValue, NsId extends string> = VariantValue extends string ? keyof RelationsOf<TContract, VariantModelName<TContract, ModelName, VariantValue, NsId>, VariantModelNamespace<TContract, ModelName, VariantValue, NsId>> : never;
927
940
  type SelectedVariantDeclaredRelationKeys<TContract extends Contract<SqlStorage>, ModelName extends string, VariantValue, NsId extends string> = VariantDeclaredRelationKeys<TContract, ModelName, string extends VariantValue ? DiscriminatorValues<TContract, ModelName, NsId> : VariantValue, NsId>;
928
941
  type VariantAwareIncludeRelationNames<TContract extends Contract<SqlStorage>, ModelName extends string, VariantValue, NsId extends string = never> = IsSingletonString<VariantValue> extends true ? RelationNames<TContract, VariantModelName<TContract, ModelName, VariantValue, NsId>, VariantModelNamespace<TContract, ModelName, VariantValue, NsId>> | Exclude<RelationNames<TContract, ModelName, NsId>, keyof RelationsOf<TContract, VariantModelName<TContract, ModelName, VariantValue, NsId>, VariantModelNamespace<TContract, ModelName, VariantValue, NsId>>> : [VariantValue] extends [string] ? Exclude<RelationNames<TContract, ModelName, NsId>, SelectedVariantDeclaredRelationKeys<TContract, ModelName, VariantValue, NsId>> : RelationNames<TContract, ModelName, NsId>;
@@ -988,6 +1001,34 @@ type IncludeRefinementValue<TContract extends Contract<SqlStorage>, ParentModelN
988
1001
  type RefinedIncludeRelationValue<TContract extends Contract<SqlStorage>, ParentModelName extends string, RelName extends string, IncludedRow, NsId extends string = never> = RelationCardinality<TContract, ParentModelName, RelName, NsId> extends '1:1' | 'N:1' ? IncludedRow | null : IncludedRow[];
989
1002
  type WhereInput<TContract extends Contract<SqlStorage>, NsId extends string, ModelName extends string, VariantValue extends string | undefined = undefined> = ((model: VariantAwareModelAccessor<TContract, ModelName, VariantValue, NsId>, tools: ModelCallbackTools<TContract, ModelName, NsId>) => WhereCallbackResult) | ShorthandWhereFilter<TContract, NsId, ModelName>;
990
1003
  //#endregion
1004
+ //#region src/collection-methods.d.ts
1005
+ type MethodsOf<Entry, Model> = (Entry & {
1006
+ readonly model: Model;
1007
+ })['methods' & keyof Entry];
1008
+ type ContributedTables<Model> = { readonly [Id in CollectionMethodContributionId]: MethodsOf<CollectionMethodRegistry[Id], Model>; };
1009
+ type MethodNames<Tables> = { [Id in keyof Tables]: keyof Tables[Id]; }[keyof Tables];
1010
+ type SignatureFrom<Tables, Name> = { [Id in keyof Tables]: Name extends keyof Tables[Id] ? Tables[Id][Name] : never; }[keyof Tables];
1011
+ type IsUnion<T, All = T> = T extends unknown ? ([All] extends [T] ? false : true) : never;
1012
+ /** The type of a method name that more than one contribution gives the same model. Calling it is a compile error that names the model and the contributions. */
1013
+ interface CollectionMethodNameClash<Name, ModelName, Contributions> {
1014
+ readonly clash: `more than one contribution gives model "${ModelName & string}" a collection method named "${Name & string}"`;
1015
+ readonly contributions: Contributions;
1016
+ }
1017
+ /** What a contributed method returns: the collection it was called on, with `Filtered` and `Ordered` added as its signature declares. */
1018
+ type ContributedMethodResult<Signature, Self> = Signature extends {
1019
+ readonly filters: true;
1020
+ } ? Signature extends {
1021
+ readonly orders: true;
1022
+ } ? Ordered<Filtered<Self>> : Filtered<Self> : Signature extends {
1023
+ readonly orders: true;
1024
+ } ? Ordered<Self> : Self;
1025
+ type ContributedCollectionMethod<Signature extends ContributedMethodSignature, Self> = <Receiver extends Self = Self>(...args: Signature['parameters']) => ContributedMethodResult<Signature, Receiver>;
1026
+ type MergedTable<Tables, ModelName> = { readonly [Name in MethodNames<Tables>]: { [Id in keyof Tables]: Name extends keyof Tables[Id] ? Id : never; }[keyof Tables] extends (infer Ids) ? true extends IsUnion<Ids> ? CollectionMethodNameClash<Name, ModelName, Ids> : SignatureFrom<Tables, Name> : never; };
1027
+ /** Each contributed method of a model, by name, with its signature. It does not depend on the receiver, so TypeScript computes it once per model. */
1028
+ type ModelContributedMethodTable<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string> = string extends ModelName | NsId ? Record<never, never> : MergedTable<ContributedTables<CollectionMethodModelTypeOf<TContract, ModelName, NsId>>, ModelName>;
1029
+ /** The contributed methods of a model's collection `Self`: the type of `using`. */
1030
+ type ContributedCollectionMethods<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string, Self, Table = ModelContributedMethodTable<TContract, ModelName, NsId>> = { readonly [Name in keyof Table]: Table[Name] extends ContributedMethodSignature ? ContributedCollectionMethod<Table[Name], Self> : Table[Name]; };
1031
+ //#endregion
991
1032
  //#region src/fragments.d.ts
992
1033
  type FieldMultiplicity = false | {
993
1034
  readonly elementNullable: boolean;
@@ -1243,6 +1284,10 @@ declare class CollectionBase<TContract extends Contract<SqlStorage>, ModelName e
1243
1284
  where<Self>(this: Self, fn: (model: VariantAwareModelAccessor<TContract, ModelName, State['variantValue'], State['nsId']>, tools: ModelCallbackTools<TContract, ModelName, State['nsId']>) => WhereCallbackResult): Filtered<Self>;
1244
1285
  where<Self>(this: Self, input: WhereDirectInput): Filtered<Self>;
1245
1286
  where<Self>(this: Self, filters: ShorthandWhereFilter<TContract, State['nsId'], ModelName>): Filtered<Self>;
1287
+ /**
1288
+ * The collection methods packages contribute for this model. Each contribution reads the model and names its methods. Each method returns this collection with the method's filter and order added.
1289
+ */
1290
+ get using(): ContributedCollectionMethods<TContract, ModelName, State['nsId'], this>;
1246
1291
  whereUnique<Self>(this: Self, criterion: UniqueConstraintCriterion<TContract, ModelName>): UniquelyFiltered<Self>;
1247
1292
  /**
1248
1293
  * Call `fn`, a query fragment, with this collection and return its result. `fn` may be a scope, which only imposes conditions and declares the fields it needs, or a fragment for what `where` cannot express, such as a shared `select` and `include`, an order or a limit. A condition on one row that needs no declared fields is `where(rowFragment)`. For a fragment made by the client's `fragment` method, the result is this collection's own type plus the filter and order the fragment's body established.
@@ -1713,13 +1758,14 @@ declare class CollectionBase<TContract extends Contract<SqlStorage>, ModelName e
1713
1758
  * conflictOn: { email: 'alice@example.com' },
1714
1759
  * });
1715
1760
  *
1716
- * // Conditional create — `update: {}` keeps the existing row
1717
- * // unchanged. `conflictOn` must reference the constraint that
1718
- * // makes the row "already exist"; omit only when the conflict is
1719
- * // on the primary key. On conflict,
1720
- * // `ON CONFLICT DO NOTHING RETURNING ...` may return zero rows,
1721
- * // so a follow-up reload is issued to fetch and return the
1722
- * // existing row.
1761
+ * // Conditional create: with `update: {}` the row is returned whether it
1762
+ * // was inserted or already existed. When it already exists, the conflict
1763
+ * // clause assigns the first conflict column its own value, which is an
1764
+ * // update: update triggers fire, the row is locked until the transaction
1765
+ * // ends, the caller needs UPDATE privilege on the table, and the call
1766
+ * // fails if that column is generated. `conflictOn` must reference the
1767
+ * // constraint that makes the row "already exist"; omit it only when the
1768
+ * // conflict is on the primary key.
1723
1769
  * await db.orm.User.upsert({
1724
1770
  * create: { email: 'alice@example.com', name: 'Alice' },
1725
1771
  * update: {},
@@ -1942,5 +1988,5 @@ type PreparedFrom<Params, Q extends SqlQueryPlan | Preparable<unknown, unknown>>
1942
1988
  declare function prepareQuery<D extends Declaration<CT>, Q extends SqlQueryPlan | Preparable<unknown, unknown>, CT extends CodecTypesBase>(runtime: Runtime, declaration: D, callback: (params: BindSiteParams<D>) => Q): Promise<PreparedFrom<ParamsFromDeclaration<D, CT>, Q>>;
1943
1989
  declare function createPreparedRowQuery<Params, DbRow, Result>(description: Preparable<DbRow, Result>, statement: PreparedStatement<Params, DbRow>): PreparedRowQuery<Params, Result>;
1944
1990
  //#endregion
1945
- export { type AggregateBuilder, type AggregateIncludeReducers, type AggregateResult, type AggregateSelector, type AggregateSpec, type AliasedTable, type CodecField, type CodecListField, Collection, type CollectionContext, type CollectionModelName, type CollectionRowOf, type CollectionState, type CollectionTables, type CollectionTypeState, type CollectionTypeStateOf, type ComparisonMethods, type Condition, type CreateInput, type DeclaredField, type DeclaredFieldsFragment, type DeclaredFieldsFragmentCallbackTools, type DefaultCollectionTypeState, type DefaultModelRow, type Filtered, type FragmentFacts, type FunctionCondition, GroupedCollection, type HasNoVariant, type HasOrderBy, type HasRow, type HasTypeState, type HasUniqueFilter, type HasWhere, type IncludeExpr, type IncludeScalar, type Including, type ModelAccessor, type ModelCallbackTools, type ModelIndexReferences, type NumericFieldNames, type OrderOptions, type Orderable, type OrderableFieldNames, type Ordered, type OrmFunctions, type OrmFunctionsOf, type OrmOptions, type OrmRawSqlBuilder, type OrmRawSqlTag, type PreparedCollection, type PreparedFrom, type PreparedRowQuery, type QueryFragment, type RelatedModelName, type RelationFilterAccessor, type RelationMutator, type RelationNames, type RelationPredicate, type RelationPredicateInput, type RelationsOf, type RowType, type RuntimeQueryable, type ScalarUpdateInput, type ShorthandWhereFilter, type TableScope, type TableStorageCoordinate, type ToManyRelationAccessor, type ToOneRelationAccessor, type TypeState, type UniqueConstraintCriterion, type UniquelyFiltered, type WhereCallbackResult, all, and, createCollectionTables, createModelAccessor, createPreparedRowQuery, emptyState, not, or, orderByField, orm, prepareQuery };
1991
+ export { type AggregateBuilder, type AggregateIncludeReducers, type AggregateResult, type AggregateSelector, type AggregateSpec, type AliasedTable, type CodecField, type CodecListField, Collection, type CollectionContext, type CollectionMethodNameClash, type CollectionModelName, type CollectionRowOf, type CollectionState, type CollectionTables, type CollectionTypeState, type CollectionTypeStateOf, type ComparisonMethods, type Condition, type ContributedCollectionMethod, type ContributedCollectionMethods, type ContributedMethodResult, type CreateInput, type DeclaredField, type DeclaredFieldsFragment, type DeclaredFieldsFragmentCallbackTools, type DefaultCollectionTypeState, type DefaultModelRow, type Filtered, type FragmentFacts, type FunctionCondition, GroupedCollection, type HasNoVariant, type HasOrderBy, type HasRow, type HasTypeState, type HasUniqueFilter, type HasWhere, type IncludeExpr, type IncludeScalar, type Including, type ModelAccessor, type ModelCallbackTools, type ModelContributedMethodTable, type ModelIndexReferences, type NumericFieldNames, type OrderOptions, type Orderable, type OrderableFieldNames, type Ordered, type OrmFunctions, type OrmFunctionsOf, type OrmOptions, type OrmRawSqlBuilder, type OrmRawSqlTag, type PreparedCollection, type PreparedFrom, type PreparedRowQuery, type QueryFragment, type RelatedModelName, type RelationFilterAccessor, type RelationMutator, type RelationNames, type RelationPredicate, type RelationPredicateInput, type RelationsOf, type RowType, type RuntimeQueryable, type ScalarUpdateInput, type ShorthandWhereFilter, type TableScope, type TableStorageCoordinate, type ToManyRelationAccessor, type ToOneRelationAccessor, type TypeState, type UniqueConstraintCriterion, type UniquelyFiltered, type WhereCallbackResult, all, and, createCollectionTables, createModelAccessor, createPreparedRowQuery, emptyState, not, or, orderByField, orm, prepareQuery };
1946
1992
  //# sourceMappingURL=orm-client.d.mts.map