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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (564) hide show
  1. package/README.md +2 -6
  2. package/dist/{aggregate-descriptor-registry-C7hel5O7.mjs → aggregate-descriptor-registry-ZrKjxwQe.mjs} +5 -5
  3. package/dist/aggregate-descriptor-registry-ZrKjxwQe.mjs.map +1 -0
  4. package/dist/ast-D0miQ1B6.mjs +372 -0
  5. package/dist/ast-D0miQ1B6.mjs.map +1 -0
  6. package/dist/ast-YEMe_B8z.d.mts +292 -0
  7. package/dist/ast-YEMe_B8z.d.mts.map +1 -0
  8. package/dist/attribute-specs-DA_RwQFB.d.mts +114 -0
  9. package/dist/attribute-specs-DA_RwQFB.d.mts.map +1 -0
  10. package/dist/{authored-check-naming-Hf9990DV.mjs → authored-check-naming-BHGJhjqn.mjs} +5 -5
  11. package/dist/authored-check-naming-BHGJhjqn.mjs.map +1 -0
  12. package/dist/{authored-check-naming-BWBe-PVE.d.mts → authored-check-naming-D-o196ry.d.mts} +3 -3
  13. package/dist/authored-check-naming-D-o196ry.d.mts.map +1 -0
  14. package/dist/authoring-entity-types-CgKIgWq5-pEdfjam5.d.mts +9 -0
  15. package/dist/authoring-entity-types-CgKIgWq5-pEdfjam5.d.mts.map +1 -0
  16. package/dist/builder.d.mts +4 -3
  17. package/dist/builder__runtime.d.mts +29 -31
  18. package/dist/builder__runtime.d.mts.map +1 -1
  19. package/dist/builder__runtime.mjs +261 -191
  20. package/dist/builder__runtime.mjs.map +1 -1
  21. package/dist/builder__types.d.mts +6 -3
  22. package/dist/{canonicalization-hooks-dmXkOR4a.mjs → canonicalization-hooks-Ce1v_TDl.mjs} +2 -2
  23. package/dist/canonicalization-hooks-Ce1v_TDl.mjs.map +1 -0
  24. package/dist/{canonicalization-hooks-CYnW_sGn.d.mts → canonicalization-hooks-DyapQ0my.d.mts} +2 -2
  25. package/dist/canonicalization-hooks-DyapQ0my.d.mts.map +1 -0
  26. package/dist/{check-constraint-B7qGu6rc-HvQjjX82.d.mts → check-constraint-B7qGu6rc-Bk2ezWXu.d.mts} +4 -4
  27. package/dist/check-constraint-B7qGu6rc-Bk2ezWXu.d.mts.map +1 -0
  28. package/dist/{codec-descriptor-registry-N0dhtKaH.mjs → codec-descriptor-registry-CiiFzMtb.mjs} +13 -40
  29. package/dist/codec-descriptor-registry-CiiFzMtb.mjs.map +1 -0
  30. package/dist/collection-methods-BB8YH69u.d.mts +1 -0
  31. package/dist/collection-methods-D2UnCS0S-DOy2qHYS.d.mts +77 -0
  32. package/dist/collection-methods-D2UnCS0S-DOy2qHYS.d.mts.map +1 -0
  33. package/dist/{config-types-D9fdKG3g.d.mts → config-types-C-1mIiJO.d.mts} +5 -5
  34. package/dist/config-types-C-1mIiJO.d.mts.map +1 -0
  35. package/dist/{config-types-gAm54C_v.mjs → config-types-DkEeq_qq.mjs} +10 -6
  36. package/dist/config-types-DkEeq_qq.mjs.map +1 -0
  37. package/dist/{contract-builder-D4a5dT7j.mjs → contract-builder-50lF0kz1.mjs} +431 -226
  38. package/dist/contract-builder-50lF0kz1.mjs.map +1 -0
  39. package/dist/contract-builder-C_Zi57iD.d.mts +1967 -0
  40. package/dist/contract-builder-C_Zi57iD.d.mts.map +1 -0
  41. package/dist/contract-emitter.d.mts +4 -7
  42. package/dist/contract-emitter.d.mts.map +1 -1
  43. package/dist/contract-emitter.mjs +1 -1
  44. package/dist/{contract-errors-BCN6RVI5-5IHBF_lg.mjs → contract-errors-BCN6RVI5-DoH6b_KZ.mjs} +2 -2
  45. package/dist/contract-errors-BCN6RVI5-DoH6b_KZ.mjs.map +1 -0
  46. package/dist/contract-prisma7__provider.d.mts +97 -0
  47. package/dist/contract-prisma7__provider.d.mts.map +1 -0
  48. package/dist/contract-prisma7__provider.mjs +2011 -0
  49. package/dist/contract-prisma7__provider.mjs.map +1 -0
  50. package/dist/contract-psl.d.mts +18 -29
  51. package/dist/contract-psl.d.mts.map +1 -1
  52. package/dist/contract-psl.mjs +1 -1
  53. package/dist/contract-psl__attribute-specs.d.mts +2 -0
  54. package/dist/contract-psl__attribute-specs.mjs +2 -0
  55. package/dist/contract-psl__default-table-name.d.mts +7 -0
  56. package/dist/contract-psl__default-table-name.d.mts.map +1 -0
  57. package/dist/contract-psl__default-table-name.mjs +2 -0
  58. package/dist/contract-psl__diagnostics.d.mts +12 -0
  59. package/dist/contract-psl__diagnostics.d.mts.map +1 -0
  60. package/dist/contract-psl__diagnostics.mjs +2 -0
  61. package/dist/contract-psl__map-names.d.mts +16 -0
  62. package/dist/contract-psl__map-names.d.mts.map +1 -0
  63. package/dist/contract-psl__map-names.mjs +21 -0
  64. package/dist/contract-psl__map-names.mjs.map +1 -0
  65. package/dist/contract-psl__provider.d.mts +3 -3
  66. package/dist/contract-psl__provider.d.mts.map +1 -1
  67. package/dist/contract-psl__provider.mjs +95 -46
  68. package/dist/contract-psl__provider.mjs.map +1 -1
  69. package/dist/contract-ts.d.mts +5 -5
  70. package/dist/contract-ts.mjs +5 -4
  71. package/dist/contract-ts__config-types.d.mts +1 -1
  72. package/dist/contract-ts__config-types.mjs +1 -1
  73. package/dist/contract-ts__contract-builder.d.mts +4 -4
  74. package/dist/contract-ts__contract-builder.mjs +4 -3
  75. package/dist/{contract-view-BMR5IWk4.mjs → contract-view-DqpzeYeE.mjs} +2 -2
  76. package/dist/contract-view-DqpzeYeE.mjs.map +1 -0
  77. package/dist/{contract-view-CPHxoAEX.d.mts → contract-view-DuB35or0.d.mts} +3 -3
  78. package/dist/contract-view-DuB35or0.d.mts.map +1 -0
  79. package/dist/contract.d.mts +30 -28
  80. package/dist/contract.mjs +23 -18
  81. package/dist/contract__authored-check-naming.d.mts +1 -1
  82. package/dist/contract__authored-check-naming.mjs +1 -1
  83. package/dist/contract__canonicalization-hooks.d.mts +1 -1
  84. package/dist/contract__canonicalization-hooks.mjs +1 -1
  85. package/dist/contract__contract-view.d.mts +1 -1
  86. package/dist/contract__contract-view.mjs +1 -1
  87. package/dist/contract__data-type-support.d.mts +2 -0
  88. package/dist/contract__data-type-support.mjs +2 -0
  89. package/dist/contract__data-type.d.mts +2 -0
  90. package/dist/contract__data-type.mjs +3 -0
  91. package/dist/contract__entity-handle-lowering-hook.d.mts +2 -2
  92. package/dist/contract__entity-handle-lowering-hook.mjs +2 -2
  93. package/dist/contract__entity-kinds.d.mts +1 -1
  94. package/dist/contract__entity-kinds.mjs +1 -1
  95. package/dist/contract__factories.d.mts +1 -1
  96. package/dist/contract__factories.mjs +1 -1
  97. package/dist/contract__foreign-key-materialization.d.mts +2 -2
  98. package/dist/contract__foreign-key-materialization.mjs +3 -2
  99. package/dist/contract__index-naming.d.mts +2 -2
  100. package/dist/contract__index-naming.mjs +2 -2
  101. package/dist/contract__index-type-validation.d.mts +2 -2
  102. package/dist/contract__index-type-validation.mjs +1 -1
  103. package/dist/contract__index-types.d.mts +3 -3
  104. package/dist/contract__index-types.mjs +2 -2
  105. package/dist/contract__referential-action-sql.d.mts +1 -1
  106. package/dist/contract__referential-action-sql.mjs +1 -1
  107. package/dist/contract__resolve-storage-table.d.mts +1 -1
  108. package/dist/contract__resolve-storage-table.mjs +1 -1
  109. package/dist/contract__sql-expression.d.mts +2 -0
  110. package/dist/contract__sql-expression.mjs +2 -0
  111. package/dist/contract__types.d.mts +12 -12
  112. package/dist/contract__types.mjs +4 -4
  113. package/dist/contract__validators.d.mts +2 -2
  114. package/dist/contract__validators.mjs +3 -3
  115. package/dist/contract__value-set-derivation-hook.d.mts +1 -1
  116. package/dist/contract__value-set-derivation-hook.mjs +1 -1
  117. package/dist/control-BK50zF6c.mjs +2721 -0
  118. package/dist/control-BK50zF6c.mjs.map +1 -0
  119. package/dist/control-ChAUdOOu.d.mts +1416 -0
  120. package/dist/control-ChAUdOOu.d.mts.map +1 -0
  121. package/dist/{control-adapter-C99J7aEF-B7eQd7vD.d.mts → control-adapter-Bn0uhplA-BzP2uPqJ.d.mts} +27 -44
  122. package/dist/control-adapter-Bn0uhplA-BzP2uPqJ.d.mts.map +1 -0
  123. package/dist/control-adapter-NZ2kKc4x.d.mts +13 -0
  124. package/dist/control-adapter-NZ2kKc4x.d.mts.map +1 -0
  125. package/dist/control-adapter-SlQkTEwT.mjs +16 -0
  126. package/dist/control-adapter-SlQkTEwT.mjs.map +1 -0
  127. package/dist/data-type-BFSpaotu.mjs +52 -0
  128. package/dist/data-type-BFSpaotu.mjs.map +1 -0
  129. package/dist/data-type-DJIvKQHf.d.mts +158 -0
  130. package/dist/data-type-DJIvKQHf.d.mts.map +1 -0
  131. package/dist/data-type-support-BhSoPUFj.mjs +9 -0
  132. package/dist/data-type-support-BhSoPUFj.mjs.map +1 -0
  133. package/dist/data-type-support-CXpA0ex-.d.mts +7 -0
  134. package/dist/data-type-support-CXpA0ex-.d.mts.map +1 -0
  135. package/dist/{db-D18PrXKW-DvTv4JFn.d.mts → db-D1d75IvM-D4mRDC6w.d.mts} +123 -128
  136. package/dist/db-D1d75IvM-D4mRDC6w.d.mts.map +1 -0
  137. package/dist/{ddl-types-CXx4vPz6-BsgrnSUY.d.mts → ddl-types-By5mT2_S-CdaaFvsX.d.mts} +24 -29
  138. package/dist/ddl-types-By5mT2_S-CdaaFvsX.d.mts.map +1 -0
  139. package/dist/default-mapping-CAOONlKQ-4m07nb-O.d.mts +39 -0
  140. package/dist/default-mapping-CAOONlKQ-4m07nb-O.d.mts.map +1 -0
  141. package/dist/default-table-name-BfFY8qYR-CWZFDX6v.mjs +9 -0
  142. package/dist/default-table-name-BfFY8qYR-CWZFDX6v.mjs.map +1 -0
  143. package/dist/derived-checks-D5HVRvqN-BJx1gwPA.mjs +1508 -0
  144. package/dist/derived-checks-D5HVRvqN-BJx1gwPA.mjs.map +1 -0
  145. package/dist/{derived-checks-DPdD01O0-DGqOFjs6.d.mts → derived-checks-DpPkO6Dt-9U9UJZOo.d.mts} +4 -4
  146. package/dist/derived-checks-DpPkO6Dt-9U9UJZOo.d.mts.map +1 -0
  147. package/dist/diagnostics-RHJxoiIk.mjs +23 -0
  148. package/dist/diagnostics-RHJxoiIk.mjs.map +1 -0
  149. package/dist/{diff-DbTNVm2f.d.mts → diff-1qHOLoUB.d.mts} +23 -10
  150. package/dist/diff-1qHOLoUB.d.mts.map +1 -0
  151. package/dist/diff-C1rFOhek.mjs +21 -0
  152. package/dist/diff-C1rFOhek.mjs.map +1 -0
  153. package/dist/{dist-ZK6oeI5e.mjs → dist-C8Y-PPuE.mjs} +36 -212
  154. package/dist/dist-C8Y-PPuE.mjs.map +1 -0
  155. package/dist/{dist-C_q1_QR9.mjs → dist-CHz1hF8M.mjs} +2 -2
  156. package/dist/dist-CHz1hF8M.mjs.map +1 -0
  157. package/dist/{dist-x6jvtkKM.mjs → dist-CMDXybwm.mjs} +2 -2
  158. package/dist/dist-CMDXybwm.mjs.map +1 -0
  159. package/dist/{driver-types-BQtRkOJ0-Bv2RPSfr.d.mts → driver-types-DRsYeq3j-BimeCnUk.d.mts} +11 -2
  160. package/dist/driver-types-DRsYeq3j-BimeCnUk.d.mts.map +1 -0
  161. package/dist/entity-handle-lowering-hook-BJZSlVVF.mjs +16 -0
  162. package/dist/entity-handle-lowering-hook-BJZSlVVF.mjs.map +1 -0
  163. package/dist/{entity-handle-lowering-hook-CIvRKBfa.d.mts → entity-handle-lowering-hook-BuvLtgFi.d.mts} +8 -11
  164. package/dist/entity-handle-lowering-hook-BuvLtgFi.d.mts.map +1 -0
  165. package/dist/{entity-kinds-B5cUFU22.d.mts → entity-kinds-BPG2xCZV.d.mts} +7 -7
  166. package/dist/entity-kinds-BPG2xCZV.d.mts.map +1 -0
  167. package/dist/{entity-kinds-D7vwoN_T-CCBwFJy0.mjs → entity-kinds-JR5SAm5h-DOH6VUtL.mjs} +31 -28
  168. package/dist/entity-kinds-JR5SAm5h-DOH6VUtL.mjs.map +1 -0
  169. package/dist/{errors-B5g0xWro-mWH2C07F.mjs → errors-B5g0xWro-C8plbqga.mjs} +2 -2
  170. package/dist/errors-B5g0xWro-C8plbqga.mjs.map +1 -0
  171. package/dist/errors.d.mts +1 -1
  172. package/dist/errors.d.mts.map +1 -1
  173. package/dist/errors.mjs +1 -1
  174. package/dist/exports-C3wGYtID-D65DEUTC.mjs +2389 -0
  175. package/dist/exports-C3wGYtID-D65DEUTC.mjs.map +1 -0
  176. package/dist/{expression-FJK6Ar-d.d.mts → expression-6ld_ZQL6-fOuazzzm.d.mts} +37 -16
  177. package/dist/expression-6ld_ZQL6-fOuazzzm.d.mts.map +1 -0
  178. package/dist/expression-CieaNuRM-B1uVqxwd.d.mts +22 -0
  179. package/dist/expression-CieaNuRM-B1uVqxwd.d.mts.map +1 -0
  180. package/dist/expression-D8HstQiB.d.mts +2 -0
  181. package/dist/{expression-CX5mTA-z.mjs → expression-impl-B-XNINxr-BhN2sysZ.mjs} +41 -18
  182. package/dist/expression-impl-B-XNINxr-BhN2sysZ.mjs.map +1 -0
  183. package/dist/{factories-SVor5xIT.mjs → factories-Crobuxwn.mjs} +27 -20
  184. package/dist/factories-Crobuxwn.mjs.map +1 -0
  185. package/dist/{factories-P3qBQhO-.d.mts → factories-DbNP9qfs.d.mts} +16 -10
  186. package/dist/factories-DbNP9qfs.d.mts.map +1 -0
  187. package/dist/family.d.mts +17 -13
  188. package/dist/family.mjs +17 -12
  189. package/dist/family__control-adapter.d.mts +3 -3
  190. package/dist/family__control-adapter.mjs +2 -1
  191. package/dist/family__control.d.mts +5 -4
  192. package/dist/family__control.mjs +4 -4
  193. package/dist/family__diff.d.mts +2 -3
  194. package/dist/family__diff.mjs +2 -2
  195. package/dist/family__ir.d.mts +1 -1
  196. package/dist/family__ir.mjs +2 -2
  197. package/dist/family__migration.d.mts +1 -1
  198. package/dist/family__migration.mjs +1 -1
  199. package/dist/family__pack.d.mts +2 -249
  200. package/dist/family__pack.mjs +3 -18
  201. package/dist/family__psl-build.d.mts +3 -0
  202. package/dist/family__psl-build.mjs +3 -0
  203. package/dist/family__psl-infer.d.mts +2 -2
  204. package/dist/family__psl-infer.mjs +2 -2
  205. package/dist/family__runtime.d.mts +2 -2
  206. package/dist/family__runtime.mjs +2 -2
  207. package/dist/family__verify.d.mts +1 -1
  208. package/dist/family__verify.mjs +1 -1
  209. package/dist/foreign-key-materialization-48P2V8on.d.mts +98 -0
  210. package/dist/foreign-key-materialization-48P2V8on.d.mts.map +1 -0
  211. package/dist/foreign-key-materialization-BM59w_Xg.mjs +287 -0
  212. package/dist/foreign-key-materialization-BM59w_Xg.mjs.map +1 -0
  213. package/dist/{foreign-key-C-iTPuRT-C9ip8zFx.d.mts → foreign-key-qkDFfG8t-TaK_GYWR.d.mts} +21 -5
  214. package/dist/foreign-key-qkDFfG8t-TaK_GYWR.d.mts.map +1 -0
  215. package/dist/functions-CsOoN7I3.mjs +88 -0
  216. package/dist/functions-CsOoN7I3.mjs.map +1 -0
  217. package/dist/functions-EW-RrRn3.d.mts +73 -0
  218. package/dist/functions-EW-RrRn3.d.mts.map +1 -0
  219. package/dist/generator-functions-D_qdqBV--Bq296cED.mjs +544 -0
  220. package/dist/generator-functions-D_qdqBV--Bq296cED.mjs.map +1 -0
  221. package/dist/index-7nHHQsAj.d.mts +606 -0
  222. package/dist/index-7nHHQsAj.d.mts.map +1 -0
  223. package/dist/{index-C5I8D-MB.d.mts → index-Nqc3OHR_.d.mts} +4 -5
  224. package/dist/index-Nqc3OHR_.d.mts.map +1 -0
  225. package/dist/index-equivalence-DswCiq5l-CGsyPP9B.mjs +109 -0
  226. package/dist/index-equivalence-DswCiq5l-CGsyPP9B.mjs.map +1 -0
  227. package/dist/{index-naming-DREt6js7-CRH27yUv.mjs → index-naming-BOcJT1B3-mG8Fd6KN.mjs} +35 -9
  228. package/dist/index-naming-BOcJT1B3-mG8Fd6KN.mjs.map +1 -0
  229. package/dist/{index-naming-Ct65z5Xk.d.mts → index-naming-Cs6wwia3.d.mts} +15 -5
  230. package/dist/index-naming-Cs6wwia3.d.mts.map +1 -0
  231. package/dist/index-reference-4wsdeB7v-DCwswK-q.d.mts +67 -0
  232. package/dist/index-reference-4wsdeB7v-DCwswK-q.d.mts.map +1 -0
  233. package/dist/index-reference-BQSrkRfT.mjs +55 -0
  234. package/dist/index-reference-BQSrkRfT.mjs.map +1 -0
  235. package/dist/index-reference-D8ewQRJr.d.mts +1 -0
  236. package/dist/index-type-validation-DJEMmmw0.mjs +42 -0
  237. package/dist/index-type-validation-DJEMmmw0.mjs.map +1 -0
  238. package/dist/index-type-validation-fGGwAHWc.d.mts +16 -0
  239. package/dist/index-type-validation-fGGwAHWc.d.mts.map +1 -0
  240. package/dist/index-types-H1O43iYT-BD0VwPqV.d.mts +66 -0
  241. package/dist/index-types-H1O43iYT-BD0VwPqV.d.mts.map +1 -0
  242. package/dist/index-types-pC_5vADQ-BOOBi14R.mjs +95 -0
  243. package/dist/index-types-pC_5vADQ-BOOBi14R.mjs.map +1 -0
  244. package/dist/index-types-snhtt_Fo.d.mts +1 -0
  245. package/dist/interpreter-D5qk4B---CG0C7kdx.mjs +2280 -0
  246. package/dist/interpreter-D5qk4B---CG0C7kdx.mjs.map +1 -0
  247. package/dist/{ir-Bghjt-FG.d.mts → ir-BvptQsFW.d.mts} +11 -5
  248. package/dist/ir-BvptQsFW.d.mts.map +1 -0
  249. package/dist/{ir-I-xciGUH.mjs → ir-DzsUDO8e.mjs} +2 -2
  250. package/dist/ir-DzsUDO8e.mjs.map +1 -0
  251. package/dist/{middleware-AhTz1BOW-th-Suxuf.d.mts → middleware-DHkW6pRr-DM6hd9iZ.d.mts} +5 -5
  252. package/dist/middleware-DHkW6pRr-DM6hd9iZ.d.mts.map +1 -0
  253. package/dist/middleware-gqy3l13N.d.mts +1 -0
  254. package/dist/{middleware-CMr4CHNz-DHIUdxlm.mjs → middleware-yBAfiVWn-DZO0vCRQ.mjs} +3 -3
  255. package/dist/middleware-yBAfiVWn-DZO0vCRQ.mjs.map +1 -0
  256. package/dist/{migration-CK4oePIo.mjs → migration-BJQjkqFz.mjs} +4 -4
  257. package/dist/migration-BJQjkqFz.mjs.map +1 -0
  258. package/dist/{migration-CjDRZNep.d.mts → migration-Cxmpzaz0.d.mts} +6 -6
  259. package/dist/migration-Cxmpzaz0.d.mts.map +1 -0
  260. package/dist/{naming-CV9j2pXl-KARaDReS.d.mts → naming-BcD36g9T-Mfe_xGGL.d.mts} +9 -14
  261. package/dist/naming-BcD36g9T-Mfe_xGGL.d.mts.map +1 -0
  262. package/dist/{naming-DKr4TJd7-Cszhq9RV.mjs → naming-bM5qm5PY-jOg3JFMb.mjs} +20 -31
  263. package/dist/naming-bM5qm5PY-jOg3JFMb.mjs.map +1 -0
  264. package/dist/{ddl-types-BGdnAbXo-DKPHPUGx.mjs → opaque-sql-Dset3kln-CtsPDTXn.mjs} +24 -11
  265. package/dist/opaque-sql-Dset3kln-CtsPDTXn.mjs.map +1 -0
  266. package/dist/operations.d.mts +1 -1
  267. package/dist/operations.mjs +1 -1
  268. package/dist/orm-client.d.mts +817 -267
  269. package/dist/orm-client.d.mts.map +1 -1
  270. package/dist/orm-client.mjs +4719 -2942
  271. package/dist/orm-client.mjs.map +1 -1
  272. package/dist/pack-DA8HZ2mo.d.mts +535 -0
  273. package/dist/pack-DA8HZ2mo.d.mts.map +1 -0
  274. package/dist/pack-gSvGQWqs.mjs +80 -0
  275. package/dist/pack-gSvGQWqs.mjs.map +1 -0
  276. package/dist/{plan-CDxduYaN-pLIyyJaB.d.mts → plan-Cr4azjnG-CuL8FqXC.d.mts} +12 -8
  277. package/dist/plan-Cr4azjnG-CuL8FqXC.d.mts.map +1 -0
  278. package/dist/{plan-Dh0LbYIv-Crx5-ThG.mjs → plan-Dh0LbYIv-ubBSdUgl.mjs} +2 -2
  279. package/dist/plan-Dh0LbYIv-ubBSdUgl.mjs.map +1 -0
  280. package/dist/plan-Di6Gs2JD.d.mts +2 -0
  281. package/dist/psl-attribute-parsing-BCsFWsSp-BJ-wGlY6.mjs +42 -0
  282. package/dist/psl-attribute-parsing-BCsFWsSp-BJ-wGlY6.mjs.map +1 -0
  283. package/dist/psl-build-DFBG6vhz.mjs +426 -0
  284. package/dist/psl-build-DFBG6vhz.mjs.map +1 -0
  285. package/dist/psl-build-RelubU2E.d.mts +112 -0
  286. package/dist/psl-build-RelubU2E.d.mts.map +1 -0
  287. package/dist/psl-column-resolution-ChZqioOc-BREg4J7d.d.mts +24 -0
  288. package/dist/psl-column-resolution-ChZqioOc-BREg4J7d.d.mts.map +1 -0
  289. package/dist/psl-field-resolution-C5KQ7kzP-B0NwuRWV.mjs +1960 -0
  290. package/dist/psl-field-resolution-C5KQ7kzP-B0NwuRWV.mjs.map +1 -0
  291. package/dist/psl-infer--g4i84Go.mjs +201 -0
  292. package/dist/psl-infer--g4i84Go.mjs.map +1 -0
  293. package/dist/psl-infer-DzoxPZGd.d.mts +80 -0
  294. package/dist/psl-infer-DzoxPZGd.d.mts.map +1 -0
  295. package/dist/psl-names-C3cwe0rg-D1CTmC3a.mjs +66 -0
  296. package/dist/psl-names-C3cwe0rg-D1CTmC3a.mjs.map +1 -0
  297. package/dist/{query-lane-context-Qa-eddrE-kuZ8Z86-.d.mts → query-lane-context-BCEoKy0_-CzmyavC9.d.mts} +20 -49
  298. package/dist/query-lane-context-BCEoKy0_-CzmyavC9.d.mts.map +1 -0
  299. package/dist/query-lane-context-VqH0mS9B.d.mts +1 -0
  300. package/dist/{referential-action-sql-DJ9ps6-S.d.mts → referential-action-sql-B2vKoUK6.d.mts} +3 -3
  301. package/dist/referential-action-sql-B2vKoUK6.d.mts.map +1 -0
  302. package/dist/{referential-action-sql-DSqkrySN.mjs → referential-action-sql-BLzCtTi8.mjs} +2 -2
  303. package/dist/referential-action-sql-BLzCtTi8.mjs.map +1 -0
  304. package/dist/relational-core.d.mts +14 -13
  305. package/dist/relational-core.mjs +8 -8
  306. package/dist/relational-core__aggregate-descriptor-registry.d.mts +2 -2
  307. package/dist/relational-core__aggregate-descriptor-registry.d.mts.map +1 -1
  308. package/dist/relational-core__aggregate-descriptor-registry.mjs +1 -1
  309. package/dist/relational-core__ast.d.mts +5 -5
  310. package/dist/relational-core__ast.mjs +5 -5
  311. package/dist/relational-core__codec-descriptor-registry.d.mts +7 -8
  312. package/dist/relational-core__codec-descriptor-registry.d.mts.map +1 -1
  313. package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
  314. package/dist/relational-core__collection-methods.d.mts +3 -0
  315. package/dist/relational-core__contract-free.d.mts +18 -8
  316. package/dist/relational-core__contract-free.d.mts.map +1 -1
  317. package/dist/relational-core__contract-free.mjs +26 -10
  318. package/dist/relational-core__contract-free.mjs.map +1 -1
  319. package/dist/relational-core__expression.d.mts +4 -2
  320. package/dist/relational-core__expression.mjs +2 -2
  321. package/dist/relational-core__functions.d.mts +2 -0
  322. package/dist/relational-core__functions.mjs +2 -0
  323. package/dist/relational-core__index-reference.d.mts +3 -0
  324. package/dist/relational-core__index-reference.mjs +2 -0
  325. package/dist/relational-core__middleware.d.mts +2 -2
  326. package/dist/relational-core__middleware.mjs +1 -1
  327. package/dist/relational-core__plan.d.mts +4 -4
  328. package/dist/relational-core__plan.mjs +1 -1
  329. package/dist/relational-core__query-lane-context.d.mts +3 -3
  330. package/dist/relational-core__types.d.mts +2 -2
  331. package/dist/{resolve-storage-table-DZsfnzeW.mjs → resolve-storage-table-BHLQsOza.mjs} +3 -3
  332. package/dist/resolve-storage-table-BHLQsOza.mjs.map +1 -0
  333. package/dist/{resolve-storage-table-Nyrgk4h8.d.mts → resolve-storage-table-DCqtmnSU.d.mts} +4 -4
  334. package/dist/resolve-storage-table-DCqtmnSU.d.mts.map +1 -0
  335. package/dist/{runtime-tIHpGCcG.mjs → runtime-6tH1yOxK.mjs} +6 -6
  336. package/dist/runtime-6tH1yOxK.mjs.map +1 -0
  337. package/dist/{runtime-DpKF2Yu2.d.mts → runtime-CF6rAlE5.d.mts} +7 -8
  338. package/dist/runtime-CF6rAlE5.d.mts.map +1 -0
  339. package/dist/runtime.d.mts +5 -5
  340. package/dist/runtime.mjs +2 -1799
  341. package/dist/runtime__internal__prepared-query.d.mts +2 -2
  342. package/dist/runtime__internal__prepared-query.mjs +2 -2
  343. package/dist/{schema-differ-DpG_gnur-DFAtGezx.d.mts → schema-differ-DmP74bB8-tqHKiJ88.d.mts} +6 -6
  344. package/dist/schema-differ-DmP74bB8-tqHKiJ88.d.mts.map +1 -0
  345. package/dist/schema-ir.d.mts +2 -2
  346. package/dist/schema-ir.mjs +2 -2
  347. package/dist/schema-ir__naming.d.mts +1 -1
  348. package/dist/schema-ir__naming.mjs +1 -1
  349. package/dist/schema-ir__types.d.mts +3 -3
  350. package/dist/schema-ir__types.mjs +2 -2
  351. package/dist/{schema-verify-C_PEdlAr-Dxxjm6EM.mjs → schema-verify-C3wbdviw-DMjIubOr.mjs} +50 -8
  352. package/dist/schema-verify-C3wbdviw-DMjIubOr.mjs.map +1 -0
  353. package/dist/{serialized-index-CrgG8ct1-DG3JpHc7.d.mts → serialized-index-CrgG8ct1-DKVJ7TDX.d.mts} +4 -4
  354. package/dist/serialized-index-CrgG8ct1-DKVJ7TDX.d.mts.map +1 -0
  355. package/dist/{serialized-index-nBTwanKy-_ddEK4tk.mjs → serialized-index-DjCCnXB1-DMA7BtO2.mjs} +4 -4
  356. package/dist/serialized-index-DjCCnXB1-DMA7BtO2.mjs.map +1 -0
  357. package/dist/{sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs → sql-contract-serializer-sMY3prTx-D2BfrNxs.mjs} +41 -16
  358. package/dist/sql-contract-serializer-sMY3prTx-D2BfrNxs.mjs.map +1 -0
  359. package/dist/sql-data-type-D7M-YTTY-D2vRqDxn.mjs +400 -0
  360. package/dist/sql-data-type-D7M-YTTY-D2vRqDxn.mjs.map +1 -0
  361. package/dist/{sql-execution-plan--jKyLpe5-CMGhgO0M.d.mts → sql-execution-plan-3uxYjHyu-DLknM-Pj.d.mts} +3 -3
  362. package/dist/sql-execution-plan-3uxYjHyu-DLknM-Pj.d.mts.map +1 -0
  363. package/dist/sql-expression-B4BrhGPi.d.mts +62 -0
  364. package/dist/sql-expression-B4BrhGPi.d.mts.map +1 -0
  365. package/dist/sql-expression-CKgKznXS.mjs +137 -0
  366. package/dist/sql-expression-CKgKznXS.mjs.map +1 -0
  367. package/dist/{sql-index-ByAAE7K8-DKj2V86p.d.mts → sql-index-ByAAE7K8-Dqtn_vUL.d.mts} +4 -4
  368. package/dist/sql-index-ByAAE7K8-Dqtn_vUL.d.mts.map +1 -0
  369. package/dist/{sql-node-kEz6YFZo-v2F7delx.d.mts → sql-node-kEz6YFZo-1ogT6Cxt.d.mts} +2 -2
  370. package/dist/sql-node-kEz6YFZo-1ogT6Cxt.d.mts.map +1 -0
  371. package/dist/{sql-storage-8LqxeLAY-DH4DdUXx.d.mts → sql-storage-DeCAh5Hi-CEM-m8cs.d.mts} +19 -22
  372. package/dist/sql-storage-DeCAh5Hi-CEM-m8cs.d.mts.map +1 -0
  373. package/dist/{storage-table-DSeWszOL-CI-cItEK.d.mts → storage-table-Bf1ZjnxO-pUj6pyP0.d.mts} +17 -24
  374. package/dist/storage-table-Bf1ZjnxO-pUj6pyP0.d.mts.map +1 -0
  375. package/dist/{storage-table-ZzbR-xzQ-BRoTQE_2.mjs → storage-table-DDvN83mw-DkbBFmK9.mjs} +12 -9
  376. package/dist/storage-table-DDvN83mw-DkbBFmK9.mjs.map +1 -0
  377. package/dist/{storage-value-set-BGlj5Uus-CvZD--GG.d.mts → storage-value-set-BGlj5Uus-ny2k-0PA.d.mts} +3 -3
  378. package/dist/storage-value-set-BGlj5Uus-ny2k-0PA.d.mts.map +1 -0
  379. package/dist/transaction-state-BfXhs7D7-DhmbySW9.mjs +45 -0
  380. package/dist/transaction-state-BfXhs7D7-DhmbySW9.mjs.map +1 -0
  381. package/dist/transaction-state-DR3nKTmH-D29jmVE-.d.mts +115 -0
  382. package/dist/transaction-state-DR3nKTmH-D29jmVE-.d.mts.map +1 -0
  383. package/dist/types-B9wSEUsV.d.mts +1 -0
  384. package/dist/{types-CUsJrvEl.mjs → types-CTdSkl0s.mjs} +13 -6
  385. package/dist/types-CTdSkl0s.mjs.map +1 -0
  386. package/dist/types-CkAd8SWm.d.mts +57 -0
  387. package/dist/types-CkAd8SWm.d.mts.map +1 -0
  388. package/dist/{types-IqZMLrFC-DcH8v_u3.d.mts → types-Cq6ImLAB-RlU4jJAX.d.mts} +27 -41
  389. package/dist/types-Cq6ImLAB-RlU4jJAX.d.mts.map +1 -0
  390. package/dist/{types-YStFFkKs-D9UAmnON.d.mts → types-CuCxAQat-Dz8P4xyt.d.mts} +141 -86
  391. package/dist/types-CuCxAQat-Dz8P4xyt.d.mts.map +1 -0
  392. package/dist/types-DfKvtJwS-CrpWTGBJ.d.mts +273 -0
  393. package/dist/types-DfKvtJwS-CrpWTGBJ.d.mts.map +1 -0
  394. package/dist/{types-4YenawkP-CwaaZSid.mjs → types-DoyiTsjg-2YMhMJDA.mjs} +181 -80
  395. package/dist/types-DoyiTsjg-2YMhMJDA.mjs.map +1 -0
  396. package/dist/{types-v3qxLLxo-DCeKv7yY.d.mts → types-DriMIMNQ-BkbsW7w3.d.mts} +68 -34
  397. package/dist/types-DriMIMNQ-BkbsW7w3.d.mts.map +1 -0
  398. package/dist/{types-Dt4e_jC--COeP8xzN.mjs → types-NTQsD2MS-xcLtvKO9.mjs} +83 -17
  399. package/dist/types-NTQsD2MS-xcLtvKO9.mjs.map +1 -0
  400. package/dist/{types-CyxGtOOh-BggSa6Fe.d.mts → types-TXO7x1BA-CYYIY8NI.d.mts} +14 -14
  401. package/dist/types-TXO7x1BA-CYYIY8NI.d.mts.map +1 -0
  402. package/dist/types-ljUNyiWe.d.mts +1 -0
  403. package/dist/{unique-constraint-M5TlQnJQ-BiIHJ85k.d.mts → unique-constraint-M5TlQnJQ-qX-maNUV.d.mts} +3 -3
  404. package/dist/unique-constraint-M5TlQnJQ-qX-maNUV.d.mts.map +1 -0
  405. package/dist/{util-DQQgv2j1-D6INZaRG.mjs → util-BBgcP3gI-CpL-0VuC.mjs} +12 -3
  406. package/dist/util-BBgcP3gI-CpL-0VuC.mjs.map +1 -0
  407. package/dist/{validators-CrWD6bSP.mjs → validators-BwA7ttZM.mjs} +0 -0
  408. package/dist/validators-BwA7ttZM.mjs.map +1 -0
  409. package/dist/{validators-Belo8QqM.d.mts → validators-FJs8HvFr.d.mts} +54 -16
  410. package/dist/validators-FJs8HvFr.d.mts.map +1 -0
  411. package/dist/{value-set-derivation-hook-BhgGVtw0.d.mts → value-set-derivation-hook-3E437jPU.d.mts} +3 -3
  412. package/dist/value-set-derivation-hook-3E437jPU.d.mts.map +1 -0
  413. package/dist/{value-set-derivation-hook-Di9JZ0X7.mjs → value-set-derivation-hook-HVaxhALD.mjs} +2 -2
  414. package/dist/value-set-derivation-hook-HVaxhALD.mjs.map +1 -0
  415. package/dist/{verify-u0UTdZgD-DSAaz9rW.mjs → verify-BVk5bjdH-DhKm6hB3.mjs} +8 -7
  416. package/dist/verify-BVk5bjdH-DhKm6hB3.mjs.map +1 -0
  417. package/dist/{verify-zDRnw0Rn.d.mts → verify-DHXbuZPB.d.mts} +2 -2
  418. package/dist/verify-DHXbuZPB.d.mts.map +1 -0
  419. package/package.json +33 -22
  420. package/dist/aggregate-descriptor-registry-C7hel5O7.mjs.map +0 -1
  421. package/dist/ast-HFcfQZr-.d.mts +0 -206
  422. package/dist/ast-HFcfQZr-.d.mts.map +0 -1
  423. package/dist/ast-Lbl4VwqP.mjs +0 -325
  424. package/dist/ast-Lbl4VwqP.mjs.map +0 -1
  425. package/dist/authored-check-naming-BWBe-PVE.d.mts.map +0 -1
  426. package/dist/authored-check-naming-Hf9990DV.mjs.map +0 -1
  427. package/dist/authoring-type-constructors-Blqoa2Ua-DqvNCOb2.mjs +0 -316
  428. package/dist/authoring-type-constructors-Blqoa2Ua-DqvNCOb2.mjs.map +0 -1
  429. package/dist/canonicalization-hooks-CYnW_sGn.d.mts.map +0 -1
  430. package/dist/canonicalization-hooks-dmXkOR4a.mjs.map +0 -1
  431. package/dist/check-constraint-B7qGu6rc-HvQjjX82.d.mts.map +0 -1
  432. package/dist/codec-descriptor-registry-N0dhtKaH.mjs.map +0 -1
  433. package/dist/config-types-D9fdKG3g.d.mts.map +0 -1
  434. package/dist/config-types-gAm54C_v.mjs.map +0 -1
  435. package/dist/contract-builder-CG_tGDbB.d.mts +0 -1360
  436. package/dist/contract-builder-CG_tGDbB.d.mts.map +0 -1
  437. package/dist/contract-builder-D4a5dT7j.mjs.map +0 -1
  438. package/dist/contract-errors-BCN6RVI5-5IHBF_lg.mjs.map +0 -1
  439. package/dist/contract-view-BMR5IWk4.mjs.map +0 -1
  440. package/dist/contract-view-CPHxoAEX.d.mts.map +0 -1
  441. package/dist/contract__pack-types.d.mts +0 -2
  442. package/dist/control-D3cB5YQp.mjs +0 -1267
  443. package/dist/control-D3cB5YQp.mjs.map +0 -1
  444. package/dist/control-DTLJ1WtZ.d.mts +0 -945
  445. package/dist/control-DTLJ1WtZ.d.mts.map +0 -1
  446. package/dist/control-adapter-C99J7aEF-B7eQd7vD.d.mts.map +0 -1
  447. package/dist/control-adapter-MZJQiwcE.d.mts +0 -1
  448. package/dist/db-D18PrXKW-DvTv4JFn.d.mts.map +0 -1
  449. package/dist/ddl-types-BGdnAbXo-DKPHPUGx.mjs.map +0 -1
  450. package/dist/ddl-types-CXx4vPz6-BsgrnSUY.d.mts.map +0 -1
  451. package/dist/derived-checks-DFMRmiAu-DGfB8aS4.mjs +0 -1057
  452. package/dist/derived-checks-DFMRmiAu-DGfB8aS4.mjs.map +0 -1
  453. package/dist/derived-checks-DPdD01O0-DGqOFjs6.d.mts.map +0 -1
  454. package/dist/diff-B16bL_IR.mjs +0 -13
  455. package/dist/diff-B16bL_IR.mjs.map +0 -1
  456. package/dist/diff-DbTNVm2f.d.mts.map +0 -1
  457. package/dist/dist-C_q1_QR9.mjs.map +0 -1
  458. package/dist/dist-ZK6oeI5e.mjs.map +0 -1
  459. package/dist/dist-x6jvtkKM.mjs.map +0 -1
  460. package/dist/driver-types-BQtRkOJ0-Bv2RPSfr.d.mts.map +0 -1
  461. package/dist/entity-handle-lowering-hook-CIvRKBfa.d.mts.map +0 -1
  462. package/dist/entity-handle-lowering-hook-DwLIKNiS.mjs +0 -11
  463. package/dist/entity-handle-lowering-hook-DwLIKNiS.mjs.map +0 -1
  464. package/dist/entity-kinds-B5cUFU22.d.mts.map +0 -1
  465. package/dist/entity-kinds-D7vwoN_T-CCBwFJy0.mjs.map +0 -1
  466. package/dist/errors-B5g0xWro-mWH2C07F.mjs.map +0 -1
  467. package/dist/expression-CX5mTA-z.mjs.map +0 -1
  468. package/dist/expression-FJK6Ar-d.d.mts.map +0 -1
  469. package/dist/factories-P3qBQhO-.d.mts.map +0 -1
  470. package/dist/factories-SVor5xIT.mjs.map +0 -1
  471. package/dist/family__pack.d.mts.map +0 -1
  472. package/dist/family__pack.mjs.map +0 -1
  473. package/dist/foreign-key-C-iTPuRT-C9ip8zFx.d.mts.map +0 -1
  474. package/dist/foreign-key-materialization-CkvOzJWy.d.mts +0 -65
  475. package/dist/foreign-key-materialization-CkvOzJWy.d.mts.map +0 -1
  476. package/dist/foreign-key-materialization-Cu7-7LHl.mjs +0 -73
  477. package/dist/foreign-key-materialization-Cu7-7LHl.mjs.map +0 -1
  478. package/dist/index-C-vQOMY_.d.mts +0 -84
  479. package/dist/index-C-vQOMY_.d.mts.map +0 -1
  480. package/dist/index-C5I8D-MB.d.mts.map +0 -1
  481. package/dist/index-naming-Ct65z5Xk.d.mts.map +0 -1
  482. package/dist/index-naming-DREt6js7-CRH27yUv.mjs.map +0 -1
  483. package/dist/index-type-validation-COH4d78M.mjs +0 -17
  484. package/dist/index-type-validation-COH4d78M.mjs.map +0 -1
  485. package/dist/index-type-validation-CZ5L2lli.d.mts +0 -10
  486. package/dist/index-type-validation-CZ5L2lli.d.mts.map +0 -1
  487. package/dist/index-types-CNhHgKHi.d.mts +0 -1
  488. package/dist/index-types-DJQ_xwaE.mjs +0 -40
  489. package/dist/index-types-DJQ_xwaE.mjs.map +0 -1
  490. package/dist/index-types-DPVhsW0v-D-BikM4h.d.mts +0 -31
  491. package/dist/index-types-DPVhsW0v-D-BikM4h.d.mts.map +0 -1
  492. package/dist/interpreter-DyiUUAWh-DYdjIpiE.mjs +0 -3680
  493. package/dist/interpreter-DyiUUAWh-DYdjIpiE.mjs.map +0 -1
  494. package/dist/ir-Bghjt-FG.d.mts.map +0 -1
  495. package/dist/ir-I-xciGUH.mjs.map +0 -1
  496. package/dist/lane-query-builder.d.mts +0 -236
  497. package/dist/lane-query-builder.d.mts.map +0 -1
  498. package/dist/lane-query-builder.mjs +0 -67
  499. package/dist/lane-query-builder.mjs.map +0 -1
  500. package/dist/middleware--TtoxUiW.d.mts +0 -1
  501. package/dist/middleware-AhTz1BOW-th-Suxuf.d.mts.map +0 -1
  502. package/dist/middleware-CMr4CHNz-DHIUdxlm.mjs.map +0 -1
  503. package/dist/migration-CK4oePIo.mjs.map +0 -1
  504. package/dist/migration-CjDRZNep.d.mts.map +0 -1
  505. package/dist/naming-CV9j2pXl-KARaDReS.d.mts.map +0 -1
  506. package/dist/naming-DKr4TJd7-Cszhq9RV.mjs.map +0 -1
  507. package/dist/pack-types-BcLTpwbv.d.mts +0 -14
  508. package/dist/pack-types-BcLTpwbv.d.mts.map +0 -1
  509. package/dist/plan-BHLdb0Z7.d.mts +0 -2
  510. package/dist/plan-CDxduYaN-pLIyyJaB.d.mts.map +0 -1
  511. package/dist/plan-Dh0LbYIv-Crx5-ThG.mjs.map +0 -1
  512. package/dist/prepared-query-BJr50wPm-ChoqfJbX.mjs +0 -22
  513. package/dist/prepared-query-BJr50wPm-ChoqfJbX.mjs.map +0 -1
  514. package/dist/prepared-statement-9QpkE6JG-C430V3MO.d.mts +0 -529
  515. package/dist/prepared-statement-9QpkE6JG-C430V3MO.d.mts.map +0 -1
  516. package/dist/psl-infer-CCAD6FWA.d.mts +0 -119
  517. package/dist/psl-infer-CCAD6FWA.d.mts.map +0 -1
  518. package/dist/psl-infer-Dk5kgKre.mjs +0 -362
  519. package/dist/psl-infer-Dk5kgKre.mjs.map +0 -1
  520. package/dist/query-lane-context-Qa-eddrE-kuZ8Z86-.d.mts.map +0 -1
  521. package/dist/query-lane-context-XMvk7fmY.d.mts +0 -1
  522. package/dist/referential-action-sql-DJ9ps6-S.d.mts.map +0 -1
  523. package/dist/referential-action-sql-DSqkrySN.mjs.map +0 -1
  524. package/dist/resolve-storage-table-DZsfnzeW.mjs.map +0 -1
  525. package/dist/resolve-storage-table-Nyrgk4h8.d.mts.map +0 -1
  526. package/dist/runtime-DpKF2Yu2.d.mts.map +0 -1
  527. package/dist/runtime-tIHpGCcG.mjs.map +0 -1
  528. package/dist/runtime.mjs.map +0 -1
  529. package/dist/schema-differ-DpG_gnur-DFAtGezx.d.mts.map +0 -1
  530. package/dist/schema-verify-C_PEdlAr-Dxxjm6EM.mjs.map +0 -1
  531. package/dist/serialized-index-CrgG8ct1-DG3JpHc7.d.mts.map +0 -1
  532. package/dist/serialized-index-nBTwanKy-_ddEK4tk.mjs.map +0 -1
  533. package/dist/sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs.map +0 -1
  534. package/dist/sql-execution-plan--jKyLpe5-CMGhgO0M.d.mts.map +0 -1
  535. package/dist/sql-index-ByAAE7K8-DKj2V86p.d.mts.map +0 -1
  536. package/dist/sql-node-kEz6YFZo-v2F7delx.d.mts.map +0 -1
  537. package/dist/sql-storage-8LqxeLAY-DH4DdUXx.d.mts.map +0 -1
  538. package/dist/storage-table-DSeWszOL-CI-cItEK.d.mts.map +0 -1
  539. package/dist/storage-table-ZzbR-xzQ-BRoTQE_2.mjs.map +0 -1
  540. package/dist/storage-value-set-BGlj5Uus-CvZD--GG.d.mts.map +0 -1
  541. package/dist/timestamp-now-generator-DRXygu32-DN9Qb1uI.mjs +0 -173
  542. package/dist/timestamp-now-generator-DRXygu32-DN9Qb1uI.mjs.map +0 -1
  543. package/dist/types-4YenawkP-CwaaZSid.mjs.map +0 -1
  544. package/dist/types-B0msOnBM.d.mts +0 -1
  545. package/dist/types-BDUG29Df-LE85dIXP.d.mts +0 -161
  546. package/dist/types-BDUG29Df-LE85dIXP.d.mts.map +0 -1
  547. package/dist/types-CUsJrvEl.mjs.map +0 -1
  548. package/dist/types-CyxGtOOh-BggSa6Fe.d.mts.map +0 -1
  549. package/dist/types-Dt4e_jC--COeP8xzN.mjs.map +0 -1
  550. package/dist/types-Dwcw0F8X.d.mts +0 -1
  551. package/dist/types-IqZMLrFC-DcH8v_u3.d.mts.map +0 -1
  552. package/dist/types-UcHa2cTe.d.mts +0 -17
  553. package/dist/types-UcHa2cTe.d.mts.map +0 -1
  554. package/dist/types-YStFFkKs-D9UAmnON.d.mts.map +0 -1
  555. package/dist/types-v3qxLLxo-DCeKv7yY.d.mts.map +0 -1
  556. package/dist/unique-constraint-M5TlQnJQ-BiIHJ85k.d.mts.map +0 -1
  557. package/dist/util-DQQgv2j1-D6INZaRG.mjs.map +0 -1
  558. package/dist/validators-Belo8QqM.d.mts.map +0 -1
  559. package/dist/validators-CrWD6bSP.mjs.map +0 -1
  560. package/dist/value-set-derivation-hook-BhgGVtw0.d.mts.map +0 -1
  561. package/dist/value-set-derivation-hook-Di9JZ0X7.mjs.map +0 -1
  562. package/dist/verify-u0UTdZgD-DSAaz9rW.mjs.map +0 -1
  563. package/dist/verify-zDRnw0Rn.d.mts.map +0 -1
  564. /package/dist/{contract__pack-types.mjs → relational-core__collection-methods.mjs} +0 -0
