@prisma/orm-family-sql 8.0.0-rc.18-dev.16 → 8.0.0-rc.18-dev.17

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 (278) hide show
  1. package/dist/{aggregate-descriptor-registry-DrJ1vHEo.mjs → aggregate-descriptor-registry-Dd7Uj7DJ.mjs} +3 -3
  2. package/dist/{aggregate-descriptor-registry-DrJ1vHEo.mjs.map → aggregate-descriptor-registry-Dd7Uj7DJ.mjs.map} +1 -1
  3. package/dist/{ast-BDwGvnKK.mjs → ast-CBO3PEJF.mjs} +73 -47
  4. package/dist/ast-CBO3PEJF.mjs.map +1 -0
  5. package/dist/{ast-BoM9T1b2.d.mts → ast-Dzsat0Zb.d.mts} +27 -26
  6. package/dist/ast-Dzsat0Zb.d.mts.map +1 -0
  7. package/dist/{attribute-specs-D7EhHD08.d.mts → attribute-specs-2I2xuKEa.d.mts} +4 -3
  8. package/dist/attribute-specs-2I2xuKEa.d.mts.map +1 -0
  9. package/dist/{authored-check-naming-CO3GA46Y.mjs → authored-check-naming-CIX7Bbyh.mjs} +3 -3
  10. package/dist/{authored-check-naming-CO3GA46Y.mjs.map → authored-check-naming-CIX7Bbyh.mjs.map} +1 -1
  11. package/dist/{authoring-entity-types-CZ-vdwYS-Cl5erH9X.d.mts → authoring-entity-types-CZ-vdwYS-BpyuSxbj.d.mts} +2 -2
  12. package/dist/{authoring-entity-types-CZ-vdwYS-Cl5erH9X.d.mts.map → authoring-entity-types-CZ-vdwYS-BpyuSxbj.d.mts.map} +1 -1
  13. package/dist/{authoring-type-constructors-0Iv2zdwS-yMnSyGBK.mjs → authoring-type-constructors-0Iv2zdwS-MFIpJ4fA.mjs} +2 -2
  14. package/dist/{authoring-type-constructors-0Iv2zdwS-yMnSyGBK.mjs.map → authoring-type-constructors-0Iv2zdwS-MFIpJ4fA.mjs.map} +1 -1
  15. package/dist/builder.d.mts +3 -3
  16. package/dist/builder__runtime.d.mts +7 -7
  17. package/dist/builder__runtime.mjs +2 -2
  18. package/dist/builder__types.d.mts +5 -5
  19. package/dist/{codec-descriptor-registry-Bg9OjQf_.mjs → codec-descriptor-registry-4kw8FPpo.mjs} +2 -2
  20. package/dist/{codec-descriptor-registry-Bg9OjQf_.mjs.map → codec-descriptor-registry-4kw8FPpo.mjs.map} +1 -1
  21. package/dist/{collection-methods-BnR4UjcW-C_55W2m0.d.mts → collection-methods-B-tM7OPZ-v8HK9Txa.d.mts} +3 -3
  22. package/dist/{collection-methods-BnR4UjcW-C_55W2m0.d.mts.map → collection-methods-B-tM7OPZ-v8HK9Txa.d.mts.map} +1 -1
  23. package/dist/collection-methods-DQAFcGEB.d.mts +1 -0
  24. package/dist/{config-types-ni1nb_HA.mjs → config-types-ComQZUlA.mjs} +2 -2
  25. package/dist/{config-types-ni1nb_HA.mjs.map → config-types-ComQZUlA.mjs.map} +1 -1
  26. package/dist/{contract-builder-CH0AIjsv.d.mts → contract-builder-De_fyZGT.d.mts} +6 -6
  27. package/dist/{contract-builder-CH0AIjsv.d.mts.map → contract-builder-De_fyZGT.d.mts.map} +1 -1
  28. package/dist/{contract-builder-CiYVj56_.mjs → contract-builder-fQ3gkIR5.mjs} +5 -5
  29. package/dist/{contract-builder-CiYVj56_.mjs.map → contract-builder-fQ3gkIR5.mjs.map} +1 -1
  30. package/dist/contract-emitter.mjs +1 -1
  31. package/dist/contract-prisma7__provider.d.mts +12 -6
  32. package/dist/contract-prisma7__provider.d.mts.map +1 -1
  33. package/dist/contract-prisma7__provider.mjs +48 -43
  34. package/dist/contract-prisma7__provider.mjs.map +1 -1
  35. package/dist/contract-psl.d.mts +2 -2
  36. package/dist/contract-psl.d.mts.map +1 -1
  37. package/dist/contract-psl.mjs +1 -1
  38. package/dist/contract-psl__attribute-specs.d.mts +1 -1
  39. package/dist/contract-psl__attribute-specs.mjs +1 -1
  40. package/dist/contract-psl__provider.mjs +2 -2
  41. package/dist/contract-psl__provider.mjs.map +1 -1
  42. package/dist/contract-ts.d.mts +2 -2
  43. package/dist/contract-ts.mjs +4 -4
  44. package/dist/contract-ts__config-types.mjs +1 -1
  45. package/dist/contract-ts__contract-builder.d.mts +2 -2
  46. package/dist/contract-ts__contract-builder.mjs +3 -3
  47. package/dist/contract.d.mts +6 -6
  48. package/dist/contract.mjs +15 -15
  49. package/dist/contract__authored-check-naming.mjs +1 -1
  50. package/dist/contract__data-type-support.d.mts +2 -2
  51. package/dist/contract__data-type-support.mjs +2 -2
  52. package/dist/contract__data-type.d.mts +2 -2
  53. package/dist/contract__data-type.mjs +3 -3
  54. package/dist/contract__entity-kinds.mjs +1 -1
  55. package/dist/contract__factories.mjs +1 -1
  56. package/dist/contract__foreign-key-materialization.d.mts +1 -1
  57. package/dist/contract__foreign-key-materialization.mjs +2 -2
  58. package/dist/contract__index-naming.mjs +1 -1
  59. package/dist/contract__sql-expression.d.mts +2 -2
  60. package/dist/contract__sql-expression.mjs +2 -2
  61. package/dist/contract__types.mjs +3 -3
  62. package/dist/contract__validators.d.mts +1 -1
  63. package/dist/contract__validators.mjs +2 -2
  64. package/dist/{control-DXqMl_gd.mjs → control-ClahTAD-.mjs} +246 -40
  65. package/dist/control-ClahTAD-.mjs.map +1 -0
  66. package/dist/{control-adapter-CkFfBVei-DGf1LihO.d.mts → control-adapter-BCopdpsT-DIHCWbq_.d.mts} +9 -26
  67. package/dist/control-adapter-BCopdpsT-DIHCWbq_.d.mts.map +1 -0
  68. package/dist/control-adapter-BsSf5pqM.d.mts +1 -0
  69. package/dist/{control-CPg4LwJV.d.mts → control-mpACqp72.d.mts} +72 -39
  70. package/dist/control-mpACqp72.d.mts.map +1 -0
  71. package/dist/{data-type-CYsho6Yd.d.mts → data-type-B8N33s-_.d.mts} +14 -7
  72. package/dist/data-type-B8N33s-_.d.mts.map +1 -0
  73. package/dist/{numeral-text-Cqu87pVe-DJCqBaSC.mjs → data-type-DKk8Unnz.mjs} +2 -2
  74. package/dist/data-type-DKk8Unnz.mjs.map +1 -0
  75. package/dist/{data-type-support-CfhpAKLX.mjs → data-type-support-C5-XxxeB.mjs} +11 -24
  76. package/dist/data-type-support-C5-XxxeB.mjs.map +1 -0
  77. package/dist/{data-type-support-4TcZuD7d.d.mts → data-type-support-CBcYhSkD.d.mts} +12 -16
  78. package/dist/data-type-support-CBcYhSkD.d.mts.map +1 -0
  79. package/dist/{db-BmrN9nRS-CzyybGKR.d.mts → db-BmrN9nRS-xynLbnAy.d.mts} +10 -10
  80. package/dist/{db-BmrN9nRS-CzyybGKR.d.mts.map → db-BmrN9nRS-xynLbnAy.d.mts.map} +1 -1
  81. package/dist/{ddl-types-DtKZjNtN-DWQeO79o.d.mts → ddl-types-CoP6yAw9-BDp3W_5g.d.mts} +4 -4
  82. package/dist/{ddl-types-DtKZjNtN-DWQeO79o.d.mts.map → ddl-types-CoP6yAw9-BDp3W_5g.d.mts.map} +1 -1
  83. package/dist/{default-mapping-B8_APB1M-CWcTmSQW.d.mts → default-mapping-CEISdj2g-DF1LzGBR.d.mts} +7 -5
  84. package/dist/default-mapping-CEISdj2g-DF1LzGBR.d.mts.map +1 -0
  85. package/dist/{derived-checks-Cgx_VgS3-CmFqNFgU.mjs → derived-checks-CrvMQTJF-DlxFFtNM.mjs} +18 -18
  86. package/dist/derived-checks-CrvMQTJF-DlxFFtNM.mjs.map +1 -0
  87. package/dist/{diff-CVVGktZG.d.mts → diff-Bd9ILpZL.d.mts} +20 -7
  88. package/dist/diff-Bd9ILpZL.d.mts.map +1 -0
  89. package/dist/diff-DZ82XaGR.mjs +21 -0
  90. package/dist/diff-DZ82XaGR.mjs.map +1 -0
  91. package/dist/{dist-Cg2lL1hR.mjs → dist-DAHIT4AS.mjs} +2 -2
  92. package/dist/{dist-Cg2lL1hR.mjs.map → dist-DAHIT4AS.mjs.map} +1 -1
  93. package/dist/{entity-kinds-CQ_jwgYv-HA5t2SE0.mjs → entity-kinds-CQ_jwgYv-DoOBWwvX.mjs} +3 -3
  94. package/dist/{entity-kinds-CQ_jwgYv-HA5t2SE0.mjs.map → entity-kinds-CQ_jwgYv-DoOBWwvX.mjs.map} +1 -1
  95. package/dist/{expression-Ck1wys3N-Cdc7eUQS.d.mts → expression-BzrfOiPC-3NqR8UzK.d.mts} +4 -4
  96. package/dist/{expression-Ck1wys3N-Cdc7eUQS.d.mts.map → expression-BzrfOiPC-3NqR8UzK.d.mts.map} +1 -1
  97. package/dist/expression-CeerCjQG.d.mts +2 -0
  98. package/dist/{expression-CNBCbbzU-DOXKUxQs.d.mts → expression-sOY1120I-DOykEQlw.d.mts} +4 -4
  99. package/dist/expression-sOY1120I-DOykEQlw.d.mts.map +1 -0
  100. package/dist/{factories-vDQ3S5gW.mjs → factories-DkD3nMYt.mjs} +3 -3
  101. package/dist/{factories-vDQ3S5gW.mjs.map → factories-DkD3nMYt.mjs.map} +1 -1
  102. package/dist/family.d.mts +14 -14
  103. package/dist/family.mjs +8 -8
  104. package/dist/family__control-adapter.d.mts +2 -2
  105. package/dist/family__control.d.mts +5 -5
  106. package/dist/family__control.mjs +4 -4
  107. package/dist/family__diff.d.mts +1 -2
  108. package/dist/family__diff.mjs +2 -2
  109. package/dist/family__ir.d.mts +1 -1
  110. package/dist/family__ir.mjs +1 -1
  111. package/dist/family__migration.d.mts +1 -1
  112. package/dist/family__pack.d.mts +1 -1
  113. package/dist/family__pack.mjs +2 -2
  114. package/dist/family__psl-build.d.mts +2 -2
  115. package/dist/family__psl-build.mjs +1 -1
  116. package/dist/family__psl-infer.d.mts +1 -1
  117. package/dist/family__psl-infer.mjs +1 -1
  118. package/dist/{foreign-key-materialization-DJ6uhBba.d.mts → foreign-key-materialization-DCaDnUs-.d.mts} +3 -3
  119. package/dist/{foreign-key-materialization-DJ6uhBba.d.mts.map → foreign-key-materialization-DCaDnUs-.d.mts.map} +1 -1
  120. package/dist/{foreign-key-materialization-DibQ9Hjg.mjs → foreign-key-materialization-DfNPQL9G.mjs} +4 -4
  121. package/dist/{foreign-key-materialization-DibQ9Hjg.mjs.map → foreign-key-materialization-DfNPQL9G.mjs.map} +1 -1
  122. package/dist/{functions-DSwXxsTg.d.mts → functions-Cp8soSAv.d.mts} +3 -3
  123. package/dist/{functions-DSwXxsTg.d.mts.map → functions-Cp8soSAv.d.mts.map} +1 -1
  124. package/dist/{index-C8jUgdUh.d.mts → index-DWNoqFzr.d.mts} +17 -17
  125. package/dist/{index-C8jUgdUh.d.mts.map → index-DWNoqFzr.d.mts.map} +1 -1
  126. package/dist/{index-equivalence-DswCiq5l-DlC2yTK1.mjs → index-equivalence-DswCiq5l-BsphajRC.mjs} +2 -2
  127. package/dist/{index-equivalence-DswCiq5l-DlC2yTK1.mjs.map → index-equivalence-DswCiq5l-BsphajRC.mjs.map} +1 -1
  128. package/dist/{index-naming-BOcJT1B3-CeEoP8t3.mjs → index-naming-BOcJT1B3-18gQUduD.mjs} +2 -2
  129. package/dist/{index-naming-BOcJT1B3-CeEoP8t3.mjs.map → index-naming-BOcJT1B3-18gQUduD.mjs.map} +1 -1
  130. package/dist/index-reference-CWppFpUV.d.mts +1 -0
  131. package/dist/{index-reference-DJX-CNsb-D5uoBnH_.d.mts → index-reference-DJaQLZA3-DxmYkkX-.d.mts} +3 -3
  132. package/dist/{index-reference-DJX-CNsb-D5uoBnH_.d.mts.map → index-reference-DJaQLZA3-DxmYkkX-.d.mts.map} +1 -1
  133. package/dist/{interpreter-CvmBTYyI-DNl-jr2E.mjs → interpreter-CFj2aTEP-BHL3TOqk.mjs} +13 -11
  134. package/dist/interpreter-CFj2aTEP-BHL3TOqk.mjs.map +1 -0
  135. package/dist/{ir-D0Vpm5O9.d.mts → ir-DgNo535E.d.mts} +4 -2
  136. package/dist/ir-DgNo535E.d.mts.map +1 -0
  137. package/dist/ir-I-xciGUH.mjs.map +1 -1
  138. package/dist/middleware-IqWk9Eff.d.mts +1 -0
  139. package/dist/{middleware-YsFLC19Y-5mJZCBWq.d.mts → middleware-oCT0RWkt-AFlRNCOD.d.mts} +3 -3
  140. package/dist/{middleware-YsFLC19Y-5mJZCBWq.d.mts.map → middleware-oCT0RWkt-AFlRNCOD.d.mts.map} +1 -1
  141. package/dist/{migration-ESRa6312.d.mts → migration-lg_VgP_F.d.mts} +2 -2
  142. package/dist/{migration-ESRa6312.d.mts.map → migration-lg_VgP_F.d.mts.map} +1 -1
  143. package/dist/{naming-CT8tRisJ-DLHKo0Hm.mjs → naming-bM5qm5PY-DdginUhA.mjs} +2 -2
  144. package/dist/{naming-CT8tRisJ-DLHKo0Hm.mjs.map → naming-bM5qm5PY-DdginUhA.mjs.map} +1 -1
  145. package/dist/{opaque-sql-BWxbqe5a-GGKfyakq.mjs → opaque-sql-Dset3kln-BzzXoO94.mjs} +3 -3
  146. package/dist/opaque-sql-Dset3kln-BzzXoO94.mjs.map +1 -0
  147. package/dist/orm-client.d.mts +17 -17
  148. package/dist/orm-client.mjs +59 -46
  149. package/dist/orm-client.mjs.map +1 -1
  150. package/dist/{pack-BtGENS4_.d.mts → pack-CyjyMUN0.d.mts} +3 -3
  151. package/dist/{pack-BtGENS4_.d.mts.map → pack-CyjyMUN0.d.mts.map} +1 -1
  152. package/dist/plan-BZpZafiQ.d.mts +2 -0
  153. package/dist/{plan-cGEaSXHv-yuz43WrR.d.mts → plan-Cbed2eDu-BZM3geSm.d.mts} +3 -3
  154. package/dist/plan-Cbed2eDu-BZM3geSm.d.mts.map +1 -0
  155. package/dist/{psl-build-PXVtl8gM.d.mts → psl-build-BHQfP1_C.d.mts} +5 -5
  156. package/dist/{psl-build-PXVtl8gM.d.mts.map → psl-build-BHQfP1_C.d.mts.map} +1 -1
  157. package/dist/{psl-build-8bx9WTUt.mjs → psl-build-BsJ6eChh.mjs} +118 -84
  158. package/dist/psl-build-BsJ6eChh.mjs.map +1 -0
  159. package/dist/{psl-column-resolution-BCkhNzOK-Bbrs_WzK.d.mts → psl-column-resolution-BCkhNzOK-mW_8C9vr.d.mts} +2 -2
  160. package/dist/{psl-column-resolution-BCkhNzOK-Bbrs_WzK.d.mts.map → psl-column-resolution-BCkhNzOK-mW_8C9vr.d.mts.map} +1 -1
  161. package/dist/{psl-field-resolution-SPNDr-jr-CH_gs3Oy.mjs → psl-field-resolution-o9sXqIlE-BJnlxQ4z.mjs} +76 -66
  162. package/dist/psl-field-resolution-o9sXqIlE-BJnlxQ4z.mjs.map +1 -0
  163. package/dist/{psl-infer-g040TwAr.d.mts → psl-infer-B6iemK9i.d.mts} +4 -4
  164. package/dist/{psl-infer-g040TwAr.d.mts.map → psl-infer-B6iemK9i.d.mts.map} +1 -1
  165. package/dist/{psl-infer-CG0_wra6.mjs → psl-infer-HPi_YMeE.mjs} +2 -2
  166. package/dist/{psl-infer-CG0_wra6.mjs.map → psl-infer-HPi_YMeE.mjs.map} +1 -1
  167. package/dist/{query-lane-context-C42-u9L1-BSJoP83K.d.mts → query-lane-context-BLOPW1rQ-Bn3ugl9a.d.mts} +5 -5
  168. package/dist/{query-lane-context-C42-u9L1-BSJoP83K.d.mts.map → query-lane-context-BLOPW1rQ-Bn3ugl9a.d.mts.map} +1 -1
  169. package/dist/query-lane-context-Dpep1Fzy.d.mts +1 -0
  170. package/dist/relational-core.d.mts +12 -12
  171. package/dist/relational-core.mjs +2 -2
  172. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  173. package/dist/relational-core__aggregate-descriptor-registry.mjs +1 -1
  174. package/dist/relational-core__ast.d.mts +3 -3
  175. package/dist/relational-core__ast.mjs +2 -2
  176. package/dist/relational-core__codec-descriptor-registry.d.mts +2 -2
  177. package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
  178. package/dist/relational-core__collection-methods.d.mts +2 -2
  179. package/dist/relational-core__contract-free.d.mts +3 -3
  180. package/dist/relational-core__contract-free.mjs +2 -2
  181. package/dist/relational-core__contract-free.mjs.map +1 -1
  182. package/dist/relational-core__expression.d.mts +3 -3
  183. package/dist/relational-core__functions.d.mts +1 -1
  184. package/dist/relational-core__index-reference.d.mts +2 -2
  185. package/dist/relational-core__middleware.d.mts +2 -2
  186. package/dist/relational-core__plan.d.mts +3 -3
  187. package/dist/relational-core__query-lane-context.d.mts +2 -2
  188. package/dist/relational-core__types.d.mts +2 -2
  189. package/dist/runtime.d.mts +4 -4
  190. package/dist/runtime.mjs +7 -7
  191. package/dist/runtime.mjs.map +1 -1
  192. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  193. package/dist/{schema-differ-CqWOkoW9-uVU2SdFf.d.mts → schema-differ-DmP74bB8-BGA6fzOv.d.mts} +4 -4
  194. package/dist/{schema-differ-CqWOkoW9-uVU2SdFf.d.mts.map → schema-differ-DmP74bB8-BGA6fzOv.d.mts.map} +1 -1
  195. package/dist/schema-ir.d.mts +2 -2
  196. package/dist/schema-ir.mjs +2 -2
  197. package/dist/schema-ir__naming.mjs +1 -1
  198. package/dist/schema-ir__types.d.mts +3 -3
  199. package/dist/schema-ir__types.mjs +2 -2
  200. package/dist/{schema-verify-DIfHSB4I-wt28gB9e.mjs → schema-verify-BwRdzbHb-B9vFrm3T.mjs} +22 -6
  201. package/dist/schema-verify-BwRdzbHb-B9vFrm3T.mjs.map +1 -0
  202. package/dist/{serialized-index-52COq1yV-D8zJP-Xl.mjs → serialized-index-52COq1yV-CUJ2F65u.mjs} +3 -3
  203. package/dist/{serialized-index-52COq1yV-D8zJP-Xl.mjs.map → serialized-index-52COq1yV-CUJ2F65u.mjs.map} +1 -1
  204. package/dist/{sql-contract-serializer-DDaAVCQr-Ba3XOCG6.mjs → sql-contract-serializer-sMY3prTx-C8IEwSsf.mjs} +12 -7
  205. package/dist/sql-contract-serializer-sMY3prTx-C8IEwSsf.mjs.map +1 -0
  206. package/dist/{data-type-DU0mtme5.mjs → sql-data-type-Dabuwxet-BljsNjBu.mjs} +32 -13
  207. package/dist/sql-data-type-Dabuwxet-BljsNjBu.mjs.map +1 -0
  208. package/dist/{sql-execution-plan-C7XauPPu-BgBp89vP.d.mts → sql-execution-plan-Dam5yMZg-Bc_eneSz.d.mts} +3 -3
  209. package/dist/sql-execution-plan-Dam5yMZg-Bc_eneSz.d.mts.map +1 -0
  210. package/dist/{sql-expression-BWrjmY6M.d.mts → sql-expression-BAtH-2UU.d.mts} +6 -6
  211. package/dist/sql-expression-BAtH-2UU.d.mts.map +1 -0
  212. package/dist/{sql-expression-DSRILiU2.mjs → sql-expression-BJCuy-WI.mjs} +15 -9
  213. package/dist/sql-expression-BJCuy-WI.mjs.map +1 -0
  214. package/dist/{storage-table-DN36E2yE-Bm5eKeGw.mjs → storage-table-DN36E2yE-0ncS821l.mjs} +2 -2
  215. package/dist/{storage-table-DN36E2yE-Bm5eKeGw.mjs.map → storage-table-DN36E2yE-0ncS821l.mjs.map} +1 -1
  216. package/dist/{transaction-state-DR3nKTmH-D5eFB250.d.mts → transaction-state-DR3nKTmH-n_12DsnU.d.mts} +9 -9
  217. package/dist/{transaction-state-DR3nKTmH-D5eFB250.d.mts.map → transaction-state-DR3nKTmH-n_12DsnU.d.mts.map} +1 -1
  218. package/dist/types-BLyhYk6B.d.mts +1 -0
  219. package/dist/{types-DvhckjSz-Cm0Oodhr.mjs → types-CaVn_xxe-D9WdU3Iy.mjs} +81 -157
  220. package/dist/types-CaVn_xxe-D9WdU3Iy.mjs.map +1 -0
  221. package/dist/{types-Cl4MLNrS-BXDsTb9U.d.mts → types-Cv5t6_Ly-CcBWTpfM.d.mts} +6 -6
  222. package/dist/{types-Cl4MLNrS-BXDsTb9U.d.mts.map → types-Cv5t6_Ly-CcBWTpfM.d.mts.map} +1 -1
  223. package/dist/{types-Sh5HuaZE-BwZNUDEi.d.mts → types-DVaVM20q-B-QcMIOa.d.mts} +9 -20
  224. package/dist/types-DVaVM20q-B-QcMIOa.d.mts.map +1 -0
  225. package/dist/{types-CzxOObSY-Cq3t_HCe.d.mts → types-DaYtBAYT-B22gkh5z.d.mts} +5 -5
  226. package/dist/{types-CzxOObSY-Cq3t_HCe.d.mts.map → types-DaYtBAYT-B22gkh5z.d.mts.map} +1 -1
  227. package/dist/{types-GS3fwvoX.mjs → types-M_FeBD9w.mjs} +2 -2
  228. package/dist/{types-GS3fwvoX.mjs.map → types-M_FeBD9w.mjs.map} +1 -1
  229. package/dist/types-_7TbRpPw.d.mts +1 -0
  230. package/dist/{types-C-z8HyiZ-1Nhw0pHj.d.mts → types-c1iIhJep-DdMj6TNl.d.mts} +49 -51
  231. package/dist/types-c1iIhJep-DdMj6TNl.d.mts.map +1 -0
  232. package/dist/{validators-DlpO67uZ.mjs → validators-Bvfk0aN7.mjs} +14 -11
  233. package/dist/validators-Bvfk0aN7.mjs.map +1 -0
  234. package/dist/{validators-R-Wsy5Rr.d.mts → validators-CTZ-hU2l.d.mts} +4 -1
  235. package/dist/validators-CTZ-hU2l.d.mts.map +1 -0
  236. package/package.json +18 -18
  237. package/dist/ast-BDwGvnKK.mjs.map +0 -1
  238. package/dist/ast-BoM9T1b2.d.mts.map +0 -1
  239. package/dist/attribute-specs-D7EhHD08.d.mts.map +0 -1
  240. package/dist/collection-methods-CyUXbXVw.d.mts +0 -1
  241. package/dist/control-CPg4LwJV.d.mts.map +0 -1
  242. package/dist/control-DXqMl_gd.mjs.map +0 -1
  243. package/dist/control-adapter-CkFfBVei-DGf1LihO.d.mts.map +0 -1
  244. package/dist/control-adapter-DDjgBMy3.d.mts +0 -1
  245. package/dist/data-type-CYsho6Yd.d.mts.map +0 -1
  246. package/dist/data-type-DU0mtme5.mjs.map +0 -1
  247. package/dist/data-type-support-4TcZuD7d.d.mts.map +0 -1
  248. package/dist/data-type-support-CfhpAKLX.mjs.map +0 -1
  249. package/dist/default-mapping-B8_APB1M-CWcTmSQW.d.mts.map +0 -1
  250. package/dist/derived-checks-Cgx_VgS3-CmFqNFgU.mjs.map +0 -1
  251. package/dist/diff-B16bL_IR.mjs +0 -13
  252. package/dist/diff-B16bL_IR.mjs.map +0 -1
  253. package/dist/diff-CVVGktZG.d.mts.map +0 -1
  254. package/dist/expression-CNBCbbzU-DOXKUxQs.d.mts.map +0 -1
  255. package/dist/expression-DUYovBa6.d.mts +0 -2
  256. package/dist/index-reference-DGQdSRjQ.d.mts +0 -1
  257. package/dist/interpreter-CvmBTYyI-DNl-jr2E.mjs.map +0 -1
  258. package/dist/ir-D0Vpm5O9.d.mts.map +0 -1
  259. package/dist/middleware-Bp-R5o9E.d.mts +0 -1
  260. package/dist/numeral-text-Cqu87pVe-DJCqBaSC.mjs.map +0 -1
  261. package/dist/opaque-sql-BWxbqe5a-GGKfyakq.mjs.map +0 -1
  262. package/dist/plan-DdpaNNu1.d.mts +0 -2
  263. package/dist/plan-cGEaSXHv-yuz43WrR.d.mts.map +0 -1
  264. package/dist/psl-build-8bx9WTUt.mjs.map +0 -1
  265. package/dist/psl-field-resolution-SPNDr-jr-CH_gs3Oy.mjs.map +0 -1
  266. package/dist/query-lane-context-C4xq68Mr.d.mts +0 -1
  267. package/dist/schema-verify-DIfHSB4I-wt28gB9e.mjs.map +0 -1
  268. package/dist/sql-contract-serializer-DDaAVCQr-Ba3XOCG6.mjs.map +0 -1
  269. package/dist/sql-execution-plan-C7XauPPu-BgBp89vP.d.mts.map +0 -1
  270. package/dist/sql-expression-BWrjmY6M.d.mts.map +0 -1
  271. package/dist/sql-expression-DSRILiU2.mjs.map +0 -1
  272. package/dist/types-BSBsW0qR.d.mts +0 -1
  273. package/dist/types-C-z8HyiZ-1Nhw0pHj.d.mts.map +0 -1
  274. package/dist/types-CJK7FBdw.d.mts +0 -1
  275. package/dist/types-DvhckjSz-Cm0Oodhr.mjs.map +0 -1
  276. package/dist/types-Sh5HuaZE-BwZNUDEi.d.mts.map +0 -1
  277. package/dist/validators-DlpO67uZ.mjs.map +0 -1
  278. package/dist/validators-R-Wsy5Rr.d.mts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opaque-sql-Dset3kln-BzzXoO94.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/opaque-sql-Dset3kln.mjs"],"sourcesContent":["import { structuredError } from \"@internal/utils/structured-error\";\nimport { isColumnDefaultLiteralInputValue } from \"@internal/contract/types\";\n//#region src/ast/ddl-types.ts\nvar DdlColumnDefault = class {\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n};\nvar LiteralColumnDefault = class extends DdlColumnDefault {\n\tkind = \"literal\";\n\tvalue;\n\tconstructor(value) {\n\t\tsuper();\n\t\tif (!isColumnDefaultLiteralInputValue(value)) throw structuredError(\"CONTRACT.DEFAULT_INVALID\", \"Invalid column default literal value\");\n\t\tthis.value = value;\n\t\tthis.freeze();\n\t}\n};\nvar FunctionColumnDefault = class extends DdlColumnDefault {\n\tkind = \"function\";\n\texpression;\n\tconstructor(expression) {\n\t\tsuper();\n\t\tthis.expression = expression;\n\t\tthis.freeze();\n\t}\n};\nvar DdlColumn = class {\n\tname;\n\ttype;\n\tnotNull;\n\tprimaryKey;\n\tdefault;\n\t/** Codec identity for this column. When present, the DDL walker builds the codec with the column's type parameters and runs the literal default through both declared conversions in order — `codec.toWire(codec.fromDataTypeValue(dataType.fromContract(default.value, params)), {})` — to obtain the wire value it inlines into the DDL string (`encodeLiteralDefault`), and reads each element of a list default the same way (`encodeListLiteralDefault`). The read-back is what makes the pair sound: a contract stores a literal default as its data type's stored JSON, which is not always the application value `toWire` takes (`pg/int8@1` stores decimal text for a `bigint`). A `Date` is the one authored value JSON has no notation for, so it arrives as itself, and the codec reads it with `toDataTypeValue` before `fromDataTypeValue` and `toWire`, so the column's type checks it. A `null` default the type refuses is SQL NULL, `DEFAULT NULL`; a JSON type reads it as the JSON value null. When absent, literal defaults follow RawSqlLiteral wire-scalar semantics (string / number / boolean / bigint / null / Uint8Array / Date inlined directly). */\n\tcodecRef;\n\tconstructor(options) {\n\t\tthis.name = options.name;\n\t\tthis.type = options.type;\n\t\tthis.notNull = options.notNull;\n\t\tthis.primaryKey = options.primaryKey;\n\t\tthis.default = options.default;\n\t\tthis.codecRef = options.codecRef;\n\t\tObject.freeze(this);\n\t}\n};\nvar DdlNode = class {\n\t/**\n\t* Structural brand: every DDL node answers `true`. Lets {@link isDdlNode}\n\t* recognise any `DdlNode` subclass — including target-contributed kinds —\n\t* without a central kind registry that subclasses would have to register\n\t* into.\n\t*/\n\tisDdlNode() {\n\t\treturn true;\n\t}\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n\tcollectParamRefs() {\n\t\treturn [];\n\t}\n};\nfunction isDdlNode(value) {\n\treturn typeof value === \"object\" && value !== null && \"isDdlNode\" in value && typeof value.isDdlNode === \"function\";\n}\n/**\n* A composite (or single-column) PRIMARY KEY constraint on a `CreateTable`\n* node. When `name` is set, the adapter renders `CONSTRAINT <name> PRIMARY KEY\n* (…)`; otherwise it renders an anonymous `PRIMARY KEY (…)`.\n*\n* Frozen on construction — immutable after creation.\n*/\nvar PrimaryKeyConstraint = class {\n\tkind = \"primary-key\";\n\tcolumns;\n\tname;\n\tconstructor(options) {\n\t\tthis.columns = Object.freeze([...options.columns]);\n\t\tthis.name = options.name;\n\t\tObject.freeze(this);\n\t}\n};\n/**\n* A FOREIGN KEY constraint on a `CreateTable` node. `onDelete` and `onUpdate`\n* use the same `ReferentialAction` vocabulary already used by the migration\n* planner and the contract IR — no parallel string enum.\n*\n* Frozen on construction — immutable after creation.\n*/\nvar ForeignKeyConstraint = class {\n\tkind = \"foreign-key\";\n\tcolumns;\n\trefTable;\n\trefColumns;\n\tonDelete;\n\tonUpdate;\n\tname;\n\tconstructor(options) {\n\t\tthis.columns = Object.freeze([...options.columns]);\n\t\tthis.refTable = options.refTable;\n\t\tthis.refColumns = Object.freeze([...options.refColumns]);\n\t\tthis.onDelete = options.onDelete;\n\t\tthis.onUpdate = options.onUpdate;\n\t\tthis.name = options.name;\n\t\tObject.freeze(this);\n\t}\n};\n/**\n* A table-level UNIQUE constraint on a `CreateTable` node. When `name` is\n* set, the adapter renders `CONSTRAINT <name> UNIQUE (…)`; otherwise it\n* renders an anonymous `UNIQUE (…)`.\n*\n* Frozen on construction — immutable after creation.\n*/\nvar UniqueConstraint = class {\n\tkind = \"unique\";\n\tcolumns;\n\tname;\n\tconstructor(options) {\n\t\tthis.columns = Object.freeze([...options.columns]);\n\t\tthis.name = options.name;\n\t\tObject.freeze(this);\n\t}\n};\n/**\n* A table-level CHECK constraint carrying a raw SQL predicate expression. Used\n* for checks that are not enum value-set restrictions — e.g. the element-non-null\n* constraint on a scalar-array column (`array_position(col, NULL) IS NULL`).\n* The `expression` is emitted through `renderOpaqueSql`, so callers must supply safe,\n* pre-validated SQL.\n*\n* Frozen on construction — immutable after creation.\n*/\nvar CheckExpressionConstraint = class {\n\tkind = \"check-expression\";\n\tname;\n\texpression;\n\tconstructor(options) {\n\t\tthis.name = options.name;\n\t\tthis.expression = options.expression;\n\t\tObject.freeze(this);\n\t}\n};\n//#endregion\n//#region src/ast/opaque-sql.ts\n/**\n* SQL text that Prisma does not parse, placed inside a larger statement: a CHECK or policy predicate, an index element list or predicate, a column default, or an ALTER COLUMN TYPE conversion. ADR 244 calls such text opaque.\n*/\nvar OpaqueSql = class {\n\ttext;\n\tconstructor(text) {\n\t\tthis.text = text;\n\t\tObject.freeze(this);\n\t}\n};\nfunction opaqueSql(text) {\n\treturn new OpaqueSql(text);\n}\n/**\n* The text as a statement includes it. Text containing `--` ends with a line break, so a line comment on its last line cannot hide what the statement writes after it.\n*/\nfunction renderOpaqueSql(sql) {\n\treturn sql.text.includes(\"--\") ? `${sql.text}\\n` : sql.text;\n}\n//#endregion\nexport { DdlColumn as a, ForeignKeyConstraint as c, PrimaryKeyConstraint as d, UniqueConstraint as f, CheckExpressionConstraint as i, FunctionColumnDefault as l, opaqueSql as n, DdlColumnDefault as o, isDdlNode as p, renderOpaqueSql as r, DdlNode as s, OpaqueSql as t, LiteralColumnDefault as u };\n\n//# sourceMappingURL=opaque-sql-Dset3kln.mjs.map"],"mappings":";;;AAGA,IAAI,mBAAmB,MAAM;CAC5B,SAAS;EACR,OAAO,OAAO,IAAI;CACnB;AACD;AACA,IAAI,uBAAuB,cAAc,iBAAiB;CACzD,OAAO;CACP;CACA,YAAY,OAAO;EAClB,MAAM;EACN,IAAI,CAAC,iCAAiC,KAAK,GAAG,MAAM,gBAAgB,4BAA4B,sCAAsC;EACtI,KAAK,QAAQ;EACb,KAAK,OAAO;CACb;AACD;AACA,IAAI,wBAAwB,cAAc,iBAAiB;CAC1D,OAAO;CACP;CACA,YAAY,YAAY;EACvB,MAAM;EACN,KAAK,aAAa;EAClB,KAAK,OAAO;CACb;AACD;AACA,IAAI,YAAY,MAAM;CACrB;CACA;CACA;CACA;CACA;;CAEA;CACA,YAAY,SAAS;EACpB,KAAK,OAAO,QAAQ;EACpB,KAAK,OAAO,QAAQ;EACpB,KAAK,UAAU,QAAQ;EACvB,KAAK,aAAa,QAAQ;EAC1B,KAAK,UAAU,QAAQ;EACvB,KAAK,WAAW,QAAQ;EACxB,OAAO,OAAO,IAAI;CACnB;AACD;AACA,IAAI,UAAU,MAAM;;;;;;;CAOnB,YAAY;EACX,OAAO;CACR;CACA,SAAS;EACR,OAAO,OAAO,IAAI;CACnB;CACA,mBAAmB;EAClB,OAAO,CAAC;CACT;AACD;AACA,SAAS,UAAU,OAAO;CACzB,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,eAAe,SAAS,OAAO,MAAM,cAAc;AAC1G;;;;;;;;AAQA,IAAI,uBAAuB,MAAM;CAChC,OAAO;CACP;CACA;CACA,YAAY,SAAS;EACpB,KAAK,UAAU,OAAO,OAAO,CAAC,GAAG,QAAQ,OAAO,CAAC;EACjD,KAAK,OAAO,QAAQ;EACpB,OAAO,OAAO,IAAI;CACnB;AACD;;;;;;;;AAQA,IAAI,uBAAuB,MAAM;CAChC,OAAO;CACP;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,SAAS;EACpB,KAAK,UAAU,OAAO,OAAO,CAAC,GAAG,QAAQ,OAAO,CAAC;EACjD,KAAK,WAAW,QAAQ;EACxB,KAAK,aAAa,OAAO,OAAO,CAAC,GAAG,QAAQ,UAAU,CAAC;EACvD,KAAK,WAAW,QAAQ;EACxB,KAAK,WAAW,QAAQ;EACxB,KAAK,OAAO,QAAQ;EACpB,OAAO,OAAO,IAAI;CACnB;AACD;;;;;;;;AAQA,IAAI,mBAAmB,MAAM;CAC5B,OAAO;CACP;CACA;CACA,YAAY,SAAS;EACpB,KAAK,UAAU,OAAO,OAAO,CAAC,GAAG,QAAQ,OAAO,CAAC;EACjD,KAAK,OAAO,QAAQ;EACpB,OAAO,OAAO,IAAI;CACnB;AACD;;;;;;;;;;AAUA,IAAI,4BAA4B,MAAM;CACrC,OAAO;CACP;CACA;CACA,YAAY,SAAS;EACpB,KAAK,OAAO,QAAQ;EACpB,KAAK,aAAa,QAAQ;EAC1B,OAAO,OAAO,IAAI;CACnB;AACD;;;;AAMA,IAAI,YAAY,MAAM;CACrB;CACA,YAAY,MAAM;EACjB,KAAK,OAAO;EACZ,OAAO,OAAO,IAAI;CACnB;AACD;AACA,SAAS,UAAU,MAAM;CACxB,OAAO,IAAI,UAAU,IAAI;AAC1B;;;;AAIA,SAAS,gBAAgB,KAAK;CAC7B,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,GAAG,IAAI,KAAK,MAAM,IAAI;AACxD"}
