@prisma/orm-family-sql 0.16.0-dev.36

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 (325) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +28 -0
  3. package/dist/ast-BstHjAoG.mjs +325 -0
  4. package/dist/ast-BstHjAoG.mjs.map +1 -0
  5. package/dist/ast-DSuzmsWn.d.mts +287 -0
  6. package/dist/ast-DSuzmsWn.d.mts.map +1 -0
  7. package/dist/authoring-type-constructors-Blqoa2Ua-DyCmD6mp.mjs +316 -0
  8. package/dist/authoring-type-constructors-Blqoa2Ua-DyCmD6mp.mjs.map +1 -0
  9. package/dist/build-contract-DBCz_YSs-DO0wMHai.mjs +778 -0
  10. package/dist/build-contract-DBCz_YSs-DO0wMHai.mjs.map +1 -0
  11. package/dist/builder.d.mts +3 -0
  12. package/dist/builder.mjs +1 -0
  13. package/dist/builder__runtime.d.mts +42 -0
  14. package/dist/builder__runtime.d.mts.map +1 -0
  15. package/dist/builder__runtime.mjs +955 -0
  16. package/dist/builder__runtime.mjs.map +1 -0
  17. package/dist/builder__types.d.mts +3 -0
  18. package/dist/builder__types.mjs +1 -0
  19. package/dist/canonicalization-hooks-CYnW_sGn.d.mts +10 -0
  20. package/dist/canonicalization-hooks-CYnW_sGn.d.mts.map +1 -0
  21. package/dist/canonicalization-hooks-DfIc_lOO.mjs +87 -0
  22. package/dist/canonicalization-hooks-DfIc_lOO.mjs.map +1 -0
  23. package/dist/codec-descriptor-registry-BJVJRftS.mjs +96 -0
  24. package/dist/codec-descriptor-registry-BJVJRftS.mjs.map +1 -0
  25. package/dist/codec-types-MOaceoPi-C5eL2sao.d.mts +116 -0
  26. package/dist/codec-types-MOaceoPi-C5eL2sao.d.mts.map +1 -0
  27. package/dist/config-types-47qB33rW.d.mts +21 -0
  28. package/dist/config-types-47qB33rW.d.mts.map +1 -0
  29. package/dist/config-types-N7PJc6VN.mjs +65 -0
  30. package/dist/config-types-N7PJc6VN.mjs.map +1 -0
  31. package/dist/contract-builder-MvJJrQ-5.d.mts +1306 -0
  32. package/dist/contract-builder-MvJJrQ-5.d.mts.map +1 -0
  33. package/dist/contract-builder-YjMQcvZ1.mjs +1615 -0
  34. package/dist/contract-builder-YjMQcvZ1.mjs.map +1 -0
  35. package/dist/contract-emitter.d.mts +25 -0
  36. package/dist/contract-emitter.d.mts.map +1 -0
  37. package/dist/contract-emitter.mjs +2 -0
  38. package/dist/contract-errors-BCN6RVI5-5IHBF_lg.mjs +9 -0
  39. package/dist/contract-errors-BCN6RVI5-5IHBF_lg.mjs.map +1 -0
  40. package/dist/contract-psl.d.mts +65 -0
  41. package/dist/contract-psl.d.mts.map +1 -0
  42. package/dist/contract-psl.mjs +2 -0
  43. package/dist/contract-psl__provider.d.mts +23 -0
  44. package/dist/contract-psl__provider.d.mts.map +1 -0
  45. package/dist/contract-psl__provider.mjs +105 -0
  46. package/dist/contract-psl__provider.mjs.map +1 -0
  47. package/dist/contract-ts.d.mts +3 -0
  48. package/dist/contract-ts.mjs +4 -0
  49. package/dist/contract-ts__config-types.d.mts +2 -0
  50. package/dist/contract-ts__config-types.mjs +2 -0
  51. package/dist/contract-ts__contract-builder.d.mts +2 -0
  52. package/dist/contract-ts__contract-builder.mjs +3 -0
  53. package/dist/contract-view-BMR5IWk4.mjs +39 -0
  54. package/dist/contract-view-BMR5IWk4.mjs.map +1 -0
  55. package/dist/contract-view-BbWQp6r4.d.mts +61 -0
  56. package/dist/contract-view-BbWQp6r4.d.mts.map +1 -0
  57. package/dist/contract.d.mts +26 -0
  58. package/dist/contract.mjs +17 -0
  59. package/dist/contract__canonicalization-hooks.d.mts +2 -0
  60. package/dist/contract__canonicalization-hooks.mjs +2 -0
  61. package/dist/contract__contract-view.d.mts +2 -0
  62. package/dist/contract__contract-view.mjs +2 -0
  63. package/dist/contract__entity-handle-lowering-hook.d.mts +2 -0
  64. package/dist/contract__entity-handle-lowering-hook.mjs +2 -0
  65. package/dist/contract__entity-kinds.d.mts +2 -0
  66. package/dist/contract__entity-kinds.mjs +2 -0
  67. package/dist/contract__factories.d.mts +2 -0
  68. package/dist/contract__factories.mjs +2 -0
  69. package/dist/contract__foreign-key-materialization.d.mts +2 -0
  70. package/dist/contract__foreign-key-materialization.mjs +2 -0
  71. package/dist/contract__index-naming.d.mts +2 -0
  72. package/dist/contract__index-naming.mjs +2 -0
  73. package/dist/contract__index-type-validation.d.mts +2 -0
  74. package/dist/contract__index-type-validation.mjs +2 -0
  75. package/dist/contract__index-types.d.mts +3 -0
  76. package/dist/contract__index-types.mjs +2 -0
  77. package/dist/contract__pack-types.d.mts +2 -0
  78. package/dist/contract__pack-types.mjs +1 -0
  79. package/dist/contract__referential-action-sql.d.mts +2 -0
  80. package/dist/contract__referential-action-sql.mjs +2 -0
  81. package/dist/contract__resolve-storage-table.d.mts +2 -0
  82. package/dist/contract__resolve-storage-table.mjs +2 -0
  83. package/dist/contract__types.d.mts +11 -0
  84. package/dist/contract__types.mjs +4 -0
  85. package/dist/contract__validators.d.mts +2 -0
  86. package/dist/contract__validators.mjs +3 -0
  87. package/dist/contract__value-set-derivation-hook.d.mts +2 -0
  88. package/dist/contract__value-set-derivation-hook.mjs +2 -0
  89. package/dist/control-B7iS4jv4.mjs +1326 -0
  90. package/dist/control-B7iS4jv4.mjs.map +1 -0
  91. package/dist/control-BHmsZudH.d.mts +948 -0
  92. package/dist/control-BHmsZudH.d.mts.map +1 -0
  93. package/dist/control-adapter-4y1O8Ps3.d.mts +1 -0
  94. package/dist/control-adapter-C99J7aEF-C-17lFY8.d.mts +191 -0
  95. package/dist/control-adapter-C99J7aEF-C-17lFY8.d.mts.map +1 -0
  96. package/dist/db-DhMsmBS--DKENDi3l.d.mts +365 -0
  97. package/dist/db-DhMsmBS--DKENDi3l.d.mts.map +1 -0
  98. package/dist/ddl-types-BMp2bWVS-D1waZJ4n.mjs +153 -0
  99. package/dist/ddl-types-BMp2bWVS-D1waZJ4n.mjs.map +1 -0
  100. package/dist/ddl-types-rrMsf77U-DGctYf-T.d.mts +149 -0
  101. package/dist/ddl-types-rrMsf77U-DGctYf-T.d.mts.map +1 -0
  102. package/dist/diff-B16bL_IR.mjs +13 -0
  103. package/dist/diff-B16bL_IR.mjs.map +1 -0
  104. package/dist/diff-DhlzHOMD.d.mts +104 -0
  105. package/dist/diff-DhlzHOMD.d.mts.map +1 -0
  106. package/dist/dist-C_q1_QR9.mjs +9 -0
  107. package/dist/dist-C_q1_QR9.mjs.map +1 -0
  108. package/dist/dist-DrScXbhq.mjs +414 -0
  109. package/dist/dist-DrScXbhq.mjs.map +1 -0
  110. package/dist/dist-x6jvtkKM.mjs +68 -0
  111. package/dist/dist-x6jvtkKM.mjs.map +1 -0
  112. package/dist/entity-handle-lowering-hook-CIvRKBfa.d.mts +92 -0
  113. package/dist/entity-handle-lowering-hook-CIvRKBfa.d.mts.map +1 -0
  114. package/dist/entity-handle-lowering-hook-DwLIKNiS.mjs +11 -0
  115. package/dist/entity-handle-lowering-hook-DwLIKNiS.mjs.map +1 -0
  116. package/dist/entity-kinds-DKxwKolf-CcsY-iYV.mjs +136 -0
  117. package/dist/entity-kinds-DKxwKolf-CcsY-iYV.mjs.map +1 -0
  118. package/dist/entity-kinds-Dh6VH4uK.d.mts +29 -0
  119. package/dist/entity-kinds-Dh6VH4uK.d.mts.map +1 -0
  120. package/dist/errors-B5g0xWro-mWH2C07F.mjs +9 -0
  121. package/dist/errors-B5g0xWro-mWH2C07F.mjs.map +1 -0
  122. package/dist/errors.d.mts +63 -0
  123. package/dist/errors.d.mts.map +1 -0
  124. package/dist/errors.mjs +2 -0
  125. package/dist/expression-DIf8F4Mc.d.mts +167 -0
  126. package/dist/expression-DIf8F4Mc.d.mts.map +1 -0
  127. package/dist/expression-RUO52bJB.mjs +109 -0
  128. package/dist/expression-RUO52bJB.mjs.map +1 -0
  129. package/dist/factories-B7tA4y9D.d.mts +39 -0
  130. package/dist/factories-B7tA4y9D.d.mts.map +1 -0
  131. package/dist/factories-CDG9zBxC.mjs +77 -0
  132. package/dist/factories-CDG9zBxC.mjs.map +1 -0
  133. package/dist/family.d.mts +13 -0
  134. package/dist/family.mjs +12 -0
  135. package/dist/family__control-adapter.d.mts +3 -0
  136. package/dist/family__control-adapter.mjs +1 -0
  137. package/dist/family__control.d.mts +4 -0
  138. package/dist/family__control.mjs +4 -0
  139. package/dist/family__diff.d.mts +3 -0
  140. package/dist/family__diff.mjs +3 -0
  141. package/dist/family__ir.d.mts +2 -0
  142. package/dist/family__ir.mjs +3 -0
  143. package/dist/family__migration.d.mts +2 -0
  144. package/dist/family__migration.mjs +2 -0
  145. package/dist/family__pack.d.mts +249 -0
  146. package/dist/family__pack.d.mts.map +1 -0
  147. package/dist/family__pack.mjs +18 -0
  148. package/dist/family__pack.mjs.map +1 -0
  149. package/dist/family__psl-infer.d.mts +2 -0
  150. package/dist/family__psl-infer.mjs +2 -0
  151. package/dist/family__runtime.d.mts +3 -0
  152. package/dist/family__runtime.mjs +3 -0
  153. package/dist/family__verify.d.mts +2 -0
  154. package/dist/family__verify.mjs +2 -0
  155. package/dist/foreign-key-BSy9u4O4-BnsOe5Nf.d.mts +85 -0
  156. package/dist/foreign-key-BSy9u4O4-BnsOe5Nf.d.mts.map +1 -0
  157. package/dist/foreign-key-materialization-Ca-wRbmj.d.mts +65 -0
  158. package/dist/foreign-key-materialization-Ca-wRbmj.d.mts.map +1 -0
  159. package/dist/foreign-key-materialization-HI7BIQrG.mjs +72 -0
  160. package/dist/foreign-key-materialization-HI7BIQrG.mjs.map +1 -0
  161. package/dist/index-Bb9U36N4.d.mts +511 -0
  162. package/dist/index-Bb9U36N4.d.mts.map +1 -0
  163. package/dist/index-BgaTJRxj.d.mts +25 -0
  164. package/dist/index-BgaTJRxj.d.mts.map +1 -0
  165. package/dist/index-naming-BZWoh45T.d.mts +62 -0
  166. package/dist/index-naming-BZWoh45T.d.mts.map +1 -0
  167. package/dist/index-naming-BoGBcMmI-DiJAr66H.mjs +108 -0
  168. package/dist/index-naming-BoGBcMmI-DiJAr66H.mjs.map +1 -0
  169. package/dist/index-type-validation-COH4d78M.mjs +17 -0
  170. package/dist/index-type-validation-COH4d78M.mjs.map +1 -0
  171. package/dist/index-type-validation-DN0L2mqm.d.mts +10 -0
  172. package/dist/index-type-validation-DN0L2mqm.d.mts.map +1 -0
  173. package/dist/index-types-CNhHgKHi.d.mts +1 -0
  174. package/dist/index-types-DJQ_xwaE.mjs +40 -0
  175. package/dist/index-types-DJQ_xwaE.mjs.map +1 -0
  176. package/dist/index-types-DPVhsW0v-D-BikM4h.d.mts +31 -0
  177. package/dist/index-types-DPVhsW0v-D-BikM4h.d.mts.map +1 -0
  178. package/dist/interpreter-5WgpL-ax-_nqHLUTr.mjs +3526 -0
  179. package/dist/interpreter-5WgpL-ax-_nqHLUTr.mjs.map +1 -0
  180. package/dist/ir-B3bKMnGQ.d.mts +123 -0
  181. package/dist/ir-B3bKMnGQ.d.mts.map +1 -0
  182. package/dist/ir-I-xciGUH.mjs +36 -0
  183. package/dist/ir-I-xciGUH.mjs.map +1 -0
  184. package/dist/lane-query-builder.d.mts +236 -0
  185. package/dist/lane-query-builder.d.mts.map +1 -0
  186. package/dist/lane-query-builder.mjs +67 -0
  187. package/dist/lane-query-builder.mjs.map +1 -0
  188. package/dist/middleware-B4XbF4d4-tfwBl6mX.d.mts +119 -0
  189. package/dist/middleware-B4XbF4d4-tfwBl6mX.d.mts.map +1 -0
  190. package/dist/middleware-ByRsXxxq.d.mts +1 -0
  191. package/dist/middleware-CMr4CHNz-DHIUdxlm.mjs +80 -0
  192. package/dist/middleware-CMr4CHNz-DHIUdxlm.mjs.map +1 -0
  193. package/dist/migration-CK4oePIo.mjs +44 -0
  194. package/dist/migration-CK4oePIo.mjs.map +1 -0
  195. package/dist/migration-CW0ZJLxP.d.mts +44 -0
  196. package/dist/migration-CW0ZJLxP.d.mts.map +1 -0
  197. package/dist/naming-BwqqVcZy-BgTObIQw.mjs +177 -0
  198. package/dist/naming-BwqqVcZy-BgTObIQw.mjs.map +1 -0
  199. package/dist/naming-jLgdauLi-C84G_UHi.d.mts +133 -0
  200. package/dist/naming-jLgdauLi-C84G_UHi.d.mts.map +1 -0
  201. package/dist/operations.d.mts +2 -0
  202. package/dist/operations.mjs +2 -0
  203. package/dist/orm-client.d.mts +1316 -0
  204. package/dist/orm-client.d.mts.map +1 -0
  205. package/dist/orm-client.mjs +4544 -0
  206. package/dist/orm-client.mjs.map +1 -0
  207. package/dist/pack-types-BcLTpwbv.d.mts +14 -0
  208. package/dist/pack-types-BcLTpwbv.d.mts.map +1 -0
  209. package/dist/plan-BTD8xFfa-Dd_K-A1R.d.mts +45 -0
  210. package/dist/plan-BTD8xFfa-Dd_K-A1R.d.mts.map +1 -0
  211. package/dist/plan-CkpcgUaM.mjs +34 -0
  212. package/dist/plan-CkpcgUaM.mjs.map +1 -0
  213. package/dist/plan-Cm4jaoNM.d.mts +2 -0
  214. package/dist/psl-infer-6je61Z6J.d.mts +119 -0
  215. package/dist/psl-infer-6je61Z6J.d.mts.map +1 -0
  216. package/dist/psl-infer-DGftl-HW.mjs +362 -0
  217. package/dist/psl-infer-DGftl-HW.mjs.map +1 -0
  218. package/dist/query-lane-context-Bz8XJZ45.d.mts +1 -0
  219. package/dist/query-lane-context-DtdVMqoz-C2Tj5QHA.d.mts +94 -0
  220. package/dist/query-lane-context-DtdVMqoz-C2Tj5QHA.d.mts.map +1 -0
  221. package/dist/referential-action-sql-Csd6dA8G.d.mts +12 -0
  222. package/dist/referential-action-sql-Csd6dA8G.d.mts.map +1 -0
  223. package/dist/referential-action-sql-DSqkrySN.mjs +17 -0
  224. package/dist/referential-action-sql-DSqkrySN.mjs.map +1 -0
  225. package/dist/relational-core.d.mts +13 -0
  226. package/dist/relational-core.mjs +8 -0
  227. package/dist/relational-core__ast.d.mts +5 -0
  228. package/dist/relational-core__ast.mjs +5 -0
  229. package/dist/relational-core__codec-descriptor-registry.d.mts +39 -0
  230. package/dist/relational-core__codec-descriptor-registry.d.mts.map +1 -0
  231. package/dist/relational-core__codec-descriptor-registry.mjs +2 -0
  232. package/dist/relational-core__contract-free.d.mts +220 -0
  233. package/dist/relational-core__contract-free.d.mts.map +1 -0
  234. package/dist/relational-core__contract-free.mjs +393 -0
  235. package/dist/relational-core__contract-free.mjs.map +1 -0
  236. package/dist/relational-core__expression.d.mts +2 -0
  237. package/dist/relational-core__expression.mjs +2 -0
  238. package/dist/relational-core__middleware.d.mts +3 -0
  239. package/dist/relational-core__middleware.mjs +2 -0
  240. package/dist/relational-core__plan.d.mts +4 -0
  241. package/dist/relational-core__plan.mjs +2 -0
  242. package/dist/relational-core__query-lane-context.d.mts +3 -0
  243. package/dist/relational-core__query-lane-context.mjs +1 -0
  244. package/dist/relational-core__types.d.mts +3 -0
  245. package/dist/relational-core__types.mjs +1 -0
  246. package/dist/resolve-storage-table-DUwyRJmP.d.mts +21 -0
  247. package/dist/resolve-storage-table-DUwyRJmP.d.mts.map +1 -0
  248. package/dist/resolve-storage-table-DZsfnzeW.mjs +46 -0
  249. package/dist/resolve-storage-table-DZsfnzeW.mjs.map +1 -0
  250. package/dist/runtime-DNewRuec.d.mts +46 -0
  251. package/dist/runtime-DNewRuec.d.mts.map +1 -0
  252. package/dist/runtime-tIHpGCcG.mjs +55 -0
  253. package/dist/runtime-tIHpGCcG.mjs.map +1 -0
  254. package/dist/runtime.d.mts +4 -0
  255. package/dist/runtime.mjs +1606 -0
  256. package/dist/runtime.mjs.map +1 -0
  257. package/dist/schema-differ-DpG_gnur-g5_iks8G.d.mts +47 -0
  258. package/dist/schema-differ-DpG_gnur-g5_iks8G.d.mts.map +1 -0
  259. package/dist/schema-ir.d.mts +2 -0
  260. package/dist/schema-ir.mjs +2 -0
  261. package/dist/schema-ir__naming.d.mts +2 -0
  262. package/dist/schema-ir__naming.mjs +2 -0
  263. package/dist/schema-ir__types.d.mts +3 -0
  264. package/dist/schema-ir__types.mjs +2 -0
  265. package/dist/schema-verify-vtFZbmGq-BNfTr6fU.mjs +222 -0
  266. package/dist/schema-verify-vtFZbmGq-BNfTr6fU.mjs.map +1 -0
  267. package/dist/serialized-index-B96AwqtU-DcqcB4q_.d.mts +26 -0
  268. package/dist/serialized-index-B96AwqtU-DcqcB4q_.d.mts.map +1 -0
  269. package/dist/serialized-index-Dp5_EjXD-DMsw8jf3.mjs +64 -0
  270. package/dist/serialized-index-Dp5_EjXD-DMsw8jf3.mjs.map +1 -0
  271. package/dist/sql-contract-serializer-2oBWuxTe-B9hzBBv1.mjs +171 -0
  272. package/dist/sql-contract-serializer-2oBWuxTe-B9hzBBv1.mjs.map +1 -0
  273. package/dist/sql-execution-plan-CJmsCP7n-DoEpNn7r.d.mts +32 -0
  274. package/dist/sql-execution-plan-CJmsCP7n-DoEpNn7r.d.mts.map +1 -0
  275. package/dist/sql-index-DsI8HAeK-BJsn-jvD.d.mts +72 -0
  276. package/dist/sql-index-DsI8HAeK-BJsn-jvD.d.mts.map +1 -0
  277. package/dist/sql-node-kEz6YFZo-v2F7delx.d.mts +42 -0
  278. package/dist/sql-node-kEz6YFZo-v2F7delx.d.mts.map +1 -0
  279. package/dist/sql-storage-B0QwiTg6-B8DVctJm.d.mts +171 -0
  280. package/dist/sql-storage-B0QwiTg6-B8DVctJm.d.mts.map +1 -0
  281. package/dist/storage-table-BBaAmanc-BwR37LMA.d.mts +130 -0
  282. package/dist/storage-table-BBaAmanc-BwR37LMA.d.mts.map +1 -0
  283. package/dist/storage-table-_LWDmPfv-DFhU2dML.mjs +277 -0
  284. package/dist/storage-table-_LWDmPfv-DFhU2dML.mjs.map +1 -0
  285. package/dist/storage-value-set-BGlj5Uus-CvZD--GG.d.mts +41 -0
  286. package/dist/storage-value-set-BGlj5Uus-CvZD--GG.d.mts.map +1 -0
  287. package/dist/timestamp-now-generator-DRXygu32-DN9Qb1uI.mjs +173 -0
  288. package/dist/timestamp-now-generator-DRXygu32-DN9Qb1uI.mjs.map +1 -0
  289. package/dist/types-BchwQpmO.d.mts +16 -0
  290. package/dist/types-BchwQpmO.d.mts.map +1 -0
  291. package/dist/types-BgkZru_1-H7yfikSQ.mjs +1444 -0
  292. package/dist/types-BgkZru_1-H7yfikSQ.mjs.map +1 -0
  293. package/dist/types-CMMQS6aG.mjs +111 -0
  294. package/dist/types-CMMQS6aG.mjs.map +1 -0
  295. package/dist/types-CuDrWc5v-ISVXBmBs.d.mts +134 -0
  296. package/dist/types-CuDrWc5v-ISVXBmBs.d.mts.map +1 -0
  297. package/dist/types-CvbBw1Jo-3KQdErJY.d.mts +688 -0
  298. package/dist/types-CvbBw1Jo-3KQdErJY.d.mts.map +1 -0
  299. package/dist/types-DIBA80mc-wf5wLmON.d.mts +723 -0
  300. package/dist/types-DIBA80mc-wf5wLmON.d.mts.map +1 -0
  301. package/dist/types-DMxc5KZa.d.mts +1 -0
  302. package/dist/types-Dl20lxky-DC_jdA0T.d.mts +247 -0
  303. package/dist/types-Dl20lxky-DC_jdA0T.d.mts.map +1 -0
  304. package/dist/types-DmhUVq4u-BpqqjPJx.mjs +719 -0
  305. package/dist/types-DmhUVq4u-BpqqjPJx.mjs.map +1 -0
  306. package/dist/types-IqZMLrFC-DtdJNICr.d.mts +426 -0
  307. package/dist/types-IqZMLrFC-DtdJNICr.d.mts.map +1 -0
  308. package/dist/types-TvBZ2Ne9.d.mts +1 -0
  309. package/dist/unique-constraint-jQWfH7dg-zLWtFp99.d.mts +32 -0
  310. package/dist/unique-constraint-jQWfH7dg-zLWtFp99.d.mts.map +1 -0
  311. package/dist/util-DQQgv2j1-D6INZaRG.mjs +34 -0
  312. package/dist/util-DQQgv2j1-D6INZaRG.mjs.map +1 -0
  313. package/dist/validators-C4PItWnf.mjs +0 -0
  314. package/dist/validators-C4PItWnf.mjs.map +1 -0
  315. package/dist/validators-CxeHhHrf.d.mts +206 -0
  316. package/dist/validators-CxeHhHrf.d.mts.map +1 -0
  317. package/dist/value-set-derivation-hook-BhgGVtw0.d.mts +35 -0
  318. package/dist/value-set-derivation-hook-BhgGVtw0.d.mts.map +1 -0
  319. package/dist/value-set-derivation-hook-Di9JZ0X7.mjs +22 -0
  320. package/dist/value-set-derivation-hook-Di9JZ0X7.mjs.map +1 -0
  321. package/dist/verify-E6Dd2vYp-gYwnlhLm.mjs +86 -0
  322. package/dist/verify-E6Dd2vYp-gYwnlhLm.mjs.map +1 -0
  323. package/dist/verify-zDRnw0Rn.d.mts +26 -0
  324. package/dist/verify-zDRnw0Rn.d.mts.map +1 -0
  325. package/package.json +112 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.mjs","names":["#ast","#preparedStatementHandles"],"sources":["../../../../2-sql/5-runtime/dist/exports-DcRj136z.mjs"],"sourcesContent":["import { materializeCodec, resolveCodecDescriptorOrThrow } from \"@internal/framework-components/codec\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\nimport { AsyncIterableResult, RuntimeCore, checkAborted, checkMiddlewareCompatibility, raceAgainstAbort, runBeforeExecuteChain, runWithMiddleware, runtimeError } from \"@internal/framework-components/runtime\";\nimport { PreparedParamRef, collectOrderedParamRefs, isQueryAst } from \"@internal/sql-relational-core/ast\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { assertNever } from \"@internal/utils/internal-error\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { checkContractComponentRequirements, mergeCapabilityMatrices } from \"@internal/framework-components/components\";\nimport { createExecutionStack } from \"@internal/framework-components/execution\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { createSqlOperationRegistry } from \"@internal/sql-operations\";\nimport { buildCodecDescriptorRegistry } from \"@internal/sql-relational-core/codec-descriptor-registry\";\nimport { createSqlParamRefMutator } from \"@internal/sql-relational-core/middleware\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { hashContent } from \"@internal/utils/hash-content\";\nimport { createHash } from \"node:crypto\";\n//#region src/codecs/ast-codec-resolver.ts\n/**\n* Build an {@link AstCodecResolver} bound to a descriptor registry and a per-call instance-context factory.\n*\n* The instance-context factory lets callers control `name` / `usedAt` for refs the AST supplies (e.g. AST-embedded migration ops where the materialisation site is the AST node, not a contract column). The contract-walk pre-population path constructs its own contexts and invokes the resolver with those refs to seed the cache.\n*/\nfunction createAstCodecResolver(descriptors, instanceContextFor) {\n\tconst cache = /* @__PURE__ */ new Map();\n\treturn { forCodecRef(ref) {\n\t\tconst key = `${ref.codecId}:${canonicalizeJson(ref.typeParams)}`;\n\t\tconst cached = cache.get(key);\n\t\tif (cached) return cached;\n\t\tconst codec = materializeCodec(resolveCodecDescriptorOrThrow((id) => descriptors.descriptorFor(id), ref, \"RUNTIME.CODEC_DESCRIPTOR_MISSING\"), ref, instanceContextFor(ref));\n\t\tcache.set(key, codec);\n\t\treturn codec;\n\t} };\n}\n//#endregion\n//#region src/codecs/ast-codec-registry.ts\n/**\n* Build a contract-free {@link ContractCodecRegistry} that resolves codecs\n* purely from AST-supplied {@link import('@internal/framework-components/codec').CodecRef}s\n* against a target's descriptor registry.\n*\n* Dispatch is driven entirely by `CodecRef`s embedded in AST nodes; no\n* contract walk is needed. `forColumn` always returns `undefined` — this\n* registry carries no column-to-codec mappings.\n*/\nfunction createAstCodecRegistry(descriptors) {\n\tconst resolver = createAstCodecResolver(descriptors, (ref) => ({\n\t\tname: ref.codecId,\n\t\tusedAt: []\n\t}));\n\treturn {\n\t\tforColumn: () => void 0,\n\t\tforCodecRef: (ref) => resolver.forCodecRef(ref)\n\t};\n}\n//#endregion\n//#region src/codecs/encoding.ts\nconst NO_METADATA = Object.freeze({\n\tcodec: void 0,\n\tname: void 0\n});\nfunction deriveParamMetadata(ast) {\n\treturn collectOrderedParamRefs(ast).map((ref) => {\n\t\treturn {\n\t\t\tcodec: ref.codec,\n\t\t\tname: ref.name\n\t\t};\n\t});\n}\nfunction resolveParamCodec(metadata, contractCodecs) {\n\tif (metadata.codec && contractCodecs) return contractCodecs.forCodecRef(metadata.codec);\n}\nfunction paramLabel(metadata, paramIndex) {\n\treturn metadata.name ?? `param[${paramIndex}]`;\n}\nfunction wrapEncodeFailure(error, metadata, paramIndex, codecId) {\n\tconst label = paramLabel(metadata, paramIndex);\n\tconst wrapped = runtimeError(\"RUNTIME.ENCODE_FAILED\", `Failed to encode parameter ${label} with codec '${codecId}': ${error instanceof Error ? error.message : String(error)}`, {\n\t\tlabel,\n\t\tcodec: codecId,\n\t\tparamIndex\n\t});\n\twrapped.cause = error;\n\tthrow wrapped;\n}\nasync function encodeParamValue(value, metadata, paramIndex, ctx, contractCodecs) {\n\tif (value === null || value === void 0) return null;\n\tconst codec = resolveParamCodec(metadata, contractCodecs);\n\tif (!codec) return value;\n\tif (metadata.codec?.many) {\n\t\tif (!Array.isArray(value)) wrapEncodeFailure(/* @__PURE__ */ new TypeError(`expected an array for many-typed parameter, got ${typeof value}`), metadata, paramIndex, codec.id);\n\t\tconst encoded = [];\n\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\tconst elem = value[i];\n\t\t\tif (elem === null || elem === void 0) {\n\t\t\t\tencoded.push(null);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tencoded.push(await codec.encode(elem, ctx));\n\t\t\t} catch (error) {\n\t\t\t\tif (isStructuredError(error)) throw error;\n\t\t\t\twrapEncodeFailure(error, metadata, paramIndex, codec.id);\n\t\t\t}\n\t\t}\n\t\treturn encoded;\n\t}\n\ttry {\n\t\treturn await codec.encode(value, ctx);\n\t} catch (error) {\n\t\tif (isStructuredError(error)) throw error;\n\t\twrapEncodeFailure(error, metadata, paramIndex, codec.id);\n\t}\n}\n/**\n* Encodes all parameters concurrently via `Promise.all`. Per parameter, sync-and async-authored codecs share the same path: `codec.encode → await → return`. Param-level failures are wrapped in `RUNTIME.ENCODE_FAILED`.\n*\n* When `ctx.signal` is provided:\n*\n* - **Already-aborted at entry** short-circuits with `RUNTIME.ABORTED` (`{ phase: 'encode' }`) before any `codec.encode` call is made — codecs can pin this with a per-call counter that stays at zero.\n* - **Mid-flight abort** races the per-param `Promise.all` against `abortable(ctx.signal)`. The runtime returns `RUNTIME.ABORTED` promptly even if codec bodies ignore the signal; the in-flight bodies are abandoned and run to completion in the background (cooperative cancellation, see ADR 204).\n* - Existing structured envelopes (any dotted-code error passing `isStructuredError`, e.g. `RUNTIME.ENCODE_FAILED`) that surface from a codec body before the runtime observes the abort pass through unchanged (no double wrap).\n*/\nasync function encodeParams(plan, ctx, contractCodecs) {\n\treturn encodeParamsWithMetadata(plan.params, deriveParamMetadata(plan.ast), ctx, contractCodecs);\n}\nasync function encodeParamsWithMetadata(values, metadata, ctx, contractCodecs) {\n\tcheckAborted(ctx, \"encode\");\n\tconst signal = ctx.signal;\n\tif (values.length === 0) return values;\n\tconst tasks = values.map((value, i) => encodeParamValue(value, metadata[i] ?? NO_METADATA, i, ctx, contractCodecs));\n\tconst settled = await raceAgainstAbort(Promise.all(tasks), signal, \"encode\");\n\treturn Object.freeze(settled);\n}\n//#endregion\n//#region src/codecs/validation.ts\nfunction extractCodecIds(contract) {\n\tconst codecIds = /* @__PURE__ */ new Set();\n\tfor (const ns of Object.values(contract.storage.namespaces)) for (const table of Object.values(ns.entries.table ?? {})) for (const column of Object.values(table.columns)) {\n\t\tconst codecId = column.codecId;\n\t\tcodecIds.add(codecId);\n\t}\n\treturn codecIds;\n}\nfunction extractColumnCodecRefs(contract) {\n\tconst refs = [];\n\tfor (const [namespaceId, ns] of Object.entries(contract.storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) for (const [columnName, column] of Object.entries(table.columns)) refs.push({\n\t\tnamespaceId,\n\t\ttable: tableName,\n\t\tcolumn: columnName,\n\t\tcodecId: column.codecId\n\t});\n\treturn refs;\n}\nfunction validateContractCodecMappings(registry, contract) {\n\tconst invalidCodecs = extractColumnCodecRefs(contract).filter((ref) => registry.descriptorFor(ref.codecId) === void 0);\n\tif (invalidCodecs.length > 0) {\n\t\tconst details = {\n\t\t\tcontractTarget: contract.target,\n\t\t\tinvalidCodecs\n\t\t};\n\t\tthrow runtimeError(\"RUNTIME.CODEC_MISSING\", `Missing codec implementations for column codecIds: ${invalidCodecs.map((c) => `${c.namespaceId}.${c.table}.${c.column} (${c.codecId})`).join(\", \")}`, details);\n\t}\n}\nfunction validateCodecRegistryCompleteness(registry, contract) {\n\tvalidateContractCodecMappings(registry, contract);\n}\n//#endregion\n//#region src/lower-sql-plan.ts\n/**\n* Lowers a SQL query plan to an executable Plan by calling the adapter's lower method.\n*\n* Ad-hoc lowerings produce only `{kind: 'literal'}` slots; this helper\n* unwraps them into the bare-value array `SqlExecutionPlan` exposes.\n* Encountering a `{kind: 'bind'}` slot here means the caller passed an\n* AST containing `PreparedParamRef` to the ad-hoc execute path — that's a\n* caller error, surfaced as `RUNTIME.PREPARE_BIND_ON_ADHOC`.\n*/\nfunction lowerSqlPlan(adapter, contract, queryPlan) {\n\tconst lowered = adapter.lower(queryPlan.ast, {\n\t\tcontract,\n\t\tparams: queryPlan.params\n\t});\n\tconst params = lowered.params.map((slot) => {\n\t\tif (slot.kind === \"literal\") return slot.value;\n\t\tthrow runtimeError(\"RUNTIME.PREPARE_BIND_ON_ADHOC\", `Ad-hoc execute received a bind-site slot for '${slot.name}' — bind-site references are only valid inside runtime.prepare(...).`, { name: slot.name });\n\t});\n\treturn Object.freeze({\n\t\tsql: lowered.sql,\n\t\tparams,\n\t\tast: queryPlan.ast,\n\t\tmeta: queryPlan.meta\n\t});\n}\n//#endregion\n//#region src/middleware/budgets.ts\nfunction hasAggregateWithoutGroupBy(ast) {\n\tif (ast.groupBy !== void 0) return false;\n\treturn ast.projection.some((item) => item.expr.kind === \"aggregate\");\n}\nfunction primaryTableFromAst(ast) {\n\tif (ast.from === void 0) return void 0;\n\tswitch (ast.from.kind) {\n\t\tcase \"table-source\": return ast.from.name;\n\t\tcase \"derived-table-source\": return ast.from.alias;\n\t\tcase \"function-source\": return ast.from.fn;\n\t\t// v8 ignore next 4\n\t\tdefault: return assertNever(ast.from, `Unsupported source kind: ${ast.from.kind}`);\n\t}\n}\nfunction estimateRowsFromAst(ast, tableRows, defaultTableRows, hasAggregateWithoutGroup) {\n\tif (hasAggregateWithoutGroup) return 1;\n\tconst primaryTable = primaryTableFromAst(ast);\n\tconst tableEstimate = (primaryTable !== void 0 ? tableRows[primaryTable] : void 0) ?? defaultTableRows;\n\tif (typeof ast.limit === \"number\") return Math.min(ast.limit, tableEstimate);\n\treturn tableEstimate;\n}\nfunction emitBudgetViolation(error, shouldBlock, ctx) {\n\tif (shouldBlock) throw error;\n\tctx.log.warn({\n\t\tcode: error.code,\n\t\tmessage: error.message,\n\t\tdetails: error.details\n\t});\n}\nfunction budgets(options) {\n\tconst maxRows = options?.maxRows ?? 1e4;\n\tconst defaultTableRows = options?.defaultTableRows ?? 1e4;\n\tconst tableRows = options?.tableRows ?? {};\n\tconst maxLatencyMs = options?.maxLatencyMs ?? 1e3;\n\tconst rowSeverity = options?.severities?.rowCount ?? \"error\";\n\tconst latencySeverity = options?.severities?.latency ?? \"warn\";\n\tconst observedRowsByPlan = /* @__PURE__ */ new WeakMap();\n\treturn Object.freeze({\n\t\tname: \"budgets\",\n\t\tfamilyId: \"sql\",\n\t\tasync beforeExecute(plan, ctx) {\n\t\t\tobservedRowsByPlan.set(plan, { count: 0 });\n\t\t\tif (isQueryAst(plan.ast) && plan.ast.kind === \"select\") return evaluateSelectAst(plan.ast, ctx);\n\t\t},\n\t\tasync onRow(_row, plan, _ctx) {\n\t\t\tconst state = observedRowsByPlan.get(plan);\n\t\t\tif (!state) return;\n\t\t\tstate.count += 1;\n\t\t\tif (state.count > maxRows) throw runtimeError(\"BUDGET.ROWS_EXCEEDED\", \"Observed row count exceeds budget\", {\n\t\t\t\tsource: \"observed\",\n\t\t\t\tobservedRows: state.count,\n\t\t\t\tmaxRows\n\t\t\t});\n\t\t},\n\t\tasync afterExecute(_plan, result, ctx) {\n\t\t\tconst latencyMs = result.latencyMs;\n\t\t\tif (latencyMs > maxLatencyMs) {\n\t\t\t\tconst shouldBlock = latencySeverity === \"error\" || ctx.mode === \"strict\";\n\t\t\t\temitBudgetViolation(runtimeError(\"BUDGET.TIME_EXCEEDED\", \"Query latency exceeds budget\", {\n\t\t\t\t\tlatencyMs,\n\t\t\t\t\tmaxLatencyMs\n\t\t\t\t}), shouldBlock, ctx);\n\t\t\t}\n\t\t}\n\t});\n\tfunction evaluateSelectAst(ast, ctx) {\n\t\tconst hasAggNoGroup = hasAggregateWithoutGroupBy(ast);\n\t\tconst estimated = estimateRowsFromAst(ast, tableRows, defaultTableRows, hasAggNoGroup);\n\t\tconst isUnbounded = ast.limit === void 0 && !hasAggNoGroup;\n\t\tconst shouldBlock = rowSeverity === \"error\" || ctx.mode === \"strict\";\n\t\tif (isUnbounded) {\n\t\t\temitBudgetViolation(runtimeError(\"BUDGET.ROWS_EXCEEDED\", \"Unbounded SELECT query exceeds budget\", estimated >= maxRows ? {\n\t\t\t\tsource: \"ast\",\n\t\t\t\testimatedRows: estimated,\n\t\t\t\tmaxRows\n\t\t\t} : {\n\t\t\t\tsource: \"ast\",\n\t\t\t\tmaxRows\n\t\t\t}), shouldBlock, ctx);\n\t\t\treturn;\n\t\t}\n\t\tif (estimated > maxRows) emitBudgetViolation(runtimeError(\"BUDGET.ROWS_EXCEEDED\", \"Estimated row count exceeds budget\", {\n\t\t\tsource: \"ast\",\n\t\t\testimatedRows: estimated,\n\t\t\tmaxRows\n\t\t}), shouldBlock, ctx);\n\t}\n}\n//#endregion\n//#region src/guardrails/raw.ts\nconst SELECT_STAR_REGEX = /select\\s+\\*/i;\nconst LIMIT_REGEX = /\\blimit\\b/i;\nconst MUTATION_PREFIX_REGEX = /^(insert|update|delete|create|alter|drop|truncate)\\b/i;\nconst READ_ONLY_INTENTS = /* @__PURE__ */ new Set([\n\t\"read\",\n\t\"report\",\n\t\"readonly\"\n]);\nfunction evaluateRawGuardrails(plan, config) {\n\tconst lints = [];\n\tconst budgets = [];\n\tconst normalized = normalizeWhitespace(plan.sql);\n\tconst statementType = classifyStatement(normalized);\n\tif (statementType === \"select\") {\n\t\tif (SELECT_STAR_REGEX.test(normalized)) lints.push(createLint(\"LINT.SELECT_STAR\", \"error\", \"Raw SQL plan selects all columns via *\", { sql: snippet(plan.sql) }));\n\t\tif (!LIMIT_REGEX.test(normalized)) {\n\t\t\tconst severity = config?.budgets?.unboundedSelectSeverity ?? \"error\";\n\t\t\tlints.push(createLint(\"LINT.NO_LIMIT\", \"warn\", \"Raw SQL plan omits LIMIT clause\", { sql: snippet(plan.sql) }));\n\t\t\tbudgets.push(createBudget(\"BUDGET.ROWS_EXCEEDED\", severity, \"Raw SQL plan is unbounded and may exceed row budget\", {\n\t\t\t\tsql: snippet(plan.sql),\n\t\t\t\t...config?.budgets?.estimatedRows !== void 0 ? { estimatedRows: config.budgets.estimatedRows } : {}\n\t\t\t}));\n\t\t}\n\t}\n\tif (isMutationStatement(statementType) && isReadOnlyIntent(plan.meta)) lints.push(createLint(\"LINT.READ_ONLY_MUTATION\", \"error\", \"Raw SQL plan mutates data despite read-only intent\", {\n\t\tsql: snippet(plan.sql),\n\t\tintent: plan.meta.annotations?.[\"intent\"]\n\t}));\n\treturn {\n\t\tlints,\n\t\tbudgets,\n\t\tstatement: statementType\n\t};\n}\nfunction classifyStatement(sql) {\n\tconst trimmed = sql.trim();\n\tconst lower = trimmed.toLowerCase();\n\tif (lower.startsWith(\"with\")) {\n\t\tif (lower.includes(\"select\")) return \"select\";\n\t}\n\tif (lower.startsWith(\"select\")) return \"select\";\n\tif (MUTATION_PREFIX_REGEX.test(trimmed)) return \"mutation\";\n\treturn \"other\";\n}\nfunction isMutationStatement(statement) {\n\treturn statement === \"mutation\";\n}\nfunction isReadOnlyIntent(meta) {\n\tconst annotations = meta.annotations;\n\tconst intent = typeof annotations?.intent === \"string\" ? annotations.intent.toLowerCase() : void 0;\n\treturn intent !== void 0 && READ_ONLY_INTENTS.has(intent);\n}\nfunction normalizeWhitespace(value) {\n\treturn value.replace(/\\s+/g, \" \").trim();\n}\nfunction snippet(sql) {\n\treturn normalizeWhitespace(sql).slice(0, 200);\n}\nfunction createLint(code, severity, message, details) {\n\treturn {\n\t\tcode,\n\t\tseverity,\n\t\tmessage,\n\t\t...details ? { details } : {}\n\t};\n}\nfunction createBudget(code, severity, message, details) {\n\treturn {\n\t\tcode,\n\t\tseverity,\n\t\tmessage,\n\t\t...details ? { details } : {}\n\t};\n}\n//#endregion\n//#region src/middleware/lints.ts\nfunction getFromSourceTableDetail(source) {\n\tswitch (source.kind) {\n\t\tcase \"table-source\": return source.name;\n\t\tcase \"derived-table-source\": return source.alias;\n\t\tcase \"function-source\": return source.fn;\n\t\t// v8 ignore next 4\n\t\tdefault: return assertNever(source, `Unsupported source kind: ${source.kind}`);\n\t}\n}\nfunction evaluateAstLints(ast) {\n\tconst findings = [];\n\tswitch (ast.kind) {\n\t\tcase \"delete\":\n\t\t\tif (ast.where === void 0) findings.push({\n\t\t\t\tcode: \"LINT.DELETE_WITHOUT_WHERE\",\n\t\t\t\tseverity: \"error\",\n\t\t\t\tmessage: \"DELETE without WHERE clause blocks execution to prevent accidental full-table deletion\",\n\t\t\t\tdetails: { table: ast.table.name }\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"update\":\n\t\t\tif (ast.where === void 0) findings.push({\n\t\t\t\tcode: \"LINT.UPDATE_WITHOUT_WHERE\",\n\t\t\t\tseverity: \"error\",\n\t\t\t\tmessage: \"UPDATE without WHERE clause blocks execution to prevent accidental full-table update\",\n\t\t\t\tdetails: { table: ast.table.name }\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"select\":\n\t\t\tif (ast.limit === void 0) {\n\t\t\t\tconst table = ast.from !== void 0 ? getFromSourceTableDetail(ast.from) : void 0;\n\t\t\t\tfindings.push({\n\t\t\t\t\tcode: \"LINT.NO_LIMIT\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\tmessage: \"Unbounded SELECT may return large result sets\",\n\t\t\t\t\t...ifDefined(\"details\", table !== void 0 ? { table } : void 0)\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (ast.selectAllIntent !== void 0) {\n\t\t\t\tconst table = ast.selectAllIntent.table;\n\t\t\t\tfindings.push({\n\t\t\t\t\tcode: \"LINT.SELECT_STAR\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\tmessage: \"Query selects all columns via selectAll intent\",\n\t\t\t\t\t...ifDefined(\"details\", table !== void 0 ? { table } : void 0)\n\t\t\t\t});\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"insert\": break;\n\t\tcase \"raw-sql\": break;\n\t\t// v8 ignore next 2\n\t\tdefault: assertNever(ast, `Unsupported AST kind: ${ast.kind}`);\n\t}\n\treturn findings;\n}\nfunction getConfiguredSeverity(code, options) {\n\tconst severities = options?.severities;\n\tif (!severities) return void 0;\n\tswitch (code) {\n\t\tcase \"LINT.SELECT_STAR\": return severities.selectStar;\n\t\tcase \"LINT.NO_LIMIT\": return severities.noLimit;\n\t\tcase \"LINT.DELETE_WITHOUT_WHERE\": return severities.deleteWithoutWhere;\n\t\tcase \"LINT.UPDATE_WITHOUT_WHERE\": return severities.updateWithoutWhere;\n\t\tcase \"LINT.READ_ONLY_MUTATION\": return severities.readOnlyMutation;\n\t\tdefault: return;\n\t}\n}\n/**\n* AST-first lint middleware for SQL plans. When `plan.ast` is a SQL QueryAst, inspects\n* the AST structurally. When `plan.ast` is missing, falls back to raw heuristic\n* guardrails or skips linting depending on `fallbackWhenAstMissing`.\n*\n* Rules (AST-based):\n* - DELETE without WHERE: blocks execution (configurable severity, default error)\n* - UPDATE without WHERE: blocks execution (configurable severity, default error)\n* - Unbounded SELECT: warn/error (severity from noLimit)\n* - SELECT * intent: warn/error (severity from selectStar)\n*\n* Fallback: When ast is missing, `fallbackWhenAstMissing: 'raw'` uses heuristic\n* SQL parsing; `'skip'` skips all lints. Default is `'raw'`.\n*/\nfunction lints(options) {\n\tconst fallback = options?.fallbackWhenAstMissing ?? \"raw\";\n\treturn Object.freeze({\n\t\tname: \"lints\",\n\t\tfamilyId: \"sql\",\n\t\tasync beforeExecute(plan, ctx) {\n\t\t\tconst findings = [];\n\t\t\tif (isQueryAst(plan.ast)) {\n\t\t\t\tfindings.push(...evaluateAstLints(plan.ast));\n\t\t\t\tif (plan.ast.kind === \"raw-sql\") findings.push(...evaluateRawGuardrails(plan).lints);\n\t\t\t} else if (fallback !== \"skip\") findings.push(...evaluateRawGuardrails(plan).lints);\n\t\t\tfor (const lint of findings) {\n\t\t\t\tconst effectiveSeverity = getConfiguredSeverity(lint.code, options) ?? lint.severity;\n\t\t\t\tif (effectiveSeverity === \"error\") throw runtimeError(lint.code, lint.message, lint.details);\n\t\t\t\tif (effectiveSeverity === \"warn\") ctx.log.warn({\n\t\t\t\t\tcode: lint.code,\n\t\t\t\t\tmessage: lint.message,\n\t\t\t\t\tdetails: lint.details\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n}\n//#endregion\n//#region src/prepared/prepared-statement.ts\nvar PreparedStatementImpl = class {\n\tsql;\n\tast;\n\tmeta;\n\tslots;\n\tdecodeContext;\n\tparamMetadata;\n\tconstructor(internals) {\n\t\tthis.sql = internals.sql;\n\t\tthis.ast = internals.ast;\n\t\tthis.meta = internals.meta;\n\t\tthis.slots = internals.slots;\n\t\tthis.decodeContext = internals.decodeContext;\n\t\tthis.paramMetadata = internals.paramMetadata;\n\t\tObject.freeze(this);\n\t}\n\texecute(target, params, options) {\n\t\treturn target.executePrepared(this, params, options);\n\t}\n};\n//#endregion\n//#region src/sql-context.ts\nfunction documentScopedCodecTypes(contract) {\n\treturn blindCast(contract.storage.types);\n}\nfunction createSqlExecutionStack(options) {\n\treturn createExecutionStack({\n\t\ttarget: options.target,\n\t\tadapter: options.adapter,\n\t\tdriver: options.driver,\n\t\textensions: options.extensions\n\t});\n}\nfunction assertExecutionStackContractRequirements(contract, stack) {\n\tconst providedComponentIds = /* @__PURE__ */ new Set([\n\t\tstack.target.id,\n\t\tstack.adapter.id,\n\t\t...stack.extensions.map((pack) => pack.id)\n\t]);\n\tconst result = checkContractComponentRequirements({\n\t\tcontract,\n\t\texpectedTargetFamily: \"sql\",\n\t\texpectedTargetId: stack.target.targetId,\n\t\tprovidedComponentIds\n\t});\n\tif (result.familyMismatch) throw runtimeError(\"RUNTIME.CONTRACT_FAMILY_MISMATCH\", `Contract target family '${result.familyMismatch.actual}' does not match runtime family '${result.familyMismatch.expected}'.`, {\n\t\tactual: result.familyMismatch.actual,\n\t\texpected: result.familyMismatch.expected\n\t});\n\tif (result.targetMismatch) throw runtimeError(\"RUNTIME.CONTRACT_TARGET_MISMATCH\", `Contract target '${result.targetMismatch.actual}' does not match runtime target descriptor '${result.targetMismatch.expected}'.`, {\n\t\tactual: result.targetMismatch.actual,\n\t\texpected: result.targetMismatch.expected\n\t});\n\tif (result.missingExtensionPackIds.length > 0) {\n\t\tconst packIds = result.missingExtensionPackIds;\n\t\tthrow runtimeError(\"RUNTIME.MISSING_EXTENSION_PACK\", `Contract requires extension pack(s) ${packIds.map((id) => `'${id}'`).join(\", \")}, but runtime descriptors do not provide matching component(s).`, { packIds });\n\t}\n}\nfunction validateTypeParams(typeParams, descriptor, context) {\n\tconst result = descriptor.paramsSchema[\"~standard\"].validate(typeParams);\n\tif (result instanceof Promise) throw runtimeError(\"RUNTIME.TYPE_PARAMS_INVALID\", `paramsSchema for codec '${descriptor.codecId}' returned a Promise; runtime validation requires a synchronous Standard Schema validator.`, {\n\t\t...context,\n\t\tcodecId: descriptor.codecId,\n\t\ttypeParams\n\t});\n\tif (result.issues) {\n\t\tconst messages = result.issues.map((issue) => issue.message).join(\"; \");\n\t\tthrow runtimeError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid typeParams for ${context.typeName ? `type '${context.typeName}'` : `column '${context.tableName}.${context.columnName}'`} (codecId: ${descriptor.codecId}): ${messages}`, {\n\t\t\t...context,\n\t\t\tcodecId: descriptor.codecId,\n\t\t\ttypeParams\n\t\t});\n\t}\n\treturn result.value;\n}\n/**\n* Collect every {@link CodecDescriptor} contributed by the SQL stack and partition into \"parameterized\" vs \"non-parameterized\" via the descriptor's own {@link CodecDescriptorImpl.isParameterized} getter. The getter is the canonical discriminator — a `paramsSchema` identity check would misroute any descriptor that doesn't reuse the exact `voidParamsSchema` singleton (e.g. a non-parameterized codec authoring its own no-op schema).\n*\n* The unified descriptor list collapses the legacy split (a separate slot used to register parameterized codecs) — every codec id resolves through the same map (codec-registry-unification spec § Decision).\n*/\nfunction collectCodecDescriptors(contributors) {\n\tconst all = [];\n\tconst parameterized = /* @__PURE__ */ new Map();\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const contributor of contributors) for (const descriptor of contributor.codecs()) {\n\t\tif (seen.has(descriptor.codecId)) throw runtimeError(\"RUNTIME.DUPLICATE_CODEC\", `Duplicate codec descriptor for codecId '${descriptor.codecId}'.`, { codecId: descriptor.codecId });\n\t\tseen.add(descriptor.codecId);\n\t\tall.push(descriptor);\n\t\tif (descriptor.isParameterized) parameterized.set(descriptor.codecId, descriptor);\n\t}\n\treturn {\n\t\tall,\n\t\tparameterized\n\t};\n}\nfunction collectTypeRefSites(storage) {\n\tconst sites = /* @__PURE__ */ new Map();\n\tfor (const ns of Object.values(storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) for (const [columnName, column] of Object.entries(table.columns)) {\n\t\tif (typeof column.typeRef !== \"string\") continue;\n\t\tconst list = sites.get(column.typeRef);\n\t\tconst entry = {\n\t\t\ttable: tableName,\n\t\t\tcolumn: columnName\n\t\t};\n\t\tif (list) list.push(entry);\n\t\telse sites.set(column.typeRef, [entry]);\n\t}\n\treturn sites;\n}\nfunction initializeTypeHelpers(storage, documentTypes, codecDescriptors) {\n\tconst helpers = {};\n\tif (!documentTypes) return helpers;\n\tconst typeRefSites = collectTypeRefSites(storage);\n\tfor (const [typeName, typeInstance] of Object.entries(documentTypes)) {\n\t\tconst codecId = typeInstance.codecId;\n\t\tconst typeParams = typeInstance.typeParams;\n\t\tconst descriptor = codecDescriptors.get(codecId);\n\t\tif (!descriptor) {\n\t\t\thelpers[typeName] = typeInstance;\n\t\t\tcontinue;\n\t\t}\n\t\tconst validatedParams = validateTypeParams(typeParams ?? {}, descriptor, { typeName });\n\t\tconst ctx = {\n\t\t\tname: typeName,\n\t\t\tusedAt: typeRefSites.get(typeName) ?? []\n\t\t};\n\t\thelpers[typeName] = descriptor.factory(validatedParams)(ctx);\n\t}\n\treturn helpers;\n}\nfunction validateColumnTypeParams(storage, codecDescriptors) {\n\tfor (const ns of Object.values(storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) for (const [columnName, column] of Object.entries(table.columns)) if (column.typeParams) {\n\t\tconst descriptor = codecDescriptors.get(column.codecId);\n\t\tif (descriptor) validateTypeParams(column.typeParams, descriptor, {\n\t\t\ttableName,\n\t\t\tcolumnName\n\t\t});\n\t}\n}\n/**\n* Build-time contract-integrity check: every `(table, column)` resolves to a {@link CodecRef} whose `codecId` is registered and whose `typeParams` presence matches the descriptor's `isParameterized` flag.\n*\n* Surfaces three classes of malformed contract that AST-bound codec resolution would otherwise mask silently:\n*\n* - column references a codecId no contributor registered → `RUNTIME.CODEC_DESCRIPTOR_MISSING`.\n* - parameterized codec, no `typeParams` (legacy \"tolerate refs without params\" shape) → `RUNTIME.CODEC_PARAMETERIZATION_MISMATCH`.\n* - non-parameterized codec, `typeParams` supplied → `RUNTIME.CODEC_PARAMETERIZATION_MISMATCH`.\n*\n* Runs unconditionally from `createExecutionContext` so contract bugs fail fast at construction time instead of silently skipping affected columns in the codec registry's pre-population walk.\n*/\nfunction assertColumnCodecIntegrity(storage, codecDescriptors) {\n\tfor (const [namespaceId, ns] of Object.entries(storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) for (const columnName of Object.keys(table.columns)) {\n\t\tconst ref = codecDescriptors.codecRefForColumn(namespaceId, tableName, columnName);\n\t\tif (!ref) continue;\n\t\tconst descriptor = codecDescriptors.descriptorFor(ref.codecId);\n\t\tif (!descriptor) throw runtimeError(\"RUNTIME.CODEC_DESCRIPTOR_MISSING\", `Column '${tableName}.${columnName}' references codec '${ref.codecId}' but no contributor registered a codec descriptor for that codecId. Add the extension pack that owns the codec to the runtime stack.`, {\n\t\t\ttable: tableName,\n\t\t\tcolumn: columnName,\n\t\t\tcodecId: ref.codecId\n\t\t});\n\t\tif (descriptor.isParameterized && ref.typeParams === void 0) {\n\t\t\tconst probe = descriptor.paramsSchema[\"~standard\"].validate({});\n\t\t\tif (probe instanceof Promise) {\n\t\t\t\tprobe.catch(() => {});\n\t\t\t\tthrow runtimeError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Column '${tableName}.${columnName}' uses parameterized codec '${ref.codecId}' whose paramsSchema returned a Promise; paramsSchema must be a synchronous Standard Schema validator. Return a value/issues result directly instead of a Promise.`, {\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\tcolumn: columnName,\n\t\t\t\t\tcodecId: ref.codecId\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (\"issues\" in probe && !!probe.issues) throw runtimeError(\"RUNTIME.CODEC_PARAMETERIZATION_MISMATCH\", `Column '${tableName}.${columnName}' uses parameterized codec '${ref.codecId}' but no typeParams are supplied. Provide typeParams on the column, or use a typeRef pointing at a storage.types entry that carries them.`, {\n\t\t\t\ttable: tableName,\n\t\t\t\tcolumn: columnName,\n\t\t\t\tcodecId: ref.codecId,\n\t\t\t\texpected: \"parameterized\",\n\t\t\t\tactual: \"no typeParams\"\n\t\t\t});\n\t\t}\n\t\tconst refTypeParams = ref.typeParams;\n\t\tconst refHasTypeParamKeys = refTypeParams !== void 0 && refTypeParams !== null && typeof refTypeParams === \"object\" && !Array.isArray(refTypeParams) && Object.keys(refTypeParams).length > 0;\n\t\tif (!descriptor.isParameterized && refHasTypeParamKeys) throw runtimeError(\"RUNTIME.CODEC_PARAMETERIZATION_MISMATCH\", `Column '${tableName}.${columnName}' supplies typeParams to non-parameterized codec '${ref.codecId}'. Remove the typeParams or switch to a parameterized codec id.`, {\n\t\t\ttable: tableName,\n\t\t\tcolumn: columnName,\n\t\t\tcodecId: ref.codecId,\n\t\t\texpected: \"non-parameterized\",\n\t\t\tactual: \"has typeParams\"\n\t\t});\n\t}\n}\n/**\n* Build a {@link ContractCodecRegistry} that resolves codecs exclusively through the `forCodecRef` content-keyed cache.\n*\n* One pre-population pass walks `storage.types` and `storage.tables[].columns[]` to seed the resolver's per-ref instance context with the *aggregated* `usedAt` set for each canonical `(codecId, typeParams)` key. The same codec materialised through `forColumn` or `forCodecRef` is therefore one instance with one `SqlCodecInstanceContext` — stateful codecs reading `usedAt` see the full column set regardless of which surface the caller used.\n*\n* Per-key instance-name policy:\n*\n* - typeRef-shared columns use the `storage.types[name]` name.\n* - inline-`typeParams` columns use `<col:Table.column>` (the first column observed at that key; additional columns sharing the key extend `usedAt`).\n* - non-parameterized codec ids use `<codec:codecId>`, aggregating every column on that codec id into one `usedAt` set.\n* - ad-hoc refs the contract walk did not pre-populate (e.g. AST-supplied refs from deserialised migration ops) fall back to the canonical cache key `${codecId}:${canonicalizeJson(typeParams)}` — the only structurally honest identity for an ad-hoc ref, distinct per `(codecId, typeParams)`.\n*\n* Contract integrity is enforced upstream by {@link assertColumnCodecIntegrity}: every column must reference a registered `codecId` whose `descriptor.isParameterized` flag matches the presence of `typeParams` (via `codecRefForColumn`). The pre-population walk and `forColumn` therefore make no defensive checks — malformed columns fail fast at `createExecutionContext` construction with `RUNTIME.CODEC_DESCRIPTOR_MISSING` or `RUNTIME.CODEC_PARAMETERIZATION_MISMATCH` rather than being silently skipped here.\n*\n* `forColumn(ns, t, c)` is a thin delegate over `forCodecRef(codecRefForColumn(ns, t, c))`; encode/decode hot paths read the resolver directly via `forCodecRef`. The only `undefined` `forColumn` returns is the legitimate \"no such column in the contract\" case.\n*/\nfunction buildContractCodecRegistry(contract, codecDescriptors) {\n\tconst refKeyOf = (ref) => `${ref.codecId}:${canonicalizeJson(ref.typeParams)}`;\n\tconst usedAtByKey = /* @__PURE__ */ new Map();\n\tconst nameByKey = /* @__PURE__ */ new Map();\n\tconst typeRefSites = collectTypeRefSites(contract.storage);\n\tfor (const [typeName, typeInstance] of Object.entries(documentScopedCodecTypes(contract) ?? {})) {\n\t\tconst instanceTypeParams = typeInstance.typeParams;\n\t\tconst key = refKeyOf(instanceTypeParams !== void 0 && Object.keys(instanceTypeParams).length > 0 ? {\n\t\t\tcodecId: typeInstance.codecId,\n\t\t\ttypeParams: instanceTypeParams\n\t\t} : { codecId: typeInstance.codecId });\n\t\tconst sites = typeRefSites.get(typeName) ?? [];\n\t\tconst existing = usedAtByKey.get(key);\n\t\tif (existing) existing.push(...sites);\n\t\telse {\n\t\t\tusedAtByKey.set(key, [...sites]);\n\t\t\tnameByKey.set(key, typeName);\n\t\t}\n\t}\n\tfor (const [namespaceId, ns] of Object.entries(contract.storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) for (const [columnName, column] of Object.entries(table.columns)) {\n\t\tif (column.typeRef !== void 0) continue;\n\t\tconst ref = codecDescriptors.codecRefForColumn(namespaceId, tableName, columnName);\n\t\tif (!ref) continue;\n\t\tconst key = refKeyOf(ref);\n\t\tconst site = {\n\t\t\ttable: tableName,\n\t\t\tcolumn: columnName\n\t\t};\n\t\tconst existing = usedAtByKey.get(key);\n\t\tif (existing) existing.push(site);\n\t\telse {\n\t\t\tusedAtByKey.set(key, [site]);\n\t\t\tconst name = ref.typeParams !== void 0 ? `<col:${tableName}.${columnName}>` : `<codec:${ref.codecId}>`;\n\t\t\tnameByKey.set(key, name);\n\t\t}\n\t}\n\tconst resolver = createAstCodecResolver(codecDescriptors, (ref) => {\n\t\tconst key = refKeyOf(ref);\n\t\treturn {\n\t\t\tname: nameByKey.get(key) ?? key,\n\t\t\tusedAt: usedAtByKey.get(key) ?? []\n\t\t};\n\t});\n\tfor (const [namespaceId, ns] of Object.entries(contract.storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) for (const columnName of Object.keys(table.columns)) {\n\t\tconst ref = codecDescriptors.codecRefForColumn(namespaceId, tableName, columnName);\n\t\tif (!ref) continue;\n\t\tresolver.forCodecRef(ref);\n\t}\n\treturn {\n\t\tforColumn(namespaceId, table, column) {\n\t\t\tconst ref = codecDescriptors.codecRefForColumn(namespaceId, table, column);\n\t\t\treturn ref ? resolver.forCodecRef(ref) : void 0;\n\t\t},\n\t\tforCodecRef(ref) {\n\t\t\treturn resolver.forCodecRef(ref);\n\t\t}\n\t};\n}\nfunction assertMutationDefaultGeneratorsAvailable(contract, generatorRegistry) {\n\tconst defaults = contract.execution?.mutations.defaults ?? [];\n\tif (defaults.length === 0) return;\n\tconst missing = /* @__PURE__ */ new Set();\n\tfor (const mutationDefault of defaults) for (const phase of [mutationDefault.onCreate, mutationDefault.onUpdate]) {\n\t\tif (!phase) continue;\n\t\tif (phase.kind === \"generator\" && !generatorRegistry.has(phase.id)) missing.add(phase.id);\n\t}\n\tif (missing.size === 0) return;\n\tconst ids = Array.from(missing);\n\tthrow runtimeError(\"RUNTIME.MUTATION_DEFAULT_GENERATOR_MISSING\", `Contract requires mutation default generator(s) ${ids.map((id) => `'${id}'`).join(\", \")}, but no runtime component provides them.`, { ids });\n}\nfunction collectMutationDefaultGenerators(contributors) {\n\tconst generators = /* @__PURE__ */ new Map();\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const contributor of contributors) {\n\t\tconst nextGenerators = contributor.mutationDefaultGenerators?.() ?? [];\n\t\tfor (const generator of nextGenerators) {\n\t\t\tconst existingOwner = owners.get(generator.id);\n\t\t\tif (existingOwner !== void 0) throw runtimeError(\"RUNTIME.DUPLICATE_MUTATION_DEFAULT_GENERATOR\", `Duplicate mutation default generator '${generator.id}'.`, {\n\t\t\t\tid: generator.id,\n\t\t\t\texistingOwner,\n\t\t\t\tincomingOwner: contributor.id\n\t\t\t});\n\t\t\tgenerators.set(generator.id, generator);\n\t\t\towners.set(generator.id, contributor.id);\n\t\t}\n\t}\n\treturn generators;\n}\nfunction computeExecutionDefaultValue(spec, generatorRegistry) {\n\tswitch (spec.kind) {\n\t\tcase \"generator\": {\n\t\t\tconst generator = generatorRegistry.get(spec.id);\n\t\t\tif (!generator) throw runtimeError(\"RUNTIME.MUTATION_DEFAULT_GENERATOR_MISSING\", `Contract references mutation default generator '${spec.id}' but no runtime component provides it.`, { id: spec.id });\n\t\t\treturn generator.generate(spec.params);\n\t\t}\n\t}\n}\nfunction applyMutationDefaults(contract, generatorRegistry, options) {\n\tconst defaults = contract.execution?.mutations.defaults ?? [];\n\tif (defaults.length === 0) return [];\n\tconst isEmptyUpdate = options.op === \"update\" && Object.keys(options.values).length === 0;\n\tconst applied = [];\n\tconst appliedColumns = /* @__PURE__ */ new Set();\n\tconst rowCache = /* @__PURE__ */ new Map();\n\tfor (const mutationDefault of defaults) {\n\t\tif (mutationDefault.ref.table !== options.table) continue;\n\t\tif (mutationDefault.ref.namespace !== options.namespace) continue;\n\t\tconst defaultSpec = options.op === \"create\" ? mutationDefault.onCreate : mutationDefault.onUpdate;\n\t\tif (!defaultSpec) continue;\n\t\tif (isEmptyUpdate) continue;\n\t\tconst columnName = mutationDefault.ref.column;\n\t\tif (Object.hasOwn(options.values, columnName) || appliedColumns.has(columnName)) continue;\n\t\tapplied.push({\n\t\t\tcolumn: columnName,\n\t\t\tvalue: resolveScopedValue(defaultSpec, generatorRegistry, rowCache, options.defaultValueCache)\n\t\t});\n\t\tappliedColumns.add(columnName);\n\t}\n\treturn applied;\n}\nfunction resolveScopedValue(spec, generatorRegistry, rowCache, queryCache) {\n\tif (spec.kind !== \"generator\") return computeExecutionDefaultValue(spec, generatorRegistry);\n\tconst cache = scopedCache(generatorRegistry.get(spec.id)?.stability, rowCache, queryCache);\n\tif (!cache) return computeExecutionDefaultValue(spec, generatorRegistry);\n\tif (cache.has(spec.id)) return cache.get(spec.id);\n\tconst value = computeExecutionDefaultValue(spec, generatorRegistry);\n\tcache.set(spec.id, value);\n\treturn value;\n}\nfunction scopedCache(stability, rowCache, queryCache) {\n\tswitch (stability) {\n\t\tcase \"row\": return rowCache;\n\t\tcase \"query\": return queryCache;\n\t\tdefault: return;\n\t}\n}\nfunction createExecutionContext(options) {\n\tconst { stack, driver } = options;\n\tassertExecutionStackContractRequirements(options.contract, stack);\n\tconst capabilityContributors = [\n\t\tstack.target,\n\t\tstack.adapter,\n\t\t...driver ? [driver] : [],\n\t\t...stack.extensions\n\t];\n\tconst mergedCapabilities = mergeCapabilityMatrices(options.contract.capabilities, capabilityContributors);\n\tconst contract = {\n\t\t...options.contract,\n\t\tcapabilities: mergedCapabilities\n\t};\n\tconst contributors = [\n\t\tstack.target,\n\t\tstack.adapter,\n\t\t...stack.extensions\n\t];\n\tconst { all: allCodecDescriptors, parameterized: parameterizedCodecDescriptors } = collectCodecDescriptors(contributors);\n\tconst queryOperationRegistry = createSqlOperationRegistry();\n\tfor (const contributor of contributors) {\n\t\tconst ops = contributor.queryOperations?.() ?? {};\n\t\tfor (const [name, op] of Object.entries(ops)) queryOperationRegistry.register(name, op);\n\t}\n\tconst codecDescriptors = buildCodecDescriptorRegistry(allCodecDescriptors, contract.storage);\n\tassertColumnCodecIntegrity(contract.storage, codecDescriptors);\n\tconst mutationDefaultGeneratorRegistry = collectMutationDefaultGenerators(contributors);\n\tassertMutationDefaultGeneratorsAvailable(contract, mutationDefaultGeneratorRegistry);\n\tif (parameterizedCodecDescriptors.size > 0) validateColumnTypeParams(contract.storage, parameterizedCodecDescriptors);\n\tconst types = initializeTypeHelpers(contract.storage, documentScopedCodecTypes(contract), parameterizedCodecDescriptors);\n\treturn {\n\t\tcontract,\n\t\tcontractCodecs: buildContractCodecRegistry(contract, codecDescriptors),\n\t\tcodecDescriptors,\n\t\tqueryOperations: queryOperationRegistry,\n\t\ttypes,\n\t\tapplyMutationDefaults: (options) => applyMutationDefaults(contract, mutationDefaultGeneratorRegistry, options)\n\t};\n}\n//#endregion\n//#region src/codecs/decoding.ts\nconst WIRE_PREVIEW_LIMIT = 100;\nconst EMPTY_INCLUDE_ALIASES = /* @__PURE__ */ new Set();\nfunction projectionListFromAst(ast) {\n\tif (ast.kind === \"select\") return ast.projection;\n\tif (ast.kind === \"raw-sql\") return;\n\treturn ast.returning;\n}\nfunction resolveProjectionCodec(item, contractCodecs) {\n\tif (item.codec && contractCodecs) return contractCodecs.forCodecRef(item.codec);\n}\nconst EMPTY_MANY_ALIASES = /* @__PURE__ */ new Set();\nfunction buildDecodeContext(ast, contractCodecs) {\n\tconst projection = projectionListFromAst(ast);\n\tif (!projection || projection.length === 0) return {\n\t\taliases: void 0,\n\t\tcodecs: /* @__PURE__ */ new Map(),\n\t\tcolumnRefs: /* @__PURE__ */ new Map(),\n\t\tincludeAliases: EMPTY_INCLUDE_ALIASES,\n\t\tmanyAliases: EMPTY_MANY_ALIASES\n\t};\n\tconst aliases = [];\n\tconst codecs = /* @__PURE__ */ new Map();\n\tconst columnRefs = /* @__PURE__ */ new Map();\n\tconst includeAliases = /* @__PURE__ */ new Set();\n\tconst manyAliases = /* @__PURE__ */ new Set();\n\tfor (const item of projection) {\n\t\taliases.push(item.alias);\n\t\tconst codec = resolveProjectionCodec(item, contractCodecs);\n\t\tif (codec) codecs.set(item.alias, codec);\n\t\tif (item.codec?.many) manyAliases.add(item.alias);\n\t\tif (item.expr.kind === \"column-ref\") columnRefs.set(item.alias, {\n\t\t\ttable: item.expr.table,\n\t\t\tcolumn: item.expr.column\n\t\t});\n\t\telse if (item.expr.kind === \"subquery\" || item.expr.kind === \"json-array-agg\") includeAliases.add(item.alias);\n\t}\n\treturn {\n\t\taliases,\n\t\tcodecs,\n\t\tcolumnRefs,\n\t\tincludeAliases,\n\t\tmanyAliases\n\t};\n}\nfunction previewWireValue(wireValue) {\n\tif (typeof wireValue === \"string\") return wireValue.length > WIRE_PREVIEW_LIMIT ? `${wireValue.substring(0, WIRE_PREVIEW_LIMIT)}...` : wireValue;\n\treturn String(wireValue).substring(0, WIRE_PREVIEW_LIMIT);\n}\nfunction wrapDecodeFailure(error, alias, ref, codec, wireValue) {\n\tconst message = error instanceof Error ? error.message : String(error);\n\tconst wrapped = runtimeError(\"RUNTIME.DECODE_FAILED\", `Failed to decode column ${ref ? `${ref.table}.${ref.column}` : alias} with codec '${codec.id}': ${message}`, {\n\t\t...ref ? {\n\t\t\ttable: ref.table,\n\t\t\tcolumn: ref.column\n\t\t} : { alias },\n\t\tcodec: codec.id,\n\t\twirePreview: previewWireValue(wireValue)\n\t});\n\twrapped.cause = error;\n\tthrow wrapped;\n}\nfunction wrapIncludeAggregateFailure(error, alias, wireValue) {\n\tconst wrapped = runtimeError(\"RUNTIME.DECODE_FAILED\", `Failed to parse JSON array for include alias '${alias}': ${error instanceof Error ? error.message : String(error)}`, {\n\t\talias,\n\t\twirePreview: previewWireValue(wireValue)\n\t});\n\twrapped.cause = error;\n\tthrow wrapped;\n}\nfunction decodeIncludeAggregate(alias, wireValue) {\n\tif (wireValue === null || wireValue === void 0) return [];\n\ttry {\n\t\tif (typeof wireValue === \"string\") return JSON.parse(wireValue);\n\t\tif (typeof wireValue === \"object\") return wireValue;\n\t\treturn JSON.parse(String(wireValue));\n\t} catch (error) {\n\t\twrapIncludeAggregateFailure(error, alias, wireValue);\n\t}\n}\n/**\n* Decodes a single field. Single-armed: every cell takes the same path — `codec.decode → await → return plain value` — so sync- and async-authored codecs are indistinguishable to callers. JSON-Schema validation, when required, lives inside the resolved codec's `decode` body (e.g. `arktype-json` validates against its rehydrated schema and throws `RUNTIME.JSON_SCHEMA_VALIDATION_FAILED` from `decode` directly); there is\n* no separate validator-registry pass.\n*\n* The row-level `rowCtx` is repackaged into a per-cell `SqlCodecCallContext` whose `column = { table, name }` is a structural projection of the per-cell `ColumnRef = { table, column }` resolved from the AST-backed `DecodeContext` (the same resolution `wrapDecodeFailure` uses for envelope construction — one resolution per cell, two consumers). Cells the runtime cannot resolve to a single underlying column (aggregate\n* aliases, computed projections without a simple ref) get `column: undefined`, matching the spec contract that the runtime never silently defaults this field.\n*\n* For `many`-flagged aliases the driver has already parsed the wire form into a JS array; this function maps the element codec over that array element-by-element, passing `null` elements through unchanged. Element-level failures surface through the existing `RUNTIME.DECODE_FAILED` envelope with the column/codec context from the parent cell.\n*/\nasync function decodeField(alias, wireValue, decodeCtx, rowCtx) {\n\tif (wireValue === null) return null;\n\tconst codec = decodeCtx.codecs.get(alias);\n\tif (!codec) return wireValue;\n\tconst ref = decodeCtx.columnRefs.get(alias);\n\tlet cellCtx;\n\tif (ref) cellCtx = {\n\t\t...rowCtx,\n\t\tcolumn: {\n\t\t\ttable: ref.table,\n\t\t\tname: ref.column\n\t\t}\n\t};\n\telse {\n\t\tconst { column: _drop, ...rowCtxWithoutColumn } = rowCtx;\n\t\tcellCtx = rowCtxWithoutColumn;\n\t}\n\tif (decodeCtx.manyAliases.has(alias)) {\n\t\tif (!Array.isArray(wireValue)) wrapDecodeFailure(/* @__PURE__ */ new TypeError(`expected an array from the driver for many-typed column, got ${typeof wireValue}`), alias, ref, codec, wireValue);\n\t\tconst decoded = [];\n\t\tfor (const elem of wireValue) {\n\t\t\tif (elem === null || elem === void 0) {\n\t\t\t\tdecoded.push(null);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tdecoded.push(await codec.decode(elem, cellCtx));\n\t\t\t} catch (error) {\n\t\t\t\tif (isStructuredError(error)) throw error;\n\t\t\t\twrapDecodeFailure(error, alias, ref, codec, elem);\n\t\t\t}\n\t\t}\n\t\treturn decoded;\n\t}\n\ttry {\n\t\treturn await codec.decode(wireValue, cellCtx);\n\t} catch (error) {\n\t\tif (isStructuredError(error)) throw error;\n\t\twrapDecodeFailure(error, alias, ref, codec, wireValue);\n\t}\n}\n/**\n* Decodes a row by dispatching all per-cell codec calls concurrently via `Promise.all`. Each cell follows the single-armed `decodeField` path. Structured envelopes thrown by codec bodies (anything passing `isStructuredError`) pass through unchanged; all other failures are wrapped in `RUNTIME.DECODE_FAILED` with `{ table, column, codec }` (or `{ alias, codec }` when no column ref is resolvable) and the original error attached on `cause`.\n*\n* When `rowCtx.signal` is provided:\n*\n* - **Already-aborted at entry** short-circuits with `RUNTIME.ABORTED` (`{ phase: 'decode' }`) before any `codec.decode` call is made.\n* - **Mid-flight aborts** race the per-cell `Promise.all` against the signal so the runtime returns promptly even when codec bodies ignore it. In-flight bodies that ignore the signal complete in the background (cooperative cancellation).\n* - Existing structured envelopes (any dotted-code error passing `isStructuredError`, e.g. `RUNTIME.DECODE_FAILED`) from codec bodies pass through unchanged (no double wrap).\n*/\nasync function decodeRow(row, decodeCtx, rowCtx) {\n\tcheckAborted(rowCtx, \"decode\");\n\tconst signal = rowCtx.signal;\n\tconst aliases = decodeCtx.aliases ?? Object.keys(row);\n\tif (decodeCtx.aliases !== void 0) {\n\t\tfor (const alias of decodeCtx.aliases) if (!Object.hasOwn(row, alias)) throw runtimeError(\"RUNTIME.DECODE_FAILED\", `Row missing projection alias \"${alias}\"`, {\n\t\t\talias,\n\t\t\texpectedAliases: decodeCtx.aliases,\n\t\t\tpresentKeys: Object.keys(row)\n\t\t});\n\t}\n\tconst tasks = [];\n\tconst includeIndices = [];\n\tfor (let i = 0; i < aliases.length; i++) {\n\t\tconst alias = aliases[i];\n\t\tconst wireValue = row[alias];\n\t\tif (decodeCtx.includeAliases.has(alias)) {\n\t\t\tincludeIndices.push({\n\t\t\t\tindex: i,\n\t\t\t\talias,\n\t\t\t\tvalue: wireValue\n\t\t\t});\n\t\t\ttasks.push(Promise.resolve(void 0));\n\t\t\tcontinue;\n\t\t}\n\t\ttasks.push(decodeField(alias, wireValue, decodeCtx, rowCtx));\n\t}\n\tconst settled = await raceAgainstAbort(Promise.all(tasks), signal, \"decode\");\n\tfor (const entry of includeIndices) settled[entry.index] = decodeIncludeAggregate(entry.alias, entry.value);\n\tconst decoded = {};\n\tfor (let i = 0; i < aliases.length; i++) decoded[aliases[i]] = settled[i];\n\treturn decoded;\n}\n//#endregion\n//#region src/content-hash.ts\n/**\n* Computes a stable content hash for a lowered SQL execution plan.\n*\n* Internally builds an unambiguous canonical-stringified preimage from\n* three components:\n*\n* 1. `meta.storageHash` — discriminates by schema. A migration changes the\n* storage hash, which invalidates cached entries automatically.\n* 2. `exec.sql` — the raw lowered SQL text. Two queries with different\n* structure produce different keys. Note that we deliberately do **not**\n* use `computeSqlFingerprint` here: that helper strips literals to group\n* executions by statement shape (used by telemetry), which is the\n* opposite of what a content hash needs — we want per-execution\n* discrimination, not per-statement-shape grouping.\n* 3. `exec.params` — the bound parameters. `canonicalStringify` produces a\n* deterministic serialization that is stable across object key\n* insertion order and that distinguishes types JSON would otherwise\n* conflate (e.g. `BigInt(1)` vs `1`).\n*\n* The components are wrapped in an object and canonicalized as a single\n* unit (rather than concatenated with a delimiter) so component\n* boundaries are unambiguous: any character appearing inside `sql` or\n* `storageHash` cannot bleed across components and produce a collision\n* with a different split of the same characters.\n*\n* The canonical string is then piped through `hashContent` to produce a\n* bounded, opaque digest. See `@internal/utils/hash-content` for the\n* rationale.\n*\n* @internal\n*/\nfunction computeSqlContentHash(exec) {\n\treturn hashContent(canonicalStringify({\n\t\tstorageHash: exec.meta.storageHash,\n\t\tsql: exec.sql,\n\t\tparams: exec.params\n\t}));\n}\n//#endregion\n//#region src/fingerprint.ts\nconst STRING_LITERAL_REGEX = /'(?:''|[^'])*'/g;\nconst NUMERIC_LITERAL_REGEX = /\\b\\d+(?:\\.\\d+)?\\b/g;\nconst WHITESPACE_REGEX = /\\s+/g;\n/**\n* Computes a literal-stripped, normalized fingerprint of a SQL statement.\n*\n* The function strips string and numeric literals, collapses whitespace, and\n* lowercases the result before hashing — so two structurally equivalent\n* statements (with different parameter values) produce the same fingerprint.\n* Used by SQL telemetry to group queries.\n*/\nfunction computeSqlFingerprint(sql) {\n\tconst normalized = sql.replace(STRING_LITERAL_REGEX, \"?\").replace(NUMERIC_LITERAL_REGEX, \"?\").replace(WHITESPACE_REGEX, \" \").trim().toLowerCase();\n\treturn createHash(\"sha256\").update(normalized).digest(\"hex\");\n}\n//#endregion\n//#region src/middleware/before-compile-chain.ts\nasync function runBeforeCompileChain(middleware, initial, ctx) {\n\tlet current = initial;\n\tfor (const mw of middleware) {\n\t\tif (!mw.beforeCompile) continue;\n\t\tconst result = await mw.beforeCompile(current, ctx);\n\t\tif (result === void 0) continue;\n\t\tif (result.ast === current.ast) continue;\n\t\tctx.log.debug?.({\n\t\t\tevent: \"middleware.rewrite\",\n\t\t\tmiddleware: mw.name,\n\t\t\tlane: current.meta.lane\n\t\t});\n\t\tcurrent = result;\n\t}\n\treturn current;\n}\n//#endregion\n//#region src/prepared/bind-site-params.ts\nfunction normalizeSpec(spec) {\n\tif (typeof spec === \"string\") return {\n\t\tcodec: { codecId: spec },\n\t\tnullable: false\n\t};\n\treturn {\n\t\tcodec: spec.typeParams !== void 0 ? {\n\t\t\tcodecId: spec.codecId,\n\t\t\ttypeParams: spec.typeParams\n\t\t} : { codecId: spec.codecId },\n\t\tnullable: spec.nullable === true\n\t};\n}\nvar BindSiteExpression = class {\n\treturnType;\n\t#ast;\n\tconstructor(ref, returnType) {\n\t\tthis.#ast = ref;\n\t\tthis.returnType = returnType;\n\t}\n\tbuildAst() {\n\t\treturn this.#ast;\n\t}\n};\nfunction buildBindSiteParams(declaration) {\n\tconst params = {};\n\tfor (const [name, spec] of Object.entries(declaration)) {\n\t\tconst { codec, nullable } = normalizeSpec(spec);\n\t\tparams[name] = new BindSiteExpression(PreparedParamRef.of(name, codec), {\n\t\t\tcodecId: codec.codecId,\n\t\t\tnullable\n\t\t});\n\t}\n\treturn Object.freeze(params);\n}\n//#endregion\n//#region src/prepared/encode-prepared.ts\n/**\n* Resolve a PreparedStatement's slot order to the unencoded values it\n* will carry into encode. Literal slots come from the lowered AST;\n* bind slots are looked up by name on `userParams`. Missing user params\n* surface `RUNTIME.PREPARE_MISSING_PARAM` so the caller cannot silently\n* bind `undefined`.\n*/\nfunction resolvePreparedSlotValues(ps, userParams) {\n\treturn ps.slots.map((slot) => {\n\t\tif (slot.kind === \"literal\") return slot.value;\n\t\tif (!Object.hasOwn(userParams, slot.name)) throw runtimeError(\"RUNTIME.PREPARE_MISSING_PARAM\", `Prepared statement execute is missing parameter '${slot.name}'`, { name: slot.name });\n\t\treturn userParams[slot.name];\n\t});\n}\n//#endregion\n//#region src/sql-family-adapter.ts\nvar SqlFamilyAdapter = class {\n\tcontract;\n\tmarkerReader;\n\tconstructor(contract, adapterProfile) {\n\t\tthis.contract = contract;\n\t\tthis.markerReader = adapterProfile;\n\t}\n\tvalidatePlan(plan, contract) {\n\t\tif (plan.meta.target !== contract.target) throw runtimeError(\"PLAN.TARGET_MISMATCH\", \"Plan target does not match runtime target\", {\n\t\t\tplanTarget: plan.meta.target,\n\t\t\truntimeTarget: contract.target\n\t\t});\n\t\tif (plan.meta.storageHash !== contract.storage.storageHash) throw runtimeError(\"PLAN.HASH_MISMATCH\", \"Plan storage hash does not match runtime contract\", {\n\t\t\tplanStorageHash: plan.meta.storageHash,\n\t\t\truntimeStorageHash: contract.storage.storageHash\n\t\t});\n\t}\n};\n//#endregion\n//#region src/sql-runtime.ts\nfunction isExecutionPlan(plan) {\n\treturn \"sql\" in plan;\n}\n// v8 ignore next 2\nconst noopLogSink = () => {};\nconst noopLog = {\n\tinfo: noopLogSink,\n\twarn: noopLogSink,\n\terror: noopLogSink\n};\n/**\n* Abstract family-layer base for SQL runtimes. Subclass to build a target runtime\n* (e.g. `PostgresRuntimeImpl`); app code should consume the `Runtime` interface returned\n* by the target factories, never this class directly.\n*/\nvar SqlRuntimeBase = class extends RuntimeCore {\n\tcontract;\n\tadapter;\n\tdriver;\n\tfamilyAdapter;\n\tcontractCodecs;\n\tcodecDescriptors;\n\tsqlCtx;\n\tverifyMarkerOption;\n\tverifyMarkerPromise;\n\t#preparedStatementHandles = /* @__PURE__ */ new WeakMap();\n\tcodecRegistryValidated;\n\t_telemetry;\n\tconstructor(options) {\n\t\tconst { context, adapter, driver, verifyMarker, middleware, mode, log } = options;\n\t\tif (middleware) for (const mw of middleware) checkMiddlewareCompatibility(mw, \"sql\", context.contract.target);\n\t\tconst sqlCtx = {\n\t\t\tcontract: context.contract,\n\t\t\tmode: mode ?? \"strict\",\n\t\t\tnow: () => Date.now(),\n\t\t\tlog: log ?? noopLog,\n\t\t\tcontentHash: (exec) => computeSqlContentHash(exec),\n\t\t\tscope: \"runtime\",\n\t\t\tplanExecutionId: \"\"\n\t\t};\n\t\tsuper({\n\t\t\tmiddleware: middleware ?? [],\n\t\t\tctx: sqlCtx\n\t\t});\n\t\tthis.contract = context.contract;\n\t\tthis.adapter = adapter;\n\t\tthis.driver = driver;\n\t\tthis.familyAdapter = new SqlFamilyAdapter(context.contract, adapter.profile);\n\t\tthis.contractCodecs = context.contractCodecs;\n\t\tthis.codecDescriptors = context.codecDescriptors;\n\t\tthis.sqlCtx = sqlCtx;\n\t\tthis.verifyMarkerOption = verifyMarker ?? \"onFirstUse\";\n\t\tthis.codecRegistryValidated = false;\n\t\tthis.verifyMarkerPromise = this.verifyMarkerOption === false ? Promise.resolve() : null;\n\t\tthis._telemetry = null;\n\t}\n\t/**\n\t* Lower a `SqlQueryPlan` (AST + meta) into a `SqlExecutionPlan`\n\t* with encoded parameters ready for the driver.\n\t*\n\t* Implementation note: SQL splits lower-then-encode across\n\t* {@link lowerToDraft} + {@link encodeDraftParams} so the runtime\n\t* can fire the `beforeExecute` middleware chain between them\n\t* (cipherstash bulk-encrypt, for example, mutates pre-encode\n\t* `ParamRef.value` slots). This protected hook composes the two\n\t* back into the cross-family `lower()` shape `RuntimeCore.execute`\n\t* expects, and is called from the no-middleware fast paths /\n\t* fixtures that hit `RuntimeCore`'s default template directly.\n\t* `execute()` overrides the template and uses the split form so\n\t* `beforeExecute` lands between the two halves.\n\t*\n\t* `ctx: SqlCodecCallContext` is forwarded to `encodeParams` so\n\t* per-query cancellation reaches every codec body during parameter\n\t* encoding. SQL params do not populate `ctx.column` — encode-side\n\t* column metadata is the middleware's domain.\n\t*/\n\tasync lower(plan, ctx) {\n\t\tconst draft = this.lowerToDraft(plan);\n\t\treturn await this.encodeDraftParams(draft, ctx);\n\t}\n\t/**\n\t* AST → pre-encode draft. The returned plan has `sql` rendered and\n\t* `params` populated with the user-domain values the lowering site\n\t* collected from `ParamRef` nodes. No codec encode has happened\n\t* yet; consumers can mutate `params` via the `SqlParamRefMutator`\n\t* before {@link encodeDraftParams} runs.\n\t*/\n\tlowerToDraft(plan) {\n\t\treturn lowerSqlPlan(this.adapter, this.contract, plan);\n\t}\n\t/**\n\t* Encode a draft plan's params through the per-column codecs and\n\t* freeze the result into the final `SqlExecutionPlan` the driver\n\t* sees. Errors surface as `RUNTIME.ENCODE_FAILED` envelopes from\n\t* {@link encodeParams}.\n\t*/\n\tasync encodeDraftParams(draft, ctx) {\n\t\treturn Object.freeze({\n\t\t\t...draft,\n\t\t\tparams: await encodeParams(draft, ctx, this.contractCodecs)\n\t\t});\n\t}\n\t/**\n\t* Default driver invocation required by the abstract `RuntimeCore` contract. Every production path overrides `execute()` and routes through `executeAgainstQueryable`, so this hook is defensive only — subclasses that delegate back to `super.execute()` would land here.\n\t*/\n\t// v8 ignore next 6\n\trunDriver(exec) {\n\t\treturn this.driver.execute({\n\t\t\tsql: exec.sql,\n\t\t\tparams: exec.params\n\t\t});\n\t}\n\t/**\n\t* SQL pre-compile hook. Runs the registered middleware `beforeCompile` chain over the plan's draft (AST + meta). Returns the original plan unchanged when no middleware rewrote the AST; otherwise returns a new plan carrying the rewritten AST and meta. The AST is the authoritative source of execution metadata, so a rewrite needs no sidecar reconciliation here — the lowering adapter and the encoder both walk the rewritten\n\t* AST directly.\n\t*/\n\tasync runBeforeCompile(plan) {\n\t\tconst rewrittenDraft = await runBeforeCompileChain(this.middleware, {\n\t\t\tast: plan.ast,\n\t\t\tmeta: plan.meta\n\t\t}, this.sqlCtx);\n\t\treturn rewrittenDraft.ast === plan.ast ? plan : {\n\t\t\t...plan,\n\t\t\tast: rewrittenDraft.ast,\n\t\t\tmeta: rewrittenDraft.meta\n\t\t};\n\t}\n\texecute(plan, options) {\n\t\treturn this.executeAgainstQueryable(plan, this.driver, options);\n\t}\n\texecutePrepared(ps, params, options) {\n\t\treturn this.executePreparedAgainstQueryable(ps, params, this.driver, options);\n\t}\n\t/**\n\t* Returns the raw driver connection. The connection is a `SqlQueryable` — SQL\n\t* issued on it runs below the middleware/codec/telemetry pipeline. It carries\n\t* its own lifecycle (`release`/`destroy`/`beginTransaction`); the caller owns\n\t* disposal.\n\t*/\n\tacquireRawConnection() {\n\t\treturn this.driver.acquireConnection();\n\t}\n\tasync *streamRows(exec, decodeContext, driverCall, codecCtx, execMiddlewareCtx) {\n\t\tthis.familyAdapter.validatePlan(exec, this.contract);\n\t\tthis._telemetry = null;\n\t\tif (this.verifyMarkerPromise === null) this.verifyMarkerPromise = this.verifyMarker();\n\t\tawait this.verifyMarkerPromise;\n\t\tconst startedAt = Date.now();\n\t\tlet outcome = null;\n\t\ttry {\n\t\t\tconst iterator = runWithMiddleware(exec, this.middleware, execMiddlewareCtx, driverCall)[Symbol.asyncIterator]();\n\t\t\ttry {\n\t\t\t\twhile (true) {\n\t\t\t\t\tcheckAborted(codecCtx, \"stream\");\n\t\t\t\t\tconst next = await iterator.next();\n\t\t\t\t\tif (next.done) break;\n\t\t\t\t\tyield await decodeRow(next.value, decodeContext, codecCtx);\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tawait iterator.return?.();\n\t\t\t}\n\t\t\toutcome = \"success\";\n\t\t} catch (error) {\n\t\t\toutcome = \"runtime-error\";\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tif (outcome !== null) this.recordTelemetry(exec, outcome, Date.now() - startedAt);\n\t\t}\n\t}\n\t/**\n\t* Execute a plan against a caller-supplied queryable, running the full\n\t* middleware/codec/telemetry pipeline. Use `acquireRawConnection` to obtain a\n\t* queryable that subclasses can bind typed plans to.\n\t*/\n\texecuteAgainstQueryable(plan, queryable, options) {\n\t\tthis.ensureCodecRegistryValidated();\n\t\tconst self = this;\n\t\tconst signal = options?.signal;\n\t\tconst scope = options?.scope ?? \"runtime\";\n\t\tconst codecCtx = signal === void 0 ? {} : { signal };\n\t\tconst execMiddlewareCtx = {\n\t\t\t...self.ctx,\n\t\t\t...ifDefined(\"signal\", signal),\n\t\t\t...scope !== \"runtime\" ? { scope } : {},\n\t\t\tplanExecutionId: crypto.randomUUID()\n\t\t};\n\t\tconst generator = async function* () {\n\t\t\tcheckAborted(codecCtx, \"stream\");\n\t\t\tlet exec;\n\t\t\tif (isExecutionPlan(plan)) {\n\t\t\t\tconst preEncodeMutator = createSqlParamRefMutator(plan);\n\t\t\t\tawait runBeforeExecuteChain(plan, self.middleware, execMiddlewareCtx, preEncodeMutator);\n\t\t\t\texec = Object.freeze({\n\t\t\t\t\t...plan,\n\t\t\t\t\tparams: await encodeParams({\n\t\t\t\t\t\t...plan,\n\t\t\t\t\t\tparams: preEncodeMutator.currentParams()\n\t\t\t\t\t}, codecCtx, self.contractCodecs)\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst compiled = await self.runBeforeCompile(plan);\n\t\t\t\tconst draft = self.lowerToDraft(compiled);\n\t\t\t\tconst preEncodeMutator = createSqlParamRefMutator(draft);\n\t\t\t\tawait runBeforeExecuteChain(draft, self.middleware, execMiddlewareCtx, preEncodeMutator);\n\t\t\t\tconst draftWithMutations = Object.freeze({\n\t\t\t\t\t...draft,\n\t\t\t\t\tparams: preEncodeMutator.currentParams()\n\t\t\t\t});\n\t\t\t\texec = await self.encodeDraftParams(draftWithMutations, codecCtx);\n\t\t\t}\n\t\t\tconst decodeContext = buildDecodeContext(exec.ast, self.contractCodecs);\n\t\t\tyield* self.streamRows(exec, decodeContext, () => queryable.execute({\n\t\t\t\tsql: exec.sql,\n\t\t\t\tparams: exec.params\n\t\t\t}), codecCtx, execMiddlewareCtx);\n\t\t};\n\t\treturn new AsyncIterableResult(generator());\n\t}\n\tasync prepare(declaration, callback) {\n\t\tthis.ensureCodecRegistryValidated();\n\t\tconst userPlan = callback(buildBindSiteParams(declaration));\n\t\tconst finalPlan = await this.runBeforeCompile(userPlan);\n\t\tconst orderedRefs = collectOrderedParamRefs(finalPlan.ast);\n\t\tconst referencedNames = /* @__PURE__ */ new Set();\n\t\tfor (const ref of orderedRefs) if (ref.kind === \"prepared-param-ref\") referencedNames.add(ref.name);\n\t\tconst missing = Object.keys(declaration).filter((name) => !referencedNames.has(name));\n\t\tif (missing.length > 0) throw runtimeError(\"RUNTIME.PREPARE_UNUSED_PARAM\", `Prepared statement declaration includes parameter${missing.length === 1 ? \"\" : \"s\"} not referenced by the callback's plan: ${missing.join(\", \")}`, { unused: missing });\n\t\tconst lowered = this.adapter.lower(finalPlan.ast, {\n\t\t\tcontract: this.contract,\n\t\t\tparams: orderedRefs.map((r) => r.kind === \"param-ref\" ? r.value : void 0)\n\t\t});\n\t\tconst decodeContext = buildDecodeContext(finalPlan.ast, this.contractCodecs);\n\t\tconst paramMetadata = deriveParamMetadata(finalPlan.ast);\n\t\treturn new PreparedStatementImpl(Object.freeze({\n\t\t\tsql: lowered.sql,\n\t\t\tast: finalPlan.ast,\n\t\t\tmeta: finalPlan.meta,\n\t\t\tslots: lowered.params,\n\t\t\tdecodeContext,\n\t\t\tparamMetadata\n\t\t}));\n\t}\n\t/**\n\t* Execute a prepared statement against a caller-supplied queryable, running\n\t* the full middleware/codec/telemetry pipeline.\n\t*/\n\texecutePreparedAgainstQueryable(ps, userParams, queryable, options) {\n\t\tthis.ensureCodecRegistryValidated();\n\t\tconst self = this;\n\t\tconst signal = options?.signal;\n\t\tconst scope = options?.scope ?? \"runtime\";\n\t\tconst codecCtx = signal === void 0 ? {} : { signal };\n\t\tconst execMiddlewareCtx = {\n\t\t\t...self.ctx,\n\t\t\t...ifDefined(\"signal\", signal),\n\t\t\t...scope !== \"runtime\" ? { scope } : {},\n\t\t\tplanExecutionId: crypto.randomUUID()\n\t\t};\n\t\tconst generator = async function* () {\n\t\t\tcheckAborted(codecCtx, \"stream\");\n\t\t\tconst preEncodeValues = resolvePreparedSlotValues(ps, userParams);\n\t\t\tconst preEncodeExec = {\n\t\t\t\tsql: ps.sql,\n\t\t\t\tparams: preEncodeValues,\n\t\t\t\tast: ps.ast,\n\t\t\t\tmeta: ps.meta\n\t\t\t};\n\t\t\tconst mutator = createSqlParamRefMutator(preEncodeExec);\n\t\t\tawait runBeforeExecuteChain(preEncodeExec, self.middleware, execMiddlewareCtx, mutator);\n\t\t\tconst encodedParams = await encodeParamsWithMetadata(mutator.currentParams(), ps.paramMetadata, codecCtx, self.contractCodecs);\n\t\t\tconst exec = {\n\t\t\t\tsql: ps.sql,\n\t\t\t\tparams: encodedParams,\n\t\t\t\tast: ps.ast,\n\t\t\t\tmeta: ps.meta\n\t\t\t};\n\t\t\tconst handles = self.#preparedStatementHandles;\n\t\t\tconst request = {\n\t\t\t\tsql: exec.sql,\n\t\t\t\tparams: exec.params,\n\t\t\t\thandle: {\n\t\t\t\t\tget: () => handles.get(ps),\n\t\t\t\t\tset: (value) => {\n\t\t\t\t\t\thandles.set(ps, value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tyield* self.streamRows(exec, ps.decodeContext, () => queryable.executePrepared(request), codecCtx, execMiddlewareCtx);\n\t\t};\n\t\treturn new AsyncIterableResult(generator());\n\t}\n\tasync connection() {\n\t\tconst driverConn = await this.driver.acquireConnection();\n\t\tconst self = this;\n\t\treturn {\n\t\t\tasync transaction() {\n\t\t\t\tconst driverTx = await driverConn.beginTransaction();\n\t\t\t\treturn self.wrapTransaction(driverTx);\n\t\t\t},\n\t\t\tasync release() {\n\t\t\t\tawait driverConn.release();\n\t\t\t},\n\t\t\tasync destroy(reason) {\n\t\t\t\tawait driverConn.destroy(reason);\n\t\t\t},\n\t\t\texecute(plan, options) {\n\t\t\t\treturn self.executeAgainstQueryable(plan, driverConn, {\n\t\t\t\t\t...options,\n\t\t\t\t\tscope: \"connection\"\n\t\t\t\t});\n\t\t\t},\n\t\t\texecutePrepared(ps, params, options) {\n\t\t\t\treturn self.executePreparedAgainstQueryable(ps, params, driverConn, {\n\t\t\t\t\t...options,\n\t\t\t\t\tscope: \"connection\"\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t}\n\twrapTransaction(driverTx) {\n\t\tconst self = this;\n\t\treturn {\n\t\t\tasync commit() {\n\t\t\t\tawait driverTx.commit();\n\t\t\t},\n\t\t\tasync rollback() {\n\t\t\t\tawait driverTx.rollback();\n\t\t\t},\n\t\t\texecute(plan, options) {\n\t\t\t\treturn self.executeAgainstQueryable(plan, driverTx, {\n\t\t\t\t\t...options,\n\t\t\t\t\tscope: \"transaction\"\n\t\t\t\t});\n\t\t\t},\n\t\t\texecutePrepared(ps, params, options) {\n\t\t\t\treturn self.executePreparedAgainstQueryable(ps, params, driverTx, {\n\t\t\t\t\t...options,\n\t\t\t\t\tscope: \"transaction\"\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t}\n\ttelemetry() {\n\t\treturn this._telemetry;\n\t}\n\tasync close() {\n\t\tawait this.driver.close();\n\t}\n\tensureCodecRegistryValidated() {\n\t\tif (!this.codecRegistryValidated) {\n\t\t\tvalidateCodecRegistryCompleteness(this.codecDescriptors, this.contract);\n\t\t\tthis.codecRegistryValidated = true;\n\t\t}\n\t}\n\tasync verifyMarker() {\n\t\tconst readResult = await this.familyAdapter.markerReader.readMarker(this.driver);\n\t\tconst expectedStorageHash = this.contract.storage.storageHash;\n\t\tconst expectedProfileHash = this.contract.profileHash ?? null;\n\t\tconst expected = {\n\t\t\tstorageHash: expectedStorageHash,\n\t\t\tprofileHash: expectedProfileHash\n\t\t};\n\t\tif (readResult.kind !== \"present\") {\n\t\t\tthis.sqlCtx.log.warn({\n\t\t\t\tcode: \"CONTRACT.MARKER_MISSING\",\n\t\t\t\tscope: \"marker-verification\",\n\t\t\t\texpected,\n\t\t\t\tactual: null,\n\t\t\t\tmessage: \"Contract marker not found in database\"\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst marker = readResult.record;\n\t\tconst storageHashMatch = marker.storageHash === expectedStorageHash;\n\t\tconst profileHashMatch = expectedProfileHash === null || marker.profileHash === expectedProfileHash;\n\t\tif (!storageHashMatch || !profileHashMatch) this.sqlCtx.log.warn({\n\t\t\tcode: \"CONTRACT.MARKER_MISMATCH\",\n\t\t\tscope: \"marker-verification\",\n\t\t\texpected,\n\t\t\tactual: {\n\t\t\t\tstorageHash: marker.storageHash,\n\t\t\t\tprofileHash: marker.profileHash ?? null\n\t\t\t},\n\t\t\tmessage: \"Contract marker hash does not match runtime contract\"\n\t\t});\n\t}\n\trecordTelemetry(plan, outcome, durationMs) {\n\t\tconst contract = this.contract;\n\t\tthis._telemetry = Object.freeze({\n\t\t\tlane: plan.meta.lane,\n\t\t\ttarget: contract.target,\n\t\t\tfingerprint: computeSqlFingerprint(plan.sql),\n\t\t\toutcome,\n\t\t\t...durationMs !== void 0 ? { durationMs } : {}\n\t\t});\n\t}\n};\nfunction transactionClosedError() {\n\treturn runtimeError(\"RUNTIME.TRANSACTION_CLOSED\", \"Cannot read from a query result after the transaction has ended. Await the result or call .toArray() inside the transaction callback.\", {});\n}\nasync function withTransaction(runtime, fn) {\n\tconst connection = await runtime.connection();\n\tconst transaction = await connection.transaction();\n\tlet invalidated = false;\n\tasync function* guardedStream(inner) {\n\t\tif (invalidated) throw transactionClosedError();\n\t\tfor await (const row of inner) {\n\t\t\tyield row;\n\t\t\tif (invalidated) throw transactionClosedError();\n\t\t}\n\t}\n\tconst txContext = {\n\t\tget invalidated() {\n\t\t\treturn invalidated;\n\t\t},\n\t\texecute(plan, options) {\n\t\t\tif (invalidated) throw transactionClosedError();\n\t\t\treturn new AsyncIterableResult(guardedStream(transaction.execute(plan, options)));\n\t\t},\n\t\texecutePrepared(ps, params, options) {\n\t\t\tif (invalidated) throw transactionClosedError();\n\t\t\treturn new AsyncIterableResult(guardedStream(transaction.executePrepared(ps, params, options)));\n\t\t}\n\t};\n\tlet connectionDisposed = false;\n\tconst destroyConnection = async (reason) => {\n\t\tif (connectionDisposed) return;\n\t\tconnectionDisposed = true;\n\t\tawait connection.destroy(reason).catch(() => void 0);\n\t};\n\ttry {\n\t\tlet result;\n\t\ttry {\n\t\t\tresult = await fn(txContext);\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\tawait transaction.rollback();\n\t\t\t} catch (rollbackError) {\n\t\t\t\tawait destroyConnection(rollbackError);\n\t\t\t\tconst wrapped = runtimeError(\"RUNTIME.TRANSACTION_ROLLBACK_FAILED\", \"Transaction rollback failed after callback error\", { rollbackError });\n\t\t\t\twrapped.cause = error;\n\t\t\t\tthrow wrapped;\n\t\t\t}\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tinvalidated = true;\n\t\t}\n\t\ttry {\n\t\t\tawait transaction.commit();\n\t\t} catch (commitError) {\n\t\t\ttry {\n\t\t\t\tawait transaction.rollback();\n\t\t\t} catch {\n\t\t\t\tawait destroyConnection(commitError);\n\t\t\t}\n\t\t\tconst wrapped = runtimeError(\"RUNTIME.TRANSACTION_COMMIT_FAILED\", \"Transaction commit failed\", { commitError });\n\t\t\twrapped.cause = commitError;\n\t\t\tthrow wrapped;\n\t\t}\n\t\treturn result;\n\t} finally {\n\t\tif (!connectionDisposed) await connection.release();\n\t}\n}\n//#endregion\nexport { createExecutionContext as a, lints as c, extractCodecIds as d, validateCodecRegistryCompleteness as f, createAstCodecRegistry as g, encodeParamsWithMetadata as h, decodeRow as i, budgets as l, deriveParamMetadata as m, withTransaction as n, createSqlExecutionStack as o, validateContractCodecMappings as p, buildDecodeContext as r, PreparedStatementImpl as s, SqlRuntimeBase as t, lowerSqlPlan as u };\n\n//# sourceMappingURL=exports-DcRj136z.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,uBAAuB,aAAa,oBAAoB;CAChE,MAAM,wBAAwB,IAAI,IAAI;CACtC,OAAO,EAAE,YAAY,KAAK;EACzB,MAAM,MAAM,GAAG,IAAI,QAAQ,GAAG,iBAAiB,IAAI,UAAU;EAC7D,MAAM,SAAS,MAAM,IAAI,GAAG;EAC5B,IAAI,QAAQ,OAAO;EACnB,MAA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,WAAW;GACpC;GACA,MAAM,UAAU,aAAa,qCAAqC,6BAA6B,EAAE,YAAY,CAAC;GAC9G,QAAQ,QAAQ;GAChB,MAAM;EACP;EACA,OAAO;CACR,UAAU;EACT,IAAI,CAAC,oBAAoB,MAAM,WAAW,QAAQ;CACnD;AACD"}
