@prisma/orm-family-sql 8.0.0-rc.1-dev.46 → 8.0.0-rc.10-dev.1

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 (207) hide show
  1. package/README.md +2 -6
  2. package/dist/{ast-Lbl4VwqP.mjs → ast-5tg0fGPQ.mjs} +2 -58
  3. package/dist/ast-5tg0fGPQ.mjs.map +1 -0
  4. package/dist/{ast-HFcfQZr-.d.mts → ast-DuLukI6f.d.mts} +4 -36
  5. package/dist/ast-DuLukI6f.d.mts.map +1 -0
  6. package/dist/{authored-check-naming-Hf9990DV.mjs → authored-check-naming-BEvfamnI.mjs} +2 -2
  7. package/dist/{authored-check-naming-Hf9990DV.mjs.map → authored-check-naming-BEvfamnI.mjs.map} +1 -1
  8. package/dist/{authoring-type-constructors-Blqoa2Ua-DqvNCOb2.mjs → authoring-type-constructors-BD-XuavC-CJV-TxFh.mjs} +10 -4
  9. package/dist/authoring-type-constructors-BD-XuavC-CJV-TxFh.mjs.map +1 -0
  10. package/dist/builder.d.mts +3 -3
  11. package/dist/builder__runtime.d.mts +26 -9
  12. package/dist/builder__runtime.d.mts.map +1 -1
  13. package/dist/builder__runtime.mjs +18 -9
  14. package/dist/builder__runtime.mjs.map +1 -1
  15. package/dist/builder__types.d.mts +3 -3
  16. package/dist/{codec-descriptor-registry-N0dhtKaH.mjs → codec-descriptor-registry-ECZ4ohtG.mjs} +2 -2
  17. package/dist/{codec-descriptor-registry-N0dhtKaH.mjs.map → codec-descriptor-registry-ECZ4ohtG.mjs.map} +1 -1
  18. package/dist/{config-types-gAm54C_v.mjs → config-types-BNJgLUUQ.mjs} +2 -2
  19. package/dist/{config-types-gAm54C_v.mjs.map → config-types-BNJgLUUQ.mjs.map} +1 -1
  20. package/dist/{config-types-D9fdKG3g.d.mts → config-types-Bd3ud-mX.d.mts} +3 -3
  21. package/dist/{config-types-D9fdKG3g.d.mts.map → config-types-Bd3ud-mX.d.mts.map} +1 -1
  22. package/dist/{contract-builder-D4a5dT7j.mjs → contract-builder-BOmEsrRi.mjs} +24 -5
  23. package/dist/contract-builder-BOmEsrRi.mjs.map +1 -0
  24. package/dist/{contract-builder-CG_tGDbB.d.mts → contract-builder-De_sioHE.d.mts} +15 -3
  25. package/dist/contract-builder-De_sioHE.d.mts.map +1 -0
  26. package/dist/contract-emitter.mjs +1 -1
  27. package/dist/contract-psl.d.mts +1 -1
  28. package/dist/contract-psl.mjs +1 -1
  29. package/dist/contract-psl__attribute-specs.d.mts +77 -0
  30. package/dist/contract-psl__attribute-specs.d.mts.map +1 -0
  31. package/dist/contract-psl__attribute-specs.mjs +2 -0
  32. package/dist/contract-psl__provider.d.mts +1 -1
  33. package/dist/contract-psl__provider.mjs +3 -3
  34. package/dist/contract-psl__provider.mjs.map +1 -1
  35. package/dist/contract-ts.d.mts +3 -3
  36. package/dist/contract-ts.mjs +3 -3
  37. package/dist/contract-ts__config-types.d.mts +1 -1
  38. package/dist/contract-ts__config-types.mjs +1 -1
  39. package/dist/contract-ts__contract-builder.d.mts +2 -2
  40. package/dist/contract-ts__contract-builder.mjs +2 -2
  41. package/dist/contract.d.mts +3 -3
  42. package/dist/contract.mjs +6 -6
  43. package/dist/contract__authored-check-naming.mjs +1 -1
  44. package/dist/contract__foreign-key-materialization.mjs +1 -1
  45. package/dist/contract__index-naming.mjs +1 -1
  46. package/dist/contract__types.d.mts +2 -2
  47. package/dist/contract__types.mjs +2 -2
  48. package/dist/contract__validators.d.mts +2 -2
  49. package/dist/contract__validators.mjs +2 -2
  50. package/dist/{control-D3cB5YQp.mjs → control-BIIMOKMy.mjs} +11 -9
  51. package/dist/control-BIIMOKMy.mjs.map +1 -0
  52. package/dist/{control-adapter-C99J7aEF-B7eQd7vD.d.mts → control-adapter-C99J7aEF-GODO43Ai.d.mts} +5 -5
  53. package/dist/{control-adapter-C99J7aEF-B7eQd7vD.d.mts.map → control-adapter-C99J7aEF-GODO43Ai.d.mts.map} +1 -1
  54. package/dist/control-adapter-DzTFiMaG.d.mts +1 -0
  55. package/dist/{control-DTLJ1WtZ.d.mts → control-b-6t8eI_.d.mts} +138 -19
  56. package/dist/control-b-6t8eI_.d.mts.map +1 -0
  57. package/dist/{db-D18PrXKW-DvTv4JFn.d.mts → db-BhQdL6Za-DubRGJvv.d.mts} +86 -62
  58. package/dist/{db-D18PrXKW-DvTv4JFn.d.mts.map → db-BhQdL6Za-DubRGJvv.d.mts.map} +1 -1
  59. package/dist/{ddl-types-CXx4vPz6-BsgrnSUY.d.mts → ddl-types-CXx4vPz6-Dko-GTTj.d.mts} +3 -3
  60. package/dist/{ddl-types-CXx4vPz6-BsgrnSUY.d.mts.map → ddl-types-CXx4vPz6-Dko-GTTj.d.mts.map} +1 -1
  61. package/dist/{derived-checks-DFMRmiAu-DGfB8aS4.mjs → derived-checks-DGjY5t7S-B3txNm7X.mjs} +48 -15
  62. package/dist/derived-checks-DGjY5t7S-B3txNm7X.mjs.map +1 -0
  63. package/dist/{derived-checks-DPdD01O0-DGqOFjs6.d.mts → derived-checks-DPdD01O0-DNBs1ZDA.d.mts} +2 -2
  64. package/dist/{derived-checks-DPdD01O0-DGqOFjs6.d.mts.map → derived-checks-DPdD01O0-DNBs1ZDA.d.mts.map} +1 -1
  65. package/dist/{diff-DbTNVm2f.d.mts → diff-CN1ou7vM.d.mts} +5 -5
  66. package/dist/{diff-DbTNVm2f.d.mts.map → diff-CN1ou7vM.d.mts.map} +1 -1
  67. package/dist/{dist-ZK6oeI5e.mjs → dist-D5__KJs-.mjs} +2 -1
  68. package/dist/dist-D5__KJs-.mjs.map +1 -0
  69. package/dist/{expression-CX5mTA-z.mjs → expression-B2Ox7zKM.mjs} +6 -2
  70. package/dist/expression-B2Ox7zKM.mjs.map +1 -0
  71. package/dist/{expression-FJK6Ar-d.d.mts → expression-mku9I7Ue.d.mts} +16 -7
  72. package/dist/{expression-FJK6Ar-d.d.mts.map → expression-mku9I7Ue.d.mts.map} +1 -1
  73. package/dist/family.d.mts +10 -10
  74. package/dist/family.mjs +8 -8
  75. package/dist/family__control-adapter.d.mts +2 -2
  76. package/dist/family__control.d.mts +4 -4
  77. package/dist/family__control.mjs +4 -4
  78. package/dist/family__diff.d.mts +2 -2
  79. package/dist/family__diff.mjs +1 -1
  80. package/dist/family__ir.d.mts +1 -1
  81. package/dist/family__ir.mjs +1 -1
  82. package/dist/family__migration.d.mts +1 -1
  83. package/dist/family__pack.d.mts +72 -0
  84. package/dist/family__pack.d.mts.map +1 -1
  85. package/dist/family__pack.mjs +4 -2
  86. package/dist/family__pack.mjs.map +1 -1
  87. package/dist/family__psl-infer.mjs +1 -1
  88. package/dist/family__runtime.d.mts +1 -1
  89. package/dist/family__runtime.mjs +1 -1
  90. package/dist/family__verify.mjs +1 -1
  91. package/dist/{foreign-key-materialization-Cu7-7LHl.mjs → foreign-key-materialization-0TrwfShD.mjs} +2 -2
  92. package/dist/{foreign-key-materialization-Cu7-7LHl.mjs.map → foreign-key-materialization-0TrwfShD.mjs.map} +1 -1
  93. package/dist/{index-C5I8D-MB.d.mts → index-CLAshwKN.d.mts} +2 -2
  94. package/dist/{index-C5I8D-MB.d.mts.map → index-CLAshwKN.d.mts.map} +1 -1
  95. package/dist/{index-C-vQOMY_.d.mts → index-DzBzeTAy.d.mts} +10 -10
  96. package/dist/{index-C-vQOMY_.d.mts.map → index-DzBzeTAy.d.mts.map} +1 -1
  97. package/dist/{index-naming-DREt6js7-CRH27yUv.mjs → index-naming-fQMLqyC4-4FzPVtCR.mjs} +4 -4
  98. package/dist/index-naming-fQMLqyC4-4FzPVtCR.mjs.map +1 -0
  99. package/dist/{interpreter-DyiUUAWh-DYdjIpiE.mjs → interpreter-CZ_iVQV4-CJ6COgSE.mjs} +123 -302
  100. package/dist/interpreter-CZ_iVQV4-CJ6COgSE.mjs.map +1 -0
  101. package/dist/ir-I-xciGUH.mjs.map +1 -1
  102. package/dist/{ir-Bghjt-FG.d.mts → ir-R9GE8gsm.d.mts} +2 -2
  103. package/dist/{ir-Bghjt-FG.d.mts.map → ir-R9GE8gsm.d.mts.map} +1 -1
  104. package/dist/{middleware-AhTz1BOW-th-Suxuf.d.mts → middleware-AhTz1BOW-CtQWS4mb.d.mts} +2 -2
  105. package/dist/{middleware-AhTz1BOW-th-Suxuf.d.mts.map → middleware-AhTz1BOW-CtQWS4mb.d.mts.map} +1 -1
  106. package/dist/middleware-Cev-ZFyS.d.mts +1 -0
  107. package/dist/{migration-CjDRZNep.d.mts → migration-Bhce5i_m.d.mts} +3 -3
  108. package/dist/{migration-CjDRZNep.d.mts.map → migration-Bhce5i_m.d.mts.map} +1 -1
  109. package/dist/operations.d.mts +1 -1
  110. package/dist/orm-client.d.mts +131 -95
  111. package/dist/orm-client.d.mts.map +1 -1
  112. package/dist/orm-client.mjs +1021 -942
  113. package/dist/orm-client.mjs.map +1 -1
  114. package/dist/plan-C7VP7jOh.d.mts +2 -0
  115. package/dist/{plan-CDxduYaN-pLIyyJaB.d.mts → plan-CDxduYaN-B2kMLIQQ.d.mts} +3 -3
  116. package/dist/{plan-CDxduYaN-pLIyyJaB.d.mts.map → plan-CDxduYaN-B2kMLIQQ.d.mts.map} +1 -1
  117. package/dist/{prepared-statement-9QpkE6JG-C430V3MO.d.mts → prepared-statement-9QpkE6JG-B9xqBu5T.d.mts} +16 -16
  118. package/dist/{prepared-statement-9QpkE6JG-C430V3MO.d.mts.map → prepared-statement-9QpkE6JG-B9xqBu5T.d.mts.map} +1 -1
  119. package/dist/{psl-infer-Dk5kgKre.mjs → psl-infer-TBwKfKgU.mjs} +2 -2
  120. package/dist/{psl-infer-Dk5kgKre.mjs.map → psl-infer-TBwKfKgU.mjs.map} +1 -1
  121. package/dist/query-lane-context-CGdMIEuv.d.mts +1 -0
  122. package/dist/{query-lane-context-Qa-eddrE-kuZ8Z86-.d.mts → query-lane-context-Qa-eddrE-BQV6J9nV.d.mts} +4 -4
  123. package/dist/{query-lane-context-Qa-eddrE-kuZ8Z86-.d.mts.map → query-lane-context-Qa-eddrE-BQV6J9nV.d.mts.map} +1 -1
  124. package/dist/relational-core.d.mts +12 -12
  125. package/dist/relational-core.mjs +3 -3
  126. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  127. package/dist/relational-core__ast.d.mts +4 -4
  128. package/dist/relational-core__ast.mjs +2 -2
  129. package/dist/relational-core__codec-descriptor-registry.d.mts +3 -3
  130. package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
  131. package/dist/relational-core__contract-free.d.mts +3 -3
  132. package/dist/relational-core__expression.d.mts +1 -1
  133. package/dist/relational-core__expression.mjs +1 -1
  134. package/dist/relational-core__middleware.d.mts +2 -2
  135. package/dist/relational-core__plan.d.mts +3 -3
  136. package/dist/relational-core__query-lane-context.d.mts +2 -2
  137. package/dist/relational-core__types.d.mts +2 -2
  138. package/dist/{runtime-DpKF2Yu2.d.mts → runtime-CzCx0TKe.d.mts} +3 -3
  139. package/dist/{runtime-DpKF2Yu2.d.mts.map → runtime-CzCx0TKe.d.mts.map} +1 -1
  140. package/dist/{runtime-tIHpGCcG.mjs → runtime-PknWErjr.mjs} +2 -2
  141. package/dist/{runtime-tIHpGCcG.mjs.map → runtime-PknWErjr.mjs.map} +1 -1
  142. package/dist/runtime.d.mts +4 -4
  143. package/dist/runtime.mjs +2 -2
  144. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  145. package/dist/{schema-differ-DpG_gnur-DFAtGezx.d.mts → schema-differ-DpG_gnur-BICVtTHY.d.mts} +2 -2
  146. package/dist/{schema-differ-DpG_gnur-DFAtGezx.d.mts.map → schema-differ-DpG_gnur-BICVtTHY.d.mts.map} +1 -1
  147. package/dist/schema-ir.mjs +1 -1
  148. package/dist/schema-ir__types.mjs +1 -1
  149. package/dist/{schema-verify-C_PEdlAr-Dxxjm6EM.mjs → schema-verify-C_PEdlAr-CmXrFuW1.mjs} +2 -2
  150. package/dist/{schema-verify-C_PEdlAr-Dxxjm6EM.mjs.map → schema-verify-C_PEdlAr-CmXrFuW1.mjs.map} +1 -1
  151. package/dist/sql-attribute-specs-CG0yitvD-CG-0eW98.mjs +275 -0
  152. package/dist/sql-attribute-specs-CG0yitvD-CG-0eW98.mjs.map +1 -0
  153. package/dist/{sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs → sql-contract-serializer-Bxu4a5oQ-D0lKpb4a.mjs} +24 -5
  154. package/dist/sql-contract-serializer-Bxu4a5oQ-D0lKpb4a.mjs.map +1 -0
  155. package/dist/{sql-execution-plan--jKyLpe5-CMGhgO0M.d.mts → sql-execution-plan--jKyLpe5-Bcz9QM2s.d.mts} +2 -2
  156. package/dist/{sql-execution-plan--jKyLpe5-CMGhgO0M.d.mts.map → sql-execution-plan--jKyLpe5-Bcz9QM2s.d.mts.map} +1 -1
  157. package/dist/{timestamp-now-generator-DRXygu32-DN9Qb1uI.mjs → timestamp-now-generator-BZnBo7IC-DbN5Apqe.mjs} +27 -19
  158. package/dist/timestamp-now-generator-BZnBo7IC-DbN5Apqe.mjs.map +1 -0
  159. package/dist/{types-4YenawkP-CwaaZSid.mjs → types-BvupgHcG-c8QDupnu.mjs} +13 -6
  160. package/dist/types-BvupgHcG-c8QDupnu.mjs.map +1 -0
  161. package/dist/{types-UcHa2cTe.d.mts → types-C36_3E6_.d.mts} +3 -2
  162. package/dist/types-C36_3E6_.d.mts.map +1 -0
  163. package/dist/{types-CyxGtOOh-BggSa6Fe.d.mts → types-CyxGtOOh-BJnoWm0f.d.mts} +8 -8
  164. package/dist/{types-CyxGtOOh-BggSa6Fe.d.mts.map → types-CyxGtOOh-BJnoWm0f.d.mts.map} +1 -1
  165. package/dist/{types-CUsJrvEl.mjs → types-D0B65hip.mjs} +3 -2
  166. package/dist/types-D0B65hip.mjs.map +1 -0
  167. package/dist/types-DvsoMNLs.d.mts +1 -0
  168. package/dist/{types-IqZMLrFC-DcH8v_u3.d.mts → types-IqZMLrFC-BIRftuU7.d.mts} +4 -4
  169. package/dist/{types-IqZMLrFC-DcH8v_u3.d.mts.map → types-IqZMLrFC-BIRftuU7.d.mts.map} +1 -1
  170. package/dist/{types-v3qxLLxo-DCeKv7yY.d.mts → types-v3qxLLxo-Clw_yBAh.d.mts} +2 -2
  171. package/dist/{types-v3qxLLxo-DCeKv7yY.d.mts.map → types-v3qxLLxo-Clw_yBAh.d.mts.map} +1 -1
  172. package/dist/{validators-Belo8QqM.d.mts → validators-CbqMxQfW.d.mts} +23 -4
  173. package/dist/validators-CbqMxQfW.d.mts.map +1 -0
  174. package/dist/{validators-CrWD6bSP.mjs → validators-DD98VrpC.mjs} +0 -0
  175. package/dist/validators-DD98VrpC.mjs.map +1 -0
  176. package/dist/{verify-u0UTdZgD-DSAaz9rW.mjs → verify-ChiDeTk8-HEewdjrM.mjs} +3 -3
  177. package/dist/verify-ChiDeTk8-HEewdjrM.mjs.map +1 -0
  178. package/package.json +20 -21
  179. package/dist/ast-HFcfQZr-.d.mts.map +0 -1
  180. package/dist/ast-Lbl4VwqP.mjs.map +0 -1
  181. package/dist/authoring-type-constructors-Blqoa2Ua-DqvNCOb2.mjs.map +0 -1
  182. package/dist/contract-builder-CG_tGDbB.d.mts.map +0 -1
  183. package/dist/contract-builder-D4a5dT7j.mjs.map +0 -1
  184. package/dist/control-D3cB5YQp.mjs.map +0 -1
  185. package/dist/control-DTLJ1WtZ.d.mts.map +0 -1
  186. package/dist/control-adapter-MZJQiwcE.d.mts +0 -1
  187. package/dist/derived-checks-DFMRmiAu-DGfB8aS4.mjs.map +0 -1
  188. package/dist/dist-ZK6oeI5e.mjs.map +0 -1
  189. package/dist/expression-CX5mTA-z.mjs.map +0 -1
  190. package/dist/index-naming-DREt6js7-CRH27yUv.mjs.map +0 -1
  191. package/dist/interpreter-DyiUUAWh-DYdjIpiE.mjs.map +0 -1
  192. package/dist/lane-query-builder.d.mts +0 -236
  193. package/dist/lane-query-builder.d.mts.map +0 -1
  194. package/dist/lane-query-builder.mjs +0 -67
  195. package/dist/lane-query-builder.mjs.map +0 -1
  196. package/dist/middleware--TtoxUiW.d.mts +0 -1
  197. package/dist/plan-BHLdb0Z7.d.mts +0 -2
  198. package/dist/query-lane-context-XMvk7fmY.d.mts +0 -1
  199. package/dist/sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs.map +0 -1
  200. package/dist/timestamp-now-generator-DRXygu32-DN9Qb1uI.mjs.map +0 -1
  201. package/dist/types-4YenawkP-CwaaZSid.mjs.map +0 -1
  202. package/dist/types-B0msOnBM.d.mts +0 -1
  203. package/dist/types-CUsJrvEl.mjs.map +0 -1
  204. package/dist/types-UcHa2cTe.d.mts.map +0 -1
  205. package/dist/validators-Belo8QqM.d.mts.map +0 -1
  206. package/dist/validators-CrWD6bSP.mjs.map +0 -1
  207. package/dist/verify-u0UTdZgD-DSAaz9rW.mjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { c as SqlStorage } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