@@ -2,23 +2,23 @@ import { t as StorageColumn } from "./storage-table-DC9afJhr-CmRU56OS.mjs";
2
2
  import { l as SqlStorage } from "./sql-storage-tZhB8nS5-8NSWT0TW.mjs";
3
3
  import { D as QueryOperationTypesBase, d as ExtractAggregateTypes, f as ExtractCodecTypes, h as ExtractQueryOperationTypes, m as ExtractFieldOutputTypes, p as ExtractFieldInputTypes } from "./types-Dqf87mfA-BOElvimQ.mjs";
4
4
  import "./types-DMfBh16_.mjs";
5
- import { E as CodecRef$1, Ht as WhereArg, O as ColumnRef, St as OrderByNulls, _ as BinaryExpr, a as AndExpr, bt as OrExpr, c as AnyExpression, ft as LockingClause, r as AggregateFn, st as LimitOffsetValue, ut as LockStrength, vt as NullCheckExpr, xt as OrderByItem, zt as TableSource } from "./types-Sh5HuaZE-BwZNUDEi.mjs";
6
- import { n as SqlQueryPlan, t as Preparable } from "./plan-cGEaSXHv-yuz43WrR.mjs";
7
- import { C as TraitExpression, g as RawSqlInterpolation, i as CodecTypesBase, o as Expression, r as CodecExpression } from "./expression-Ck1wys3N-Cdc7eUQS.mjs";
8
- import "./expression-DUYovBa6.mjs";
9
- import { n as BuiltinFunctions, t as BooleanCodecType } from "./functions-DSwXxsTg.mjs";
10
- import { c as LockOptionCapabilities, l as LockStrengthCapabilities, u as LockWaitOptions } from "./ast-BoM9T1b2.mjs";
11
- import { r as TableIndexReferences, t as IndexReference } from "./index-reference-DJX-CNsb-D5uoBnH_.mjs";
12
- import "./index-reference-DGQdSRjQ.mjs";
13
- import "./plan-DdpaNNu1.mjs";
14
- import { c as CollectionMethodRegistry, r as CollectionMethodContributionId, u as ContributedMethodSignature } from "./collection-methods-BnR4UjcW-C_55W2m0.mjs";
15
- import { n as ExecutionContext } from "./query-lane-context-C42-u9L1-BSJoP83K.mjs";
16
- import "./query-lane-context-C4xq68Mr.mjs";
17
- import { h as RuntimeScope, o as ComputeColumnJsType } from "./types-Cl4MLNrS-BXDsTb9U.mjs";
18
- import "./types-BSBsW0qR.mjs";
19
- import { l as PreparedFor, n as Declaration, o as ParamsFromDeclaration, t as BindSiteParams, u as PreparedStatement } from "./transaction-state-DR3nKTmH-D5eFB250.mjs";
20
- import "./collection-methods-CyUXbXVw.mjs";
21
- import { M as ActivitySourceTarget, W as RuntimeQueryable$1, z as Runtime } from "./index-C8jUgdUh.mjs";
5
+ import { E as CodecRef$1, Ht as WhereArg, O as ColumnRef, St as OrderByNulls, _ as BinaryExpr, a as AndExpr, bt as OrExpr, c as AnyExpression, ft as LockingClause, r as AggregateFn, st as LimitOffsetValue, ut as LockStrength, vt as NullCheckExpr, xt as OrderByItem, zt as TableSource } from "./types-DVaVM20q-B-QcMIOa.mjs";
6
+ import { n as SqlQueryPlan, t as Preparable } from "./plan-Cbed2eDu-BZM3geSm.mjs";
7
+ import { C as TraitExpression, g as RawSqlInterpolation, i as CodecTypesBase, o as Expression, r as CodecExpression } from "./expression-BzrfOiPC-3NqR8UzK.mjs";
8
+ import "./expression-CeerCjQG.mjs";
9
+ import { n as BuiltinFunctions, t as BooleanCodecType } from "./functions-Cp8soSAv.mjs";
10
+ import { c as LockOptionCapabilities, l as LockStrengthCapabilities, u as LockWaitOptions } from "./ast-Dzsat0Zb.mjs";
11
+ import { r as TableIndexReferences, t as IndexReference } from "./index-reference-DJaQLZA3-DxmYkkX-.mjs";
12
+ import "./index-reference-CWppFpUV.mjs";
13
+ import "./plan-BZpZafiQ.mjs";
14
+ import { c as CollectionMethodRegistry, r as CollectionMethodContributionId, u as ContributedMethodSignature } from "./collection-methods-B-tM7OPZ-v8HK9Txa.mjs";
15
+ import { n as ExecutionContext } from "./query-lane-context-BLOPW1rQ-Bn3ugl9a.mjs";
16
+ import "./query-lane-context-Dpep1Fzy.mjs";
17
+ import { h as RuntimeScope, o as ComputeColumnJsType } from "./types-Cv5t6_Ly-CcBWTpfM.mjs";
18
+ import "./types-_7TbRpPw.mjs";
19
+ import { l as PreparedFor, n as Declaration, o as ParamsFromDeclaration, t as BindSiteParams, u as PreparedStatement } from "./transaction-state-DR3nKTmH-n_12DsnU.mjs";
20
+ import "./collection-methods-DQAFcGEB.mjs";
21
+ import { M as ActivitySourceTarget, W as RuntimeQueryable$1, z as Runtime } from "./index-DWNoqFzr.mjs";
22
22
  import { CodecDescriptorRef, ScalarFieldDeclarationBuilder } from "@prisma/orm-framework/components/codec";
