@prisma/orm-family-sql 8.0.0-rc.21-dev.5 → 8.0.0-rc.21-dev.7

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 (337) hide show
  1. package/dist/{ast-DcphKbq9.d.mts → ast-1JRQY-dP.d.mts} +10 -4
  2. package/dist/ast-1JRQY-dP.d.mts.map +1 -0
  3. package/dist/{ast-e_02t9Nt.mjs → ast-C3itulLi.mjs} +7 -1
  4. package/dist/ast-C3itulLi.mjs.map +1 -0
  5. package/dist/{attribute-specs-Dcd2ZUrY.d.mts → attribute-specs-DDpSUaG9.d.mts} +3 -3
  6. package/dist/{attribute-specs-Dcd2ZUrY.d.mts.map → attribute-specs-DDpSUaG9.d.mts.map} +1 -1
  7. package/dist/{authored-check-naming-D-o196ry.d.mts → authored-check-naming-BiSwtSFu.d.mts} +2 -2
  8. package/dist/{authored-check-naming-D-o196ry.d.mts.map → authored-check-naming-BiSwtSFu.d.mts.map} +1 -1
  9. package/dist/{authored-check-naming-BHGJhjqn.mjs → authored-check-naming-DTKcH2_d.mjs} +3 -3
  10. package/dist/{authored-check-naming-BHGJhjqn.mjs.map → authored-check-naming-DTKcH2_d.mjs.map} +1 -1
  11. package/dist/{authoring-entity-types-CgKIgWq5-CZK1F9a_.d.mts → authoring-entity-types-CgKIgWq5-BqRjoPFF.d.mts} +2 -2
  12. package/dist/{authoring-entity-types-CgKIgWq5-CZK1F9a_.d.mts.map → authoring-entity-types-CgKIgWq5-BqRjoPFF.d.mts.map} +1 -1
  13. package/dist/builder.d.mts +3 -3
  14. package/dist/builder__runtime.d.mts +10 -10
  15. package/dist/builder__runtime.mjs +4 -4
  16. package/dist/builder__types.d.mts +5 -5
  17. package/dist/{check-constraint-B7qGu6rc-Bk2ezWXu.d.mts → check-constraint-B7qGu6rc-D5kVe9je.d.mts} +2 -2
  18. package/dist/{check-constraint-B7qGu6rc-Bk2ezWXu.d.mts.map → check-constraint-B7qGu6rc-D5kVe9je.d.mts.map} +1 -1
  19. package/dist/check-expressions-BDsLvzqN.mjs +108 -0
  20. package/dist/check-expressions-BDsLvzqN.mjs.map +1 -0
  21. package/dist/check-expressions-DuWjvG4h.d.mts +82 -0
  22. package/dist/check-expressions-DuWjvG4h.d.mts.map +1 -0
  23. package/dist/{codec-descriptor-registry-CiiFzMtb.mjs → codec-descriptor-registry-UiFDvDj4.mjs} +2 -2
  24. package/dist/{codec-descriptor-registry-CiiFzMtb.mjs.map → codec-descriptor-registry-UiFDvDj4.mjs.map} +1 -1
  25. package/dist/codec-json-type-BdWPJ6T5-BhmIyNyb.d.mts +13 -0
  26. package/dist/codec-json-type-BdWPJ6T5-BhmIyNyb.d.mts.map +1 -0
  27. package/dist/codec-json-type-DUWyBtJk-BVTavkH0.mjs +21 -0
  28. package/dist/codec-json-type-DUWyBtJk-BVTavkH0.mjs.map +1 -0
  29. package/dist/{collection-methods-D9CYfePl-DsDjYS6t.d.mts → collection-methods-D9CYfePl-BGvD1h9Z.d.mts} +4 -4
  30. package/dist/{collection-methods-D9CYfePl-DsDjYS6t.d.mts.map → collection-methods-D9CYfePl-BGvD1h9Z.d.mts.map} +1 -1
  31. package/dist/collection-methods-mo-2RjdX.d.mts +1 -0
  32. package/dist/{config-types-DkEeq_qq.mjs → config-types-BCXwEBZH.mjs} +2 -2
  33. package/dist/{config-types-DkEeq_qq.mjs.map → config-types-BCXwEBZH.mjs.map} +1 -1
  34. package/dist/{config-types-C-1mIiJO.d.mts → config-types-Ce1tAJ0B.d.mts} +4 -4
  35. package/dist/{config-types-C-1mIiJO.d.mts.map → config-types-Ce1tAJ0B.d.mts.map} +1 -1
  36. package/dist/{contract-builder-DMNe_jX9.mjs → contract-builder-D50r41BU.mjs} +114 -49
  37. package/dist/contract-builder-D50r41BU.mjs.map +1 -0
  38. package/dist/{contract-builder-B-Q9T1CO.d.mts → contract-builder-D6JuOGA6.d.mts} +58 -13
  39. package/dist/contract-builder-D6JuOGA6.d.mts.map +1 -0
  40. package/dist/contract-emitter.d.mts +1 -1
  41. package/dist/contract-emitter.mjs +1 -1
  42. package/dist/contract-prisma7__provider.d.mts +5 -3
  43. package/dist/contract-prisma7__provider.d.mts.map +1 -1
  44. package/dist/contract-prisma7__provider.mjs +62 -26
  45. package/dist/contract-prisma7__provider.mjs.map +1 -1
  46. package/dist/contract-psl.d.mts +4 -4
  47. package/dist/contract-psl.mjs +1 -1
  48. package/dist/contract-psl__attribute-specs.d.mts +1 -1
  49. package/dist/contract-psl__attribute-specs.mjs +1 -1
  50. package/dist/contract-psl__diagnostics.mjs +1 -1
  51. package/dist/contract-psl__provider.d.mts +2 -2
  52. package/dist/contract-psl__provider.mjs +3 -3
  53. package/dist/contract-psl__provider.mjs.map +1 -1
  54. package/dist/contract-ts.d.mts +4 -4
  55. package/dist/contract-ts.mjs +3 -3
  56. package/dist/contract-ts__config-types.d.mts +1 -1
  57. package/dist/contract-ts__config-types.mjs +1 -1
  58. package/dist/contract-ts__contract-builder.d.mts +3 -3
  59. package/dist/contract-ts__contract-builder.mjs +2 -2
  60. package/dist/{contract-view-DqpzeYeE.mjs → contract-view-CcD3axo0.mjs} +6 -2
  61. package/dist/contract-view-CcD3axo0.mjs.map +1 -0
  62. package/dist/{contract-view-DuB35or0.d.mts → contract-view-DkIZrHyj.d.mts} +3 -3
  63. package/dist/{contract-view-DuB35or0.d.mts.map → contract-view-DkIZrHyj.d.mts.map} +1 -1
  64. package/dist/contract.d.mts +21 -19
  65. package/dist/contract.mjs +18 -14
  66. package/dist/contract__authored-check-naming.d.mts +1 -1
  67. package/dist/contract__authored-check-naming.mjs +1 -1
  68. package/dist/contract__check-expressions.d.mts +2 -0
  69. package/dist/contract__check-expressions.mjs +2 -0
  70. package/dist/contract__codec-json-type.d.mts +2 -0
  71. package/dist/contract__codec-json-type.mjs +2 -0
  72. package/dist/contract__contract-view.d.mts +1 -1
  73. package/dist/contract__contract-view.mjs +1 -1
  74. package/dist/contract__data-type.d.mts +2 -2
  75. package/dist/contract__data-type.mjs +2 -2
  76. package/dist/contract__entity-kinds.d.mts +2 -2
  77. package/dist/contract__entity-kinds.mjs +2 -2
  78. package/dist/contract__factories.d.mts +1 -1
  79. package/dist/contract__factories.mjs +1 -1
  80. package/dist/contract__foreign-key-materialization.d.mts +1 -1
  81. package/dist/contract__foreign-key-materialization.mjs +2 -2
  82. package/dist/contract__index-naming.d.mts +1 -1
  83. package/dist/contract__index-naming.mjs +1 -1
  84. package/dist/contract__index-type-validation.d.mts +1 -1
  85. package/dist/contract__resolve-storage-table.d.mts +1 -1
  86. package/dist/contract__sql-expression.d.mts +1 -1
  87. package/dist/contract__types.d.mts +8 -8
  88. package/dist/contract__types.mjs +6 -4
  89. package/dist/contract__validators.d.mts +1 -1
  90. package/dist/contract__validators.mjs +2 -2
  91. package/dist/{control-B6W_VEZ9.d.mts → control-BE7gXqZF.d.mts} +18 -18
  92. package/dist/{control-B6W_VEZ9.d.mts.map → control-BE7gXqZF.d.mts.map} +1 -1
  93. package/dist/{control-D6wIw5Fi.mjs → control-DPCrkpMS.mjs} +16 -17
  94. package/dist/control-DPCrkpMS.mjs.map +1 -0
  95. package/dist/{control-adapter-SlQkTEwT.mjs → control-adapter-BetaUm2y.mjs} +2 -2
  96. package/dist/{control-adapter-SlQkTEwT.mjs.map → control-adapter-BetaUm2y.mjs.map} +1 -1
  97. package/dist/{control-adapter-BfyLe7rh-C_rrUuhb.d.mts → control-adapter-BfyLe7rh-CiGzw3dq.d.mts} +8 -8
  98. package/dist/{control-adapter-BfyLe7rh-C_rrUuhb.d.mts.map → control-adapter-BfyLe7rh-CiGzw3dq.d.mts.map} +1 -1
  99. package/dist/{control-adapter-CZ84jQ_z.d.mts → control-adapter-BlBhW0pc.d.mts} +4 -4
  100. package/dist/{control-adapter-CZ84jQ_z.d.mts.map → control-adapter-BlBhW0pc.d.mts.map} +1 -1
  101. package/dist/{data-type-DJIvKQHf.d.mts → data-type-B-Do6RMA.d.mts} +15 -7
  102. package/dist/data-type-B-Do6RMA.d.mts.map +1 -0
  103. package/dist/{data-type-BFSpaotu.mjs → data-type-BfA5F0Qf.mjs} +2 -2
  104. package/dist/{data-type-BFSpaotu.mjs.map → data-type-BfA5F0Qf.mjs.map} +1 -1
  105. package/dist/{db-D1d75IvM-D5CqruQz.d.mts → db-D1d75IvM-C1lqD6a2.d.mts} +13 -13
  106. package/dist/{db-D1d75IvM-D5CqruQz.d.mts.map → db-D1d75IvM-C1lqD6a2.d.mts.map} +1 -1
  107. package/dist/{ddl-types-BeA1kjV1-C4d5owxE.d.mts → ddl-types-BeA1kjV1-BUcW52Dx.d.mts} +3 -3
  108. package/dist/{ddl-types-BeA1kjV1-C4d5owxE.d.mts.map → ddl-types-BeA1kjV1-BUcW52Dx.d.mts.map} +1 -1
  109. package/dist/{default-mapping-CAOONlKQ-4m07nb-O.d.mts → default-mapping-CEISdj2g-B50Ag_F_.d.mts} +5 -11
  110. package/dist/default-mapping-CEISdj2g-B50Ag_F_.d.mts.map +1 -0
  111. package/dist/{derived-checks-D5HVRvqN-BJx1gwPA.mjs → derived-checks-D__agoFB-Boa1MHcA.mjs} +156 -40
  112. package/dist/derived-checks-D__agoFB-Boa1MHcA.mjs.map +1 -0
  113. package/dist/{derived-checks-DpPkO6Dt-9U9UJZOo.d.mts → derived-checks-DpPkO6Dt-CQIM17j5.d.mts} +3 -3
  114. package/dist/{derived-checks-DpPkO6Dt-9U9UJZOo.d.mts.map → derived-checks-DpPkO6Dt-CQIM17j5.d.mts.map} +1 -1
  115. package/dist/{diagnostics-C7jR1Jyf.mjs → diagnostics-CoM0OFuR.mjs} +40 -30
  116. package/dist/diagnostics-CoM0OFuR.mjs.map +1 -0
  117. package/dist/{diff-FNTO8gbI.d.mts → diff-BlX_rfVG.d.mts} +7 -7
  118. package/dist/{diff-FNTO8gbI.d.mts.map → diff-BlX_rfVG.d.mts.map} +1 -1
  119. package/dist/{dist-C8Y-PPuE.mjs → dist-BJjqJT_M.mjs} +5 -3
  120. package/dist/dist-BJjqJT_M.mjs.map +1 -0
  121. package/dist/{entity-kinds-JR5SAm5h-DOH6VUtL.mjs → entity-kinds-CgEwK0hH-D1NKoKE5.mjs} +25 -7
  122. package/dist/entity-kinds-CgEwK0hH-D1NKoKE5.mjs.map +1 -0
  123. package/dist/{entity-kinds-BPG2xCZV.d.mts → entity-kinds-oN1yn4vw.d.mts} +8 -7
  124. package/dist/{entity-kinds-BPG2xCZV.d.mts.map → entity-kinds-oN1yn4vw.d.mts.map} +1 -1
  125. package/dist/{exports-CGzFaakG-Dddm8emA.mjs → exports-CGzFaakG-4Aw50nT1.mjs} +3 -3
  126. package/dist/{exports-CGzFaakG-Dddm8emA.mjs.map → exports-CGzFaakG-4Aw50nT1.mjs.map} +1 -1
  127. package/dist/{expression-BWRsWR6O-BrUVz0V2.d.mts → expression-BWRsWR6O-HbWL9x9D.d.mts} +3 -3
  128. package/dist/{expression-BWRsWR6O-BrUVz0V2.d.mts.map → expression-BWRsWR6O-HbWL9x9D.d.mts.map} +1 -1
  129. package/dist/{expression-C3F6gxZH-DrYNeDbh.d.mts → expression-C3F6gxZH-EOb5cRCY.d.mts} +7 -7
  130. package/dist/{expression-C3F6gxZH-DrYNeDbh.d.mts.map → expression-C3F6gxZH-EOb5cRCY.d.mts.map} +1 -1
  131. package/dist/expression-OVCWlXHm.d.mts +2 -0
  132. package/dist/{expression-impl-DtbmFnnz-CUKzBisY.mjs → expression-impl-DtbmFnnz-Dal0IYDE.mjs} +2 -2
  133. package/dist/{expression-impl-DtbmFnnz-CUKzBisY.mjs.map → expression-impl-DtbmFnnz-Dal0IYDE.mjs.map} +1 -1
  134. package/dist/{factories-Crobuxwn.mjs → factories-B2hKDIzy.mjs} +3 -3
  135. package/dist/{factories-Crobuxwn.mjs.map → factories-B2hKDIzy.mjs.map} +1 -1
  136. package/dist/{factories-DbNP9qfs.d.mts → factories-DVgCG7DR.d.mts} +4 -4
  137. package/dist/{factories-DbNP9qfs.d.mts.map → factories-DVgCG7DR.d.mts.map} +1 -1
  138. package/dist/family.d.mts +16 -16
  139. package/dist/family.mjs +10 -10
  140. package/dist/family__control-adapter.d.mts +2 -2
  141. package/dist/family__control-adapter.mjs +1 -1
  142. package/dist/family__control.d.mts +4 -4
  143. package/dist/family__control.mjs +3 -3
  144. package/dist/family__diff.d.mts +1 -1
  145. package/dist/family__diff.mjs +1 -1
  146. package/dist/family__ir.d.mts +1 -1
  147. package/dist/family__ir.mjs +1 -1
  148. package/dist/family__migration.d.mts +1 -1
  149. package/dist/family__pack.d.mts +1 -1
  150. package/dist/family__pack.mjs +2 -2
  151. package/dist/family__psl-build.d.mts +3 -3
  152. package/dist/family__psl-build.mjs +2 -2
  153. package/dist/family__psl-infer.d.mts +1 -1
  154. package/dist/family__psl-infer.mjs +1 -1
  155. package/dist/family__runtime.d.mts +2 -2
  156. package/dist/family__runtime.mjs +1 -1
  157. package/dist/{foreign-key-materialization-48P2V8on.d.mts → foreign-key-materialization-C53nVQuD.d.mts} +4 -4
  158. package/dist/{foreign-key-materialization-48P2V8on.d.mts.map → foreign-key-materialization-C53nVQuD.d.mts.map} +1 -1
  159. package/dist/{foreign-key-materialization-BM59w_Xg.mjs → foreign-key-materialization-CCHAR789.mjs} +5 -5
  160. package/dist/{foreign-key-materialization-BM59w_Xg.mjs.map → foreign-key-materialization-CCHAR789.mjs.map} +1 -1
  161. package/dist/{functions-D7lN5-JU.mjs → functions-DO1k8KLB.mjs} +2 -2
  162. package/dist/{functions-D7lN5-JU.mjs.map → functions-DO1k8KLB.mjs.map} +1 -1
  163. package/dist/{functions-CQrsCHCj.d.mts → functions-PBSwFhni.d.mts} +6 -6
  164. package/dist/{functions-CQrsCHCj.d.mts.map → functions-PBSwFhni.d.mts.map} +1 -1
  165. package/dist/{generator-functions-Hy4pDDr9-AUCNpeg5.mjs → generator-functions-Hy4pDDr9-CMfJOBtv.mjs} +3 -3
  166. package/dist/{generator-functions-Hy4pDDr9-AUCNpeg5.mjs.map → generator-functions-Hy4pDDr9-CMfJOBtv.mjs.map} +1 -1
  167. package/dist/{index-0qfR8_db.d.mts → index-BAI1gH-I.d.mts} +21 -21
  168. package/dist/{index-0qfR8_db.d.mts.map → index-BAI1gH-I.d.mts.map} +1 -1
  169. package/dist/{index-Nqc3OHR_.d.mts → index-BWWwt5hB.d.mts} +3 -3
  170. package/dist/{index-Nqc3OHR_.d.mts.map → index-BWWwt5hB.d.mts.map} +1 -1
  171. package/dist/{index-equivalence-DswCiq5l-CGsyPP9B.mjs → index-equivalence-DswCiq5l-9GNm8oG9.mjs} +2 -2
  172. package/dist/{index-equivalence-DswCiq5l-CGsyPP9B.mjs.map → index-equivalence-DswCiq5l-9GNm8oG9.mjs.map} +1 -1
  173. package/dist/{index-naming-BOcJT1B3-mG8Fd6KN.mjs → index-naming-BOcJT1B3-D-49owHA.mjs} +2 -2
  174. package/dist/{index-naming-BOcJT1B3-mG8Fd6KN.mjs.map → index-naming-BOcJT1B3-D-49owHA.mjs.map} +1 -1
  175. package/dist/{index-naming-Cs6wwia3.d.mts → index-naming-DqjO4p5R.d.mts} +2 -2
  176. package/dist/{index-naming-Cs6wwia3.d.mts.map → index-naming-DqjO4p5R.d.mts.map} +1 -1
  177. package/dist/index-reference-D3p5ziNG.d.mts +1 -0
  178. package/dist/{index-reference-YHvh6wAL-BAhOS7RC.d.mts → index-reference-YHvh6wAL-BupQRpkE.d.mts} +4 -4
  179. package/dist/{index-reference-YHvh6wAL-BAhOS7RC.d.mts.map → index-reference-YHvh6wAL-BupQRpkE.d.mts.map} +1 -1
  180. package/dist/{index-type-validation-fGGwAHWc.d.mts → index-type-validation-BFJlwjWi.d.mts} +3 -3
  181. package/dist/{index-type-validation-fGGwAHWc.d.mts.map → index-type-validation-BFJlwjWi.d.mts.map} +1 -1
  182. package/dist/{interpreter-CS21wD1i-G0u1x8t_.mjs → interpreter-ChvVEijY-FeJngsog.mjs} +92 -45
  183. package/dist/interpreter-ChvVEijY-FeJngsog.mjs.map +1 -0
  184. package/dist/{ir-BvptQsFW.d.mts → ir-CZ5Ks7EA.d.mts} +4 -4
  185. package/dist/{ir-BvptQsFW.d.mts.map → ir-CZ5Ks7EA.d.mts.map} +1 -1
  186. package/dist/middleware-Dp3CD7yZ.d.mts +1 -0
  187. package/dist/{middleware-JfHt_Ax8-DKXbos9y.d.mts → middleware-JfHt_Ax8-rWWdDxnq.d.mts} +2 -2
  188. package/dist/{middleware-JfHt_Ax8-DKXbos9y.d.mts.map → middleware-JfHt_Ax8-rWWdDxnq.d.mts.map} +1 -1
  189. package/dist/{migration-qalbcIUs.d.mts → migration-B35kGD-7.d.mts} +4 -4
  190. package/dist/{migration-qalbcIUs.d.mts.map → migration-B35kGD-7.d.mts.map} +1 -1
  191. package/dist/{naming-BcD36g9T-Mfe_xGGL.d.mts → naming-CLfASFf7-HRjmKe43.d.mts} +9 -4
  192. package/dist/naming-CLfASFf7-HRjmKe43.d.mts.map +1 -0
  193. package/dist/{naming-bM5qm5PY-jOg3JFMb.mjs → naming-DEpT6Zad-C9PFkWt6.mjs} +5 -4
  194. package/dist/naming-DEpT6Zad-C9PFkWt6.mjs.map +1 -0
  195. package/dist/operations.d.mts +1 -1
  196. package/dist/orm-client.d.mts +22 -22
  197. package/dist/orm-client.mjs +7 -7
  198. package/dist/{pack-Cap3oVPy.d.mts → pack-DKM1hv1E.d.mts} +4 -4
  199. package/dist/{pack-Cap3oVPy.d.mts.map → pack-DKM1hv1E.d.mts.map} +1 -1
  200. package/dist/{plan-CMqVpPq6-Bllx5Zpk.d.mts → plan-CMqVpPq6-Aoza6Dp2.d.mts} +4 -4
  201. package/dist/{plan-CMqVpPq6-Bllx5Zpk.d.mts.map → plan-CMqVpPq6-Aoza6Dp2.d.mts.map} +1 -1
  202. package/dist/plan-DINEcqC1.d.mts +2 -0
  203. package/dist/psl-build-BA0Ndi1v.mjs +268 -0
  204. package/dist/psl-build-BA0Ndi1v.mjs.map +1 -0
  205. package/dist/{psl-build-RelubU2E.d.mts → psl-build-DCZaF5g4.d.mts} +47 -18
  206. package/dist/psl-build-DCZaF5g4.d.mts.map +1 -0
  207. package/dist/{psl-column-resolution-djGEITmJ-B5iMpe8H.d.mts → psl-column-resolution-djGEITmJ-C0LSpwl4.d.mts} +3 -3
  208. package/dist/{psl-column-resolution-djGEITmJ-B5iMpe8H.d.mts.map → psl-column-resolution-djGEITmJ-C0LSpwl4.d.mts.map} +1 -1
  209. package/dist/{psl-field-resolution-Bvhx79fP-CQqHf_L4.mjs → psl-field-resolution-BW2_FOb9-DxqR43fo.mjs} +68 -38
  210. package/dist/psl-field-resolution-BW2_FOb9-DxqR43fo.mjs.map +1 -0
  211. package/dist/{psl-infer--g4i84Go.mjs → psl-infer-C9kVS9ma.mjs} +2 -2
  212. package/dist/{psl-infer--g4i84Go.mjs.map → psl-infer-C9kVS9ma.mjs.map} +1 -1
  213. package/dist/{psl-infer-DzoxPZGd.d.mts → psl-infer-Cr9AeccU.d.mts} +4 -4
  214. package/dist/{psl-infer-DzoxPZGd.d.mts.map → psl-infer-Cr9AeccU.d.mts.map} +1 -1
  215. package/dist/query-lane-context-DL6bwl6k.d.mts +1 -0
  216. package/dist/{query-lane-context-DLSXDsDK-pEiQmuYy.d.mts → query-lane-context-DLSXDsDK-CGSahS15.d.mts} +8 -8
  217. package/dist/{query-lane-context-DLSXDsDK-pEiQmuYy.d.mts.map → query-lane-context-DLSXDsDK-CGSahS15.d.mts.map} +1 -1
  218. package/dist/relational-core.d.mts +12 -12
  219. package/dist/relational-core.mjs +2 -2
  220. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  221. package/dist/relational-core__ast.d.mts +3 -3
  222. package/dist/relational-core__ast.mjs +1 -1
  223. package/dist/relational-core__codec-descriptor-registry.d.mts +4 -4
  224. package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
  225. package/dist/relational-core__collection-methods.d.mts +2 -2
  226. package/dist/relational-core__contract-free.d.mts +4 -4
  227. package/dist/relational-core__expression.d.mts +3 -3
  228. package/dist/relational-core__expression.mjs +1 -1
  229. package/dist/relational-core__functions.d.mts +1 -1
  230. package/dist/relational-core__functions.mjs +1 -1
  231. package/dist/relational-core__index-reference.d.mts +2 -2
  232. package/dist/relational-core__middleware.d.mts +2 -2
  233. package/dist/relational-core__plan.d.mts +3 -3
  234. package/dist/relational-core__query-lane-context.d.mts +2 -2
  235. package/dist/relational-core__types.d.mts +2 -2
  236. package/dist/{resolve-storage-table-DCqtmnSU.d.mts → resolve-storage-table-D1rXCcCk.d.mts} +3 -3
  237. package/dist/{resolve-storage-table-DCqtmnSU.d.mts.map → resolve-storage-table-D1rXCcCk.d.mts.map} +1 -1
  238. package/dist/{runtime-JKWb27L5.d.mts → runtime-CSDcwOEG.d.mts} +5 -4
  239. package/dist/{runtime-JKWb27L5.d.mts.map → runtime-CSDcwOEG.d.mts.map} +1 -1
  240. package/dist/{runtime-CCzfa1mY.mjs → runtime-DkUiQi00.mjs} +12 -4
  241. package/dist/runtime-DkUiQi00.mjs.map +1 -0
  242. package/dist/runtime.d.mts +4 -4
  243. package/dist/runtime.mjs +1 -1
  244. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  245. package/dist/{schema-differ-DmP74bB8-tqHKiJ88.d.mts → schema-differ-DmP74bB8-BXkhxcPs.d.mts} +5 -5
  246. package/dist/{schema-differ-DmP74bB8-tqHKiJ88.d.mts.map → schema-differ-DmP74bB8-BXkhxcPs.d.mts.map} +1 -1
  247. package/dist/schema-ir.d.mts +1 -1
  248. package/dist/schema-ir.mjs +1 -1
  249. package/dist/schema-ir__naming.d.mts +2 -2
  250. package/dist/schema-ir__naming.mjs +2 -2
  251. package/dist/schema-ir__types.d.mts +2 -2
  252. package/dist/schema-ir__types.mjs +1 -1
  253. package/dist/{schema-verify-C3wbdviw-DMjIubOr.mjs → schema-verify-C3wbdviw-nQ4tG9N7.mjs} +4 -4
  254. package/dist/{schema-verify-C3wbdviw-DMjIubOr.mjs.map → schema-verify-C3wbdviw-nQ4tG9N7.mjs.map} +1 -1
  255. package/dist/{serialized-index-DjCCnXB1-DMA7BtO2.mjs → serialized-index-BefvjuZ0-Bbsja7If.mjs} +14 -27
  256. package/dist/serialized-index-BefvjuZ0-Bbsja7If.mjs.map +1 -0
  257. package/dist/{serialized-index-CrgG8ct1-DKVJ7TDX.d.mts → serialized-index-CrgG8ct1-Duy5-kFV.d.mts} +3 -3
  258. package/dist/{serialized-index-CrgG8ct1-DKVJ7TDX.d.mts.map → serialized-index-CrgG8ct1-Duy5-kFV.d.mts.map} +1 -1
  259. package/dist/{sql-contract-serializer-sMY3prTx-D2BfrNxs.mjs → sql-contract-serializer-sMY3prTx-CBHrlt9O.mjs} +4 -4
  260. package/dist/{sql-contract-serializer-sMY3prTx-D2BfrNxs.mjs.map → sql-contract-serializer-sMY3prTx-CBHrlt9O.mjs.map} +1 -1
  261. package/dist/{sql-data-type-D7M-YTTY-D2vRqDxn.mjs → sql-data-type-LVBldu1a-Bq203xWX.mjs} +13 -7
  262. package/dist/sql-data-type-LVBldu1a-Bq203xWX.mjs.map +1 -0
  263. package/dist/{sql-execution-plan-CN-FEwrR-CzRFoxKR.d.mts → sql-execution-plan-CN-FEwrR-BEJ0-g83.d.mts} +2 -2
  264. package/dist/{sql-execution-plan-CN-FEwrR-CzRFoxKR.d.mts.map → sql-execution-plan-CN-FEwrR-BEJ0-g83.d.mts.map} +1 -1
  265. package/dist/{sql-expression-B4BrhGPi.d.mts → sql-expression-1yO8GiBc.d.mts} +2 -2
  266. package/dist/{sql-expression-B4BrhGPi.d.mts.map → sql-expression-1yO8GiBc.d.mts.map} +1 -1
  267. package/dist/{sql-index-ByAAE7K8-Dqtn_vUL.d.mts → sql-index-ByAAE7K8-4TUFKGLK.d.mts} +2 -2
  268. package/dist/{sql-index-ByAAE7K8-Dqtn_vUL.d.mts.map → sql-index-ByAAE7K8-4TUFKGLK.d.mts.map} +1 -1
  269. package/dist/sql-node-D8P0akYY-RVytYXDZ.mjs +50 -0
  270. package/dist/sql-node-D8P0akYY-RVytYXDZ.mjs.map +1 -0
  271. package/dist/{sql-storage-DeCAh5Hi-CEM-m8cs.d.mts → sql-storage-B_AM6tU1-BOPQxXo7.d.mts} +6 -5
  272. package/dist/{sql-storage-DeCAh5Hi-CEM-m8cs.d.mts.map → sql-storage-B_AM6tU1-BOPQxXo7.d.mts.map} +1 -1
  273. package/dist/{storage-table-DDvN83mw-DkbBFmK9.mjs → storage-table-B_MrLtQX-eWx6BgGT.mjs} +7 -50
  274. package/dist/storage-table-B_MrLtQX-eWx6BgGT.mjs.map +1 -0
  275. package/dist/{storage-table-Bf1ZjnxO-pUj6pyP0.d.mts → storage-value-object-BcvIeUr8-DiiZNIrZ.d.mts} +23 -6
  276. package/dist/storage-value-object-BcvIeUr8-DiiZNIrZ.d.mts.map +1 -0
  277. package/dist/storage-value-set-uGUEBAMJ-hX-zFqN5.mjs +38 -0
  278. package/dist/storage-value-set-uGUEBAMJ-hX-zFqN5.mjs.map +1 -0
  279. package/dist/{transaction-state-DR3nKTmH-BIKF_fP6.d.mts → transaction-state-DR3nKTmH-C3wq6dCB.d.mts} +9 -9
  280. package/dist/{transaction-state-DR3nKTmH-BIKF_fP6.d.mts.map → transaction-state-DR3nKTmH-C3wq6dCB.d.mts.map} +1 -1
  281. package/dist/{types-DoyiTsjg-2YMhMJDA.mjs → types-1ZKE0deC-Dou4ugcz.mjs} +3 -3
  282. package/dist/{types-DoyiTsjg-2YMhMJDA.mjs.map → types-1ZKE0deC-Dou4ugcz.mjs.map} +1 -1
  283. package/dist/types-B-dwfOwQ.d.mts +1 -0
  284. package/dist/{types-CTdSkl0s.mjs → types-CISwoRED.mjs} +2 -2
  285. package/dist/types-CISwoRED.mjs.map +1 -0
  286. package/dist/{types-COXfSNOP-DcuULeD9.d.mts → types-COXfSNOP-D9vt9QDL.d.mts} +9 -9
  287. package/dist/{types-COXfSNOP-DcuULeD9.d.mts.map → types-COXfSNOP-D9vt9QDL.d.mts.map} +1 -1
  288. package/dist/{types-CkAd8SWm.d.mts → types-CXRxo_TK.d.mts} +7 -7
  289. package/dist/{types-CkAd8SWm.d.mts.map → types-CXRxo_TK.d.mts.map} +1 -1
  290. package/dist/types-DIoM5Ft3.d.mts +1 -0
  291. package/dist/{types-DfKvtJwS-CrpWTGBJ.d.mts → types-DNTLudNR-DiVulPhL.d.mts} +7 -7
  292. package/dist/{types-DfKvtJwS-CrpWTGBJ.d.mts.map → types-DNTLudNR-DiVulPhL.d.mts.map} +1 -1
  293. package/dist/{types-NgqqVAo5-Be_uYGQx.d.mts → types-NgqqVAo5-CJG02ILZ.d.mts} +10 -10
  294. package/dist/{types-NgqqVAo5-Be_uYGQx.d.mts.map → types-NgqqVAo5-CJG02ILZ.d.mts.map} +1 -1
  295. package/dist/{types-CuCxAQat-Dz8P4xyt.d.mts → types-fmtEmvj3-B0fQaVes.d.mts} +4 -4
  296. package/dist/{types-CuCxAQat-Dz8P4xyt.d.mts.map → types-fmtEmvj3-B0fQaVes.d.mts.map} +1 -1
  297. package/dist/{types-ijhejJhK-EdACW3bY.d.mts → types-ijhejJhK-BqfwP5Cc.d.mts} +2 -2
  298. package/dist/{types-ijhejJhK-EdACW3bY.d.mts.map → types-ijhejJhK-BqfwP5Cc.d.mts.map} +1 -1
  299. package/dist/{validators-FJs8HvFr.d.mts → validators-Dt-19ywK.d.mts} +4 -4
  300. package/dist/{validators-FJs8HvFr.d.mts.map → validators-Dt-19ywK.d.mts.map} +1 -1
  301. package/dist/{validators-BwA7ttZM.mjs → validators-qcQteqs2.mjs} +30 -31
  302. package/dist/validators-qcQteqs2.mjs.map +1 -0
  303. package/package.json +20 -18
  304. package/dist/ast-DcphKbq9.d.mts.map +0 -1
  305. package/dist/ast-e_02t9Nt.mjs.map +0 -1
  306. package/dist/collection-methods-FWiYjZ5j.d.mts +0 -1
  307. package/dist/contract-builder-B-Q9T1CO.d.mts.map +0 -1
  308. package/dist/contract-builder-DMNe_jX9.mjs.map +0 -1
  309. package/dist/contract-view-DqpzeYeE.mjs.map +0 -1
  310. package/dist/control-D6wIw5Fi.mjs.map +0 -1
  311. package/dist/data-type-DJIvKQHf.d.mts.map +0 -1
  312. package/dist/default-mapping-CAOONlKQ-4m07nb-O.d.mts.map +0 -1
  313. package/dist/derived-checks-D5HVRvqN-BJx1gwPA.mjs.map +0 -1
  314. package/dist/diagnostics-C7jR1Jyf.mjs.map +0 -1
  315. package/dist/dist-C8Y-PPuE.mjs.map +0 -1
  316. package/dist/entity-kinds-JR5SAm5h-DOH6VUtL.mjs.map +0 -1
  317. package/dist/expression-CQHy0GY7.d.mts +0 -2
  318. package/dist/index-reference-BVkoanQn.d.mts +0 -1
  319. package/dist/interpreter-CS21wD1i-G0u1x8t_.mjs.map +0 -1
  320. package/dist/middleware-DYiOUIpn.d.mts +0 -1
  321. package/dist/naming-BcD36g9T-Mfe_xGGL.d.mts.map +0 -1
  322. package/dist/naming-bM5qm5PY-jOg3JFMb.mjs.map +0 -1
  323. package/dist/plan-Cg0h96GD.d.mts +0 -2
  324. package/dist/psl-build-DqqYhOsa.mjs +0 -426
  325. package/dist/psl-build-DqqYhOsa.mjs.map +0 -1
  326. package/dist/psl-build-RelubU2E.d.mts.map +0 -1
  327. package/dist/psl-field-resolution-Bvhx79fP-CQqHf_L4.mjs.map +0 -1
  328. package/dist/query-lane-context-Dqs5qCXx.d.mts +0 -1
  329. package/dist/runtime-CCzfa1mY.mjs.map +0 -1
  330. package/dist/serialized-index-DjCCnXB1-DMA7BtO2.mjs.map +0 -1
  331. package/dist/sql-data-type-D7M-YTTY-D2vRqDxn.mjs.map +0 -1
  332. package/dist/storage-table-Bf1ZjnxO-pUj6pyP0.d.mts.map +0 -1
  333. package/dist/storage-table-DDvN83mw-DkbBFmK9.mjs.map +0 -1
  334. package/dist/types-CTdSkl0s.mjs.map +0 -1
  335. package/dist/types-CvmPNREJ.d.mts +0 -1
  336. package/dist/types-ljUNyiWe.d.mts +0 -1
  337. package/dist/validators-BwA7ttZM.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"schema-verify-C3wbdviw-DMjIubOr.mjs","names":[],"sources":["../../../../2-sql-family/9-family/dist/schema-verify-C3wbdviw.mjs"],"sourcesContent":["import { findSqlDataTypeCollision, isSqlDataType } from \"@internal/sql-contract/data-type\";\nimport { assertNothingCastsFromSqlExpression } from \"@internal/sql-contract/sql-expression\";\nimport { VERIFY_CODE_SCHEMA_FAILURE, assertUniqueCodecOwner, dispositionForCategory, issueOutcome } from \"@internal/framework-components/control\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { runtimeError } from \"@internal/framework-components/components\";\nimport { isStorageTypeInstance } from \"@internal/sql-contract/types\";\nimport { effectiveControlPolicy } from \"@internal/contract/types\";\n//#region src/core/assembly.ts\nfunction hasCodecControlHooks(descriptor) {\n\tif (typeof descriptor !== \"object\" || descriptor === null) return false;\n\tconst hooks = blindCast(descriptor).types?.codecTypes?.controlPlaneHooks;\n\treturn hooks !== null && hooks !== void 0 && typeof hooks === \"object\";\n}\nfunction extractCodecControlHooks(descriptors) {\n\tconst hooks = /* @__PURE__ */ new Map();\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tif (typeof descriptor !== \"object\" || descriptor === null) continue;\n\t\tif (!hasCodecControlHooks(descriptor)) continue;\n\t\tconst controlPlaneHooks = descriptor.types.codecTypes.controlPlaneHooks;\n\t\tfor (const [codecId, hook] of Object.entries(controlPlaneHooks)) {\n\t\t\tassertUniqueCodecOwner({\n\t\t\t\tcodecId,\n\t\t\t\towners,\n\t\t\t\tdescriptorId: descriptor.id,\n\t\t\t\tentityLabel: \"control hooks\",\n\t\t\t\tentityOwnershipLabel: \"owner\"\n\t\t\t});\n\t\t\thooks.set(codecId, hook);\n\t\t\towners.set(codecId, descriptor.id);\n\t\t}\n\t}\n\treturn hooks;\n}\n/**\n* The SQL family's checks of the stack's data types and codecs, each naming the contributor:\n* no two SQL data types would both recognise one reported type, by colliding claiming texts or by\n* claiming the same kind; no data type casts from `sql/expression`; every type stored as another\n* names a registered SQL data type; and every codec represents a\n* SQL data type, because a codec represents a column's type and `sql/expression` is the one data\n* type no column has.\n*/\nfunction enforceSqlDataTypeInvariants(declaredDataTypes, codecDescriptors) {\n\tconst declaredById = new Map(declaredDataTypes.map((declared) => [declared.type.id, declared]));\n\tconst capitalized = (text) => `${text.charAt(0).toUpperCase()}${text.slice(1)}`;\n\tconst describe = (type) => `data type \"${type.id}\" contributed by \"${declaredById.get(type.id)?.contributedBy ?? \"<unknown>\"}\"`;\n\tconst collision = findSqlDataTypeCollision(declaredDataTypes.map(({ type }) => type));\n\tif (collision !== void 0) {\n\t\tconst { first, second, claims } = collision;\n\t\tif (claims.by === \"kind\") throw new InternalError(`The ${describe(first)} and the ${describe(second)} both claim the kind \"${claims.kind}\".`);\n\t\tthrow new InternalError(`The ${describe(first)} claims the text \"${claims.first}\", which collides with the text \"${claims.second}\" claimed by the ${describe(second)}.`);\n\t}\n\tassertNothingCastsFromSqlExpression(declaredDataTypes);\n\tfor (const { type, contributedBy } of declaredDataTypes) {\n\t\tif (!isSqlDataType(type) || type.sql.storedAs === void 0) continue;\n\t\tconst storage = declaredById.get(type.sql.storedAs)?.type;\n\t\tif (storage !== void 0 && isSqlDataType(storage)) {\n\t\t\tconst further = storage.sql.storedAs;\n\t\t\tif (further === void 0) continue;\n\t\t\tthrow new InternalError(`${capitalized(describe(type))} is stored as \"${storage.id}\", which is itself stored as \"${further}\". Name \"${further}\" as the type it is stored as.`);\n\t\t}\n\t\tthrow runtimeError(\"CONTRACT.DATA_TYPE_UNREGISTERED\", `Data type \"${type.id}\" is stored as data type \"${type.sql.storedAs}\", which no component registers. Contributed by \"${contributedBy}\".`, {\n\t\t\tdataType: type.sql.storedAs,\n\t\t\tcontributedBy\n\t\t});\n\t}\n\tfor (const codec of codecDescriptors) {\n\t\tconst represented = declaredById.get(codec.dataType)?.type;\n\t\tif (represented === void 0 || isSqlDataType(represented)) continue;\n\t\tthrow new InternalError(`Codec \"${codec.codecId}\" represents ${describe(represented)}, which is not a SQL data type. In a SQL stack a codec represents a column's type, so its data type is declared with sqlDataType.`);\n\t}\n}\n//#endregion\n//#region src/core/diff/verifier-disposition.ts\n/**\n* Classifies a codec `verifyType` hook finding into the target-neutral\n* categories the framework grades. A storage type is a named type instance\n* (e.g. a native enum); the only shape divergence it can carry is a change\n* to its value set, so a paired mismatch always classifies as `valueDrift`.\n*/\nfunction classifyStorageTypeDiffIssue(issue) {\n\tif (issueOutcome(issue) === \"not-found\") return \"declaredMissing\";\n\tif (issueOutcome(issue) === \"not-expected\") return \"extraAuxiliary\";\n\treturn \"valueDrift\";\n}\nfunction verifierDisposition(controlPolicy, issue) {\n\treturn dispositionForCategory(controlPolicy, classifyStorageTypeDiffIssue(issue));\n}\n//#endregion\n//#region src/core/diff/schema-verify.ts\nfunction issueNode(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\treturn blindCast(node);\n}\n/**\n* Resolves an issue's framework-neutral {@link DiffSubjectGranularity} on\n* demand, from the issue's node's `nodeKind` via the target-provided\n* `granularityOf` map. The node carries only its `nodeKind` identity, never a\n* classification, and nothing is stamped onto the issue — every consumer\n* (the family verdict below, the framework aggregate's unclaimed-elements\n* sweep via {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable})\n* calls this the same way, resolved by the family/target that owns the node\n* vocabulary. `undefined` for an issue with no node.\n*/\nfunction classifyDiffSubjectGranularity(issue, granularityOf) {\n\tconst node = issueNode(issue);\n\treturn node === void 0 ? void 0 : granularityOf(node.nodeKind);\n}\n/**\n* Resolves an issue's storage `entityKind` on demand, from the issue's\n* node's `nodeKind` via the target-provided `entityKindOf` map — the sibling\n* of {@link classifyDiffSubjectGranularity}, called the same way by the same\n* consumers (via\n* {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable}).\n* `undefined` for an issue with no node, or for a node kind with no storage\n* entity of its own.\n*/\nfunction classifyDiffEntityKind(issue, entityKindOf) {\n\tconst node = issueNode(issue);\n\treturn node === void 0 ? void 0 : entityKindOf(node.nodeKind);\n}\n/**\n* Re-keys the legacy `classifySqlVerifierIssueKind` category mapping on the\n* issue's {@link DiffSubjectGranularity} (resolved via `granularityOf`) + the\n* issue reason. The vocabulary maps one-to-one: an undeclared live entity or\n* namespace is `extraTopLevelObject`, an undeclared live field\n* `extraNestedElement`, undeclared auxiliaries (constraints, indexes,\n* defaults) and structural leaves (policies) `extraAuxiliary`; every paired\n* divergence is `declaredIncompatible`; anything the database lacks is\n* `declaredMissing`.\n* `granularityOf` is the target's classifier, so target and extension node\n* kinds classify without the family importing them.\n*/\nfunction classifySqlDiffIssue(issue, granularityOf) {\n\tif (issueOutcome(issue) === \"not-found\") return \"declaredMissing\";\n\tif (issueOutcome(issue) === \"not-expected\") {\n\t\tconst granularity = classifyDiffSubjectGranularity(issue, granularityOf);\n\t\tif (granularity === \"entity\" || granularity === \"namespace\") return \"extraTopLevelObject\";\n\t\tif (granularity === \"field\") return \"extraNestedElement\";\n\t\treturn \"extraAuxiliary\";\n\t}\n\treturn \"declaredIncompatible\";\n}\n/**\n* Whether a `not-expected` issue is a strict-mode-only finding. The legacy\n* walk detected every relational extra (namespaces, entities, fields, and\n* their auxiliaries) only under `--strict`; the structural diff (roots, RLS\n* policies, roles) was never strict-gated — its extras fail in both modes.\n* Keyed on the issue's granularity, resolved via `granularityOf`.\n*/\nfunction isStrictOnlyExtra(issue, granularityOf) {\n\tconst granularity = classifyDiffSubjectGranularity(issue, granularityOf);\n\treturn granularity === \"namespace\" || granularity === \"entity\" || granularity === \"field\" || granularity === \"auxiliary\";\n}\n/**\n* Applies the two consumer filters to a diff issue list: strict gating\n* (relational `not-expected` findings drop in lenient mode) and\n* control-policy disposition (each surviving issue grades against its\n* subject table's effective policy; suppressed issues drop, `observed`\n* subjects warn). The verify verdict is `failures.length === 0`.\n*/\nfunction computeSqlDiffVerdict(input) {\n\tconst failures = [];\n\tconst warnings = [];\n\tfor (const issue of input.issues) {\n\t\tif (!input.strict && issueOutcome(issue) === \"not-expected\" && isStrictOnlyExtra(issue, input.granularityOf)) continue;\n\t\tconst disposition = dispositionForCategory(effectiveControlPolicy(input.resolveControlPolicy(issue), input.defaultControlPolicy), classifySqlDiffIssue(issue, input.granularityOf));\n\t\tif (disposition === \"suppress\") continue;\n\t\tif (disposition === \"warn\") {\n\t\t\twarnings.push(issue);\n\t\t\tcontinue;\n\t\t}\n\t\tfailures.push(issue);\n\t}\n\treturn {\n\t\tfailures,\n\t\twarnings\n\t};\n}\nfunction computeStorageTypeVerdict(input) {\n\tconst failures = [];\n\tconst warnings = [];\n\tconst policy = effectiveControlPolicy(void 0, input.contract.defaultControlPolicy);\n\tfor (const pair of input.namespacePairs) {\n\t\tif (pair.actual === void 0) continue;\n\t\tfor (const [typeName, typeInstance] of Object.entries(input.contract.storage.types ?? {})) {\n\t\t\tif (!isStorageTypeInstance(typeInstance)) continue;\n\t\t\tconst hook = input.codecHooks.get(typeInstance.codecId);\n\t\t\tif (!hook?.verifyType) continue;\n\t\t\tconst typeIssues = hook.verifyType({\n\t\t\t\ttypeName,\n\t\t\t\ttypeInstance,\n\t\t\t\tschema: pair.actual\n\t\t\t});\n\t\t\tfor (const issue of typeIssues) {\n\t\t\t\tconst disposition = verifierDisposition(policy, issue);\n\t\t\t\tif (disposition === \"suppress\") continue;\n\t\t\t\tif (disposition === \"warn\") {\n\t\t\t\t\twarnings.push(issue);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tfailures.push(issue);\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tfailures,\n\t\twarnings\n\t};\n}\n/**\n* THE SQL schema verify: runs the target's full-tree node diff, grades it\n* through the family's post-diff filters (strict gating + control-policy\n* disposition) plus the codec `verifyType` hook findings, and wraps the\n* verdict in the issue-based result envelope. `ok` holds exactly when both\n* issue lists are empty — the lists carry the verdict's failures.\n*/\nfunction verifySqlSchemaByDiff(input) {\n\tconst startTime = Date.now();\n\tconst verdictDiff = input.diffSchema({\n\t\tcontract: input.contract,\n\t\tschema: input.schema,\n\t\tframeworkComponents: input.frameworkComponents\n\t});\n\tconst diffVerdict = computeSqlDiffVerdict({\n\t\tissues: verdictDiff.issues,\n\t\tresolveControlPolicy: verdictDiff.resolveControlPolicy,\n\t\tstrict: input.strict,\n\t\tdefaultControlPolicy: input.contract.defaultControlPolicy,\n\t\tgranularityOf: input.granularityOf\n\t});\n\tconst storageTypeVerdict = computeStorageTypeVerdict({\n\t\tcontract: input.contract,\n\t\tnamespacePairs: verdictDiff.namespacePairs,\n\t\tcodecHooks: extractCodecControlHooks(input.frameworkComponents)\n\t});\n\tconst failCount = diffVerdict.failures.length + storageTypeVerdict.failures.length;\n\tconst ok = failCount === 0;\n\tconst profileHash = \"profileHash\" in input.contract && typeof input.contract.profileHash === \"string\" ? input.contract.profileHash : void 0;\n\treturn {\n\t\tok,\n\t\t...ok ? {} : { code: VERIFY_CODE_SCHEMA_FAILURE },\n\t\tsummary: ok ? \"Database schema satisfies contract\" : `Database schema does not satisfy contract (${failCount} failure${failCount === 1 ? \"\" : \"s\"})`,\n\t\tcontract: {\n\t\t\tstorageHash: input.contract.storage.storageHash,\n\t\t\t...ifDefined(\"profileHash\", profileHash)\n\t\t},\n\t\ttarget: {\n\t\t\texpected: input.contract.target,\n\t\t\tactual: input.contract.target\n\t\t},\n\t\tschema: {\n\t\t\tissues: [...diffVerdict.failures, ...storageTypeVerdict.failures],\n\t\t\twarnings: { issues: [...diffVerdict.warnings, ...storageTypeVerdict.warnings] }\n\t\t},\n\t\tmeta: { strict: input.strict },\n\t\ttimings: { total: Date.now() - startTime }\n\t};\n}\n//#endregion\nexport { computeStorageTypeVerdict as a, extractCodecControlHooks as c, computeSqlDiffVerdict as i, classifyDiffSubjectGranularity as n, verifySqlSchemaByDiff as o, classifySqlDiffIssue as r, enforceSqlDataTypeInvariants as s, classifyDiffEntityKind as t };\n\n//# sourceMappingURL=schema-verify-C3wbdviw.mjs.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AS,mBAAmB,SAAS;CAC5E,MAAM,KAAK,cAAc;CACzB,MAAM,cAAc,iBAAiB,MAAM,YAAY,OAAO,MAAM,SAAS,gBAAgB,WAAW,MAAM,SAAS,cAAc,KAAK;CAC1I,OAAO;EACN;EACA,GAAG,KAAK,CAAC,IAAI,EAAE,MAAM,2BAA2B;EAChD,SAAS,KAAK,uCAAuC,8CAA8C,UAAU,UAAU,cAAc,IAAI,KAAK,IAAI;EAClJ,UAAU;GACT,aAAa,MAAM,SAAS,QAAQ;GACpC,GAAG,UAAU,eAAe,WAAW;EACxC;EACA,QAAQ;GACP,UAAU,MAAM,SAAS;GACzB,QAAQ,MAAM,SAAS;EACxB;EACA,QAAQ;GACP,QAAQ,CAAC,GAAG,YAAY,UAAU,GAAG,mBAAmB,QAAQ;GAChE,UAAU,EAAE,QAAQ,CAAC,GAAG,YAAY,UAAU,GAAG,mBAAmB,QAAQ,EAAE;EAC/E;EACA,MAAM,EAAE,QAAQ,MAAM,OAAO;EAC7B,SAAS,EAAE,OAAO,KAAK,IAAI,IAAI,UAAU;CAC1C;AACD"}