2
- import "./types-UcHa2cTe.mjs";
3
- import { f as SqlMigrationPlanOperation, w as SqlPlanTargetDetails } from "./types-IqZMLrFC-DcH8v_u3.mjs";
2
+ import "./types-C36_3E6_.mjs";
3
+ import { f as SqlMigrationPlanOperation, w as SqlPlanTargetDetails } from "./types-IqZMLrFC-BIRftuU7.mjs";
4
4
  import { Contract } from "@prisma/orm-framework/contract/types";
5
5
  import { Migration } from "@prisma/orm-toolchain/migration-tools/migration";
6
6
  //#region ../../../2-sql/9-family/dist/migration.d.mts
@@ -41,4 +41,4 @@ declare abstract class SqlMigration<TDetails extends SqlPlanTargetDetails, TTarg
41
41
  }
42
42
  //#endregion
43
43
  export { SqlMigration as t };
44
- //# sourceMappingURL=migration-CjDRZNep.d.mts.map
44
+ //# sourceMappingURL=migration-Bhce5i_m.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migration-CjDRZNep.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/migration.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA0BuB,aAAa,iBAAiB,sBAAsB,mCAAmC,cAAc,SAAS,cAAc,SAAS,aAAa,YAAY,SAAS,cAAc,SAAS,qBAAqB,UAAU,0BAA0B,kBAAkB,WAAW,OAAO;;;;;;;;;;;MAW5S"}
1
+ {"version":3,"file":"migration-Bhce5i_m.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/migration.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA0BuB,aAAa,iBAAiB,sBAAsB,mCAAmC,cAAc,SAAS,cAAc,SAAS,aAAa,YAAY,SAAS,cAAc,SAAS,qBAAqB,UAAU,0BAA0B,kBAAkB,WAAW,OAAO;;;;;;;;;;;MAW5S"}
@@ -1,2 +1,2 @@
1
- import { a as SqlOperationRegistry, i as SqlOperationEntry, n as SqlOperationDescriptor, o as createSqlOperationRegistry, r as SqlOperationDescriptors, t as SqlLoweringSpec } from "./index-C5I8D-MB.mjs";
1
+ import { a as SqlOperationRegistry, i as SqlOperationEntry, n as SqlOperationDescriptor, o as createSqlOperationRegistry, r as SqlOperationDescriptors, t as SqlLoweringSpec } from "./index-CLAshwKN.mjs";
2
2
  export { SqlLoweringSpec, SqlOperationDescriptor, SqlOperationDescriptors, SqlOperationEntry, SqlOperationRegistry, createSqlOperationRegistry };
