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

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 (251) hide show
  1. package/dist/{ast-DlajRqlB.d.mts → ast-BySjcUKx.d.mts} +3 -3
  2. package/dist/{ast-DlajRqlB.d.mts.map → ast-BySjcUKx.d.mts.map} +1 -1
  3. package/dist/{attribute-specs-cHzMPvMl.d.mts → attribute-specs-BsaemIyu.d.mts} +9 -11
  4. package/dist/attribute-specs-BsaemIyu.d.mts.map +1 -0
  5. package/dist/{authoring-entity-types-DUQLeBf_-nuhFC6jJ.d.mts → authoring-entity-types-DUQLeBf_-DSWWvkLJ.d.mts} +2 -2
  6. package/dist/{authoring-entity-types-DUQLeBf_-nuhFC6jJ.d.mts.map → authoring-entity-types-DUQLeBf_-DSWWvkLJ.d.mts.map} +1 -1
  7. package/dist/builder.d.mts +3 -3
  8. package/dist/builder__runtime.d.mts +10 -10
  9. package/dist/builder__runtime.mjs +1 -1
  10. package/dist/builder__types.d.mts +5 -5
  11. package/dist/{codec-descriptor-registry-4kw8FPpo.mjs → codec-descriptor-registry-MG2bFxW_.mjs} +5 -14
  12. package/dist/codec-descriptor-registry-MG2bFxW_.mjs.map +1 -0
  13. package/dist/collection-methods-BTknGdHI.d.mts +1 -0
  14. package/dist/{collection-methods-BtJYB_5s-0fek2_wK.d.mts → collection-methods-D2UnCS0S-CRYoAOtB.d.mts} +5 -5
  15. package/dist/{collection-methods-BtJYB_5s-0fek2_wK.d.mts.map → collection-methods-D2UnCS0S-CRYoAOtB.d.mts.map} +1 -1
  16. package/dist/{config-types-DY37pCIx.mjs → config-types-BLDwd9wS.mjs} +2 -2
  17. package/dist/{config-types-DY37pCIx.mjs.map → config-types-BLDwd9wS.mjs.map} +1 -1
  18. package/dist/{config-types-DN0IueHY.d.mts → config-types-D8quwydu.d.mts} +4 -4
  19. package/dist/{config-types-DN0IueHY.d.mts.map → config-types-D8quwydu.d.mts.map} +1 -1
  20. package/dist/{contract-builder-DT689tII.mjs → contract-builder-CNeGxqP_.mjs} +96 -99
  21. package/dist/contract-builder-CNeGxqP_.mjs.map +1 -0
  22. package/dist/{contract-builder-DZSUqbp0.d.mts → contract-builder-xFftVmD8.d.mts} +85 -69
  23. package/dist/contract-builder-xFftVmD8.d.mts.map +1 -0
  24. package/dist/contract-emitter.mjs +1 -1
  25. package/dist/contract-prisma7__provider.d.mts +2 -2
  26. package/dist/contract-prisma7__provider.mjs +4 -4
  27. package/dist/contract-psl.d.mts +4 -4
  28. package/dist/contract-psl.d.mts.map +1 -1
  29. package/dist/contract-psl.mjs +1 -1
  30. package/dist/contract-psl__attribute-specs.d.mts +1 -1
  31. package/dist/contract-psl__attribute-specs.mjs +1 -1
  32. package/dist/contract-psl__provider.d.mts +2 -2
  33. package/dist/contract-psl__provider.mjs +2 -2
  34. package/dist/contract-psl__provider.mjs.map +1 -1
  35. package/dist/contract-ts.d.mts +3 -3
  36. package/dist/contract-ts.mjs +3 -3
  37. package/dist/contract-ts__config-types.d.mts +1 -1
  38. package/dist/contract-ts__config-types.mjs +1 -1
  39. package/dist/contract-ts__contract-builder.d.mts +2 -2
  40. package/dist/contract-ts__contract-builder.mjs +2 -2
  41. package/dist/{contract-view-BAbRgQMW.d.mts → contract-view-BgpEwVz0.d.mts} +2 -2
  42. package/dist/{contract-view-BAbRgQMW.d.mts.map → contract-view-BgpEwVz0.d.mts.map} +1 -1
  43. package/dist/contract.d.mts +13 -13
  44. package/dist/contract.mjs +7 -7
  45. package/dist/contract__contract-view.d.mts +1 -1
  46. package/dist/contract__data-type.d.mts +1 -1
  47. package/dist/contract__entity-kinds.d.mts +1 -1
  48. package/dist/contract__entity-kinds.mjs +1 -1
  49. package/dist/contract__factories.d.mts +1 -1
  50. package/dist/contract__factories.mjs +1 -1
  51. package/dist/contract__foreign-key-materialization.d.mts +1 -1
  52. package/dist/contract__index-type-validation.d.mts +1 -1
  53. package/dist/contract__resolve-storage-table.d.mts +1 -1
  54. package/dist/contract__types.d.mts +5 -5
  55. package/dist/contract__types.mjs +4 -4
  56. package/dist/contract__validators.d.mts +1 -1
  57. package/dist/contract__validators.mjs +2 -2
  58. package/dist/{control-CF-KJYTH.mjs → control-KwF_dWdr.mjs} +33 -67
  59. package/dist/control-KwF_dWdr.mjs.map +1 -0
  60. package/dist/{control-adapter-Bn0uhplA-BBax-2PG.d.mts → control-adapter-Bn0uhplA-D0fhkvnJ.d.mts} +8 -8
  61. package/dist/{control-adapter-Bn0uhplA-BBax-2PG.d.mts.map → control-adapter-Bn0uhplA-D0fhkvnJ.d.mts.map} +1 -1
  62. package/dist/{control-adapter-QzlyTp1z.d.mts → control-adapter-El4czoUh.d.mts} +4 -4
  63. package/dist/{control-adapter-QzlyTp1z.d.mts.map → control-adapter-El4czoUh.d.mts.map} +1 -1
  64. package/dist/{control-YFLg-7Gn.d.mts → control-cq1XZ1wo.d.mts} +24 -24
  65. package/dist/control-cq1XZ1wo.d.mts.map +1 -0
  66. package/dist/{data-type-BacIoCfv.d.mts → data-type-CWFhlpaq.d.mts} +3 -3
  67. package/dist/{data-type-BacIoCfv.d.mts.map → data-type-CWFhlpaq.d.mts.map} +1 -1
  68. package/dist/{db-BmrN9nRS-DGNx3jwd.d.mts → db-BmrN9nRS-MT5cfCJy.d.mts} +13 -13
  69. package/dist/{db-BmrN9nRS-DGNx3jwd.d.mts.map → db-BmrN9nRS-MT5cfCJy.d.mts.map} +1 -1
  70. package/dist/{ddl-types-BBrLVtS--u4u-I8L5.d.mts → ddl-types-By5mT2_S--j4lTxme.d.mts} +4 -4
  71. package/dist/{ddl-types-BBrLVtS--u4u-I8L5.d.mts.map → ddl-types-By5mT2_S--j4lTxme.d.mts.map} +1 -1
  72. package/dist/{derived-checks-DpPkO6Dt-D-vp9vY3.d.mts → derived-checks-DpPkO6Dt-D6tfanWv.d.mts} +3 -3
  73. package/dist/{derived-checks-DpPkO6Dt-D-vp9vY3.d.mts.map → derived-checks-DpPkO6Dt-D6tfanWv.d.mts.map} +1 -1
  74. package/dist/{derived-checks-CXW9ytkb-B_zxX1-8.mjs → derived-checks-iXF3y0Ki-28vqz_8w.mjs} +22 -18
  75. package/dist/derived-checks-iXF3y0Ki-28vqz_8w.mjs.map +1 -0
  76. package/dist/{diff-CzUyZmJi.d.mts → diff-Cqz45svW.d.mts} +7 -7
  77. package/dist/{diff-CzUyZmJi.d.mts.map → diff-Cqz45svW.d.mts.map} +1 -1
  78. package/dist/diff-DZ82XaGR.mjs.map +1 -1
  79. package/dist/{dist-Bxu8hzMC.mjs → dist-D8RKUdwh.mjs} +4 -5
  80. package/dist/dist-D8RKUdwh.mjs.map +1 -0
  81. package/dist/{entity-kinds-CQ_jwgYv-DoOBWwvX.mjs → entity-kinds-JR5SAm5h-ZkDejOUK.mjs} +4 -8
  82. package/dist/entity-kinds-JR5SAm5h-ZkDejOUK.mjs.map +1 -0
  83. package/dist/{entity-kinds-BCMNbwxO.d.mts → entity-kinds-OhCjfrIe.d.mts} +2 -2
  84. package/dist/{entity-kinds-BCMNbwxO.d.mts.map → entity-kinds-OhCjfrIe.d.mts.map} +1 -1
  85. package/dist/{exports-D3JbXqm_-mm-wWICO.mjs → exports-CRROThzp-BNz0pGj0.mjs} +8 -65
  86. package/dist/{exports-D3JbXqm_-mm-wWICO.mjs.map → exports-CRROThzp-BNz0pGj0.mjs.map} +1 -1
  87. package/dist/{expression-CC4544Y8-C_EWTA_0.d.mts → expression-6ld_ZQL6-CQghHqQ4.d.mts} +8 -8
  88. package/dist/{expression-CC4544Y8-C_EWTA_0.d.mts.map → expression-6ld_ZQL6-CQghHqQ4.d.mts.map} +1 -1
  89. package/dist/expression-BLiObOS8.d.mts +2 -0
  90. package/dist/{expression-BdaU48Qq-Dff96hT_.d.mts → expression-CieaNuRM-BpwVyjJL.d.mts} +4 -4
  91. package/dist/expression-CieaNuRM-BpwVyjJL.d.mts.map +1 -0
  92. package/dist/{factories-DkD3nMYt.mjs → factories-C4JbtO84.mjs} +2 -2
  93. package/dist/{factories-DkD3nMYt.mjs.map → factories-C4JbtO84.mjs.map} +1 -1
  94. package/dist/{factories-B4AMRt6O.d.mts → factories-CfHDga-q.d.mts} +3 -3
  95. package/dist/{factories-B4AMRt6O.d.mts.map → factories-CfHDga-q.d.mts.map} +1 -1
  96. package/dist/family.d.mts +14 -14
  97. package/dist/family.mjs +6 -6
  98. package/dist/family__control-adapter.d.mts +2 -2
  99. package/dist/family__control.d.mts +4 -4
  100. package/dist/family__control.mjs +3 -3
  101. package/dist/family__diff.d.mts +1 -1
  102. package/dist/family__diff.mjs +1 -1
  103. package/dist/family__ir.d.mts +1 -1
  104. package/dist/family__ir.mjs +1 -1
  105. package/dist/family__migration.d.mts +1 -1
  106. package/dist/family__pack.d.mts +1 -1
  107. package/dist/family__pack.mjs +2 -2
  108. package/dist/family__psl-build.d.mts +1 -1
  109. package/dist/family__psl-infer.d.mts +1 -1
  110. package/dist/family__runtime.d.mts +2 -2
  111. package/dist/{foreign-key-materialization-bL-t2oPB.d.mts → foreign-key-materialization-CgW18KP-.d.mts} +3 -3
  112. package/dist/{foreign-key-materialization-bL-t2oPB.d.mts.map → foreign-key-materialization-CgW18KP-.d.mts.map} +1 -1
  113. package/dist/{functions-wFi6AtCc.d.mts → functions-DTInIMZT.d.mts} +6 -6
  114. package/dist/{functions-wFi6AtCc.d.mts.map → functions-DTInIMZT.d.mts.map} +1 -1
  115. package/dist/{generator-functions-DuDZSQHE-BbKhsXck.mjs → generator-functions-DuDZSQHE-Dl5EP61A.mjs} +2 -2
  116. package/dist/{generator-functions-DuDZSQHE-BbKhsXck.mjs.map → generator-functions-DuDZSQHE-Dl5EP61A.mjs.map} +1 -1
  117. package/dist/{index-v5QXXCrA.d.mts → index-3aEIvk82.d.mts} +22 -22
  118. package/dist/{index-v5QXXCrA.d.mts.map → index-3aEIvk82.d.mts.map} +1 -1
  119. package/dist/{index-BRFLss5v.d.mts → index-ffCr9ySU.d.mts} +3 -3
  120. package/dist/{index-BRFLss5v.d.mts.map → index-ffCr9ySU.d.mts.map} +1 -1
  121. package/dist/{index-reference-DSsn39tX-EEkv1N4w.d.mts → index-reference-4wsdeB7v-DiTLLldN.d.mts} +4 -4
  122. package/dist/{index-reference-DSsn39tX-EEkv1N4w.d.mts.map → index-reference-4wsdeB7v-DiTLLldN.d.mts.map} +1 -1
  123. package/dist/index-reference-Da9mdOjD.d.mts +1 -0
  124. package/dist/{index-type-validation-Cz2T3FJn.d.mts → index-type-validation-Ibtp3RKo.d.mts} +3 -3
  125. package/dist/{index-type-validation-Cz2T3FJn.d.mts.map → index-type-validation-Ibtp3RKo.d.mts.map} +1 -1
  126. package/dist/{interpreter-DTwRm0sl-DHX1SdeJ.mjs → interpreter-BGgim2OE-D9BG-4aU.mjs} +148 -130
  127. package/dist/interpreter-BGgim2OE-D9BG-4aU.mjs.map +1 -0
  128. package/dist/{ir-qK4wX3D3.d.mts → ir-BjC1VOuq.d.mts} +3 -3
  129. package/dist/{ir-qK4wX3D3.d.mts.map → ir-BjC1VOuq.d.mts.map} +1 -1
  130. package/dist/{middleware-C7H9kh01-l6_mYpN2.d.mts → middleware-DHkW6pRr-CFiQojK4.d.mts} +3 -3
  131. package/dist/{middleware-C7H9kh01-l6_mYpN2.d.mts.map → middleware-DHkW6pRr-CFiQojK4.d.mts.map} +1 -1
  132. package/dist/middleware-GO31SJSv.d.mts +1 -0
  133. package/dist/{migration-tfMTDejH.d.mts → migration-DeekERBF.d.mts} +4 -4
  134. package/dist/{migration-tfMTDejH.d.mts.map → migration-DeekERBF.d.mts.map} +1 -1
  135. package/dist/operations.d.mts +1 -1
  136. package/dist/orm-client.d.mts +21 -21
  137. package/dist/orm-client.mjs +2 -2
  138. package/dist/{pack-NM8AYiUp.mjs → pack-B5_CfdgT.mjs} +3 -3
  139. package/dist/{pack-NM8AYiUp.mjs.map → pack-B5_CfdgT.mjs.map} +1 -1
  140. package/dist/{pack-AyeYizq-.d.mts → pack-BJ53Inwa.d.mts} +6 -6
  141. package/dist/{pack-AyeYizq-.d.mts.map → pack-BJ53Inwa.d.mts.map} +1 -1
  142. package/dist/{plan-BiCLdXQr-0ZB4P6b9.d.mts → plan-Cr4azjnG-lIrzIrmu.d.mts} +5 -5
  143. package/dist/plan-Cr4azjnG-lIrzIrmu.d.mts.map +1 -0
  144. package/dist/plan-OXQ8s6Ee.d.mts +2 -0
  145. package/dist/psl-build-D5VG40ej.mjs.map +1 -1
  146. package/dist/{psl-build-C4ia2uM6.d.mts → psl-build-prdUw3sC.d.mts} +4 -4
  147. package/dist/{psl-build-C4ia2uM6.d.mts.map → psl-build-prdUw3sC.d.mts.map} +1 -1
  148. package/dist/{psl-column-resolution-BgThghdu-BWaFlWYV.d.mts → psl-column-resolution-ChZqioOc-DcjGSXDp.d.mts} +3 -4
  149. package/dist/psl-column-resolution-ChZqioOc-DcjGSXDp.d.mts.map +1 -0
  150. package/dist/{psl-field-resolution-DpGsATq3-BREG9FbU.mjs → psl-field-resolution-C9zwpsAu-DCc7Eifv.mjs} +163 -133
  151. package/dist/psl-field-resolution-C9zwpsAu-DCc7Eifv.mjs.map +1 -0
  152. package/dist/{psl-infer-B_n-rSCj.d.mts → psl-infer-CpTRaF5I.d.mts} +3 -3
  153. package/dist/{psl-infer-B_n-rSCj.d.mts.map → psl-infer-CpTRaF5I.d.mts.map} +1 -1
  154. package/dist/{query-lane-context-DEr9NHM--ClIM8v5T.d.mts → query-lane-context-BCEoKy0_-DQOOliDn.d.mts} +11 -20
  155. package/dist/query-lane-context-BCEoKy0_-DQOOliDn.d.mts.map +1 -0
  156. package/dist/query-lane-context-BssPNZey.d.mts +1 -0
  157. package/dist/relational-core.d.mts +13 -13
  158. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  159. package/dist/relational-core__ast.d.mts +3 -3
  160. package/dist/relational-core__codec-descriptor-registry.d.mts +6 -7
  161. package/dist/relational-core__codec-descriptor-registry.d.mts.map +1 -1
  162. package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
  163. package/dist/relational-core__collection-methods.d.mts +2 -2
  164. package/dist/relational-core__contract-free.d.mts +3 -3
  165. package/dist/relational-core__expression.d.mts +3 -3
  166. package/dist/relational-core__functions.d.mts +1 -1
  167. package/dist/relational-core__index-reference.d.mts +2 -2
  168. package/dist/relational-core__middleware.d.mts +2 -2
  169. package/dist/relational-core__plan.d.mts +3 -3
  170. package/dist/relational-core__query-lane-context.d.mts +3 -3
  171. package/dist/relational-core__types.d.mts +2 -2
  172. package/dist/{resolve-storage-table-8N2xelSh.d.mts → resolve-storage-table-CxmU_MPu.d.mts} +3 -3
  173. package/dist/{resolve-storage-table-8N2xelSh.d.mts.map → resolve-storage-table-CxmU_MPu.d.mts.map} +1 -1
  174. package/dist/{runtime-BlUQqGCH.d.mts → runtime-Bmndf-fm.d.mts} +2 -2
  175. package/dist/{runtime-BlUQqGCH.d.mts.map → runtime-Bmndf-fm.d.mts.map} +1 -1
  176. package/dist/runtime.d.mts +5 -5
  177. package/dist/runtime.mjs +1 -1
  178. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  179. package/dist/{schema-differ-DmP74bB8-BfEQ_9cY.d.mts → schema-differ-DmP74bB8-0ZupRJKb.d.mts} +5 -5
  180. package/dist/{schema-differ-DmP74bB8-BfEQ_9cY.d.mts.map → schema-differ-DmP74bB8-0ZupRJKb.d.mts.map} +1 -1
  181. package/dist/schema-ir.d.mts +1 -1
  182. package/dist/schema-ir__types.d.mts +2 -2
  183. package/dist/{schema-verify-BwRdzbHb-DfFAS0EC.mjs → schema-verify-C3wbdviw-BifQBCpu.mjs} +3 -3
  184. package/dist/{schema-verify-BwRdzbHb-DfFAS0EC.mjs.map → schema-verify-C3wbdviw-BifQBCpu.mjs.map} +1 -1
  185. package/dist/{serialized-index-52COq1yV-CUJ2F65u.mjs → serialized-index-DjCCnXB1-C_YccpTL.mjs} +3 -3
  186. package/dist/{serialized-index-52COq1yV-CUJ2F65u.mjs.map → serialized-index-DjCCnXB1-C_YccpTL.mjs.map} +1 -1
  187. package/dist/{sql-contract-serializer-sMY3prTx-CpZa5Nlt.mjs → sql-contract-serializer-sMY3prTx-BkFoHhST.mjs} +4 -4
  188. package/dist/{sql-contract-serializer-sMY3prTx-CpZa5Nlt.mjs.map → sql-contract-serializer-sMY3prTx-BkFoHhST.mjs.map} +1 -1
  189. package/dist/{sql-execution-plan-BEhLlwYP-seGNP8Qr.d.mts → sql-execution-plan-3uxYjHyu-C0Z4_RSY.d.mts} +3 -3
  190. package/dist/sql-execution-plan-3uxYjHyu-C0Z4_RSY.d.mts.map +1 -0
  191. package/dist/{sql-storage-tZhB8nS5-8NSWT0TW.d.mts → sql-storage-DeCAh5Hi-nJQUIgfL.d.mts} +6 -9
  192. package/dist/sql-storage-DeCAh5Hi-nJQUIgfL.d.mts.map +1 -0
  193. package/dist/{storage-table-DC9afJhr-CmRU56OS.d.mts → storage-table-Bf1ZjnxO-NvkG2pgq.d.mts} +2 -8
  194. package/dist/storage-table-Bf1ZjnxO-NvkG2pgq.d.mts.map +1 -0
  195. package/dist/{storage-table-DN36E2yE-0ncS821l.mjs → storage-table-DDvN83mw-CbCFr5wm.mjs} +2 -3
  196. package/dist/{storage-table-DN36E2yE-0ncS821l.mjs.map → storage-table-DDvN83mw-CbCFr5wm.mjs.map} +1 -1
  197. package/dist/{transaction-state-DR3nKTmH-2-ewbth1.d.mts → transaction-state-DR3nKTmH-D6VdY7YX.d.mts} +9 -9
  198. package/dist/{transaction-state-DR3nKTmH-2-ewbth1.d.mts.map → transaction-state-DR3nKTmH-D6VdY7YX.d.mts.map} +1 -1
  199. package/dist/types-BUggiEEH.d.mts +1 -0
  200. package/dist/{types-M_FeBD9w.mjs → types-C7610W2l.mjs} +5 -6
  201. package/dist/types-C7610W2l.mjs.map +1 -0
  202. package/dist/{types-CI5lled6-CDV4aYNB.d.mts → types-CI5lled6-DMWq8aOX.d.mts} +9 -9
  203. package/dist/{types-CI5lled6-CDV4aYNB.d.mts.map → types-CI5lled6-DMWq8aOX.d.mts.map} +1 -1
  204. package/dist/{types-B2Dee96w.d.mts → types-CRbj_WQf.d.mts} +7 -12
  205. package/dist/types-CRbj_WQf.d.mts.map +1 -0
  206. package/dist/{types-DiD6BqoN-ZF53hwPp.d.mts → types-CuCxAQat-BBGUHEku.d.mts} +3 -4
  207. package/dist/types-CuCxAQat-BBGUHEku.d.mts.map +1 -0
  208. package/dist/types-DDqbg3WC.d.mts +1 -0
  209. package/dist/{types-Dqf87mfA-BOElvimQ.d.mts → types-DfKvtJwS-tndgHh53.d.mts} +4 -4
  210. package/dist/{types-Dqf87mfA-BOElvimQ.d.mts.map → types-DfKvtJwS-tndgHh53.d.mts.map} +1 -1
  211. package/dist/{types-GgcOrYm_-RhoxnXdj.d.mts → types-DriMIMNQ-BBacSgaI.d.mts} +4 -5
  212. package/dist/types-DriMIMNQ-BBacSgaI.d.mts.map +1 -0
  213. package/dist/{types-Dy1w8GHm-7hJTBOLL.d.mts → types-TXO7x1BA-DuW4v0rw.d.mts} +11 -11
  214. package/dist/{types-Dy1w8GHm-7hJTBOLL.d.mts.map → types-TXO7x1BA-DuW4v0rw.d.mts.map} +1 -1
  215. package/dist/{validators-CTZ-hU2l.d.mts → validators-BDuMio1F.d.mts} +3 -4
  216. package/dist/validators-BDuMio1F.d.mts.map +1 -0
  217. package/dist/{validators-Cfy0jmZ2.mjs → validators-xXKEHvnw.mjs} +25 -12
  218. package/dist/validators-xXKEHvnw.mjs.map +1 -0
  219. package/package.json +18 -18
  220. package/dist/attribute-specs-cHzMPvMl.d.mts.map +0 -1
  221. package/dist/codec-descriptor-registry-4kw8FPpo.mjs.map +0 -1
  222. package/dist/collection-methods-CwBVxvll.d.mts +0 -1
  223. package/dist/contract-builder-DT689tII.mjs.map +0 -1
  224. package/dist/contract-builder-DZSUqbp0.d.mts.map +0 -1
  225. package/dist/control-CF-KJYTH.mjs.map +0 -1
  226. package/dist/control-YFLg-7Gn.d.mts.map +0 -1
  227. package/dist/derived-checks-CXW9ytkb-B_zxX1-8.mjs.map +0 -1
  228. package/dist/dist-Bxu8hzMC.mjs.map +0 -1
  229. package/dist/entity-kinds-CQ_jwgYv-DoOBWwvX.mjs.map +0 -1
  230. package/dist/expression-BdaU48Qq-Dff96hT_.d.mts.map +0 -1
  231. package/dist/expression-DI_LoyKf.d.mts +0 -2
  232. package/dist/index-reference-burEIuXy.d.mts +0 -1
  233. package/dist/interpreter-DTwRm0sl-DHX1SdeJ.mjs.map +0 -1
  234. package/dist/middleware-CpxZxPGp.d.mts +0 -1
  235. package/dist/plan-BiCLdXQr-0ZB4P6b9.d.mts.map +0 -1
  236. package/dist/plan-xPa9B6I3.d.mts +0 -2
  237. package/dist/psl-column-resolution-BgThghdu-BWaFlWYV.d.mts.map +0 -1
  238. package/dist/psl-field-resolution-DpGsATq3-BREG9FbU.mjs.map +0 -1
  239. package/dist/query-lane-context--sVodqqM.d.mts +0 -1
  240. package/dist/query-lane-context-DEr9NHM--ClIM8v5T.d.mts.map +0 -1
  241. package/dist/sql-execution-plan-BEhLlwYP-seGNP8Qr.d.mts.map +0 -1
  242. package/dist/sql-storage-tZhB8nS5-8NSWT0TW.d.mts.map +0 -1
  243. package/dist/storage-table-DC9afJhr-CmRU56OS.d.mts.map +0 -1
  244. package/dist/types-B2Dee96w.d.mts.map +0 -1
  245. package/dist/types-BQC-To7K.d.mts +0 -1
  246. package/dist/types-D_nlUp-1.d.mts +0 -1
  247. package/dist/types-DiD6BqoN-ZF53hwPp.d.mts.map +0 -1
  248. package/dist/types-GgcOrYm_-RhoxnXdj.d.mts.map +0 -1
  249. package/dist/types-M_FeBD9w.mjs.map +0 -1
  250. package/dist/validators-CTZ-hU2l.d.mts.map +0 -1
  251. package/dist/validators-Cfy0jmZ2.mjs.map +0 -1