1
+ {"version":3,"file":"schema-verify-C3wbdviw-nQ4tG9N7.mjs","names":[],"sources":["../../../../2-sql-family/9-family/dist/schema-verify-C3wbdviw.mjs"],"sourcesContent":["import { findSqlDataTypeCollision, isSqlDataType } from \"@internal/sql-contract/data-type\";\nimport { assertNothingCastsFromSqlExpression } from \"@internal/sql-contract/sql-expression\";\nimport { VERIFY_CODE_SCHEMA_FAILURE, assertUniqueCodecOwner, dispositionForCategory, issueOutcome } from \"@internal/framework-components/control\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { runtimeError } from \"@internal/framework-components/components\";\nimport { isStorageTypeInstance } from \"@internal/sql-contract/types\";\nimport { effectiveControlPolicy } from \"@internal/contract/types\";\n//#region src/core/assembly.ts\nfunction hasCodecControlHooks(descriptor) {\n\tif (typeof descriptor !== \"object\" || descriptor === null) return false;\n\tconst hooks = blindCast(descriptor).types?.codecTypes?.controlPlaneHooks;\n\treturn hooks !== null && hooks !== void 0 && typeof hooks === \"object\";\n}\nfunction extractCodecControlHooks(descriptors) {\n\tconst hooks = /* @__PURE__ */ new Map();\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tif (typeof descriptor !== \"object\" || descriptor === null) continue;\n\t\tif (!hasCodecControlHooks(descriptor)) continue;\n\t\tconst controlPlaneHooks = descriptor.types.codecTypes.controlPlaneHooks;\n\t\tfor (const [codecId, hook] of Object.entries(controlPlaneHooks)) {\n\t\t\tassertUniqueCodecOwner({\n\t\t\t\tcodecId,\n\t\t\t\towners,\n\t\t\t\tdescriptorId: descriptor.id,\n\t\t\t\tentityLabel: \"control hooks\",\n\t\t\t\tentityOwnershipLabel: \"owner\"\n\t\t\t});\n\t\t\thooks.set(codecId, hook);\n\t\t\towners.set(codecId, descriptor.id);\n\t\t}\n\t}\n\treturn hooks;\n}\n/**\n* The SQL family's checks of the stack's data types and codecs, each naming the contributor:\n* no two SQL data types would both recognise one reported type, by colliding claiming texts or by\n* claiming the same kind; no data type casts from `sql/expression`; every type stored as another\n* names a registered SQL data type; and every codec represents a\n* SQL data type, because a codec represents a column's type and `sql/expression` is the one data\n* type no column has.\n*/\nfunction enforceSqlDataTypeInvariants(declaredDataTypes, codecDescriptors) {\n\tconst declaredById = new Map(declaredDataTypes.map((declared) => [declared.type.id, declared]));\n\tconst capitalized = (text) => `${text.charAt(0).toUpperCase()}${text.slice(1)}`;\n\tconst describe = (type) => `data type \"${type.id}\" contributed by \"${declaredById.get(type.id)?.contributedBy ?? \"<unknown>\"}\"`;\n\tconst collision = findSqlDataTypeCollision(declaredDataTypes.map(({ type }) => type));\n\tif (collision !== void 0) {\n\t\tconst { first, second, claims } = collision;\n\t\tif (claims.by === \"kind\") throw new InternalError(`The ${describe(first)} and the ${describe(second)} both claim the kind \"${claims.kind}\".`);\n\t\tthrow new InternalError(`The ${describe(first)} claims the text \"${claims.first}\", which collides with the text \"${claims.second}\" claimed by the ${describe(second)}.`);\n\t}\n\tassertNothingCastsFromSqlExpression(declaredDataTypes);\n\tfor (const { type, contributedBy } of declaredDataTypes) {\n\t\tif (!isSqlDataType(type) || type.sql.storedAs === void 0) continue;\n\t\tconst storage = declaredById.get(type.sql.storedAs)?.type;\n\t\tif (storage !== void 0 && isSqlDataType(storage)) {\n\t\t\tconst further = storage.sql.storedAs;\n\t\t\tif (further === void 0) continue;\n\t\t\tthrow new InternalError(`${capitalized(describe(type))} is stored as \"${storage.id}\", which is itself stored as \"${further}\". Name \"${further}\" as the type it is stored as.`);\n\t\t}\n\t\tthrow runtimeError(\"CONTRACT.DATA_TYPE_UNREGISTERED\", `Data type \"${type.id}\" is stored as data type \"${type.sql.storedAs}\", which no component registers. Contributed by \"${contributedBy}\".`, {\n\t\t\tdataType: type.sql.storedAs,\n\t\t\tcontributedBy\n\t\t});\n\t}\n\tfor (const codec of codecDescriptors) {\n\t\tconst represented = declaredById.get(codec.dataType)?.type;\n\t\tif (represented === void 0 || isSqlDataType(represented)) continue;\n\t\tthrow new InternalError(`Codec \"${codec.codecId}\" represents ${describe(represented)}, which is not a SQL data type. In a SQL stack a codec represents a column's type, so its data type is declared with sqlDataType.`);\n\t}\n}\n//#endregion\n//#region src/core/diff/verifier-disposition.ts\n/**\n* Classifies a codec `verifyType` hook finding into the target-neutral\n* categories the framework grades. A storage type is a named type instance\n* (e.g. a native enum); the only shape divergence it can carry is a change\n* to its value set, so a paired mismatch always classifies as `valueDrift`.\n*/\nfunction classifyStorageTypeDiffIssue(issue) {\n\tif (issueOutcome(issue) === \"not-found\") return \"declaredMissing\";\n\tif (issueOutcome(issue) === \"not-expected\") return \"extraAuxiliary\";\n\treturn \"valueDrift\";\n}\nfunction verifierDisposition(controlPolicy, issue) {\n\treturn dispositionForCategory(controlPolicy, classifyStorageTypeDiffIssue(issue));\n}\n//#endregion\n//#region src/core/diff/schema-verify.ts\nfunction issueNode(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\treturn blindCast(node);\n}\n/**\n* Resolves an issue's framework-neutral {@link DiffSubjectGranularity} on\n* demand, from the issue's node's `nodeKind` via the target-provided\n* `granularityOf` map. The node carries only its `nodeKind` identity, never a\n* classification, and nothing is stamped onto the issue — every consumer\n* (the family verdict below, the framework aggregate's unclaimed-elements\n* sweep via {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable})\n* calls this the same way, resolved by the family/target that owns the node\n* vocabulary. `undefined` for an issue with no node.\n*/\nfunction classifyDiffSubjectGranularity(issue, granularityOf) {\n\tconst node = issueNode(issue);\n\treturn node === void 0 ? void 0 : granularityOf(node.nodeKind);\n}\n/**\n* Resolves an issue's storage `entityKind` on demand, from the issue's\n* node's `nodeKind` via the target-provided `entityKindOf` map — the sibling\n* of {@link classifyDiffSubjectGranularity}, called the same way by the same\n* consumers (via\n* {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable}).\n* `undefined` for an issue with no node, or for a node kind with no storage\n* entity of its own.\n*/\nfunction classifyDiffEntityKind(issue, entityKindOf) {\n\tconst node = issueNode(issue);\n\treturn node === void 0 ? void 0 : entityKindOf(node.nodeKind);\n}\n/**\n* Re-keys the legacy `classifySqlVerifierIssueKind` category mapping on the\n* issue's {@link DiffSubjectGranularity} (resolved via `granularityOf`) + the\n* issue reason. The vocabulary maps one-to-one: an undeclared live entity or\n* namespace is `extraTopLevelObject`, an undeclared live field\n* `extraNestedElement`, undeclared auxiliaries (constraints, indexes,\n* defaults) and structural leaves (policies) `extraAuxiliary`; every paired\n* divergence is `declaredIncompatible`; anything the database lacks is\n* `declaredMissing`.\n* `granularityOf` is the target's classifier, so target and extension node\n* kinds classify without the family importing them.\n*/\nfunction classifySqlDiffIssue(issue, granularityOf) {\n\tif (issueOutcome(issue) === \"not-found\") return \"declaredMissing\";\n\tif (issueOutcome(issue) === \"not-expected\") {\n\t\tconst granularity = classifyDiffSubjectGranularity(issue, granularityOf);\n\t\tif (granularity === \"entity\" || granularity === \"namespace\") return \"extraTopLevelObject\";\n\t\tif (granularity === \"field\") return \"extraNestedElement\";\n\t\treturn \"extraAuxiliary\";\n\t}\n\treturn \"declaredIncompatible\";\n}\n/**\n* Whether a `not-expected` issue is a strict-mode-only finding. The legacy\n* walk detected every relational extra (namespaces, entities, fields, and\n* their auxiliaries) only under `--strict`; the structural diff (roots, RLS\n* policies, roles) was never strict-gated — its extras fail in both modes.\n* Keyed on the issue's granularity, resolved via `granularityOf`.\n*/\nfunction isStrictOnlyExtra(issue, granularityOf) {\n\tconst granularity = classifyDiffSubjectGranularity(issue, granularityOf);\n\treturn granularity === \"namespace\" || granularity === \"entity\" || granularity === \"field\" || granularity === \"auxiliary\";\n}\n/**\n* Applies the two consumer filters to a diff issue list: strict gating\n* (relational `not-expected` findings drop in lenient mode) and\n* control-policy disposition (each surviving issue grades against its\n* subject table's effective policy; suppressed issues drop, `observed`\n* subjects warn). The verify verdict is `failures.length === 0`.\n*/\nfunction computeSqlDiffVerdict(input) {\n\tconst failures = [];\n\tconst warnings = [];\n\tfor (const issue of input.issues) {\n\t\tif (!input.strict && issueOutcome(issue) === \"not-expected\" && isStrictOnlyExtra(issue, input.granularityOf)) continue;\n\t\tconst disposition = dispositionForCategory(effectiveControlPolicy(input.resolveControlPolicy(issue), input.defaultControlPolicy), classifySqlDiffIssue(issue, input.granularityOf));\n\t\tif (disposition === \"suppress\") continue;\n\t\tif (disposition === \"warn\") {\n\t\t\twarnings.push(issue);\n\t\t\tcontinue;\n\t\t}\n\t\tfailures.push(issue);\n\t}\n\treturn {\n\t\tfailures,\n\t\twarnings\n\t};\n}\nfunction computeStorageTypeVerdict(input) {\n\tconst failures = [];\n\tconst warnings = [];\n\tconst policy = effectiveControlPolicy(void 0, input.contract.defaultControlPolicy);\n\tfor (const pair of input.namespacePairs) {\n\t\tif (pair.actual === void 0) continue;\n\t\tfor (const [typeName, typeInstance] of Object.entries(input.contract.storage.types ?? {})) {\n\t\t\tif (!isStorageTypeInstance(typeInstance)) continue;\n\t\t\tconst hook = input.codecHooks.get(typeInstance.codecId);\n\t\t\tif (!hook?.verifyType) continue;\n\t\t\tconst typeIssues = hook.verifyType({\n\t\t\t\ttypeName,\n\t\t\t\ttypeInstance,\n\t\t\t\tschema: pair.actual\n\t\t\t});\n\t\t\tfor (const issue of typeIssues) {\n\t\t\t\tconst disposition = verifierDisposition(policy, issue);\n\t\t\t\tif (disposition === \"suppress\") continue;\n\t\t\t\tif (disposition === \"warn\") {\n\t\t\t\t\twarnings.push(issue);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tfailures.push(issue);\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tfailures,\n\t\twarnings\n\t};\n}\n/**\n* THE SQL schema verify: runs the target's full-tree node diff, grades it\n* through the family's post-diff filters (strict gating + control-policy\n* disposition) plus the codec `verifyType` hook findings, and wraps the\n* verdict in the issue-based result envelope. `ok` holds exactly when both\n* issue lists are empty — the lists carry the verdict's failures.\n*/\nfunction verifySqlSchemaByDiff(input) {\n\tconst startTime = Date.now();\n\tconst verdictDiff = input.diffSchema({\n\t\tcontract: input.contract,\n\t\tschema: input.schema,\n\t\tframeworkComponents: input.frameworkComponents\n\t});\n\tconst diffVerdict = computeSqlDiffVerdict({\n\t\tissues: verdictDiff.issues,\n\t\tresolveControlPolicy: verdictDiff.resolveControlPolicy,\n\t\tstrict: input.strict,\n\t\tdefaultControlPolicy: input.contract.defaultControlPolicy,\n\t\tgranularityOf: input.granularityOf\n\t});\n\tconst storageTypeVerdict = computeStorageTypeVerdict({\n\t\tcontract: input.contract,\n\t\tnamespacePairs: verdictDiff.namespacePairs,\n\t\tcodecHooks: extractCodecControlHooks(input.frameworkComponents)\n\t});\n\tconst failCount = diffVerdict.failures.length + storageTypeVerdict.failures.length;\n\tconst ok = failCount === 0;\n\tconst profileHash = \"profileHash\" in input.contract && typeof input.contract.profileHash === \"string\" ? input.contract.profileHash : void 0;\n\treturn {\n\t\tok,\n\t\t...ok ? {} : { code: VERIFY_CODE_SCHEMA_FAILURE },\n\t\tsummary: ok ? \"Database schema satisfies contract\" : `Database schema does not satisfy contract (${failCount} failure${failCount === 1 ? \"\" : \"s\"})`,\n\t\tcontract: {\n\t\t\tstorageHash: input.contract.storage.storageHash,\n\t\t\t...ifDefined(\"profileHash\", profileHash)\n\t\t},\n\t\ttarget: {\n\t\t\texpected: input.contract.target,\n\t\t\tactual: input.contract.target\n\t\t},\n\t\tschema: {\n\t\t\tissues: [...diffVerdict.failures, ...storageTypeVerdict.failures],\n\t\t\twarnings: { issues: [...diffVerdict.warnings, ...storageTypeVerdict.warnings] }\n\t\t},\n\t\tmeta: { strict: input.strict },\n\t\ttimings: { total: Date.now() - startTime }\n\t};\n}\n//#endregion\nexport { computeStorageTypeVerdict as a, extractCodecControlHooks as c, computeSqlDiffVerdict as i, classifyDiffSubjectGranularity as n, verifySqlSchemaByDiff as o, classifySqlDiffIssue as r, enforceSqlDataTypeInvariants as s, classifyDiffEntityKind as t };\n\n//# sourceMappingURL=schema-verify-C3wbdviw.mjs.map"],"mappings":";;;;;;;;;;AAUA,SAAS,qBAAqB,YAAY;CACzC,IAAI,OAAO,eAAe,YAAY,eAAe,MAAM,OAAO;CAClE,MAAM,QAAQ,UAAU,UAAU,CAAC,CAAC,OAAO,YAAY;CACvD,OAAO,UAAU,QAAQ,UAAU,KAAK,KAAK,OAAO,UAAU;AAC/D;AACA,SAAS,yBAAyB,aAAa;CAC9C,MAAM,wBAAwB,IAAI,IAAI;CACtC,MAAM,yBAAyB,IAAI,IAAI;CACvC,KAAK,MAAM,cAAc,aAAa;EACrC,IAAI,OAAO,eAAe,YAAY,eAAe,MAAM;EAC3D,IAAI,CAAC,qBAAqB,UAAU,GAAG;EACvC,MAAM,oBAAoB,WAAW,MAAM,WAAW;EACtD,KAAK,MAAM,CAAC,SAAS,SAAS,OAAO,QAAQ,iBAAiB,GAAG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AAC,GAAG,YAAY,UAAU,GAAG,mBAAmB,QAAQ,EAAE;EAC/E;EACA,MAAM,EAAE,QAAQ,MAAM,OAAO;EAC7B,SAAS,EAAE,OAAO,KAAK,IAAI,IAAI,UAAU;CAC1C;AACD"}
@@ -1,39 +1,26 @@
1
- import { m as parseNaming } from "./naming-bM5qm5PY-jOg3JFMb.mjs";
2
- import { o as SqlNode } from "./storage-table-DDvN83mw-DkbBFmK9.mjs";
1
+ import { h as parseNaming } from "./naming-DEpT6Zad-C9PFkWt6.mjs";
2
+ import { t as SqlNode } from "./sql-node-D8P0akYY-RVytYXDZ.mjs";
3
3
  import { ContractValidationError } from "@prisma/orm-framework/contract/contract-validation-error";