@@ -1,9 +1,12 @@
1
- import { C as LiteralExpr, D as OrExpr, F as SubqueryExpr, I as TableSource, L as UpdateAst, O as OrderByItem, P as SelectAst, S as ListExpression, T as NullCheckExpr, V as isAggregateFn, _ as InsertAst, c as DeleteAst, g as IdentifierRef, j as ProjectionItem, k as ParamRef, l as DerivedTableSource, n as AndExpr, o as ColumnRef, p as ExistsExpr, r as BinaryExpr, t as AggregateExpr, y as JoinAst } from "./types-Dt4e_jC--COeP8xzN.mjs";
2
- import { t as collectOrderedParamRefs } from "./util-DQQgv2j1-D6INZaRG.mjs";
3
- import { a as toExpr, n as codecOf, r as createRawSql } from "./expression-CX5mTA-z.mjs";
4
- import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-N0dhtKaH.mjs";
1
+ import { A as ParamRef, F as SelectAst, G as isOrderByNulls, L as TableSource, M as ProjectionItem, R as UpdateAst, U as isAggregateFn, W as isOrderByDirection, _ as InsertAst, c as DeleteAst, g as IdentifierRef, k as OrderByItem, l as DerivedTableSource, n as AndExpr, o as ColumnRef, t as AggregateExpr, w as LockingClause, y as JoinAst } from "./types-NTQsD2MS-xcLtvKO9.mjs";
2
+ import { r as isAggregateProjection, t as collectOrderedParamRefs } from "./util-BBgcP3gI-CpL-0VuC.mjs";
3
+ import { D as lockWaitPolicyOf, E as lockStrengthCapabilities, T as lockOptionCapabilities, w as lockIncompatible } from "./ast-D0miQ1B6.mjs";
4
+ import { i as createRawSql, s as toExpr, t as ExpressionImpl } from "./expression-impl-B-XNINxr-BhN2sysZ.mjs";
5
+ import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-CiiFzMtb.mjs";
6
+ import { t as createFunctions } from "./functions-CsOoN7I3.mjs";
7
+ import { t as createIndexReferences } from "./index-reference-BQSrkRfT.mjs";
5
8
  import { assertAnnotationsApplicable } from "@prisma/orm-framework/components/runtime";