23
23
  import { Contract } from "@prisma/orm-framework/contract/types";
24
24
  import { AnnotationValue, AsyncIterableResult, MetaBuilder, OperationKind, ResultType, RuntimeExecuteOptions } from "@prisma/orm-framework/components/runtime";
@@ -2,9 +2,9 @@ import { t as resolveStorageTable } from "./resolve-storage-table-DZsfnzeW.mjs";
2
2
  import { i as isUniqueConstraintViolation } from "./dist-x6jvtkKM.mjs";
3
3
  import { A as ParamRef, C as LiteralExpr, E as NullCheckExpr, F as SelectAst, G as isOrderByNulls, I as SubqueryExpr, L as TableSource, M as ProjectionItem, O as OrExpr, R as UpdateAst, S as ListExpression, T as NotExpr, U as isAggregateFn, V as checkLimitOffset, W as isOrderByDirection, _ as InsertAst, b as JsonArrayAggExpr, c as DeleteAst, f as EqColJoinOn, k as OrderByItem, l as DerivedTableSource, n as AndExpr, o as ColumnRef, p as ExistsExpr, q as isWhereExpr, r as BinaryExpr, s as DefaultValueExpr, t as AggregateExpr, v as InsertOnConflict, w as LockingClause, x as JsonObjectExpr, y as JoinAst, z as WindowFuncExpr } from "./types-NTQsD2MS-DAP2yVDn.mjs";