4
4
  import { freezeNode } from "@prisma/orm-framework/components/ir";
5
- //#region ../../../2-sql-family/1-core/contract/dist/serialized-index-DjCCnXB1.mjs
5
+ //#region ../../../2-sql-family/1-core/contract/dist/serialized-index-BefvjuZ0.mjs
6
6
  /**
7
- * SQL Contract IR node for a value-set entry in a namespace's `valueSet`
8
- * map (`SqlNamespace.entries.valueSet`).
7
+ * SQL Contract IR node for a value object in a namespace's `valueObject` map (`SqlNamespace.entries.valueObject`): the keys every row holds in a column that stores it (ADR 309). A domain field refers to it by its storage coordinate.
9
8
  *
10
- * A value-set records the ordered set of permitted codec-encoded values for
11
- * an enum-like column restriction. It does not carry a `codecId` — the
12
- * column that references it already holds the codec; the value-set holds
13
- * only the permitted values.
9
+ * A field that leaves out `many` holds `many: false`, as the authoring builders write it, so a contract read from JSON equals the one built from its source.
14
10
  *
15
- * The node's `kind` is enumerable (`'valueSet'`) so the JSON envelope
16
- * carries the discriminator and the serializer hydration walker can
17
- * dispatch on it. This follows the per-leaf enumerable-kind convention
18
- * established in the SQL-node comment (future polymorphic dispatch on
19
- * namespace entries needs the discriminator in JSON).
20
- *
21
- * The entry's name is not on the class — value-sets are keyed by name in
22
- * the parent namespace's `valueSet: Record<string, StorageValueSet>` map.
11
+ * The entry's name is not on the class: value objects are keyed by name in the parent namespace's `valueObject` map.
23
12
  */