@@ -1,14 +1,14 @@
1
- import { r as StorageTable, t as StorageColumn } from "./storage-table-DSeWszOL-CI-cItEK.mjs";
1
+ import { t as StorageColumn } from "./storage-table-DSeWszOL-CI-cItEK.mjs";
2
2
  import { c as SqlStorage } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
3
3
  import { f as ExtractFieldOutputTypes, l as ExtractAggregateTypes, p as ExtractQueryOperationTypes, u as ExtractCodecTypes } from "./types-BDUG29Df-LE85dIXP.mjs";
4
- import "./types-UcHa2cTe.mjs";
5
- import { It as WhereArg, T as CodecRef$1, a as AndExpr, g as BinaryExpr, gt as OrderByItem, ht as OrExpr, pt as NullCheckExpr, r as AggregateFn, s as AnyExpression } from "./types-v3qxLLxo-DCeKv7yY.mjs";
6
- import "./ast-HFcfQZr-.mjs";
7
- import { o as Expression } from "./expression-FJK6Ar-d.mjs";
8
- import { r as ExecutionContext } from "./query-lane-context-Qa-eddrE-kuZ8Z86-.mjs";
9
- import "./query-lane-context-XMvk7fmY.mjs";
10
- import { h as RuntimeScope, o as ComputeColumnJsType } from "./types-CyxGtOOh-BggSa6Fe.mjs";
11
- import "./types-B0msOnBM.mjs";
4
+ import "./types-C36_3E6_.mjs";
5
+ import { It as WhereArg, T as CodecRef$1, a as AndExpr, g as BinaryExpr, gt as OrderByItem, ht as OrExpr, pt as NullCheckExpr, r as AggregateFn, s as AnyExpression } from "./types-v3qxLLxo-Clw_yBAh.mjs";
6
+ import "./ast-DuLukI6f.mjs";
7
+ import { o as Expression } from "./expression-mku9I7Ue.mjs";
8
+ import { r as ExecutionContext } from "./query-lane-context-Qa-eddrE-BQV6J9nV.mjs";
9
+ import "./query-lane-context-CGdMIEuv.mjs";
10
+ import { h as RuntimeScope, o as ComputeColumnJsType } from "./types-CyxGtOOh-BJnoWm0f.mjs";
11
+ import "./types-DvsoMNLs.mjs";
12
12
  import { Contract } from "@prisma/orm-framework/contract/types";
13
13
  import { AnnotationValue, AsyncIterableResult, MetaBuilder, OperationKind } from "@prisma/orm-framework/components/runtime";
14
14
  import { SimplifyDeep } from "@prisma/orm-framework/utils/simplify-deep";
@@ -74,14 +74,27 @@ interface CollectionState {
74
74
  readonly variantName: string | undefined;
75
75
  /**
76
76
  * Annotations attached to this query at terminal-call time.
77
- * Populated transiently by terminal methods (`first`, `all`, `create`,
78
- * etc.) just before dispatch `Collection` itself has no chainable
79
- * `.annotate()`. Stored as a `Map<namespace, AnnotationValue>` so
77
+ * Populated transiently by the read terminals `all` and `first` just before dispatch. Terminals
78
+ * that compile a plan directly attach annotations to it with `mergeAnnotations` instead; nested
79
+ * `create()`/`update()` validate annotations and then discard them.
80
+ * `Collection` itself has no chainable `.annotate()`. Stored as a
81
+ * `Map<namespace, AnnotationValue>` so
80
82
  * duplicate namespaces last-write-win. Empty on a fresh state.
81
83
  */
82
84
  readonly annotations: ReadonlyMap<string, AnnotationValue<unknown, OperationKind>>;
83
85
  }
84
86
  declare function emptyState(): CollectionState;
87
+ /**
88
+ * `GroupedCollection`'s own post-group chain — orders/pages the grouped rows
89
+ * themselves. Kept separate from {@link CollectionState}: pre-group and
90
+ * post-group clauses are different clauses at different levels, and merging
91
+ * them into one state is the defect this shape exists to prevent.
92
+ */
93
+ interface GroupPagingState {
94
+ readonly orderBy: readonly OrderByItem[];
95
+ readonly limit: number | undefined;
96
+ readonly offset: number | undefined;
97
+ }
85
98
  interface CollectionTypeState {
86
99
  readonly hasOrderBy: boolean;
87
100
  readonly hasWhere: boolean;
@@ -187,7 +200,7 @@ type OpMatchesField<Op, CodecId extends string, CT extends Record<string, unknow
187
200
  } ? CodecId extends keyof CT ? CT[CodecId] extends {
188
201
  readonly traits: infer FieldTraits;
189
202
  } ? [RequiredTraits[number]] extends [FieldTraits] ? true : false : false : false : false : false;