4
4
  import { t as collectOrderedParamRefs } from "./util-BBgcP3gI-XJBkxo1K.mjs";
5
- import { C as lockStrengthCapabilities, S as lockOptionCapabilities, T as missingCapability, n as JsonDocumentProjection, r as NativeJsonValueProjection, t as CodecJsonValueProjection, w as lockWaitPolicyOf, x as lockIncompatible } from "./ast-BDwGvnKK.mjs";
5
+ import { C as lockStrengthCapabilities, S as lockOptionCapabilities, T as missingCapability, n as JsonDocumentProjection, r as NativeJsonValueProjection, t as CodecJsonValueProjection, w as lockWaitPolicyOf, x as lockIncompatible } from "./ast-CBO3PEJF.mjs";
6
6
  import { a as isExpression, s as toExpr, t as ExpressionImpl } from "./expression-impl-B-XNINxr-vYwKVFeP.mjs";
7
- import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-Bg9OjQf_.mjs";
7
+ import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-4kw8FPpo.mjs";
8
8
  import { t as createFunctions } from "./functions-0YWByawj.mjs";
9
9
  import { t as createIndexReferences } from "./index-reference-DR62gjQS.mjs";
10
10
  import { o as settlementOf } from "./transaction-state-BfXhs7D7-3k10jZ8I.mjs";