@@ -1,12 +1,11 @@
1
1
  import { u as sqlCodecColumnLength } from "./sql-data-type-D7M-YTTY-C9oWGZ3z.mjs";
2
2
  import { p as sqlTextFromStored, t as SQL_EXPRESSION_DATA_TYPE_ID } from "./sql-expression-BJCuy-WI.mjs";
3
- import { d as resolvedTypeParams } from "./types-M_FeBD9w.mjs";
4
- import { n as checkSqlDefaultText, o as reservedSqlDefaultText } from "./validators-Cfy0jmZ2.mjs";
5
- import { a as storedAsListColumn, i as isValueObjectMember } from "./derived-checks-CXW9ytkb-B_zxX1-8.mjs";
3
+ import { n as checkSqlDefaultText, o as reservedSqlDefaultText } from "./validators-xXKEHvnw.mjs";
4
+ import { i as isValueObjectMember, o as storedAsListColumn } from "./derived-checks-iXF3y0Ki-28vqz_8w.mjs";
6
5
  import { n as getAttribute, o as storageName, t as formatDbAttributeMigrationMessage } from "./psl-attribute-parsing-BCsFWsSp-LaNsbcrw.mjs";
7
6
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
8
7
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
9
- import { admittedForms, castTypedValue, describeExpected, describeRefusal, describeRefusedValueType, exactRewrite, instantiateAuthoringTypeConstructor, isAuthoringEntityTypeDescriptor, readWrittenValue, tagForm, validateAuthoringHelperArguments, validateAuthoringTypeParams } from "@prisma/orm-framework/components/authoring";
8
+ import { admittedForms, castTypedValue, describeExpected, describeRefusal, describeRefusedValueType, exactRewrite, instantiateAuthoringTypeAlias, instantiateAuthoringTypeConstructor, isAuthoringEntityTypeDescriptor, readWrittenValue, tagForm, validateAuthoringHelperArguments, validateAuthoringTypeParams } from "@prisma/orm-framework/components/authoring";
10
9
  import { codecForRef, dataTypeParams, readContractValue } from "@prisma/orm-framework/components/codec";