190
- type FieldOperations<TContract extends Contract<SqlStorage>, ModelName extends string, FieldName extends string> = FieldCodecId<TContract, ModelName, FieldName> extends (infer CodecId extends string) ? ExtractQueryOperationTypes<TContract> extends (infer AllOps) ? { [OpName in keyof AllOps & string as OpMatchesField<AllOps[OpName], CodecId, ExtractCodecTypes<TContract>> extends true ? OpName : never]: QueryOperationMethod<AllOps[OpName], ExtractCodecTypes<TContract>>; } : unknown : unknown;
203
+ type FieldOperations<TContract extends Contract<SqlStorage>, NsId extends string, ModelName extends string, FieldName extends string> = FieldCodecId<TContract, ModelName, FieldName, NsId> extends (infer CodecId extends string) ? ExtractQueryOperationTypes<TContract> extends (infer AllOps) ? { [OpName in keyof AllOps & string as OpMatchesField<AllOps[OpName], CodecId, ExtractCodecTypes<TContract>> extends true ? OpName : never]: QueryOperationMethod<AllOps[OpName], ExtractCodecTypes<TContract>>; } : unknown : unknown;
191
204
  /**
192
205
  * Declares trait requirements and runtime factory for each comparison method.
193
206
  *
@@ -249,19 +262,20 @@ declare const COMPARISON_METHODS_META: {
249
262
  };
250
263
  };
251
264
  type ComparisonMethodsMeta = typeof COMPARISON_METHODS_META;
252
- type RelationPredicate<TContract extends Contract<SqlStorage>, ModelName extends string> = (model: ModelAccessor<TContract, ModelName>) => AnyExpression;
253
- type RelationPredicateInput<TContract extends Contract<SqlStorage>, ModelName extends string> = RelationPredicate<TContract, ModelName> | Record<string, unknown>;
254
- type RelationFilterAccessor<TContract extends Contract<SqlStorage>, RelatedModelName extends string> = {
255
- some(predicate?: RelationPredicateInput<TContract, RelatedModelName>): AnyExpression;
256
- every(predicate: RelationPredicateInput<TContract, RelatedModelName>): AnyExpression;
257
- none(predicate?: RelationPredicateInput<TContract, RelatedModelName>): AnyExpression;
265
+ type DomainNamespaceId<TContract extends Contract<SqlStorage>> = keyof TContract['domain']['namespaces'] & string;
266
+ type RelationPredicate<TContract extends Contract<SqlStorage>, NsId extends DomainNamespaceId<TContract>, ModelName extends string> = (model: ModelAccessor<TContract, ModelName, NsId>) => AnyExpression;
267
+ type RelationPredicateInput<TContract extends Contract<SqlStorage>, NsId extends DomainNamespaceId<TContract>, ModelName extends string> = RelationPredicate<TContract, NsId, ModelName> | Record<string, unknown>;
268
+ type RelationFilterAccessor<TContract extends Contract<SqlStorage>, RelatedNsId extends DomainNamespaceId<TContract>, RelatedModelName extends string> = {
269
+ some(predicate?: RelationPredicateInput<TContract, RelatedNsId, RelatedModelName>): AnyExpression;
270
+ every(predicate: RelationPredicateInput<TContract, RelatedNsId, RelatedModelName>): AnyExpression;
271
+ none(predicate?: RelationPredicateInput<TContract, RelatedNsId, RelatedModelName>): AnyExpression;
258
272
  };
259
273
  type ScalarModelAccessor<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = { [K in keyof FieldsOf<TContract, ModelName, NsId> & string]: Expression<{
260
274
  codecId: FieldCodecId<TContract, ModelName, K, NsId>;
261
275
  nullable: FieldNullable<TContract, ModelName, K, NsId>;
262
- }> & ComparisonMethods<FieldJsType<TContract, ModelName, K, NsId>, FieldTraits<TContract, ModelName, K, NsId>> & FieldOperations<TContract, ModelName, K>; };
263
- type RelationModelAccessor<TContract extends Contract<SqlStorage>, ModelName extends string> = { [K in RelationNames<TContract, ModelName>]: RelationFilterAccessor<TContract, RelatedModelName<TContract, ModelName, K> & string>; };
264
- type ModelAccessor<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = ScalarModelAccessor<TContract, ModelName, NsId> & RelationModelAccessor<TContract, ModelName>;
276
+ }> & ComparisonMethods<FieldJsType<TContract, ModelName, K, NsId>, FieldTraits<TContract, ModelName, K, NsId>> & FieldOperations<TContract, NsId, ModelName, K>; };
277
+ type RelationModelAccessor<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = { [K in RelationNames<TContract, ModelName, NsId>]: RelationFilterAccessor<TContract, RelationTargetNamespace<TContract, ModelName, K, NsId>, RelatedModelName<TContract, ModelName, K, NsId> & string>; };
278
+ type ModelAccessor<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = ScalarModelAccessor<TContract, ModelName, NsId> & RelationModelAccessor<TContract, ModelName, NsId>;
265
279
  /**
266
280
  * The predicate accessor for a collection narrowed to a variant. When a real
267
281
  * variant is selected its (possibly MTI) fields and relations are merged onto
@@ -269,7 +283,7 @@ type ModelAccessor<TContract extends Contract<SqlStorage>, ModelName extends str
269
283
  * `t.variant('Feature').where(x => x.assignee.some(…))` type-check; with no
270
284
  * variant the accessor is the plain base `ModelAccessor` and is unchanged.
271
285
  */
272
- type VariantAwareModelAccessor<TContract extends Contract<SqlStorage>, ModelName extends string, VariantName extends string | undefined, NsId extends string = never> = [VariantName] extends [string] ? VariantName extends VariantNames<TContract, ModelName, NsId> ? ScalarModelAccessor<TContract, ModelName, NsId> & ScalarModelAccessor<TContract, VariantName, NsId> & RelationModelAccessor<TContract, ModelName> & RelationModelAccessor<TContract, VariantName> : ModelAccessor<TContract, ModelName, NsId> : ModelAccessor<TContract, ModelName, NsId>;
286
+ type VariantAwareModelAccessor<TContract extends Contract<SqlStorage>, ModelName extends string, VariantName extends string | undefined, NsId extends string = never> = [VariantName] extends [string] ? VariantName extends VariantNames<TContract, ModelName, NsId> ? ScalarModelAccessor<TContract, ModelName, NsId> & ScalarModelAccessor<TContract, VariantName, NsId> & RelationModelAccessor<TContract, ModelName, NsId> & RelationModelAccessor<TContract, VariantName, NsId> : ModelAccessor<TContract, ModelName, NsId> : ModelAccessor<TContract, ModelName, NsId>;
273
287
  /**
274
288
  * The flat default row of a single model: its own declared fields mapped to
275
289
  * their JS types, with no variant flattening. Use this when you want exactly
@@ -458,7 +472,7 @@ type HavingMethod<TContract extends Contract<SqlStorage>, ModelName extends stri
458
472
  * methods.
459
473
  */
460
474
  type HavingBuilder<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = string extends AggregateOperationNames<TContract> ? AggregateOperationsUnavailable : { readonly [Op in AggregateOperationNames<TContract> & AggregateFn]: HavingMethod<TContract, ModelName, Op, NsId>; };
461
- type ShorthandWhereFilter<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = Partial<{ [K in keyof DefaultModelRow<TContract, ModelName, NsId> & string]: DefaultModelRow<TContract, ModelName, NsId>[K] | null | undefined; }>;
475
+ type ShorthandWhereFilter<TContract extends Contract<SqlStorage>, NsId extends DomainNamespaceId<TContract>, ModelName extends string> = Partial<{ [K in keyof DefaultModelRow<TContract, ModelName, NsId> & string]: DefaultModelRow<TContract, ModelName, NsId>[K] | null | undefined; }>;
462
476
  type NamespaceModelsOf<TContract extends Contract<SqlStorage>, NsId extends string> = NsId extends keyof TContract['domain']['namespaces'] ? TContract['domain']['namespaces'][NsId]['models'] extends (infer M extends Record<string, unknown>) ? M : Record<string, never> : Record<string, never>;
463
477
  type ScannedModelDef<TContract extends Contract<SqlStorage>, ModelName extends string> = { [Ns in keyof TContract['domain']['namespaces']]: ModelName extends keyof TContract['domain']['namespaces'][Ns]['models'] ? TContract['domain']['namespaces'][Ns]['models'][ModelName] : never; }[keyof TContract['domain']['namespaces']];
464
478
  type ModelDef<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = [NsId] extends [never] ? ScannedModelDef<TContract, ModelName> : ModelName extends keyof NamespaceModelsOf<TContract, NsId> ? NamespaceModelsOf<TContract, NsId>[ModelName] : never;