@@ -626,7 +626,7 @@ function resolveAggregate(query) {
626
626
  if (resolved === void 0) throw unsupportedAggregate(query, input);
627
627
  const nullability = resolved.nullable ? { nullable: true } : {
628
628
  nullable: false,
629
- emptyResultJson: resolved.emptyResultJson
629
+ emptyResultWire: resolved.emptyResultWire
630
630
  };
631
631
  return {
632
632
  codec: resolved.output,
@@ -669,13 +669,12 @@ function inputCodecRef(query) {
669
669
  * count's zero cardinality — so this covers only the degenerate case of a
670
670
  * result set with no row: an absent aggregate alias, or an include whose
671
671
  * envelope never arrived. The answer reads off the operation's declared row:
672
- * NULL where the row is nullable, else the value the row declares, decoded
673
- * through the codec it declared beside it — so the application sees the same
674
- * value shape a real row would produce, in whichever form that codec's
675
- * canonical JSON takes.
672
+ * NULL where the row is nullable, else the wire value the row declares, read
673
+ * with the declared codec's `fromWire` — so the application sees the same value
674
+ * shape a real row would produce.
676
675
  */
677
- function emptyAggregateResult(result, codec) {
678
- return result.nullable ? null : codec.decodeJson(result.emptyResultJson);
676
+ async function emptyAggregateResult(result, codec) {
677
+ return result.nullable ? null : codec.fromWire(result.emptyResultWire, {});
679
678
  }
680
679
  /** The columns of a model's own and inherited fields, for operations that apply each column to the model's table: `groupBy`, `distinct` and `distinctOn`. */
681
680
  function mapFieldsToColumns(contract, namespaceId, modelName, fieldNames) {
@@ -2450,7 +2449,7 @@ function createPreparedRowsConsumer(options) {
2450
2449
  raw,
2451
2450
  mapped: mapRow(raw)
2452
2451
  }));
2453
- for (const parent of parents) for (const include of includes) parent.mapped[include.alias] = include.consume(parent.raw[include.alias]);
2452
+ for (const parent of parents) for (const include of includes) parent.mapped[include.alias] = await include.consume(parent.raw[include.alias]);
2454
2453
  for (const parent of parents) yield castRow(parent.mapped);
2455
2454
  })());