24
- var StorageValueSet = class extends SqlNode {
25
- kind = "valueSet";
26
- values;
13
+ var StorageValueObject = class extends SqlNode {
14
+ fields;
27
15
  constructor(input) {
28
16
  super();
29
- this.values = Object.freeze([...input.values]);
17
+ this.fields = Object.freeze(Object.fromEntries(Object.entries(input.fields).map(([name, field]) => [name, Object.freeze({
18
+ ...field,
19
+ many: field.many ?? false
20
+ })])));
30
21
  freezeNode(this);
31
22
  }
32
23
  };
33
- function isStorageValueSet(value) {
34
- if (typeof value !== "object" || value === null) return false;
35
- return "kind" in value && value.kind === "valueSet" && "values" in value;
36
- }
37
24
  /**
38
25
  * Hydrates one stored check constraint into constructor input. `parseNaming`
39
26
  * is what rejects a hand-edited file whose `prefix` and `name` disagree.
@@ -69,6 +56,6 @@ function indexInputFromSerialized(flat) {
69
56
  };
70
57
  }
71
58
  //#endregion
72
- export { isStorageValueSet as i, checkConstraintInputFromSerialized as n, indexInputFromSerialized as r, StorageValueSet as t };
59
+ export { checkConstraintInputFromSerialized as n, indexInputFromSerialized as r, StorageValueObject as t };
73
60
 
74
- //# sourceMappingURL=serialized-index-DjCCnXB1-DMA7BtO2.mjs.map
61
+ //# sourceMappingURL=serialized-index-BefvjuZ0-Bbsja7If.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serialized-index-BefvjuZ0-Bbsja7If.mjs","names":[],"sources":["../../../../2-sql-family/1-core/contract/dist/serialized-index-BefvjuZ0.mjs"],"sourcesContent":["import { t as SqlNode } from \"./sql-node-D8P0akYY.mjs\";\nimport { parseNaming } from \"@internal/sql-schema-ir/naming\";\nimport { freezeNode } from \"@internal/framework-components/ir\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\n//#region src/ir/storage-value-object.ts\n/**\n* SQL Contract IR node for a value object in a namespace's `valueObject` map (`SqlNamespace.entries.valueObject`): the keys every row holds in a column that stores it (ADR 309). A domain field refers to it by its storage coordinate.\n*\n* A field that leaves out `many` holds `many: false`, as the authoring builders write it, so a contract read from JSON equals the one built from its source.\n*\n* The entry's name is not on the class: value objects are keyed by name in the parent namespace's `valueObject` map.\n*/\nvar StorageValueObject = class extends SqlNode {\n\tfields;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.fields = Object.freeze(Object.fromEntries(Object.entries(input.fields).map(([name, field]) => [name, Object.freeze({\n\t\t\t...field,\n\t\t\tmany: field.many ?? false\n\t\t})])));\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/serialized-check-constraint.ts\n/**\n* Hydrates one stored check constraint into constructor input. `parseNaming`\n* is what rejects a hand-edited file whose `prefix` and `name` disagree.\n*/\nfunction checkConstraintInputFromSerialized(flat) {\n\treturn {\n\t\tnaming: parseNaming(flat.name, flat.prefix),\n\t\texpression: flat.expression\n\t};\n}\n//#endregion\n//#region src/serialized-index.ts\n/**\n* Hydrates one stored index into constructor input. The parameter is typed\n* but the values are whatever the file held, so each field the union depends\n* on is checked here rather than downstream — by the time `Index` sees the\n* data it is already a valid union.\n*/\nfunction indexInputFromSerialized(flat) {\n\tif (flat.name === void 0 || flat.name.length === 0) throw new ContractValidationError(\"Index: every index carries a full physical name; an expression index must be explicitly named (a default name cannot be derived from an expression).\", \"storage\");\n\tif (flat.columns === void 0 === (flat.expression === void 0)) throw new ContractValidationError(`Index \"${flat.name}\": exactly one of columns or expression must be set.`, \"storage\");\n\tconst carried = {\n\t\tnaming: parseNaming(flat.name, flat.prefix),\n\t\twhere: flat.where,\n\t\tunique: flat.unique,\n\t\ttype: flat.type,\n\t\toptions: flat.options\n\t};\n\treturn flat.expression !== void 0 ? {\n\t\t...carried,\n\t\texpression: flat.expression\n\t} : {\n\t\t...carried,\n\t\tcolumns: flat.columns ?? []\n\t};\n}\n//#endregion\nexport { checkConstraintInputFromSerialized as n, StorageValueObject as r, indexInputFromSerialized as t };\n\n//# sourceMappingURL=serialized-index-BefvjuZ0.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,IAAI,qBAAqB,cAAc,QAAQ;CAC9C;CACA,YAAY,OAAO;EAClB,MAAM;EACN,KAAK,SAAS,OAAO,OAAO,OAAO,YAAY,OAAO,QAAQ,MAAM,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW,CAAC,MAAM,OAAO,OAAO;GACvH,GAAG;GACH,MAAM,MAAM,QAAQ;EACrB,CAAC,CAAC,CAAC,CAAC,CAAC;EACL,WAAW,IAAI;CAChB;AACD;;;;;AAOA,SAAS,mCAAmC,MAAM;CACjD,OAAO;EACN,QAAQ,YAAY,KAAK,MAAM,KAAK,MAAM;EAC1C,YAAY,KAAK;CAClB;AACD;;;;;;;AASA,SAAS,yBAAyB,MAAM;CACvC,IAAI,KAAK,SAAS,KAAK,KAAK,KAAK,KAAK,WAAW,GAAG,MAAM,IAAI,wBAAwB,wJAAwJ,SAAS;CACvP,IAAI,KAAK,YAAY,KAAK,OAAO,KAAK,eAAe,KAAK,IAAI,MAAM,IAAI,wBAAwB,UAAU,KAAK,KAAK,uDAAuD,SAAS;CACpL,MAAM,UAAU;EACf,QAAQ,YAAY,KAAK,MAAM,KAAK,MAAM;EAC1C,OAAO,KAAK;EACZ,QAAQ,KAAK;EACb,MAAM,KAAK;EACX,SAAS,KAAK;CACf;CACA,OAAO,KAAK,eAAe,KAAK,IAAI;EACnC,GAAG;EACH,YAAY,KAAK;CAClB,IAAI;EACH,GAAG;EACH,SAAS,KAAK,WAAW,CAAC;CAC3B;AACD"}
@@ -1,5 +1,5 @@
1
- import { n as CheckConstraintInput } from "./check-constraint-B7qGu6rc-Bk2ezWXu.mjs";
2
- import { n as IndexElements, r as IndexInput } from "./sql-index-ByAAE7K8-Dqtn_vUL.mjs";
1
+ import { n as CheckConstraintInput } from "./check-constraint-B7qGu6rc-D5kVe9je.mjs";
2
+ import { n as IndexElements, r as IndexInput } from "./sql-index-ByAAE7K8-4TUFKGLK.mjs";
3
3
  //#region ../../../2-sql-family/1-core/contract/dist/serialized-index-CrgG8ct1.d.mts
4
4
  //#region src/serialized-check-constraint.d.ts
5
5
  /**
@@ -41,4 +41,4 @@ type SerializedIndex = IndexElements & {
41
41
  declare function indexInputFromSerialized(flat: SerializedIndex): IndexInput;
42
42
  //#endregion
43
43
  export { indexInputFromSerialized as i, SerializedIndex as n, checkConstraintInputFromSerialized as r, SerializedCheckConstraint as t };
44
- //# sourceMappingURL=serialized-index-CrgG8ct1-DKVJ7TDX.d.mts.map
44
+ //# sourceMappingURL=serialized-index-CrgG8ct1-Duy5-kFV.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"serialized-index-CrgG8ct1-DKVJ7TDX.d.mts","names":[],"sources":["../../../../2-sql-family/1-core/contract/dist/serialized-index-CrgG8ct1.d.mts"],"mappings":";;;;;;;;;UAQU;WACC;WACA;WACA;;;;;;iBAMM,mCAAmC,MAAM,4BAA4B;;;;;;;;KAQjF,kBAAkB;WACZ;WACA;WACA;WACA;WACA;WACA,UAAU;;;;;;;;iBAQJ,yBAAyB,MAAM,kBAAkB"}
1
+ {"version":3,"file":"serialized-index-CrgG8ct1-Duy5-kFV.d.mts","names":[],"sources":["../../../../2-sql-family/1-core/contract/dist/serialized-index-CrgG8ct1.d.mts"],"mappings":";;;;;;;;;UAQU;WACC;WACA;WACA;;;;;;iBAMM,mCAAmC,MAAM,4BAA4B;;;;;;;;KAQjF,kBAAkB;WACZ;WACA;WACA;WACA;WACA;WACA,UAAU;;;;;;;;iBAQJ,yBAAyB,MAAM,kBAAkB"}
@@ -1,7 +1,7 @@
1
1
  import { t as sqlContractCanonicalizationHooks } from "./canonicalization-hooks-Ce1v_TDl.mjs";
2
- import { f as composeSqlEntityKinds } from "./entity-kinds-JR5SAm5h-DOH6VUtL.mjs";
3
- import { c as isMaterializedSqlNamespace, o as SqlStorage } from "./types-CTdSkl0s.mjs";
4
- import { f as validateSqlContractFully, i as createSqlContractSchema, s as resolveSqlToOneRelationStorage } from "./validators-BwA7ttZM.mjs";
2
+ import { f as composeSqlEntityKinds } from "./entity-kinds-CgEwK0hH-D1NKoKE5.mjs";
3
+ import { c as isMaterializedSqlNamespace, o as SqlStorage } from "./types-CISwoRED.mjs";
4
+ import { f as validateSqlContractFully, i as createSqlContractSchema, s as resolveSqlToOneRelationStorage } from "./validators-qcQteqs2.mjs";
5
5
  import { t as sqlFamilyError } from "./errors-B5g0xWro-C8plbqga.mjs";
6
6
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
7
7
  import { ContractValidationError } from "@prisma/orm-framework/contract/contract-validation-error";
@@ -193,4 +193,4 @@ var SqlContractSerializer = class extends SqlContractSerializerBase {
193
193
  //#endregion
194
194
  export { SqlContractSerializerBase as n, SqlContractSerializer as t };
195
195
 
196
- //# sourceMappingURL=sql-contract-serializer-sMY3prTx-D2BfrNxs.mjs.map
196
+ //# sourceMappingURL=sql-contract-serializer-sMY3prTx-CBHrlt9O.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sql-contract-serializer-sMY3prTx-D2BfrNxs.mjs","names":[],"sources":["../../../../2-sql-family/9-family/dist/sql-contract-serializer-sMY3prTx.mjs"],"sourcesContent":["import { t as sqlFamilyError } from \"./errors-B5g0xWro.mjs\";\nimport { hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { sqlContractCanonicalizationHooks } from \"@internal/sql-contract/canonicalization-hooks\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { SqlStorage, isMaterializedSqlNamespace } from \"@internal/sql-contract/types\";\nimport { createSqlContractSchema, resolveSqlToOneRelationStorage, validateSqlContractFully } from \"@internal/sql-contract/validators\";\nimport { isPlainRecord as isPlainRecord$1 } from \"@internal/contract/is-plain-record\";\nimport { withDerivedToOneRelationNullability } from \"@internal/contract-authoring\";\nimport { composeSqlEntityKinds } from \"@internal/sql-contract/entity-kinds\";\nimport { type } from \"arktype\";\n//#region src/core/ir/sql-contract-serializer-base.ts\nconst NamespaceRawSchema = type({\n\tid: \"string\",\n\t\"kind?\": \"string\",\n\tentries: type({ \"+\": \"ignore\" })\n});\n/**\n* A `contract.json` written before to-one relations recorded `nullable` (rc.9 and earlier)\n* loads with the flag derived from storage: nullable when any local FK column is nullable or\n* cannot be resolved.\n*/\nfunction withSqlToOneRelationNullability(contract) {\n\tconst domain = withDerivedToOneRelationNullability(contract.domain, ({ model, relation }) => {\n\t\tconst { ownsForeignKey, columns } = resolveSqlToOneRelationStorage(contract, blindCast(model.storage), relation);\n\t\treturn {\n\t\t\townsReference: ownsForeignKey,\n\t\t\tlocalFieldNullability: columns.map((column) => column.nullable)\n\t\t};\n\t});\n\treturn {\n\t\t...contract,\n\t\tdomain\n\t};\n}\n/**\n* SQL family `ContractSerializer` abstract base. Carries the SQL-shared\n* deserialization pipeline:\n*\n* 1. `parseSqlContractStructure` validates the on-disk JSON envelope\n* against the SQL contract arktype schema (`validateSqlContractFully`)\n* and returns the validated flat-data shape.\n* 2. `hydrateSqlStorage` walks the validated `storage` subtree and\n* constructs the family-shared SQL Contract IR class hierarchy\n* (`SqlStorage` -> `StorageTable` -> `StorageColumn` / `PrimaryKey`\n* / …). The rest of the contract envelope is JSON-clean primitive\n* data and passes through unchanged.\n* 3. `constructTargetContract` is the target-specific extension hook;\n* defaults to identity. Targets that need to attach target-only\n* fields (e.g. target-specific derived storage fields) override it.\n*\n* Default `serializeContract` is identity over the contract — concrete\n* SQL targets ship JSON-clean class instances, so the contract value\n* can be stringified directly. The non-enumerable family-level `kind`\n* discriminator on `SqlNode` instances stays out of the persisted\n* envelope automatically. Targets that need to canonicalize on the way\n* out (key ordering, dropping computed-only fields) override\n* `serializeContract` directly.\n*/\nvar SqlContractSerializerBase = class {\n\tentityHydrationRegistry;\n\tdataTypes;\n\tcontractSchema;\n\tentryKinds;\n\tconstructor(entityHydrationRegistry = /* @__PURE__ */ new Map(), packEntityKinds = [], dataTypes = void 0) {\n\t\tthis.entityHydrationRegistry = entityHydrationRegistry;\n\t\tthis.dataTypes = dataTypes;\n\t\tthis.entryKinds = composeSqlEntityKinds(packEntityKinds);\n\t\tthis.contractSchema = packEntityKinds.length > 0 ? createSqlContractSchema(this.entryKinds) : void 0;\n\t}\n\tdeserializeContract(json) {\n\t\tconst validated = withSqlToOneRelationNullability(this.parseSqlContractStructure(json));\n\t\tconst hydrated = this.hydrateSqlStorage(validated);\n\t\treturn blindCast(this.constructTargetContract(hydrated));\n\t}\n\tserializeContract(contract) {\n\t\treturn blindCast(contract);\n\t}\n\tshouldPreserveEmpty = sqlContractCanonicalizationHooks.shouldPreserveEmpty;\n\tsortStorage = sqlContractCanonicalizationHooks.sortStorage;\n\thashCanonicalizationHooks = sqlContractCanonicalizationHooks;\n\tparseSqlContractStructure(json) {\n\t\treturn validateSqlContractFully(json, {\n\t\t\t...ifDefined(\"contractSchema\", this.contractSchema),\n\t\t\t...ifDefined(\"dataTypes\", this.dataTypes)\n\t\t});\n\t}\n\thydrateSqlStorage(validated) {\n\t\tconst types = validated.storage.types;\n\t\tconst hydratedTypes = types !== void 0 ? Object.fromEntries(Object.entries(types).map(([name, entry]) => [name, this.hydrateStorageTypeEntry(entry)])) : void 0;\n\t\tconst rawNamespaces = validated.storage.namespaces;\n\t\tif (rawNamespaces === void 0) throw new ContractValidationError(\"Contract storage.namespaces is required after structural validation\", \"structural\");\n\t\tconst hydratedNamespaces = this.hydrateSqlNamespaceMap(blindCast(rawNamespaces));\n\t\treturn {\n\t\t\t...validated,\n\t\t\tstorage: new SqlStorage({\n\t\t\t\tstorageHash: validated.storage.storageHash,\n\t\t\t\t...ifDefined(\"types\", hydratedTypes),\n\t\t\t\tnamespaces: blindCast(hydratedNamespaces)\n\t\t\t})\n\t\t};\n\t}\n\thydrateSqlNamespaceMap(namespaces) {\n\t\treturn Object.fromEntries(Object.entries(namespaces).map(([nsId, namespaceEntryRaw]) => {\n\t\t\tconst namespaceHydrated = this.hydrateSqlNamespaceEntry(nsId, namespaceEntryRaw);\n\t\t\tif (!isMaterializedSqlNamespace(namespaceHydrated)) throw sqlFamilyError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Target serializer bug: hydrateSqlNamespaceEntry for namespace \"${nsId}\" returned a non-NamespaceBase value. Override hydrateSqlNamespaceEntry to produce a target namespace concretion.`, {\n\t\t\t\twhy: \"The target contract serializer hydrated a namespace into a value that is not a materialized namespace concretion.\",\n\t\t\t\tfix: \"Fix the target package: its hydrateSqlNamespaceEntry override must return a target namespace concretion.\",\n\t\t\t\tmeta: { namespaceId: nsId }\n\t\t\t});\n\t\t\treturn [nsId, namespaceHydrated];\n\t\t}));\n\t}\n\thydrateSqlNamespaceEntry(nsId, raw) {\n\t\tconst id = typeof raw[\"id\"] === \"string\" ? raw[\"id\"] : nsId;\n\t\tconst parsed = NamespaceRawSchema({\n\t\t\t...raw,\n\t\t\tid\n\t\t});\n\t\tif (parsed instanceof type.errors) throw new ContractValidationError(`Namespace hydration failed: ${parsed.map((p) => p.message).join(\"; \")}`, \"structural\");\n\t\tconst entriesRaw = parsed.entries;\n\t\tconst rawEntriesMap = isPlainRecord$1(entriesRaw) ? entriesRaw : {};\n\t\tconst entriesInput = {};\n\t\tfor (const [key, innerMap] of Object.entries(rawEntriesMap)) entriesInput[key] = isPlainRecord$1(innerMap) ? innerMap : Object.freeze({});\n\t\tconst entriesOutput = hydrateNamespaceEntities(entriesInput, this.entryKinds, \"fail\", id);\n\t\tif (!Object.hasOwn(entriesOutput, \"table\")) entriesOutput[\"table\"] = {};\n\t\treturn blindCast({\n\t\t\tid,\n\t\t\tentries: entriesOutput\n\t\t});\n\t}\n\thydrateStorageTypeEntry(entry) {\n\t\tif (typeof entry !== \"object\" || entry === null) return entry;\n\t\tconst kind = isPlainRecord$1(entry) && \"kind\" in entry ? entry.kind : void 0;\n\t\tif (typeof kind !== \"string\") return entry;\n\t\tconst factory = this.entityHydrationRegistry.get(kind);\n\t\tif (factory === void 0) return entry;\n\t\treturn blindCast(factory(entry));\n\t}\n\tconstructTargetContract(hydrated) {\n\t\treturn blindCast(hydrated);\n\t}\n\t/**\n\t* Serializes a namespace's `entries` dict by walking every enumerable\n\t* kind — no kind is named here, mirroring the generic hydrate walk in\n\t* `hydrateSqlNamespaceEntry` above. `table` is the SQL family's one\n\t* universal base kind (every namespace carries it), so it is always\n\t* emitted, even when empty; every other kind — target- or\n\t* pack-contributed — is emitted only when it holds at least one entry.\n\t* A kind carried non-enumerable on `entries` is excluded here for free,\n\t* since `Object.entries` honors enumerability.\n\t*/\n\tserializeNamespaceEntries(entries) {\n\t\tconst out = { table: this.serializeEntries(entries[\"table\"] ?? {}) };\n\t\tfor (const [kind, record] of Object.entries(entries)) {\n\t\t\tif (kind === \"table\" || record == null || Object.keys(record).length === 0) continue;\n\t\t\tout[kind] = this.serializeEntries(record);\n\t\t}\n\t\treturn out;\n\t}\n\tserializeEntries(entries) {\n\t\tconst out = {};\n\t\tfor (const [name, entry] of Object.entries(entries)) out[name] = this.serializeJsonObject(entry);\n\t\treturn out;\n\t}\n\tserializeJsonObject(value) {\n\t\treturn blindCast(this.serializeJsonValue(value));\n\t}\n\tserializeJsonValue(value) {\n\t\treturn blindCast(JSON.parse(JSON.stringify(value)));\n\t}\n};\n//#endregion\n//#region src/core/ir/sql-contract-serializer.ts\n/**\n* Default SQL family `ContractSerializer` concretion. Inherits the\n* full SQL-shared deserialization pipeline (structural validation +\n* IR-class hydration) without pack-registered `storage.types`\n* hydration factories — targets that emit polymorphic JSON outside the\n* codec-typed envelope wire a target-specific subclass with a populated\n* registry (see Postgres). Family-level call sites instantiate this\n* default directly when no target serializer is supplied.\n*\n* Because this serializer has no target concretion, deserialization of\n* contracts that include namespace entries from JSON will throw unless\n* the caller provides pre-hydrated `NamespaceBase` instances. Production\n* paths always supply a target-specific serializer.\n*/\nvar SqlContractSerializer = class extends SqlContractSerializerBase {\n\tconstructor() {\n\t\tsuper(/* @__PURE__ */ new Map());\n\t}\n};\n//#endregion\nexport { SqlContractSerializerBase as n, SqlContractSerializer as t };\n\n//# sourceMappingURL=sql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D;;;;;;;;;;;;;;;AAiBA,IAAI,wBAAwB,cAAc,0BAA0B;CACnE,cAAc;EACb,sBAAsB,IAAI,IAAI,CAAC;CAChC;AACD"}
1
+ {"version":3,"file":"sql-contract-serializer-sMY3prTx-CBHrlt9O.mjs","names":[],"sources":["../../../../2-sql-family/9-family/dist/sql-contract-serializer-sMY3prTx.mjs"],"sourcesContent":["import { t as sqlFamilyError } from \"./errors-B5g0xWro.mjs\";\nimport { hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { sqlContractCanonicalizationHooks } from \"@internal/sql-contract/canonicalization-hooks\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { SqlStorage, isMaterializedSqlNamespace } from \"@internal/sql-contract/types\";\nimport { createSqlContractSchema, resolveSqlToOneRelationStorage, validateSqlContractFully } from \"@internal/sql-contract/validators\";\nimport { isPlainRecord as isPlainRecord$1 } from \"@internal/contract/is-plain-record\";\nimport { withDerivedToOneRelationNullability } from \"@internal/contract-authoring\";\nimport { composeSqlEntityKinds } from \"@internal/sql-contract/entity-kinds\";\nimport { type } from \"arktype\";\n//#region src/core/ir/sql-contract-serializer-base.ts\nconst NamespaceRawSchema = type({\n\tid: \"string\",\n\t\"kind?\": \"string\",\n\tentries: type({ \"+\": \"ignore\" })\n});\n/**\n* A `contract.json` written before to-one relations recorded `nullable` (rc.9 and earlier)\n* loads with the flag derived from storage: nullable when any local FK column is nullable or\n* cannot be resolved.\n*/\nfunction withSqlToOneRelationNullability(contract) {\n\tconst domain = withDerivedToOneRelationNullability(contract.domain, ({ model, relation }) => {\n\t\tconst { ownsForeignKey, columns } = resolveSqlToOneRelationStorage(contract, blindCast(model.storage), relation);\n\t\treturn {\n\t\t\townsReference: ownsForeignKey,\n\t\t\tlocalFieldNullability: columns.map((column) => column.nullable)\n\t\t};\n\t});\n\treturn {\n\t\t...contract,\n\t\tdomain\n\t};\n}\n/**\n* SQL family `ContractSerializer` abstract base. Carries the SQL-shared\n* deserialization pipeline:\n*\n* 1. `parseSqlContractStructure` validates the on-disk JSON envelope\n* against the SQL contract arktype schema (`validateSqlContractFully`)\n* and returns the validated flat-data shape.\n* 2. `hydrateSqlStorage` walks the validated `storage` subtree and\n* constructs the family-shared SQL Contract IR class hierarchy\n* (`SqlStorage` -> `StorageTable` -> `StorageColumn` / `PrimaryKey`\n* / …). The rest of the contract envelope is JSON-clean primitive\n* data and passes through unchanged.\n* 3. `constructTargetContract` is the target-specific extension hook;\n* defaults to identity. Targets that need to attach target-only\n* fields (e.g. target-specific derived storage fields) override it.\n*\n* Default `serializeContract` is identity over the contract — concrete\n* SQL targets ship JSON-clean class instances, so the contract value\n* can be stringified directly. The non-enumerable family-level `kind`\n* discriminator on `SqlNode` instances stays out of the persisted\n* envelope automatically. Targets that need to canonicalize on the way\n* out (key ordering, dropping computed-only fields) override\n* `serializeContract` directly.\n*/\nvar SqlContractSerializerBase = class {\n\tentityHydrationRegistry;\n\tdataTypes;\n\tcontractSchema;\n\tentryKinds;\n\tconstructor(entityHydrationRegistry = /* @__PURE__ */ new Map(), packEntityKinds = [], dataTypes = void 0) {\n\t\tthis.entityHydrationRegistry = entityHydrationRegistry;\n\t\tthis.dataTypes = dataTypes;\n\t\tthis.entryKinds = composeSqlEntityKinds(packEntityKinds);\n\t\tthis.contractSchema = packEntityKinds.length > 0 ? createSqlContractSchema(this.entryKinds) : void 0;\n\t}\n\tdeserializeContract(json) {\n\t\tconst validated = withSqlToOneRelationNullability(this.parseSqlContractStructure(json));\n\t\tconst hydrated = this.hydrateSqlStorage(validated);\n\t\treturn blindCast(this.constructTargetContract(hydrated));\n\t}\n\tserializeContract(contract) {\n\t\treturn blindCast(contract);\n\t}\n\tshouldPreserveEmpty = sqlContractCanonicalizationHooks.shouldPreserveEmpty;\n\tsortStorage = sqlContractCanonicalizationHooks.sortStorage;\n\thashCanonicalizationHooks = sqlContractCanonicalizationHooks;\n\tparseSqlContractStructure(json) {\n\t\treturn validateSqlContractFully(json, {\n\t\t\t...ifDefined(\"contractSchema\", this.contractSchema),\n\t\t\t...ifDefined(\"dataTypes\", this.dataTypes)\n\t\t});\n\t}\n\thydrateSqlStorage(validated) {\n\t\tconst types = validated.storage.types;\n\t\tconst hydratedTypes = types !== void 0 ? Object.fromEntries(Object.entries(types).map(([name, entry]) => [name, this.hydrateStorageTypeEntry(entry)])) : void 0;\n\t\tconst rawNamespaces = validated.storage.namespaces;\n\t\tif (rawNamespaces === void 0) throw new ContractValidationError(\"Contract storage.namespaces is required after structural validation\", \"structural\");\n\t\tconst hydratedNamespaces = this.hydrateSqlNamespaceMap(blindCast(rawNamespaces));\n\t\treturn {\n\t\t\t...validated,\n\t\t\tstorage: new SqlStorage({\n\t\t\t\tstorageHash: validated.storage.storageHash,\n\t\t\t\t...ifDefined(\"types\", hydratedTypes),\n\t\t\t\tnamespaces: blindCast(hydratedNamespaces)\n\t\t\t})\n\t\t};\n\t}\n\thydrateSqlNamespaceMap(namespaces) {\n\t\treturn Object.fromEntries(Object.entries(namespaces).map(([nsId, namespaceEntryRaw]) => {\n\t\t\tconst namespaceHydrated = this.hydrateSqlNamespaceEntry(nsId, namespaceEntryRaw);\n\t\t\tif (!isMaterializedSqlNamespace(namespaceHydrated)) throw sqlFamilyError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Target serializer bug: hydrateSqlNamespaceEntry for namespace \"${nsId}\" returned a non-NamespaceBase value. Override hydrateSqlNamespaceEntry to produce a target namespace concretion.`, {\n\t\t\t\twhy: \"The target contract serializer hydrated a namespace into a value that is not a materialized namespace concretion.\",\n\t\t\t\tfix: \"Fix the target package: its hydrateSqlNamespaceEntry override must return a target namespace concretion.\",\n\t\t\t\tmeta: { namespaceId: nsId }\n\t\t\t});\n\t\t\treturn [nsId, namespaceHydrated];\n\t\t}));\n\t}\n\thydrateSqlNamespaceEntry(nsId, raw) {\n\t\tconst id = typeof raw[\"id\"] === \"string\" ? raw[\"id\"] : nsId;\n\t\tconst parsed = NamespaceRawSchema({\n\t\t\t...raw,\n\t\t\tid\n\t\t});\n\t\tif (parsed instanceof type.errors) throw new ContractValidationError(`Namespace hydration failed: ${parsed.map((p) => p.message).join(\"; \")}`, \"structural\");\n\t\tconst entriesRaw = parsed.entries;\n\t\tconst rawEntriesMap = isPlainRecord$1(entriesRaw) ? entriesRaw : {};\n\t\tconst entriesInput = {};\n\t\tfor (const [key, innerMap] of Object.entries(rawEntriesMap)) entriesInput[key] = isPlainRecord$1(innerMap) ? innerMap : Object.freeze({});\n\t\tconst entriesOutput = hydrateNamespaceEntities(entriesInput, this.entryKinds, \"fail\", id);\n\t\tif (!Object.hasOwn(entriesOutput, \"table\")) entriesOutput[\"table\"] = {};\n\t\treturn blindCast({\n\t\t\tid,\n\t\t\tentries: entriesOutput\n\t\t});\n\t}\n\thydrateStorageTypeEntry(entry) {\n\t\tif (typeof entry !== \"object\" || entry === null) return entry;\n\t\tconst kind = isPlainRecord$1(entry) && \"kind\" in entry ? entry.kind : void 0;\n\t\tif (typeof kind !== \"string\") return entry;\n\t\tconst factory = this.entityHydrationRegistry.get(kind);\n\t\tif (factory === void 0) return entry;\n\t\treturn blindCast(factory(entry));\n\t}\n\tconstructTargetContract(hydrated) {\n\t\treturn blindCast(hydrated);\n\t}\n\t/**\n\t* Serializes a namespace's `entries` dict by walking every enumerable\n\t* kind — no kind is named here, mirroring the generic hydrate walk in\n\t* `hydrateSqlNamespaceEntry` above. `table` is the SQL family's one\n\t* universal base kind (every namespace carries it), so it is always\n\t* emitted, even when empty; every other kind — target- or\n\t* pack-contributed — is emitted only when it holds at least one entry.\n\t* A kind carried non-enumerable on `entries` is excluded here for free,\n\t* since `Object.entries` honors enumerability.\n\t*/\n\tserializeNamespaceEntries(entries) {\n\t\tconst out = { table: this.serializeEntries(entries[\"table\"] ?? {}) };\n\t\tfor (const [kind, record] of Object.entries(entries)) {\n\t\t\tif (kind === \"table\" || record == null || Object.keys(record).length === 0) continue;\n\t\t\tout[kind] = this.serializeEntries(record);\n\t\t}\n\t\treturn out;\n\t}\n\tserializeEntries(entries) {\n\t\tconst out = {};\n\t\tfor (const [name, entry] of Object.entries(entries)) out[name] = this.serializeJsonObject(entry);\n\t\treturn out;\n\t}\n\tserializeJsonObject(value) {\n\t\treturn blindCast(this.serializeJsonValue(value));\n\t}\n\tserializeJsonValue(value) {\n\t\treturn blindCast(JSON.parse(JSON.stringify(value)));\n\t}\n};\n//#endregion\n//#region src/core/ir/sql-contract-serializer.ts\n/**\n* Default SQL family `ContractSerializer` concretion. Inherits the\n* full SQL-shared deserialization pipeline (structural validation +\n* IR-class hydration) without pack-registered `storage.types`\n* hydration factories — targets that emit polymorphic JSON outside the\n* codec-typed envelope wire a target-specific subclass with a populated\n* registry (see Postgres). Family-level call sites instantiate this\n* default directly when no target serializer is supplied.\n*\n* Because this serializer has no target concretion, deserialization of\n* contracts that include namespace entries from JSON will throw unless\n* the caller provides pre-hydrated `NamespaceBase` instances. Production\n* paths always supply a target-specific serializer.\n*/\nvar SqlContractSerializer = class extends SqlContractSerializerBase {\n\tconstructor() {\n\t\tsuper(/* @__PURE__ */ new Map());\n\t}\n};\n//#endregion\nexport { SqlContractSerializerBase as n, SqlContractSerializer as t };\n\n//# sourceMappingURL=sql-contract-serializer-sMY3prTx.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,qBAAqB,KAAK;CAC/B,IAAI;CACJ,SAAS;CACT,SAAS,KAAK,EAAE,KAAK,SAAS,CAAC;AAChC,CAAC;;;;;;AAMD,SAAS,gCAAgC,UAAU;CAClD,MAAM,SAAS,oCAAoC,SAAS,SAAS,EAAE,OAAO,eAAe;EAC5F,MAAM,EAAE,gBAAgB,YAAY,+BAA+B,UAAU,UAAU,MAAM,OAAO,GAAG,QAAQ;EAC/G,OAAO;GACN,eAAe;GACf,uBAAuB,QAAQ,KAAK,WAAW,OAAO,QAAQ;EAC/D;CACD,CAAC;CACD,OAAO;EACN,GAA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EACrC,MAAM,UAAU,KAAK,wBAAwB,IAAI,IAAI;EACrD,IAAI,YAAY,KAAK,GAAG,OAAO;EAC/B,OAAO,UAAU,QAAQ,KAAK,CAAC;CAChC;CACA,wBAAwB,UAAU;EACjC,OAAO,UAAU,QAAQ;CAC1B;;;;;;;;;;;CAWA,0BAA0B,SAAS;EAClC,MAAM,MAAM,EAAE,OAAO,KAAK,iBAAiB,QAAQ,YAAY,CAAC,CAAC,EAAE;EACnE,KAAK,MAAM,CAAC,MAAM,WAAW,OAAO,QAAQ,OAAO,GAAG;GACrD,IAAI,SAAS,WAAW,UAAU,QAAQ,OAAO,KAAK,MAAM,CAAC,CAAC,WAAW,GAAG;GAC5E,IAAI,QAAQ,KAAK,iBAAiB,MAAM;EACzC;EACA,OAAO;CACR;CACA,iBAAiB,SAAS;EACzB,MAAM,MAAM,CAAC;EACb,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,OAAO,GAAG,IAAI,QAAQ,KAAK,oBAAoB,KAAK;EAC/F,OAAO;CACR;CACA,oBAAoB,OAAO;EAC1B,OAAO,UAAU,KAAK,mBAAmB,KAAK,CAAC;CAChD;CACA,mBAAmB,OAAO;EACzB,OAAO,UAAU,KAAK,MAAM,KAAK,UAAU,KAAK,CAAC,CAAC;CACnD;AACD;;;;;;;;;;;;;;;AAiBA,IAAI,wBAAwB,cAAc,0BAA0B;CACnE,cAAc;EACb,sBAAsB,IAAI,IAAI,CAAC;CAChC;AACD"}
@@ -5,7 +5,7 @@ import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
5
5
  import { blindCast } from "@prisma/orm-framework/utils/casts";
6
6
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
7
7
  import { type } from "arktype";
8
- //#region ../../../2-sql-family/1-core/contract/dist/sql-data-type-D7M-YTTY.mjs
8
+ //#region ../../../2-sql-family/1-core/contract/dist/sql-data-type-LVBldu1a.mjs
9
9
  const PLACEHOLDER = /\{([A-Za-z][A-Za-z0-9]*)\}/g;
10
10
  const LITERAL_CHARACTERS = /^[a-z0-9_ (),.]*$/;
11
11
  const REGEXP_SPECIAL = /[.*+?^${}()|[\]\\]/g;
@@ -102,6 +102,8 @@ function sqlDataType(id, spec) {
102
102
  checkMarks(declared.id, texts);
103
103
  checkKindClaim(declared.id, spec);
104
104
  checkStoredAs(declared.id, spec);
105
+ const declaredCatalogParams = spec.catalogParams;
106
+ const catalogParams = declaredCatalogParams === void 0 ? normalize : (params) => isParamsOf(spec.params, params) ? declaredCatalogParams(params) : params;
105
107
  const type = {
106
108
  ...declared,
107
109
  ...ifDefined("params", spec.params),
@@ -110,6 +112,7 @@ function sqlDataType(id, spec) {
110
112
  claimsKind: spec.claimsKind,
111
113
  storedAs: spec.storedAs,
112
114
  normalize,
115
+ catalogParams,
113
116
  render: spec.render,
114
117
  fromReported: spec.fromReported,
115
118
  nameIsCatalogText: spec.nameIsCatalogText === true
@@ -272,13 +275,13 @@ function renderSqlTypeName(type, params) {
272
275
  const normalized = type.sql.normalize(validated);
273
276
  return substitute(type, pickText(type, "written", presentKeys(params).filter((key) => Object.hasOwn(normalized, key))), params);
274
277
  }
275
- /** The text the database catalog prints for `type` with `params`, in their normal form. */
278
+ /** The text the database catalog prints for `type` with `params` as written, from the parameters its catalog prints for them ({@link SqlDataTypeFacts.catalogParams}). */
276
279
  function renderSqlCatalogText(type, params) {
277
280
  const validated = validateSqlTypeParams(type, params);
278
281
  if (type.sql.claimsKind !== void 0) throw new InternalError(`Data type ${type.id} claims the kind "${type.sql.claimsKind}" and has no catalog text.`);
279
282
  if (type.sql.render !== void 0) return type.sql.render(validated);
280
- const normalized = type.sql.normalize(validated);
281
- return substitute(type, pickText(type, "catalog", presentKeys(normalized)), normalized);
283
+ const printed = type.sql.catalogParams(validated);
284
+ return substitute(type, pickText(type, "catalog", presentKeys(printed)), printed);
282
285
  }
283
286
  function prepareReportedText(text) {
284
287
  let prepared = "";
@@ -371,7 +374,7 @@ function paramsMatching(type, candidate, text) {
371
374
  }
372
375
  /**
373
376
  * Every data type in `dataTypes` that reads `text` as a migration may write it, with its parameters
374
- * in normal form: any of a type's texts counts, whether written, printed by the catalog or only
377
+ * in normal form and as written: any of a type's texts counts, whether written, printed by the catalog or only
375
378
  * claimed. Empty when no type reads it or its parameters fail the type's schema. A type that claims
376
379
  * a kind has no texts, so it never reads one.
377
380
  */
@@ -382,7 +385,10 @@ function resolveWrittenSqlTypes(text, dataTypes) {
382
385
  const params = paramsMatching(type, candidate, prepared);
383
386
  if (params === void 0) continue;
384
387
  const resolved = resolvedWith(type, params);
385
- if (resolved !== void 0) return [resolved];
388
+ if (resolved !== void 0) return [{
389
+ ...resolved,
390
+ writtenTypeParams: params
391
+ }];
386
392
  }
387
393
  return [];
388
394
  });
@@ -397,4 +403,4 @@ function resolvedWith(type$1, params) {
397
403
  //#endregion
398
404
  export { unquotedSqlBaseName as _, renderSqlTypeName as a, sameSqlColumnType as c, sqlColumnLength as d, sqlDataType as f, sqlStorageTypeOfCodec as g, sqlStorageTypeId as h, renderSqlCatalogText as i, sqlBaseName as l, sqlStorageType as m, isSqlDataType as n, resolveReportedSqlType as o, sqlDataTypeOfCodec as p, nameIsCatalogText as r, resolveWrittenSqlTypes as s, findSqlDataTypeCollision as t, sqlCodecColumnLength as u, unquotedSqlBaseNameOfCodec as v, validateSqlTypeParams as y };
399
405
 
400
- //# sourceMappingURL=sql-data-type-D7M-YTTY-D2vRqDxn.mjs.map
406
+ //# sourceMappingURL=sql-data-type-LVBldu1a-Bq203xWX.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-data-type-LVBldu1a-Bq203xWX.mjs","names":[],"sources":["../../../../2-sql-family/1-core/contract/dist/sql-data-type-LVBldu1a.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { assertDataTypeParams, dataType, dataTypeParams, objectSchemaKeys, schemaKeysAllowing } from \"@internal/framework-components/codec\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { type } from \"arktype\";\n//#region src/sql-data-type.ts\nconst PLACEHOLDER = /\\{([A-Za-z][A-Za-z0-9]*)\\}/g;\nconst LITERAL_CHARACTERS = /^[a-z0-9_ (),.]*$/;\nconst REGEXP_SPECIAL = /[.*+?^${}()|[\\]\\\\]/g;\nfunction paramKeysOf(id, schema) {\n\tif (schema === void 0) return [];\n\tconst keys = objectSchemaKeys(schema);\n\tif (keys === void 0) refuseDeclaration(id, \"its parameter schema must be an arktype object schema.\");\n\treturn keys;\n}\nfunction placeholdersOf(text) {\n\treturn [...text.matchAll(PLACEHOLDER)].map((match) => match[1] ?? \"\");\n}\nfunction placeholderSetOf(text) {\n\treturn [...placeholdersOf(text)].sort().join(\",\");\n}\nfunction patternOf(text, signedKeys = []) {\n\tconst placeholders = text.replace(REGEXP_SPECIAL, \"\\\\$&\").replace(/\\\\\\{([A-Za-z][A-Za-z0-9]*)\\\\\\}/g, (_, name) => signedKeys.includes(name) ? \"(-?\\\\d+)\" : \"(\\\\d+)\");\n\treturn new RegExp(`^${placeholders}$`);\n}\nfunction refuseDeclaration(id, why) {\n\tthrow new InternalError(`Data type ${id}: ${why}`);\n}\nfunction checkText(id, text, paramKeys) {\n\tconst quoted = JSON.stringify(text.text);\n\tconst refuse = (why) => refuseDeclaration(id, `the text ${quoted} ${why}.`);\n\tif (text.text === \"\") refuse(\"is empty\");\n\tif (text.text !== text.text.trim()) refuse(\"starts or ends with a space\");\n\tif (text.text.includes(\" \")) refuse(\"has two spaces in a row\");\n\tconst literal = text.text.replace(PLACEHOLDER, \"\");\n\tif (literal.includes(\"{\") || literal.includes(\"}\")) refuse(\"has a placeholder that is not written {name}\");\n\tif (!LITERAL_CHARACTERS.test(literal)) refuse(\"must be lower case and contain only letters, digits, spaces, brackets, commas, dots, underscores and placeholders\");\n\tfor (const name of placeholdersOf(text.text)) if (!paramKeys.includes(name)) refuse(`names the parameter {${name}}, which the type does not declare`);\n\tif (text.display === void 0) return;\n\tconst display = JSON.stringify(text.display);\n\tif (text.display.toLowerCase() !== text.text.toLowerCase()) refuse(`has the display ${display}, which differs from it beyond letter case`);\n\tif (placeholdersOf(text.display).join(\",\") !== placeholdersOf(text.text).join(\",\")) refuse(`has the display ${display}, which writes a placeholder differently`);\n}\nfunction checkMarks(id, texts) {\n\tconst marked = /* @__PURE__ */ new Map();\n\tfor (const text of texts) {\n\t\tconst key = placeholderSetOf(text.text);\n\t\tconst entry = marked.get(key) ?? {};\n\t\tfor (const mark of [\"written\", \"catalog\"]) {\n\t\t\tif (text[mark] !== true) continue;\n\t\t\tconst other = entry[mark];\n\t\t\tif (other !== void 0) refuseDeclaration(id, `the texts ${JSON.stringify(other)} and ${JSON.stringify(text.text)} have the same placeholders and are both ${mark}.`);\n\t\t\tentry[mark] = text.text;\n\t\t}\n\t\tmarked.set(key, entry);\n\t}\n}\nfunction checkKindClaim(id, spec) {\n\tif (spec.nameIsCatalogText === true) {\n\t\tif (spec.render === void 0) refuseDeclaration(id, \"a type whose name is its catalog text declares render.\");\n\t\tif (spec.texts !== void 0 || spec.claimsKind !== void 0) refuseDeclaration(id, \"a type whose name is its catalog text declares no texts and claims no kind.\");\n\t}\n\tif (spec.claimsKind === void 0) {\n\t\tif (spec.render !== void 0 && spec.nameIsCatalogText !== true) refuseDeclaration(id, \"render is allowed only together with claimsKind or nameIsCatalogText.\");\n\t\tif (spec.fromReported !== void 0) refuseDeclaration(id, \"fromReported is allowed only together with claimsKind.\");\n\t\treturn;\n\t}\n\tif (spec.texts !== void 0) refuseDeclaration(id, \"a type that claims a kind declares no texts.\");\n}\nfunction checkStoredAs(id, spec) {\n\tif (spec.storedAs === void 0) return;\n\tif (spec.texts !== void 0) refuseDeclaration(id, \"a type stored as another declares no texts; its name is the name of the type it is stored as.\");\n\tif (spec.claimsKind !== void 0) refuseDeclaration(id, \"a type stored as another claims no kind.\");\n}\nconst identity = (params) => params;\nfunction isParamsOf(schema, params) {\n\treturn schema === void 0 || !(schema(params) instanceof type.errors);\n}\nfunction checkNormalFormsWritten(type) {\n\tconst written = new Set(type.sql.texts.filter((text) => text.written === true).map((text) => placeholderSetOf(text.text)));\n\tif (written.size === 0) return;\n\tconst probes = [{}, ...type.sql.texts.map((text) => Object.fromEntries(placeholdersOf(text.text).map((name) => [name, 1])))];\n\tfor (const probe of probes) {\n\t\tif (!isParamsOf(type.params, probe)) continue;\n\t\tconst normalKeys = presentKeys(type.sql.normalize(probe));\n\t\tif (!written.has([...normalKeys].sort().join(\",\"))) refuseDeclaration(type.id, `the parameters ${formatKeys(Object.keys(probe))} have the normal form ${formatKeys(normalKeys)}, which no written text takes.`);\n\t}\n}\n/** Declare a SQL data type, refusing a declaration that breaks a rule of the module. */\nfunction sqlDataType(id, spec) {\n\tconst declaredNormalize = spec.normalize ?? identity;\n\tconst normalize = (params) => isParamsOf(spec.params, params) ? declaredNormalize(params) : params;\n\tconst { params: _untypedParams, ...declared } = dataType(id, {\n\t\t...spec,\n\t\tnormalize\n\t});\n\tconst texts = spec.texts ?? [];\n\tconst paramKeys = paramKeysOf(declared.id, spec.params);\n\tfor (const text of texts) checkText(declared.id, text, paramKeys);\n\tcheckMarks(declared.id, texts);\n\tcheckKindClaim(declared.id, spec);\n\tcheckStoredAs(declared.id, spec);\n\tconst declaredCatalogParams = spec.catalogParams;\n\tconst catalogParams = declaredCatalogParams === void 0 ? normalize : (params) => isParamsOf(spec.params, params) ? declaredCatalogParams(params) : params;\n\tconst type = {\n\t\t...declared,\n\t\t...ifDefined(\"params\", spec.params),\n\t\tsql: {\n\t\t\ttexts,\n\t\t\tclaimsKind: spec.claimsKind,\n\t\t\tstoredAs: spec.storedAs,\n\t\t\tnormalize,\n\t\t\tcatalogParams,\n\t\t\trender: spec.render,\n\t\t\tfromReported: spec.fromReported,\n\t\t\tnameIsCatalogText: spec.nameIsCatalogText === true\n\t\t}\n\t};\n\tcheckNormalFormsWritten(type);\n\treturn type;\n}\n/** Whether the name of `type` is the text the database catalog prints, as declared by {@link SqlDataTypeSpec.nameIsCatalogText}. */\nfunction nameIsCatalogText(type) {\n\treturn type.sql.nameIsCatalogText;\n}\n/** Whether `type` is a data type a SQL column can have. `sql/expression` is the one data type no column has. */\nfunction isSqlDataType(type) {\n\treturn \"sql\" in type;\n}\nfunction presentKeys(params) {\n\treturn Object.keys(params).filter((key) => params[key] !== void 0);\n}\nfunction formatKeys(keys) {\n\treturn `[${[...keys].sort().join(\", \")}]`;\n}\n/** The parameters, when `type` accepts them; otherwise `CONTRACT.TYPE_PARAMS_INVALID` naming each parameter it refuses. */\nfunction validateSqlTypeParams(type, params) {\n\tassertDataTypeParams(type, params);\n\treturn blindCast(params);\n}\nfunction pickText(type, mark, keys) {\n\tconst candidates = type.sql.texts.filter((text) => text[mark] === true);\n\tconst wanted = [...keys].sort().join(\",\");\n\tconst found = candidates.find((text) => placeholderSetOf(text.text) === wanted);\n\tif (found !== void 0) return found;\n\tconst verb = mark === \"written\" ? \"written\" : \"reported\";\n\tconst takes = candidates.length === 0 ? `it is never ${verb}` : `it is ${verb} with ${candidates.map((text) => formatKeys(placeholdersOf(text.text))).join(\", \")}`;\n\tthrow contractError(\"CONTRACT.TYPE_PARAMS_INVALID\", `${type.id} cannot be ${verb} with parameters ${formatKeys(keys)}; ${takes}`, { meta: {\n\t\tdataType: type.id,\n\t\tparameters: [...keys]\n\t} });\n}\nfunction substitute(type, text, params) {\n\treturn (text.display ?? text.text).replace(PLACEHOLDER, (_, name) => {\n\t\tconst value = params[name];\n\t\tif (!Number.isSafeInteger(value)) throw contractError(\"CONTRACT.TYPE_PARAMS_INVALID\", `${type.id}: the parameter ${name} is written into the type name and must be an integer`, { meta: {\n\t\t\tdataType: type.id,\n\t\t\tparameters: [name]\n\t\t} });\n\t\treturn String(value);\n\t});\n}\n/**\n* The name of `type` with no parameters, for places where parameters must not appear, such as a\n* cast. A type whose name is its catalog text has none: its parameters cannot be separated from its\n* name, so it is refused.\n*/\nfunction sqlBaseName(type, params) {\n\tif (type.sql.nameIsCatalogText) throw new InternalError(`Data type ${type.id} names its type by its catalog text, so it has no base name.`);\n\tif (type.sql.render !== void 0) return type.sql.render(validateSqlTypeParams(type, params));\n\tconst fewest = type.sql.texts.filter((text) => text.written === true).reduce((best, text) => best === void 0 || placeholdersOf(text.text).length < placeholdersOf(best.text).length ? text : best, void 0);\n\tif (fewest === void 0) throw new InternalError(`Data type ${type.id} has no written text and no render, so it has no base name.`);\n\tconst name = fewest.display ?? fewest.text;\n\tif (placeholdersOf(fewest.text).length === 0) return name;\n\tconst bracket = name.indexOf(\"(\");\n\treturn bracket === -1 ? name : name.slice(0, bracket);\n}\n/**\n* The base name of `type` with `params`, unquoted, for display. It differs from {@link sqlBaseName}\n* for a type that claims a kind, where it is the `typeName` parameter as written (`app.status`)\n* while `sqlBaseName` gives the quoted name `render` writes into SQL (`\"app\".\"status\"`), and for a\n* type whose name is its catalog text, where it is that whole text.\n*/\nfunction unquotedSqlBaseName(type, params) {\n\tif (type.sql.nameIsCatalogText) return renderSqlTypeName(type, params);\n\tif (type.sql.claimsKind === void 0) return sqlBaseName(type, params);\n\tconst { typeName } = validateSqlTypeParams(type, params);\n\tif (typeof typeName !== \"string\") throw new InternalError(`Data type ${type.id} claims the kind \"${type.sql.claimsKind}\" but declares no string typeName parameter.`);\n\treturn typeName;\n}\nconst ADD_THE_CODEC_PACK = \"Add the pack that provides the codec, and so declares its data type, to the configuration: to `extensions` in prisma.config or in defineContract.\";\n/** The SQL data type the codec `codecId` represents. */\nfunction sqlDataTypeOfCodec(codecId, lookups) {\n\tconst descriptor = lookups.codecLookup.descriptorFor(codecId);\n\tif (descriptor === void 0) throw contractError(\"CONTRACT.CODEC_DESCRIPTOR_MISSING\", `No codec \"${codecId}\" is registered, so its column type cannot be named.`, {\n\t\tfix: ADD_THE_CODEC_PACK,\n\t\tmeta: { codecId }\n\t});\n\tconst type = lookups.dataTypeLookup.get(descriptor.dataType);\n\tif (type === void 0) throw contractError(\"CONTRACT.DATA_TYPE_UNREGISTERED\", `Codec \"${codecId}\" represents data type \"${descriptor.dataType}\", which no component registers.`, {\n\t\tfix: ADD_THE_CODEC_PACK,\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\tdataType: descriptor.dataType\n\t\t}\n\t});\n\tif (!isSqlDataType(type)) throw new InternalError(`Data type ${type.id} is not a SQL data type, so it has no type name.`);\n\treturn type;\n}\n/**\n* The length of a column of data type `type` with `typeParams`, in the type's normal form, as verify compares it: a bare Postgres `character` holds 1. `undefined` when the column has no length, or when its data type drops the length because the database does not limit it, as SQLite's text types do.\n*/\nfunction sqlColumnLength(type, typeParams) {\n\tif (type === void 0 || !isSqlDataType(type)) return void 0;\n\tconst length = type.sql.normalize(dataTypeParams(type, typeParams ?? {}))[\"length\"];\n\treturn typeof length === \"number\" ? length : void 0;\n}\n/** The length of a column of `codecId` in its data type's normal form, or `undefined` for a column with no length or one whose database does not limit it. */\nfunction sqlCodecColumnLength(dataTypes, codecId, typeParams) {\n\tconst dataTypeId = dataTypes.dataTypeOfCodec(codecId);\n\treturn sqlColumnLength(dataTypeId === void 0 ? void 0 : dataTypes.lookup.get(dataTypeId), typeParams);\n}\n/** The type a column of `type` is stored as, whose name DDL writes and the database reports: `type` itself unless it names another. */\nfunction sqlStorageType(type, lookup) {\n\tif (type.sql.storedAs === void 0) return type;\n\tconst storage = lookup.get(type.sql.storedAs);\n\tif (storage === void 0 || !isSqlDataType(storage)) throw contractError(\"CONTRACT.DATA_TYPE_UNREGISTERED\", `Data type \"${type.id}\" is stored as \"${type.sql.storedAs}\", which no component registers as a SQL data type.`, { meta: {\n\t\tdataType: type.sql.storedAs,\n\t\tstoredBy: type.id\n\t} });\n\treturn storage;\n}\n/** The id of the type a column of the data type `dataTypeId` is stored as: {@link sqlStorageType} of it, which refuses a storage type the lookup does not register, or `dataTypeId` itself when the lookup does not know it as a SQL data type. */\nfunction sqlStorageTypeId(dataTypeId, lookup) {\n\tconst type = lookup.get(dataTypeId);\n\treturn type !== void 0 && isSqlDataType(type) ? sqlStorageType(type, lookup).id : dataTypeId;\n}\n/** The type a column is stored as, with its parameters in normal form, or the column's own id and parameters as written when the lookup does not know its data type as a SQL data type. */\nfunction storedColumnType(column, lookup) {\n\tconst type = lookup.get(column.dataType);\n\tif (type === void 0 || !isSqlDataType(type)) return {\n\t\tid: column.dataType,\n\t\tparams: column.typeParams ?? {}\n\t};\n\tconst storage = sqlStorageType(type, lookup);\n\treturn {\n\t\tid: storage.id,\n\t\tparams: storage.sql.normalize(dataTypeParams(storage, column.typeParams ?? {}))\n\t};\n}\n/**\n* Whether two contract columns have the same type: the types their data types are stored as are one type, those types' parameters are equal in normal form, and both or neither are lists. ADR 254.\n*/\nfunction sameSqlColumnType(a, b, lookup) {\n\tconst isList = (column) => column.many !== void 0 && column.many !== false;\n\tconst left = storedColumnType(a, lookup);\n\tconst right = storedColumnType(b, lookup);\n\treturn left.id === right.id && canonicalizeJson(left.params) === canonicalizeJson(right.params) && isList(a) === isList(b);\n}\n/** The type a column of the codec `codecId` is stored as: {@link sqlStorageType} of the data type it represents. */\nfunction sqlStorageTypeOfCodec(codecId, lookups) {\n\treturn sqlStorageType(sqlDataTypeOfCodec(codecId, lookups), lookups.dataTypeLookup);\n}\n/** {@link unquotedSqlBaseName} of the type a column of the codec `codecId` is stored as. */\nfunction unquotedSqlBaseNameOfCodec(codecId, typeParams, lookups) {\n\tconst type = sqlStorageTypeOfCodec(codecId, lookups);\n\treturn unquotedSqlBaseName(type, dataTypeParams(type, typeParams));\n}\n/** The text a migration writes for `type` with the raw `params`. */\nfunction renderSqlTypeName(type, params) {\n\tconst validated = validateSqlTypeParams(type, params);\n\tif (type.sql.render !== void 0) return type.sql.render(validated);\n\tconst normalized = type.sql.normalize(validated);\n\treturn substitute(type, pickText(type, \"written\", presentKeys(params).filter((key) => Object.hasOwn(normalized, key))), params);\n}\n/** The text the database catalog prints for `type` with `params` as written, from the parameters its catalog prints for them ({@link SqlDataTypeFacts.catalogParams}). */\nfunction renderSqlCatalogText(type, params) {\n\tconst validated = validateSqlTypeParams(type, params);\n\tif (type.sql.claimsKind !== void 0) throw new InternalError(`Data type ${type.id} claims the kind \"${type.sql.claimsKind}\" and has no catalog text.`);\n\tif (type.sql.render !== void 0) return type.sql.render(validated);\n\tconst printed = type.sql.catalogParams(validated);\n\treturn substitute(type, pickText(type, \"catalog\", presentKeys(printed)), printed);\n}\nfunction prepareReportedText(text) {\n\tlet prepared = \"\";\n\tlet quoted = false;\n\tlet spacePending = false;\n\tfor (const character of text.trim()) {\n\t\tif (!quoted && /\\s/.test(character)) {\n\t\t\tspacePending = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (spacePending && !/[(,]$/.test(prepared) && character !== \")\") prepared += \" \";\n\t\tspacePending = false;\n\t\tif (character === \"\\\"\") quoted = !quoted;\n\t\tprepared += quoted ? character : character.toLowerCase();\n\t}\n\treturn prepared;\n}\nfunction claims(text) {\n\treturn text.catalog === true || text.written !== true;\n}\nfunction claimingTexts(type) {\n\treturn type.sql.texts.filter(claims).map((text) => text.text);\n}\nfunction textsCollide(a, b) {\n\tconst withOnes = (text) => text.replace(PLACEHOLDER, \"1\");\n\treturn patternOf(a).test(withOnes(b)) || patternOf(b).test(withOnes(a));\n}\nfunction collisionBetween(first, second) {\n\tconst kind = first.sql.claimsKind;\n\tif (kind !== void 0 && kind === second.sql.claimsKind) return {\n\t\tby: \"kind\",\n\t\tkind\n\t};\n\tfor (const a of claimingTexts(first)) {\n\t\tconst b = claimingTexts(second).find((text) => textsCollide(a, text));\n\t\tif (b !== void 0) return {\n\t\t\tby: \"text\",\n\t\t\tfirst: a,\n\t\t\tsecond: b\n\t\t};\n\t}\n}\n/**\n* The first two SQL data types in `types` that would both recognise one reported type: a claiming\n* text of each collides, or both claim the same kind. Two texts collide when either one's pattern\n* matches the other with each placeholder written as 1.\n*/\nfunction findSqlDataTypeCollision(types) {\n\tconst sqlTypes = types.filter(isSqlDataType);\n\tfor (const [index, first] of sqlTypes.entries()) for (const second of sqlTypes.slice(index + 1)) {\n\t\tconst claims = collisionBetween(first, second);\n\t\tif (claims !== void 0) return {\n\t\t\tfirst,\n\t\t\tsecond,\n\t\t\tclaims\n\t\t};\n\t}\n}\n/**\n* The data type that claims a reported type, with its parameters in normal form, or undefined when\n* no type in `dataTypes` claims it or its parameters fail the type's schema.\n*/\nfunction resolveReportedSqlType(reported, dataTypes) {\n\tconst sqlTypes = dataTypes.filter(isSqlDataType);\n\tif (reported.kind !== void 0) {\n\t\tconst claimant = sqlTypes.find((type) => type.sql.claimsKind === reported.kind);\n\t\tif (claimant === void 0) return void 0;\n\t\treturn resolvedWith(claimant, claimant.sql.fromReported?.(reported) ?? {});\n\t}\n\tconst text = prepareReportedText(reported.text);\n\tfor (const type of sqlTypes) for (const candidate of type.sql.texts) {\n\t\tif (!claims(candidate)) continue;\n\t\tconst params = paramsMatching(type, candidate, text);\n\t\tif (params !== void 0) return resolvedWith(type, params);\n\t}\n}\nconst signedParamKeysByType = /* @__PURE__ */ new WeakMap();\n/** The parameters of `type` that may be negative, whose placeholders read a leading minus. */\nfunction signedParamKeys(type) {\n\tconst known = signedParamKeysByType.get(type);\n\tif (known !== void 0) return known;\n\tconst keys = schemaKeysAllowing(type.params, -1) ?? [];\n\tsignedParamKeysByType.set(type, keys);\n\treturn keys;\n}\nfunction paramsMatching(type, candidate, text) {\n\tconst match = patternOf(candidate.text, signedParamKeys(type)).exec(text);\n\tif (match === null) return void 0;\n\treturn Object.fromEntries(placeholdersOf(candidate.text).map((name, index) => [name, Number.parseInt(match[index + 1] ?? \"\", 10)]));\n}\n/**\n* Every data type in `dataTypes` that reads `text` as a migration may write it, with its parameters\n* in normal form and as written: any of a type's texts counts, whether written, printed by the catalog or only\n* claimed. Empty when no type reads it or its parameters fail the type's schema. A type that claims\n* a kind has no texts, so it never reads one.\n*/\nfunction resolveWrittenSqlTypes(text, dataTypes) {\n\tconst prepared = prepareReportedText(text);\n\treturn dataTypes.filter(isSqlDataType).flatMap((type) => {\n\t\tfor (const candidate of type.sql.texts) {\n\t\t\tconst params = paramsMatching(type, candidate, prepared);\n\t\t\tif (params === void 0) continue;\n\t\t\tconst resolved = resolvedWith(type, params);\n\t\t\tif (resolved !== void 0) return [{\n\t\t\t\t...resolved,\n\t\t\t\twrittenTypeParams: params\n\t\t\t}];\n\t\t}\n\t\treturn [];\n\t});\n}\nfunction resolvedWith(type$1, params) {\n\tif (type$1.params !== void 0 && type$1.params(params) instanceof type.errors) return void 0;\n\treturn {\n\t\tdataType: type$1,\n\t\ttypeParams: type$1.sql.normalize(params)\n\t};\n}\n//#endregion\nexport { unquotedSqlBaseName as _, renderSqlTypeName as a, sameSqlColumnType as c, sqlColumnLength as d, sqlDataType as f, sqlStorageTypeOfCodec as g, sqlStorageTypeId as h, renderSqlCatalogText as i, sqlBaseName as l, sqlStorageType as m, isSqlDataType as n, resolveReportedSqlType as o, sqlDataTypeOfCodec as p, nameIsCatalogText as r, resolveWrittenSqlTypes as s, findSqlDataTypeCollision as t, sqlCodecColumnLength as u, unquotedSqlBaseNameOfCodec as v, validateSqlTypeParams as y };\n\n//# sourceMappingURL=sql-data-type-LVBldu1a.mjs.map"],"mappings":";;;;;;;;AAQA,MAAM,cAAc;AACpB,MAAM,qBAAqB;AAC3B,MAAM,iBAAiB;AACvB,SAAS,YAAY,IAAI,QAAQ;CAChC,IAAI,WAAW,KAAK,GAAG,OAAO,CAAC;CAC/B,MAAM,OAAO,iBAAiB,MAAM;CACpC,IAAI,SAAS,KAAK,GAAG,kBAAkB,IAAI,wDAAwD;CACnG,OAAO;AACR;AACA,SAAS,eAAe,MAAM;CAC7B,OAAO,CAAC,GAAG,KAAK,SAAS,WAAW,CAAC,CAAC,CAAC,KAAK,UAAU,MAAM,MAAM,EAAE;AACrE;AACA,SAAS,iBAAiB,MAAM;CAC/B,OAAO,CAAC,GAAG,eAAe,IAAI,CAAC,CAAC,CAAC,KAAK,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,IAAI,aAAa,KAAK,GAAG,OAAO,CAAC;IAChC,GAAG;IACH,mBAAmB;GACpB,CAAC;EACF;EACA,OAAO,CAAC;CACT,CAAC;AACF;AACA,SAAS,aAAa,QAAQ,QAAQ;CACrC,IAAI,OAAO,WAAW,KAAK,KAAK,OAAO,OAAO,MAAM,aAAa,KAAK,QAAQ,OAAO,KAAK;CAC1F,OAAO;EACN,UAAU;EACV,YAAY,OAAO,IAAI,UAAU,MAAM;CACxC;AACD"}
@@ -1,4 +1,4 @@
1
- import { h as AnyQueryAst } from "./types-ijhejJhK-EdACW3bY.mjs";
1
+ import { h as AnyQueryAst } from "./types-ijhejJhK-BqfwP5Cc.mjs";
2
2
  import { ExecutionPlan } from "@prisma/orm-framework/components/runtime";
3
3
  //#region ../../../2-sql-family/4-lanes/relational-core/dist/sql-execution-plan-CN-FEwrR.d.mts
4
4
  //#region src/sql-execution-plan.d.ts
@@ -28,4 +28,4 @@ interface SqlExecutionPlan<Row = unknown> extends ExecutionPlan<Row> {
28
28
  }
29
29
  //#endregion
30
30
  export { SqlExecutionPlan as t };
31
- //# sourceMappingURL=sql-execution-plan-CN-FEwrR-CzRFoxKR.d.mts.map
31
+ //# sourceMappingURL=sql-execution-plan-CN-FEwrR-BEJ0-g83.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sql-execution-plan-CN-FEwrR-CzRFoxKR.d.mts","names":[],"sources":["../../../../2-sql-family/4-lanes/relational-core/dist/sql-execution-plan-CN-FEwrR.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UAsBU,iBAAiB,uBAAuB,cAAc;WACrD;WACA;WACA,KAAK"}
1
+ {"version":3,"file":"sql-execution-plan-CN-FEwrR-BEJ0-g83.d.mts","names":[],"sources":["../../../../2-sql-family/4-lanes/relational-core/dist/sql-execution-plan-CN-FEwrR.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UAsBU,iBAAiB,uBAAuB,cAAc;WACrD;WACA;WACA,KAAK"}
@@ -1,6 +1,6 @@
1
1
  import { DataTypeAuthoringEntry } from "@prisma/orm-framework/components/authoring";
2
- import { DataType, DataTypeId } from "@prisma/orm-framework/components/codec";
3
2
  import { JsonValue } from "@prisma/orm-framework/contract/types";
3
+ import { DataType, DataTypeId } from "@prisma/orm-framework/components/codec";
4
4
  //#region ../../../2-sql-family/1-core/contract/dist/sql-expression.d.mts
5
5
  //#region src/sql-expression.d.ts
6
6
  declare const SQL_EXPRESSION_DATA_TYPE_ID: DataTypeId;
@@ -59,4 +59,4 @@ declare function sql(strings: TemplateStringsArray, ...values: readonly SqlExpre
59
59
  declare function requireSqlExpression(value: unknown, what: string): SqlExpression;
60
60
  //#endregion
61
61
  export { assertNothingCastsFromSqlExpression as a, readSqlExpression as c, sqlExpressionAuthoringEntry as d, sqlExpressionDataType as f, storedSqlText as g, sqlTextsReadBack as h, SqlExpressionRegistration as i, requireSqlExpression as l, sqlTextFromStored as m, SQL_EXPRESSION_TAG as n, isSqlExpression as o, sqlExpressionRegistration as p, SqlExpression as r, printSqlExpressionLiteral as s, SQL_EXPRESSION_DATA_TYPE_ID as t, sql as u };
62
- //# sourceMappingURL=sql-expression-B4BrhGPi.d.mts.map
62
+ //# sourceMappingURL=sql-expression-1yO8GiBc.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sql-expression-B4BrhGPi.d.mts","names":[],"sources":["../../../../2-sql-family/1-core/contract/dist/sql-expression.d.mts"],"mappings":";;;;;cAIc,6BAA6B;cAC7B;;cAEA,uBAAuB;;cAEvB,6BAA6B;UACjC;WACC,oBAAoB;WACpB;aACE,WAAW,SAAS,eAAe;;;;cAIlC,2BAA2B;;iBAExB,kBAAkB,OAAO;;iBAEzB,cAAc;;;;;iBAKd,0BAA0B;;iBAE1B,iBAAiB;;;;;;iBAMjB,oCAAoC,mBAAmB;WAC7D,MAAM;WACN;;cAEG;;cAEA;YACF;WACD;;EAET,YAAY;;;iBAGG,gBAAgB,iBAAiB,SAAS;;;;;;iBAM1C,kBAAkB,iBAAiB;;iBAEnC,IAAI,SAAS,yBAAyB,iBAAiB,kBAAkB;;iBAEzE,qBAAqB,gBAAgB,eAAe"}
1
+ {"version":3,"file":"sql-expression-1yO8GiBc.d.mts","names":[],"sources":["../../../../2-sql-family/1-core/contract/dist/sql-expression.d.mts"],"mappings":";;;;;cAIc,6BAA6B;cAC7B;;cAEA,uBAAuB;;cAEvB,6BAA6B;UACjC;WACC,oBAAoB;WACpB;aACE,WAAW,SAAS,eAAe;;;;cAIlC,2BAA2B;;iBAExB,kBAAkB,OAAO;;iBAEzB,cAAc;;;;;iBAKd,0BAA0B;;iBAE1B,iBAAiB;;;;;;iBAMjB,oCAAoC,mBAAmB;WAC7D,MAAM;WACN;;cAEG;;cAEA;YACF;WACD;;EAET,YAAY;;;iBAGG,gBAAgB,iBAAiB,SAAS;;;;;;iBAM1C,kBAAkB,iBAAiB;;iBAEnC,IAAI,SAAS,yBAAyB,iBAAiB,kBAAkB;;iBAEzE,qBAAqB,gBAAgB,eAAe"}
@@ -1,5 +1,5 @@
1
1
  import { t as SqlNode } from "./sql-node-kEz6YFZo-1ogT6Cxt.mjs";
2
- import { r as SqlObjectNaming } from "./naming-BcD36g9T-Mfe_xGGL.mjs";
2
+ import { i as SqlObjectNaming } from "./naming-CLfASFf7-HRjmKe43.mjs";
3
3
  //#region ../../../2-sql-family/1-core/contract/dist/sql-index-ByAAE7K8.d.mts
4
4
  //#region src/ir/sql-index.d.ts
5
5
  /**
@@ -70,4 +70,4 @@ declare class Index extends SqlNode {
70
70
  }
71
71
  //#endregion
72
72
  export { IndexElements as n, IndexInput as r, Index as t };
73
- //# sourceMappingURL=sql-index-ByAAE7K8-Dqtn_vUL.d.mts.map
73
+ //# sourceMappingURL=sql-index-ByAAE7K8-4TUFKGLK.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sql-index-ByAAE7K8-Dqtn_vUL.d.mts","names":[],"sources":["../../../../2-sql-family/1-core/contract/dist/sql-index-ByAAE7K8.d.mts"],"mappings":";;;;;;;;;;;KAUK;;WAEM;WACA;;WAEA;;;;;WAKA;;;;;;;;KAQN,aAAa;;WAEP,QAAQ;;WAER;;WAEA;WACA;WACA,SAAS;;;;;;;;;;;;;;;;;;;;cAoBN,cAAc;WACjB;WACA;;WAEA;WACA;WACA;WACA;WACA;WACA,UAAU;EACnB,YAAY,OAAO;SACZ,KAAK,OAAO,QAAQ,aAAa"}
1
+ {"version":3,"file":"sql-index-ByAAE7K8-4TUFKGLK.d.mts","names":[],"sources":["../../../../2-sql-family/1-core/contract/dist/sql-index-ByAAE7K8.d.mts"],"mappings":";;;;;;;;;;;KAUK;;WAEM;WACA;;WAEA;;;;;WAKA;;;;;;;;KAQN,aAAa;;WAEP,QAAQ;;WAER;;WAEA;WACA;WACA,SAAS;;;;;;;;;;;;;;;;;;;;cAoBN,cAAc;WACjB;WACA;;WAEA;WACA;WACA;WACA;WACA;WACA,UAAU;EACnB,YAAY,OAAO;SACZ,KAAK,OAAO,QAAQ,aAAa"}
@@ -0,0 +1,50 @@
1
+ import { IRNodeBase } from "@prisma/orm-framework/components/ir";
2
+ //#region ../../../2-sql-family/1-core/contract/dist/sql-node-D8P0akYY.mjs
3
+ /**
4
+ * SQL family IR node base. Carries the family-level `kind` discriminator
5
+ * `'sql'` and inherits the framework's `freezeNode` affordance.
6
+ *
7
+ * Single family-level discriminator (not per-leaf) reflects the fact that
8
+ * SQL IR has no polymorphic dispatch today — verifiers and serializers
9
+ * walk by structural position (`storage.tables[name].columns[name]`),
10
+ * not by inspecting `kind`. The abstract bar for per-leaf discriminators
11
+ * isn't earned until a future polymorphic consumer arrives.
12
+ *
13
+ * `kind` is installed as a non-enumerable own property on every instance,
14
+ * which keeps three things clean simultaneously:
15
+ *
16
+ * - `JSON.stringify(node)` produces the canonical pre-lift JSON envelope
17
+ * shape (no `kind` field), so emitted contract.json files and the
18
+ * `validateSqlContractFully` arktype schemas stay unchanged.
19
+ * - Test assertions that use `toEqual({...})` against the pre-lift flat
20
+ * shape continue to pass — only enumerable own properties are
21
+ * compared.
22
+ * - Direct access (`node.kind`) and runtime narrowing
23
+ * (`if (node.kind === 'sql')`) still work, so future polymorphic
24
+ * dispatch can begin reading `kind` without a runtime change.
25
+ *
26
+ * Future per-leaf overrides land cleanly: a class that gains a
27
+ * polymorphic-dispatch consumer (e.g. an enum type instance walked
28
+ * alongside other types) overrides `kind` with its narrower literal
29
+ * at that leaf level. Per-leaf overrides will use enumerable kind
30
+ * (matching the Mongo per-class-discriminator precedent) because they
31
+ * encode dispatch-relevant information that callers need to see in
32
+ * JSON envelopes; the family-level `'sql'` is uniform across all SQL
33
+ * IR and carries no dispatch-relevant information.
34
+ */
35
+ var SqlNode = class extends IRNodeBase {
36
+ kind;
37
+ constructor() {
38
+ super();
39
+ Object.defineProperty(this, "kind", {
40
+ value: "sql",
41
+ writable: false,
42
+ enumerable: false,
43
+ configurable: true
44
+ });
45
+ }
46
+ };
47
+ //#endregion
48
+ export { SqlNode as t };
49
+
50
+ //# sourceMappingURL=sql-node-D8P0akYY-RVytYXDZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-node-D8P0akYY-RVytYXDZ.mjs","names":[],"sources":["../../../../2-sql-family/1-core/contract/dist/sql-node-D8P0akYY.mjs"],"sourcesContent":["import { IRNodeBase } from \"@internal/framework-components/ir\";\n//#region src/ir/sql-node.ts\n/**\n* SQL family IR node base. Carries the family-level `kind` discriminator\n* `'sql'` and inherits the framework's `freezeNode` affordance.\n*\n* Single family-level discriminator (not per-leaf) reflects the fact that\n* SQL IR has no polymorphic dispatch today — verifiers and serializers\n* walk by structural position (`storage.tables[name].columns[name]`),\n* not by inspecting `kind`. The abstract bar for per-leaf discriminators\n* isn't earned until a future polymorphic consumer arrives.\n*\n* `kind` is installed as a non-enumerable own property on every instance,\n* which keeps three things clean simultaneously:\n*\n* - `JSON.stringify(node)` produces the canonical pre-lift JSON envelope\n* shape (no `kind` field), so emitted contract.json files and the\n* `validateSqlContractFully` arktype schemas stay unchanged.\n* - Test assertions that use `toEqual({...})` against the pre-lift flat\n* shape continue to pass — only enumerable own properties are\n* compared.\n* - Direct access (`node.kind`) and runtime narrowing\n* (`if (node.kind === 'sql')`) still work, so future polymorphic\n* dispatch can begin reading `kind` without a runtime change.\n*\n* Future per-leaf overrides land cleanly: a class that gains a\n* polymorphic-dispatch consumer (e.g. an enum type instance walked\n* alongside other types) overrides `kind` with its narrower literal\n* at that leaf level. Per-leaf overrides will use enumerable kind\n* (matching the Mongo per-class-discriminator precedent) because they\n* encode dispatch-relevant information that callers need to see in\n* JSON envelopes; the family-level `'sql'` is uniform across all SQL\n* IR and carries no dispatch-relevant information.\n*/\nvar SqlNode = class extends IRNodeBase {\n\tkind;\n\tconstructor() {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"sql\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t}\n};\n//#endregion\nexport { SqlNode as t };\n\n//# sourceMappingURL=sql-node-D8P0akYY.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAI,UAAU,cAAc,WAAW;CACtC;CACA,cAAc;EACb,MAAM;EACN,OAAO,eAAe,MAAM,QAAQ;GACnC,OAAO;GACP,UAAU;GACV,YAAY;GACZ,cAAc;EACf,CAAC;CACF;AACD"}
@@ -1,10 +1,10 @@
1
1
  import { t as SqlNode } from "./sql-node-kEz6YFZo-1ogT6Cxt.mjs";
2
- import { r as StorageTable } from "./storage-table-Bf1ZjnxO-pUj6pyP0.mjs";
2
+ import { a as StorageValueObject, r as StorageTable } from "./storage-value-object-BcvIeUr8-DiiZNIrZ.mjs";
3
3
  import { t as StorageValueSet } from "./storage-value-set-BGlj5Uus-ny2k-0PA.mjs";
4
4
  import { AuthoringContributions } from "@prisma/orm-framework/components/authoring";
5
5
  import { Namespace, NamespaceBase, Storage, StorageType } from "@prisma/orm-framework/components/ir";
6
6
  import { StorageHashBase } from "@prisma/orm-framework/contract/types";
7
- //#region ../../../2-sql-family/1-core/contract/dist/sql-storage-DeCAh5Hi.d.mts
7
+ //#region ../../../2-sql-family/1-core/contract/dist/sql-storage-B_AM6tU1.d.mts
8
8
  //#region src/ir/storage-type-instance.d.ts
9
9
  /**
10
10
  * Sentinel kind for the legacy codec-triple shape persisted under
@@ -111,13 +111,14 @@ interface SqlStorageInput<THash extends string = string> {
111
111
  */
112
112
  /**
113
113
  * The typed `entries` shape for SQL family namespaces. The open dictionary
114
- * is intersected with optional known-kind maps so that `ns.entries.table`
115
- * and `ns.entries.valueSet` resolve without a cast, while unknown pack-
114
+ * is intersected with optional known-kind maps so that `ns.entries.table`,
115
+ * `ns.entries.valueSet` and `ns.entries.valueObject` resolve without a cast, while unknown pack-
116
116
  * contributed kinds remain valid (the `Record` part allows any string key).
117
117
  */
118
118
  type SqlNamespaceEntries = Readonly<Record<string, Readonly<Record<string, unknown>>>> & {
119
119
  readonly table?: Readonly<Record<string, StorageTable>>;
120
120
  readonly valueSet?: Readonly<Record<string, StorageValueSet>>;
121
+ readonly valueObject?: Readonly<Record<string, StorageValueObject>>;
121
122
  };
122
123
  /**
123
124
  * Structural interface for SQL family namespaces. Generated `.d.ts` contract
@@ -165,4 +166,4 @@ declare class SqlStorage<THash extends string = string> extends SqlNode implemen
165
166
  }
166
167
  //#endregion
167
168
  export { nonEmptyTypeParams as _, SqlNamespaceBase as a, SqlNamespaceInput as c, SqlStorageTypeEntry as d, StorageTypeInstance as f, isStorageTypeInstance as g, isSqlAuthoringContributions as h, SqlNamespace as i, SqlStorage as l, isMaterializedSqlNamespace as m, CODEC_INSTANCE_KIND as n, SqlNamespaceEntries as o, StorageTypeInstanceInput as p, SqlAuthoringContributions as r, SqlNamespaceFactory as s, AuthoredStorageTypeInstance as t, SqlStorageInput as u, toStorageTypeInstance as v };
168
- //# sourceMappingURL=sql-storage-DeCAh5Hi-CEM-m8cs.d.mts.map
169
+ //# sourceMappingURL=sql-storage-B_AM6tU1-BOPQxXo7.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sql-storage-DeCAh5Hi-CEM-m8cs.d.mts","names":[],"sources":["../../../../2-sql-family/1-core/contract/dist/sql-storage-DeCAh5Hi.d.mts"],"mappings":";;;;;;;;;;;;;;;cAcc;;;;UAIJ,4BAA4B;WAC3B,aAAa;WACb;WACA;WACA,YAAY;;;;;KAKlB,8BAA8B,KAAK;;;;KAInC,2BAA2B,KAAK;WAC1B,aAAa;;;;;;;iBAOP,sBAAsB,OAAO,2BAA2B;;;;iBAIxD,mBAAmB,YAAY,sCAAsC;;;;;;iBAMrE,sBAAsB,iBAAiB,SAAS;;;;;;;;;;KAU5D,sBAAsB,sBAAsB;UACvC;WACC;WACA,SAAS,SAAS,eAAe,SAAS;;;;;;KAMhD,uBAAuB,OAAO,sBAAsB;;;;;;;;UAQ/C,kCAAkC;WACjC,kBAAkB;;;;;;iBAMZ,4BAA4B,WAAW,qCAAqC,aAAa;UAChG,gBAAgB;WACf,aAAa,gBAAgB;WAC7B,QAAQ,eAAe;WACvB,YAAY,SAAS,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6B1C,sBAAsB,SAAS,eAAe,SAAS;WACjD,QAAQ,SAAS,eAAe;WAChC,WAAW,SAAS,eAAe;;;;;;;;;;;UAWpC;WACC;WACA;WACA,SAAS;WACT;EACT,cAAc;;;;;;;;uBAQO,yBAAyB,yBAAyB;oBACrD;oBACA,SAAS;WAClB,aAAa;;;;;;;;;;;;iBAYP,2BAA2B,aAAa,KAAK;cAChD,WAAW,uCAAuC,mBAAmB;WACxE,aAAa,gBAAgB;WAC7B,YAAY,SAAS,eAAe;WACpC,QAAQ,SAAS,eAAe;EACzC,YAAY,OAAO,gBAAgB"}
1
+ {"version":3,"file":"sql-storage-B_AM6tU1-BOPQxXo7.d.mts","names":[],"sources":["../../../../2-sql-family/1-core/contract/dist/sql-storage-B_AM6tU1.d.mts"],"mappings":";;;;;;;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