6
- //#region ../../../2-sql/4-lanes/sql-builder/dist/runtime/index.mjs
9
+ //#region ../../../2-sql-family/4-lanes/sql-builder/dist/runtime/index.mjs
7
10
  /**
8
11
  * **Last-resort escape hatch for unsafe type assertions. Not a sanctioned tool to reach for.**
9
12
  *
@@ -42,6 +45,55 @@ import { assertAnnotationsApplicable } from "@prisma/orm-framework/components/ru
42
45
  function blindCast(input) {
43
46
  return input;
44
47
  }
48
+ function createFieldProxy(scope) {
49
+ return new Proxy(blindCast({}), { get(_target, prop) {
50
+ if (Object.hasOwn(scope.topLevel, prop)) {
51
+ const topField = scope.topLevel[prop];
52
+ if (topField) return new ExpressionImpl(IdentifierRef.of(prop), topField);
53
+ }
54
+ if (Object.hasOwn(scope.namespaces, prop)) {
55
+ const nsFields = scope.namespaces[prop];
56
+ if (nsFields) return createNamespaceProxy(prop, nsFields);
57
+ }
58
+ } });
59
+ }
60
+ function createNamespaceProxy(namespaceName, fields) {
61
+ return new Proxy({}, { get(_target, prop) {
62
+ if (Object.hasOwn(fields, prop)) {
63
+ const field = fields[prop];
64
+ if (field) return new ExpressionImpl(ColumnRef.of(namespaceName, prop), field);
65
+ }
66
+ } });
67
+ }
68
+ /**
69
+ * A bug in Prisma 8, not a user error. Never catch this except at the
70
+ * outermost boundary for crash reporting — an InternalError means an invariant
71
+ * broke and the process cannot reliably continue. User-facing failures use
72
+ * `structuredError` with a dotted code instead.
73
+ */
74
+ var InternalError = class extends Error {
75
+ isPrismaInternalError = true;
76
+ constructor(message, options) {
77
+ super(message, options?.cause !== void 0 ? { cause: options.cause } : void 0);
78
+ this.name = "InternalError";
79
+ }
80
+ };
81
+ /**
82
+ * Asserts that a value is defined (not null or undefined).
83
+ * Use for invariants where the value should always exist at runtime.
84
+ *
85
+ * @throws Error if value is null or undefined
86
+ *
87
+ * @example
88
+ * ```typescript
89
+ * const table = storage.namespaces[namespaceId].entries.table[tableName];
90
+ * assertDefined(table, `Table "${tableName}" not found`);
91
+ * // table is now narrowed to non-nullable
92
+ * ```
93
+ */
94
+ function assertDefined(value, message) {
95
+ if (value === null || value === void 0) throw new InternalError(message);
96
+ }
45
97
  /**
46
98
  * Returns an object with the key/value if value is defined, otherwise an empty object.
47
99
  *
@@ -85,31 +137,6 @@ function structuredError(code, message, options) {
85
137
  });
86
138
  }
87
139
  /**
88
- * Runtime wrapper around a relational-core AST expression node. Carries ScopeField metadata (codecId, nullable) so aggregate-like combinators can propagate the input codec onto their result.
89
- *
90
- * `codec` records the column-bound {@link CodecRef} when the field-proxy knows the binding — both the namespaced form (`f.user.email` → `ColumnRef`) and the top-level shortcut (`f.email` → `IdentifierRef`) stamp the ref derived from contract storage. `codecOf(expression)` exposes it for operation implementations forwarding the ref to `toExpr`.
91
- *
92
- * `projectionAst` carries the descriptor-lowered rendering of the expression, where a target declares one (e.g. SQLite's `CAST(count(*) AS TEXT)`). Lowering exists to carry the value across the driver boundary, so only the projection site consumes it — predicate and ordering positions (`buildAst()`) keep the plain form, where the rendering would change SQL semantics.
93
- */
94
- var ExpressionImpl = class {
95
- ast;
96
- projectionAst;
97
- returnType;
98
- codec;
99
- constructor(ast, returnType, codec, projectionAst) {
100
- this.ast = ast;
101
- this.returnType = returnType;
102
- this.codec = codec;
103
- this.projectionAst = projectionAst;
104
- }
105
- buildAst() {
106
- return this.ast;
107
- }
108
- buildProjectionAst() {
109
- return this.projectionAst ?? this.ast;
110
- }
111
- };
112
- /**
113
140
  * An aggregate whose operation lies outside the SQL aggregate alphabet: the expression exists only in its descriptor-lowered form, so only the projection may consume it.
114
141
  *
115
142
  * Predicate and ordering positions build the plain form through `buildAst()` and are refused at authoring time — the lowered rendering exists to carry the value across the driver boundary, and comparing or sorting by it inside the database would change SQL semantics (a textual rendering compares lexicographically).
@@ -117,7 +144,7 @@ var ExpressionImpl = class {
117
144
  var ProjectionOnlyExpressionImpl = class extends ExpressionImpl {
118
145
  operation;
119
146
  constructor(operation, lowered, returnType) {
120
- super(lowered, returnType, void 0, lowered);
147
+ super(lowered, returnType, lowered);
121
148
  this.operation = operation;
122
149
  }
123
150
  buildAst() {
@@ -134,111 +161,6 @@ var ProjectionOnlyExpressionImpl = class extends ExpressionImpl {
134
161
  function projectionAstOf(expr) {
135
162
  return expr instanceof ExpressionImpl ? expr.buildProjectionAst() : expr.buildAst();
136
163
  }
137
- function createFieldProxy(scope) {
138
- return new Proxy({}, { get(_target, prop) {
139
- if (Object.hasOwn(scope.topLevel, prop)) {
140
- const topField = scope.topLevel[prop];
141
- if (topField) return new ExpressionImpl(IdentifierRef.of(prop), topField, topField.codec);
142
- }
143
- if (Object.hasOwn(scope.namespaces, prop)) {
144
- const nsFields = scope.namespaces[prop];
145
- if (nsFields) return createNamespaceProxy(prop, nsFields);
146
- }
147
- } });
148
- }
149
- function createNamespaceProxy(namespaceName, fields) {
150
- return new Proxy({}, { get(_target, prop) {
151
- if (Object.hasOwn(fields, prop)) {
152
- const field = fields[prop];
153
- if (field) return new ExpressionImpl(ColumnRef.of(namespaceName, prop), field, field.codec);
154
- }
155
- } });
156
- }
157
- /**
158
- * A bug in Prisma Next, not a user error. Never catch this except at the
159
- * outermost boundary for crash reporting — an InternalError means an invariant
160
- * broke and the process cannot reliably continue. User-facing failures use
161
- * `structuredError` with a dotted code instead.
162
- */
163
- var InternalError = class extends Error {
164
- isPrismaInternalError = true;
165
- constructor(message, options) {
166
- super(message, options?.cause !== void 0 ? { cause: options.cause } : void 0);
167
- this.name = "InternalError";
168
- }
169
- };
170
- /**
171
- * Asserts that a value is defined (not null or undefined).
172
- * Use for invariants where the value should always exist at runtime.
173
- *
174
- * @throws Error if value is null or undefined
175
- *
176
- * @example
177
- * ```typescript
178
- * const table = storage.namespaces[namespaceId].entries.table[tableName];
179
- * assertDefined(table, `Table "${tableName}" not found`);
180
- * // table is now narrowed to non-nullable
181
- * ```
182
- */
183
- function assertDefined(value, message) {
184
- if (value === null || value === void 0) throw new InternalError(message);
185
- }
186
- const BOOL_FIELD = {
187
- codecId: "pg/bool@1",
188
- nullable: false
189
- };
190
- const resolve = toExpr;
191
- /**
192
- * Resolve a binary-comparison operand into an AST expression, threading the column-bound side's {@link CodecRef} to the raw-value side.
193
- *
194
- * For `fns.eq(f.email, 'alice@example.com')`, `f.email` is the column-bound expression carrying a `ColumnRef` AST and a `CodecRef` derived from contract storage; the raw string operand has no codec context. By deriving the codec context from the column-bound side and forwarding it via `toExpr(value, codec)`, the resulting `ParamRef` carries the `CodecRef` that encode-side dispatch needs to materialise the per-instance codec for parameterized codec ids (`vector(1024)` vs. `vector(1536)`).
195
- */
196
- function resolveOperand(operand, otherCodec) {
197
- if (isExpressionLike(operand)) return operand.buildAst();
198
- return toExpr(operand, otherCodec);
199
- }
200
- function isExpressionLike(value) {
201
- return typeof value === "object" && value !== null && "buildAst" in value && typeof value.buildAst === "function";
202
- }
203
- /**
204
- * Resolves an Expression via `buildAst()`, or wraps a raw value as a `LiteralExpr` — an SQL literal inlined into the query text, not a bound parameter.
205
- *
206
- * Used for `and` / `or` operands. The usual operand is an `Expression<bool>` (e.g. the result of `fns.eq`), which this function passes through by calling `buildAst()`. The only time the raw-value branch fires is when the caller writes `fns.and(true, x)` or similar — inlining `TRUE`/`FALSE` literals lets the SQL planner statically simplify `TRUE AND x` to `x`, which it cannot do for an opaque `ParamRef`.
207
- */
208
- function toLiteralExpr(value) {
209
- if (typeof value === "object" && value !== null && "buildAst" in value && typeof value.buildAst === "function") return value.buildAst();
210
- return new LiteralExpr(value);
211
- }
212
- function boolExpr(astNode) {
213
- return new ExpressionImpl(astNode, BOOL_FIELD);
214
- }
215
- function binaryWithSharedCodec(a, b, build) {
216
- const aCodec = codecOf(a);
217
- return build(resolveOperand(a, codecOf(b)), resolveOperand(b, aCodec));
218
- }
219
- function eq(a, b) {
220
- if (b === null) return boolExpr(NullCheckExpr.isNull(resolve(a)));
221
- if (a === null) return boolExpr(NullCheckExpr.isNull(resolve(b)));
222
- return boolExpr(binaryWithSharedCodec(a, b, (l, r) => new BinaryExpr("eq", l, r)));
223
- }
224
- function ne(a, b) {
225
- if (b === null) return boolExpr(NullCheckExpr.isNotNull(resolve(a)));
226
- if (a === null) return boolExpr(NullCheckExpr.isNotNull(resolve(b)));
227
- return boolExpr(binaryWithSharedCodec(a, b, (l, r) => new BinaryExpr("neq", l, r)));
228
- }
229
- function comparison(a, b, op) {
230
- return boolExpr(binaryWithSharedCodec(a, b, (l, r) => new BinaryExpr(op, l, r)));
231
- }
232
- function inOrNotIn(expr, valuesOrSubquery, op) {
233
- const left = expr.buildAst();
234
- const leftCodec = codecOf(expr);
235
- const binaryFn = op === "in" ? BinaryExpr.in : BinaryExpr.notIn;
236
- if (Array.isArray(valuesOrSubquery)) {
237
- const refs = valuesOrSubquery.map((v) => resolveOperand(v, leftCodec));
238
- return boolExpr(binaryFn(left, ListExpression.of(refs)));
239
- }
240
- return boolExpr(binaryFn(left, SubqueryExpr.of(valuesOrSubquery.buildAst())));
241
- }
242
164
  /**
243
165
  * Build an aggregate through the target's own answer for it.
244
166
  *
@@ -294,24 +216,7 @@ function aggregate(aggregates, operation, expr) {
294
216
  expr: inputAst,
295
217
  inputCodec
296
218
  });
297
- return new ExpressionImpl(ast, returnType, void 0, projectionAst);
298
- }
299
- function createBuiltinFunctions(rawCodecInferer) {
300
- return {
301
- eq: (a, b) => eq(a, b),
302
- ne: (a, b) => ne(a, b),
303
- gt: (a, b) => comparison(a, b, "gt"),
304
- gte: (a, b) => comparison(a, b, "gte"),
305
- lt: (a, b) => comparison(a, b, "lt"),
306
- lte: (a, b) => comparison(a, b, "lte"),
307
- and: (...exprs) => boolExpr(AndExpr.of(exprs.map(toLiteralExpr))),
308
- or: (...exprs) => boolExpr(OrExpr.of(exprs.map(toLiteralExpr))),
309
- exists: (subquery) => boolExpr(ExistsExpr.exists(subquery.buildAst())),
310
- notExists: (subquery) => boolExpr(ExistsExpr.notExists(subquery.buildAst())),
311
- in: (expr, valuesOrSubquery) => inOrNotIn(expr, valuesOrSubquery, "in"),
312
- notIn: (expr, valuesOrSubquery) => inOrNotIn(expr, valuesOrSubquery, "notIn"),
313
- raw: createRawSql(rawCodecInferer)
314
- };
219
+ return new ExpressionImpl(ast, returnType, projectionAst);
315
220
  }
316
221
  /**
317
222
  * The aggregate implementations, one per operation the registry contributes,
@@ -332,22 +237,28 @@ function createAggregateOnlyFunctions(aggregates) {
332
237
  }
333
238
  return Object.fromEntries(methods);
334
239
  }
335
- function createFunctions(operations, rawCodecInferer) {
336
- const builtins = createBuiltinFunctions(rawCodecInferer);
337
- return new Proxy({}, { get(_target, prop) {
338
- if (Object.hasOwn(builtins, prop)) return builtins[prop];
339
- const op = operations[prop];
340
- if (op) return op.impl;
341
- } });
342
- }
343
240
  function createAggregateFunctions(operations, rawCodecInferer, aggregateRegistry) {
344
241
  const baseFns = createFunctions(operations, rawCodecInferer);
345
242
  const aggregates = createAggregateOnlyFunctions(aggregateRegistry);
346
- return new Proxy({}, { get(_target, prop) {
243
+ return new Proxy(blindCast({}), { get(_target, prop) {
347
244
  if (Object.hasOwn(aggregates, prop)) return aggregates[prop];
348
- return baseFns[prop];
245
+ return blindCast(baseFns)[prop];
349
246
  } });
350
247
  }
248
+ /**
249
+ * Builds the raw lane a client exposes as `db.raw`.
250
+ *
251
+ * The tag binds the adapter's codec inferer and the contract here, once. An
252
+ * authoring site then carries only its template, its row spec, and a
253
+ * terminator.
254
+ *
255
+ * The row type is phantom: no value holds it. The target-agnostic tag types it
256
+ * as `unknown`, and the contract says what each declared column decodes to.
257
+ */
258
+ function createRawLane(options) {
259
+ const tag = blindCast(createRawSql(options.rawCodecInferer, { contract: options.context.contract }));
260
+ return Object.freeze({ sql: tag });
261
+ }
351
262
  function resolveTableInNamespace(storage, namespaceId, tableName) {
352
263
  const namespace = storage.namespaces[namespaceId];
353
264
  if (namespace === void 0) return void 0;
@@ -355,6 +266,83 @@ function resolveTableInNamespace(storage, namespaceId, tableName) {
355
266
  if (tables === void 0 || !Object.hasOwn(tables, tableName)) return void 0;
356
267
  return tables[tableName];
357
268
  }
269
+ const NOTHING = {
270
+ columns: [],
271
+ subqueries: []
272
+ };
273
+ /** The columns an expression reads itself, and the subqueries inside it, which read their own sources. */
274
+ function readsOf(expression) {
275
+ return expression.fold({
276
+ empty: NOTHING,
277
+ combine: (a, b) => ({
278
+ columns: [...a.columns, ...b.columns],
279
+ subqueries: [...a.subqueries, ...b.subqueries]
280
+ }),
281
+ columnRef: (columnRef) => ({
282
+ columns: [columnRef],
283
+ subqueries: []
284
+ }),
285
+ select: (subquery) => ({
286
+ columns: [],
287
+ subqueries: [subquery]
288
+ })
289
+ });
290
+ }
291
+ function aliasOf(source) {
292
+ return source.kind === "table-source" ? source.alias ?? source.name : source.alias;
293
+ }
294
+ function assertReadsIn(expressions, visible) {
295
+ for (const expression of expressions) {
296
+ const { columns, subqueries } = readsOf(expression);
297
+ for (const column of columns) if (!visible.has(column.table)) throw columnOutsideQuery(column, visible);
298
+ for (const subquery of subqueries) assertSelectReads(subquery, visible);
299
+ }
300
+ }
301
+ function assertSelectReads(select, outer) {
302
+ const sources = [select.from, ...(select.joins ?? []).map((join) => join.source)].filter((source) => source !== void 0);
303
+ const visible = /* @__PURE__ */ new Set([...outer, ...sources.map(aliasOf).filter((alias) => alias !== void 0)]);
304
+ for (const source of sources) {
305
+ if (source.kind === "derived-table-source") assertSelectReads(source.query, visible);
306
+ if (source.kind === "function-source") assertReadsIn(source.args, visible);
307
+ }
308
+ assertReadsIn([
309
+ ...select.projection.map((item) => item.expr),
310
+ ...select.where === void 0 ? [] : [select.where],
311
+ ...(select.orderBy ?? []).map((item) => item.expr),
312
+ ...select.groupBy ?? [],
313
+ ...select.having === void 0 ? [] : [select.having],
314
+ ...select.distinctOn ?? [],
315
+ ...(select.joins ?? []).flatMap((join) => join.on.kind === "eq-col-join-on" ? [join.on.left, join.on.right] : [join.on])
316
+ ], visible);
317
+ }
318
+ /**
319
+ * Refuses a statement that reads a column of an alias none of its sources, or of the queries around it, has. An expression built outside the query's callbacks, such as an index read from `table.as('other').indexes`, can name any alias.
320
+ */
321
+ function assertColumnsInScope(ast) {
322
+ switch (ast.kind) {
323
+ case "select":
324
+ assertSelectReads(ast, /* @__PURE__ */ new Set());
325
+ return;
326
+ case "update":
327
+ assertReadsIn([...Object.values(ast.set), ...ast.where === void 0 ? [] : [ast.where]], /* @__PURE__ */ new Set([aliasOf(ast.table) ?? ast.table.name]));
328
+ return;
329
+ case "delete":
330
+ assertReadsIn(ast.where === void 0 ? [] : [ast.where], /* @__PURE__ */ new Set([aliasOf(ast.table) ?? ast.table.name]));
331
+ return;
332
+ default: return;
333
+ }
334
+ }
335
+ function columnOutsideQuery(column, visible) {
336
+ const sources = [...visible];
337
+ return structuredError("ORM.ARGUMENT_INVALID", `The query reads column "${column.column}" of "${column.table}", which is not one of its sources (${sources.map((source) => `"${source}"`).join(", ")}).`, {
338
+ fix: "Read the column, or the index, from a table the query selects from or joins, under the alias it has in the query.",
339
+ meta: {
340
+ alias: column.table,
341
+ column: column.column,
342
+ sources
343
+ }
344
+ });
345
+ }
358
346
  var BuilderBase = class {
359
347
  ctx;
360
348
  constructor(ctx) {
@@ -387,6 +375,7 @@ function emptyState(from, scope) {
387
375
  offset: void 0,
388
376
  distinct: void 0,
389
377
  distinctOn: void 0,
378
+ locking: void 0,
390
379
  scope,
391
380
  rowFields: {},
392
381
  annotations: /* @__PURE__ */ new Map()
@@ -403,7 +392,33 @@ function combineWhereExprs(exprs) {
403
392
  if (exprs.length === 1) return exprs[0];
404
393
  return AndExpr.of(exprs);
405
394
  }
395
+ const lockConflictKinds = [
396
+ "distinct",
397
+ "distinctOn",
398
+ "groupBy",
399
+ "having"
400
+ ];
401
+ function lockConflictOf(state) {
402
+ const conflicts = {
403
+ distinct: state.distinct !== void 0,
404
+ distinctOn: state.distinctOn !== void 0 && state.distinctOn.length > 0,
405
+ groupBy: state.groupBy.length > 0,
406
+ having: state.having !== void 0
407
+ };
408
+ return lockConflictKinds.find((conflict) => conflicts[conflict]);
409
+ }
410
+ function assertLockable(state) {
411
+ if (state.locking === void 0) return;
412
+ const conflict = lockConflictOf(state);
413
+ if (conflict !== void 0) throw lockIncompatible(conflict, `A locking clause cannot be combined with ${conflict}`);
414
+ const item = state.projections.find(isAggregateProjection);
415
+ if (item !== void 0) throw lockIncompatible("aggregate", `A locking clause cannot be combined with an aggregate or window function in the projection (column "${item.alias}")`);
416
+ }
417
+ function assertNotLocked(state) {
418
+ if (state.locking !== void 0) throw lockIncompatible("subquery", "A locked select cannot be used as a subquery");
419
+ }
406
420
  function buildSelectAst(state) {
421
+ assertLockable(state);
407
422
  const where = combineWhereExprs(state.where);
408
423
  return new SelectAst({
409
424
  from: state.from,
@@ -417,10 +432,12 @@ function buildSelectAst(state) {
417
432
  having: state.having,
418
433
  limit: state.limit,
419
434
  offset: state.offset,
435
+ locking: state.locking,
420
436
  selectAllIntent: void 0
421
437
  });
422
438
  }
423
439
  function buildQueryPlan(ast, ctx, annotations) {
440
+ assertColumnsInScope(ast);
424
441
  const paramValues = collectOrderedParamRefs(ast).map((r) => r.kind === "param-ref" ? r.value : void 0);
425
442
  const annotationsRecord = annotations !== void 0 && annotations.size > 0 ? Object.freeze(Object.fromEntries(annotations)) : void 0;
426
443
  const meta = Object.freeze({
@@ -501,6 +518,10 @@ function assertCapability(ctx, required, methodName) {
501
518
  capability: `${ns}.${key}`
502
519
  } });
503
520
  }
521
+ function codecRefOf(field, ctx) {
522
+ if (field.codec !== void 0) return field.codec;
523
+ return ctx.materializesWithoutTypeParams(field.codecId) ? { codecId: field.codecId } : void 0;
524
+ }
504
525
  function resolveSelectArgs(args, scope, ctx) {
505
526
  const projections = [];
506
527
  const newRowFields = {};
@@ -512,7 +533,7 @@ function resolveSelectArgs(args, scope, ctx) {
512
533
  for (const colName of args) {
513
534
  const field = scope.topLevel[colName];
514
535
  if (!field) throw structuredError("ORM.COLUMN_UNKNOWN", `Column "${colName}" not found in scope`, { meta: { column: colName } });
515
- projections.push(ProjectionItem.of(colName, IdentifierRef.of(colName), field.codec));
536
+ projections.push(ProjectionItem.of(colName, IdentifierRef.of(colName), codecRefOf(field, ctx)));
516
537
  newRowFields[colName] = field;
517
538
  }
518
539
  return {
@@ -526,7 +547,7 @@ function resolveSelectArgs(args, scope, ctx) {
526
547
  const fns = createAggregateFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer, ctx.aggregates);
527
548
  const result = exprFn(createFieldProxy(scope), fns);
528
549
  const field = result.returnType;
529
- projections.push(ProjectionItem.of(alias, projectionAstOf(result), field.codec));
550
+ projections.push(ProjectionItem.of(alias, projectionAstOf(result), codecRefOf(field, ctx)));
530
551
  newRowFields[alias] = field;
531
552
  return {
532
553
  projections,
@@ -539,7 +560,7 @@ function resolveSelectArgs(args, scope, ctx) {
539
560
  const record = callbackFn(createFieldProxy(scope), fns);
540
561
  for (const [key, expr] of Object.entries(record)) {
541
562
  const field = expr.returnType;
542
- projections.push(ProjectionItem.of(key, projectionAstOf(expr), field.codec));
563
+ projections.push(ProjectionItem.of(key, projectionAstOf(expr), codecRefOf(field, ctx)));
543
564
  newRowFields[key] = field;
544
565
  }
545
566
  return {
@@ -550,17 +571,19 @@ function resolveSelectArgs(args, scope, ctx) {
550
571
  throw structuredError("ORM.ARGUMENT_INVALID", "Invalid .select() arguments");
551
572
  }
552
573
  function resolveOrderBy(arg, options, scope, rowFields, ctx, useAggregateFns) {
553
- const dir = options?.direction ?? "asc";
574
+ const direction = options?.direction ?? "asc";
575
+ const nulls = options?.nulls;
576
+ if (!isOrderByDirection(direction)) throw structuredError("ORM.ARGUMENT_INVALID", "orderBy direction must be \"asc\" or \"desc\"", { meta: { direction: String(direction) } });
577
+ if (nulls !== void 0 && !isOrderByNulls(nulls)) throw structuredError("ORM.ARGUMENT_INVALID", "orderBy nulls must be \"first\" or \"last\"", { meta: { nulls: String(nulls) } });
578
+ const toOrderByItem = (expr) => new OrderByItem(expr, direction, nulls);
554
579
  if (typeof arg === "string") {
555
580
  if (!(arg in orderByScopeOf(scope, rowFields).topLevel)) throw structuredError("ORM.COLUMN_UNKNOWN", `Column "${arg}" not found in scope for orderBy`, { meta: { column: arg } });
556
- const expr = IdentifierRef.of(arg);
557
- return dir === "asc" ? OrderByItem.asc(expr) : OrderByItem.desc(expr);
581
+ return toOrderByItem(IdentifierRef.of(arg));
558
582
  }
559
583
  if (typeof arg === "function") {
560
584
  const combined = orderByScopeOf(scope, rowFields);
561
585
  const fns = useAggregateFns ? createAggregateFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer, ctx.aggregates) : createFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer);
562
- const result = arg(createFieldProxy(combined), fns);
563
- return dir === "asc" ? OrderByItem.asc(result.buildAst()) : OrderByItem.desc(result.buildAst());
586
+ return toOrderByItem(arg(createFieldProxy(combined), fns).buildAst());
564
587
  }
565
588
  throw structuredError("ORM.ARGUMENT_INVALID", "Invalid orderBy argument");
566
589
  }
@@ -640,6 +663,7 @@ var QueryBase = class extends BuilderBase {
640
663
  return new GroupedQueryImpl(cloneState(this.state, { groupBy: [...this.state.groupBy, ...exprs] }), this.ctx);
641
664
  }
642
665
  as(alias) {
666
+ assertNotLocked(this.state);
643
667
  const ast = buildSelectAst(this.state);
644
668
  const derivedSource = DerivedTableSource.as(alias, ast);
645
669
  const scope = {
@@ -655,6 +679,7 @@ var QueryBase = class extends BuilderBase {
655
679
  return this.state.rowFields;
656
680
  }
657
681
  buildAst() {
682
+ assertNotLocked(this.state);
658
683
  return buildSelectAst(this.state);
659
684
  }
660
685
  build() {
@@ -683,6 +708,21 @@ var SelectQueryImpl = class SelectQueryImpl extends QueryBase {
683
708
  const item = resolveOrderBy(arg, options, this.state.scope, this.state.rowFields, this.ctx, false);
684
709
  return this.clone(cloneState(this.state, { orderBy: [...this.state.orderBy, item] }));
685
710
  }
711
+ forUpdate = this._gate(lockStrengthCapabilities.forUpdate, "forUpdate", (options) => this.lock("forUpdate", options));
712
+ forNoKeyUpdate = this._gate(lockStrengthCapabilities.forNoKeyUpdate, "forNoKeyUpdate", (options) => this.lock("forNoKeyUpdate", options));
713
+ forShare = this._gate(lockStrengthCapabilities.forShare, "forShare", (options) => this.lock("forShare", options));
714
+ forKeyShare = this._gate(lockStrengthCapabilities.forKeyShare, "forKeyShare", (options) => this.lock("forKeyShare", options));
715
+ lock(strength, options) {
716
+ const of = options?.of !== void 0 && options.of.length > 0 ? options.of : void 0;
717
+ if (of !== void 0) assertCapability(this.ctx, lockOptionCapabilities.of, strength);
718
+ const waitPolicy = lockWaitPolicyOf(strength, options);
719
+ if (waitPolicy !== void 0) assertCapability(this.ctx, lockOptionCapabilities[waitPolicy], strength);
720
+ const clause = LockingClause.of(strength, {
721
+ ...ifDefined("of", of),
722
+ ...ifDefined("waitPolicy", waitPolicy)
723
+ });
724
+ return this.clone(cloneState(this.state, { locking: [...this.state.locking ?? [], clause] }));
725
+ }
686
726
  };
687
727
  var GroupedQueryImpl = class GroupedQueryImpl extends QueryBase {
688
728
  clone(state) {
@@ -800,16 +840,19 @@ function buildParamValues(values, namespaceId, table, tableName, op, ctx) {
800
840
  for (const def of ctx.applyMutationDefaults({
801
841
  op,
802
842
  namespace: namespaceId,
803
- table: tableName,
843
+ entry: tableName,
804
844
  values
805
845
  })) {
806
- const codec = table.columns[def.column] ? codecRefFor(ctx, namespaceId, tableName, def.column) : void 0;
807
- params[def.column] = ParamRef.of(def.value, codec ? { codec } : void 0);
846
+ const codec = table.columns[def.field] ? codecRefFor(ctx, namespaceId, tableName, def.field) : void 0;
847
+ params[def.field] = ParamRef.of(def.value, codec ? { codec } : void 0);
808
848
  }
809
849
  return params;
810
850
  }
811
- function buildReturningProjections(tableName, columns, rowFields) {
812
- return columns.map((col) => ProjectionItem.of(col, ColumnRef.of(tableName, col), rowFields[col]?.codec));
851
+ function buildReturningProjections(tableName, columns, rowFields, ctx) {
852
+ return columns.map((col) => {
853
+ const field = rowFields[col];
854
+ return ProjectionItem.of(col, ColumnRef.of(tableName, col), field === void 0 ? void 0 : codecRefOf(field, ctx));
855
+ });
813
856
  }
814
857
  function evaluateWhere(whereCallback, scope, queryOperationTypes, rawCodecInferer) {
815
858
  return whereCallback(createFieldProxy(scope), createFunctions(queryOperationTypes, rawCodecInferer)).buildAst();
@@ -825,11 +868,11 @@ function buildSetExpressions(exprs, namespaceId, table, tableName, op, ctx) {
825
868
  for (const def of ctx.applyMutationDefaults({
826
869
  op,
827
870
  namespace: namespaceId,
828
- table: tableName,
871
+ entry: tableName,
829
872
  values: exprs
830
- })) if (!(def.column in set)) {
831
- const codec = table.columns[def.column] ? codecRefFor(ctx, namespaceId, tableName, def.column) : void 0;
832
- set[def.column] = ParamRef.of(def.value, ifDefined("codec", codec));
873
+ })) if (!(def.field in set)) {
874
+ const codec = table.columns[def.field] ? codecRefFor(ctx, namespaceId, tableName, def.field) : void 0;
875
+ set[def.field] = ParamRef.of(def.value, ifDefined("codec", codec));
833
876
  }
834
877
  return set;
835
878
  }
@@ -878,7 +921,7 @@ var InsertQueryImpl = class InsertQueryImpl extends BuilderBase {
878
921
  if (this.#rows.length === 0) throw structuredError("ORM.MUTATION_DATA_MISSING", "insert() called with an empty row array — at least one row is required");
879
922
  const paramRows = this.#rows.map((rowValues) => buildParamValues(rowValues, this.#namespaceId, this.#table, this.#tableName, "create", this.ctx));
880
923
  let ast = InsertAst.into(this.#tableSource).withRows(paramRows);
881
- if (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields));
924
+ if (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields, this.ctx));
882
925
  return buildQueryPlan(ast, this.ctx, this.#annotations);
883
926
  }
884
927
  };
@@ -925,7 +968,7 @@ var UpdateQueryImpl = class UpdateQueryImpl extends BuilderBase {
925
968
  }
926
969
  build() {
927
970
  let ast = UpdateAst.table(this.#tableSource).withSet(this.#setExpressions).withWhere(combineWhereExprs(this.#whereExprs));
928
- if (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields));
971
+ if (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields, this.ctx));
929
972
  return buildQueryPlan(ast, this.ctx, this.#annotations);
930
973
  }
931
974
  };
@@ -969,7 +1012,7 @@ var DeleteQueryImpl = class DeleteQueryImpl extends BuilderBase {
969
1012
  build() {
970
1013
  const whereExpr = combineWhereExprs(this.#whereCallbacks.map((cb) => evaluateWhere(cb, this.#scope, this.ctx.queryOperationTypes, this.ctx.rawCodecInferer)));
971
1014
  let ast = DeleteAst.from(this.#tableSource).withWhere(whereExpr);
972
- if (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields));
1015
+ if (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields, this.ctx));
973
1016
  return buildQueryPlan(ast, this.ctx, this.#annotations);
974
1017
  }
975
1018
  };
@@ -978,13 +1021,16 @@ function tableSourceForProxy(tableName, alias, namespaceId) {
978
1021
  }
979
1022
  var TableProxyImpl = class TableProxyImpl extends BuilderBase {
980
1023
  #tableName;
1024
+ #alias;
981
1025
  #table;
982
1026
  #namespaceId;
983
1027
  #fromSource;
984
1028
  #scope;
1029
+ #indexes;
985
1030
  constructor(tableName, table, alias, ctx, namespaceId) {
986
1031
  super(ctx);
987
1032
  this.#tableName = tableName;
1033
+ this.#alias = alias;
988
1034
  this.#table = table;
989
1035
  this.#namespaceId = namespaceId;
990
1036
  this.#scope = tableToScope(alias, table, {
@@ -1006,6 +1052,27 @@ var TableProxyImpl = class TableProxyImpl extends BuilderBase {
1006
1052
  }]));
1007
1053
  return blindCast(Object.freeze(refs));
1008
1054
  }
1055
+ /**
1056
+ * The table's indexes, keyed by the name the contract source gave each. An index's columns are this table's columns under its alias, so `post.as('p').indexes.post_search` reads `p`'s columns. A name more than one index shares is refused when it is read.
1057
+ */
1058
+ get indexes() {
1059
+ this.#indexes ??= this.#indexReferences();
1060
+ return this.#indexes;
1061
+ }
1062
+ #indexReferences() {
1063
+ const fields = this.#scope.namespaces[this.#alias];
1064
+ assertDefined(fields, "a table proxy scopes its own alias");
1065
+ return blindCast(createIndexReferences({
1066
+ namespaceId: this.#namespaceId,
1067
+ tableName: this.#tableName,
1068
+ table: this.#table,
1069
+ column: (column) => {
1070
+ const field = fields[column];
1071
+ assertDefined(field, `an index covers a column of table "${this.#tableName}"`);
1072
+ return new ExpressionImpl(ColumnRef.of(this.#alias, column), field);
1073
+ }
1074
+ }));
1075
+ }
1009
1076
  lateralJoin = this._gate({ sql: { lateral: true } }, "lateralJoin", (alias, builder) => {
1010
1077
  return this.#toJoined().lateralJoin(alias, builder);
1011
1078
  });
@@ -1054,8 +1121,13 @@ var TableProxyImpl = class TableProxyImpl extends BuilderBase {
1054
1121
  return new JoinedTablesImpl(emptyState(this.#fromSource, this.#scope), this.ctx);
1055
1122
  }
1056
1123
  };
1057
- /** The key `raw`, which the SQL surface answers with the raw statement tag; no storage namespace may claim it. */
1058
- const RAW_TAG_KEY = "raw";
1124
+ function descriptorMaterializesWithoutTypeParams(descriptor) {
1125
+ if (descriptor === void 0) return false;
1126
+ const schema = descriptor.paramsSchema;
1127
+ if (schema === void 0) return true;
1128
+ const result = schema["~standard"].validate({});
1129
+ return !(result instanceof Promise) && result.issues === void 0;
1130
+ }
1059
1131
  function sql(options) {
1060
1132
  const { context, rawCodecInferer } = options;
1061
1133
  const ctx = {
@@ -1066,14 +1138,12 @@ function sql(options) {
1066
1138
  storage: context.contract.storage,
1067
1139
  applyMutationDefaults: (options) => context.applyMutationDefaults(options),
1068
1140
  rawCodecInferer,
1069
- aggregates: context.aggregateDescriptors
1141
+ aggregates: context.aggregateDescriptors,
1142
+ materializesWithoutTypeParams: (codecId) => descriptorMaterializesWithoutTypeParams(context.codecDescriptors.descriptorFor(codecId))
1070
1143
  };
1071
1144
  const { storage } = context.contract;
1072
- if (Object.hasOwn(storage.namespaces, RAW_TAG_KEY)) throw structuredError("ORM.NAMESPACE_RESERVED", `The SQL surface exposes the raw statement tag as "db.${RAW_TAG_KEY}", so a storage namespace named "${RAW_TAG_KEY}" cannot be reached through it. Rename the namespace in the schema.`, { meta: { namespaceId: RAW_TAG_KEY } });
1073
- const raw = blindCast(createRawSql(rawCodecInferer, { contract: context.contract }));
1074
1145
  return new Proxy(blindCast({}), { get(_target, prop) {
1075
1146
  if (typeof prop !== "string") return;
1076
- if (prop === RAW_TAG_KEY) return raw;
1077
1147
  if (!Object.hasOwn(storage.namespaces, prop)) return;
1078
1148
  const namespaceId = prop;
1079
1149
  return new Proxy({}, { get(_facetTarget, tableName) {
@@ -1084,6 +1154,6 @@ function sql(options) {
1084
1154
  } });
1085
1155
  }
1086
1156
  //#endregion
1087
- export { ExpressionImpl, createAggregateFunctions, createFieldProxy, createFunctions, sql };
1157
+ export { ExpressionImpl, createAggregateFunctions, createFieldProxy, createFunctions, createRawLane, sql };
1088
1158
 
1089
1159
  //# sourceMappingURL=builder__runtime.mjs.map