2456
2455
  }
@@ -2473,10 +2472,10 @@ function createPreparedIncludeConsumer(context, include) {
2473
2472
  }));
2474
2473
  return {
2475
2474
  alias,
2476
- consume: (raw) => {
2475
+ consume: async (raw) => {
2477
2476
  const parsed = parseCombineEnvelope(include, raw);
2478
2477
  const result = {};
2479
- for (const branch of branches) result[branch.name] = branch.consume(parsed[branch.name]);
2478
+ for (const branch of branches) result[branch.name] = await branch.consume(parsed[branch.name]);
2480
2479
  return result;
2481
2480
  }
2482
2481
  };
@@ -2498,16 +2497,17 @@ function createPreparedIncludeConsumer(context, include) {
2498
2497
  const fused = deferResolution(() => createPreparedIncludedRowDecoder(contract, include, bindingFor));
2499
2498
  return {
2500
2499
  alias,
2501
- consume: (raw) => {
2500
+ consume: async (raw) => {
2502
2501
  const rows = parseIncludedRows(include, raw);
2503
2502
  if (rows.length === 0) return toOne ? null : [];
2504
2503
  const decoder = fused();
2505
2504
  if (!decoder || !rows.every(decoder.matches)) return consumeRowInclude(rows, mapRow, bindingFor, nested, toOne);
2506
- const mapped = rows.map((row) => {
2507
- const result = decoder.decode(row);
2508
- for (const child of nested) result[child.alias] = child.consume(row[child.alias]);
2509
- return result;
2510
- });
2505
+ const mapped = [];
2506
+ for (const row of rows) {
2507
+ const result = await decoder.decode(row);
2508
+ for (const child of nested) result[child.alias] = await child.consume(row[child.alias]);
2509
+ mapped.push(result);
2510
+ }
2511
2511
  return toOne ? mapped[0] ?? null : mapped;
2512
2512
  }
2513
2513
  };
@@ -2529,10 +2529,10 @@ function createPreparedIncludedRowDecoder(contract, include, bindingFor) {
2529
2529
  return {
2530
2530
  key,
2531
2531
  field: fieldOf(key),
2532
- decode(value) {
2532
+ async decode(value) {
2533
2533
  if (value === null || value === void 0) return value;
2534
2534
  const resolved = binding();
2535
- return resolved ? decodeIncludedColumnValue(resolved.ref, resolved.codecId, resolved.codec, value) : value;
2535
+ return resolved ? decodeIncludedColumnValue(resolved, value) : value;
2536
2536
  }
2537
2537
  };
2538
2538
  });
@@ -2541,9 +2541,9 @@ function createPreparedIncludedRowDecoder(contract, include, bindingFor) {
2541
2541
  const actual = Object.keys(row);
2542
2542
  return actual.length === keys.length && actual.every((key, index) => key === keys[index]);
2543
2543
  },
2544
- decode(row) {
2544
+ async decode(row) {
2545
2545
  const result = {};
2546
- for (const operation of operations) result[operation.field] = operation.decode(row[operation.key]);
2546
+ for (const operation of operations) result[operation.field] = await operation.decode(row[operation.key]);
2547
2547
  return result;
2548
2548
  }
2549
2549
  };
@@ -2604,7 +2604,7 @@ function consumeIncludeRows(context, state, namespaceId, modelName, rows) {
2604
2604
  };
2605
2605
  });
2606
2606
  const bindings = /* @__PURE__ */ new WeakMap();
2607
- for (const parent of parentRows) for (const include of state.includes) parent.mapped[include.relationName] = decodeIncludePayload(contract, context, include, parent.raw[include.relationName], bindings);
2607
+ for (const parent of parentRows) for (const include of state.includes) parent.mapped[include.relationName] = await decodeIncludePayload(contract, context, include, parent.raw[include.relationName], bindings);
2608
2608
  for (const row of parentRows) yield blindCast(row.mapped);
2609
2609
  };