@@ -542,7 +556,8 @@ type IsOptionalCreateField<TContract extends Contract<SqlStorage>, ModelName ext
542
556
  type CreateFieldNames<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = keyof DefaultModelRow<TContract, ModelName, NsId> & string;
543
557
  type RequiredCreateFieldNames<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = { [K in CreateFieldNames<TContract, ModelName, NsId>]-?: IsOptionalCreateField<TContract, ModelName, K, NsId> extends true ? never : K; }[CreateFieldNames<TContract, ModelName, NsId>];
544
558
  type OptionalCreateFieldNames<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = { [K in CreateFieldNames<TContract, ModelName, NsId>]-?: IsOptionalCreateField<TContract, ModelName, K, NsId> extends true ? K : never; }[CreateFieldNames<TContract, ModelName, NsId>];
545
- type CreateInput<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = Pick<DefaultModelRow<TContract, ModelName, NsId>, RequiredCreateFieldNames<TContract, ModelName, NsId>> & Partial<Pick<DefaultModelRow<TContract, ModelName, NsId>, OptionalCreateFieldNames<TContract, ModelName, NsId>>> & RelationMutationFields<TContract, ModelName, 'create'>;
559
+ type ScalarCreateInput<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = Pick<DefaultModelRow<TContract, ModelName, NsId>, RequiredCreateFieldNames<TContract, ModelName, NsId>> & Partial<Pick<DefaultModelRow<TContract, ModelName, NsId>, OptionalCreateFieldNames<TContract, ModelName, NsId>>>;
560
+ type CreateInput<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = ScalarCreateInput<TContract, ModelName, NsId> & RelationMutationFields<TContract, ModelName, 'create'>;
546
561
  type IsPolymorphicBase<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = ModelDef<TContract, ModelName, NsId> extends {
547
562
  readonly discriminator: unknown;
548
563
  readonly variants: Record<string, unknown>;
@@ -554,6 +569,7 @@ type DiscriminatorFieldName<TContract extends Contract<SqlStorage>, ModelName ex
554
569
  } ? F : never;
555
570
  type VariantCreateInput<TContract extends Contract<SqlStorage>, BaseModelName extends string, VariantName extends string, NsId extends string = never> = Omit<CreateInput<TContract, BaseModelName, NsId>, DiscriminatorFieldName<TContract, BaseModelName, NsId>> & CreateInput<TContract, VariantName, NsId>;
556
571
  type ResolvedCreateInput<TContract extends Contract<SqlStorage>, ModelName extends string, VName extends string | undefined, NsId extends string = never> = IsPolymorphicBase<TContract, ModelName, NsId> extends true ? VName extends string ? VariantCreateInput<TContract, ModelName, VName, NsId> : never : CreateInput<TContract, ModelName, NsId>;
572
+ type ResolvedScalarCreateInput<TContract extends Contract<SqlStorage>, ModelName extends string, VName extends string | undefined, NsId extends string = never> = IsPolymorphicBase<TContract, ModelName, NsId> extends true ? VName extends string ? Omit<ScalarCreateInput<TContract, ModelName, NsId>, DiscriminatorFieldName<TContract, ModelName, NsId>> & ScalarCreateInput<TContract, VName, NsId> : never : ScalarCreateInput<TContract, ModelName, NsId>;
557
573
  type ModelStorageTableDef<TContract extends Contract<SqlStorage>, ModelName extends string> = ModelTableName<TContract, ModelName> extends (infer TableName extends string) ? NamespaceTableDef<TContract, TableName> : never;
558
574
  type PrimaryKeyConstraintColumns<TContract extends Contract<SqlStorage>, ModelName extends string> = ModelStorageTableDef<TContract, ModelName> extends {
559
575
  readonly primaryKey: {
@@ -682,31 +698,19 @@ type RelationModelName<Relation> = Relation extends {
682
698
  };
683
699
  } ? To : never;
684
700
  type RelatedModelName<TContract extends Contract<SqlStorage>, ModelName extends string, RelName extends string, NsId extends string = never> = RelationsOf<TContract, ModelName, NsId> extends (infer Rels) ? Rels extends Record<string, unknown> ? RelName extends keyof Rels ? RelationModelName<Rels[RelName]> : never : never : never;
701
+ type ContractNamespaceKey<TContract extends Contract<SqlStorage>, NsId extends string> = { [K in keyof TContract['domain']['namespaces'] & string]: NsId extends K ? K : never; }[keyof TContract['domain']['namespaces'] & string];
685
702
  type RelationTargetNamespace<TContract extends Contract<SqlStorage>, ModelName extends string, RelName extends string, NsId extends string = never> = [NsId] extends [never] ? never : RelationsOf<TContract, ModelName, NsId> extends (infer Rels) ? Rels extends Record<string, unknown> ? RelName extends keyof Rels ? Rels[RelName] extends {
686
703
  readonly to: {
687
704
  readonly namespace: infer N extends string;
688
705
  };
689
- } ? N : never : never : never : never;
706
+ } ? ContractNamespaceKey<TContract, N> : never : never : never : never;
690
707
  type RelationCardinalityFromRelation<Relation> = Relation extends {
691
708
  readonly cardinality: infer Cardinality extends RelationCardinalityTag;
692
709
  } ? Cardinality : '1:N';
693
710
  type RelationCardinality<TContract extends Contract<SqlStorage>, ModelName extends string, RelName extends string, NsId extends string = never> = RelationsOf<TContract, ModelName, NsId> extends (infer Rels) ? Rels extends Record<string, unknown> ? RelName extends keyof Rels ? RelationCardinalityFromRelation<Rels[RelName]> : '1:N' : '1:N' : '1:N';
694
- type RelationLocalFieldColumns<TContract extends Contract<SqlStorage>, ModelName extends string, Relation> = Relation extends {
695
- readonly on: {
696
- readonly localFields: infer Fields extends readonly string[];
697
- };
698
- } ? MapFieldsToColumns<TContract, ModelName, Fields> : readonly [];
699
- type MapFieldsToColumns<TContract extends Contract<SqlStorage>, ModelName extends string, Fields extends readonly string[]> = Fields extends readonly [infer Head extends string, ...infer Tail extends string[]] ? readonly [FieldColumnName<TContract, ModelName, Head>, ...MapFieldsToColumns<TContract, ModelName, Tail>] : readonly [];
700
- type AnyColumnNullable<Columns extends Record<string, StorageColumn>, ColNames extends readonly string[]> = ColNames extends readonly [infer Head extends string, ...infer Tail extends string[]] ? Head extends keyof Columns ? Columns[Head]['nullable'] extends true ? true : AnyColumnNullable<Columns, Tail> : true : false;
701
- type HasForeignKeyForCols<FKs extends readonly unknown[], Cols extends readonly string[]> = FKs extends readonly [infer Head, ...infer Tail extends unknown[]] ? Head extends {
702
- readonly source: {
703
- readonly columns: Cols;
704
- };
705
- } ? true : HasForeignKeyForCols<Tail, Cols> : false;
706
- type IsFkSideOfRelation<Table extends StorageTable, ParentCols extends readonly string[]> = Table extends {
707
- readonly foreignKeys: infer FKs extends readonly unknown[];
708
- } ? HasForeignKeyForCols<FKs, ParentCols> : false;
709
- type IsToOneRelationNullable<TContract extends Contract<SqlStorage>, ModelName extends string, RelName extends string, NsId extends string = never> = ModelTableName<TContract, ModelName, NsId> extends (infer TableName extends string) ? NamespaceTableDef<TContract, TableName, ResolvedNsId<TContract, ModelName, NsId>> extends (infer Table extends StorageTable) ? RelationsOf<TContract, ModelName, NsId> extends (infer Rels extends Record<string, unknown>) ? RelName extends keyof Rels ? RelationLocalFieldColumns<TContract, ModelName, Rels[RelName]> extends (infer Cols extends readonly string[]) ? IsFkSideOfRelation<Table, Cols> extends true ? AnyColumnNullable<Table['columns'], Cols> : true : true : true : true : true : true;
711
+ type IsToOneRelationNullable<TContract extends Contract<SqlStorage>, ModelName extends string, RelName extends string, NsId extends string = never> = RelationsOf<TContract, ModelName, NsId> extends (infer Rels extends Record<string, unknown>) ? RelName extends keyof Rels ? Rels[RelName] extends {
712
+ readonly nullable: false;
713
+ } ? false : true : true : true;
710
714
  type IncludeRelationValue<TContract extends Contract<SqlStorage>, ModelName extends string, RelName extends string, IncludedRow, NsId extends string = never> = RelationCardinality<TContract, ModelName, RelName, NsId> extends '1:1' | 'N:1' ? IsToOneRelationNullable<TContract, ModelName, RelName, NsId> extends true ? IncludedRow | null : IncludedRow : IncludedRow[];
711
715
  type CollectionModelName<TContract extends Contract<SqlStorage>> = { [Ns in keyof TContract['domain']['namespaces']]: keyof TContract['domain']['namespaces'][Ns]['models'] & string; }[keyof TContract['domain']['namespaces']];
712
716
  //#endregion