@@ -0,0 +1,47 @@
1
+ import { c as SqlStorage } from "./sql-storage-B0QwiTg6-B8DVctJm.mjs";
2
+ import "./types-BchwQpmO.mjs";
3
+ import { v as SqlSchemaIRNode } from "./types-CvbBw1Jo-3KQdErJY.mjs";
4
+ import "./types-TvBZ2Ne9.mjs";
5
+ import { Contract, ControlPolicy } from "@prisma/orm-framework/contract/types";
6
+ import { TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
7
+ import { SchemaDiffIssue } from "@prisma/orm-framework/components/control";
8
+ //#region ../../../2-sql/9-family/dist/schema-differ-DpG_gnur.d.mts
9
+ //#region src/core/migrations/schema-differ.d.ts
10
+ /**
11
+ * The full-tree node diff a SQL target produces for the family verify
12
+ * verdict: the target derives the expected tree from the contract, applies
13
+ * the pre-diff normalizations (semantic satisfaction, FK schema-segment
14
+ * resolution), runs the generic differ, and ownership-scopes the result.
15
+ * Strict gating, control-policy disposition, and the verdict itself are the
16
+ * family's post-diff filters over this output.
17
+ */
18
+ interface SqlSchemaDiffResult {
19
+ /** The full, ownership-scoped diff issue list. */
20
+ readonly issues: readonly SchemaDiffIssue[];
21
+ /**
22
+ * Resolves a diff issue's subject table's declared control policy directly
23
+ * from the contract (Decision 5's own-layer-per-concern discipline extends
24
+ * here too: control policy is a contract concern, resolved by the target
25
+ * at disposition time — never stamped on the diff node). `undefined`
26
+ * when the issue's path resolves to no contract table (a genuine orphan,
27
+ * or a non-table subject).
28
+ */
29
+ readonly resolveControlPolicy: (issue: SchemaDiffIssue) => ControlPolicy | undefined;
30
+ /**
31
+ * The expected/actual namespace-node pairs the codec `verifyType` hooks
32
+ * run over — one per contract namespace with tables, paired by DDL
33
+ * schema; a flat target repeats its sole actual root per such namespace.
34
+ */
35
+ readonly namespacePairs: ReadonlyArray<{
36
+ readonly actual: SqlSchemaIRNode | undefined;
37
+ }>;
38
+ }
39
+ interface SqlSchemaDiffInput {
40
+ readonly contract: Contract<SqlStorage>;
41
+ readonly schema: SqlSchemaIRNode;
42
+ readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
43
+ }
44
+ type SqlSchemaDiffFn = (input: SqlSchemaDiffInput) => SqlSchemaDiffResult;
45
+ //#endregion
46
+ export { SqlSchemaDiffInput as n, SqlSchemaDiffResult as r, SqlSchemaDiffFn as t };
47
+ //# sourceMappingURL=schema-differ-DpG_gnur-g5_iks8G.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-differ-DpG_gnur-g5_iks8G.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/schema-differ-DpG_gnur.d.mts"],"mappings":";;;;;;;;;;;;;;;;;UAcU;;WAEC,iBAAiB;;;;;;;;;WASjB,uBAAuB,OAAO,oBAAoB;;;;;;WAMlD,gBAAgB;aACd,QAAQ;;;UAGX;WACC,UAAU,SAAS;WACnB,QAAQ;WACR,qBAAqB,cAAc;;KAEzC,mBAAmB,OAAO,uBAAuB"}
@@ -0,0 +1,2 @@
1
+ import { C as SqlUniqueIR, D as relationalNodeEntityKind, E as defineNonEnumerable, O as relationalNodeGranularity, S as SqlTypeMetadataRegistry, T as assertNode, _ as SqlSchemaIRInput, a as SqlCheckConstraintIR, b as SqlTableIRInput, c as SqlColumnDefaultIRInput, d as SqlForeignKeyIR, f as SqlForeignKeyIRInput, g as SqlSchemaIR, h as SqlReferentialAction, i as SqlAnnotations, l as SqlColumnIR, m as SqlIndexIRInput, n as PrimaryKeyInput, o as SqlCheckConstraintIRInput, p as SqlIndexIR, r as RelationalSchemaNodeKind, s as SqlColumnDefaultIR, t as PrimaryKey, u as SqlColumnIRInput, v as SqlSchemaIRNode, w as SqlUniqueIRInput, x as SqlTypeMetadata, y as SqlTableIR } from "./types-CvbBw1Jo-3KQdErJY.mjs";
2
+ export { PrimaryKey, type PrimaryKeyInput, RelationalSchemaNodeKind, type SqlAnnotations, SqlCheckConstraintIR, type SqlCheckConstraintIRInput, SqlColumnDefaultIR, type SqlColumnDefaultIRInput, SqlColumnIR, type SqlColumnIRInput, SqlForeignKeyIR, type SqlForeignKeyIRInput, SqlIndexIR, type SqlIndexIRInput, type SqlReferentialAction, SqlSchemaIR, type SqlSchemaIRInput, SqlSchemaIRNode, SqlTableIR, type SqlTableIRInput, type SqlTypeMetadata, type SqlTypeMetadataRegistry, SqlUniqueIR, type SqlUniqueIRInput, assertNode, defineNonEnumerable, relationalNodeEntityKind, relationalNodeGranularity };
@@ -0,0 +1,2 @@
1
+ import { a as SqlColumnIR, c as SqlSchemaIR, d as SqlUniqueIR, f as assertNode, h as relationalNodeGranularity, i as SqlColumnDefaultIR, l as SqlSchemaIRNode, m as relationalNodeEntityKind, n as RelationalSchemaNodeKind, o as SqlForeignKeyIR, p as defineNonEnumerable, r as SqlCheckConstraintIR, s as SqlIndexIR, t as PrimaryKey, u as SqlTableIR } from "./types-DmhUVq4u-BpqqjPJx.mjs";
2
+ export { PrimaryKey, RelationalSchemaNodeKind, SqlCheckConstraintIR, SqlColumnDefaultIR, SqlColumnIR, SqlForeignKeyIR, SqlIndexIR, SqlSchemaIR, SqlSchemaIRNode, SqlTableIR, SqlUniqueIR, assertNode, defineNonEnumerable, relationalNodeEntityKind, relationalNodeGranularity };
@@ -0,0 +1,2 @@
1
+ import { a as assertWireNamePrefixLength, c as formatWireName, d as namingOfLiveName, f as normalizeIndexOptionValue, h as parseWireName, i as WireName, l as nameOf, m as parseNaming, n as SqlObjectNaming, o as computeIndexContentHash, p as normalizeSqlBody, r as WIRE_NAME_PREFIX_MAX_LENGTH, s as defaultIndexName, t as IndexContentHashParts, u as namingOf } from "./naming-jLgdauLi-C84G_UHi.mjs";
2
+ export { type IndexContentHashParts, type SqlObjectNaming, WIRE_NAME_PREFIX_MAX_LENGTH, type WireName, assertWireNamePrefixLength, computeIndexContentHash, defaultIndexName, formatWireName, nameOf, namingOf, namingOfLiveName, normalizeIndexOptionValue, normalizeSqlBody, parseNaming, parseWireName };
@@ -0,0 +1,2 @@
1
+ import { a as formatWireName, c as namingOfLiveName, d as parseNaming, f as parseWireName, i as defaultIndexName, l as normalizeIndexOptionValue, n as assertWireNamePrefixLength, o as nameOf, r as computeIndexContentHash, s as namingOf, t as WIRE_NAME_PREFIX_MAX_LENGTH, u as normalizeSqlBody } from "./naming-BwqqVcZy-BgTObIQw.mjs";
2
+ export { WIRE_NAME_PREFIX_MAX_LENGTH, assertWireNamePrefixLength, computeIndexContentHash, defaultIndexName, formatWireName, nameOf, namingOf, namingOfLiveName, normalizeIndexOptionValue, normalizeSqlBody, parseNaming, parseWireName };
@@ -0,0 +1,3 @@
1
+ import { C as SqlUniqueIR, D as relationalNodeEntityKind, E as defineNonEnumerable, O as relationalNodeGranularity, S as SqlTypeMetadataRegistry, T as assertNode, _ as SqlSchemaIRInput, a as SqlCheckConstraintIR, b as SqlTableIRInput, c as SqlColumnDefaultIRInput, d as SqlForeignKeyIR, f as SqlForeignKeyIRInput, g as SqlSchemaIR, h as SqlReferentialAction, i as SqlAnnotations, l as SqlColumnIR, m as SqlIndexIRInput, n as PrimaryKeyInput, o as SqlCheckConstraintIRInput, p as SqlIndexIR, r as RelationalSchemaNodeKind, s as SqlColumnDefaultIR, t as PrimaryKey, u as SqlColumnIRInput, v as SqlSchemaIRNode, w as SqlUniqueIRInput, x as SqlTypeMetadata, y as SqlTableIR } from "./types-CvbBw1Jo-3KQdErJY.mjs";
2
+ import "./types-TvBZ2Ne9.mjs";
3
+ export { PrimaryKey, type PrimaryKeyInput, RelationalSchemaNodeKind, type SqlAnnotations, SqlCheckConstraintIR, type SqlCheckConstraintIRInput, SqlColumnDefaultIR, type SqlColumnDefaultIRInput, SqlColumnIR, type SqlColumnIRInput, SqlForeignKeyIR, type SqlForeignKeyIRInput, SqlIndexIR, type SqlIndexIRInput, type SqlReferentialAction, SqlSchemaIR, type SqlSchemaIRInput, SqlSchemaIRNode, SqlTableIR, type SqlTableIRInput, type SqlTypeMetadata, type SqlTypeMetadataRegistry, SqlUniqueIR, type SqlUniqueIRInput, assertNode, defineNonEnumerable, relationalNodeEntityKind, relationalNodeGranularity };
@@ -0,0 +1,2 @@
1
+ import { a as SqlColumnIR, c as SqlSchemaIR, d as SqlUniqueIR, f as assertNode, h as relationalNodeGranularity, i as SqlColumnDefaultIR, l as SqlSchemaIRNode, m as relationalNodeEntityKind, n as RelationalSchemaNodeKind, o as SqlForeignKeyIR, p as defineNonEnumerable, r as SqlCheckConstraintIR, s as SqlIndexIR, t as PrimaryKey, u as SqlTableIR } from "./types-DmhUVq4u-BpqqjPJx.mjs";
2
+ export { PrimaryKey, RelationalSchemaNodeKind, SqlCheckConstraintIR, SqlColumnDefaultIR, SqlColumnIR, SqlForeignKeyIR, SqlIndexIR, SqlSchemaIR, SqlSchemaIRNode, SqlTableIR, SqlUniqueIR, assertNode, defineNonEnumerable, relationalNodeEntityKind, relationalNodeGranularity };
@@ -0,0 +1,222 @@
1
+ import { l as isStorageTypeInstance } from "./types-CMMQS6aG.mjs";
2
+ import { n as RelationalSchemaNodeKind } from "./types-DmhUVq4u-BpqqjPJx.mjs";
3
+ import { effectiveControlPolicy } from "@prisma/orm-framework/contract/types";
4
+ import { blindCast } from "@prisma/orm-framework/utils/casts";
5
+ import { ifDefined } from "@prisma/orm-framework/utils/defined";
6
+ import { assertUniqueCodecOwner, dispositionForCategory, issueOutcome } from "@prisma/orm-framework/components/control";
7
+ //#region ../../../2-sql/9-family/dist/schema-verify-vtFZbmGq.mjs
8
+ function hasCodecControlHooks(descriptor) {
9
+ if (typeof descriptor !== "object" || descriptor === null) return false;
10
+ const hooks = descriptor.types?.codecTypes?.controlPlaneHooks;
11
+ return hooks !== null && hooks !== void 0 && typeof hooks === "object";
12
+ }
13
+ function extractCodecControlHooks(descriptors) {
14
+ const hooks = /* @__PURE__ */ new Map();
15
+ const owners = /* @__PURE__ */ new Map();
16
+ for (const descriptor of descriptors) {
17
+ if (typeof descriptor !== "object" || descriptor === null) continue;
18
+ if (!hasCodecControlHooks(descriptor)) continue;
19
+ const controlPlaneHooks = descriptor.types.codecTypes.controlPlaneHooks;
20
+ for (const [codecId, hook] of Object.entries(controlPlaneHooks)) {
21
+ assertUniqueCodecOwner({
22
+ codecId,
23
+ owners,
24
+ descriptorId: descriptor.id,
25
+ entityLabel: "control hooks",
26
+ entityOwnershipLabel: "owner"
27
+ });
28
+ hooks.set(codecId, hook);
29
+ owners.set(codecId, descriptor.id);
30
+ }
31
+ }
32
+ return hooks;
33
+ }
34
+ /**
35
+ * Classifies a codec `verifyType` hook finding into the target-neutral
36
+ * categories the framework grades. A storage type is a named type instance
37
+ * (e.g. a native enum); the only shape divergence it can carry is a change
38
+ * to its value set, so a paired mismatch always classifies as `valueDrift`.
39
+ */
40
+ function classifyStorageTypeDiffIssue(issue) {
41
+ if (issueOutcome(issue) === "not-found") return "declaredMissing";
42
+ if (issueOutcome(issue) === "not-expected") return "extraAuxiliary";
43
+ return "valueDrift";
44
+ }
45
+ function verifierDisposition(controlPolicy, issue) {
46
+ return dispositionForCategory(controlPolicy, classifyStorageTypeDiffIssue(issue));
47
+ }
48
+ function issueNode(issue) {
49
+ const node = issue.expected ?? issue.actual;
50
+ if (node === void 0) return void 0;
51
+ return blindCast(node);
52
+ }
53
+ /**
54
+ * Resolves an issue's framework-neutral {@link DiffSubjectGranularity} on
55
+ * demand, from the issue's node's `nodeKind` via the target-provided
56
+ * `granularityOf` map. The node carries only its `nodeKind` identity, never a
57
+ * classification, and nothing is stamped onto the issue — every consumer
58
+ * (the family verdict below, the framework aggregate's unclaimed-elements
59
+ * sweep via {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable})
60
+ * calls this the same way, resolved by the family/target that owns the node
61
+ * vocabulary. `undefined` for an issue with no node.
62
+ */
63
+ function classifyDiffSubjectGranularity(issue, granularityOf) {
64
+ const node = issueNode(issue);
65
+ return node === void 0 ? void 0 : granularityOf(node.nodeKind);
66
+ }
67
+ /**
68
+ * Resolves an issue's storage `entityKind` on demand, from the issue's
69
+ * node's `nodeKind` via the target-provided `entityKindOf` map — the sibling
70
+ * of {@link classifyDiffSubjectGranularity}, called the same way by the same
71
+ * consumers (via
72
+ * {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable}).
73
+ * `undefined` for an issue with no node, or for a node kind with no storage
74
+ * entity of its own.
75
+ */
76
+ function classifyDiffEntityKind(issue, entityKindOf) {
77
+ const node = issueNode(issue);
78
+ return node === void 0 ? void 0 : entityKindOf(node.nodeKind);
79
+ }
80
+ /**
81
+ * Re-keys the legacy `classifySqlVerifierIssueKind` category mapping on the
82
+ * issue's {@link DiffSubjectGranularity} (resolved via `granularityOf`) + the
83
+ * issue reason. The vocabulary maps one-to-one: an undeclared live entity or
84
+ * namespace is `extraTopLevelObject`, an undeclared live field
85
+ * `extraNestedElement`, undeclared auxiliaries (constraints, indexes,
86
+ * defaults) and structural leaves (policies) `extraAuxiliary`; a value-set
87
+ * drift on a check node is `valueDrift`; every other paired divergence is
88
+ * `declaredIncompatible`; anything the database lacks is `declaredMissing`.
89
+ * `granularityOf` is the target's classifier, so target and extension node
90
+ * kinds classify without the family importing them.
91
+ */
92
+ function classifySqlDiffIssue(issue, granularityOf) {
93
+ if (issueOutcome(issue) === "not-found") return "declaredMissing";
94
+ if (issueOutcome(issue) === "not-expected") {
95
+ const granularity = classifyDiffSubjectGranularity(issue, granularityOf);
96
+ if (granularity === "entity" || granularity === "namespace") return "extraTopLevelObject";
97
+ if (granularity === "field") return "extraNestedElement";
98
+ return "extraAuxiliary";
99
+ }
100
+ if (issueNode(issue)?.nodeKind === RelationalSchemaNodeKind.check) return "valueDrift";
101
+ return "declaredIncompatible";
102
+ }
103
+ /**
104
+ * Whether a `not-expected` issue is a strict-mode-only finding. The legacy
105
+ * walk detected every relational extra (namespaces, entities, fields, and
106
+ * their auxiliaries) only under `--strict`; the structural diff (roots, RLS
107
+ * policies, roles) was never strict-gated — its extras fail in both modes.
108
+ * Keyed on the issue's granularity, resolved via `granularityOf`.
109
+ */
110
+ function isStrictOnlyExtra(issue, granularityOf) {
111
+ const granularity = classifyDiffSubjectGranularity(issue, granularityOf);
112
+ return granularity === "namespace" || granularity === "entity" || granularity === "field" || granularity === "auxiliary";
113
+ }
114
+ /**
115
+ * Applies the two consumer filters to a diff issue list: strict gating
116
+ * (relational `not-expected` findings drop in lenient mode) and
117
+ * control-policy disposition (each surviving issue grades against its
118
+ * subject table's effective policy; suppressed issues drop, `observed`
119
+ * subjects warn). The verify verdict is `failures.length === 0`.
120
+ */
121
+ function computeSqlDiffVerdict(input) {
122
+ const failures = [];
123
+ const warnings = [];
124
+ for (const issue of input.issues) {
125
+ if (!input.strict && issueOutcome(issue) === "not-expected" && isStrictOnlyExtra(issue, input.granularityOf)) continue;
126
+ const disposition = dispositionForCategory(effectiveControlPolicy(input.resolveControlPolicy(issue), input.defaultControlPolicy), classifySqlDiffIssue(issue, input.granularityOf));
127
+ if (disposition === "suppress") continue;
128
+ if (disposition === "warn") {
129
+ warnings.push(issue);
130
+ continue;
131
+ }
132
+ failures.push(issue);
133
+ }
134
+ return {
135
+ failures,
136
+ warnings
137
+ };
138
+ }
139
+ function computeStorageTypeVerdict(input) {
140
+ const failures = [];
141
+ const warnings = [];
142
+ const policy = effectiveControlPolicy(void 0, input.contract.defaultControlPolicy);
143
+ for (const pair of input.namespacePairs) {
144
+ if (pair.actual === void 0) continue;
145
+ for (const [typeName, typeInstance] of Object.entries(input.contract.storage.types ?? {})) {
146
+ if (!isStorageTypeInstance(typeInstance)) continue;
147
+ const hook = input.codecHooks.get(typeInstance.codecId);
148
+ if (!hook?.verifyType) continue;
149
+ const typeIssues = hook.verifyType({
150
+ typeName,
151
+ typeInstance,
152
+ schema: pair.actual
153
+ });
154
+ for (const issue of typeIssues) {
155
+ const disposition = verifierDisposition(policy, issue);
156
+ if (disposition === "suppress") continue;
157
+ if (disposition === "warn") {
158
+ warnings.push(issue);
159
+ continue;
160
+ }
161
+ failures.push(issue);
162
+ }
163
+ }
164
+ }
165
+ return {
166
+ failures,
167
+ warnings
168
+ };
169
+ }
170
+ /**
171
+ * THE SQL schema verify: runs the target's full-tree node diff, grades it
172
+ * through the family's post-diff filters (strict gating + control-policy
173
+ * disposition) plus the codec `verifyType` hook findings, and wraps the
174
+ * verdict in the issue-based result envelope. `ok` holds exactly when both
175
+ * issue lists are empty — the lists carry the verdict's failures.
176
+ */
177
+ function verifySqlSchemaByDiff(input) {
178
+ const startTime = Date.now();
179
+ const verdictDiff = input.diffSchema({
180
+ contract: input.contract,
181
+ schema: input.schema,
182
+ frameworkComponents: input.frameworkComponents
183
+ });
184
+ const diffVerdict = computeSqlDiffVerdict({
185
+ issues: verdictDiff.issues,
186
+ resolveControlPolicy: verdictDiff.resolveControlPolicy,
187
+ strict: input.strict,
188
+ defaultControlPolicy: input.contract.defaultControlPolicy,
189
+ granularityOf: input.granularityOf
190
+ });
191
+ const storageTypeVerdict = computeStorageTypeVerdict({
192
+ contract: input.contract,
193
+ namespacePairs: verdictDiff.namespacePairs,
194
+ codecHooks: extractCodecControlHooks(input.frameworkComponents)
195
+ });
196
+ const failCount = diffVerdict.failures.length + storageTypeVerdict.failures.length;
197
+ const ok = failCount === 0;
198
+ const profileHash = "profileHash" in input.contract && typeof input.contract.profileHash === "string" ? input.contract.profileHash : void 0;
199
+ return {
200
+ ok,
201
+ ...ok ? {} : { code: "CONTRACT.SCHEMA_VERIFICATION_FAILED" },
202
+ summary: ok ? "Database schema satisfies contract" : `Database schema does not satisfy contract (${failCount} failure${failCount === 1 ? "" : "s"})`,
203
+ contract: {
204
+ storageHash: input.contract.storage.storageHash,
205
+ ...ifDefined("profileHash", profileHash)
206
+ },
207
+ target: {
208
+ expected: input.contract.target,
209
+ actual: input.contract.target
210
+ },
211
+ schema: {
212
+ issues: [...diffVerdict.failures, ...storageTypeVerdict.failures],
213
+ warnings: { issues: [...diffVerdict.warnings, ...storageTypeVerdict.warnings] }
214
+ },
215
+ meta: { strict: input.strict },
216
+ timings: { total: Date.now() - startTime }
217
+ };
218
+ }
219
+ //#endregion
220
+ export { computeStorageTypeVerdict as a, computeSqlDiffVerdict as i, classifyDiffSubjectGranularity as n, extractCodecControlHooks as o, classifySqlDiffIssue as r, verifySqlSchemaByDiff as s, classifyDiffEntityKind as t };
221
+
222
+ //# sourceMappingURL=schema-verify-vtFZbmGq-BNfTr6fU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-verify-vtFZbmGq-BNfTr6fU.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/schema-verify-vtFZbmGq.mjs"],"sourcesContent":["import { blindCast } from \"@internal/utils/casts\";\nimport { assertUniqueCodecOwner, dispositionForCategory, issueOutcome } from \"@internal/framework-components/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { effectiveControlPolicy } from \"@internal/contract/types\";\nimport { isStorageTypeInstance } from \"@internal/sql-contract/types\";\nimport { RelationalSchemaNodeKind } from \"@internal/sql-schema-ir/types\";\n//#region src/core/assembly.ts\nfunction hasCodecControlHooks(descriptor) {\n\tif (typeof descriptor !== \"object\" || descriptor === null) return false;\n\tconst hooks = descriptor.types?.codecTypes?.controlPlaneHooks;\n\treturn hooks !== null && hooks !== void 0 && typeof hooks === \"object\";\n}\nfunction extractCodecControlHooks(descriptors) {\n\tconst hooks = /* @__PURE__ */ new Map();\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tif (typeof descriptor !== \"object\" || descriptor === null) continue;\n\t\tif (!hasCodecControlHooks(descriptor)) continue;\n\t\tconst controlPlaneHooks = descriptor.types.codecTypes.controlPlaneHooks;\n\t\tfor (const [codecId, hook] of Object.entries(controlPlaneHooks)) {\n\t\t\tassertUniqueCodecOwner({\n\t\t\t\tcodecId,\n\t\t\t\towners,\n\t\t\t\tdescriptorId: descriptor.id,\n\t\t\t\tentityLabel: \"control hooks\",\n\t\t\t\tentityOwnershipLabel: \"owner\"\n\t\t\t});\n\t\t\thooks.set(codecId, hook);\n\t\t\towners.set(codecId, descriptor.id);\n\t\t}\n\t}\n\treturn hooks;\n}\n//#endregion\n//#region src/core/diff/verifier-disposition.ts\n/**\n* Classifies a codec `verifyType` hook finding into the target-neutral\n* categories the framework grades. A storage type is a named type instance\n* (e.g. a native enum); the only shape divergence it can carry is a change\n* to its value set, so a paired mismatch always classifies as `valueDrift`.\n*/\nfunction classifyStorageTypeDiffIssue(issue) {\n\tif (issueOutcome(issue) === \"not-found\") return \"declaredMissing\";\n\tif (issueOutcome(issue) === \"not-expected\") return \"extraAuxiliary\";\n\treturn \"valueDrift\";\n}\nfunction verifierDisposition(controlPolicy, issue) {\n\treturn dispositionForCategory(controlPolicy, classifyStorageTypeDiffIssue(issue));\n}\n//#endregion\n//#region src/core/diff/schema-verify.ts\nfunction issueNode(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\treturn blindCast(node);\n}\n/**\n* Resolves an issue's framework-neutral {@link DiffSubjectGranularity} on\n* demand, from the issue's node's `nodeKind` via the target-provided\n* `granularityOf` map. The node carries only its `nodeKind` identity, never a\n* classification, and nothing is stamped onto the issue — every consumer\n* (the family verdict below, the framework aggregate's unclaimed-elements\n* sweep via {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable})\n* calls this the same way, resolved by the family/target that owns the node\n* vocabulary. `undefined` for an issue with no node.\n*/\nfunction classifyDiffSubjectGranularity(issue, granularityOf) {\n\tconst node = issueNode(issue);\n\treturn node === void 0 ? void 0 : granularityOf(node.nodeKind);\n}\n/**\n* Resolves an issue's storage `entityKind` on demand, from the issue's\n* node's `nodeKind` via the target-provided `entityKindOf` map — the sibling\n* of {@link classifyDiffSubjectGranularity}, called the same way by the same\n* consumers (via\n* {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable}).\n* `undefined` for an issue with no node, or for a node kind with no storage\n* entity of its own.\n*/\nfunction classifyDiffEntityKind(issue, entityKindOf) {\n\tconst node = issueNode(issue);\n\treturn node === void 0 ? void 0 : entityKindOf(node.nodeKind);\n}\n/**\n* Re-keys the legacy `classifySqlVerifierIssueKind` category mapping on the\n* issue's {@link DiffSubjectGranularity} (resolved via `granularityOf`) + the\n* issue reason. The vocabulary maps one-to-one: an undeclared live entity or\n* namespace is `extraTopLevelObject`, an undeclared live field\n* `extraNestedElement`, undeclared auxiliaries (constraints, indexes,\n* defaults) and structural leaves (policies) `extraAuxiliary`; a value-set\n* drift on a check node is `valueDrift`; every other paired divergence is\n* `declaredIncompatible`; anything the database lacks is `declaredMissing`.\n* `granularityOf` is the target's classifier, so target and extension node\n* kinds classify without the family importing them.\n*/\nfunction classifySqlDiffIssue(issue, granularityOf) {\n\tif (issueOutcome(issue) === \"not-found\") return \"declaredMissing\";\n\tif (issueOutcome(issue) === \"not-expected\") {\n\t\tconst granularity = classifyDiffSubjectGranularity(issue, granularityOf);\n\t\tif (granularity === \"entity\" || granularity === \"namespace\") return \"extraTopLevelObject\";\n\t\tif (granularity === \"field\") return \"extraNestedElement\";\n\t\treturn \"extraAuxiliary\";\n\t}\n\tif (issueNode(issue)?.nodeKind === RelationalSchemaNodeKind.check) return \"valueDrift\";\n\treturn \"declaredIncompatible\";\n}\n/**\n* Whether a `not-expected` issue is a strict-mode-only finding. The legacy\n* walk detected every relational extra (namespaces, entities, fields, and\n* their auxiliaries) only under `--strict`; the structural diff (roots, RLS\n* policies, roles) was never strict-gated — its extras fail in both modes.\n* Keyed on the issue's granularity, resolved via `granularityOf`.\n*/\nfunction isStrictOnlyExtra(issue, granularityOf) {\n\tconst granularity = classifyDiffSubjectGranularity(issue, granularityOf);\n\treturn granularity === \"namespace\" || granularity === \"entity\" || granularity === \"field\" || granularity === \"auxiliary\";\n}\n/**\n* Applies the two consumer filters to a diff issue list: strict gating\n* (relational `not-expected` findings drop in lenient mode) and\n* control-policy disposition (each surviving issue grades against its\n* subject table's effective policy; suppressed issues drop, `observed`\n* subjects warn). The verify verdict is `failures.length === 0`.\n*/\nfunction computeSqlDiffVerdict(input) {\n\tconst failures = [];\n\tconst warnings = [];\n\tfor (const issue of input.issues) {\n\t\tif (!input.strict && issueOutcome(issue) === \"not-expected\" && isStrictOnlyExtra(issue, input.granularityOf)) continue;\n\t\tconst disposition = dispositionForCategory(effectiveControlPolicy(input.resolveControlPolicy(issue), input.defaultControlPolicy), classifySqlDiffIssue(issue, input.granularityOf));\n\t\tif (disposition === \"suppress\") continue;\n\t\tif (disposition === \"warn\") {\n\t\t\twarnings.push(issue);\n\t\t\tcontinue;\n\t\t}\n\t\tfailures.push(issue);\n\t}\n\treturn {\n\t\tfailures,\n\t\twarnings\n\t};\n}\nfunction computeStorageTypeVerdict(input) {\n\tconst failures = [];\n\tconst warnings = [];\n\tconst policy = effectiveControlPolicy(void 0, input.contract.defaultControlPolicy);\n\tfor (const pair of input.namespacePairs) {\n\t\tif (pair.actual === void 0) continue;\n\t\tfor (const [typeName, typeInstance] of Object.entries(input.contract.storage.types ?? {})) {\n\t\t\tif (!isStorageTypeInstance(typeInstance)) continue;\n\t\t\tconst hook = input.codecHooks.get(typeInstance.codecId);\n\t\t\tif (!hook?.verifyType) continue;\n\t\t\tconst typeIssues = hook.verifyType({\n\t\t\t\ttypeName,\n\t\t\t\ttypeInstance,\n\t\t\t\tschema: pair.actual\n\t\t\t});\n\t\t\tfor (const issue of typeIssues) {\n\t\t\t\tconst disposition = verifierDisposition(policy, issue);\n\t\t\t\tif (disposition === \"suppress\") continue;\n\t\t\t\tif (disposition === \"warn\") {\n\t\t\t\t\twarnings.push(issue);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tfailures.push(issue);\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tfailures,\n\t\twarnings\n\t};\n}\n/**\n* THE SQL schema verify: runs the target's full-tree node diff, grades it\n* through the family's post-diff filters (strict gating + control-policy\n* disposition) plus the codec `verifyType` hook findings, and wraps the\n* verdict in the issue-based result envelope. `ok` holds exactly when both\n* issue lists are empty — the lists carry the verdict's failures.\n*/\nfunction verifySqlSchemaByDiff(input) {\n\tconst startTime = Date.now();\n\tconst verdictDiff = input.diffSchema({\n\t\tcontract: input.contract,\n\t\tschema: input.schema,\n\t\tframeworkComponents: input.frameworkComponents\n\t});\n\tconst diffVerdict = computeSqlDiffVerdict({\n\t\tissues: verdictDiff.issues,\n\t\tresolveControlPolicy: verdictDiff.resolveControlPolicy,\n\t\tstrict: input.strict,\n\t\tdefaultControlPolicy: input.contract.defaultControlPolicy,\n\t\tgranularityOf: input.granularityOf\n\t});\n\tconst storageTypeVerdict = computeStorageTypeVerdict({\n\t\tcontract: input.contract,\n\t\tnamespacePairs: verdictDiff.namespacePairs,\n\t\tcodecHooks: extractCodecControlHooks(input.frameworkComponents)\n\t});\n\tconst failCount = diffVerdict.failures.length + storageTypeVerdict.failures.length;\n\tconst ok = failCount === 0;\n\tconst profileHash = \"profileHash\" in input.contract && typeof input.contract.profileHash === \"string\" ? input.contract.profileHash : void 0;\n\treturn {\n\t\tok,\n\t\t...ok ? {} : { code: \"CONTRACT.SCHEMA_VERIFICATION_FAILED\" },\n\t\tsummary: ok ? \"Database schema satisfies contract\" : `Database schema does not satisfy contract (${failCount} failure${failCount === 1 ? \"\" : \"s\"})`,\n\t\tcontract: {\n\t\t\tstorageHash: input.contract.storage.storageHash,\n\t\t\t...ifDefined(\"profileHash\", profileHash)\n\t\t},\n\t\ttarget: {\n\t\t\texpected: input.contract.target,\n\t\t\tactual: input.contract.target\n\t\t},\n\t\tschema: {\n\t\t\tissues: [...diffVerdict.failures, ...storageTypeVerdict.failures],\n\t\t\twarnings: { issues: [...diffVerdict.warnings, ...storageTypeVerdict.warnings] }\n\t\t},\n\t\tmeta: { strict: input.strict },\n\t\ttimings: { total: Date.now() - startTime }\n\t};\n}\n//#endregion\nexport { computeStorageTypeVerdict as a, computeSqlDiffVerdict as i, classifyDiffSubjectGranularity as n, verifySqlSchemaByDiff as o, classifySqlDiffIssue as r, extractCodecControlHooks as s, classifyDiffEntityKind as t };\n\n//# sourceMappingURL=schema-verify-vtFZbmGq.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,qBAAqB,YAAY;CACzC,IAAI,OAAO,eAAe,YAAY,eAAe,MAAM,OAAO;CAClE,MAAM,QAAQ,WAAW,OAAO,YAAY;CAC5C,OAAO,UAAU,QAAQ,UAAU,KAAK,KAAK,OAAO,UAAU;AAC/D;AACA,SAAS,yBAAyB,aAAa;CAC9C,MAAM,wBAAwB,IAAI,IAAI;CACtC,MAAM,yBAAyB,IAAI,IAAI;CACvC,KAAK,MAAM,cAAc,aAAa;EACrC,IAAI,OAAO,eAAe,YAAY,eAAe,MAAM;EAC3D,IAAI,CAAC,qBAAqB,UAAU,GAAG;EACvC,MAAM,oBAAoB,WAAW,MAAM,WAAW;EACtD,KAAK,MAAM,CAAC,SAAS,SAAS,OAAO,QAAQ,iBAAiB,GAAG;GAChE,uBAAuB;IACtB;IACA;IACA,cAAc,WAAW;IACzB,aAAa;IACb,sBAAsB;GACvB,CAAC;GACD,MAAM,IAAI,SAAS,IAAI;GACvB,OAAO,IAAI,SAAS,WAAW,EAAE;EAClC;CACD;CACA,OAAO;AACR;;;;;;;AASA,SAAS,6BAA6B,OAAO;CAC5C,IAAI,aAAa,KAAK,MAAM,aAAa,OAAO;CAChD,IAAI,aAAa,KAAK,MAAM,gBAAgB,OAAO;CACnD,OAAO;AACR;AACA,SAAS,oBAAoB,eAAe,OAAO;CAClD,OAAO,uBAAuB,eAAe,6BAA6B,KAAK,CAAC;AACjF;AAGA,SAAS,UAAU,OAAO;CACzB,MAAM,OAAO,MAAM,YAAY,MAAM;CACrC,IAAI,SAAS,KAAK,GAAG,OAAO,KAAK;CACjC,OAAO,UAAU,IAAI;AACtB;;;;;;;;;;;AAWA,SAAS,+BAA+B,OAAO,eAAe;CAC7D,MAAM,OAAO,UAAU,KAAK;CAC5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MAAM,SAAS,cAAc,KAAK;CAC1I,OAAO;EACN;EACA,GAAG,KAAK,CAAC,IAAI,EAAE,MAAM,sCAAsC;EAC3D,SAAS,KAAK,uCAAuC,8CAA8C,UAAU,UAAU,cAAc,IAAI,KAAK,IAAI;EAClJ,UAAU;GACT,aAAa,MAAM,SAAS,QAAQ;GACpC,GAAG,UAAU,eAAe,WAAW;EACxC;EACA,QAAQ;GACP,UAAU,MAAM,SAAS;GACzB,QAAQ,MAAM,SAAS;EACxB;EACA,QAAQ;GACP,QAAQ,CAAC,GAAG,YAAY,UAAU,GAAG,mBAAmB,QAAQ;GAChE,UAAU,EAAE,QAAQ,CAAC,GAAG,YAAY,UAAU,GAAG,mBAAmB,QAAQ,EAAE;EAC/E;EACA,MAAM,EAAE,QAAQ,MAAM,OAAO;EAC7B,SAAS,EAAE,OAAO,KAAK,IAAI,IAAI,UAAU;CAC1C;AACD"}
@@ -0,0 +1,26 @@
1
+ import { n as IndexElements, r as IndexInput } from "./sql-index-DsI8HAeK-BJsn-jvD.mjs";
2
+ //#region ../../../2-sql/1-core/contract/dist/serialized-index-B96AwqtU.d.mts
3
+ //#region src/serialized-index.d.ts
4
+ /**
5
+ * An index as `contract.json` stores it: full `name`, optional `prefix` whose
6
+ * presence marks wire mode. The `table` entity kind hydrates it through
7
+ * {@link indexInputFromSerialized}.
8
+ */
9
+ type SerializedIndex = IndexElements & {
10
+ readonly name: string;
11
+ readonly prefix?: string;
12
+ readonly where?: string;
13
+ readonly unique: boolean;
14
+ readonly type?: string;
15
+ readonly options?: Record<string, unknown>;
16
+ };
17
+ /**
18
+ * Hydrates one stored index into constructor input. The parameter is typed
19
+ * but the values are whatever the file held, so each field the union depends
20
+ * on is checked here rather than downstream — by the time `Index` sees the
21
+ * data it is already a valid union.
22
+ */
23
+ declare function indexInputFromSerialized(flat: SerializedIndex): IndexInput;
24
+ //#endregion
25
+ export { indexInputFromSerialized as n, SerializedIndex as t };
26
+ //# sourceMappingURL=serialized-index-B96AwqtU-DcqcB4q_.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serialized-index-B96AwqtU-DcqcB4q_.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/serialized-index-B96AwqtU.d.mts"],"mappings":";;;;;;;;KAOK,kBAAkB;WACZ;WACA;WACA;WACA;WACA;WACA,UAAU;;;;;;;;iBAQJ,yBAAyB,MAAM,kBAAkB"}