11
10
  import { blindCast } from "@prisma/orm-framework/utils/casts";
12
11
  import { InternalError, isInternalError } from "@prisma/orm-framework/utils/internal-error";
@@ -14,9 +13,9 @@ import { FunctionCallAst } from "@prisma/orm-framework/psl-parser/syntax";
14
13
  import { invariant } from "@prisma/orm-framework/utils/assertions";
15
14
  import { notOk, ok } from "@prisma/orm-framework/utils/result";
16
15
  import { describeTaggedLiteralFailure as describeTaggedLiteralFailure$1 } from "@prisma/orm-framework/components/control";
17
- import { bool, contributedTypeOf, dataTypeValue, diagnosticSource, entityRef, fieldAttribute, fieldRef, funcCall, generatorAttributeSpec, identifier, interpretAttribute, leafDiagnostic, list, mapArg, modelAttribute, nodePslSpan, nodeSourceText, numLiteral, oneOf, optional, record, referencedFieldRef, str, taggedLiteral, typeReferenceNode, writtenList, writtenScalar } from "@prisma/orm-framework/psl-parser";
16
+ import { bool, contributedTypeCodecId, contributedTypeOf, dataTypeValue, diagnosticSource, entityRef, fieldAttribute, fieldRef, funcCall, generatorAttributeSpec, identifier, interpretAttribute, leafDiagnostic, list, mapArg, modelAttribute, nodePslSpan, nodeSourceText, numLiteral, oneOf, optional, record, referencedFieldRef, refuseRepeatedTypeAliasAttributes, str, taggedLiteral, typeAttribute, typeAttributeSpecContextOfField, typeAttributeSubjectLabel, typeGeneratorAttributeSpec, typeReferenceNode, writtenList, writtenScalar } from "@prisma/orm-framework/psl-parser";
18
17
  import { instantiatePslFieldPreset, isBareTypeConstructor, mapPslHelperArgs, reportPresetNotCalled, reportTypeConstructorNotCalled } from "@prisma/orm-framework/psl-parser/interpret";
