@prisma/orm-family-sql 8.0.0-rc.1-dev.2 → 8.0.0-rc.1-dev.3

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 (227) hide show
  1. package/dist/{ast-Bb6loOw9.d.mts → ast-UfF480P2.d.mts} +3 -3
  2. package/dist/{ast-Bb6loOw9.d.mts.map → ast-UfF480P2.d.mts.map} +1 -1
  3. package/dist/{authoring-type-constructors-Blqoa2Ua-DyCmD6mp.mjs → authoring-type-constructors-Blqoa2Ua-DymjrX_a.mjs} +2 -2
  4. package/dist/{authoring-type-constructors-Blqoa2Ua-DyCmD6mp.mjs.map → authoring-type-constructors-Blqoa2Ua-DymjrX_a.mjs.map} +1 -1
  5. package/dist/builder.d.mts +2 -2
  6. package/dist/builder__runtime.d.mts +9 -9
  7. package/dist/builder__runtime.mjs +1 -1
  8. package/dist/builder__types.d.mts +2 -2
  9. package/dist/{canonicalization-hooks-DfIc_lOO.mjs → canonicalization-hooks-dmXkOR4a.mjs} +6 -2
  10. package/dist/{canonicalization-hooks-DfIc_lOO.mjs.map → canonicalization-hooks-dmXkOR4a.mjs.map} +1 -1
  11. package/dist/{codec-descriptor-registry-BJVJRftS.mjs → codec-descriptor-registry-BK_ZTP-3.mjs} +2 -2
  12. package/dist/{codec-descriptor-registry-BJVJRftS.mjs.map → codec-descriptor-registry-BK_ZTP-3.mjs.map} +1 -1
  13. package/dist/{config-types-N7PJc6VN.mjs → config-types-1lEI_abO.mjs} +6 -7
  14. package/dist/config-types-1lEI_abO.mjs.map +1 -0
  15. package/dist/{config-types-DKKhWdzf.d.mts → config-types-DuhCZxnc.d.mts} +11 -4
  16. package/dist/config-types-DuhCZxnc.d.mts.map +1 -0
  17. package/dist/{contract-builder-Cj-lKWgM.d.mts → contract-builder-B5ztYYVI.d.mts} +7 -6
  18. package/dist/contract-builder-B5ztYYVI.d.mts.map +1 -0
  19. package/dist/{contract-builder-YjMQcvZ1.mjs → contract-builder-DQ02XiKy.mjs} +4 -4
  20. package/dist/contract-builder-DQ02XiKy.mjs.map +1 -0
  21. package/dist/contract-psl.d.mts +2 -2
  22. package/dist/contract-psl.mjs +1 -1
  23. package/dist/contract-psl__provider.d.mts +2 -2
  24. package/dist/contract-psl__provider.mjs +4 -4
  25. package/dist/contract-psl__provider.mjs.map +1 -1
  26. package/dist/contract-ts.d.mts +4 -3
  27. package/dist/contract-ts.mjs +4 -4
  28. package/dist/contract-ts__config-types.d.mts +1 -1
  29. package/dist/contract-ts__config-types.mjs +1 -1
  30. package/dist/contract-ts__contract-builder.d.mts +3 -2
  31. package/dist/contract-ts__contract-builder.mjs +3 -3
  32. package/dist/{contract-view-BbWQp6r4.d.mts → contract-view-DB7yHLAp.d.mts} +2 -2
  33. package/dist/{contract-view-BbWQp6r4.d.mts.map → contract-view-DB7yHLAp.d.mts.map} +1 -1
  34. package/dist/contract.d.mts +15 -15
  35. package/dist/contract.mjs +10 -10
  36. package/dist/contract__canonicalization-hooks.mjs +1 -1
  37. package/dist/contract__contract-view.d.mts +1 -1
  38. package/dist/contract__entity-kinds.d.mts +1 -1
  39. package/dist/contract__entity-kinds.mjs +1 -1
  40. package/dist/contract__factories.d.mts +1 -1
  41. package/dist/contract__factories.mjs +1 -1
  42. package/dist/contract__foreign-key-materialization.d.mts +1 -1
  43. package/dist/contract__foreign-key-materialization.mjs +1 -1
  44. package/dist/contract__index-naming.d.mts +1 -1
  45. package/dist/contract__index-naming.mjs +1 -1
  46. package/dist/contract__index-type-validation.d.mts +1 -1
  47. package/dist/contract__resolve-storage-table.d.mts +1 -1
  48. package/dist/contract__types.d.mts +7 -7
  49. package/dist/contract__types.mjs +4 -4
  50. package/dist/contract__validators.d.mts +1 -1
  51. package/dist/contract__validators.mjs +2 -2
  52. package/dist/{control-C1EmRznB.mjs → control-Bj2zT_YF.mjs} +16 -75
  53. package/dist/control-Bj2zT_YF.mjs.map +1 -0
  54. package/dist/{control-BWngBFMj.d.mts → control-JKCfuZLF.d.mts} +15 -19
  55. package/dist/{control-BWngBFMj.d.mts.map → control-JKCfuZLF.d.mts.map} +1 -1
  56. package/dist/control-adapter-BjSrEp2V.d.mts +1 -0
  57. package/dist/{control-adapter-C99J7aEF-Cmay9zFj.d.mts → control-adapter-C99J7aEF-BvoknoRl.d.mts} +8 -8
  58. package/dist/{control-adapter-C99J7aEF-Cmay9zFj.d.mts.map → control-adapter-C99J7aEF-BvoknoRl.d.mts.map} +1 -1
  59. package/dist/{db-B5PMfDDd-BsvBY8Wh.d.mts → db-B5PMfDDd-ZnA9Kuky.d.mts} +9 -9
  60. package/dist/{db-B5PMfDDd-BsvBY8Wh.d.mts.map → db-B5PMfDDd-ZnA9Kuky.d.mts.map} +1 -1
  61. package/dist/{ddl-types-h_3_pXmq-QBLq6WbP.d.mts → ddl-types-h_3_pXmq-DzkUGplM.d.mts} +3 -3
  62. package/dist/{ddl-types-h_3_pXmq-QBLq6WbP.d.mts.map → ddl-types-h_3_pXmq-DzkUGplM.d.mts.map} +1 -1
  63. package/dist/{build-contract-DBCz_YSs-DO0wMHai.mjs → derived-checks-BDG-r9XD-CrpFUaO7.mjs} +199 -17
  64. package/dist/derived-checks-BDG-r9XD-CrpFUaO7.mjs.map +1 -0
  65. package/dist/derived-checks-DPdD01O0-CXFJD5al.d.mts +21 -0
  66. package/dist/derived-checks-DPdD01O0-CXFJD5al.d.mts.map +1 -0
  67. package/dist/diff-B16bL_IR.mjs.map +1 -1
  68. package/dist/{diff-DnLtQXpg.d.mts → diff-DDfez6HZ.d.mts} +11 -11
  69. package/dist/{diff-DnLtQXpg.d.mts.map → diff-DDfez6HZ.d.mts.map} +1 -1
  70. package/dist/{entity-kinds-DKxwKolf-CcsY-iYV.mjs → entity-kinds-3IFQq7Ho-DB6IN-V6.mjs} +16 -15
  71. package/dist/entity-kinds-3IFQq7Ho-DB6IN-V6.mjs.map +1 -0
  72. package/dist/{entity-kinds-Dh6VH4uK.d.mts → entity-kinds-FB5fUkUH.d.mts} +9 -8
  73. package/dist/entity-kinds-FB5fUkUH.d.mts.map +1 -0
  74. package/dist/{expression-KPBpeH4T.d.mts → expression-CBHseNtv.d.mts} +5 -5
  75. package/dist/{expression-KPBpeH4T.d.mts.map → expression-CBHseNtv.d.mts.map} +1 -1
  76. package/dist/{factories-MfcqTt5R.d.mts → factories-BPmhxoFd.d.mts} +4 -4
  77. package/dist/{factories-MfcqTt5R.d.mts.map → factories-BPmhxoFd.d.mts.map} +1 -1
  78. package/dist/{factories-CDG9zBxC.mjs → factories-BtnISekg.mjs} +3 -3
  79. package/dist/{factories-CDG9zBxC.mjs.map → factories-BtnISekg.mjs.map} +1 -1
  80. package/dist/family.d.mts +12 -12
  81. package/dist/family.mjs +5 -5
  82. package/dist/family__control-adapter.d.mts +2 -2
  83. package/dist/family__control.d.mts +4 -4
  84. package/dist/family__control.mjs +3 -3
  85. package/dist/family__diff.d.mts +2 -2
  86. package/dist/family__diff.mjs +1 -1
  87. package/dist/family__ir.d.mts +1 -1
  88. package/dist/family__ir.mjs +1 -1
  89. package/dist/family__migration.d.mts +1 -1
  90. package/dist/family__pack.mjs +1 -1
  91. package/dist/family__psl-infer.d.mts +1 -1
  92. package/dist/family__psl-infer.mjs +1 -1
  93. package/dist/family__runtime.d.mts +2 -2
  94. package/dist/{foreign-key-materialization-Ca-wRbmj.d.mts → foreign-key-materialization-CetaZvuu.d.mts} +2 -2
  95. package/dist/{foreign-key-materialization-Ca-wRbmj.d.mts.map → foreign-key-materialization-CetaZvuu.d.mts.map} +1 -1
  96. package/dist/{foreign-key-materialization-HI7BIQrG.mjs → foreign-key-materialization-fH6cObko.mjs} +2 -2
  97. package/dist/{foreign-key-materialization-HI7BIQrG.mjs.map → foreign-key-materialization-fH6cObko.mjs.map} +1 -1
  98. package/dist/{index-BOhWLVvH.d.mts → index-COS9qF9d.d.mts} +16 -16
  99. package/dist/{index-BOhWLVvH.d.mts.map → index-COS9qF9d.d.mts.map} +1 -1
  100. package/dist/{index-BZF7Wehu.d.mts → index-avHHFCFT.d.mts} +3 -3
  101. package/dist/{index-BZF7Wehu.d.mts.map → index-avHHFCFT.d.mts.map} +1 -1
  102. package/dist/{index-naming-BZWoh45T.d.mts → index-naming-BfRyBZR4.d.mts} +2 -2
  103. package/dist/{index-naming-BZWoh45T.d.mts.map → index-naming-BfRyBZR4.d.mts.map} +1 -1
  104. package/dist/{index-naming-BoGBcMmI-DiJAr66H.mjs → index-naming-BoGBcMmI-DE0Eu71F.mjs} +2 -2
  105. package/dist/{index-naming-BoGBcMmI-DiJAr66H.mjs.map → index-naming-BoGBcMmI-DE0Eu71F.mjs.map} +1 -1
  106. package/dist/{index-type-validation-D_vuj-76.d.mts → index-type-validation-0NdkDB_n.d.mts} +3 -3
  107. package/dist/{index-type-validation-D_vuj-76.d.mts.map → index-type-validation-0NdkDB_n.d.mts.map} +1 -1
  108. package/dist/{interpreter-5WgpL-ax-_nqHLUTr.mjs → interpreter-5WgpL-ax-BIbrd_Xv.mjs} +3 -3
  109. package/dist/{interpreter-5WgpL-ax-_nqHLUTr.mjs.map → interpreter-5WgpL-ax-BIbrd_Xv.mjs.map} +1 -1
  110. package/dist/{ir-Cvj3eU-K.d.mts → ir-VWQX6aGP.d.mts} +3 -3
  111. package/dist/{ir-Cvj3eU-K.d.mts.map → ir-VWQX6aGP.d.mts.map} +1 -1
  112. package/dist/lane-query-builder.d.mts +4 -4
  113. package/dist/middleware-B8QoWWIx.d.mts +1 -0
  114. package/dist/{middleware-eb7YwdD4-D0M6ACQ-.d.mts → middleware-eb7YwdD4-CiyaANOv.d.mts} +2 -2
  115. package/dist/{middleware-eb7YwdD4-D0M6ACQ-.d.mts.map → middleware-eb7YwdD4-CiyaANOv.d.mts.map} +1 -1
  116. package/dist/{migration-BvCT6g2N.d.mts → migration-DvCs5-4I.d.mts} +4 -4
  117. package/dist/{migration-BvCT6g2N.d.mts.map → migration-DvCs5-4I.d.mts.map} +1 -1
  118. package/dist/{naming-BwqqVcZy-BgTObIQw.mjs → naming-CEGRBbyW-BOa9Eun0.mjs} +54 -9
  119. package/dist/naming-CEGRBbyW-BOa9Eun0.mjs.map +1 -0
  120. package/dist/{naming-jLgdauLi-C84G_UHi.d.mts → naming-DvlNocom-ClcApdiR.d.mts} +33 -7
  121. package/dist/naming-DvlNocom-ClcApdiR.d.mts.map +1 -0
  122. package/dist/operations.d.mts +1 -1
  123. package/dist/orm-client.d.mts +11 -11
  124. package/dist/orm-client.mjs +2 -2
  125. package/dist/{plan-Bmp5R9sq-DKMRkx6Z.d.mts → plan-Bmp5R9sq-mVFXvLM7.d.mts} +4 -4
  126. package/dist/{plan-Bmp5R9sq-DKMRkx6Z.d.mts.map → plan-Bmp5R9sq-mVFXvLM7.d.mts.map} +1 -1
  127. package/dist/plan-Cl6aCuij.d.mts +2 -0
  128. package/dist/{psl-infer-6je61Z6J.d.mts → psl-infer-Dp_hwubv.d.mts} +3 -3
  129. package/dist/{psl-infer-6je61Z6J.d.mts.map → psl-infer-Dp_hwubv.d.mts.map} +1 -1
  130. package/dist/{psl-infer-DGftl-HW.mjs → psl-infer-f5BgyRKm.mjs} +2 -2
  131. package/dist/{psl-infer-DGftl-HW.mjs.map → psl-infer-f5BgyRKm.mjs.map} +1 -1
  132. package/dist/query-lane-context-BhDJZFMh.d.mts +1 -0
  133. package/dist/{query-lane-context-DjyAyYht-HDNYE_oF.d.mts → query-lane-context-DjyAyYht-DdovdGjc.d.mts} +5 -5
  134. package/dist/{query-lane-context-DjyAyYht-HDNYE_oF.d.mts.map → query-lane-context-DjyAyYht-DdovdGjc.d.mts.map} +1 -1
  135. package/dist/relational-core.d.mts +11 -11
  136. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  137. package/dist/relational-core__ast.d.mts +3 -3
  138. package/dist/relational-core__codec-descriptor-registry.d.mts +4 -4
  139. package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
  140. package/dist/relational-core__contract-free.d.mts +3 -3
  141. package/dist/relational-core__expression.d.mts +1 -1
  142. package/dist/relational-core__middleware.d.mts +2 -2
  143. package/dist/relational-core__plan.d.mts +3 -3
  144. package/dist/relational-core__query-lane-context.d.mts +2 -2
  145. package/dist/relational-core__types.d.mts +2 -2
  146. package/dist/{resolve-storage-table-DUwyRJmP.d.mts → resolve-storage-table-BJYVl94P.d.mts} +3 -3
  147. package/dist/{resolve-storage-table-DUwyRJmP.d.mts.map → resolve-storage-table-BJYVl94P.d.mts.map} +1 -1
  148. package/dist/{runtime-AvfMMERk.d.mts → runtime-CiGC1spO.d.mts} +3 -3
  149. package/dist/{runtime-AvfMMERk.d.mts.map → runtime-CiGC1spO.d.mts.map} +1 -1
  150. package/dist/runtime.d.mts +3 -3
  151. package/dist/runtime.mjs +2 -2
  152. package/dist/{schema-differ-DpG_gnur-zSwkxqxK.d.mts → schema-differ-DpG_gnur-BgbN2De2.d.mts} +5 -5
  153. package/dist/{schema-differ-DpG_gnur-zSwkxqxK.d.mts.map → schema-differ-DpG_gnur-BgbN2De2.d.mts.map} +1 -1
  154. package/dist/schema-ir.d.mts +1 -1
  155. package/dist/schema-ir.mjs +1 -1
  156. package/dist/schema-ir__naming.d.mts +2 -2
  157. package/dist/schema-ir__naming.mjs +2 -2
  158. package/dist/schema-ir__types.d.mts +2 -2
  159. package/dist/schema-ir__types.mjs +1 -1
  160. package/dist/{schema-verify-vtFZbmGq-BNfTr6fU.mjs → schema-verify-C_PEdlAr-JK3UgFWU.mjs} +7 -9
  161. package/dist/schema-verify-C_PEdlAr-JK3UgFWU.mjs.map +1 -0
  162. package/dist/{serialized-index-Dp5_EjXD-DMsw8jf3.mjs → serialized-index-B6udRZV1-Ciet0tVA.mjs} +15 -5
  163. package/dist/serialized-index-B6udRZV1-Ciet0tVA.mjs.map +1 -0
  164. package/dist/serialized-index-CvprUx-6-CX0DYGLe.d.mts +44 -0
  165. package/dist/serialized-index-CvprUx-6-CX0DYGLe.d.mts.map +1 -0
  166. package/dist/{sql-contract-serializer-2oBWuxTe-B9hzBBv1.mjs → sql-contract-serializer-2oBWuxTe-Bp9QfUjI.mjs} +6 -6
  167. package/dist/{sql-contract-serializer-2oBWuxTe-B9hzBBv1.mjs.map → sql-contract-serializer-2oBWuxTe-Bp9QfUjI.mjs.map} +1 -1
  168. package/dist/{sql-execution-plan-Da_d82pz-IHBEmGSa.d.mts → sql-execution-plan-Da_d82pz-g3khvnbo.d.mts} +2 -2
  169. package/dist/{sql-execution-plan-Da_d82pz-IHBEmGSa.d.mts.map → sql-execution-plan-Da_d82pz-g3khvnbo.d.mts.map} +1 -1
  170. package/dist/{sql-index-DsI8HAeK-BJsn-jvD.d.mts → sql-index-DsI8HAeK-SazZYeA2.d.mts} +2 -2
  171. package/dist/{sql-index-DsI8HAeK-BJsn-jvD.d.mts.map → sql-index-DsI8HAeK-SazZYeA2.d.mts.map} +1 -1
  172. package/dist/{sql-storage-B0QwiTg6-B8DVctJm.d.mts → sql-storage-aEsH6Fnv-_bWH3uY3.d.mts} +3 -3
  173. package/dist/{sql-storage-B0QwiTg6-B8DVctJm.d.mts.map → sql-storage-aEsH6Fnv-_bWH3uY3.d.mts.map} +1 -1
  174. package/dist/{storage-table-BBaAmanc-BwR37LMA.d.mts → storage-table-BTVeIKBx-Ba6wCjG5.d.mts} +30 -22
  175. package/dist/storage-table-BTVeIKBx-Ba6wCjG5.d.mts.map +1 -0
  176. package/dist/{storage-table-_LWDmPfv-DFhU2dML.mjs → storage-table-BcDudZC5-DZNZhjf2.mjs} +39 -30
  177. package/dist/storage-table-BcDudZC5-DZNZhjf2.mjs.map +1 -0
  178. package/dist/types--gTlnnvl.d.mts +1 -0
  179. package/dist/{types-wy2-Y8wQ.d.mts → types-BL_h3id0.d.mts} +6 -6
  180. package/dist/{types-wy2-Y8wQ.d.mts.map → types-BL_h3id0.d.mts.map} +1 -1
  181. package/dist/{types-D_plAPEe-DqK5It_K.d.mts → types-BpPwiK2b-DCMVWQ_F.d.mts} +6 -6
  182. package/dist/{types-D_plAPEe-DqK5It_K.d.mts.map → types-BpPwiK2b-DCMVWQ_F.d.mts.map} +1 -1
  183. package/dist/{types-BwePDa3m-BVrPIi8V.d.mts → types-BwePDa3m-CrVQ_8YI.d.mts} +2 -2
  184. package/dist/{types-BwePDa3m-BVrPIi8V.d.mts.map → types-BwePDa3m-CrVQ_8YI.d.mts.map} +1 -1
  185. package/dist/types-C-KBovJY.d.mts +1 -0
  186. package/dist/{types-CvbBw1Jo-3KQdErJY.d.mts → types-C1F8xk0m-7rMwgIR6.d.mts} +30 -27
  187. package/dist/types-C1F8xk0m-7rMwgIR6.d.mts.map +1 -0
  188. package/dist/{types-CMMQS6aG.mjs → types-CuvwcWTE.mjs} +2 -2
  189. package/dist/types-CuvwcWTE.mjs.map +1 -0
  190. package/dist/{types-IqZMLrFC-D8PN7ygS.d.mts → types-IqZMLrFC-CcORLTOK.d.mts} +9 -9
  191. package/dist/{types-IqZMLrFC-D8PN7ygS.d.mts.map → types-IqZMLrFC-CcORLTOK.d.mts.map} +1 -1
  192. package/dist/{types-DmhUVq4u-BpqqjPJx.mjs → types-UhDfY1iX-C5wOQ0D5.mjs} +21 -29
  193. package/dist/types-UhDfY1iX-C5wOQ0D5.mjs.map +1 -0
  194. package/dist/{types-dD8JJfeD-BOvMw2Iu.d.mts → types-dD8JJfeD-CS9uMlzW.d.mts} +10 -10
  195. package/dist/{types-dD8JJfeD-BOvMw2Iu.d.mts.map → types-dD8JJfeD-CS9uMlzW.d.mts.map} +1 -1
  196. package/dist/{validators-Ds_fvIs_.d.mts → validators-Bl1TVj5n.d.mts} +7 -19
  197. package/dist/validators-Bl1TVj5n.d.mts.map +1 -0
  198. package/dist/{validators-C4PItWnf.mjs → validators-w7IJlTcR.mjs} +0 -0
  199. package/dist/validators-w7IJlTcR.mjs.map +1 -0
  200. package/package.json +18 -18
  201. package/dist/build-contract-DBCz_YSs-DO0wMHai.mjs.map +0 -1
  202. package/dist/config-types-DKKhWdzf.d.mts.map +0 -1
  203. package/dist/config-types-N7PJc6VN.mjs.map +0 -1
  204. package/dist/contract-builder-Cj-lKWgM.d.mts.map +0 -1
  205. package/dist/contract-builder-YjMQcvZ1.mjs.map +0 -1
  206. package/dist/control-C1EmRznB.mjs.map +0 -1
  207. package/dist/control-adapter-DrCAQQpa.d.mts +0 -1
  208. package/dist/entity-kinds-DKxwKolf-CcsY-iYV.mjs.map +0 -1
  209. package/dist/entity-kinds-Dh6VH4uK.d.mts.map +0 -1
  210. package/dist/middleware-ChwIEKBC.d.mts +0 -1
  211. package/dist/naming-BwqqVcZy-BgTObIQw.mjs.map +0 -1
  212. package/dist/naming-jLgdauLi-C84G_UHi.d.mts.map +0 -1
  213. package/dist/plan-mKgmSe0R.d.mts +0 -2
  214. package/dist/query-lane-context-Dcj4eXUl.d.mts +0 -1
  215. package/dist/schema-verify-vtFZbmGq-BNfTr6fU.mjs.map +0 -1
  216. package/dist/serialized-index-B96AwqtU-DcqcB4q_.d.mts +0 -26
  217. package/dist/serialized-index-B96AwqtU-DcqcB4q_.d.mts.map +0 -1
  218. package/dist/serialized-index-Dp5_EjXD-DMsw8jf3.mjs.map +0 -1
  219. package/dist/storage-table-BBaAmanc-BwR37LMA.d.mts.map +0 -1
  220. package/dist/storage-table-_LWDmPfv-DFhU2dML.mjs.map +0 -1
  221. package/dist/types-CMMQS6aG.mjs.map +0 -1
  222. package/dist/types-Cty2fvYD.d.mts +0 -1
  223. package/dist/types-CvbBw1Jo-3KQdErJY.d.mts.map +0 -1
  224. package/dist/types-DmhUVq4u-BpqqjPJx.mjs.map +0 -1
  225. package/dist/types-TvBZ2Ne9.d.mts +0 -1
  226. package/dist/validators-C4PItWnf.mjs.map +0 -1
  227. package/dist/validators-Ds_fvIs_.d.mts.map +0 -1