@@ -747,30 +751,58 @@ interface RowSelection<T> {
747
751
  }
748
752
  type IncludeRefinementValue<TContract extends Contract<SqlStorage>, ParentModelName extends string, RelName extends string, DefaultIncludedRow, RefinedResult, NsId extends string = never> = RefinedResult extends RowSelection<infer V> ? RefinedResult extends {
749
753
  readonly kind: 'includeScalar' | 'includeCombine';
750
- } ? V : IncludeRelationValue<TContract, ParentModelName, RelName, V, NsId> : IncludeRelationValue<TContract, ParentModelName, RelName, DefaultIncludedRow, NsId>;
754
+ } ? V : RefinedIncludeRelationValue<TContract, ParentModelName, RelName, V, NsId> : IncludeRelationValue<TContract, ParentModelName, RelName, DefaultIncludedRow, NsId>;
755
+ /**
756
+ * A refined to-one include is nullable whatever the relation's `nullable` flag
757
+ * says: the refinement's filter can exclude the related row.
758
+ */
759
+ type RefinedIncludeRelationValue<TContract extends Contract<SqlStorage>, ParentModelName extends string, RelName extends string, IncludedRow, NsId extends string = never> = IsToManyRelation<TContract, ParentModelName, RelName, NsId> extends true ? IncludedRow[] : IncludedRow | null;
751
760
  //#endregion
752
761
  //#region src/grouped-collection.d.ts
753
762
  interface GroupedCollectionInit {
754
763
  readonly tableName: string;
755
764
  readonly namespaceId: string;
756
- readonly baseFilters: readonly AnyExpression[];
765
+ readonly preGroupState: CollectionState;
757
766
  readonly groupByFields: readonly string[];
758
767
  readonly groupByColumns: readonly string[];
759
768
  readonly havingFilters: readonly AnyExpression[];
769
+ readonly postGroup: GroupPagingState;
760
770
  }
761
771
  type GroupByFieldName<TContract extends Contract<SqlStorage>, ModelName extends string, NsId extends string = never> = keyof DefaultModelRow<TContract, ModelName, NsId> & string;