19
- //#region ../../../2-sql/2-authoring/contract-psl/dist/psl-field-resolution-DpGsATq3.mjs
18
+ //#region ../../../2-sql/2-authoring/contract-psl/dist/psl-field-resolution-C9zwpsAu.mjs
20
19
  function contractError(code, message, options) {
21
20
  return structuredError(code, message, options);
22
21
  }
@@ -230,13 +229,16 @@ function rewriteOf(refusal, written, dataTypes) {
230
229
  * defaults have at the `@default` attribute.
231
230
  */
232
231
  function lowerDataTypeDefault(input) {
233
- const read = readDataTypeDefault(input);
232
+ const read = readDataTypeDefault({
233
+ ...input,
234
+ fieldPath: input.subject
235
+ });
234
236
  if (read.ok) return read;
235
237
  const refusal = atSourceElement(read.refusal, input.sourceElementIndexes);
236
238
  return {
237
239
  ok: false,
238
- ...refusalMessage(refusal, `Field "${input.fieldPath}"`, input.dataTypes, guidanceFor(read, input.written, input.dataTypes)),
239
- span: refusalSpan(refusal, input.spans, input.fieldPath)
240
+ ...refusalMessage(refusal, input.subject, input.dataTypes, guidanceFor(read, input.written, input.dataTypes)),
241
+ span: refusalSpan(refusal, input.spans, input.subject)
240
242
  };
241
243
  }
242
244
  /**
@@ -311,17 +313,17 @@ function refusalMessage(refusal, subject, dataTypes, guidance) {
311
313
  }
312
314
  }
313
315
  }
314
- function refusalSpan(refusal, spans, fieldPath) {
316
+ function refusalSpan(refusal, spans, subject) {
315
317
  switch (refusal.kind) {
316
318
  case "not-a-list":
317
319
  case "refused-by-column": return spans.attribute;
318
- default: return writtenValueSpan(spans, refusal.elementIndex, fieldPath);
320
+ default: return writtenValueSpan(spans, refusal.elementIndex, subject);
319
321
  }
320
322
  }
321
- function writtenValueSpan(spans, elementIndex, fieldPath) {
323
+ function writtenValueSpan(spans, elementIndex, subject) {
322
324
  if (elementIndex === void 0) return spans.value;
323
325
  const span = spans.elements[elementIndex];
324
- if (span === void 0) throw new InternalError(`Field "${fieldPath}": a refused @default list element ${elementIndex + 1} has no written span.`);
326
+ if (span === void 0) throw new InternalError(`${subject}: a refused @default list element ${elementIndex + 1} has no written span.`);
325
327
  return span;
326
328
  }
327
329
  function formatSupportedFunctionList(registry) {
@@ -407,6 +409,19 @@ function interpretFieldAttribute(input) {
407
409
  }
408
410
  return result.value;
409
411
  }
412
+ /** Interprets an attribute that reads only its type, such as `@default` on a field or a type alias, draining parse failures into `diagnostics`. */
413
+ function interpretTypeAttribute(input) {
414
+ const result = interpretAttribute(input.node, input.spec, {
415
+ sources: input.sources,
416
+ symbols: input.symbols,
417
+ binder: input.binder
418
+ });
419
+ if (!result.ok) {
420
+ input.diagnostics.push(...result.failure);
421
+ return;
422
+ }
423
+ return result.value;
424
+ }
410
425
  function validateMappedName(value, ctx, attributeNode) {
411
426
  return value.name === "" ? [leafDiagnostic(ctx, attributeNode, "Mapped name must not be empty")] : [];
412
427
  }
@@ -452,7 +467,7 @@ function defaultFunctionCall(name, entry, dataTypes) {
452
467
  /** The data type of the column a field declares, when its type, or the named type it is declared with, is a constructor or preset the stack knows. */
453
468
  function receivingDataType(ctx) {
454
469
  const typeConstructor = ctx.typeConstructor;
455
- return typeConstructor === void 0 ? void 0 : ctx.dataTypes.dataTypeOfCodec(typeConstructor.descriptor.output.codecId);
470
+ return typeConstructor === void 0 ? void 0 : ctx.dataTypes.dataTypeOfCodec(contributedTypeCodecId(typeConstructor.descriptor));
456
471
  }
457
472
  /** Whether a value of `type` can be written for a column of `receiving`: it is that type, or the column's type casts from it. An unknown column takes every type. */
458
473
  function receives(dataTypes, receiving, type) {
@@ -497,7 +512,7 @@ function scalarDefaultArms(isList, receiving, dataTypes, defaultFunctionRegistry
497
512
  * The `@default` value arms, with a `dbgenerated(...)` call reported as removed before the arms
498
513
  * are tried, so the author is told what replaced it instead of being shown the list of arms.
499
514
  */
500
- function defaultValueArm(arms, registry, generatorFunctions, fieldPath) {
515
+ function defaultValueArm(arms, registry, generatorFunctions, subject) {
501
516
  const value = arms.length === 1 && arms[0].kind === "list" ? arms[0] : oneOf(...arms);
502
517
  return {
503
518
  ...value,
@@ -506,7 +521,7 @@ function defaultValueArm(arms, registry, generatorFunctions, fieldPath) {
506
521
  if (callee === "dbgenerated") return notOk([leafDiagnostic(ctx, arg, removedDbgeneratedMessage(registry), "PSL_UNKNOWN_DEFAULT_FUNCTION")]);
507
522
  if (callee !== void 0 && !registry.has(callee) && generatorFunctions.has(callee)) {
508
523
  const call = nodeSourceText(arg, ctx);
509
- return notOk([leafDiagnostic(ctx, arg, `Field "${fieldPath}": ${call} is a value the client generates, and @default sets a database default only. Write @onCreate(${call}) instead.`, "PSL_GENERATOR_IN_DEFAULT")]);
524
+ return notOk([leafDiagnostic(ctx, arg, `${subject}: ${call} is a value the client generates, and @default sets a database default only. Write @onCreate(${call}) instead.`, "PSL_GENERATOR_IN_DEFAULT")]);
510
525
  }
511
526
  return value.parse(arg, ctx);
512
527
  }
@@ -547,13 +562,14 @@ function enumDefaultArms(members, enumName, isList) {
547
562
  }))];
548
563
  return [member(first), ...rest.map(member)];
549
564
  }
550
- function defaultFieldSpec(ctx) {
565
+ /** The spec of `@default` on a field or a type alias, offering the values its type takes. */
566
+ function typeDefaultSpec(ctx) {
551
567
  const members = enumMemberNames(ctx);
552
- return fieldAttribute("default", {
568
+ return typeAttribute("default", {
553
569
  documentation: "Supplies a default value when this field is omitted from a mutation.",
554
570
  positional: [{
555
571
  key: "value",
556
- type: defaultValueArm(members === void 0 ? scalarDefaultArms(ctx.field.list, receivingDataType(ctx), ctx.dataTypes, ctx.defaultFunctionRegistry) : enumDefaultArms(members, ctx.field.typeName, ctx.field.list), ctx.defaultFunctionRegistry, ctx.generatorFunctions, `${ctx.model.name}.${ctx.field.name}`),
572
+ type: defaultValueArm(members === void 0 ? scalarDefaultArms(ctx.list, receivingDataType(ctx), ctx.dataTypes, ctx.defaultFunctionRegistry) : enumDefaultArms(members, ctx.typeName, ctx.list), ctx.defaultFunctionRegistry, ctx.generatorFunctions, typeAttributeSubjectLabel(ctx.subject)),
557
573
  documentation: "A literal, enum member, or registered default function compatible with this field."
558
574
  }]
559
575
  });
@@ -822,7 +838,7 @@ const sqlAttributeSpecs = {
822
838
  id: (_ctx) => idFieldSpec,
823
839
  unique: (_ctx) => uniqueFieldSpec,
824
840
  relation: (_ctx) => relationFieldSpec,
825
- default: defaultFieldSpec,
841
+ default: (ctx) => typeDefaultSpec(typeAttributeSpecContextOfField(ctx)),
826
842
  onCreate: generatorAttributeSpec("onCreate"),
827
843
  onUpdate: generatorAttributeSpec("onUpdate")
828
844
  }
@@ -962,12 +978,6 @@ function jsonKind(value) {
962
978
  if (typeof value === "object") return "a JSON object";
963
979
  return `a JSON ${typeof value}`;
964
980
  }
965
- function toNamedTypeFieldDescriptor(typeRef, descriptor) {
966
- return {
967
- codecId: descriptor.codecId,
968
- typeRef
969
- };
970
- }
971
981
  function argumentSpan(call, descriptors, index) {
972
982
  if (index === void 0) return call.span;
973
983
  const name = descriptors?.[index]?.name;
@@ -1192,15 +1202,10 @@ function instantiateFieldPreset(input) {
1192
1202
  presetContributions
1193
1203
  };
1194
1204
  }
1195
- function bareTypeConstructorOf(resolution) {
1196
- if (resolution?.kind !== "contributedType") return void 0;
1197
- const { descriptor } = resolution.symbol;
1198
- return descriptor.kind === "typeConstructor" && isBareTypeConstructor(descriptor) ? descriptor : void 0;
1199
- }
1200
1205
  function resolvedKindLabel(resolution) {
1201
1206
  switch (resolution.kind) {
1202
1207
  case "compositeType": return "composite type";
1203
- case "namedType": return "named type";
1208
+ case "namedType": return "type alias";
1204
1209
  case "block": return resolution.symbol.keyword;
1205
1210
  case "crossSpace": return "type of another contract space";
1206
1211
  default: return resolution.kind;
@@ -1227,6 +1232,20 @@ function resolveFieldTypeDescriptor(input) {
1227
1232
  case "contributedType": {
1228
1233
  const { descriptor, path } = resolution.symbol;
1229
1234
  const written = path.join(".");
1235
+ if (descriptor.kind === "typeAlias") {
1236
+ if (call !== void 0) {
1237
+ diagnostics.push({
1238
+ code: "PSL_INVALID_ATTRIBUTE_ARGUMENT",
1239
+ message: `${written} is a type alias and takes no arguments.`,
1240
+ ...source.at(call.span)
1241
+ });
1242
+ return NOT_RESOLVED;
1243
+ }
1244
+ return {
1245
+ ok: true,
1246
+ descriptor: instantiateAuthoringTypeAlias(descriptor).type
1247
+ };
1248
+ }
1230
1249
  if (descriptor.kind === "fieldPreset") {
1231
1250
  if (call === void 0) {
1232
1251
  reportPresetNotCalled({
@@ -1279,10 +1298,10 @@ function resolveFieldTypeDescriptor(input) {
1279
1298
  if (call !== void 0) return unsupported(`${entityLabel} calls "${call.path.join(".")}", which is a ${resolvedKindLabel(resolution)}, not a type constructor. Remove the arguments.`);
1280
1299
  switch (resolution.kind) {
1281
1300
  case "namedType": {
1282
- const descriptor = input.namedTypeDescriptors.get(resolution.symbol);
1283
- return descriptor === void 0 ? NOT_RESOLVED : {
1301
+ const alias = input.typeAliases.get(resolution.symbol);
1302
+ return alias === void 0 ? NOT_RESOLVED : {
1284
1303
  ok: true,
1285
- descriptor
1304
+ descriptor: alias.descriptor
1286
1305
  };
1287
1306
  }
1288
1307
  case "block": {
@@ -1308,12 +1327,12 @@ const TAGGED_LITERAL_CANONICALIZATION_CODES = {
1308
1327
  * at the first `null`. Returns whether it refused.
1309
1328
  */
1310
1329
  function rejectStrictListNullDefault(input) {
1311
- if (input.field.elementOptional) return false;
1330
+ if (input.owner.elementOptional) return false;
1312
1331
  const nullElement = input.elements.find(isParsedNullLiteral);
1313
1332
  if (nullElement === void 0) return false;
1314
1333
  input.diagnostics.push({
1315
1334
  code: "PSL_INVALID_DEFAULT_APPLICABILITY",
1316
- message: `Field "${input.modelName}.${input.field.name}" has strict list elements and cannot use null in a literal list default. Make the element type nullable or remove null from the default.`,
1335
+ message: `${typeAttributeSubjectLabel(input.owner.specContext.subject)} has strict list elements and cannot use null in a literal list default. Make the element type nullable or remove null from the default.`,
1317
1336
  ...input.source.at(nullElement.span)
1318
1337
  });
1319
1338
  return true;
@@ -1321,25 +1340,44 @@ function rejectStrictListNullDefault(input) {
1321
1340
  function isParsedNullLiteral(element) {
1322
1341
  return element.kind === "null";
1323
1342
  }
1343
+ function fieldAttributeOwner(input) {
1344
+ const { field, model } = input;
1345
+ return {
1346
+ attributes: field.attributes,
1347
+ optional: field.optional,
1348
+ list: field.list,
1349
+ elementOptional: field.elementOptional,
1350
+ specContext: typeAttributeSpecContextOfField(fieldSpecContext({
1351
+ symbols: input.symbolTable,
1352
+ model,
1353
+ field,
1354
+ binder: input.binder,
1355
+ defaultFunctionRegistry: input.defaultFunctionRegistry,
1356
+ generatorFunctions: input.generatorFunctions,
1357
+ dataTypes: input.dataTypes
1358
+ })),
1359
+ loweringNames: {
1360
+ modelName: model.name,
1361
+ fieldName: field.name
1362
+ }
1363
+ };
1364
+ }
1324
1365
  function lowerDefaultForField(input) {
1325
- const node = getAttribute(input.field.attributes, "default")?.node;
1366
+ return lowerTypeDefault({
1367
+ ...input,
1368
+ owner: fieldAttributeOwner(input)
1369
+ });
1370
+ }
1371
+ /** The default a field's or type alias's `@default(...)` lowers to for its column. */
1372
+ function lowerTypeDefault(input) {
1373
+ const node = getAttribute(input.owner.attributes, "default")?.node;
1326
1374
  if (node === void 0) return {};
1327
1375
  const source = diagnosticSource(input.sources, node.syntax);
1328
- const spec = sqlAttributeSpecs.field.default(fieldSpecContext({
1329
- symbols: input.symbolTable,
1330
- model: input.model,
1331
- field: input.field,
1332
- binder: input.binder,
1333
- defaultFunctionRegistry: input.defaultFunctionRegistry,
1334
- generatorFunctions: input.generatorFunctions,
1335
- dataTypes: input.dataTypes
1336
- }));
1337
- const interpreted = interpretFieldAttribute({
1376
+ const subject = typeAttributeSubjectLabel(input.owner.specContext.subject);
1377
+ const interpreted = interpretTypeAttribute({
1338
1378
  symbols: input.symbolTable,
1339
1379
  node,
1340
- spec,
1341
- model: input.model,
1342
- field: input.field,
1380
+ spec: typeDefaultSpec(input.owner.specContext),
1343
1381
  sources: input.sources,
1344
1382
  binder: input.binder,
1345
1383
  diagnostics: input.diagnostics
@@ -1348,10 +1386,10 @@ function lowerDefaultForField(input) {
1348
1386
  const value = interpreted.value;
1349
1387
  const attributeSpan = nodePslSpan(node.syntax, input.sources);
1350
1388
  if (value.kind === "null") {
1351
- if (!input.field.optional) {
1389
+ if (!input.owner.optional) {
1352
1390
  input.diagnostics.push({
1353
1391
  code: "PSL_INVALID_DEFAULT_APPLICABILITY",
1354
- message: `Field "${input.modelName}.${input.fieldName}" is non-nullable and cannot use null as its literal default. Make the field nullable or use a non-null default.`,
1392
+ message: `${subject} is non-nullable and cannot use null as its literal default. Make the field nullable or use a non-null default.`,
1355
1393
  ...source.at()
1356
1394
  });
1357
1395
  return {};
@@ -1367,7 +1405,7 @@ function lowerDefaultForField(input) {
1367
1405
  elements: value.elements,
1368
1406
  source
1369
1407
  })) return {};
1370
- const readsListElements = (written) => input.isListColumn || input.field.list && written.kind === "list";
1408
+ const readsListElements = (written) => input.isListColumn || input.owner.list && written.kind === "list";
1371
1409
  const readAsLiteral = (written, spans, sourceElementIndexes) => {
1372
1410
  const lowered = lowerDataTypeDefault({
1373
1411
  written,
@@ -1380,7 +1418,7 @@ function lowerDefaultForField(input) {
1380
1418
  },
1381
1419
  codecLookup: input.codecLookup,
1382
1420
  dataTypes: input.dataTypes,
1383
- fieldPath: `${input.modelName}.${input.fieldName}`
1421
+ subject
1384
1422
  });
1385
1423
  if (!lowered.ok) {
1386
1424
  input.diagnostics.push({
@@ -1404,11 +1442,11 @@ function lowerDefaultForField(input) {
1404
1442
  codecLookup: input.codecLookup
1405
1443
  });
1406
1444
  const mismatches = valueObjectDefaultMismatches({
1407
- fieldPath: `${input.modelName}.${input.fieldName}`,
1445
+ fieldPath: input.owner.specContext.subject.name,
1408
1446
  value: document,
1409
- list: input.field.list,
1410
- nullable: input.field.optional,
1411
- elementNullable: input.field.elementOptional,
1447
+ list: input.owner.list,
1448
+ nullable: input.owner.optional,
1449
+ elementNullable: input.owner.elementOptional,
1412
1450
  ...input.valueObjectDefault,
1413
1451
  lookups: {
1414
1452
  codecLookup: input.codecLookup,
@@ -1510,8 +1548,7 @@ function lowerDefaultForField(input) {
1510
1548
  const { call } = value;
1511
1549
  const context = {
1512
1550
  sourceId: input.sources.sourceFileFor(node.syntax).filename,
1513
- modelName: input.modelName,
1514
- fieldName: input.fieldName,
1551
+ ...input.owner.loweringNames,
1515
1552
  columnCodecId: input.columnDescriptor.codecId
1516
1553
  };
1517
1554
  const lowered = lowerDefaultFunctionWithRegistry({
@@ -1530,34 +1567,32 @@ function lowerDefaultForField(input) {
1530
1567
  const GENERATOR_PHASES = ["onCreate", "onUpdate"];
1531
1568
  /** The generators a field's `@onCreate(fn())` and `@onUpdate(fn())` resolve to for its column, or `undefined` for a field with neither. */
1532
1569
  function lowerGeneratorAttributesForField(input) {
1533
- const specContext = fieldSpecContext({
1534
- symbols: input.symbolTable,
1535
- model: input.model,
1536
- field: input.field,
1537
- binder: input.binder,
1538
- defaultFunctionRegistry: input.defaultFunctionRegistry,
1539
- generatorFunctions: input.generatorFunctions,
1540
- dataTypes: input.dataTypes
1570
+ return lowerTypeGenerators({
1571
+ ...input,
1572
+ owner: fieldAttributeOwner(input)
1541
1573
  });
1574
+ }
1575
+ /** The generators the `@onCreate(fn())` and `@onUpdate(fn())` of a field or type alias resolve to for its column, or `undefined` when it has neither. */
1576
+ function lowerTypeGenerators(input) {
1577
+ const { subject } = input.owner.specContext;
1578
+ const label = typeAttributeSubjectLabel(subject);
1542
1579
  const phases = {};
1543
1580
  for (const phase of GENERATOR_PHASES) {
1544
- const [attribute, duplicate] = input.field.attributes.filter(({ name }) => name === phase);
1581
+ const [attribute, duplicate] = input.owner.attributes.filter(({ name }) => name === phase);
1545
1582
  if (attribute === void 0) continue;
1546
1583
  if (duplicate !== void 0) {
1547
1584
  input.diagnostics.push({
1548
1585
  code: "PSL_DUPLICATE_ATTRIBUTE",
1549
- message: `\`@${phase}\` declared more than once on field "${input.modelName}.${input.fieldName}".`,
1586
+ message: `\`@${phase}\` declared more than once on ${subject.kind} "${subject.name}".`,
1550
1587
  ...diagnosticSource(input.sources, duplicate.node.syntax).at(duplicate.span)
1551
1588
  });
1552
1589
  continue;
1553
1590
  }
1554
1591
  const node = attribute.node;
1555
- const interpreted = interpretFieldAttribute({
1592
+ const interpreted = interpretTypeAttribute({
1556
1593
  symbols: input.symbolTable,
1557
1594
  node,
1558
- spec: sqlAttributeSpecs.field[phase](specContext),
1559
- model: input.model,
1560
- field: input.field,
1595
+ spec: typeGeneratorAttributeSpec(phase, input.owner.specContext),
1561
1596
  sources: input.sources,
1562
1597
  binder: input.binder,
1563
1598
  diagnostics: input.diagnostics
@@ -1578,31 +1613,22 @@ function lowerGeneratorAttributesForField(input) {
1578
1613
  }
1579
1614
  input.diagnostics.push({
1580
1615
  code: "PSL_GENERATOR_NOT_APPLICABLE",
1581
- message: resolution.reason === "refused" ? `Field "${input.modelName}.${input.fieldName}": ${resolution.message}` : `Field "${input.modelName}.${input.fieldName}": ${call.fn}() does not apply to codec "${input.columnDescriptor.codecId}".`,
1616
+ message: resolution.reason === "refused" ? `${label}: ${resolution.message}` : `${label}: ${call.fn}() does not apply to codec "${input.columnDescriptor.codecId}".`,
1582
1617
  ...diagnosticSource(input.sources, node.syntax).at(call.span)
1583
1618
  });
1584
1619
  }
1585
1620
  return phases.onCreate === void 0 && phases.onUpdate === void 0 ? void 0 : phases;
1586
1621
  }
1587
- function lowerEnumDefaultForField(input) {
1588
- const { field, model, enumHandle, diagnostics } = input;
1589
- const node = getAttribute(field.attributes, "default")?.node;
1622
+ /** The default a field's or type alias's `@default(...)` names among the members of its enum. */
1623
+ function lowerEnumDefault(input) {
1624
+ const { owner, enumHandle, diagnostics } = input;
1625
+ const node = getAttribute(owner.attributes, "default")?.node;
1590
1626
  if (node === void 0) return {};
1591
1627
  if (enumHandle.enumMembers.length === 0) return {};
1592
- const interpreted = interpretFieldAttribute({
1628
+ const interpreted = interpretTypeAttribute({
1593
1629
  node,
1594
- spec: sqlAttributeSpecs.field.default(fieldSpecContext({
1595
- symbols: input.symbolTable,
1596
- model,
1597
- field,
1598
- binder: input.binder,
1599
- defaultFunctionRegistry: input.defaultFunctionRegistry,
1600
- generatorFunctions: input.generatorFunctions,
1601
- dataTypes: input.dataTypes
1602
- })),
1630
+ spec: typeDefaultSpec(owner.specContext),
1603
1631
  symbols: input.symbolTable,
1604
- model,
1605
- field,
1606
1632
  sources: input.sources,
1607
1633
  binder: input.binder,
1608
1634
  diagnostics
@@ -1611,9 +1637,10 @@ function lowerEnumDefaultForField(input) {
1611
1637
  const member = interpreted.value;
1612
1638
  if (member.kind === "member-list") {
1613
1639
  if (rejectStrictListNullDefault({
1614
- ...input,
1640
+ owner,
1615
1641
  elements: member.elements,
1616
- source: diagnosticSource(input.sources, node.syntax)
1642
+ source: diagnosticSource(input.sources, node.syntax),
1643
+ diagnostics
1617
1644
  })) return {};
1618
1645
  return { defaultValue: {
1619
1646
  kind: "literal",
@@ -1634,7 +1661,7 @@ function modelCoordinateKey(namespaceId, modelName) {
1634
1661
  }
1635
1662
  const GENERATOR_ATTRIBUTE_NAMES = ["onCreate", "onUpdate"];
1636
1663
  const REMOVED_ATTRIBUTE_RULES = /* @__PURE__ */ new Map([["updatedAt", {
1637
- hint: "Use @onCreate(now()) @onUpdate(now()) instead.",
1664
+ hint: "Use @onCreate(now()) @onUpdate(now()), or type the field temporal.UpdatedAt.",
1638
1665
  suppressWhen: (field) => field.attributes.some((attribute) => attribute.name === "onUpdate")
1639
1666
  }]]);
1640
1667
  {
@@ -1701,7 +1728,7 @@ function extractFieldConstraintNames(input) {
1701
1728
  };
1702
1729
  }
1703
1730
  function collectResolvedFields(input) {
1704
- const { model, symbolTable, enumTypeDescriptors, namedTypeDescriptors, valueObjectTypes, authoringContributions, binder, targetId, defaultFunctionRegistry, generatorFunctions, dataTypes, diagnostics, sources, scalarColumnDescriptors, enumHandles, capabilities, namespaceId, namespaceExtensionEntities, codecLookup } = input;
1731
+ const { model, symbolTable, enumTypeDescriptors, typeAliases, valueObjectTypes, authoringContributions, binder, targetId, defaultFunctionRegistry, generatorFunctions, dataTypes, diagnostics, sources, scalarColumnDescriptors, enumHandles, capabilities, namespaceId, namespaceExtensionEntities, codecLookup } = input;
1705
1732
  const resolvedFields = [];
1706
1733
  const valueObjectStorageTypeName = authoringContributions?.valueObjectStorageType;
1707
1734
  for (const field of Object.values(model.fields)) {
@@ -1727,7 +1754,7 @@ function collectResolvedFields(input) {
1727
1754
  field,
1728
1755
  resolution: fieldTypeResolution,
1729
1756
  enumTypeDescriptors,
1730
- namedTypeDescriptors,
1757
+ typeAliases,
1731
1758
  diagnostics,
1732
1759
  sources,
1733
1760
  entityLabel: `Field "${model.name}.${field.name}"`,
@@ -1783,6 +1810,14 @@ function collectResolvedFields(input) {
1783
1810
  });
1784
1811
  continue;
1785
1812
  }
1813
+ const typeAlias = typeAliases.ofResolution(fieldTypeResolution);
1814
+ if (typeAlias !== void 0) refuseRepeatedTypeAliasAttributes({
1815
+ field,
1816
+ fieldPath: `${model.name}.${field.name}`,
1817
+ alias: typeAlias.alias,
1818
+ sources,
1819
+ diagnostics
1820
+ });
1786
1821
  const defaultAttribute = getAttribute(field.attributes, "default");
1787
1822
  if (presetContributions?.default && defaultAttribute) {
1788
1823
  diagnostics.push({
@@ -1792,8 +1827,8 @@ function collectResolvedFields(input) {
1792
1827
  });
1793
1828
  continue;
1794
1829
  }
1795
- const enumHandle = fieldTypeResolution?.kind === "block" ? enumHandles.get(fieldTypeResolution.symbol) : void 0;
1796
- const loweredDefault = defaultAttribute ? enumHandle ? lowerEnumDefaultForField({
1830
+ const enumHandle = fieldTypeResolution?.kind === "block" ? enumHandles.get(fieldTypeResolution.symbol) : typeAlias?.enumHandle;
1831
+ const fieldLowering = {
1797
1832
  modelName: model.name,
1798
1833
  fieldName: field.name,
1799
1834
  field,
@@ -1801,47 +1836,40 @@ function collectResolvedFields(input) {
1801
1836
  symbolTable,
1802
1837
  sources: input.sources,
1803
1838
  binder: input.binder,
1804
- enumHandle,
1805
1839
  defaultFunctionRegistry,
1806
1840
  generatorFunctions,
1807
1841
  dataTypes,
1808
1842
  diagnostics
1843
+ };
1844
+ const ownDefault = defaultAttribute ? enumHandle ? lowerEnumDefault({
1845
+ ...fieldLowering,
1846
+ owner: fieldAttributeOwner(fieldLowering),
1847
+ enumHandle
1809
1848
  }) : lowerDefaultForField({
1810
- modelName: model.name,
1811
- fieldName: field.name,
1812
- field,
1813
- model,
1814
- symbolTable,
1815
- sources: input.sources,
1816
- binder: input.binder,
1849
+ ...fieldLowering,
1817
1850
  columnDescriptor: descriptor,
1818
- columnTypeParams: resolvedTypeParams(descriptor, input.namedTypes),
1851
+ columnTypeParams: descriptor.typeParams,
1819
1852
  isListColumn,
1820
1853
  valueObjectDefault: valueObjectName === void 0 ? void 0 : {
1821
1854
  valueObjectName,
1822
1855
  types: valueObjectTypes
1823
1856
  },
1824
- defaultFunctionRegistry,
1825
- generatorFunctions,
1826
- dataTypes,
1827
- codecLookup,
1828
- diagnostics
1857
+ codecLookup
1829
1858
  }) : {};
1830
- const generatedValues = lowerGeneratorAttributesForField({
1831
- modelName: model.name,
1832
- fieldName: field.name,
1833
- field,
1834
- model,
1835
- symbolTable,
1836
- sources: input.sources,
1837
- binder: input.binder,
1859
+ if (isListField && typeAlias?.defaultValue !== void 0) {
1860
+ diagnostics.push({
1861
+ code: "PSL_DEFAULT_LIST_EXPECTED",
1862
+ message: `Field "${model.name}.${field.name}" is a list, but its type alias "${typeAlias.name}" sets @default for a single value. Remove "[]" or the @default of the alias.`,
1863
+ ...source.at(field.span)
1864
+ });
1865
+ continue;
1866
+ }
1867
+ const loweredDefault = { ...ifDefined("defaultValue", typeAlias?.defaultValue ?? ownDefault.defaultValue) };
1868
+ const generatedValues = mergeExecutionDefaults(lowerGeneratorAttributesForField({
1869
+ ...fieldLowering,
1838
1870
  columnDescriptor: descriptor,
1839
- columnTypeParams: resolvedTypeParams(descriptor, input.namedTypes),
1840
- defaultFunctionRegistry,
1841
- generatorFunctions,
1842
- dataTypes,
1843
- diagnostics
1844
- });
1871
+ columnTypeParams: descriptor.typeParams
1872
+ }), typeAlias?.executionDefaults);
1845
1873
  if (isListField && loweredDefault.defaultValue?.kind === "function" && loweredDefault.defaultValue.expression === "autoincrement()") {
1846
1874
  diagnostics.push({
1847
1875
  code: "PSL_LIST_AUTOINCREMENT_UNSUPPORTED",
@@ -1850,13 +1878,15 @@ function collectResolvedFields(input) {
1850
1878
  });
1851
1879
  continue;
1852
1880
  }
1853
- const generatorAttribute = GENERATOR_ATTRIBUTE_NAMES.map((name) => getAttribute(field.attributes, name)).find((attribute) => attribute !== void 0);
1854
- if (isListField && generatorAttribute !== void 0 && generatedValues !== void 0) {
1855
- const argument = generatorAttribute.args.find((arg) => arg.kind === "positional")?.value.trim() ?? "";
1881
+ const ownGeneratorAttribute = GENERATOR_ATTRIBUTE_NAMES.map((name) => getAttribute(field.attributes, name)).find((attribute) => attribute !== void 0);
1882
+ if (isListField && generatedValues !== void 0) {
1883
+ const fieldLabel = `Field "${model.name}.${field.name}"`;
1884
+ const perElement = "Lists have no per-element generated values;";
1885
+ const call = ownGeneratorAttribute?.args.find((arg) => arg.kind === "positional")?.value.trim() ?? "";
1856
1886
  diagnostics.push({
1857
1887
  code: "PSL_LIST_EXECUTION_DEFAULT_UNSUPPORTED",
1858
- message: `Field "${model.name}.${field.name}" is a list and cannot use @${generatorAttribute.name}(${argument}). Lists have no per-element generated values; remove @${generatorAttribute.name}(...).`,
1859
- ...source.at(generatorAttribute.span)
1888
+ message: ownGeneratorAttribute === void 0 ? `${fieldLabel} is a list, and its type alias "${typeAlias?.name}" generates a value. ${perElement} remove "[]" or type the field without the alias.` : `${fieldLabel} is a list and cannot use @${ownGeneratorAttribute.name}(${call}). ${perElement} remove @${ownGeneratorAttribute.name}(...).`,
1889
+ ...source.at(ownGeneratorAttribute?.span ?? field.span)
1860
1890
  });
1861
1891
  continue;
1862
1892
  }
@@ -1943,6 +1973,6 @@ function mergeExecutionDefaults(fromAttributes, fromPreset) {
1943
1973
  };
1944
1974
  }
1945
1975
  //#endregion
1946
- export { readDataTypeDefault as _, defaultFunctionCall as a, sqlAttributeSpecs as b, getAuthoringEntity as c, interpretFieldAttribute as d, interpretModelAttribute as f, modelSpecContext as g, modelCoordinateKey as h, contractError as i, instantiateFieldTypeConstructor as l, modelAttributeSpecsFrom as m, bareTypeConstructorOf as n, describeUnsupportedSqlAttribute as o, lowerDataTypeDefault as p, collectResolvedFields as r, fieldSpecContext as s, PSL_CHECK_ON_STI_VARIANT as t, instantiatePslTypeConstructor as u, readWrittenValueForCodec as v, toNamedTypeFieldDescriptor as x, resolveFieldTypeDescriptor as y };
1976
+ export { sqlAttributeSpecs as S, modelCoordinateKey as _, describeUnsupportedSqlAttribute as a, readWrittenValueForCodec as b, instantiateFieldTypeConstructor as c, interpretModelAttribute as d, lowerDataTypeDefault as f, modelAttributeSpecsFrom as g, lowerTypeGenerators as h, defaultFunctionCall as i, instantiatePslTypeConstructor as l, lowerTypeDefault as m, collectResolvedFields as n, fieldSpecContext as o, lowerEnumDefault as p, contractError as r, getAuthoringEntity as s, PSL_CHECK_ON_STI_VARIANT as t, interpretFieldAttribute as u, modelSpecContext as v, resolveFieldTypeDescriptor as x, readDataTypeDefault as y };
1947
1977
 
1948
- //# sourceMappingURL=psl-field-resolution-DpGsATq3-BREG9FbU.mjs.map
1978
+ //# sourceMappingURL=psl-field-resolution-C9zwpsAu-DCc7Eifv.mjs.map