@@ -1,5 +1,5 @@
1
- import { c as SqlStorage, s as SqlNamespaceInput, u as SqlStorageTypeEntry } from "./sql-storage-B0QwiTg6-B8DVctJm.mjs";
2
- import "./types-wy2-Y8wQ.mjs";
1
+ import { c as SqlStorage, s as SqlNamespaceInput, u as SqlStorageTypeEntry } from "./sql-storage-aEsH6Fnv-_bWH3uY3.mjs";
2
+ import "./types-BL_h3id0.mjs";
3
3
  import { AnyEntityKindDescriptor, Namespace } from "@prisma/orm-framework/components/ir";
4
4
  import { Contract } from "@prisma/orm-framework/contract/types";
5
5
  import { ContractSerializer, SchemaDiffIssue, SchemaVerifier, SchemaVerifyOptions, SchemaVerifyResult } from "@prisma/orm-framework/components/control";
@@ -120,4 +120,4 @@ declare abstract class SqlSchemaVerifierBase<TContract, TSchema> implements Sche
120
120
  }
121
121
  //#endregion
122
122
  export { SqlSchemaVerifierBase as i, SqlContractSerializerBase as n, SqlEntityHydrationFactory as r, SqlContractSerializer as t };
123
- //# sourceMappingURL=ir-Cvj3eU-K.d.mts.map
123
+ //# sourceMappingURL=ir-VWQX6aGP.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ir-Cvj3eU-K.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/ir.d.mts"],"mappings":";;;;;;;;KAMK,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;uBAyBX,0BAA0B,kBAAkB,SAAS,wBAAwB,mBAAmB;qBAClG,yBAAyB,oBAAoB;mBAC/C;mBACA;EACjB,YAAY,0BAA0B,oBAAoB,4BAA4B,2BAA2B;EACjH,oBAAoB,UAAU,YAAY,WAAW,gBAAgB;EACrE,kBAAkB,UAAU,YAAY;EACxC,0DAA0D;EAC1D,kDAAkD;YACxC,0BAA0B,gBAAgB,SAAS;YACnD,kBAAkB,WAAW,SAAS,cAAc,SAAS;YAC7D,uBAAuB,YAAY,SAAS,eAAe,4BAA4B,SAAS,eAAe;YAC/G,yBAAyB,cAAc,KAAK,0BAA0B,YAAY;YAClF,wBAAwB,OAAO,sBAAsB;YACrD,wBAAwB,UAAU,SAAS,cAAc;;;;;;;;;;;YAWzD,0BAA0B,SAAS,SAAS,eAAe,SAAS,6BAA6B,eAAe,eAAe;UACjI;YACE,oBAAoB,iBAAiB;UACvC;;;;;;;;;;;;;;;;;;cAkBI,8BAA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@@
1
- import { a as StorageTable } from "./storage-table-BBaAmanc-BwR37LMA.mjs";
2
- import { c as SqlStorage } from "./sql-storage-B0QwiTg6-B8DVctJm.mjs";
3
- import { h as ExtractStorageColumnTypes } from "./types-D_plAPEe-DqK5It_K.mjs";
4
- import { n as StorageColumnTypeAcrossNamespaces } from "./types-wy2-Y8wQ.mjs";
1
+ import { a as StorageTable } from "./storage-table-BTVeIKBx-Ba6wCjG5.mjs";
2
+ import { c as SqlStorage } from "./sql-storage-aEsH6Fnv-_bWH3uY3.mjs";
3
+ import { h as ExtractStorageColumnTypes } from "./types-BpPwiK2b-DCMVWQ_F.mjs";
4
+ import { n as StorageColumnTypeAcrossNamespaces } from "./types-BL_h3id0.mjs";
5
5
  import { Brand, Contract, StorageHashBase } from "@prisma/orm-framework/contract/types";
6
6
  import "@standard-schema/spec";
7
7
  //#region ../../../2-sql/4-lanes/query-builder/dist/index.d.mts
@@ -0,0 +1 @@
1
+ import "./middleware-eb7YwdD4-CiyaANOv.mjs";
@@ -1,4 +1,4 @@
1
- import { t as SqlExecutionPlan } from "./sql-execution-plan-Da_d82pz-IHBEmGSa.mjs";
1
+ import { t as SqlExecutionPlan } from "./sql-execution-plan-Da_d82pz-g3khvnbo.mjs";
2
2
  import { ParamRefMutator } from "@prisma/orm-framework/components/runtime";
3
3
  //#region ../../../2-sql/4-lanes/relational-core/dist/middleware-eb7YwdD4.d.mts
4
4
  //#region src/middleware/param-ref-mutator.d.ts
@@ -116,4 +116,4 @@ interface SqlParamRefMutatorInternal<TCodecMap extends Record<string, unknown> =
116
116
  declare function createSqlParamRefMutator<TCodecMap extends Record<string, unknown> = Record<string, unknown>>(plan: SqlExecutionPlan): SqlParamRefMutatorInternal<TCodecMap>;
117
117
  //#endregion
118
118
  export { SqlParamRefMutatorInternal as a, SqlParamRefMutator as i, ParamRefEntryUnion as n, createSqlParamRefMutator as o, ParamRefHandle as r, ParamRefEntry as t };
119
- //# sourceMappingURL=middleware-eb7YwdD4-D0M6ACQ-.d.mts.map
119
+ //# sourceMappingURL=middleware-eb7YwdD4-CiyaANOv.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"middleware-eb7YwdD4-D0M6ACQ-.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/middleware-eb7YwdD4.d.mts"],"mappings":";;;;;;;;;;;;;;cAac;;;;;;;;;;UAUJ,eAAe;YACb,sBAAsB;;;;;;;UAOxB,cAAc;WACb,KAAK,eAAe;WACpB;WACA,SAAS;;;;;;;;;;KAUf,mBAAmB,kBAAkB,8BAA8B,WAAW,qBAAqB,cAAc,YAAY,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;UAyB9I,mBAAmB,kBAAkB,0BAA0B,iCAAiC;;EAExG,WAAW,iBAAiB,mBAAmB;;;;;;;EAO/C,aAAa,uBAAuB,oBAAoB,KAAK,eAAe,WAAW,UAAU,UAAU;EAC3G,aAAa,KAAK,2BAA2B;;EAE7C,cAAc,SAAS;aACZ,KAAK,sBAAsB;aAC3B;;;;;;;;;;;;;UAaH,2BAA2B,kBAAkB,0BAA0B,iCAAiC,mBAAmB;EACnI;;;;;;;;;;;;;;;;;iBAiBe,yBAAyB,kBAAkB,0BAA0B,yBAAyB,MAAM,mBAAmB,2BAA2B"}
1
+ {"version":3,"file":"middleware-eb7YwdD4-CiyaANOv.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/middleware-eb7YwdD4.d.mts"],"mappings":";;;;;;;;;;;;;;cAac;;;;;;;;;;UAUJ,eAAe;YACb,sBAAsB;;;;;;;UAOxB,cAAc;WACb,KAAK,eAAe;WACpB;WACA,SAAS;;;;;;;;;;KAUf,mBAAmB,kBAAkB,8BAA8B,WAAW,qBAAqB,cAAc,YAAY,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;UAyB9I,mBAAmB,kBAAkB,0BAA0B,iCAAiC;;EAExG,WAAW,iBAAiB,mBAAmB;;;;;;;EAO/C,aAAa,uBAAuB,oBAAoB,KAAK,eAAe,WAAW,UAAU,UAAU;EAC3G,aAAa,KAAK,2BAA2B;;EAE7C,cAAc,SAAS;aACZ,KAAK,sBAAsB;aAC3B;;;;;;;;;;;;;UAaH,2BAA2B,kBAAkB,0BAA0B,iCAAiC,mBAAmB;EACnI;;;;;;;;;;;;;;;;;iBAiBe,yBAAyB,kBAAkB,0BAA0B,yBAAyB,MAAM,mBAAmB,2BAA2B"}
@@ -1,6 +1,6 @@
1
- import { c as SqlStorage } from "./sql-storage-B0QwiTg6-B8DVctJm.mjs";
2
- import "./types-wy2-Y8wQ.mjs";
3
- import { f as SqlMigrationPlanOperation, w as SqlPlanTargetDetails } from "./types-IqZMLrFC-D8PN7ygS.mjs";
1
+ import { c as SqlStorage } from "./sql-storage-aEsH6Fnv-_bWH3uY3.mjs";
2
+ import "./types-BL_h3id0.mjs";
3
+ import { f as SqlMigrationPlanOperation, w as SqlPlanTargetDetails } from "./types-IqZMLrFC-CcORLTOK.mjs";
4
4
  import { Contract } from "@prisma/orm-framework/contract/types";
5
5
  import { Migration } from "@prisma/orm-toolchain/migration-tools/migration";
6
6
  //#region ../../../2-sql/9-family/dist/migration.d.mts
@@ -41,4 +41,4 @@ declare abstract class SqlMigration<TDetails extends SqlPlanTargetDetails, TTarg
41
41
  }
42
42
  //#endregion
43
43
  export { SqlMigration as t };
44
- //# sourceMappingURL=migration-BvCT6g2N.d.mts.map
44
+ //# sourceMappingURL=migration-DvCs5-4I.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migration-BvCT6g2N.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/migration.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA0BuB,aAAa,iBAAiB,sBAAsB,mCAAmC,cAAc,SAAS,cAAc,SAAS,aAAa,YAAY,SAAS,cAAc,SAAS,qBAAqB,UAAU,0BAA0B,kBAAkB,WAAW,OAAO;;;;;;;;;;;MAW5S"}
1
+ {"version":3,"file":"migration-DvCs5-4I.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/migration.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA0BuB,aAAa,iBAAiB,sBAAsB,mCAAmC,cAAc,SAAS,cAAc,SAAS,aAAa,YAAY,SAAS,cAAc,SAAS,qBAAqB,UAAU,0BAA0B,kBAAkB,WAAW,OAAO;;;;;;;;;;;MAW5S"}
@@ -1,7 +1,7 @@
1
1
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
2
2
  import { ContractValidationError } from "@prisma/orm-framework/contract/contract-validation-error";
3
3
  import { createHash } from "node:crypto";