762
- declare class GroupedCollection<TContract extends Contract<SqlStorage>, ModelName extends string, GroupFields extends readonly GroupByFieldName<TContract, ModelName, NsId>[], NsId extends string = never> {
772
+ type GroupedAggregateRow<TContract extends Contract<SqlStorage>, ModelName extends string, GroupFields extends readonly GroupByFieldName<TContract, ModelName, NsId>[], NsId extends string, Spec extends AggregateSpec> = SimplifyDeep<Pick<DefaultModelRow<TContract, ModelName, NsId>, GroupFields[number]> & AggregateResult<Spec>>;
773
+ declare class GroupedCollection<TContract extends Contract<SqlStorage>, ModelName extends string, GroupFields extends readonly GroupByFieldName<TContract, ModelName, NsId>[], NsId extends string = never, HasOrderBy extends boolean = false> {
774
+ #private;
763
775
  readonly ctx: CollectionContext<TContract>;
764
776
  private readonly contract;
765
777
  readonly modelName: ModelName;
766
778
  readonly tableName: string;
767
- readonly namespaceId: string;
768
- readonly baseFilters: readonly AnyExpression[];
779
+ readonly namespaceId: NsId;
780
+ readonly preGroupState: CollectionState;
769
781
  readonly groupByFields: readonly string[];
770
782
  readonly groupByColumns: readonly string[];
771
783
  readonly havingFilters: readonly AnyExpression[];
784
+ readonly postGroup: GroupPagingState;
772
785
  constructor(ctx: CollectionContext<TContract>, modelName: ModelName, options: GroupedCollectionInit);
773
- having(predicate: (having: HavingBuilder<TContract, ModelName, NsId>) => AnyExpression): GroupedCollection<TContract, ModelName, GroupFields, NsId>;
786
+ having(predicate: (having: HavingBuilder<TContract, ModelName, NsId>) => AnyExpression): GroupedCollection<TContract, ModelName, GroupFields, NsId, HasOrderBy>;
787
+ /**
788
+ * Append an `ORDER BY` clause on the grouped rows themselves — orders by
789
+ * group key. Ordering by an aggregate alias needs a builder surface over
790
+ * the aliases and isn't supported here. Unlocks post-group `limit(...)` /
791
+ * `offset(...)`, which page a group order that would otherwise be undefined.
792
+ */
793
+ orderBy(selection: ((model: Pick<ModelAccessor<TContract, ModelName, NsId>, GroupFields[number]>) => OrderByItem) | readonly [(model: Pick<ModelAccessor<TContract, ModelName, NsId>, GroupFields[number]>) => OrderByItem, ...ReadonlyArray<(model: Pick<ModelAccessor<TContract, ModelName, NsId>, GroupFields[number]>) => OrderByItem>]): GroupedCollection<TContract, ModelName, GroupFields, NsId, true>;
794
+ /**
795
+ * Apply `LIMIT n` to the grouped rows. Replaces any previous post-group
796
+ * limit. Requires a prior `orderBy(...)` — a database may return groups in
797
+ * any order, so "the first n groups" is undefined without one.
798
+ */
799
+ limit(n: HasOrderBy extends true ? number : never): GroupedCollection<TContract, ModelName, GroupFields, NsId, HasOrderBy>;
800
+ /**
801
+ * Apply `OFFSET n` to the grouped rows. Replaces any previous post-group
802
+ * offset. Requires a prior `orderBy(...)`, same as `limit(...)` — both
803
+ * pagination methods need a deterministic group order.
804
+ */
805
+ offset(n: HasOrderBy extends true ? number : never): GroupedCollection<TContract, ModelName, GroupFields, NsId, HasOrderBy>;
774
806
  /**
775
807
  * Read terminal: run a grouped aggregate query.
776
808
  *
@@ -778,7 +810,7 @@ declare class GroupedCollection<TContract extends Contract<SqlStorage>, ModelNam
778
810
  * `MetaBuilder<'read'>` for attaching typed annotations.
779
811
  * Annotations are merged into the compiled plan's `meta.annotations`.
780
812
  */
781
- aggregate<Spec extends AggregateSpec>(fn: (aggregate: AggregateBuilder<TContract, ModelName, NsId>) => Spec, configure?: (meta: MetaBuilder<'read'>) => void): Promise<Array<SimplifyDeep<Pick<DefaultModelRow<TContract, ModelName, NsId>, GroupFields[number]> & AggregateResult<Spec>>>>;
813
+ aggregate<Spec extends AggregateSpec>(fn: (aggregate: AggregateBuilder<TContract, ModelName, NsId>) => Spec, configure?: (meta: MetaBuilder<'read'>) => void): Promise<Array<GroupedAggregateRow<TContract, ModelName, GroupFields, NsId, Spec>>>;
782
814
  }
783
815
  //#endregion
784
816
  //#region src/collection.d.ts
@@ -786,6 +818,7 @@ type WhereDirectInput = WhereArg;
786
818
  declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName extends string, Row = SimplifyDeep<InferRootRow<TContract, ModelName>>, State extends CollectionTypeState = DefaultCollectionTypeState> implements RowSelection<Row> {
787
819
  #private;
788
820
  readonly [RowType]: Row;
821
+ readonly _row?: Row;
789
822
  /** @internal */
790
823
  readonly ctx: CollectionContext<TContract>;
791
824
  /** @internal */
@@ -825,7 +858,7 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
825
858
  where(fn: (model: VariantAwareModelAccessor<TContract, ModelName, State['variantName'], State['nsId']>) => WhereDirectInput): Collection<TContract, ModelName, Row, WithWhereState<State>>;
826
859
  where(input: WhereDirectInput): Collection<TContract, ModelName, Row, WithWhereState<State>>;
827
860
  where(fn: (model: VariantAwareModelAccessor<TContract, ModelName, State['variantName'], State['nsId']>) => WhereArg): Collection<TContract, ModelName, Row, WithWhereState<State>>;
828
- where(filters: ShorthandWhereFilter<TContract, ModelName, State['nsId']>): Collection<TContract, ModelName, Row, WithWhereState<State>>;
861
+ where(filters: ShorthandWhereFilter<TContract, State['nsId'], ModelName>): Collection<TContract, ModelName, Row, WithWhereState<State>>;
829
862
  /**
830
863
  * Narrow a polymorphic model to a specific variant. The returned
831
864
  * collection has the variant's row shape and a discriminator filter
@@ -862,7 +895,7 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
862
895
  *
863
896
  * // Refine the related collection:
864
897
  * const withRecent = await db.orm.User.include('posts', (posts) =>
865
- * posts.where({ published: true }).orderBy((p) => p.createdAt.desc()).take(5),
898
+ * posts.where({ published: true }).orderBy((p) => p.createdAt.desc()).limit(5),
866
899
  * ).all();
867
900
  *
868
901
  * // Reduce a to-many relation to a scalar value:
@@ -870,11 +903,12 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
870
903
  *
871
904
  * // Multiple sub-views via combine():
872
905
  * const overview = await db.orm.User.include('posts', (posts) =>
873
- * posts.combine({ recent: posts.take(3), total: posts.count() }),
906
+ * posts.combine({ recent: posts.limit(3), total: posts.count() }),
874
907
  * ).all();
875
908
  * ```
876
909
  */
877
- include<RelName extends VariantAwareIncludeRelationNames<TContract, ModelName, State['variantName'], State['nsId']>, RelationOwner extends string = IncludeRelationOwner<TContract, ModelName, State['variantName'], RelName, State['nsId']> & string, RelatedName extends RelatedModelName<TContract, RelationOwner, RelName, State['nsId']> & string = RelatedModelName<TContract, RelationOwner, RelName, State['nsId']> & string, TargetNs extends string = RelationTargetNamespace<TContract, RelationOwner, RelName, State['nsId']>, IsToMany extends boolean = IsToManyRelation<TContract, RelationOwner, RelName, State['nsId']>, RefinedResult extends IncludeRefinementResult<TContract, RelatedName, IsToMany> = IncludeRefinementCollection<TContract, RelatedName, SimplifyDeep<InferRootRow<TContract, RelatedName, TargetNs>>, CollectionTypeState, IsToMany>>(relationName: RelName, refineFn?: (collection: IncludeRefinementCollection<TContract, RelatedName, SimplifyDeep<InferRootRow<TContract, RelatedName, TargetNs>>, DefaultCollectionTypeState, IsToMany>) => RefinedResult): Collection<TContract, ModelName, SimplifyDeep<Row & { [K in RelName]: IncludeRefinementValue<TContract, RelationOwner, K, SimplifyDeep<InferRootRow<TContract, RelatedName, TargetNs>>, RefinedResult, State['nsId']>; }>, State>;
910
+ include<RelName extends VariantAwareIncludeRelationNames<TContract, ModelName, State['variantName'], State['nsId']>, RelationOwner extends string = IncludeRelationOwner<TContract, ModelName, State['variantName'], RelName, State['nsId']> & string, RelatedName extends RelatedModelName<TContract, RelationOwner, RelName, State['nsId']> & string = RelatedModelName<TContract, RelationOwner, RelName, State['nsId']> & string, TargetNs extends string = RelationTargetNamespace<TContract, RelationOwner, RelName, State['nsId']>>(relationName: RelName): Collection<TContract, ModelName, SimplifyDeep<Row & { [K in RelName]: IncludeRelationValue<TContract, RelationOwner, K, SimplifyDeep<InferRootRow<TContract, RelatedName, TargetNs>>, State['nsId']>; }>, State>;
911
+ include<RelName extends VariantAwareIncludeRelationNames<TContract, ModelName, State['variantName'], State['nsId']>, RelationOwner extends string = IncludeRelationOwner<TContract, ModelName, State['variantName'], RelName, State['nsId']> & string, RelatedName extends RelatedModelName<TContract, RelationOwner, RelName, State['nsId']> & string = RelatedModelName<TContract, RelationOwner, RelName, State['nsId']> & string, TargetNs extends string = RelationTargetNamespace<TContract, RelationOwner, RelName, State['nsId']>, IsToMany extends boolean = IsToManyRelation<TContract, RelationOwner, RelName, State['nsId']>, RefinedResult extends IncludeRefinementResult<TContract, RelatedName, IsToMany> = IncludeRefinementCollection<TContract, RelatedName, SimplifyDeep<InferRootRow<TContract, RelatedName, TargetNs>>, CollectionTypeState, IsToMany>>(relationName: RelName, refineFn: (collection: IncludeRefinementCollection<TContract, RelatedName, SimplifyDeep<InferRootRow<TContract, RelatedName, TargetNs>>, DefaultCollectionTypeState, IsToMany>) => RefinedResult): Collection<TContract, ModelName, SimplifyDeep<Row & { [K in RelName]: IncludeRefinementValue<TContract, RelationOwner, K, SimplifyDeep<InferRootRow<TContract, RelatedName, TargetNs>>, RefinedResult, State['nsId']>; }>, State>;
878
912
  /**
879
913
  * Project the row down to a subset of scalar fields. Previously
880
914
  * included relations are preserved on the resulting row shape; only
@@ -907,7 +941,7 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
907
941
  * .all();
908
942
  * ```
909
943
  */
910
- orderBy(selection: ((model: VariantAwareModelAccessor<TContract, ModelName, State['variantName']>) => OrderByItem) | ReadonlyArray<(model: VariantAwareModelAccessor<TContract, ModelName, State['variantName']>) => OrderByItem>): Collection<TContract, ModelName, Row, WithOrderByState<State>>;
944
+ orderBy(selection: ((model: VariantAwareModelAccessor<TContract, ModelName, State['variantName'], State['nsId']>) => OrderByItem) | ReadonlyArray<(model: VariantAwareModelAccessor<TContract, ModelName, State['variantName'], State['nsId']>) => OrderByItem>): Collection<TContract, ModelName, Row, WithOrderByState<State>>;
911
945
  /**
912
946
  * Switch to grouped-aggregate mode. Returns a `GroupedCollection`
913
947
  * whose `.aggregate(...)` terminal produces one row per group with
@@ -932,7 +966,7 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
932
966
  * ```typescript
933
967
  * const users = await db.orm.User.include('posts', (posts) =>
934
968
  * posts.combine({
935
- * recent: posts.where({ published: true }).take(3),
969
+ * recent: posts.where({ published: true }).limit(3),
936
970
  * total: posts.count(),
937
971
  * averageViews: posts.avg('views'),
938
972
  * }),
@@ -953,14 +987,14 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
953
987
  * ```typescript
954
988
  * const page1 = await db.orm.Post
955
989
  * .orderBy((p) => p.createdAt.desc())
956
- * .take(20)
990
+ * .limit(20)
957
991
  * .all();
958
992
  *
959
993
  * const last = page1[page1.length - 1]!;
960
994
  * const page2 = await db.orm.Post
961
995
  * .orderBy((p) => p.createdAt.desc())
962
996
  * .cursor({ createdAt: last.createdAt })
963
- * .take(20)
997
+ * .limit(20)
964
998
  * .all();
965
999
  * ```
966
1000
  */
@@ -980,6 +1014,8 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
980
1014
  * prior `orderBy(...)`; replaces any previous `distinct(...)` /
981
1015
  * `distinctOn(...)` selection.
982
1016
  *
1017
+ * Requires the `postgres.distinctOn` capability.
1018
+ *
983
1019
  * ```typescript
984
1020
  * // Latest post per user:
985
1021
  * const latestPerUser = await db.orm.Post
@@ -988,27 +1024,31 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
988
1024
  * .all();
989
1025
  * ```
990
1026
  */
991
- distinctOn<Fields extends readonly [keyof DefaultModelRow<TContract, ModelName> & string, ...(keyof DefaultModelRow<TContract, ModelName> & string)[]]>(...fields: State['hasOrderBy'] extends true ? Fields : never): Collection<TContract, ModelName, Row, State>;
1027
+ distinctOn<Fields extends readonly [keyof DefaultModelRow<TContract, ModelName> & string, ...(keyof DefaultModelRow<TContract, ModelName> & string)[]]>(...fields: TContract['capabilities'] extends {
1028
+ postgres: {
1029
+ distinctOn: true;
1030
+ };
1031
+ } ? State['hasOrderBy'] extends true ? Fields : never : never): Collection<TContract, ModelName, Row, State>;
992
1032
  /**
993
1033
  * Apply `LIMIT n`. Replaces any previous limit set on this collection.
994
1034
  *
995
1035
  * ```typescript
996
- * const firstTen = await db.orm.User.orderBy((u) => u.id.asc()).take(10).all();
1036
+ * const firstTen = await db.orm.User.orderBy((u) => u.id.asc()).limit(10).all();
997
1037
  * ```
998
1038
  */
999
- take(n: number): Collection<TContract, ModelName, Row, State>;
1039
+ limit(n: number): Collection<TContract, ModelName, Row, State>;
1000
1040
  /**
1001
1041
  * Apply `OFFSET n`. Replaces any previous offset set on this collection.
1002
1042
  *
1003
1043
  * ```typescript
1004
1044
  * const page2 = await db.orm.User
1005
1045
  * .orderBy((u) => u.id.asc())
1006
- * .skip(10)
1007
- * .take(10)
1046
+ * .offset(10)
1047
+ * .limit(10)
1008
1048
  * .all();
1009
1049
  * ```
1010
1050
  */
1011
- skip(n: number): Collection<TContract, ModelName, Row, State>;
1051
+ offset(n: number): Collection<TContract, ModelName, Row, State>;
1012
1052
  /**
1013
1053
  * Read terminal: execute the query and stream every matching row.
1014
1054
  *
@@ -1019,15 +1059,9 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
1019
1059
  * whichever fits the caller. A single result can only be consumed
1020
1060
  * once.
1021
1061
  *
1022
- * Streaming is the default and the expected execution model. The
1023
- * only scenarios that fall back to buffering internally before
1024
- * yielding are drivers that cannot expose a cursor to the
1025
- * underlying database, and — for queries with `include(...)` —
1026
- * targets whose SQL dialect supports neither lateral joins nor
1027
- * correlated subqueries (so child rows cannot be stitched in a
1028
- * single streaming query). These are implementation details below
1029
- * the public API; the iteration shape itself is genuinely
1030
- * streaming whenever the driver and plan allow it.
1062
+ * Queries without `include(...)` stream rows as the driver yields them (drivers that cannot
1063
+ * expose a cursor buffer internally first). Queries with `include(...)` read the whole parent
1064
+ * result set into memory before yielding the first row.
1031
1065
  *
1032
1066
  * ```typescript
1033
1067
  * // Thenable — collect to an array:
@@ -1078,7 +1112,7 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
1078
1112
  first(): Promise<Row | null>;
1079
1113
  first(filter: undefined, configure: (meta: MetaBuilder<'read'>) => void): Promise<Row | null>;
1080
1114
  first(filter: (model: VariantAwareModelAccessor<TContract, ModelName, State['variantName'], State['nsId']>) => WhereArg, configure?: (meta: MetaBuilder<'read'>) => void): Promise<Row | null>;
1081
- first(filter: ShorthandWhereFilter<TContract, ModelName, State['nsId']>, configure?: (meta: MetaBuilder<'read'>) => void): Promise<Row | null>;
1115
+ first(filter: ShorthandWhereFilter<TContract, State['nsId'], ModelName>, configure?: (meta: MetaBuilder<'read'>) => void): Promise<Row | null>;
1082
1116
  /**
1083
1117
  * Read terminal: run an aggregate query (count, sum, avg, min, max)
1084
1118
  * built via the `AggregateBuilder` callback. Returns one object
@@ -1106,12 +1140,13 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
1106
1140
  * `select(...)` / `include(...)` projections applied to the returned
1107
1141
  * shape).
1108
1142
  *
1109
- * Related rows can be created or linked through relation callbacks
1110
- * on parent/child-owned relations (one-to-one or one-to-many).
1111
- * The callback receives a mutator exposing `create(...)` and
1112
- * `connect(...)`; `disconnect(...)` is only supported in nested
1113
- * `update(...)` mutations. Many-to-many relations are not yet
1114
- * supported as nested-mutation targets.
1143
+ * Related rows can be created or linked through relation callbacks on any relation: to-one
1144
+ * (1:1, N:1), to-many (1:N), and many-to-many (N:M, written through the junction table). The
1145
+ * callback receives a mutator exposing `create(...)` and `connect(...)`; `disconnect(...)` is
1146
+ * only supported in nested `update(...)` mutations. To-one relations take a single row or
1147
+ * criterion.
1148
+ * N:M `create`/`connect` are unavailable when the junction has required columns the relation API
1149
+ * cannot populate.
1115
1150
  *
1116
1151
  * ```typescript
1117
1152
  * // Simple insert:
@@ -1143,9 +1178,9 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
1143
1178
  *
1144
1179
  * Note: when the input contains nested-mutation callbacks, the
1145
1180
  * operation is executed as a graph of internal queries via
1146
- * `withMutationScope`. In that path, annotations apply to the
1147
- * logical `create()` call but do not currently flow into each
1148
- * constituent SQL statement issued for the related rows.
1181
+ * `withMutationScope`. In that path the `configure` callback still runs, so `meta.annotate`
1182
+ * validation applies, but the recorded annotations are discarded: neither the nested
1183
+ * statements nor the read-back query carry them.
1149
1184
  */
1150
1185
  create(data: ResolvedCreateInput<TContract, ModelName, State['variantName'], State['nsId']>, configure?: (meta: MetaBuilder<'write'>) => void): Promise<Row>;
1151
1186
  create(data: MutationCreateInputWithRelations<TContract, ModelName, State['nsId']>, configure?: (meta: MetaBuilder<'write'>) => void): Promise<Row>;
@@ -1176,7 +1211,7 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
1176
1211
  * `MetaBuilder<'write'>` for attaching typed annotations to the
1177
1212
  * compiled insert plan.
1178
1213
  */
1179
- createAll(data: readonly ResolvedCreateInput<TContract, ModelName, State['variantName'], State['nsId']>[], configure?: (meta: MetaBuilder<'write'>) => void): AsyncIterableResult<Row>;
1214
+ createAll(data: readonly ResolvedScalarCreateInput<TContract, ModelName, State['variantName'], State['nsId']>[], configure?: (meta: MetaBuilder<'write'>) => void): AsyncIterableResult<Row>;
1180
1215
  /**
1181
1216
  * Write terminal: insert many rows without materializing the
1182
1217
  * inserted rows, returning the number of inserted records.
@@ -1195,7 +1230,7 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
1195
1230
  *
1196
1231
  * Not supported on MTI variants — use `createAll(...)` instead.
1197
1232
  */
1198
- createAndCount(data: readonly ResolvedCreateInput<TContract, ModelName, State['variantName']>[], configure?: (meta: MetaBuilder<'write'>) => void): Promise<number>;
1233
+ createAndCount(data: readonly ResolvedScalarCreateInput<TContract, ModelName, State['variantName'], State['nsId']>[], configure?: (meta: MetaBuilder<'write'>) => void): Promise<number>;
1199
1234
  /**
1200
1235
  * Write terminal: insert a row, or update the existing row on
1201
1236
  * conflict. Returns the resulting row (the inserted one or the
@@ -1229,7 +1264,7 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
1229
1264
  * Not supported on MTI variants.
1230
1265
  */
1231
1266
  upsert(input: {
1232
- create: ResolvedCreateInput<TContract, ModelName, State['variantName']>;
1267
+ create: ResolvedScalarCreateInput<TContract, ModelName, State['variantName'], State['nsId']>;
1233
1268
  update: Partial<DefaultModelRow<TContract, ModelName>>;
1234
1269
  conflictOn?: UniqueConstraintCriterion<TContract, ModelName>;
1235
1270
  }, configure?: (meta: MetaBuilder<'write'>) => void): Promise<Row>;
@@ -1239,12 +1274,13 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
1239
1274
  * Requires a prior `.where(...)` — calling `update(...)` on an
1240
1275
  * unfiltered collection is a type error.
1241
1276
  *
1242
- * Related rows can be created or relinked through relation
1243
- * callbacks on parent/child-owned relations (one-to-one or
1244
- * one-to-many). The callback receives a mutator exposing
1245
- * `create(...)`, `connect(...)`, and `disconnect(...)`. Nested
1246
- * updates against existing related rows, and many-to-many relations
1247
- * as nested-mutation targets, are not supported through this API.
1277
+ * Related rows can be created, linked, or unlinked through relation callbacks on any relation:
1278
+ * to-one (1:1, N:1), to-many (1:N), and many-to-many (N:M, written through the junction table).
1279
+ * The callback receives a mutator exposing `create(...)`, `connect(...)`, and `disconnect(...)`.
1280
+ * A to-one `disconnect()` clears the foreign key; a to-many `disconnect()` with no criteria
1281
+ * unlinks every related row; an N:M `disconnect()` requires criteria. N:M `create`/`connect` are
1282
+ * unavailable when the junction has required columns the relation API cannot populate. Nested
1283
+ * updates against existing related rows are not supported through this API.
1248
1284
  *
1249
1285
  * ```typescript
1250
1286
  * // Update one row by id:
@@ -1266,9 +1302,9 @@ declare class CollectionImpl<TContract extends Contract<SqlStorage>, ModelName e
1266
1302
  *
1267
1303
  * Note: when the input contains nested-mutation callbacks, the
1268
1304
  * operation is executed as a graph of internal queries via
1269
- * `withMutationScope`. In that path, annotations apply to the logical
1270
- * `update()` call but do not currently flow into each constituent SQL
1271
- * statement issued for the related rows.
1305
+ * `withMutationScope`. In that path the `configure` callback still runs, so `meta.annotate`
1306
+ * validation applies, but the recorded annotations are discarded: neither the nested
1307
+ * statements nor the read-back query carry them.
1272
1308
  */
1273
1309
  update(data: State['hasWhere'] extends true ? MutationUpdateInput<TContract, ModelName, State['nsId']> : never, configure?: (meta: MetaBuilder<'write'>) => void): Promise<Row | null>;
1274
1310
  /**
@@ -1392,7 +1428,7 @@ declare function not(expr: AnyExpression): AnyExpression;
1392
1428
  declare function all(): AnyExpression;
1393
1429
  //#endregion
1394
1430
  //#region src/model-accessor.d.ts
1395
- declare function createModelAccessor<TContract extends Contract<SqlStorage>, ModelName extends string, VariantName extends string | undefined = undefined>(context: ExecutionContext<TContract>, namespaceId: string, modelName: ModelName, variantName?: VariantName): VariantAwareModelAccessor<TContract, ModelName, VariantName>;
1431
+ declare function createModelAccessor<TContract extends Contract<SqlStorage>, ModelName extends string, VariantName extends string | undefined = undefined, NsId extends string = string>(context: ExecutionContext<TContract>, namespaceId: NsId, modelName: ModelName, variantName?: VariantName): VariantAwareModelAccessor<TContract, ModelName, VariantName, NsId>;
1396
1432
  //#endregion
1397
1433
  //#region src/orm.d.ts
1398
1434
  interface OrmOptions<TContract extends Contract<SqlStorage>, Collections extends Partial<Record<string, AnyCollectionClass>>> {