2610
2610
  return new AsyncIterableResult(generator());
@@ -2648,7 +2648,7 @@ function consumeIncludeRows(context, state, namespaceId, modelName, rows) {
2648
2648
  * each branch is dispatched to the row or scalar decoder per its
2649
2649
  * declared shape (see `decodeCombineIncludePayload`).
2650
2650
  */
2651
- function decodeIncludePayload(contract, context, include, raw, bindings) {
2651
+ async function decodeIncludePayload(contract, context, include, raw, bindings) {
2652
2652
  if (include.scalar) return decodeScalarIncludePayload(contract, context, include, include.scalar, raw);
2653
2653
  if (include.combine) return decodeCombineIncludePayload(contract, context, include, include.combine, raw, bindings);
2654
2654
  const rawChildren = parseIncludedRows(include, raw);
@@ -2672,17 +2672,17 @@ function decodeIncludePayload(contract, context, include, raw, bindings) {
2672
2672
  consume: (value) => decodeIncludePayload(contract, context, nested, value, bindings)
2673
2673
  })), isToOneCardinality(include.cardinality));
2674
2674
  }
2675
- function consumeRowInclude(rawChildren, mapChildRow, bindingFor, nested, toOne) {
2675
+ async function consumeRowInclude(rawChildren, mapChildRow, bindingFor, nested, toOne) {
2676
2676
  const mappedChildren = [];
2677
2677
  for (const childRow of rawChildren) {
2678
- const decodedChildRow = decodeIncludedStorageRow(childRow, bindingFor);
2678
+ const decodedChildRow = await decodeIncludedStorageRow(childRow, bindingFor);
2679
2679
  const mapped = mapChildRow(decodedChildRow);
2680
- for (const child of nested) mapped[child.alias] = child.consume(decodedChildRow[child.alias]);
2680
+ for (const child of nested) mapped[child.alias] = await child.consume(decodedChildRow[child.alias]);
2681
2681
  mappedChildren.push(mapped);
2682
2682
  }
2683
2683
  return toOne ? mappedChildren[0] ?? null : mappedChildren;
2684
2684
  }
2685
- function decodeIncludedStorageRow(row, bindingFor) {
2685
+ async function decodeIncludedStorageRow(row, bindingFor) {
2686
2686
  const decoded = {};
2687
2687
  for (const [key, value] of Object.entries(row)) {
2688
2688
  if (value === null || value === void 0) {
@@ -2690,7 +2690,7 @@ function decodeIncludedStorageRow(row, bindingFor) {
2690
2690
  continue;
2691
2691
  }
2692
2692
  const binding = bindingFor(key);
2693
- decoded[key] = binding ? decodeIncludedColumnValue(binding.ref, binding.codecId, binding.codec, value) : value;
2693
+ decoded[key] = binding ? await decodeIncludedColumnValue(binding, value) : value;
2694
2694
  }
2695
2695
  return decoded;
2696
2696
  }
@@ -2702,7 +2702,11 @@ function resolveIncludedColumnBinding(contract, context, include, key) {
2702
2702
  return {
2703
2703
  ref,
2704
2704
  codec,
2705
- codecId: context.codecDescriptors.codecRefForColumn(ref.namespaceId, ref.table, ref.column)?.codecId ?? ref.storageColumn.codecId
2705
+ codecId: context.codecDescriptors.codecRefForColumn(ref.namespaceId, ref.table, ref.column)?.codecId ?? ref.storageColumn.codecId,
2706
+ ctx: { column: {
2707
+ table: ref.table,
2708
+ name: ref.column
2709
+ } }
2706
2710
  };
2707
2711
  }
2708
2712
  function resolveIncludedColumnRef(contract, include, key) {
@@ -2730,7 +2734,8 @@ function resolveIncludedColumnRef(contract, include, key) {
2730
2734
  };
2731
2735
  }
2732
2736
  }
2733
- function decodeIncludedColumnValue(ref, codecId, codec, value) {
2737
+ async function decodeIncludedColumnValue(binding, value) {
2738
+ const { ref, codecId } = binding;
2734
2739
  if (ref.storageColumn.many !== false) {
2735
2740
  if (!Array.isArray(value)) wrapIncludedDecodeFailure(/* @__PURE__ */ new TypeError(`expected an array from the driver for many-typed column, got ${typeof value}`), ref, codecId);
2736
2741
  const decoded = [];
@@ -2739,16 +2744,19 @@ function decodeIncludedColumnValue(ref, codecId, codec, value) {
2739
2744
  decoded.push(null);
2740
2745
  continue;
2741
2746
  }
2742
- decoded.push(decodeIncludedJsonValue(ref, codecId, codec, element));
2747
+ decoded.push(await decodeIncludedJsonValue(binding, element));
2743
2748
  }
2744
2749
  return decoded;
2745
2750
  }
2746
- return decodeIncludedJsonValue(ref, codecId, codec, value);
2751
+ return decodeIncludedJsonValue(binding, value);
2747
2752
  }
2748
- /** `ref` names the value for a decode failure; an aggregate names its relation where a column would name itself. */
2749
- function decodeIncludedJsonValue(ref, codecId, codec, value) {
2753
+ /**
2754
+ * Reads a value the database put into JSON with its codec's `fromWire`, with the call context an ordinary row's cell gets. `ref` names the value for a decode failure; an aggregate names its relation where a column would name itself.
2755
+ */
2756
+ async function decodeIncludedJsonValue(binding, value) {
2757
+ const { ref, codecId, codec, ctx } = binding;
2750
2758
  try {
2751
- return codec.decodeJson(blindCast(value));
2759
+ return await codec.fromWire(value, ctx);
2752
2760
  } catch (error) {
2753
2761
  if (isRuntimeError(error)) throw error;
2754
2762
  wrapIncludedDecodeFailure(error, ref, codecId);
@@ -2785,18 +2793,18 @@ function wrapIncludedDecodeFailure(error, ref, codecId) {
2785
2793
  * bug — `parseCombineEnvelope` throws loudly rather than papering over
2786
2794
  * it with an empty shape.
2787
2795
  */
2788
- function decodeCombineIncludePayload(contract, context, include, branches, raw, bindings) {
2796
+ async function decodeCombineIncludePayload(contract, context, include, branches, raw, bindings) {
2789
2797
  const parsed = parseCombineEnvelope(include, raw);
2790
2798
  const result = {};
2791
2799
  for (const [branchName, branch] of Object.entries(branches)) {
2792
2800
  const branchRaw = parsed[branchName];
2793
- if (branch.kind === "rows") result[branchName] = decodeIncludePayload(contract, context, {
2801
+ if (branch.kind === "rows") result[branchName] = await decodeIncludePayload(contract, context, {
2794
2802
  ...include,
2795
2803
  nested: branch.state,
2796
2804
  scalar: void 0,
2797
2805
  combine: void 0
2798
2806
  }, branchRaw, bindings);
2799
- else result[branchName] = decodeScalarIncludePayload(contract, context, include, branch.selector, branchRaw);
2807
+ else result[branchName] = await decodeScalarIncludePayload(contract, context, include, branch.selector, branchRaw);
2800
2808
  }
2801
2809
  return result;
2802
2810
  }
@@ -2855,16 +2863,21 @@ function resolveScalarIncludeMetadata(contract, context, include, scalar) {
2855
2863
  codec: context.contractCodecs.forCodecRef(resolved.codec)
2856
2864
  };
2857
2865
  }
2858
- function consumeScalarInclude(include, resolved, codec, raw) {
2866
+ async function consumeScalarInclude(include, resolved, codec, raw) {
2859
2867
  if (raw === null || raw === void 0) return emptyAggregateResult(resolved, codec);
2860
2868
  const parsed = parseIncludePayload(raw);
2861
2869
  if (!isPlainObjectEnvelope(parsed)) throw new InternalError(`scalar() envelope for include "${include.relationName}" has unexpected shape (expected object, got ${describeEnvelopeShape(parsed)}); this indicates a planner or decoder bug.`);
2862
2870
  const value = parsed["value"];
2863
2871
  if (value === null || value === void 0) return emptyAggregateResult(resolved, codec);
2864
2872
  return decodeIncludedJsonValue({
2865
- table: include.relatedTableName,
2866
- column: include.relationName
2867
- }, resolved.codec.codecId, codec, value);
2873
+ ref: {
2874
+ table: include.relatedTableName,
2875
+ column: include.relationName
2876
+ },
2877
+ codecId: resolved.codec.codecId,
2878
+ codec,
2879
+ ctx: {}
2880
+ }, value);
2868
2881
  }
2869
2882
  function parseIncludedRows(include, value) {
2870
2883
  if (value === null || value === void 0) return [];
@@ -5618,9 +5631,9 @@ var CollectionBase = class CollectionBase {
5618
5631
  plan: compiled,
5619
5632
  async consume(source) {
5620
5633
  const row = (await source.toArray())[0] ?? {};
5621
- return blindCast(Object.fromEntries(results.map(({ alias, resolved, codec }) => {
5622
- return [alias, (Object.hasOwn(row, alias) ? row[alias] : void 0) ?? emptyAggregateResult(resolved, codec)];
5623
- })));
5634
+ return blindCast(Object.fromEntries(await Promise.all(results.map(async ({ alias, resolved, codec }) => {
5635
+ return [alias, (Object.hasOwn(row, alias) ? row[alias] : void 0) ?? await emptyAggregateResult(resolved, codec)];
5636
+ }))));
5624
5637
  }
5625
5638
  };
5626
5639
  }