4
- //#region ../../../2-sql/1-core/schema-ir/dist/naming-BwqqVcZy.mjs
4
+ //#region ../../../2-sql/1-core/schema-ir/dist/naming-CEGRBbyW.mjs
5
5
  function defaultIndexName(tableName, columns) {
6
6
  return `${tableName}_${columns.join("_")}_idx`;
7
7
  }
@@ -116,6 +116,24 @@ function normalizeSqlBody(sql) {
116
116
  }
117
117
  /**
118
118
  * Returns the first 8 lowercase hex characters of the SHA-256 digest over the
119
+ * canonical content tuple for a check constraint:
120
+ *
121
+ * [normalizeSqlBody(expression)]
122
+ *
123
+ * The predicate is the whole of a check's content — the constraint name,
124
+ * schema, and table are orthogonal to its equivalence. The one-element tuple
125
+ * keeps the encoding in the same shape as the index and RLS tuples so a member
126
+ * can be added later without re-reading which encoding a kind uses.
127
+ *
128
+ * The tuple order and encoding are a stability commitment: any change
129
+ * re-suffixes every wire name.
130
+ */
131
+ function computeCheckContentHash(expression) {
132
+ const tuple = JSON.stringify([normalizeSqlBody(expression)]);
133
+ return createHash("sha256").update(tuple).digest("hex").slice(0, 8);
134
+ }
135
+ /**
136
+ * Returns the first 8 lowercase hex characters of the SHA-256 digest over the
119
137
  * canonical content tuple for an index:
120
138
  *
121
139
  * [normalizeSqlBody(expression), normalizeSqlBody(where), columns, unique, type, sortedOptions]
@@ -157,21 +175,48 @@ function computeIndexContentHash(parts) {
157
175
  return createHash("sha256").update(tuple).digest("hex").slice(0, 8);
158
176
  }
159
177
  /**
160
- * Postgres identifiers cap at 63 characters and the wire name appends a
161
- * 9-character `_<8hex>` suffix, so an authored prefix is bounded at 54.
178
+ * Postgres truncates identifiers at `NAMEDATALEN - 1` = 63 **bytes**, not
179
+ * characters, and the wire name appends a 9-byte `_<8hex>` suffix so a
180
+ * prefix is bounded at 54 bytes. A prefix of non-ASCII characters can sit well
181
+ * under 54 characters and still overrun: the database would silently truncate
182
+ * the name, leaving the declared object permanently unmatchable against the
183
+ * live one.
162
184
  */
163
- const WIRE_NAME_PREFIX_MAX_LENGTH = 54;
185
+ const WIRE_NAME_PREFIX_MAX_BYTES = 54;
186
+ const utf8 = new TextEncoder();
187
+ /** UTF-8 byte length — the unit Postgres measures identifiers in. */
188
+ function byteLength(value) {
189
+ return utf8.encode(value).length;
190
+ }
164
191
  /**
165
- * Rejects a wire-name prefix over {@link WIRE_NAME_PREFIX_MAX_LENGTH}.
192
+ * Rejects a wire-name prefix over {@link WIRE_NAME_PREFIX_MAX_BYTES}.
166
193
  * `subject` opens the error message (e.g. `defineContract: policy prefix`).
167
194
  */
168
195
  function assertWireNamePrefixLength(prefix, subject) {
169
- if (prefix.length > 54) throw structuredError("CONTRACT.WIRE_NAME_PREFIX_TOO_LONG", `${subject} "${prefix}" exceeds the 54-character maximum (Postgres identifiers cap at 63 characters and the wire name appends a 9-character hash suffix).`, { meta: {
196
+ if (byteLength(prefix) > 54) throw structuredError("CONTRACT.WIRE_NAME_PREFIX_TOO_LONG", `${subject} "${prefix}" exceeds the 54-byte maximum (Postgres identifiers cap at 63 bytes and the wire name appends a 9-byte hash suffix).`, { meta: {
170
197
  prefix,
171
- maxLength: 54
198
+ maxBytes: 54
172
199
  } });
173
200
  }
201
+ /**
202
+ * Shortens a DERIVED wire-name prefix to {@link WIRE_NAME_PREFIX_MAX_BYTES},
203
+ * cutting on a code-point boundary so a multibyte character is never split.
204
+ * Only derived prefixes truncate — an authored one throws
205
+ * ({@link assertWireNamePrefixLength}), because its author can shorten it.
206
+ */
207
+ function truncateToWireNamePrefixBytes(prefix) {
208
+ if (byteLength(prefix) <= 54) return prefix;
209
+ let out = "";
210
+ let bytes = 0;
211
+ for (const character of prefix) {
212
+ const size = byteLength(character);
213
+ if (bytes + size > 54) break;
214
+ out += character;
215
+ bytes += size;
216
+ }
217
+ return out;
218
+ }
174
219
  //#endregion
175
- export { formatWireName as a, namingOfLiveName as c, parseNaming as d, parseWireName as f, defaultIndexName as i, normalizeIndexOptionValue as l, assertWireNamePrefixLength as n, nameOf as o, computeIndexContentHash as r, namingOf as s, WIRE_NAME_PREFIX_MAX_LENGTH as t, normalizeSqlBody as u };
220
+ export { defaultIndexName as a, namingOf as c, normalizeSqlBody as d, parseNaming as f, computeIndexContentHash as i, namingOfLiveName as l, truncateToWireNamePrefixBytes as m, assertWireNamePrefixLength as n, formatWireName as o, parseWireName as p, computeCheckContentHash as r, nameOf as s, WIRE_NAME_PREFIX_MAX_BYTES as t, normalizeIndexOptionValue as u };
176
221
 
177
- //# sourceMappingURL=naming-BwqqVcZy-BgTObIQw.mjs.map
222
+ //# sourceMappingURL=naming-CEGRBbyW-BOa9Eun0.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"naming-CEGRBbyW-BOa9Eun0.mjs","names":[],"sources":["../../../../2-sql/1-core/schema-ir/dist/naming-CEGRBbyW.mjs"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/naming.ts\nfunction defaultIndexName(tableName, columns) {\n\treturn `${tableName}_${columns.join(\"_\")}_idx`;\n}\n/** The flat name the union describes. Inverse of {@link namingOf}. */\nfunction nameOf(naming) {\n\treturn naming.kind === \"wire\" ? formatWireName(naming.prefix, naming.hash) : naming.name;\n}\n/**\n* The naming a name-identified node was built with, read back off the flat\n* pair it stores. Inverse of {@link nameOf}, and total for that\n* reason: the constructor derived `name` from the union, so the two agree.\n* Flat data arriving from outside the process goes through\n* {@link parseNaming} instead.\n*/\nfunction namingOf(name, prefix) {\n\tif (prefix === void 0) return {\n\t\tkind: \"exact\",\n\t\tname\n\t};\n\treturn {\n\t\tkind: \"wire\",\n\t\tprefix,\n\t\thash: name.slice(prefix.length + 1)\n\t};\n}\n/**\n* Reads naming out of flat stored data — deserialized contract JSON and the\n* literals a user may hand-edit, the one place a name and a prefix can still\n* disagree. Throws when a declared prefix does not parse back out of the name.\n*/\nfunction parseNaming(name, prefix) {\n\tif (prefix === void 0) return {\n\t\tkind: \"exact\",\n\t\tname\n\t};\n\tconst parsed = parseWireName(name);\n\tif (parsed === void 0 || parsed.prefix !== prefix) throw new ContractValidationError(`\"${name}\": prefix \"${prefix}\" does not match the wire name (expected \"${formatWireName(prefix, \"<8hex>\")}\").`, \"storage\");\n\treturn {\n\t\tkind: \"wire\",\n\t\tprefix: parsed.prefix,\n\t\thash: parsed.hash\n\t};\n}\n/**\n* The naming an object read out of a live catalog has: a wire-shaped name\n* gets the wire arm so the rename pass can pair it by prefix, and every\n* other name is exact.\n*\n* The wire answer is a claim about the name's SHAPE only — the hash is\n* deliberately not recomputed from the object's content here. Nothing\n* downstream reads it as more than that: the differ always asks the\n* contract-derived side to choose the comparison, so a shape-only wire\n* claim on the introspected side never suppresses a body comparison, and\n* `contract infer` recomputes the hash independently before it will emit an\n* index as wire-named.\n*/\nfunction namingOfLiveName(name) {\n\tconst wire = parseWireName(name);\n\treturn wire === void 0 ? {\n\t\tkind: \"exact\",\n\t\tname\n\t} : {\n\t\tkind: \"wire\",\n\t\tprefix: wire.prefix,\n\t\thash: wire.hash\n\t};\n}\nconst WIRE_NAME_PATTERN = /^(.+)_([0-9a-f]{8})$/;\n/**\n* Assembles a wire name from its user-supplied prefix and its 8-hex\n* content-hash suffix. This module owns the `<prefix>_<hash>` format on both\n* sides — construction here and parsing in {@link parseWireName} — so the two\n* never drift.\n*/\nfunction formatWireName(prefix, hash) {\n\treturn `${prefix}_${hash}`;\n}\n/**\n* Splits a wire name (`<prefix>_<8hex>`) into its prefix and content-hash\n* suffix. Returns `undefined` when the name does not follow the wire-name\n* shape (e.g. an object created outside the toolchain) — callers treat such\n* names as all-prefix. Consumed by introspection (prefix extraction) and by\n* rename pairing (same hash, different prefix).\n*/\nfunction parseWireName(name) {\n\tconst match = WIRE_NAME_PATTERN.exec(name);\n\tconst prefix = match?.[1];\n\tconst hash = match?.[2];\n\tif (prefix === void 0 || hash === void 0) return void 0;\n\treturn {\n\t\tprefix,\n\t\thash\n\t};\n}\n/**\n* Stabilizes an authored SQL body (index expression, partial-index predicate,\n* RLS policy predicate) for hashing: trim, and collapse runs of internal\n* whitespace to a single space.\n*\n* This is deliberately minimal. The content hash is the equivalence relation\n* for a wire-named object, and the wire name (prefix + hash) is the only\n* thing ever compared — the hash is never recomputed from an introspected\n* body, so there is no need to match the database's reprinted form. Minimal\n* normalization also protects the no-collision property: aggressive rewriting\n* (lowercasing, paren-stripping, cast-alias folding) risks collapsing two\n* distinct bodies onto one hash.\n*\n* The normalizer is a stability commitment: any change re-suffixes all wire names.\n*/\nfunction normalizeSqlBody(sql) {\n\treturn sql.replace(/\\s+/g, \" \").trim();\n}\n/**\n* Returns the first 8 lowercase hex characters of the SHA-256 digest over the\n* canonical content tuple for a check constraint:\n*\n* [normalizeSqlBody(expression)]\n*\n* The predicate is the whole of a check's content — the constraint name,\n* schema, and table are orthogonal to its equivalence. The one-element tuple\n* keeps the encoding in the same shape as the index and RLS tuples so a member\n* can be added later without re-reading which encoding a kind uses.\n*\n* The tuple order and encoding are a stability commitment: any change\n* re-suffixes every wire name.\n*/\nfunction computeCheckContentHash(expression) {\n\tconst tuple = JSON.stringify([normalizeSqlBody(expression)]);\n\treturn createHash(\"sha256\").update(tuple).digest(\"hex\").slice(0, 8);\n}\n/**\n* Returns the first 8 lowercase hex characters of the SHA-256 digest over the\n* canonical content tuple for an index:\n*\n* [normalizeSqlBody(expression), normalizeSqlBody(where), columns, unique, type, sortedOptions]\n*\n* Columns hash in authored order — column order is semantic in an index.\n* Option values are `String()`-coerced (matching the loose option equality\n* used for diffing) so a hash computed from typed contract values agrees with\n* one recomputed from introspected reloptions strings. The prefix, schema,\n* and table are excluded (they are orthogonal to index equivalence).\n*\n* The tuple order and encoding are a stability commitment with the same\n* status as the RLS tuple: any change re-suffixes every wire name.\n*/\n/**\n* Canonicalizes one index option VALUE to the `on`/`off` boolean spelling:\n* JS booleans and the common catalog spellings (`pg_class.reloptions`\n* stores whatever spelling the DDL used, so a live index may carry\n* `'true'`/`'false'` or `'on'`/`'off'`) all map to one form; everything\n* else via `String()` (fully specified for numbers, so no platform\n* variance). Shared by the wire-name hash tuple, the node's option\n* equality, and the DDL renderer, so an authored `{ fastupdate: true }`\n* agrees with a live index created under any boolean spelling.\n*/\nfunction normalizeIndexOptionValue(value) {\n\tif (value === true || value === \"true\" || value === \"on\") return \"on\";\n\tif (value === false || value === \"false\" || value === \"off\") return \"off\";\n\treturn String(value);\n}\nfunction computeIndexContentHash(parts) {\n\tconst sortedOptions = Object.entries(parts.options ?? {}).map(([key, value]) => [key, normalizeIndexOptionValue(value)]).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);\n\tconst tuple = JSON.stringify([\n\t\tnormalizeSqlBody(parts.expression ?? \"\"),\n\t\tnormalizeSqlBody(parts.where ?? \"\"),\n\t\tparts.columns ?? [],\n\t\tparts.unique,\n\t\tparts.type ?? \"\",\n\t\tsortedOptions\n\t]);\n\treturn createHash(\"sha256\").update(tuple).digest(\"hex\").slice(0, 8);\n}\n/**\n* Postgres truncates identifiers at `NAMEDATALEN - 1` = 63 **bytes**, not\n* characters, and the wire name appends a 9-byte `_<8hex>` suffix — so a\n* prefix is bounded at 54 bytes. A prefix of non-ASCII characters can sit well\n* under 54 characters and still overrun: the database would silently truncate\n* the name, leaving the declared object permanently unmatchable against the\n* live one.\n*/\nconst WIRE_NAME_PREFIX_MAX_BYTES = 54;\nconst utf8 = new TextEncoder();\n/** UTF-8 byte length — the unit Postgres measures identifiers in. */\nfunction byteLength(value) {\n\treturn utf8.encode(value).length;\n}\n/**\n* Rejects a wire-name prefix over {@link WIRE_NAME_PREFIX_MAX_BYTES}.\n* `subject` opens the error message (e.g. `defineContract: policy prefix`).\n*/\nfunction assertWireNamePrefixLength(prefix, subject) {\n\tif (byteLength(prefix) > 54) throw structuredError(\"CONTRACT.WIRE_NAME_PREFIX_TOO_LONG\", `${subject} \"${prefix}\" exceeds the 54-byte maximum (Postgres identifiers cap at 63 bytes and the wire name appends a 9-byte hash suffix).`, { meta: {\n\t\tprefix,\n\t\tmaxBytes: 54\n\t} });\n}\n/**\n* Shortens a DERIVED wire-name prefix to {@link WIRE_NAME_PREFIX_MAX_BYTES},\n* cutting on a code-point boundary so a multibyte character is never split.\n* Only derived prefixes truncate — an authored one throws\n* ({@link assertWireNamePrefixLength}), because its author can shorten it.\n*/\nfunction truncateToWireNamePrefixBytes(prefix) {\n\tif (byteLength(prefix) <= 54) return prefix;\n\tlet out = \"\";\n\tlet bytes = 0;\n\tfor (const character of prefix) {\n\t\tconst size = byteLength(character);\n\t\tif (bytes + size > 54) break;\n\t\tout += character;\n\t\tbytes += size;\n\t}\n\treturn out;\n}\n//#endregion\nexport { defaultIndexName as a, namingOf as c, normalizeSqlBody as d, parseNaming as f, computeIndexContentHash as i, namingOfLiveName as l, truncateToWireNamePrefixBytes as m, assertWireNamePrefixLength as n, formatWireName as o, parseWireName as p, computeCheckContentHash as r, nameOf as s, WIRE_NAME_PREFIX_MAX_BYTES as t, normalizeIndexOptionValue as u };\n\n//# sourceMappingURL=naming-CEGRBbyW.mjs.map"],"mappings":";;;;AAIA,SAAS,iBAAiB,WAAW,SAAS;CAC7C,OAAO,GAAG,UAAU,GAAG,QAAQ,KAAK,GAAG,EAAE;AAC1C;;AAEA,SAAS,OAAO,QAAQ;CACvB,OAAO,OAAO,SAAS,SAAS,eAAe,OAAO,QAAQ,OAAO,IAAI,IAAI,OAAO;AACrF;;;;;;;;AAQA,S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I,QAAQ;CACZ,KAAK,MAAM,aAAa,QAAQ;EAC/B,MAAM,OAAO,WAAW,SAAS;EACjC,IAAI,QAAQ,OAAO,IAAI;EACvB,OAAO;EACP,SAAS;CACV;CACA,OAAO;AACR"}
@@ -1,4 +1,4 @@
1
- //#region ../../../2-sql/1-core/schema-ir/dist/naming-jLgdauLi.d.mts
1
+ //#region ../../../2-sql/1-core/schema-ir/dist/naming-DvlNocom.d.mts
2
2
  //#region src/naming.d.ts
3
3
  declare function defaultIndexName(tableName: string, columns: readonly string[]): string;
4
4
  interface WireName {
@@ -83,6 +83,21 @@ declare function parseWireName(name: string): WireName | undefined;
83
83
  * The normalizer is a stability commitment: any change re-suffixes all wire names.
84
84
  */
85
85
  declare function normalizeSqlBody(sql: string): string;
86
+ /**
87
+ * Returns the first 8 lowercase hex characters of the SHA-256 digest over the
88
+ * canonical content tuple for a check constraint:
89
+ *
90
+ * [normalizeSqlBody(expression)]
91
+ *
92
+ * The predicate is the whole of a check's content — the constraint name,
93
+ * schema, and table are orthogonal to its equivalence. The one-element tuple
94
+ * keeps the encoding in the same shape as the index and RLS tuples so a member
95
+ * can be added later without re-reading which encoding a kind uses.
96
+ *
97
+ * The tuple order and encoding are a stability commitment: any change
98
+ * re-suffixes every wire name.
99
+ */
100
+ declare function computeCheckContentHash(expression: string): string;
86
101
  interface IndexContentHashParts {
87
102
  readonly expression?: string;
88
103
  readonly where?: string;
@@ -119,15 +134,26 @@ interface IndexContentHashParts {
119
134
  declare function normalizeIndexOptionValue(value: unknown): string;
120
135
  declare function computeIndexContentHash(parts: IndexContentHashParts): string;
121
136
  /**
122
- * Postgres identifiers cap at 63 characters and the wire name appends a
123
- * 9-character `_<8hex>` suffix, so an authored prefix is bounded at 54.
137
+ * Postgres truncates identifiers at `NAMEDATALEN - 1` = 63 **bytes**, not
138
+ * characters, and the wire name appends a 9-byte `_<8hex>` suffix so a
139
+ * prefix is bounded at 54 bytes. A prefix of non-ASCII characters can sit well
140
+ * under 54 characters and still overrun: the database would silently truncate
141
+ * the name, leaving the declared object permanently unmatchable against the
142
+ * live one.
124
143
  */
125
- declare const WIRE_NAME_PREFIX_MAX_LENGTH = 54;
144
+ declare const WIRE_NAME_PREFIX_MAX_BYTES = 54;
126
145
  /**
127
- * Rejects a wire-name prefix over {@link WIRE_NAME_PREFIX_MAX_LENGTH}.
146
+ * Rejects a wire-name prefix over {@link WIRE_NAME_PREFIX_MAX_BYTES}.
128
147
  * `subject` opens the error message (e.g. `defineContract: policy prefix`).
129
148
  */
130
149
  declare function assertWireNamePrefixLength(prefix: string, subject: string): void;
150
+ /**
151
+ * Shortens a DERIVED wire-name prefix to {@link WIRE_NAME_PREFIX_MAX_BYTES},
152
+ * cutting on a code-point boundary so a multibyte character is never split.
153
+ * Only derived prefixes truncate — an authored one throws
154
+ * ({@link assertWireNamePrefixLength}), because its author can shorten it.
155
+ */
156
+ declare function truncateToWireNamePrefixBytes(prefix: string): string;
131
157
  //#endregion
132
- export { assertWireNamePrefixLength as a, formatWireName as c, namingOfLiveName as d, normalizeIndexOptionValue as f, parseWireName as h, WireName as i, nameOf as l, parseNaming as m, SqlObjectNaming as n, computeIndexContentHash as o, normalizeSqlBody as p, WIRE_NAME_PREFIX_MAX_LENGTH as r, defaultIndexName as s, IndexContentHashParts as t, namingOf as u };
133
- //# sourceMappingURL=naming-jLgdauLi-C84G_UHi.d.mts.map
158
+ export { truncateToWireNamePrefixBytes as _, assertWireNamePrefixLength as a, defaultIndexName as c, namingOf as d, namingOfLiveName as f, parseWireName as g, parseNaming as h, WireName as i, formatWireName as l, normalizeSqlBody as m, SqlObjectNaming as n, computeCheckContentHash as o, normalizeIndexOptionValue as p, WIRE_NAME_PREFIX_MAX_BYTES as r, computeIndexContentHash as s, IndexContentHashParts as t, nameOf as u };
159
+ //# sourceMappingURL=naming-DvlNocom-ClcApdiR.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"naming-DvlNocom-ClcApdiR.d.mts","names":[],"sources":["../../../../2-sql/1-core/schema-ir/dist/naming-DvlNocom.d.mts"],"mappings":";;iBACiB,iBAAiB,mBAAmB;UAC3C;;WAEC;;WAEA;;;;;;;;;;;KAWN;WACM;WACA;;WAEA;IACP;;iBAEa,OAAO,QAAQ;;;;;;;;iBAQf,SAAS,cAAc,6BAA6B;;;;;;iBAMpD,YAAY,cAAc,6BAA6B;;;;;;;;;;;;;;iBAcvD,iBAAiB,eAAe;;;;;;;iBAOhC,eAAe,gBAAgB;;;;;;;;iBAQ/B,cAAc,eAAe;;;;;;;;;;;;;;;;iBAgB7B,iBAAiB;;;;;;;;;;;;;;;iBAejB,wBAAwB;UAC/B;WACC;WACA;WACA;WACA;WACA;WACA,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2BJ,0BAA0B;iBAC1B,wBAAwB,OAAO;;;;;;;;;cASlC;;;;;iBAKG,2BAA2B,gBAAgB;;;;;;;iBAO3C,8BAA8B"}
@@ -1,2 +1,2 @@
1
- import { a as SqlOperationRegistry, i as SqlOperationEntry, n as SqlOperationDescriptor, o as createSqlOperationRegistry, r as SqlOperationDescriptors, t as SqlLoweringSpec } from "./index-BZF7Wehu.mjs";
1
+ import { a as SqlOperationRegistry, i as SqlOperationEntry, n as SqlOperationDescriptor, o as createSqlOperationRegistry, r as SqlOperationDescriptors, t as SqlLoweringSpec } from "./index-avHHFCFT.mjs";
2
2
  export { SqlLoweringSpec, SqlOperationDescriptor, SqlOperationDescriptors, SqlOperationEntry, SqlOperationRegistry, createSqlOperationRegistry };
@@ -1,14 +1,14 @@
1
- import { a as StorageTable, r as StorageColumn } from "./storage-table-BBaAmanc-BwR37LMA.mjs";
2
- import { c as SqlStorage } from "./sql-storage-B0QwiTg6-B8DVctJm.mjs";
3
- import { f as ExtractFieldOutputTypes, l as ExtractAggregateTypes, p as ExtractQueryOperationTypes, u as ExtractCodecTypes } from "./types-D_plAPEe-DqK5It_K.mjs";
4
- import "./types-wy2-Y8wQ.mjs";
5
- import { Pt as WhereArg, T as CodecRef$1, a as AndExpr, g as BinaryExpr, gt as OrderByItem, ht as OrExpr, pt as NullCheckExpr, s as AnyExpression } from "./types-BwePDa3m-BVrPIi8V.mjs";
6
- import "./ast-Bb6loOw9.mjs";
7
- import { a as Expression } from "./expression-KPBpeH4T.mjs";
8
- import { r as ExecutionContext } from "./query-lane-context-DjyAyYht-HDNYE_oF.mjs";
9
- import "./query-lane-context-Dcj4eXUl.mjs";
10
- import { o as ComputeColumnJsType, y as RuntimeScope } from "./types-dD8JJfeD-BOvMw2Iu.mjs";
11
- import "./types-Cty2fvYD.mjs";
1
+ import { a as StorageTable, r as StorageColumn } from "./storage-table-BTVeIKBx-Ba6wCjG5.mjs";
2
+ import { c as SqlStorage } from "./sql-storage-aEsH6Fnv-_bWH3uY3.mjs";
3
+ import { f as ExtractFieldOutputTypes, l as ExtractAggregateTypes, p as ExtractQueryOperationTypes, u as ExtractCodecTypes } from "./types-BpPwiK2b-DCMVWQ_F.mjs";
4
+ import "./types-BL_h3id0.mjs";
5
+ import { Pt as WhereArg, T as CodecRef$1, a as AndExpr, g as BinaryExpr, gt as OrderByItem, ht as OrExpr, pt as NullCheckExpr, s as AnyExpression } from "./types-BwePDa3m-CrVQ_8YI.mjs";
6
+ import "./ast-UfF480P2.mjs";
7
+ import { a as Expression } from "./expression-CBHseNtv.mjs";
8
+ import { r as ExecutionContext } from "./query-lane-context-DjyAyYht-DdovdGjc.mjs";
9
+ import "./query-lane-context-BhDJZFMh.mjs";
10
+ import { o as ComputeColumnJsType, y as RuntimeScope } from "./types-dD8JJfeD-CS9uMlzW.mjs";
11
+ import "./types--gTlnnvl.mjs";
12
12
  import { Contract } from "@prisma/orm-framework/contract/types";
13
13
  import { AnnotationValue, AsyncIterableResult, MetaBuilder, OperationKind } from "@prisma/orm-framework/components/runtime";
14
14
  import { SimplifyDeep } from "@prisma/orm-framework/utils/simplify-deep";
@@ -3,12 +3,12 @@ import { i as isUniqueConstraintViolation } from "./dist-x6jvtkKM.mjs";
3
3
  import { B as isWhereExpr, C as LiteralExpr, D as OrExpr, F as SubqueryExpr, I as TableSource, L as UpdateAst, O as OrderByItem, P as SelectAst, R as WindowFuncExpr, S as ListExpression, T as NullCheckExpr, _ as InsertAst, b as JsonArrayAggExpr, c as DeleteAst, f as EqColJoinOn, j as ProjectionItem, k as ParamRef, l as DerivedTableSource, n as AndExpr, o as ColumnRef, p as ExistsExpr, r as BinaryExpr, s as DefaultValueExpr, t as AggregateExpr, v as InsertOnConflict, w as NotExpr, x as JsonObjectExpr, y as JoinAst } from "./types-D43EhRac-DOJmnq_t.mjs";
4
4
  import { t as collectOrderedParamRefs } from "./util-DQQgv2j1-D6INZaRG.mjs";
5
5
  import { n as JsonDocumentProjection, r as NativeJsonValueProjection, t as CodecJsonValueProjection } from "./ast-DDAyIKdt.mjs";
6
- import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-BJVJRftS.mjs";
6
+ import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-BK_ZTP-3.mjs";
7
7
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
8
8
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
9
9
  import { domainModelsAtDefaultNamespace } from "@prisma/orm-framework/contract/types";
10
- import { blindCast, castAs } from "@prisma/orm-framework/utils/casts";
11
10
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
11
+ import { blindCast, castAs } from "@prisma/orm-framework/utils/casts";
12
12
  import { assertDefined, invariant } from "@prisma/orm-framework/utils/assertions";
13
13
  import { AsyncIterableResult, createMetaBuilder, isRuntimeError, runtimeError } from "@prisma/orm-framework/components/runtime";
14
14
  //#region ../../../3-extensions/sql-orm-client/dist/index.mjs
@@ -1,6 +1,6 @@
1
- import { c as SqlStorage } from "./sql-storage-B0QwiTg6-B8DVctJm.mjs";
2
- import "./types-wy2-Y8wQ.mjs";
3
- import { m as AnyQueryAst } from "./types-BwePDa3m-BVrPIi8V.mjs";
1
+ import { c as SqlStorage } from "./sql-storage-aEsH6Fnv-_bWH3uY3.mjs";
2
+ import "./types-BL_h3id0.mjs";
3
+ import { m as AnyQueryAst } from "./types-BwePDa3m-CrVQ_8YI.mjs";
4
4
  import { Contract } from "@prisma/orm-framework/contract/types";
5
5
  import { QueryPlan } from "@prisma/orm-framework/components/runtime";
6
6
  //#region ../../../2-sql/4-lanes/relational-core/dist/plan-Bmp5R9sq.d.mts
@@ -42,4 +42,4 @@ interface SqlQueryPlan<Row = unknown> extends QueryPlan<Row> {
42
42
  declare function planFromAst<Row = unknown>(ast: AnyQueryAst, contract: Contract<SqlStorage>, laneId?: string): SqlQueryPlan<Row>;
43
43
  //#endregion
44
44
  export { planFromAst as n, SqlQueryPlan as t };
45
- //# sourceMappingURL=plan-Bmp5R9sq-DKMRkx6Z.d.mts.map
45
+ //# sourceMappingURL=plan-Bmp5R9sq-mVFXvLM7.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plan-Bmp5R9sq-DKMRkx6Z.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/plan-Bmp5R9sq.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;UAkBU,aAAa,uBAAuB,UAAU;WAC7C,KAAK;WACL;;;;;;;;;;;;;;;;;;;iBAmBM,YAAY,eAAe,KAAK,aAAa,UAAU,SAAS,aAAa,kBAAkB,aAAa"}
1
+ {"version":3,"file":"plan-Bmp5R9sq-mVFXvLM7.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/plan-Bmp5R9sq.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;UAkBU,aAAa,uBAAuB,UAAU;WAC7C,KAAK;WACL;;;;;;;;;;;;;;;;;;;iBAmBM,YAAY,eAAe,KAAK,aAAa,UAAU,SAAS,aAAa,kBAAkB,aAAa"}
@@ -0,0 +1,2 @@
1
+ import "./sql-execution-plan-Da_d82pz-g3khvnbo.mjs";
2
+ import "./plan-Bmp5R9sq-mVFXvLM7.mjs";
@@ -1,5 +1,5 @@
1
- import { d as SqlForeignKeyIR, y as SqlTableIR } from "./types-CvbBw1Jo-3KQdErJY.mjs";
2
- import "./types-TvBZ2Ne9.mjs";
1
+ import { d as SqlForeignKeyIR, y as SqlTableIR } from "./types-C1F8xk0m-7rMwgIR6.mjs";
2
+ import "./types-C-KBovJY.mjs";
3
3
  import { ColumnDefault } from "@prisma/orm-framework/contract/types";
4
4
  //#region ../../../2-sql/9-family/dist/psl-infer.d.mts
5
5
  //#region src/core/psl-contract-infer/default-mapping.d.ts
@@ -116,4 +116,4 @@ declare function inferRelations(tables: Record<string, SqlTableIR>, modelNameMap
116
116
  declare function buildChildRelationField(fieldName: string, parentModelName: string, fk: SqlForeignKeyIR, optional: boolean, relationName?: string, hostTable?: SqlTableIR): RelationField;
117
117
  //#endregion
118
118
  export { toEnumMemberName as _, PslPrinterOptions as a, toModelName as b, PslTypeResolution as c, deriveBackRelationFieldName as d, deriveRelationFieldName as f, pluralize as g, parseRawDefault as h, InferredRelations as i, RelationField as l, mapDefault as m, DefaultMappingResult as n, PslTypeMap as o, inferRelations as p, EnumInfo as r, PslTypeReference as s, DefaultMappingOptions as t, buildChildRelationField as u, toEnumName as v, toFieldName as y };
119
- //# sourceMappingURL=psl-infer-6je61Z6J.d.mts.map
119
+ //# sourceMappingURL=psl-infer-Dp_hwubv.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"psl-infer-6je61Z6J.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/psl-infer.d.mts"],"mappings":";;;;;UAGU;WACC,qBAAqB,SAAS;WAC9B,8BAA8B;;KAEpC;WACM;;WAEA;;iBAEM,WAAW,eAAe,eAAe,UAAU,wBAAwB;;;KAGvF;WACM;WACA;;iBAEM,YAAY,oBAAoB;iBAChC,YAAY,qBAAqB;iBACjC,WAAW,qBAAqB;;;;;;;iBAOhC,iBAAiB;iBACjB,UAAU;iBACV,wBAAwB,8BAA8B;iBACtD,4BAA4B,wBAAwB;;;KAGhE;WACM;WACA;;KAEN;WACM,SAAS;WACT;WACA,aAAa;;WAEb;WACA;;UAED;EACR,QAAQ,oBAAoB,cAAc,0BAA0B;;UAE5D;WACC,WAAW;WACX,aAAa;;UAEd;WACC,SAAS;WACT,iBAAiB;WACjB,WAAW;WACX,mBAAmB,oBAAoB,wBAAwB;;KAErE;WACM;WACA;;;;;;WAMA;;;;;;WAMA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;;;iBAIM,gBAAgB,oBAAoB,sBAAsB;;;KAGtE;WACM,kBAAkB,6BAA6B;;iBAEzC,eAAe,QAAQ,eAAe,aAAa,cAAc,8BAA8B;;;;;;;;;;;;;;;;;;;iBAmB/F,wBAAwB,mBAAmB,yBAAyB,IAAI,iBAAiB,mBAAmB,uBAAuB,YAAY,aAAa"}
1
+ {"version":3,"file":"psl-infer-Dp_hwubv.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/psl-infer.d.mts"],"mappings":";;;;;UAGU;WACC,qBAAqB,SAAS;WAC9B,8BAA8B;;KAEpC;WACM;;WAEA;;iBAEM,WAAW,eAAe,eAAe,UAAU,wBAAwB;;;KAGvF;WACM;WACA;;iBAEM,YAAY,oBAAoB;iBAChC,YAAY,qBAAqB;iBACjC,WAAW,qBAAqB;;;;;;;iBAOhC,iBAAiB;iBACjB,UAAU;iBACV,wBAAwB,8BAA8B;iBACtD,4BAA4B,wBAAwB;;;KAGhE;WACM;WACA;;KAEN;WACM,SAAS;WACT;WACA,aAAa;;WAEb;WACA;;UAED;EACR,QAAQ,oBAAoB,cAAc,0BAA0B;;UAE5D;WACC,WAAW;WACX,aAAa;;UAEd;WACC,SAAS;WACT,iBAAiB;WACjB,WAAW;WACX,mBAAmB,oBAAoB,wBAAwB;;KAErE;WACM;WACA;;;;;;WAMA;;;;;;WAMA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;;;iBAIM,gBAAgB,oBAAoB,sBAAsB;;;KAGtE;WACM,kBAAkB,6BAA6B;;iBAEzC,eAAe,QAAQ,eAAe,aAAa,cAAc,8BAA8B;;;;;;;;;;;;;;;;;;;iBAmB/F,wBAAwB,mBAAmB,yBAAyB,IAAI,iBAAiB,mBAAmB,uBAAuB,YAAY,aAAa"}
@@ -1,4 +1,4 @@
1
- import { n as isBackedByColumnKeys, t as backingIndexColumnKeys } from "./foreign-key-materialization-HI7BIQrG.mjs";
1
+ import { n as isBackedByColumnKeys, t as backingIndexColumnKeys } from "./foreign-key-materialization-fH6cObko.mjs";
2
2
  import pluralizeLib from "pluralize";
3
3
  //#region ../../../2-sql/9-family/dist/psl-infer.mjs
4
4
  const DEFAULT_FUNCTION_ATTRIBUTES = {
@@ -359,4 +359,4 @@ function addRelationField(map, tableName, field) {
359
359
  //#endregion
360
360
  export { mapDefault as a, toEnumMemberName as c, toModelName as d, inferRelations as i, toEnumName as l, deriveBackRelationFieldName as n, parseRawDefault as o, deriveRelationFieldName as r, pluralize as s, buildChildRelationField as t, toFieldName as u };
361
361
 
362
- //# sourceMappingURL=psl-infer-DGftl-HW.mjs.map
362
+ //# sourceMappingURL=psl-infer-f5BgyRKm.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"psl-infer-DGftl-HW.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/psl-infer.mjs"],"sourcesContent":["import pluralizeLib from \"pluralize\";\nimport { backingIndexColumnKeys, isBackedByColumnKeys } from \"@internal/sql-contract/foreign-key-materialization\";\n//#region src/core/psl-contract-infer/default-mapping.ts\nconst DEFAULT_FUNCTION_ATTRIBUTES = {\n\t\"autoincrement()\": \"@default(autoincrement())\",\n\t\"now()\": \"@default(now())\"\n};\nfunction mapDefault(columnDefault, options) {\n\tswitch (columnDefault.kind) {\n\t\tcase \"literal\": return { attribute: `@default(${formatLiteralValue(columnDefault.value)})` };\n\t\tcase \"function\": {\n\t\t\tconst attribute = options?.functionAttributes?.[columnDefault.expression] ?? DEFAULT_FUNCTION_ATTRIBUTES[columnDefault.expression] ?? options?.fallbackFunctionAttribute?.(columnDefault.expression);\n\t\t\treturn attribute ? { attribute } : { comment: `// Raw default: ${columnDefault.expression.replace(/[\\r\\n]+/g, \" \")}` };\n\t\t}\n\t}\n}\nfunction formatLiteralValue(value) {\n\tif (value === null) return \"null\";\n\tswitch (typeof value) {\n\t\tcase \"boolean\":\n\t\tcase \"number\": return String(value);\n\t\tcase \"string\": return quoteString(value);\n\t\tdefault: return quoteString(JSON.stringify(value));\n\t}\n}\nfunction quoteString(str) {\n\treturn `\"${escapeString(str)}\"`;\n}\nfunction escapeString(str) {\n\treturn JSON.stringify(str).slice(1, -1);\n}\n//#endregion\n//#region src/core/psl-contract-infer/name-transforms.ts\nconst PSL_RESERVED_WORDS = /* @__PURE__ */ new Set([\n\t\"model\",\n\t\"enum\",\n\t\"types\",\n\t\"type\",\n\t\"generator\",\n\t\"datasource\"\n]);\nconst IDENTIFIER_PART_PATTERN = /[A-Za-z0-9]+/g;\nfunction hasSeparators(input) {\n\treturn /[^A-Za-z0-9]/.test(input);\n}\nfunction extractIdentifierParts(input) {\n\treturn input.match(IDENTIFIER_PART_PATTERN) ?? [];\n}\nfunction createSyntheticIdentifier(input) {\n\tlet hash = 2166136261;\n\tfor (const char of input) {\n\t\thash ^= char.codePointAt(0) ?? 0;\n\t\thash = Math.imul(hash, 16777619);\n\t}\n\treturn `x${(hash >>> 0).toString(16)}`;\n}\nfunction sanitizeIdentifierCharacters(input) {\n\tconst sanitized = input.replace(/[^\\w]/g, \"\");\n\treturn sanitized.length > 0 ? sanitized : createSyntheticIdentifier(input);\n}\nfunction capitalize(word) {\n\treturn word.charAt(0).toUpperCase() + word.slice(1);\n}\nfunction snakeToPascalCase(input) {\n\tconst parts = extractIdentifierParts(input);\n\tif (parts.length === 0) return capitalize(sanitizeIdentifierCharacters(input));\n\treturn parts.map(capitalize).join(\"\");\n}\nfunction snakeToCamelCase(input) {\n\tconst parts = extractIdentifierParts(input);\n\tif (parts.length === 0) return sanitizeIdentifierCharacters(input);\n\tconst [firstPart = input, ...rest] = parts;\n\treturn firstPart.charAt(0).toLowerCase() + firstPart.slice(1) + rest.map(capitalize).join(\"\");\n}\nfunction needsEscaping(name) {\n\treturn PSL_RESERVED_WORDS.has(name.toLowerCase()) || /^\\d/.test(name);\n}\nfunction escapeName(name) {\n\treturn `_${name}`;\n}\nfunction escapeIfNeeded(name) {\n\treturn needsEscaping(name) ? escapeName(name) : name;\n}\nfunction toModelName(tableName) {\n\tlet name;\n\tif (hasSeparators(tableName)) name = snakeToPascalCase(tableName);\n\telse name = tableName.charAt(0).toUpperCase() + tableName.slice(1);\n\tif (needsEscaping(name)) return {\n\t\tname: escapeName(name),\n\t\tmap: tableName\n\t};\n\tif (name !== tableName) return {\n\t\tname,\n\t\tmap: tableName\n\t};\n\treturn { name };\n}\nfunction toFieldName(columnName) {\n\tlet name;\n\tif (hasSeparators(columnName)) name = snakeToCamelCase(columnName);\n\telse name = columnName.charAt(0).toLowerCase() + columnName.slice(1);\n\tif (needsEscaping(name)) return {\n\t\tname: escapeName(name),\n\t\tmap: columnName\n\t};\n\tif (name !== columnName) return {\n\t\tname,\n\t\tmap: columnName\n\t};\n\treturn { name };\n}\nfunction toEnumName(pgTypeName) {\n\tlet name;\n\tif (hasSeparators(pgTypeName)) name = snakeToPascalCase(pgTypeName);\n\telse name = pgTypeName.charAt(0).toUpperCase() + pgTypeName.slice(1);\n\tif (needsEscaping(name)) return {\n\t\tname: escapeName(name),\n\t\tmap: pgTypeName\n\t};\n\tif (name !== pgTypeName) return {\n\t\tname,\n\t\tmap: pgTypeName\n\t};\n\treturn { name };\n}\nconst VALID_IDENTIFIER_PATTERN = /^[A-Za-z_]\\w*$/;\n/**\n* PSL member name for a native-enum value. The value itself always prints\n* explicitly (`member = \"value\"`), so the returned name never needs a map:\n* a value that already is a valid, non-reserved identifier is kept verbatim\n* (case included); anything else is camelCased/escaped like a field name.\n*/\nfunction toEnumMemberName(value) {\n\tif (VALID_IDENTIFIER_PATTERN.test(value) && !needsEscaping(value)) return value;\n\treturn escapeIfNeeded(snakeToCamelCase(value));\n}\nfunction pluralize(word) {\n\treturn pluralizeLib.plural(word);\n}\nfunction deriveRelationFieldName(fkColumns, referencedTableName) {\n\tif (fkColumns.length === 1) {\n\t\tconst [col = referencedTableName] = fkColumns;\n\t\tconst stripped = col.replace(/_id$/i, \"\").replace(/Id$/, \"\");\n\t\tif (stripped.length > 0 && stripped !== col) return escapeIfNeeded(snakeToCamelCase(stripped));\n\t\treturn escapeIfNeeded(snakeToCamelCase(referencedTableName));\n\t}\n\treturn escapeIfNeeded(snakeToCamelCase(referencedTableName));\n}\nfunction deriveBackRelationFieldName(childModelName, isOneToOne) {\n\tconst base = childModelName.charAt(0).toLowerCase() + childModelName.slice(1);\n\treturn isOneToOne ? base : pluralize(base);\n}\n//#endregion\n//#region src/core/psl-contract-infer/raw-default-parser.ts\nconst NEXTVAL_PATTERN = /^nextval\\s*\\(/i;\nconst NOW_FUNCTION_PATTERN = /^(now\\s*\\(\\s*\\)|CURRENT_TIMESTAMP)$/i;\nconst CLOCK_TIMESTAMP_PATTERN = /^clock_timestamp\\s*\\(\\s*\\)$/i;\nconst TIMESTAMP_CAST_SUFFIX = /::timestamp(?:tz|\\s+(?:with|without)\\s+time\\s+zone)?$/i;\nconst TEXT_CAST_SUFFIX = /::text$/i;\nconst NOW_LITERAL_PATTERN = /^'now'$/i;\nconst UUID_PATTERN = /^gen_random_uuid\\s*\\(\\s*\\)$/i;\nconst UUID_OSSP_PATTERN = /^uuid_generate_v4\\s*\\(\\s*\\)$/i;\nconst NULL_PATTERN = /^NULL(?:::.+)?$/i;\nconst TRUE_PATTERN = /^true$/i;\nconst FALSE_PATTERN = /^false$/i;\nconst NUMERIC_PATTERN = /^-?\\d+(\\.\\d+)?$/;\nconst JSON_CAST_SUFFIX = /::jsonb?$/i;\nconst STRING_LITERAL_PATTERN = /^'((?:[^']|'')*)'(?:::(?:\"[^\"]+\"|[\\w\\s]+)(?:\\(\\d+\\))?)?$/;\nfunction canonicalizeTimestampDefault(expr) {\n\tif (NOW_FUNCTION_PATTERN.test(expr)) return \"now()\";\n\tif (CLOCK_TIMESTAMP_PATTERN.test(expr)) return \"clock_timestamp()\";\n\tif (!TIMESTAMP_CAST_SUFFIX.test(expr)) return void 0;\n\tlet inner = expr.replace(TIMESTAMP_CAST_SUFFIX, \"\").trim();\n\tif (inner.startsWith(\"(\") && inner.endsWith(\")\")) inner = inner.slice(1, -1).trim();\n\tif (NOW_FUNCTION_PATTERN.test(inner)) return \"now()\";\n\tif (CLOCK_TIMESTAMP_PATTERN.test(inner)) return \"clock_timestamp()\";\n\tinner = inner.replace(TEXT_CAST_SUFFIX, \"\").trim();\n\tif (NOW_LITERAL_PATTERN.test(inner)) return \"now()\";\n}\nfunction parseRawDefault(rawDefault, nativeType) {\n\tconst trimmed = rawDefault.trim();\n\tconst normalizedType = nativeType?.toLowerCase();\n\tif (NEXTVAL_PATTERN.test(trimmed)) return {\n\t\tkind: \"function\",\n\t\texpression: \"autoincrement()\"\n\t};\n\tconst canonicalTimestamp = canonicalizeTimestampDefault(trimmed);\n\tif (canonicalTimestamp) return {\n\t\tkind: \"function\",\n\t\texpression: canonicalTimestamp\n\t};\n\tif (UUID_PATTERN.test(trimmed) || UUID_OSSP_PATTERN.test(trimmed)) return {\n\t\tkind: \"function\",\n\t\texpression: \"gen_random_uuid()\"\n\t};\n\tif (NULL_PATTERN.test(trimmed)) return {\n\t\tkind: \"literal\",\n\t\tvalue: null\n\t};\n\tif (TRUE_PATTERN.test(trimmed)) return {\n\t\tkind: \"literal\",\n\t\tvalue: true\n\t};\n\tif (FALSE_PATTERN.test(trimmed)) return {\n\t\tkind: \"literal\",\n\t\tvalue: false\n\t};\n\tif (NUMERIC_PATTERN.test(trimmed)) return {\n\t\tkind: \"literal\",\n\t\tvalue: Number(trimmed)\n\t};\n\tconst stringMatch = trimmed.match(STRING_LITERAL_PATTERN);\n\tif (stringMatch?.[1] !== void 0) {\n\t\tconst unescaped = stringMatch[1].replace(/''/g, \"'\");\n\t\tif (normalizedType === \"json\" || normalizedType === \"jsonb\") {\n\t\t\tif (JSON_CAST_SUFFIX.test(trimmed)) return {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: trimmed\n\t\t\t};\n\t\t\ttry {\n\t\t\t\treturn {\n\t\t\t\t\tkind: \"literal\",\n\t\t\t\t\tvalue: JSON.parse(unescaped)\n\t\t\t\t};\n\t\t\t} catch {}\n\t\t}\n\t\treturn {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: unescaped\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"function\",\n\t\texpression: trimmed\n\t};\n}\n//#endregion\n//#region src/core/psl-contract-infer/relation-inference.ts\nconst DEFAULT_ON_DELETE = \"noAction\";\nconst DEFAULT_ON_UPDATE = \"noAction\";\nconst REFERENTIAL_ACTION_PSL = {\n\tnoAction: \"NoAction\",\n\trestrict: \"Restrict\",\n\tcascade: \"Cascade\",\n\tsetNull: \"SetNull\",\n\tsetDefault: \"SetDefault\"\n};\nfunction inferRelations(tables, modelNameMap) {\n\tconst relationsByTable = /* @__PURE__ */ new Map();\n\tconst fkCountByPair = /* @__PURE__ */ new Map();\n\tfor (const table of Object.values(tables)) for (const fk of table.foreignKeys) {\n\t\tconst pairKey = `${table.name}→${fk.referencedTable}`;\n\t\tfkCountByPair.set(pairKey, (fkCountByPair.get(pairKey) ?? 0) + 1);\n\t}\n\tconst usedFieldNames = /* @__PURE__ */ new Map();\n\tfor (const table of Object.values(tables)) {\n\t\tconst names = /* @__PURE__ */ new Set();\n\t\tfor (const col of Object.values(table.columns)) names.add(col.name);\n\t\tusedFieldNames.set(table.name, names);\n\t}\n\tfor (const table of Object.values(tables)) for (const fk of table.foreignKeys) {\n\t\tconst childTableName = table.name;\n\t\tconst parentTableName = fk.referencedTable;\n\t\tconst childUsed = usedFieldNames.get(childTableName);\n\t\tconst childModelName = modelNameMap.get(childTableName) ?? childTableName;\n\t\tconst parentModelName = modelNameMap.get(parentTableName) ?? parentTableName;\n\t\tconst pairKey = `${childTableName}→${parentTableName}`;\n\t\tconst isSelfRelation = childTableName === parentTableName;\n\t\tconst needsRelationName = fkCountByPair.get(pairKey) > 1 || isSelfRelation;\n\t\tconst isOneToOne = detectOneToOne(fk, table);\n\t\tconst childRelFieldName = resolveUniqueFieldName(deriveRelationFieldName(fk.columns, parentTableName), childUsed, parentModelName);\n\t\tconst relationName = needsRelationName ? deriveRelationName(fk, childRelFieldName, parentModelName, isSelfRelation) : void 0;\n\t\taddRelationField(relationsByTable, childTableName, buildChildRelationField(childRelFieldName, parentModelName, fk, fk.columns.some((columnName) => table.columns[columnName]?.nullable ?? false), relationName, table));\n\t\tchildUsed.add(childRelFieldName);\n\t\tconst parentUsed = usedFieldNames.get(parentTableName) ?? /* @__PURE__ */ new Set();\n\t\tusedFieldNames.set(parentTableName, parentUsed);\n\t\tconst backRelFieldName = resolveUniqueFieldName(deriveBackRelationFieldName(childModelName, isOneToOne), parentUsed, childModelName);\n\t\taddRelationField(relationsByTable, parentTableName, {\n\t\t\tfieldName: backRelFieldName,\n\t\t\ttypeName: childModelName,\n\t\t\toptional: isOneToOne,\n\t\t\tlist: !isOneToOne,\n\t\t\trelationName\n\t\t});\n\t\tparentUsed.add(backRelFieldName);\n\t}\n\treturn { relationsByTable };\n}\nfunction detectOneToOne(fk, table) {\n\tconst fkCols = [...fk.columns].sort();\n\tif (table.primaryKey) {\n\t\tconst pkCols = [...table.primaryKey.columns].sort();\n\t\tif (pkCols.length === fkCols.length && pkCols.every((c, i) => c === fkCols[i])) return true;\n\t}\n\tfor (const unique of table.uniques) {\n\t\tconst uniqueCols = [...unique.columns].sort();\n\t\tif (uniqueCols.length === fkCols.length && uniqueCols.every((c, i) => c === fkCols[i])) return true;\n\t}\n\tfor (const index of table.indexes) {\n\t\tif (!index.unique || index.partial || index.columns === void 0) continue;\n\t\tconst indexCols = [...index.columns].sort();\n\t\tif (indexCols.length === fkCols.length && indexCols.every((c, i) => c === fkCols[i])) return true;\n\t}\n\treturn false;\n}\nfunction deriveRelationName(fk, childRelationFieldName, parentModelName, isSelfRelation) {\n\tif (fk.name) return fk.name;\n\tif (isSelfRelation) return `${childRelationFieldName.charAt(0).toUpperCase() + childRelationFieldName.slice(1)}${pluralize(parentModelName)}`;\n\treturn fk.columns.join(\"_\");\n}\n/**\n* Builds the child-side {@link RelationField} for a single foreign key:\n* `typeName` is the parent model name, `fields`/`references` are the FK's raw\n* columns, and `onDelete`/`onUpdate` are normalized to their PSL spelling.\n* Exported so a caller resolving a foreign key against a model outside\n* `tables` (e.g. a cross-space reference into another contract) can reuse the\n* same normalization instead of duplicating it.\n*\n* `hostTable` is the table the FK is declared on (i.e. `table`, not the\n* referenced parent) — its own indexes/uniques/primary key are what a\n* backing index for this FK would be. When none of them exactly match the\n* FK's source columns (in order), `index: false` is stamped so the emitted\n* `@relation` opts out of the framework's default derived backing-index\n* expectation, matching what `db verify` will find live. Passing the table\n* is optional so existing single-FK callers (e.g. cross-space resolution\n* before a host table reference is threaded through) can omit it and keep\n* the framework default.\n*/\nfunction buildChildRelationField(fieldName, parentModelName, fk, optional, relationName, hostTable) {\n\tconst onDelete = fk.onDelete && fk.onDelete !== DEFAULT_ON_DELETE ? fk.onDelete : void 0;\n\tconst onUpdate = fk.onUpdate && fk.onUpdate !== DEFAULT_ON_UPDATE ? fk.onUpdate : void 0;\n\tconst index = hostTable && !isBackedByColumnKeys(fk.columns, backingIndexColumnKeys({\n\t\tindexes: hostTable.indexes.filter((i) => i.where === void 0),\n\t\tuniques: hostTable.uniques,\n\t\tprimaryKey: hostTable.primaryKey\n\t})) ? false : void 0;\n\treturn {\n\t\tfieldName,\n\t\ttypeName: parentModelName,\n\t\treferencedTableName: fk.referencedTable,\n\t\toptional,\n\t\tlist: false,\n\t\trelationName,\n\t\tfkName: fk.name,\n\t\tfields: fk.columns,\n\t\treferences: fk.referencedColumns,\n\t\tonDelete: onDelete ? REFERENTIAL_ACTION_PSL[onDelete] : void 0,\n\t\tonUpdate: onUpdate ? REFERENTIAL_ACTION_PSL[onUpdate] : void 0,\n\t\tindex\n\t};\n}\nfunction resolveUniqueFieldName(desired, usedNames, fallbackSuffix) {\n\tif (!usedNames.has(desired)) return desired;\n\tconst withSuffix = `${desired}${fallbackSuffix}`;\n\tif (!usedNames.has(withSuffix)) return withSuffix;\n\tlet counter = 2;\n\twhile (usedNames.has(`${desired}${counter}`)) counter++;\n\treturn `${desired}${counter}`;\n}\nfunction addRelationField(map, tableName, field) {\n\tconst existing = map.get(tableName);\n\tif (existing) existing.push(field);\n\telse map.set(tableName, [field]);\n}\n//#endregion\nexport { buildChildRelationField, deriveBackRelationFieldName, deriveRelationFieldName, inferRelations, mapDefault, parseRawDefault, pluralize, toEnumMemberName, toEnumName, toFieldName, toModelName };\n\n//# sourceMappingURL=psl-infer.mjs.map"],"mappings":";;;AAGA,MAAM,8BAA8B;CACnC,mBAAmB;CACnB,SAAS;AACV;AACA,SAAS,WAAW,eAAe,SAAS;CAC3C,QAAQ,cAAc,MAAtB;EACC,KAAK,WAAW,OAAO,EAAE,WAAW,YAAY,mBAAmB,cAAc,KAAK,EAAE,GAAG;EAC3F,KAAK,YAAY;GAChB,MAAM,YAAY,SAAS,qBAAqB,cAAc,eAAe,4BAA4B,cAAc,eAAe,SAAS,4BAA4B,cAAc,UAAU;GACnM,OAAO,YAAY,EAAE,UAAU,IAAI,EAAE,SAAS,mBAAmB,cAAc,WAAW,QAAQ,YAAY,GAAG,IAAI;EACtH;CACD;AACD;AACA,SAAS,mBAAmB,OAAO;CAClC,IAAI,UAAU,MAAM,OAAO;CAC3B,QAAQ,OAAO,OAAf;EACC,KAAK;EACL,KAAK,UAAU,OAAO,OAAO,KAAK;EAClC,KAAK,UAAU,OAAO,YAAY,KAAK;EACvC,SAAS,OAAO,YAAY,KAAK,UAAU,KAAK,CAAC;CAClD;AACD;AACA,SAAS,YAAY,KAAK;CACzB,OAAO,IAAI,aAAa,GAAG,EAAE;AAC9B;AACA,SAAS,aAAa,KAAK;CAC1B,OAAO,KAAK,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;CAChD,MAAM,WAAW,IAAI,IAAI,SAAS;CAClC,IAAI,UAAU,SAAS,KAAK,KAAK;MAC5B,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC;AAChC"}
1
+ {"version":3,"file":"psl-infer-f5BgyRKm.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/psl-infer.mjs"],"sourcesContent":["import pluralizeLib from \"pluralize\";\nimport { backingIndexColumnKeys, isBackedByColumnKeys } from \"@internal/sql-contract/foreign-key-materialization\";\n//#region src/core/psl-contract-infer/default-mapping.ts\nconst DEFAULT_FUNCTION_ATTRIBUTES = {\n\t\"autoincrement()\": \"@default(autoincrement())\",\n\t\"now()\": \"@default(now())\"\n};\nfunction mapDefault(columnDefault, options) {\n\tswitch (columnDefault.kind) {\n\t\tcase \"literal\": return { attribute: `@default(${formatLiteralValue(columnDefault.value)})` };\n\t\tcase \"function\": {\n\t\t\tconst attribute = options?.functionAttributes?.[columnDefault.expression] ?? DEFAULT_FUNCTION_ATTRIBUTES[columnDefault.expression] ?? options?.fallbackFunctionAttribute?.(columnDefault.expression);\n\t\t\treturn attribute ? { attribute } : { comment: `// Raw default: ${columnDefault.expression.replace(/[\\r\\n]+/g, \" \")}` };\n\t\t}\n\t}\n}\nfunction formatLiteralValue(value) {\n\tif (value === null) return \"null\";\n\tswitch (typeof value) {\n\t\tcase \"boolean\":\n\t\tcase \"number\": return String(value);\n\t\tcase \"string\": return quoteString(value);\n\t\tdefault: return quoteString(JSON.stringify(value));\n\t}\n}\nfunction quoteString(str) {\n\treturn `\"${escapeString(str)}\"`;\n}\nfunction escapeString(str) {\n\treturn JSON.stringify(str).slice(1, -1);\n}\n//#endregion\n//#region src/core/psl-contract-infer/name-transforms.ts\nconst PSL_RESERVED_WORDS = /* @__PURE__ */ new Set([\n\t\"model\",\n\t\"enum\",\n\t\"types\",\n\t\"type\",\n\t\"generator\",\n\t\"datasource\"\n]);\nconst IDENTIFIER_PART_PATTERN = /[A-Za-z0-9]+/g;\nfunction hasSeparators(input) {\n\treturn /[^A-Za-z0-9]/.test(input);\n}\nfunction extractIdentifierParts(input) {\n\treturn input.match(IDENTIFIER_PART_PATTERN) ?? [];\n}\nfunction createSyntheticIdentifier(input) {\n\tlet hash = 2166136261;\n\tfor (const char of input) {\n\t\thash ^= char.codePointAt(0) ?? 0;\n\t\thash = Math.imul(hash, 16777619);\n\t}\n\treturn `x${(hash >>> 0).toString(16)}`;\n}\nfunction sanitizeIdentifierCharacters(input) {\n\tconst sanitized = input.replace(/[^\\w]/g, \"\");\n\treturn sanitized.length > 0 ? sanitized : createSyntheticIdentifier(input);\n}\nfunction capitalize(word) {\n\treturn word.charAt(0).toUpperCase() + word.slice(1);\n}\nfunction snakeToPascalCase(input) {\n\tconst parts = extractIdentifierParts(input);\n\tif (parts.length === 0) return capitalize(sanitizeIdentifierCharacters(input));\n\treturn parts.map(capitalize).join(\"\");\n}\nfunction snakeToCamelCase(input) {\n\tconst parts = extractIdentifierParts(input);\n\tif (parts.length === 0) return sanitizeIdentifierCharacters(input);\n\tconst [firstPart = input, ...rest] = parts;\n\treturn firstPart.charAt(0).toLowerCase() + firstPart.slice(1) + rest.map(capitalize).join(\"\");\n}\nfunction needsEscaping(name) {\n\treturn PSL_RESERVED_WORDS.has(name.toLowerCase()) || /^\\d/.test(name);\n}\nfunction escapeName(name) {\n\treturn `_${name}`;\n}\nfunction escapeIfNeeded(name) {\n\treturn needsEscaping(name) ? escapeName(name) : name;\n}\nfunction toModelName(tableName) {\n\tlet name;\n\tif (hasSeparators(tableName)) name = snakeToPascalCase(tableName);\n\telse name = tableName.charAt(0).toUpperCase() + tableName.slice(1);\n\tif (needsEscaping(name)) return {\n\t\tname: escapeName(name),\n\t\tmap: tableName\n\t};\n\tif (name !== tableName) return {\n\t\tname,\n\t\tmap: tableName\n\t};\n\treturn { name };\n}\nfunction toFieldName(columnName) {\n\tlet name;\n\tif (hasSeparators(columnName)) name = snakeToCamelCase(columnName);\n\telse name = columnName.charAt(0).toLowerCase() + columnName.slice(1);\n\tif (needsEscaping(name)) return {\n\t\tname: escapeName(name),\n\t\tmap: columnName\n\t};\n\tif (name !== columnName) return {\n\t\tname,\n\t\tmap: columnName\n\t};\n\treturn { name };\n}\nfunction toEnumName(pgTypeName) {\n\tlet name;\n\tif (hasSeparators(pgTypeName)) name = snakeToPascalCase(pgTypeName);\n\telse name = pgTypeName.charAt(0).toUpperCase() + pgTypeName.slice(1);\n\tif (needsEscaping(name)) return {\n\t\tname: escapeName(name),\n\t\tmap: pgTypeName\n\t};\n\tif (name !== pgTypeName) return {\n\t\tname,\n\t\tmap: pgTypeName\n\t};\n\treturn { name };\n}\nconst VALID_IDENTIFIER_PATTERN = /^[A-Za-z_]\\w*$/;\n/**\n* PSL member name for a native-enum value. The value itself always prints\n* explicitly (`member = \"value\"`), so the returned name never needs a map:\n* a value that already is a valid, non-reserved identifier is kept verbatim\n* (case included); anything else is camelCased/escaped like a field name.\n*/\nfunction toEnumMemberName(value) {\n\tif (VALID_IDENTIFIER_PATTERN.test(value) && !needsEscaping(value)) return value;\n\treturn escapeIfNeeded(snakeToCamelCase(value));\n}\nfunction pluralize(word) {\n\treturn pluralizeLib.plural(word);\n}\nfunction deriveRelationFieldName(fkColumns, referencedTableName) {\n\tif (fkColumns.length === 1) {\n\t\tconst [col = referencedTableName] = fkColumns;\n\t\tconst stripped = col.replace(/_id$/i, \"\").replace(/Id$/, \"\");\n\t\tif (stripped.length > 0 && stripped !== col) return escapeIfNeeded(snakeToCamelCase(stripped));\n\t\treturn escapeIfNeeded(snakeToCamelCase(referencedTableName));\n\t}\n\treturn escapeIfNeeded(snakeToCamelCase(referencedTableName));\n}\nfunction deriveBackRelationFieldName(childModelName, isOneToOne) {\n\tconst base = childModelName.charAt(0).toLowerCase() + childModelName.slice(1);\n\treturn isOneToOne ? base : pluralize(base);\n}\n//#endregion\n//#region src/core/psl-contract-infer/raw-default-parser.ts\nconst NEXTVAL_PATTERN = /^nextval\\s*\\(/i;\nconst NOW_FUNCTION_PATTERN = /^(now\\s*\\(\\s*\\)|CURRENT_TIMESTAMP)$/i;\nconst CLOCK_TIMESTAMP_PATTERN = /^clock_timestamp\\s*\\(\\s*\\)$/i;\nconst TIMESTAMP_CAST_SUFFIX = /::timestamp(?:tz|\\s+(?:with|without)\\s+time\\s+zone)?$/i;\nconst TEXT_CAST_SUFFIX = /::text$/i;\nconst NOW_LITERAL_PATTERN = /^'now'$/i;\nconst UUID_PATTERN = /^gen_random_uuid\\s*\\(\\s*\\)$/i;\nconst UUID_OSSP_PATTERN = /^uuid_generate_v4\\s*\\(\\s*\\)$/i;\nconst NULL_PATTERN = /^NULL(?:::.+)?$/i;\nconst TRUE_PATTERN = /^true$/i;\nconst FALSE_PATTERN = /^false$/i;\nconst NUMERIC_PATTERN = /^-?\\d+(\\.\\d+)?$/;\nconst JSON_CAST_SUFFIX = /::jsonb?$/i;\nconst STRING_LITERAL_PATTERN = /^'((?:[^']|'')*)'(?:::(?:\"[^\"]+\"|[\\w\\s]+)(?:\\(\\d+\\))?)?$/;\nfunction canonicalizeTimestampDefault(expr) {\n\tif (NOW_FUNCTION_PATTERN.test(expr)) return \"now()\";\n\tif (CLOCK_TIMESTAMP_PATTERN.test(expr)) return \"clock_timestamp()\";\n\tif (!TIMESTAMP_CAST_SUFFIX.test(expr)) return void 0;\n\tlet inner = expr.replace(TIMESTAMP_CAST_SUFFIX, \"\").trim();\n\tif (inner.startsWith(\"(\") && inner.endsWith(\")\")) inner = inner.slice(1, -1).trim();\n\tif (NOW_FUNCTION_PATTERN.test(inner)) return \"now()\";\n\tif (CLOCK_TIMESTAMP_PATTERN.test(inner)) return \"clock_timestamp()\";\n\tinner = inner.replace(TEXT_CAST_SUFFIX, \"\").trim();\n\tif (NOW_LITERAL_PATTERN.test(inner)) return \"now()\";\n}\nfunction parseRawDefault(rawDefault, nativeType) {\n\tconst trimmed = rawDefault.trim();\n\tconst normalizedType = nativeType?.toLowerCase();\n\tif (NEXTVAL_PATTERN.test(trimmed)) return {\n\t\tkind: \"function\",\n\t\texpression: \"autoincrement()\"\n\t};\n\tconst canonicalTimestamp = canonicalizeTimestampDefault(trimmed);\n\tif (canonicalTimestamp) return {\n\t\tkind: \"function\",\n\t\texpression: canonicalTimestamp\n\t};\n\tif (UUID_PATTERN.test(trimmed) || UUID_OSSP_PATTERN.test(trimmed)) return {\n\t\tkind: \"function\",\n\t\texpression: \"gen_random_uuid()\"\n\t};\n\tif (NULL_PATTERN.test(trimmed)) return {\n\t\tkind: \"literal\",\n\t\tvalue: null\n\t};\n\tif (TRUE_PATTERN.test(trimmed)) return {\n\t\tkind: \"literal\",\n\t\tvalue: true\n\t};\n\tif (FALSE_PATTERN.test(trimmed)) return {\n\t\tkind: \"literal\",\n\t\tvalue: false\n\t};\n\tif (NUMERIC_PATTERN.test(trimmed)) return {\n\t\tkind: \"literal\",\n\t\tvalue: Number(trimmed)\n\t};\n\tconst stringMatch = trimmed.match(STRING_LITERAL_PATTERN);\n\tif (stringMatch?.[1] !== void 0) {\n\t\tconst unescaped = stringMatch[1].replace(/''/g, \"'\");\n\t\tif (normalizedType === \"json\" || normalizedType === \"jsonb\") {\n\t\t\tif (JSON_CAST_SUFFIX.test(trimmed)) return {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: trimmed\n\t\t\t};\n\t\t\ttry {\n\t\t\t\treturn {\n\t\t\t\t\tkind: \"literal\",\n\t\t\t\t\tvalue: JSON.parse(unescaped)\n\t\t\t\t};\n\t\t\t} catch {}\n\t\t}\n\t\treturn {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: unescaped\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"function\",\n\t\texpression: trimmed\n\t};\n}\n//#endregion\n//#region src/core/psl-contract-infer/relation-inference.ts\nconst DEFAULT_ON_DELETE = \"noAction\";\nconst DEFAULT_ON_UPDATE = \"noAction\";\nconst REFERENTIAL_ACTION_PSL = {\n\tnoAction: \"NoAction\",\n\trestrict: \"Restrict\",\n\tcascade: \"Cascade\",\n\tsetNull: \"SetNull\",\n\tsetDefault: \"SetDefault\"\n};\nfunction inferRelations(tables, modelNameMap) {\n\tconst relationsByTable = /* @__PURE__ */ new Map();\n\tconst fkCountByPair = /* @__PURE__ */ new Map();\n\tfor (const table of Object.values(tables)) for (const fk of table.foreignKeys) {\n\t\tconst pairKey = `${table.name}→${fk.referencedTable}`;\n\t\tfkCountByPair.set(pairKey, (fkCountByPair.get(pairKey) ?? 0) + 1);\n\t}\n\tconst usedFieldNames = /* @__PURE__ */ new Map();\n\tfor (const table of Object.values(tables)) {\n\t\tconst names = /* @__PURE__ */ new Set();\n\t\tfor (const col of Object.values(table.columns)) names.add(col.name);\n\t\tusedFieldNames.set(table.name, names);\n\t}\n\tfor (const table of Object.values(tables)) for (const fk of table.foreignKeys) {\n\t\tconst childTableName = table.name;\n\t\tconst parentTableName = fk.referencedTable;\n\t\tconst childUsed = usedFieldNames.get(childTableName);\n\t\tconst childModelName = modelNameMap.get(childTableName) ?? childTableName;\n\t\tconst parentModelName = modelNameMap.get(parentTableName) ?? parentTableName;\n\t\tconst pairKey = `${childTableName}→${parentTableName}`;\n\t\tconst isSelfRelation = childTableName === parentTableName;\n\t\tconst needsRelationName = fkCountByPair.get(pairKey) > 1 || isSelfRelation;\n\t\tconst isOneToOne = detectOneToOne(fk, table);\n\t\tconst childRelFieldName = resolveUniqueFieldName(deriveRelationFieldName(fk.columns, parentTableName), childUsed, parentModelName);\n\t\tconst relationName = needsRelationName ? deriveRelationName(fk, childRelFieldName, parentModelName, isSelfRelation) : void 0;\n\t\taddRelationField(relationsByTable, childTableName, buildChildRelationField(childRelFieldName, parentModelName, fk, fk.columns.some((columnName) => table.columns[columnName]?.nullable ?? false), relationName, table));\n\t\tchildUsed.add(childRelFieldName);\n\t\tconst parentUsed = usedFieldNames.get(parentTableName) ?? /* @__PURE__ */ new Set();\n\t\tusedFieldNames.set(parentTableName, parentUsed);\n\t\tconst backRelFieldName = resolveUniqueFieldName(deriveBackRelationFieldName(childModelName, isOneToOne), parentUsed, childModelName);\n\t\taddRelationField(relationsByTable, parentTableName, {\n\t\t\tfieldName: backRelFieldName,\n\t\t\ttypeName: childModelName,\n\t\t\toptional: isOneToOne,\n\t\t\tlist: !isOneToOne,\n\t\t\trelationName\n\t\t});\n\t\tparentUsed.add(backRelFieldName);\n\t}\n\treturn { relationsByTable };\n}\nfunction detectOneToOne(fk, table) {\n\tconst fkCols = [...fk.columns].sort();\n\tif (table.primaryKey) {\n\t\tconst pkCols = [...table.primaryKey.columns].sort();\n\t\tif (pkCols.length === fkCols.length && pkCols.every((c, i) => c === fkCols[i])) return true;\n\t}\n\tfor (const unique of table.uniques) {\n\t\tconst uniqueCols = [...unique.columns].sort();\n\t\tif (uniqueCols.length === fkCols.length && uniqueCols.every((c, i) => c === fkCols[i])) return true;\n\t}\n\tfor (const index of table.indexes) {\n\t\tif (!index.unique || index.partial || index.columns === void 0) continue;\n\t\tconst indexCols = [...index.columns].sort();\n\t\tif (indexCols.length === fkCols.length && indexCols.every((c, i) => c === fkCols[i])) return true;\n\t}\n\treturn false;\n}\nfunction deriveRelationName(fk, childRelationFieldName, parentModelName, isSelfRelation) {\n\tif (fk.name) return fk.name;\n\tif (isSelfRelation) return `${childRelationFieldName.charAt(0).toUpperCase() + childRelationFieldName.slice(1)}${pluralize(parentModelName)}`;\n\treturn fk.columns.join(\"_\");\n}\n/**\n* Builds the child-side {@link RelationField} for a single foreign key:\n* `typeName` is the parent model name, `fields`/`references` are the FK's raw\n* columns, and `onDelete`/`onUpdate` are normalized to their PSL spelling.\n* Exported so a caller resolving a foreign key against a model outside\n* `tables` (e.g. a cross-space reference into another contract) can reuse the\n* same normalization instead of duplicating it.\n*\n* `hostTable` is the table the FK is declared on (i.e. `table`, not the\n* referenced parent) — its own indexes/uniques/primary key are what a\n* backing index for this FK would be. When none of them exactly match the\n* FK's source columns (in order), `index: false` is stamped so the emitted\n* `@relation` opts out of the framework's default derived backing-index\n* expectation, matching what `db verify` will find live. Passing the table\n* is optional so existing single-FK callers (e.g. cross-space resolution\n* before a host table reference is threaded through) can omit it and keep\n* the framework default.\n*/\nfunction buildChildRelationField(fieldName, parentModelName, fk, optional, relationName, hostTable) {\n\tconst onDelete = fk.onDelete && fk.onDelete !== DEFAULT_ON_DELETE ? fk.onDelete : void 0;\n\tconst onUpdate = fk.onUpdate && fk.onUpdate !== DEFAULT_ON_UPDATE ? fk.onUpdate : void 0;\n\tconst index = hostTable && !isBackedByColumnKeys(fk.columns, backingIndexColumnKeys({\n\t\tindexes: hostTable.indexes.filter((i) => i.where === void 0),\n\t\tuniques: hostTable.uniques,\n\t\tprimaryKey: hostTable.primaryKey\n\t})) ? false : void 0;\n\treturn {\n\t\tfieldName,\n\t\ttypeName: parentModelName,\n\t\treferencedTableName: fk.referencedTable,\n\t\toptional,\n\t\tlist: false,\n\t\trelationName,\n\t\tfkName: fk.name,\n\t\tfields: fk.columns,\n\t\treferences: fk.referencedColumns,\n\t\tonDelete: onDelete ? REFERENTIAL_ACTION_PSL[onDelete] : void 0,\n\t\tonUpdate: onUpdate ? REFERENTIAL_ACTION_PSL[onUpdate] : void 0,\n\t\tindex\n\t};\n}\nfunction resolveUniqueFieldName(desired, usedNames, fallbackSuffix) {\n\tif (!usedNames.has(desired)) return desired;\n\tconst withSuffix = `${desired}${fallbackSuffix}`;\n\tif (!usedNames.has(withSuffix)) return withSuffix;\n\tlet counter = 2;\n\twhile (usedNames.has(`${desired}${counter}`)) counter++;\n\treturn `${desired}${counter}`;\n}\nfunction addRelationField(map, tableName, field) {\n\tconst existing = map.get(tableName);\n\tif (existing) existing.push(field);\n\telse map.set(tableName, [field]);\n}\n//#endregion\nexport { buildChildRelationField, deriveBackRelationFieldName, deriveRelationFieldName, inferRelations, mapDefault, parseRawDefault, pluralize, toEnumMemberName, toEnumName, toFieldName, toModelName };\n\n//# sourceMappingURL=psl-infer.mjs.map"],"mappings":";;;AAGA,MAAM,8BAA8B;CACnC,mBAAmB;CACnB,SAAS;AACV;AACA,SAAS,WAA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,SAAS,uBAAuB;EACnF,SAAS,UAAU,QAAQ,QAAQ,MAAM,EAAE,UAAU,KAAK,CAAC;EAC3D,SAAS,UAAU;EACnB,YAAY,UAAU;CACvB,CAAC,CAAC,IAAI,QAAQ,KAAK;CACnB,OAAO;EACN;EACA,UAAU;EACV,qBAAqB,GAAG;EACxB;EACA,MAAM;EACN;EACA,QAAQ,GAAG;EACX,QAAQ,GAAG;EACX,YAAY,GAAG;EACf,UAAU,WAAW,uBAAuB,YAAY,KAAK;EAC7D,UAAU,WAAW,uBAAuB,YAAY,KAAK;EAC7D;CACD;AACD;AACA,SAAS,uBAAuB,SAAS,WAAW,gBAAgB;CACnE,IAAI,CAAC,UAAU,IAAI,OAAO,GAAG,OAAO;CACpC,MAAM,aAAa,GAAG,UAAU;CAChC,IAAI,CAAC,UAAU,IAAI,UAAU,GAAG,OAAO;CACvC,IAAI,UAAU;CACd,OAAO,UAAU,IAAI,GAAG,UAAU,SAAS,GAAG;CAC9C,OAAO,GAAG,UAAU;AACrB;AACA,SAAS,iBAAiB,KAAK,WAAW,OAAO;CAChD,MAAM,WAAW,IAAI,IAAI,SAAS;CAClC,IAAI,UAAU,SAAS,KAAK,KAAK;MAC5B,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC;AAChC"}
@@ -0,0 +1 @@
1
+ import "./query-lane-context-DjyAyYht-DdovdGjc.mjs";
@@ -1,7 +1,7 @@
1
- import { c as SqlStorage } from "./sql-storage-B0QwiTg6-B8DVctJm.mjs";
2
- import "./types-wy2-Y8wQ.mjs";
3
- import { a as SqlOperationRegistry } from "./index-BZF7Wehu.mjs";
4
- import { O as ContractCodecRegistry, s as AnyExpression } from "./types-BwePDa3m-BVrPIi8V.mjs";
1
+ import { c as SqlStorage } from "./sql-storage-aEsH6Fnv-_bWH3uY3.mjs";
2
+ import "./types-BL_h3id0.mjs";
3
+ import { a as SqlOperationRegistry } from "./index-avHHFCFT.mjs";
4
+ import { O as ContractCodecRegistry, s as AnyExpression } from "./types-BwePDa3m-CrVQ_8YI.mjs";
5
5
  import { Contract } from "@prisma/orm-framework/contract/types";
6
6
  import { AggregateDescriptor } from "@prisma/orm-framework/components/components";
7
7
  import { CodecDescriptor, CodecRef } from "@prisma/orm-framework/components/codec";
@@ -147,4 +147,4 @@ interface ExecutionContext<TContract extends Contract<SqlStorage> = Contract<Sql
147
147
  }
148
148
  //#endregion
149
149
  export { MutationDefaultsOptions as a, SqlAggregateDescriptorRegistry as c, TypeHelperRegistry as d, isSqlAggregateDescriptor as f, MutationDefaultsOp as i, SqlAggregateLowering as l, CodecDescriptorRegistry as n, ResolvedSqlAggregate as o, ExecutionContext as r, SqlAggregateDescriptor as s, AppliedMutationDefault as t, SqlAggregateLoweringContext as u };
150
- //# sourceMappingURL=query-lane-context-DjyAyYht-HDNYE_oF.d.mts.map
150
+ //# sourceMappingURL=query-lane-context-DjyAyYht-DdovdGjc.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query-lane-context-DjyAyYht-HDNYE_oF.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/query-lane-context-DjyAyYht.d.mts"],"mappings":";;;;;;;;;;;;UAUU;WACC,MAAM;WACN,YAAY;;;;;;;KAOlB,wBAAwB,SAAS,gCAAgC;;;;;;KAMjE,yBAAyB;WACnB,QAAQ;;;iBAGF,yBAAyB,iBAAiB,SAAS;;;;;;UAM1D;;;;EAIR,cAAc,kBAAkB;;;;;;;;;;;;;;EAchC,kBAAkB,qBAAqB,eAAe,iBAAiB;;;;EAIvE,UAAU,iBAAiB;;;;EAI3B,aAAa,8BAA8B;;;;;;;UAOnC;WACC;WACA,QAAQ;WACR;WACA,OAAO;;;;;;;UAOR;;;;;;EAMR,QAAQ,mBAAmB,QAAQ,WAAW;;EAE9C,UAAU,iBAAiB;;;;;KAKxB,qBAAqB;KACrB;KACA;WACM;WACA;;KAEN;WACM,IAAI;WACJ;;;;;;;;WAQA;WACA,QAAQ;;;;;WAKR,oBAAoB;;;;;;;UAOrB,iBAAiB,kBAAkB,SAAS,cAAc,SAAS;WAClE,UAAU;;;;WAIV,gBAAgB;;;;WAIhB,kBAAkB;;;;WAIlB,sBAAsB;WACtB,iBAAiB;;;;WAIjB,OAAO;;;;EAIhB,sBAAsB,SAAS,0BAA0B,cAAc"}
1
+ {"version":3,"file":"query-lane-context-DjyAyYht-DdovdGjc.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/query-lane-context-DjyAyYht.d.mts"],"mappings":";;;;;;;;;;;;UAUU;WACC,MAAM;WACN,YAAY;;;;;;;KAOlB,wBAAwB,SAAS,gCAAgC;;;;;;KAMjE,yBAAyB;WACnB,QAAQ;;;iBAGF,yBAAyB,iBAAiB,SAAS;;;;;;UAM1D;;;;EAIR,cAAc,kBAAkB;;;;;;;;;;;;;;EAchC,kBAAkB,qBAAqB,eAAe,iBAAiB;;;;EAIvE,UAAU,iBAAiB;;;;EAI3B,aAAa,8BAA8B;;;;;;;UAOnC;WACC;WACA,QAAQ;WACR;WACA,OAAO;;;;;;;UAOR;;;;;;EAMR,QAAQ,mBAAmB,QAAQ,WAAW;;EAE9C,UAAU,iBAAiB;;;;;KAKxB,qBAAqB;KACrB;KACA;WACM;WACA;;KAEN;WACM,IAAI;WACJ;;;;;;;;WAQA;WACA,QAAQ;;;;;WAKR,oBAAoB;;;;;;;UAOrB,iBAAiB,kBAAkB,SAAS,cAAc,SAAS;WAClE,UAAU;;;;WAIV,gBAAgB;;;;WAIhB,kBAAkB;;;;WAIlB,sBAAsB;WACtB,iBAAiB;;;;WAIjB,OAAO;;;;EAIhB,sBAAsB,SAAS,0BAA0B,cAAc"}
@@ -1,12 +1,12 @@
1
- import { $ as JoinAst, A as DeleteAst, At as TableRef, B as ExistsExpr, Bt as queryAstKinds, C as CodecDescriptor$1, Ct as RawSqlLiteral, D as ColumnRef, Dt as SqlCodecInstanceContext, E as CodecTrait$1, Et as SqlCodecCallContext, F as DescriptorCodecTraits, Ft as WindowFn, G as ExtractCodecTypes, H as ExpressionFolder, I as Direction, It as WindowFuncExpr, J as FunctionSourceAlias, K as FunctionCallExpr, L as DoNothingConflictAction, Lt as frozenCodecRef, M as DescriptorCodecId, Mt as ToWhereExpr, N as DescriptorCodecInput, Nt as UpdateAst, O as ContractCodecRegistry, Ot as SqlColumnRef, P as DescriptorCodecJson, Pt as WhereArg, Q as InsertValue, R as DoUpdateSetConflictAction, Rt as isQueryAst, S as CodecCallContext$1, St as RawSqlExpr, T as CodecRef$1, Tt as SelectAstOptions, U as ExpressionRewriter, V as ExprVisitor, Vt as whereExprKinds, W as ExpressionSource, X as InsertAst, Y as IdentifierRef, Z as InsertOnConflict, _ as BinaryOp, _t as ParamRef, a as AndExpr, at as JsonValueProjectionVisitor, b as CastExpr, bt as ProjectionItem, c as AnyFromSource, ct as LiteralExpr, d as AnyJsonValueProjection, dt as NativeJsonValueProjection, et as JoinOnExpr, f as AnyOperationArg, ft as NotExpr, g as BinaryExpr, gt as OrderByItem, h as AstRewriter, ht as OrExpr, i as AggregateOpFn, it as JsonObjectExpr, j as DerivedTableSource, jt as TableSource, k as DefaultValueExpr, kt as SubqueryExpr, l as AnyInsertOnConflictAction, lt as LoweredParam, m as AnyQueryAst, mt as OperationExpr, n as AggregateExpr, nt as JsonDocumentProjection, o as AnyCodecDescriptor, ot as LimitOffsetValue, p as AnyParamRef, pt as NullCheckExpr, q as FunctionSource, r as AggregateFn, rt as JsonObjectEntry, s as AnyExpression, st as ListExpression, t as AggregateCountFn, tt as JsonArrayAggExpr, u as AnyInsertValue, ut as LoweredStatement, v as CaseBranch, vt as PreparedParamRef, w as CodecJsonValueProjection, wt as SelectAst, x as Codec$1, xt as RawExpr, y as CaseExpr, yt as ProjectionExpr, z as EqColJoinOn, zt as isWhereExpr } from "./types-BwePDa3m-BVrPIi8V.mjs";
2
- import { a as DdlColumnDefaultVisitor, c as DdlTableConstraint, d as LiteralColumnDefault, f as PrimaryKeyConstraint, i as DdlColumnDefault, l as ForeignKeyConstraint, m as isDdlNode, n as CheckExpressionConstraint, o as DdlColumnRenderContext, p as UniqueConstraint, r as DdlColumn, s as DdlNode, t as AnyDdlColumnDefault, u as FunctionColumnDefault } from "./ddl-types-h_3_pXmq-QBLq6WbP.mjs";
3
- import { $ as sqlTextDecode, A as SqlTimestampCodec, B as sqlCharEncode, C as SqlFloatDescriptor, D as SqlStatementStats, E as SqlQueryable, F as collectOrderedParamRefs, G as sqlFloatDescriptor, H as sqlFloatColumn, I as compact, J as sqlIntColumn, K as sqlFloatEncode, L as sqlCharColumn, M as SqlTransaction, N as SqlVarcharCodec, O as SqlTextCodec, P as SqlVarcharDescriptor, Q as sqlTextColumn, R as sqlCharDecode, S as SqlFloatCodec, T as SqlIntDescriptor, U as sqlFloatDecode, V as sqlCharRenderOutputType, W as sqlFloatDecodeJson, X as sqlIntDescriptor, Y as sqlIntDecode, Z as sqlIntEncode, _ as SqlConnection, a as LowererContext, at as sqlTimestampDescriptor, b as SqlExecuteRequest, c as PreparedStatementHandle, ct as sqlTimestampRenderOutputType, d as SQL_INT_CODEC_ID, dt as sqlVarcharDescriptor, et as sqlTextDescriptor, f as SQL_TEXT_CODEC_ID, ft as sqlVarcharEncode, g as SqlCharDescriptor, h as SqlCharCodec, i as Lowerer, it as sqlTimestampDecodeJson, j as SqlTimestampDescriptor, k as SqlTextDescriptor, l as SQL_CHAR_CODEC_ID, lt as sqlVarcharColumn, m as SQL_VARCHAR_CODEC_ID, n as AdapterProfile, nt as sqlTimestampColumn, o as MarkerReadResult, ot as sqlTimestampEncode, p as SQL_TIMESTAMP_CODEC_ID, pt as sqlVarcharRenderOutputType, q as sqlFloatEncodeJson, r as AdapterTarget, rt as sqlTimestampDecode, s as PreparedExecuteRequest, st as sqlTimestampEncodeJson, t as Adapter, tt as sqlTextEncode, u as SQL_FLOAT_CODEC_ID, ut as sqlVarcharDecode, v as SqlDriver, w as SqlIntCodec, x as SqlExplainResult, y as SqlDriverState, z as sqlCharDescriptor } from "./ast-Bb6loOw9.mjs";
4
- import { a as Expression, c as RawSqlTag, d as TraitExpression, f as buildOperation, g as toExpr, h as param, i as CodecValue, l as ScalarListExpression, m as createRawSql, n as CodecExpression, o as RawCodecInferer, p as codecOf, r as CodecTypesBase, s as RawSqlBuilder, t as BuildOperationSpec, u as ScopeField } from "./expression-KPBpeH4T.mjs";
5
- import { t as SqlExecutionPlan } from "./sql-execution-plan-Da_d82pz-IHBEmGSa.mjs";
6
- import { n as planFromAst, t as SqlQueryPlan } from "./plan-Bmp5R9sq-DKMRkx6Z.mjs";
7
- import "./plan-mKgmSe0R.mjs";
8
- import { a as MutationDefaultsOptions, c as SqlAggregateDescriptorRegistry, d as TypeHelperRegistry, i as MutationDefaultsOp, n as CodecDescriptorRegistry, o as ResolvedSqlAggregate, r as ExecutionContext, t as AppliedMutationDefault } from "./query-lane-context-DjyAyYht-HDNYE_oF.mjs";
9
- import "./query-lane-context-Dcj4eXUl.mjs";
10
- import { a as SqlParamRefMutatorInternal, i as SqlParamRefMutator, n as ParamRefEntryUnion, o as createSqlParamRefMutator, r as ParamRefHandle, t as ParamRefEntry } from "./middleware-eb7YwdD4-D0M6ACQ-.mjs";
11
- import { C as TableDef, E as TablesOf, S as SqlPlan, T as TableMetadata, _ as RawTemplateFactory, a as ColumnsOf, b as SqlBuilderOptions, c as META, d as ModelMetadata, f as OperationTypeSignature, g as RawFunctionOptions, h as RawFactory, i as ColumnResolutionContract, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as ComputeColumnJsType, p as OperationTypes, r as CodecTypes, s as Expr, t as BuildOptions, u as ModelDef, v as RawTemplateOptions, w as TableKey, x as SqlOrmPlan, y as RuntimeScope } from "./types-dD8JJfeD-BOvMw2Iu.mjs";
1
+ import { $ as JoinAst, A as DeleteAst, At as TableRef, B as ExistsExpr, Bt as queryAstKinds, C as CodecDescriptor$1, Ct as RawSqlLiteral, D as ColumnRef, Dt as SqlCodecInstanceContext, E as CodecTrait$1, Et as SqlCodecCallContext, F as DescriptorCodecTraits, Ft as WindowFn, G as ExtractCodecTypes, H as ExpressionFolder, I as Direction, It as WindowFuncExpr, J as FunctionSourceAlias, K as FunctionCallExpr, L as DoNothingConflictAction, Lt as frozenCodecRef, M as DescriptorCodecId, Mt as ToWhereExpr, N as DescriptorCodecInput, Nt as UpdateAst, O as ContractCodecRegistry, Ot as SqlColumnRef, P as DescriptorCodecJson, Pt as WhereArg, Q as InsertValue, R as DoUpdateSetConflictAction, Rt as isQueryAst, S as CodecCallContext$1, St as RawSqlExpr, T as CodecRef$1, Tt as SelectAstOptions, U as ExpressionRewriter, V as ExprVisitor, Vt as whereExprKinds, W as ExpressionSource, X as InsertAst, Y as IdentifierRef, Z as InsertOnConflict, _ as BinaryOp, _t as ParamRef, a as AndExpr, at as JsonValueProjectionVisitor, b as CastExpr, bt as ProjectionItem, c as AnyFromSource, ct as LiteralExpr, d as AnyJsonValueProjection, dt as NativeJsonValueProjection, et as JoinOnExpr, f as AnyOperationArg, ft as NotExpr, g as BinaryExpr, gt as OrderByItem, h as AstRewriter, ht as OrExpr, i as AggregateOpFn, it as JsonObjectExpr, j as DerivedTableSource, jt as TableSource, k as DefaultValueExpr, kt as SubqueryExpr, l as AnyInsertOnConflictAction, lt as LoweredParam, m as AnyQueryAst, mt as OperationExpr, n as AggregateExpr, nt as JsonDocumentProjection, o as AnyCodecDescriptor, ot as LimitOffsetValue, p as AnyParamRef, pt as NullCheckExpr, q as FunctionSource, r as AggregateFn, rt as JsonObjectEntry, s as AnyExpression, st as ListExpression, t as AggregateCountFn, tt as JsonArrayAggExpr, u as AnyInsertValue, ut as LoweredStatement, v as CaseBranch, vt as PreparedParamRef, w as CodecJsonValueProjection, wt as SelectAst, x as Codec$1, xt as RawExpr, y as CaseExpr, yt as ProjectionExpr, z as EqColJoinOn, zt as isWhereExpr } from "./types-BwePDa3m-CrVQ_8YI.mjs";
2
+ import { a as DdlColumnDefaultVisitor, c as DdlTableConstraint, d as LiteralColumnDefault, f as PrimaryKeyConstraint, i as DdlColumnDefault, l as ForeignKeyConstraint, m as isDdlNode, n as CheckExpressionConstraint, o as DdlColumnRenderContext, p as UniqueConstraint, r as DdlColumn, s as DdlNode, t as AnyDdlColumnDefault, u as FunctionColumnDefault } from "./ddl-types-h_3_pXmq-DzkUGplM.mjs";
3
+ import { $ as sqlTextDecode, A as SqlTimestampCodec, B as sqlCharEncode, C as SqlFloatDescriptor, D as SqlStatementStats, E as SqlQueryable, F as collectOrderedParamRefs, G as sqlFloatDescriptor, H as sqlFloatColumn, I as compact, J as sqlIntColumn, K as sqlFloatEncode, L as sqlCharColumn, M as SqlTransaction, N as SqlVarcharCodec, O as SqlTextCodec, P as SqlVarcharDescriptor, Q as sqlTextColumn, R as sqlCharDecode, S as SqlFloatCodec, T as SqlIntDescriptor, U as sqlFloatDecode, V as sqlCharRenderOutputType, W as sqlFloatDecodeJson, X as sqlIntDescriptor, Y as sqlIntDecode, Z as sqlIntEncode, _ as SqlConnection, a as LowererContext, at as sqlTimestampDescriptor, b as SqlExecuteRequest, c as PreparedStatementHandle, ct as sqlTimestampRenderOutputType, d as SQL_INT_CODEC_ID, dt as sqlVarcharDescriptor, et as sqlTextDescriptor, f as SQL_TEXT_CODEC_ID, ft as sqlVarcharEncode, g as SqlCharDescriptor, h as SqlCharCodec, i as Lowerer, it as sqlTimestampDecodeJson, j as SqlTimestampDescriptor, k as SqlTextDescriptor, l as SQL_CHAR_CODEC_ID, lt as sqlVarcharColumn, m as SQL_VARCHAR_CODEC_ID, n as AdapterProfile, nt as sqlTimestampColumn, o as MarkerReadResult, ot as sqlTimestampEncode, p as SQL_TIMESTAMP_CODEC_ID, pt as sqlVarcharRenderOutputType, q as sqlFloatEncodeJson, r as AdapterTarget, rt as sqlTimestampDecode, s as PreparedExecuteRequest, st as sqlTimestampEncodeJson, t as Adapter, tt as sqlTextEncode, u as SQL_FLOAT_CODEC_ID, ut as sqlVarcharDecode, v as SqlDriver, w as SqlIntCodec, x as SqlExplainResult, y as SqlDriverState, z as sqlCharDescriptor } from "./ast-UfF480P2.mjs";
4
+ import { a as Expression, c as RawSqlTag, d as TraitExpression, f as buildOperation, g as toExpr, h as param, i as CodecValue, l as ScalarListExpression, m as createRawSql, n as CodecExpression, o as RawCodecInferer, p as codecOf, r as CodecTypesBase, s as RawSqlBuilder, t as BuildOperationSpec, u as ScopeField } from "./expression-CBHseNtv.mjs";
5
+ import { t as SqlExecutionPlan } from "./sql-execution-plan-Da_d82pz-g3khvnbo.mjs";
6
+ import { n as planFromAst, t as SqlQueryPlan } from "./plan-Bmp5R9sq-mVFXvLM7.mjs";
7
+ import "./plan-Cl6aCuij.mjs";
8
+ import { a as MutationDefaultsOptions, c as SqlAggregateDescriptorRegistry, d as TypeHelperRegistry, i as MutationDefaultsOp, n as CodecDescriptorRegistry, o as ResolvedSqlAggregate, r as ExecutionContext, t as AppliedMutationDefault } from "./query-lane-context-DjyAyYht-DdovdGjc.mjs";
9
+ import "./query-lane-context-BhDJZFMh.mjs";
10
+ import { a as SqlParamRefMutatorInternal, i as SqlParamRefMutator, n as ParamRefEntryUnion, o as createSqlParamRefMutator, r as ParamRefHandle, t as ParamRefEntry } from "./middleware-eb7YwdD4-CiyaANOv.mjs";
11
+ import { C as TableDef, E as TablesOf, S as SqlPlan, T as TableMetadata, _ as RawTemplateFactory, a as ColumnsOf, b as SqlBuilderOptions, c as META, d as ModelMetadata, f as OperationTypeSignature, g as RawFunctionOptions, h as RawFactory, i as ColumnResolutionContract, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as ComputeColumnJsType, p as OperationTypes, r as CodecTypes, s as Expr, t as BuildOptions, u as ModelDef, v as RawTemplateOptions, w as TableKey, x as SqlOrmPlan, y as RuntimeScope } from "./types-dD8JJfeD-CS9uMlzW.mjs";
12
12
  export { Adapter, AdapterProfile, AdapterTarget, AggregateCountFn, AggregateExpr, AggregateFn, AggregateOpFn, AndExpr, AnyCodecDescriptor, AnyDdlColumnDefault, AnyExpression, AnyFromSource, AnyInsertOnConflictAction, AnyInsertValue, AnyJsonValueProjection, AnyOperationArg, AnyParamRef, AnyQueryAst, AppliedMutationDefault, AstRewriter, BinaryExpr, BinaryOp, BuildOperationSpec, BuildOptions, BuildParamsMap, CaseBranch, CaseExpr, CastExpr, CheckExpressionConstraint, Codec$1 as Codec, type CodecCallContext$1 as CodecCallContext, type CodecDescriptor$1 as CodecDescriptor, CodecDescriptorRegistry, CodecExpression, CodecJsonValueProjection, type CodecRef$1 as CodecRef, type CodecTrait$1 as CodecTrait, CodecTypes, CodecTypesBase, CodecValue, ColumnRef, ColumnResolutionContract, ColumnsOf, ComputeColumnJsType, ContractCodecRegistry, DdlColumn, DdlColumnDefault, DdlColumnDefaultVisitor, DdlColumnRenderContext, DdlNode, DdlTableConstraint, DefaultValueExpr, DeleteAst, DerivedTableSource, DescriptorCodecId, DescriptorCodecInput, DescriptorCodecJson, DescriptorCodecTraits, Direction, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExecutionContext, ExistsExpr, Expr, ExprVisitor, Expression, ExpressionFolder, ExpressionRewriter, ExpressionSource, ExtractCodecTypes, ForeignKeyConstraint, FunctionCallExpr, FunctionColumnDefault, FunctionSource, FunctionSourceAlias, IdentifierRef, InsertAst, InsertOnConflict, InsertValue, JoinAst, JoinOnExpr, JsonArrayAggExpr, JsonDocumentProjection, JsonObjectEntry, JsonObjectExpr, JsonValueProjectionVisitor, LimitOffsetValue, ListExpression, LiteralColumnDefault, LiteralExpr, LoweredParam, LoweredStatement, Lowerer, LowererContext, META, MarkerReadResult, Meta, ModelDef, ModelMetadata, MutationDefaultsOp, MutationDefaultsOptions, NativeJsonValueProjection, NotExpr, NullCheckExpr, OperationExpr, OperationTypeSignature, OperationTypes, OperationsForTypeId, OrExpr, OrderByItem, ParamRef, type ParamRefEntry, type ParamRefEntryUnion, type ParamRefHandle, PreparedExecuteRequest, PreparedParamRef, PreparedStatementHandle, PrimaryKeyConstraint, ProjectionExpr, ProjectionItem, RawCodecInferer, RawExpr, RawFactory, RawFunctionOptions, RawSqlBuilder, RawSqlExpr, RawSqlLiteral, RawSqlTag, RawTemplateFactory, RawTemplateOptions, ResolvedSqlAggregate, type RuntimeScope, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID, ScalarListExpression, ScopeField, SelectAst, SelectAstOptions, SqlAggregateDescriptorRegistry, SqlBuilderOptions, SqlCharCodec, SqlCharDescriptor, SqlCodecCallContext, SqlCodecInstanceContext, SqlColumnRef, SqlConnection, SqlDriver, SqlDriverState, SqlExecuteRequest, type SqlExecutionPlan, SqlExplainResult, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, type SqlOrmPlan, type SqlParamRefMutator, type SqlParamRefMutatorInternal, SqlPlan, SqlQueryPlan, SqlQueryable, SqlStatementStats, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlTransaction, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableDef, TableKey, TableMetadata, TableRef, TableSource, TablesOf, ToWhereExpr, TraitExpression, TypeHelperRegistry, UniqueConstraint, UpdateAst, WhereArg, WindowFn, WindowFuncExpr, buildOperation, codecOf, collectOrderedParamRefs, compact, createRawSql, createSqlParamRefMutator, frozenCodecRef, isDdlNode, isQueryAst, isWhereExpr, param, planFromAst, queryAstKinds, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDecodeJson, sqlFloatDescriptor, sqlFloatEncode, sqlFloatEncodeJson, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlTimestampColumn, sqlTimestampDecode, sqlTimestampDecodeJson, sqlTimestampDescriptor, sqlTimestampEncode, sqlTimestampEncodeJson, sqlTimestampRenderOutputType, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType, toExpr, whereExprKinds };