@prisma/orm-target-postgres 8.0.0-rc.18-dev.30 → 8.0.0-rc.18-dev.32

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 (199) hide show
  1. package/dist/{adapter-vfsQ80l6.d.mts → adapter-BAR5FNt5.d.mts} +2 -2
  2. package/dist/{adapter-vfsQ80l6.d.mts.map → adapter-BAR5FNt5.d.mts.map} +1 -1
  3. package/dist/{adapter-BkfuSVLm-DmjWB5c9.mjs → adapter-BLduF4bR-LPL0DsEe.mjs} +6 -6
  4. package/dist/{adapter-BkfuSVLm-DmjWB5c9.mjs.map → adapter-BLduF4bR-LPL0DsEe.mjs.map} +1 -1
  5. package/dist/adapter.d.mts +6 -6
  6. package/dist/adapter.mjs +6 -6
  7. package/dist/adapter__adapter.d.mts +1 -1
  8. package/dist/adapter__adapter.mjs +2 -2
  9. package/dist/adapter__column-types.d.mts +2 -2
  10. package/dist/adapter__column-types.mjs +2 -2
  11. package/dist/adapter__control.d.mts +2 -2
  12. package/dist/adapter__control.mjs +4 -4
  13. package/dist/adapter__control.mjs.map +1 -1
  14. package/dist/adapter__runtime.mjs +4 -4
  15. package/dist/adapter__runtime.mjs.map +1 -1
  16. package/dist/adapter__sql-renderer.mjs +1 -1
  17. package/dist/adapter__types.d.mts +2 -2
  18. package/dist/{aggregates-DHIDeR2f.mjs → aggregates-C7KEByGU.mjs} +2 -2
  19. package/dist/{aggregates-DHIDeR2f.mjs.map → aggregates-C7KEByGU.mjs.map} +1 -1
  20. package/dist/{authoring-DtjMn8TZ-sv84Cdw_.mjs → authoring-CArQ0ZSb-BXqyKMTu.mjs} +6 -6
  21. package/dist/{authoring-DtjMn8TZ-sv84Cdw_.mjs.map → authoring-CArQ0ZSb-BXqyKMTu.mjs.map} +1 -1
  22. package/dist/{autoincrement-widths-1v9UfTSw-NFaqRGCV.mjs → autoincrement-widths-BeDdQuMU-CFDf2ypW.mjs} +3 -3
  23. package/dist/{autoincrement-widths-1v9UfTSw-NFaqRGCV.mjs.map → autoincrement-widths-BeDdQuMU-CFDf2ypW.mjs.map} +1 -1
  24. package/dist/{codec-ids-Cb0yO-IS--e0P2rfI.mjs → codec-ids-BMhEpFwv-BLIC4g3Y.mjs} +4 -4
  25. package/dist/codec-ids-BMhEpFwv-BLIC4g3Y.mjs.map +1 -0
  26. package/dist/codec-ids-C2HurNhZ.d.mts +1 -0
  27. package/dist/{codec-ids-jWpRZjZo-BKIzyx-J.d.mts → codec-ids-C6II64Wy-CCU5G6CU.d.mts} +4 -4
  28. package/dist/{codec-ids-jWpRZjZo-BKIzyx-J.d.mts.map → codec-ids-C6II64Wy-CCU5G6CU.d.mts.map} +1 -1
  29. package/dist/{codec-registry-T79ktJL4-B9_zlIhI.mjs → codec-registry-C8ymMRsH-B48NRqXL.mjs} +4 -4
  30. package/dist/{codec-registry-T79ktJL4-B9_zlIhI.mjs.map → codec-registry-C8ymMRsH-B48NRqXL.mjs.map} +1 -1
  31. package/dist/{codec-type-map-ulrHZjWI-DMkq8jy2.d.mts → codec-type-map-DiWClTtc-CUWQbVA0.d.mts} +4 -3
  32. package/dist/{codec-type-map-ulrHZjWI-DMkq8jy2.d.mts.map → codec-type-map-DiWClTtc-CUWQbVA0.d.mts.map} +1 -1
  33. package/dist/codec-types-CXL3_pbl.d.mts +2 -0
  34. package/dist/{codec-types-DX-72F9v-CORaQjWv.d.mts → codec-types-yRnVORmz-C5oISm2L.d.mts} +4 -4
  35. package/dist/{codec-types-DX-72F9v-CORaQjWv.d.mts.map → codec-types-yRnVORmz-C5oISm2L.d.mts.map} +1 -1
  36. package/dist/{codecs-UZ1NEbvk-CMnI6Ti0.mjs → codecs-DNjF5kIh-BkybYk_D.mjs} +23 -6
  37. package/dist/codecs-DNjF5kIh-BkybYk_D.mjs.map +1 -0
  38. package/dist/{codecs-ByHL7NZ0-B_903MRF.d.mts → codecs-DgslvOOU-eZpfm_fU.d.mts} +3 -3
  39. package/dist/{codecs-ByHL7NZ0-B_903MRF.d.mts.map → codecs-DgslvOOU-eZpfm_fU.d.mts.map} +1 -1
  40. package/dist/{codecs-J4SSxTf4.d.mts → codecs-DydRFxCt.d.mts} +2 -2
  41. package/dist/{codecs-J4SSxTf4.d.mts.map → codecs-DydRFxCt.d.mts.map} +1 -1
  42. package/dist/{column-types-Bbc3IVA7.mjs → column-types-5nUQfQFq.mjs} +10 -3
  43. package/dist/column-types-5nUQfQFq.mjs.map +1 -0
  44. package/dist/{column-types-COdejX_b.d.mts → column-types-D4U5xGjS.d.mts} +10 -4
  45. package/dist/column-types-D4U5xGjS.d.mts.map +1 -0
  46. package/dist/{contract-contributions-CQqafzSC-DrMFSSO4.mjs → contract-contributions-CRCEK7Dx-Dx2tYlyZ.mjs} +9 -9
  47. package/dist/{contract-contributions-CQqafzSC-DrMFSSO4.mjs.map → contract-contributions-CRCEK7Dx-Dx2tYlyZ.mjs.map} +1 -1
  48. package/dist/{contract-free-Kwm74Hg9.mjs → contract-free-CN4hGOBI.mjs} +4 -4
  49. package/dist/{contract-free-Kwm74Hg9.mjs.map → contract-free-CN4hGOBI.mjs.map} +1 -1
  50. package/dist/{control-vBNwKZ7Q.d.mts → control-R69irs57.d.mts} +2 -2
  51. package/dist/{control-vBNwKZ7Q.d.mts.map → control-R69irs57.d.mts.map} +1 -1
  52. package/dist/{control-policy-BHjZnca1-DUWuKmdJ.mjs → control-policy-B10lrdMt-CHUsNZat.mjs} +11 -9
  53. package/dist/control-policy-B10lrdMt-CHUsNZat.mjs.map +1 -0
  54. package/dist/{data-type-entries-CqnLlCkK-uN0WjREd.mjs → data-type-entries-EroSxeag-Ba-K5snn.mjs} +3 -3
  55. package/dist/{data-type-entries-CqnLlCkK-uN0WjREd.mjs.map → data-type-entries-EroSxeag-Ba-K5snn.mjs.map} +1 -1
  56. package/dist/{data-types-Cs-LkJBw-CJN57Y5M.mjs → data-types-DhBM9bIL-CVDQGAGw.mjs} +5 -4
  57. package/dist/data-types-DhBM9bIL-CVDQGAGw.mjs.map +1 -0
  58. package/dist/{ddl-2L13tYjC-enYPQJnG.mjs → ddl-BrIDeRCe-ojLIc02T.mjs} +4 -4
  59. package/dist/{ddl-2L13tYjC-enYPQJnG.mjs.map → ddl-BrIDeRCe-ojLIc02T.mjs.map} +1 -1
  60. package/dist/{descriptor-meta-C0yUaYLH-CUtYbbZp.mjs → descriptor-meta-9qCQPbrI-DFEFmwBv.mjs} +8 -8
  61. package/dist/{descriptor-meta-C0yUaYLH-CUtYbbZp.mjs.map → descriptor-meta-9qCQPbrI-DFEFmwBv.mjs.map} +1 -1
  62. package/dist/{descriptor-meta-DDh7-s6c-D6qC3SDx.mjs → descriptor-meta-Cb7RcgEQ-CwwQ6QE8.mjs} +4 -4
  63. package/dist/{descriptor-meta-DDh7-s6c-D6qC3SDx.mjs.map → descriptor-meta-Cb7RcgEQ-CwwQ6QE8.mjs.map} +1 -1
  64. package/dist/{descriptor-meta-runtime-C1AjrKaP-CYer0qt7.mjs → descriptor-meta-runtime-C56qYaOz-hfOBfhVz.mjs} +3 -3
  65. package/dist/{descriptor-meta-runtime-C1AjrKaP-CYer0qt7.mjs.map → descriptor-meta-runtime-C56qYaOz-hfOBfhVz.mjs.map} +1 -1
  66. package/dist/{diff-database-schema-DyCIRT80-C1zMCmRx.mjs → diff-database-schema-CmWmomi3-PoUser3Y.mjs} +5 -5
  67. package/dist/{diff-database-schema-DyCIRT80-C1zMCmRx.mjs.map → diff-database-schema-CmWmomi3-PoUser3Y.mjs.map} +1 -1
  68. package/dist/{full-text-CSMAiOYz.mjs → full-text-8PmilGkW.mjs} +2 -2
  69. package/dist/{full-text-CSMAiOYz.mjs.map → full-text-8PmilGkW.mjs.map} +1 -1
  70. package/dist/{full-text-OAJrtCtv.d.mts → full-text-OgRqBeQu.d.mts} +3 -3
  71. package/dist/{full-text-OAJrtCtv.d.mts.map → full-text-OgRqBeQu.d.mts.map} +1 -1
  72. package/dist/{full-text-collection-method-BIqQH9XN-CkW2x4u2.d.mts → full-text-collection-method-DWbpg-Ep-DDs6t_BB.d.mts} +4 -4
  73. package/dist/full-text-collection-method-DWbpg-Ep-DDs6t_BB.d.mts.map +1 -0
  74. package/dist/{full-text-parsers-CrMjTR2n-CHDNR_vE.mjs → full-text-parsers-CFFxiOrp-BmiwdZ21.mjs} +3 -3
  75. package/dist/{full-text-parsers-CrMjTR2n-CHDNR_vE.mjs.map → full-text-parsers-CFFxiOrp-BmiwdZ21.mjs.map} +1 -1
  76. package/dist/{indexes-BX4ewz3l-CPzMc0-t.d.mts → indexes-CvNRG0Xu-C8OjTa0S.d.mts} +3 -3
  77. package/dist/{indexes-BX4ewz3l-CPzMc0-t.d.mts.map → indexes-CvNRG0Xu-C8OjTa0S.d.mts.map} +1 -1
  78. package/dist/{issue-planner-BT5rqDNx.d.mts → issue-planner-CAxHx3OH.d.mts} +2 -2
  79. package/dist/{issue-planner-BT5rqDNx.d.mts.map → issue-planner-CAxHx3OH.d.mts.map} +1 -1
  80. package/dist/migration-CbOh59ZJ.mjs.map +1 -1
  81. package/dist/{migration-BWZskUHP.d.mts → migration-DbAx8skF.d.mts} +3 -3
  82. package/dist/{migration-BWZskUHP.d.mts.map → migration-DbAx8skF.d.mts.map} +1 -1
  83. package/dist/{native-type-normalizer-a1XJSlk6.mjs → native-type-normalizer-eX3KyHPA.mjs} +2 -2
  84. package/dist/{native-type-normalizer-a1XJSlk6.mjs.map → native-type-normalizer-eX3KyHPA.mjs.map} +1 -1
  85. package/dist/{op-factory-call-No9Z2tdw-Lap8xvVy.mjs → op-factory-call-35RJQ1ME-BFxUakDe.mjs} +10 -6
  86. package/dist/op-factory-call-35RJQ1ME-BFxUakDe.mjs.map +1 -0
  87. package/dist/op-factory-call-BRHT7R1s.d.mts +1 -0
  88. package/dist/{op-factory-call-DILl2zlf-BakJezLJ.d.mts → op-factory-call-DghB0ndC-9CDIMLTM.d.mts} +7 -4
  89. package/dist/op-factory-call-DghB0ndC-9CDIMLTM.d.mts.map +1 -0
  90. package/dist/operation-types-DeGKVV0-.d.mts +1 -0
  91. package/dist/{operation-types-CK6URXeD-BsCK-mcK.d.mts → operation-types-RXpAlUCj-9eC1wX5R.d.mts} +4 -4
  92. package/dist/{operation-types-CK6URXeD-BsCK-mcK.d.mts.map → operation-types-RXpAlUCj-9eC1wX5R.d.mts.map} +1 -1
  93. package/dist/{pack-C-rgdVoH.d.mts → pack-XQaG7LAo.d.mts} +5 -5
  94. package/dist/{pack-C-rgdVoH.d.mts.map → pack-XQaG7LAo.d.mts.map} +1 -1
  95. package/dist/{planner-Bo92I5YX.d.mts → planner-DVwj2GUS.d.mts} +2 -2
  96. package/dist/{planner-Bo92I5YX.d.mts.map → planner-DVwj2GUS.d.mts.map} +1 -1
  97. package/dist/{planner-ddl-builders-B8PhQZ2T-D1KBJxcS.mjs → planner-ddl-builders-DujKuwcn-C0VYScBe.mjs} +3 -3
  98. package/dist/{planner-ddl-builders-B8PhQZ2T-D1KBJxcS.mjs.map → planner-ddl-builders-DujKuwcn-C0VYScBe.mjs.map} +1 -1
  99. package/dist/{planner-identity-values-BnxSwhlS-CzyBeK0a.mjs → planner-identity-values-Vbk2SkMl-8xDzcTpo.mjs} +3 -3
  100. package/dist/{planner-identity-values-BnxSwhlS-CzyBeK0a.mjs.map → planner-identity-values-Vbk2SkMl-8xDzcTpo.mjs.map} +1 -1
  101. package/dist/{planner-BIOXTf-E-CFs_l_0M.mjs → planner-olDFDn2v-Bh0e16rN.mjs} +9 -9
  102. package/dist/{planner-BIOXTf-E-CFs_l_0M.mjs.map → planner-olDFDn2v-Bh0e16rN.mjs.map} +1 -1
  103. package/dist/{planner-produced-postgres-migration-Y7bMLPPc-tZeIl3hP.mjs → planner-produced-postgres-migration-BVsfYarL-C9BdUXeX.mjs} +4 -4
  104. package/dist/{planner-produced-postgres-migration-Y7bMLPPc-tZeIl3hP.mjs.map → planner-produced-postgres-migration-BVsfYarL-C9BdUXeX.mjs.map} +1 -1
  105. package/dist/planner-produced-postgres-migration-BtS3h1R7.d.mts +1 -0
  106. package/dist/{planner-produced-postgres-migration-C8uYGzUj-DRmZY4_u.d.mts → planner-produced-postgres-migration-DNnxAU-R-CSPyb9D_.d.mts} +3 -3
  107. package/dist/planner-produced-postgres-migration-DNnxAU-R-CSPyb9D_.d.mts.map +1 -0
  108. package/dist/{planner-sql-checks-pkURMYMz-2QAIKyW-.mjs → planner-sql-checks-BluJBZmQ-ClqyqOhD.mjs} +19 -7
  109. package/dist/planner-sql-checks-BluJBZmQ-ClqyqOhD.mjs.map +1 -0
  110. package/dist/{planner-sql-checks-CWOmxltY-CoWF8Eq0.d.mts → planner-sql-checks-Ed-WGtge-Clnvg-zp.d.mts} +4 -4
  111. package/dist/planner-sql-checks-Ed-WGtge-Clnvg-zp.d.mts.map +1 -0
  112. package/dist/planner-sql-checks-K_EFdkCw.d.mts +1 -0
  113. package/dist/{postgres-codec-traits-D3muwxMS-OwnBG0Mz.mjs → postgres-codec-traits-DM3rkou1-AyAbELmA.mjs} +3 -3
  114. package/dist/{postgres-codec-traits-D3muwxMS-OwnBG0Mz.mjs.map → postgres-codec-traits-DM3rkou1-AyAbELmA.mjs.map} +1 -1
  115. package/dist/{postgres-contract-view-Ctg2ire_-smoqnU-u.mjs → postgres-contract-view-xyfQHZ29-HOrk9af1.mjs} +8 -8
  116. package/dist/{postgres-contract-view-Ctg2ire_-smoqnU-u.mjs.map → postgres-contract-view-xyfQHZ29-HOrk9af1.mjs.map} +1 -1
  117. package/dist/{postgres-migration-HW4fCGNb-CLkytGtG.d.mts → postgres-migration-8BDn8Wja-D9tHQGWg.d.mts} +5 -3
  118. package/dist/{postgres-migration-HW4fCGNb-CLkytGtG.d.mts.map → postgres-migration-8BDn8Wja-D9tHQGWg.d.mts.map} +1 -1
  119. package/dist/{postgres-migration-BdFXT6xg-BPApPGX9.mjs → postgres-migration-fZk6Dmud-BjRqdGdm.mjs} +11 -10
  120. package/dist/{postgres-migration-BdFXT6xg-BPApPGX9.mjs.map → postgres-migration-fZk6Dmud-BjRqdGdm.mjs.map} +1 -1
  121. package/dist/{postgres-schema-DyUXtYIT-vb-RxpRN.mjs → postgres-schema-C6w1rzOF-bzaF5PIS.mjs} +3 -3
  122. package/dist/{postgres-schema-DyUXtYIT-vb-RxpRN.mjs.map → postgres-schema-C6w1rzOF-bzaF5PIS.mjs.map} +1 -1
  123. package/dist/{prisma7-binding-BXyT6bKE.d.mts → prisma7-binding-ChOxdhPc.d.mts} +5 -5
  124. package/dist/{prisma7-binding-BXyT6bKE.d.mts.map → prisma7-binding-ChOxdhPc.d.mts.map} +1 -1
  125. package/dist/{prisma7-binding-DWeHpJrg.mjs → prisma7-binding-Dfb3osBy.mjs} +7 -7
  126. package/dist/{prisma7-binding-DWeHpJrg.mjs.map → prisma7-binding-Dfb3osBy.mjs.map} +1 -1
  127. package/dist/{render-ops-MeXLgeOa-nL4PdJzz.mjs → render-ops-DkBRaS0Z-BtGb58iC.mjs} +3 -3
  128. package/dist/{render-ops-MeXLgeOa-nL4PdJzz.mjs.map → render-ops-DkBRaS0Z-BtGb58iC.mjs.map} +1 -1
  129. package/dist/{resolve-ddl-schema-IdPEiyLX-BZGpy8Wz.mjs → resolve-ddl-schema-D3VNPMSm-DVuswLch.mjs} +3 -3
  130. package/dist/{resolve-ddl-schema-IdPEiyLX-BZGpy8Wz.mjs.map → resolve-ddl-schema-D3VNPMSm-DVuswLch.mjs.map} +1 -1
  131. package/dist/{runtime-BeTyqpCH.d.mts → runtime-ONyptFAN.d.mts} +2 -2
  132. package/dist/{runtime-BeTyqpCH.d.mts.map → runtime-ONyptFAN.d.mts.map} +1 -1
  133. package/dist/{sql-renderer-CD5aYQos-1hGCWT0S.mjs → sql-renderer-BdWJPa5F-DqJ5nUgt.mjs} +9 -6
  134. package/dist/sql-renderer-BdWJPa5F-DqJ5nUgt.mjs.map +1 -0
  135. package/dist/target.d.mts +24 -24
  136. package/dist/target.mjs +29 -29
  137. package/dist/target__aggregates.mjs +1 -1
  138. package/dist/target__codec-ids.d.mts +3 -3
  139. package/dist/target__codec-ids.mjs +2 -2
  140. package/dist/target__codec-types.d.mts +3 -3
  141. package/dist/target__codecs.d.mts +2 -2
  142. package/dist/target__codecs.mjs +2 -2
  143. package/dist/target__contract-free.mjs +3 -3
  144. package/dist/target__control.mjs +11 -11
  145. package/dist/target__control.mjs.map +1 -1
  146. package/dist/target__data-types.mjs +2 -2
  147. package/dist/target__diff-database-schema.mjs +1 -1
  148. package/dist/target__full-text-index-authoring.mjs +1 -1
  149. package/dist/target__full-text.d.mts +3 -3
  150. package/dist/target__full-text.mjs +2 -2
  151. package/dist/target__issue-planner.d.mts +1 -1
  152. package/dist/target__issue-planner.mjs +1 -1
  153. package/dist/target__migration.d.mts +2 -2
  154. package/dist/target__migration.mjs +2 -2
  155. package/dist/target__native-type-normalizer.mjs +1 -1
  156. package/dist/target__op-factory-call.d.mts +2 -2
  157. package/dist/target__op-factory-call.mjs +1 -1
  158. package/dist/target__operation-types.d.mts +2 -2
  159. package/dist/target__pack.d.mts +2 -2
  160. package/dist/target__pack.mjs +1 -1
  161. package/dist/target__planner-ddl-builders.mjs +1 -1
  162. package/dist/target__planner-identity-values.mjs +1 -1
  163. package/dist/target__planner-produced-postgres-migration.d.mts +2 -2
  164. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  165. package/dist/target__planner-sql-checks.d.mts +2 -2
  166. package/dist/target__planner-sql-checks.mjs +1 -1
  167. package/dist/target__planner.d.mts +1 -1
  168. package/dist/target__planner.mjs +2 -2
  169. package/dist/target__prisma7-binding.d.mts +1 -1
  170. package/dist/target__prisma7-binding.mjs +1 -1
  171. package/dist/target__render-ops.mjs +1 -1
  172. package/dist/target__runtime.d.mts +2 -2
  173. package/dist/target__runtime.mjs +6 -6
  174. package/dist/target__runtime.mjs.map +1 -1
  175. package/dist/target__schema-ir-annotations.mjs +1 -1
  176. package/dist/target__types.mjs +1 -1
  177. package/dist/{type-constructors-BEZJxWcZ-Co2GJw1M.mjs → type-constructors-DQ7O80xT-DdTGyTSt.mjs} +7 -7
  178. package/dist/{type-constructors-BEZJxWcZ-Co2GJw1M.mjs.map → type-constructors-DQ7O80xT-DdTGyTSt.mjs.map} +1 -1
  179. package/dist/{types-CJNq93fb.d.mts → types-BA-ghQ5q.d.mts} +1 -1
  180. package/package.json +9 -9
  181. package/dist/codec-ids-BQRXOwQR.d.mts +0 -1
  182. package/dist/codec-ids-Cb0yO-IS--e0P2rfI.mjs.map +0 -1
  183. package/dist/codec-types-DoxsMXp7.d.mts +0 -2
  184. package/dist/codecs-UZ1NEbvk-CMnI6Ti0.mjs.map +0 -1
  185. package/dist/column-types-Bbc3IVA7.mjs.map +0 -1
  186. package/dist/column-types-COdejX_b.d.mts.map +0 -1
  187. package/dist/control-policy-BHjZnca1-DUWuKmdJ.mjs.map +0 -1
  188. package/dist/data-types-Cs-LkJBw-CJN57Y5M.mjs.map +0 -1
  189. package/dist/full-text-collection-method-BIqQH9XN-CkW2x4u2.d.mts.map +0 -1
  190. package/dist/op-factory-call-CEyI7a78.d.mts +0 -1
  191. package/dist/op-factory-call-DILl2zlf-BakJezLJ.d.mts.map +0 -1
  192. package/dist/op-factory-call-No9Z2tdw-Lap8xvVy.mjs.map +0 -1
  193. package/dist/operation-types-ECV4mkfb.d.mts +0 -1
  194. package/dist/planner-produced-postgres-migration-C8uYGzUj-DRmZY4_u.d.mts.map +0 -1
  195. package/dist/planner-produced-postgres-migration-DaDlRTID.d.mts +0 -1
  196. package/dist/planner-sql-checks-CWOmxltY-CoWF8Eq0.d.mts.map +0 -1
  197. package/dist/planner-sql-checks-Cp3fcCNc.d.mts +0 -1
  198. package/dist/planner-sql-checks-pkURMYMz-2QAIKyW-.mjs.map +0 -1
  199. package/dist/sql-renderer-CD5aYQos-1hGCWT0S.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"authoring-DtjMn8TZ-sv84Cdw_.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/authoring-DtjMn8TZ.mjs"],"sourcesContent":["import { A as PG_TIME_TEMPORAL_CODEC_ID, C as PG_TIMESTAMPTZ_DATE_CODEC_ID, D as PG_TIMESTAMP_TEMPORAL_CODEC_ID, E as PG_TIMESTAMP_STRING_CODEC_ID, O as PG_TIMETZ_CODEC_ID, T as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, k as PG_TIME_STRING_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID, s as PG_ENUM_CODEC_ID, w as PG_TIMESTAMPTZ_STRING_CODEC_ID } from \"./codec-ids-Cb0yO-IS.mjs\";\nimport { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport { N as requireTemporal } from \"./codecs-UZ1NEbvk.mjs\";\nimport { t as PostgresNativeEnum } from \"./postgres-native-enum-CdP3b_-R.mjs\";\nimport { f as weightGroupsOf, l as POSTGRES_TEXT_SEARCH_LANGUAGES, o as fullTextIndexProblems, r as describeFullTextIndexProblem, t as FULL_TEXT_INDEX_TYPE } from \"./full-text-index-definition-BPxQQBuC.mjs\";\nimport { t as postgresCodecTraitsOf } from \"./postgres-codec-traits-D3muwxMS.mjs\";\nimport { _ as PostgresRlsPolicy, d as PostgresNativeEnumSchema, f as PostgresRlsEnablementSchema, h as PostgresRole, m as PostgresRoleSchema, p as PostgresRlsPolicySchema, v as PostgresRlsEnablement } from \"./postgres-schema-DyUXtYIT.mjs\";\nimport { r as computeContentHash } from \"./canonicalize-RdxoUHao.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { temporalCodecPresetWithPrecision, temporalStringAuthoringPresets } from \"@internal/family-sql/control\";\nimport { TIMESTAMP_NOW_GENERATOR_ID, temporalAuthoringPresets, temporalCodecPreset } from \"@internal/framework-components/authoring\";\nimport { blockAttribute, bool, dataTypeValue, entityRef, fieldRef, identifier, leafDiagnostic, list, mapBlock, modelAttribute, oneOf, optional, str, structBlock } from \"@internal/psl-parser\";\nimport { exactNameBodyWarning } from \"@internal/sql-contract/index-naming\";\nimport { SQL_EXPRESSION_DATA_TYPE_ID, requireSqlExpression, sqlTextFromStored } from \"@internal/sql-contract/sql-expression\";\nimport { assertWireNamePrefixLength, normalizeSqlBody } from \"@internal/sql-schema-ir/naming\";\nimport { assertDefined, invariant } from \"@internal/utils/assertions\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { singleGeneratorBinding } from \"@internal/framework-components/components\";\n//#region src/core/date-time-now-generators.ts\n/**\n* The Postgres \"now\" generators, one per date and time codec except `pg/timestamptz-date@1`, which uses the framework's `timestampNow`. All read the clock through `Date.now()` and write UTC. The time generators round down to their `precision` param. The string generators are named after the codec they serve and write the text PostgreSQL prints in a UTC session, with milliseconds and no trailing zeros in the fraction.\n*/\nconst INSTANT_NOW_GENERATOR_ID = \"instantNow\";\nconst PLAIN_DATE_TIME_NOW_GENERATOR_ID = \"plainDateTimeNow\";\nconst PLAIN_DATE_NOW_GENERATOR_ID = \"plainDateNow\";\nconst PLAIN_TIME_NOW_GENERATOR_ID = \"plainTimeNow\";\nconst TIMESTAMP_STRING_NOW_GENERATOR_ID = \"timestampStringNow\";\nconst TIMESTAMPTZ_STRING_NOW_GENERATOR_ID = \"timestamptzStringNow\";\nconst DATE_STRING_NOW_GENERATOR_ID = \"dateStringNow\";\nconst TIME_STRING_NOW_GENERATOR_ID = \"timeStringNow\";\nconst TIMETZ_NOW_GENERATOR_ID = \"timetzNow\";\nconst UTC_OFFSET = \"+00\";\nconst MAX_TIME_PRECISION = 6;\nfunction fractionDigitsOf(params) {\n\tconst precision = params?.[\"precision\"];\n\treturn typeof precision === \"number\" ? precision : MAX_TIME_PRECISION;\n}\nfunction utcNow(fractionDigits = MAX_TIME_PRECISION) {\n\tconst iso = new Date(Date.now()).toISOString();\n\tconst [wholeSeconds = \"\", fraction = \"\"] = iso.slice(11, -1).split(\".\");\n\tconst kept = fraction.slice(0, fractionDigits).replace(/0+$/, \"\");\n\treturn {\n\t\tdate: iso.slice(0, 10),\n\t\ttime: kept === \"\" ? wholeSeconds : `${wholeSeconds}.${kept}`\n\t};\n}\n/** Rounds down, so PostgreSQL stores the value without rounding it up, which can reach `24:00:00`. */\nfunction truncateTime(time, fractionDigits) {\n\tif (fractionDigits <= 0) return time.round({\n\t\tsmallestUnit: \"second\",\n\t\troundingMode: \"trunc\"\n\t});\n\tconst smallestUnit = fractionDigits <= 3 ? \"millisecond\" : \"microsecond\";\n\tconst unitDigits = fractionDigits <= 3 ? 3 : 6;\n\treturn time.round({\n\t\tsmallestUnit,\n\t\troundingIncrement: 10 ** (unitDigits - Math.min(fractionDigits, unitDigits)),\n\t\troundingMode: \"trunc\"\n\t});\n}\nfunction utcDateTimeNow(generatorId) {\n\treturn requireTemporal({ generatorId }).Instant.fromEpochMilliseconds(Date.now()).toZonedDateTimeISO(\"UTC\");\n}\nfunction instantNow() {\n\treturn requireTemporal({ generatorId: INSTANT_NOW_GENERATOR_ID }).Instant.fromEpochMilliseconds(Date.now());\n}\nfunction plainDateTimeNow() {\n\treturn utcDateTimeNow(PLAIN_DATE_TIME_NOW_GENERATOR_ID).toPlainDateTime();\n}\nfunction plainDateNow() {\n\treturn utcDateTimeNow(PLAIN_DATE_NOW_GENERATOR_ID).toPlainDate();\n}\nfunction plainTimeNow(params) {\n\treturn truncateTime(utcDateTimeNow(PLAIN_TIME_NOW_GENERATOR_ID).toPlainTime(), fractionDigitsOf(params));\n}\nfunction timestampStringNow() {\n\tconst { date, time } = utcNow();\n\treturn `${date} ${time}`;\n}\nfunction timestamptzStringNow() {\n\treturn `${timestampStringNow()}${UTC_OFFSET}`;\n}\nfunction dateStringNow() {\n\treturn utcNow().date;\n}\nfunction timeStringNow(params) {\n\treturn utcNow(fractionDigitsOf(params)).time;\n}\nfunction timetzNow(params) {\n\treturn `${timeStringNow(params)}${UTC_OFFSET}`;\n}\nconst postgresNowGenerators = [\n\t{\n\t\tid: INSTANT_NOW_GENERATOR_ID,\n\t\tgenerate: instantNow\n\t},\n\t{\n\t\tid: PLAIN_DATE_TIME_NOW_GENERATOR_ID,\n\t\tgenerate: plainDateTimeNow\n\t},\n\t{\n\t\tid: PLAIN_DATE_NOW_GENERATOR_ID,\n\t\tgenerate: plainDateNow\n\t},\n\t{\n\t\tid: PLAIN_TIME_NOW_GENERATOR_ID,\n\t\tgenerate: plainTimeNow\n\t},\n\t{\n\t\tid: TIMESTAMP_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: timestampStringNow\n\t},\n\t{\n\t\tid: TIMESTAMPTZ_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: timestamptzStringNow\n\t},\n\t{\n\t\tid: DATE_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: dateStringNow\n\t},\n\t{\n\t\tid: TIME_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: timeStringNow\n\t},\n\t{\n\t\tid: TIMETZ_NOW_GENERATOR_ID,\n\t\tgenerate: timetzNow\n\t}\n];\nfunction postgresNowGeneratorControlDescriptors() {\n\treturn postgresNowGenerators.map(({ id }) => ({ id }));\n}\n//#endregion\n//#region src/core/now-generators.ts\n/** The \"now\" generator for each codec that has one. The `temporal` field presets read it. */\nconst postgresNowGeneratorIds = {\n\t[PG_DATE_TEMPORAL_CODEC_ID]: PLAIN_DATE_NOW_GENERATOR_ID,\n\t[PG_DATE_STRING_CODEC_ID]: DATE_STRING_NOW_GENERATOR_ID,\n\t[PG_TIME_TEMPORAL_CODEC_ID]: PLAIN_TIME_NOW_GENERATOR_ID,\n\t[PG_TIME_STRING_CODEC_ID]: TIME_STRING_NOW_GENERATOR_ID,\n\t[PG_TIMETZ_CODEC_ID]: TIMETZ_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_TEMPORAL_CODEC_ID]: PLAIN_DATE_TIME_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_STRING_CODEC_ID]: TIMESTAMP_STRING_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]: INSTANT_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_STRING_CODEC_ID]: TIMESTAMPTZ_STRING_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_DATE_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID\n};\nnew Map(Object.entries(postgresNowGeneratorIds));\n/** The codecs whose \"now\" generator takes the column's precision, so that it rounds down where PostgreSQL would round a time up to `24:00:00`. */\nconst postgresNowGeneratorTakesPrecision = {\n\t[PG_TIME_TEMPORAL_CODEC_ID]: true,\n\t[PG_TIME_STRING_CODEC_ID]: true,\n\t[PG_TIMETZ_CODEC_ID]: true\n};\n/** The `now` generator function bound to each Postgres date and time codec, with the column's precision on the three time codecs. */\nconst postgresNowGeneratorFunction = {\n\tname: \"now\",\n\tbindings: Object.entries(postgresNowGeneratorIds).map(([codecId, generatorId]) => singleGeneratorBinding({\n\t\tcodecIds: [codecId],\n\t\tgeneratorId,\n\t\tparamsFromField: (column) => {\n\t\t\tconst precision = column.typeParams?.[\"precision\"];\n\t\t\treturn Object.hasOwn(postgresNowGeneratorTakesPrecision, codecId) && typeof precision === \"number\" ? { precision } : void 0;\n\t\t}\n\t}))\n};\n//#endregion\n//#region src/core/authoring.ts\nconst PSL_POLICY_INVALID_MAP = \"PSL_POLICY_INVALID_MAP\";\nconst PSL_FULL_TEXT_INDEX_TOO_MANY_GROUPS = \"PSL_FULL_TEXT_INDEX_TOO_MANY_GROUPS\";\nconst PSL_FULL_TEXT_INDEX_EMPTY_GROUP = \"PSL_FULL_TEXT_INDEX_EMPTY_GROUP\";\nconst PSL_FULL_TEXT_INDEX_DUPLICATE_FIELD = \"PSL_FULL_TEXT_INDEX_DUPLICATE_FIELD\";\nconst PSL_FULL_TEXT_INDEX_REQUIRES_NAME = \"PSL_FULL_TEXT_INDEX_REQUIRES_NAME\";\nconst PSL_FULL_TEXT_INDEX_NAME_XOR_MAP = \"PSL_FULL_TEXT_INDEX_NAME_XOR_MAP\";\nconst PSL_FULL_TEXT_INDEX_TEXT_FIELD = \"PSL_FULL_TEXT_INDEX_TEXT_FIELD\";\nconst PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE = \"PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE\";\nconst PSL_NATIVE_ENUM_MISSING_MEMBERS = \"PSL_NATIVE_ENUM_MISSING_MEMBERS\";\nconst PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE = \"PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE\";\n/**\n* `pg.enum(<ref>)` registers as an ordinary type constructor whose sole\n* positional argument names a `native_enum` entity instead of carrying a\n* literal value. The interpreter resolves the ref to the `native_enum`\n* entity generically (driven by `entityRefArg`); the `pg/enum@1` codec\n* descriptor's `columnFromEntity` hook (see `codecs.ts`) converts that\n* entity into the column's `typeParams`. The column's type name comes from the\n* `pg/enum` data type, which renders `typeParams.typeName`.\n*/\nconst postgresAuthoringTypes = {\n\tBigIntNumber: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A PostgreSQL 64-bit integer represented as a JavaScript number within its safe integer range.\",\n\t\toutput: { codecId: \"pg/int8number@1\" }\n\t},\n\tUnboundedInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An arbitrary-precision integer stored as PostgreSQL numeric and represented as bigint.\",\n\t\toutput: { codecId: \"pg/unboundedint@1\" }\n\t},\n\tpg: { enum: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tentityRefArg: {\n\t\t\tindex: 0,\n\t\t\tentityKind: \"native_enum\"\n\t\t},\n\t\toutput: { codecId: PG_ENUM_CODEC_ID }\n\t} }\n};\nconst policyTargetParam = {\n\ttype: entityRef({ kind: \"model\" }),\n\tdocumentation: \"The model protected by this policy; it must declare @@rls.\"\n};\nconst policyRolesParam = {\n\ttype: optional(list(oneOf(entityRef({\n\t\tkind: \"block\",\n\t\tkeyword: \"role\"\n\t}), identifier()))),\n\tdocumentation: \"The database roles to which this policy applies.\"\n};\nfunction policyUsingParam(ctx) {\n\treturn {\n\t\ttype: optional(dataTypeValue(SQL_EXPRESSION_DATA_TYPE_ID, ctx.dataTypes)),\n\t\tdocumentation: \"A SQL predicate controlling which rows this policy permits.\"\n\t};\n}\nfunction policyWithCheckParam(ctx) {\n\treturn {\n\t\ttype: optional(dataTypeValue(SQL_EXPRESSION_DATA_TYPE_ID, ctx.dataTypes)),\n\t\tdocumentation: \"A SQL predicate checking rows being written by this policy.\"\n\t};\n}\nconst policyPermissiveParam = {\n\ttype: optional(bool()),\n\tdocumentation: \"Whether the policy is permissive (combined with OR) rather than restrictive (combined with AND).\"\n};\nfunction policyUsingOnlySpec(ctx) {\n\treturn structBlock({ parameters: {\n\t\ttarget: policyTargetParam,\n\t\troles: policyRolesParam,\n\t\tusing: policyUsingParam(ctx),\n\t\tpermissive: policyPermissiveParam\n\t} });\n}\nfunction policyWithCheckOnlySpec(ctx) {\n\treturn structBlock({ parameters: {\n\t\ttarget: policyTargetParam,\n\t\troles: policyRolesParam,\n\t\twithCheck: policyWithCheckParam(ctx),\n\t\tpermissive: policyPermissiveParam\n\t} });\n}\nfunction policyBothPredicatesSpec(ctx) {\n\treturn structBlock({ parameters: {\n\t\ttarget: policyTargetParam,\n\t\troles: policyRolesParam,\n\t\tusing: policyUsingParam(ctx),\n\t\twithCheck: policyWithCheckParam(ctx),\n\t\tpermissive: policyPermissiveParam\n\t} });\n}\nfunction roleSpec() {\n\treturn structBlock({ parameters: {} });\n}\nfunction nativeEnumSpec() {\n\treturn mapBlock({ value: {\n\t\ttype: str(),\n\t\tdocumentation: \"The member value stored in the database enum type.\"\n\t} });\n}\n/**\n* The block keyword that authors each row-level security operation. The keyword is the operation, so\n* a policy block has no `operation` parameter. The reader looks a block's operation up here, and\n* `contract infer` and `contract print` look up the keyword to write.\n*/\nconst POLICY_BLOCK_KEYWORDS = {\n\tselect: \"policy_select\",\n\tinsert: \"policy_insert\",\n\tupdate: \"policy_update\",\n\tdelete: \"policy_delete\",\n\tall: \"policy_all\"\n};\nfunction isRlsPolicyOperation(value) {\n\treturn Object.hasOwn(POLICY_BLOCK_KEYWORDS, value);\n}\n/** The operation a `policy_<operation>` block keyword authors, or `undefined` for another keyword. */\nfunction policyOperationOfKeyword(keyword) {\n\treturn Object.keys(POLICY_BLOCK_KEYWORDS).filter(isRlsPolicyOperation).find((operation) => POLICY_BLOCK_KEYWORDS[operation] === keyword);\n}\n/**\n* Assembles a {@link PostgresRlsPolicy} from lowered inputs: normalizes the\n* predicates, computes the content-hash wire name, and constructs the frozen\n* entity. The single hash-assembly body shared by the PSL block lowering\n* ({@link lowerRlsPolicyFromBlock}) and the TS entity-handle lowering\n* ({@link postgresLowerEntityHandles}) so the two surfaces cannot drift.\n*/\nfunction buildRlsPolicyEntity(input) {\n\tconst permissive = input.permissive ?? true;\n\tconst wireHash = computeContentHash({\n\t\t...ifDefined(\"using\", input.using !== void 0 ? normalizeSqlBody(input.using) : void 0),\n\t\t...ifDefined(\"withCheck\", input.withCheck !== void 0 ? normalizeSqlBody(input.withCheck) : void 0),\n\t\troles: input.roles,\n\t\toperation: input.operation,\n\t\tpermissive\n\t});\n\treturn new PostgresRlsPolicy({\n\t\tnaming: {\n\t\t\tkind: \"wire\",\n\t\t\tprefix: input.prefix,\n\t\t\thash: wireHash\n\t\t},\n\t\ttableName: input.tableName,\n\t\tnamespaceId: input.namespaceId,\n\t\toperation: input.operation,\n\t\troles: input.roles,\n\t\tusing: input.using,\n\t\twithCheck: input.withCheck,\n\t\tpermissive\n\t});\n}\nfunction lowerRlsPolicyFromBlock(block, ctx) {\n\tconst prefix = block.name;\n\tconst operation = policyOperationOfKeyword(block.keyword) ?? \"select\";\n\tconst target = block.resolvedModelRefs?.[\"target\"];\n\tassertDefined(target, `lowerRlsPolicyFromBlock: policy \"${block.name}\" reached the factory without a projected \\`target\\` coordinate; the interpreter projects checked model references before invoking entity factories.`);\n\tconst roles = block.values.roles === void 0 ? [] : block.values.roles.map((role) => typeof role === \"string\" ? role : role.declaration.name).sort();\n\tconst using = block.values.using === void 0 ? void 0 : sqlTextFromStored(block.values.using.value.value);\n\tconst withCheck = block.values.withCheck === void 0 ? void 0 : sqlTextFromStored(block.values.withCheck.value.value);\n\tconst permissive = block.values.permissive ?? true;\n\tconst mapAttr = block.attributes[\"map\"];\n\tif (mapAttr !== void 0) {\n\t\tconst exactName = mapAttr.args[\"name\"];\n\t\tinvariant(typeof exactName === \"string\", \"@@map on a policy block parses one string argument\");\n\t\tctx.warnings?.push(exactNameBodyWarning(\"policy\", exactName));\n\t\treturn new PostgresRlsPolicy({\n\t\t\tnaming: {\n\t\t\t\tkind: \"exact\",\n\t\t\t\tname: exactName\n\t\t\t},\n\t\t\ttableName: target.tableName,\n\t\t\tnamespaceId: target.namespaceId,\n\t\t\toperation,\n\t\t\troles,\n\t\t\tusing,\n\t\t\twithCheck,\n\t\t\tpermissive\n\t\t});\n\t}\n\treturn buildRlsPolicyEntity({\n\t\tprefix,\n\t\ttableName: target.tableName,\n\t\tnamespaceId: target.namespaceId,\n\t\toperation,\n\t\troles,\n\t\t...ifDefined(\"using\", using),\n\t\t...ifDefined(\"withCheck\", withCheck),\n\t\tpermissive\n\t});\n}\nconst policyEntityTypeOutput = {\n\tfactory: lowerRlsPolicyFromBlock,\n\tpslPlacement: (entity) => ({ namespaceId: entity.namespaceId })\n};\nfunction lowerNativeEnumFromBlock(block, ctx) {\n\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\tconst diagnostics = ctx.diagnostics;\n\tconst mapAttr = block.attributes[\"map\"];\n\tlet typeName = block.name;\n\tif (mapAttr !== void 0) {\n\t\tconst mapped = mapAttr.args[\"name\"];\n\t\tinvariant(typeof mapped === \"string\", \"@@map on a native_enum block parses one string argument\");\n\t\ttypeName = mapped;\n\t}\n\tlet memberError = false;\n\tconst seenValues = /* @__PURE__ */ new Set();\n\tconst members = [];\n\tfor (const [memberName, value] of Object.entries(block.values)) {\n\t\tif (seenValues.has(value)) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE,\n\t\t\t\tmessage: `native_enum \"${block.name}\": duplicate member value \"${value}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.parameterSpans[memberName] ?? block.span\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tseenValues.add(value);\n\t\tmembers.push(value);\n\t}\n\tif (memberError) return void 0;\n\tif (members.length === 0) {\n\t\tdiagnostics?.push({\n\t\t\tcode: PSL_NATIVE_ENUM_MISSING_MEMBERS,\n\t\t\tmessage: `native_enum \"${block.name}\" must have at least one member`,\n\t\t\tsourceId,\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\treturn new PostgresNativeEnum({\n\t\ttypeName,\n\t\tmembers\n\t});\n}\n/**\n* `native_enum`'s entity-type factory output, checked separately from the assembled\n* `postgresAuthoringEntityTypes` map below: `deriveValueSet` is SQL-family surface\n* ({@link SqlValueSetDerivingEntityTypeOutput}), not part of the framework\n* `AuthoringEntityTypeFactoryOutput` shape, so folding it directly into the map's single\n* `satisfies AuthoringEntityTypeNamespace` check would trip an excess-property error. Checking it\n* here against the intersection of both shapes keeps it structurally valid against each without\n* widening the map's own check.\n*/\nconst nativeEnumEntityTypeOutput = {\n\tfactory: lowerNativeEnumFromBlock,\n\tderiveValueSet: (entity) => ({\n\t\tkind: \"valueSet\",\n\t\tvalues: [...entity.members]\n\t})\n};\n/**\n* Lowers a `role <name> {}` block into a {@link PostgresRole}. Roles are\n* cluster-scoped in Postgres, so the block must be declared inside\n* `namespace unbound { … }` — any other lexical namespace (a named schema,\n* or the default bucket top-level declarations resolve to) is a load-time\n* diagnostic. The lowered entity carries the unbound coordinate.\n*/\nfunction lowerRoleFromBlock(block, ctx) {\n\tif (block.namespaceId !== UNBOUND_NAMESPACE_ID) {\n\t\tctx.diagnostics?.push({\n\t\t\tcode: PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE,\n\t\t\tmessage: `\\`role\\` block \"${block.name}\" must be declared inside \\`namespace unbound { }\\`, not in namespace \"${block.namespaceId}\"`,\n\t\t\tsourceId: ctx.sourceId ?? \"unknown\",\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\treturn new PostgresRole({\n\t\tname: block.name,\n\t\tnamespaceId: UNBOUND_NAMESPACE_ID\n\t});\n}\nconst postgresAuthoringEntityTypes = {\n\trole: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"role\",\n\t\tvalidatorSchema: PostgresRoleSchema,\n\t\toutput: { factory: lowerRoleFromBlock }\n\t},\n\trls: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"rls\",\n\t\tvalidatorSchema: PostgresRlsEnablementSchema,\n\t\toutput: { factory: (input) => new PostgresRlsEnablement(input) }\n\t},\n\tpolicy: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"policy\",\n\t\tvalidatorSchema: PostgresRlsPolicySchema,\n\t\toutput: policyEntityTypeOutput\n\t},\n\tnative_enum: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"native_enum\",\n\t\tvalidatorSchema: PostgresNativeEnumSchema,\n\t\toutput: nativeEnumEntityTypeOutput\n\t}\n};\n/**\n* Field presets contributed by the Postgres target pack.\n*\n* These mirror the PSL scalar-to-codec mapping used by the Postgres adapter\n* (see `createPostgresPslScalarTypeDescriptors`), so that authoring a field\n* via the TS callback surface (e.g. `field.int()`) and via the PSL scalar\n* surface (e.g. `Int`) lowers to byte-identical contracts.\n*\n* The `uuidNative` / `id.uuidv4Native` / `id.uuidv7Native` presets use the\n* native Postgres `uuid` type (codecId `pg/uuid@1`). For cross-target\n* portability use `uuidString` / `id.uuidv4String` / `id.uuidv7String` from\n* the family pack instead.\n*/\nconst policyRequiresRls = {\n\tparameter: \"target\",\n\tattribute: \"rls\"\n};\nconst policyMapAttribute = blockAttribute(\"map\", {\n\tdocumentation: \"Maps this row-level security policy to its PostgreSQL policy name.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The nonempty PostgreSQL policy name.\"\n\t}],\n\trefine: (parsed, ctx, attributeNode) => parsed.name === \"\" ? [leafDiagnostic(ctx, attributeNode, \"@@map policy name must be a non-empty string\", PSL_POLICY_INVALID_MAP)] : []\n});\nconst policyBlockAttributes = { map: () => policyMapAttribute };\nconst nativeEnumMapAttribute = blockAttribute(\"map\", {\n\tdocumentation: \"Maps this native enum to its PostgreSQL type name.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The PostgreSQL enum type name.\"\n\t}]\n});\nconst postgresAuthoringPslBlockDescriptors = {\n\t[POLICY_BLOCK_KEYWORDS.select]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.select,\n\t\tdocumentation: \"Defines a row-level security policy controlling which rows can be selected.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyUsingOnlySpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.delete]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.delete,\n\t\tdocumentation: \"Defines a row-level security policy controlling which rows can be deleted.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyUsingOnlySpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.insert]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.insert,\n\t\tdocumentation: \"Defines a row-level security policy checking rows being inserted.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyWithCheckOnlySpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.update]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.update,\n\t\tdocumentation: \"Defines a row-level security policy controlling row visibility and checks for updates.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyBothPredicatesSpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.all]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.all,\n\t\tdocumentation: \"Defines a row-level security policy applying to all operations.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyBothPredicatesSpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\tnative_enum: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"native_enum\",\n\t\tdocumentation: \"Defines a PostgreSQL enum type with named string-valued members.\",\n\t\tdiscriminator: \"native_enum\",\n\t\tname: { required: true },\n\t\tspec: nativeEnumSpec,\n\t\tnameIsStorageName: true,\n\t\tattributes: { map: () => nativeEnumMapAttribute }\n\t},\n\t/**\n\t* PSL block descriptor for `role` (e.g. `role anon {}`). Name-only, no\n\t* parameters and no body content. Declared inside `namespace unbound { }`\n\t* — see {@link lowerRoleFromBlock} for the placement check and the\n\t* coordinate the lowered entity carries.\n\t*/\n\trole: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"role\",\n\t\tdocumentation: \"Declares an existing database role in namespace unbound for use in security policies.\",\n\t\tdiscriminator: \"role\",\n\t\tname: { required: true },\n\t\tspec: roleSpec\n\t}\n};\nconst postgresRlsSpec = modelAttribute(\"rls\", { documentation: \"Enables PostgreSQL row-level security on this model’s table.\" });\nconst postgresRlsSpecFactory = () => postgresRlsSpec;\nconst [firstLanguage, ...remainingLanguages] = POSTGRES_TEXT_SEARCH_LANGUAGES;\nconst fullTextField = fieldRef();\nfunction postgresFullTextIndexSpec(ctx) {\n\treturn modelAttribute(\"fullTextIndex\", {\n\t\tdocumentation: \"Indexes text fields for full-text search. Each item of the list is a weight group, strongest first; a nested list puts several fields in one group. Pass the index from the table's `indexes` to `fullTextMatches` and `fullTextRank` to search the same document.\",\n\t\tpositional: [{\n\t\t\tkey: \"fields\",\n\t\t\ttype: oneOf(fullTextField, list(oneOf(fullTextField, list(fullTextField)), {\n\t\t\t\tallowEmpty: false,\n\t\t\t\tlabel: \"(field name | field name[])[]\"\n\t\t\t})),\n\t\t\tdocumentation: \"The fields to index: one field, or a list of fields and lists of fields. Each top-level item is a weight group, from A down to D.\"\n\t\t}],\n\t\tnamed: {\n\t\t\tlanguage: {\n\t\t\t\ttype: optional(oneOf(str(firstLanguage), ...remainingLanguages.map((language) => str(language)))),\n\t\t\t\tdocumentation: \"The text-search configuration. Defaults to `english`, and must match the language the query operations are given.\"\n\t\t\t},\n\t\t\tname: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The index name. Mutually exclusive with `map`.\"\n\t\t\t},\n\t\t\tmap: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The database index name. Mutually exclusive with `name`.\"\n\t\t\t},\n\t\t\twhere: {\n\t\t\t\ttype: optional(dataTypeValue(SQL_EXPRESSION_DATA_TYPE_ID, ctx.dataTypes)),\n\t\t\t\tdocumentation: \"The SQL predicate restricting rows included in a partial index.\"\n\t\t\t}\n\t\t},\n\t\trefine: (value, ctx, attributeNode) => {\n\t\t\tconst diagnostics = fullTextIndexProblems({ weightGroups: weightGroupsOf(value.fields, isFieldName) }).filter(isPslFullTextIndexProblem).map((problem) => leafDiagnostic(ctx, attributeNode, describeFullTextIndexProblem(\"`@@fullTextIndex`\", problem), FULL_TEXT_INDEX_PROBLEM_CODES[problem.kind]));\n\t\t\tif (value.name === void 0 && value.map === void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@fullTextIndex` requires a `name` or `map` argument\", PSL_FULL_TEXT_INDEX_REQUIRES_NAME));\n\t\t\tif (value.name !== void 0 && value.map !== void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@fullTextIndex` takes at most one of `name` and `map`\", PSL_FULL_TEXT_INDEX_NAME_XOR_MAP));\n\t\t\treturn diagnostics;\n\t\t}\n\t});\n}\nfunction isFieldName(value) {\n\treturn typeof value === \"string\";\n}\nfunction isPslFullTextIndexProblem(problem) {\n\treturn problem.kind !== \"unique\" && problem.kind !== \"no-fields\";\n}\nconst FULL_TEXT_INDEX_PROBLEM_CODES = {\n\t\"too-many-groups\": PSL_FULL_TEXT_INDEX_TOO_MANY_GROUPS,\n\t\"empty-group\": PSL_FULL_TEXT_INDEX_EMPTY_GROUP,\n\t\"duplicate-field\": PSL_FULL_TEXT_INDEX_DUPLICATE_FIELD,\n\t\"not-text\": PSL_FULL_TEXT_INDEX_TEXT_FIELD\n};\nconst postgresFullTextIndexSpecFactory = (ctx) => postgresFullTextIndexSpec(ctx);\n/**\n* `@@` model attributes contributed by the Postgres target pack.\n*\n* `@@rls` is argument-less: presence marks the model's table\n* RLS-controlled. It lowers to a {@link PostgresRlsEnablement} marker in\n* the namespace's `entries.rls`, keyed by the model's table name — the\n* marker (never the policy set) is what drives\n* `ENABLE`/`DISABLE ROW LEVEL SECURITY` planning.\n*/\nconst postgresAuthoringModelAttributes = {\n\trls: {\n\t\tkind: \"modelAttribute\",\n\t\tattribute: \"rls\",\n\t\tspec: postgresRlsSpecFactory,\n\t\tlower: (_parsed, ctx) => ({\n\t\t\tkey: ctx.storageName,\n\t\t\tentity: new PostgresRlsEnablement({\n\t\t\t\ttableName: ctx.storageName,\n\t\t\t\tnamespaceId: ctx.namespaceId\n\t\t\t})\n\t\t})\n\t},\n\tfullTextIndex: {\n\t\tkind: \"modelAttribute\",\n\t\tattribute: \"fullTextIndex\",\n\t\tspec: postgresFullTextIndexSpecFactory,\n\t\trepeatable: true,\n\t\tlower: (parsed, ctx) => {\n\t\t\tconst fieldGroups = weightGroupsOf(parsed.fields, isFieldName);\n\t\t\tconst problems = fullTextIndexProblems({\n\t\t\t\tweightGroups: fieldGroups,\n\t\t\t\tcodecs: {\n\t\t\t\t\tcodecIdOf: (fieldName) => ctx.fieldStorageName(fieldName) === void 0 ? void 0 : ctx.fieldCodecId(fieldName),\n\t\t\t\t\ttraitsOf: postgresCodecTraitsOf\n\t\t\t\t}\n\t\t\t}).filter(isPslFullTextIndexProblem);\n\t\t\tfor (const problem of problems) ctx.diagnostics?.push({\n\t\t\t\tcode: FULL_TEXT_INDEX_PROBLEM_CODES[problem.kind],\n\t\t\t\tmessage: describeFullTextIndexProblem(\"`@@fullTextIndex`\", problem, (fieldName) => `${ctx.modelName}.${fieldName}`),\n\t\t\t\tsourceId: ctx.sourceId ?? \"unknown\"\n\t\t\t});\n\t\t\tif (problems.length > 0) return void 0;\n\t\t\tconst weightGroups = fieldGroups.map((group) => group.map((fieldName) => {\n\t\t\t\tconst columnName = ctx.fieldStorageName(fieldName);\n\t\t\t\tassertDefined(columnName, `@@fullTextIndex field \"${fieldName}\" has no storage column`);\n\t\t\t\treturn columnName;\n\t\t\t}));\n\t\t\treturn { index: {\n\t\t\t\tcolumns: weightGroups.flat(),\n\t\t\t\ttype: FULL_TEXT_INDEX_TYPE,\n\t\t\t\toptions: {\n\t\t\t\t\tweightGroups,\n\t\t\t\t\tlanguage: parsed.language ?? \"english\"\n\t\t\t\t},\n\t\t\t\twhere: parsed.where === void 0 ? void 0 : sqlTextFromStored(parsed.where.value.value),\n\t\t\t\tunique: void 0,\n\t\t\t\tname: parsed.name,\n\t\t\t\tmap: parsed.map\n\t\t\t} };\n\t\t}\n\t}\n};\nconst postgresAuthoringFieldPresets = {\n\ttext: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/text@1\" }\n\t},\n\tint: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/int4@1\" }\n\t},\n\tbigint: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/int8@1\" }\n\t},\n\tfloat: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/float8@1\" }\n\t},\n\tdecimal: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/numeric@1\" }\n\t},\n\tboolean: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/bool@1\" }\n\t},\n\tjson: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/jsonb@1\" }\n\t},\n\tbytes: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/bytea@1\" }\n\t},\n\tdateTime: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/timestamptz-temporal@1\" }\n\t},\n\ttemporal: {\n\t\tcreatedAtJsDate: (/* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]\n\t\t})).createdAt,\n\t\tupdatedAtJsDate: (/* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]\n\t\t})).updatedAt,\n\t\ttimestamptzJsDate: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]\n\t\t}),\n\t\t.../* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\t.../* @__PURE__ */ temporalStringAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_STRING_CODEC_ID]\n\t\t}),\n\t\ttimestamp: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMP_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMP_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\ttimestamptz: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\ttimestampString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMP_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMP_STRING_CODEC_ID]\n\t\t}),\n\t\ttimestamptzString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMPTZ_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_STRING_CODEC_ID]\n\t\t}),\n\t\tdate: /* @__PURE__ */ temporalCodecPreset({\n\t\t\tcodecId: PG_DATE_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_DATE_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\tdateString: /* @__PURE__ */ temporalCodecPreset({\n\t\t\tcodecId: PG_DATE_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_DATE_STRING_CODEC_ID]\n\t\t}),\n\t\ttime: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIME_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIME_TEMPORAL_CODEC_ID],\n\t\t\tnowTakesPrecision: postgresNowGeneratorTakesPrecision[PG_TIME_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\ttimeString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIME_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIME_STRING_CODEC_ID],\n\t\t\tnowTakesPrecision: postgresNowGeneratorTakesPrecision[PG_TIME_STRING_CODEC_ID]\n\t\t}),\n\t\t/** Produces a string: no Temporal type holds a time of day with an offset. */\n\t\ttimetz: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMETZ_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMETZ_CODEC_ID],\n\t\t\tnowTakesPrecision: postgresNowGeneratorTakesPrecision[PG_TIMETZ_CODEC_ID]\n\t\t})\n\t},\n\tuuidNative: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/uuid@1\" }\n\t},\n\tid: {\n\t\tuuidv4Native: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv4\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tuuidv7Native: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv7\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t}\n\t}\n};\nfunction predicateText(predicate, what) {\n\treturn predicate === void 0 ? void 0 : requireSqlExpression(predicate, what).text;\n}\n/**\n* Resolves an entity handle's `target` ref to a table coordinate of this\n* contract, or throws the load-time diagnostic naming the handle: a\n* cross-space target is rejected (you cannot CREATE POLICY on a table\n* another space owns) and an unresolved target names the model.\n*/\nfunction requireLocalTarget(refs, subject) {\n\tconst target = refs[\"target\"];\n\tif (target !== void 0 && target.kind === \"resolved\") return {\n\t\tnamespaceId: target.namespaceId,\n\t\ttableName: target.tableName\n\t};\n\tif (target !== void 0 && target.kind === \"cross-space\") throw postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: ${subject} targets model \"${target.modelName ?? target.tableName}\", which lives in another contract space. Policies and rlsEnabled entries must target a model declared in this contract.`, { meta: {\n\t\tmodel: target.modelName ?? target.tableName,\n\t\treason: \"cross-space-target\"\n\t} });\n\tthrow postgresError(\"CONTRACT.MODEL_UNKNOWN\", `defineContract: ${subject} targets model \"${target?.modelName ?? \"<anonymous>\"}\", which is not in the contract's models. Add the model to \\`models\\`.`, { meta: { model: target?.modelName ?? \"<anonymous>\" } });\n}\n/**\n* The SQL-family entity-handle batch lowering hook for the Postgres pack\n* (`SqlEntityHandleLoweringContribution`). Receives every `entities` handle\n* whose kind this pack registered — batch, so the cross-entity diagnostics\n* (duplicate prefix, policy without rlsEnabled, duplicate role) can see\n* sibling handles — and lowers them with the same keying and hash assembly\n* as the PSL path: `policy` keyed by prefix (wire name via\n* {@link buildRlsPolicyEntity}), `rls` keyed by table name, `role` keyed by\n* name and filed under the default namespace (roles are declared\n* contract-wide; PSL has no role block to set a precedent).\n*/\nfunction postgresLowerEntityHandles(input) {\n\tconst enablements = /* @__PURE__ */ new Map();\n\tconst roles = /* @__PURE__ */ new Map();\n\tconst policies = [];\n\tconst coordinateKey = (coordinate) => `${coordinate.namespaceId} ${coordinate.tableName}`;\n\tfor (const { handle, refs } of input.handles) switch (handle.entityKind) {\n\t\tcase \"rls\": {\n\t\t\tconst coordinate = requireLocalTarget(refs, \"an rlsEnabled entry\");\n\t\t\tconst key = coordinateKey(coordinate);\n\t\t\tif (!enablements.has(key)) enablements.set(key, {\n\t\t\t\tcoordinate,\n\t\t\t\tentity: new PostgresRlsEnablement({\n\t\t\t\t\ttableName: coordinate.tableName,\n\t\t\t\t\tnamespaceId: coordinate.namespaceId\n\t\t\t\t})\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\tcase \"role\": {\n\t\t\tconst roleHandle = blindCast(handle);\n\t\t\tif (roles.has(roleHandle.name)) throw postgresError(\"CONTRACT.ROLE_INVALID\", `defineContract: role \"${roleHandle.name}\" is declared more than once in the entities list.`, { meta: {\n\t\t\t\trole: roleHandle.name,\n\t\t\t\treason: \"duplicate\"\n\t\t\t} });\n\t\t\troles.set(roleHandle.name, new PostgresRole({\n\t\t\t\tname: roleHandle.name,\n\t\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID\n\t\t\t}));\n\t\t\tbreak;\n\t\t}\n\t\tcase \"policy\": {\n\t\t\tconst policyHandle = blindCast(handle);\n\t\t\tpolicies.push({\n\t\t\t\thandle: policyHandle,\n\t\t\t\trefs\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\tdefault: throw postgresError(\"CONTRACT.ENTITY_KIND_INVALID\", `defineContract: the postgres pack does not lower \"${handle.entityKind}\" handles from the entities list.`, { meta: { entityKind: handle.entityKind } });\n\t}\n\tconst rows = [];\n\tconst seenPrefixes = /* @__PURE__ */ new Set();\n\tfor (const { handle: policy, refs } of policies) {\n\t\tconst prefix = policy.name;\n\t\tassertWireNamePrefixLength(prefix, \"defineContract: policy prefix\");\n\t\tconst coordinate = requireLocalTarget(refs, `policy \"${prefix}\"`);\n\t\tif (!enablements.has(coordinateKey(coordinate))) {\n\t\t\tconst target = refs[\"target\"];\n\t\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: policy \"${prefix}\" targets model \"${target?.modelName ?? coordinate.tableName}\", whose table is not RLS-enabled. Add rlsEnabled(<model>) to the entities list.`, { meta: {\n\t\t\t\tprefix,\n\t\t\t\tmodel: target?.modelName ?? coordinate.tableName,\n\t\t\t\treason: \"target-not-rls-enabled\"\n\t\t\t} });\n\t\t}\n\t\tconst prefixKey = `${coordinate.namespaceId} ${prefix}`;\n\t\tif (seenPrefixes.has(prefixKey)) throw postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: policy prefix \"${prefix}\" is declared more than once in namespace \"${coordinate.namespaceId}\". Policy prefixes must be unique per namespace.`, { meta: {\n\t\t\tprefix,\n\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\treason: \"duplicate-prefix\"\n\t\t} });\n\t\tseenPrefixes.add(prefixKey);\n\t\tconst roleNames = [...new Set(policy.roles.map((roleHandle) => roleHandle.name))].sort();\n\t\trows.push({\n\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\tentityKind: \"policy\",\n\t\t\tkey: prefix,\n\t\t\tentity: buildRlsPolicyEntity({\n\t\t\t\tprefix,\n\t\t\t\ttableName: coordinate.tableName,\n\t\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\t\toperation: policy.operation,\n\t\t\t\troles: roleNames,\n\t\t\t\t...ifDefined(\"using\", predicateText(policy.using, `Policy \"${prefix}\" using`)),\n\t\t\t\t...ifDefined(\"withCheck\", predicateText(policy.withCheck, `Policy \"${prefix}\" withCheck`))\n\t\t\t})\n\t\t});\n\t}\n\tfor (const { coordinate, entity } of enablements.values()) rows.push({\n\t\tnamespaceId: coordinate.namespaceId,\n\t\tentityKind: \"rls\",\n\t\tkey: coordinate.tableName,\n\t\tentity\n\t});\n\tfor (const [name, entity] of roles) rows.push({\n\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\tentityKind: \"role\",\n\t\tkey: name,\n\t\tentity\n\t});\n\treturn rows;\n}\n//#endregion\nexport { postgresAuthoringPslBlockDescriptors as a, postgresNowGeneratorFunction as c, postgresAuthoringModelAttributes as i, postgresNowGeneratorControlDescriptors as l, postgresAuthoringEntityTypes as n, postgresAuthoringTypes as o, postgresAuthoringFieldPresets as r, postgresLowerEntityHandles as s, POLICY_BLOCK_KEYWORDS as t, postgresNowGen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["../../../../3-targets/3-targets/postgres/dist/authoring-CArQ0ZSb.mjs"],"sourcesContent":["import { A as PG_TIME_TEMPORAL_CODEC_ID, C as PG_TIMESTAMPTZ_DATE_CODEC_ID, D as PG_TIMESTAMP_TEMPORAL_CODEC_ID, E as PG_TIMESTAMP_STRING_CODEC_ID, O as PG_TIMETZ_CODEC_ID, T as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, k as PG_TIME_STRING_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID, s as PG_ENUM_CODEC_ID, w as PG_TIMESTAMPTZ_STRING_CODEC_ID } from \"./codec-ids-BMhEpFwv.mjs\";\nimport { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport { N as requireTemporal } from \"./codecs-DNjF5kIh.mjs\";\nimport { t as PostgresNativeEnum } from \"./postgres-native-enum-CdP3b_-R.mjs\";\nimport { f as weightGroupsOf, l as POSTGRES_TEXT_SEARCH_LANGUAGES, o as fullTextIndexProblems, r as describeFullTextIndexProblem, t as FULL_TEXT_INDEX_TYPE } from \"./full-text-index-definition-BPxQQBuC.mjs\";\nimport { t as postgresCodecTraitsOf } from \"./postgres-codec-traits-DM3rkou1.mjs\";\nimport { _ as PostgresRlsPolicy, d as PostgresNativeEnumSchema, f as PostgresRlsEnablementSchema, h as PostgresRole, m as PostgresRoleSchema, p as PostgresRlsPolicySchema, v as PostgresRlsEnablement } from \"./postgres-schema-C6w1rzOF.mjs\";\nimport { r as computeContentHash } from \"./canonicalize-RdxoUHao.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { temporalCodecPresetWithPrecision, temporalStringAuthoringPresets } from \"@internal/family-sql/control\";\nimport { TIMESTAMP_NOW_GENERATOR_ID, temporalAuthoringPresets, temporalCodecPreset } from \"@internal/framework-components/authoring\";\nimport { blockAttribute, bool, dataTypeValue, entityRef, fieldRef, identifier, leafDiagnostic, list, mapBlock, modelAttribute, oneOf, optional, str, structBlock } from \"@internal/psl-parser\";\nimport { exactNameBodyWarning } from \"@internal/sql-contract/index-naming\";\nimport { SQL_EXPRESSION_DATA_TYPE_ID, requireSqlExpression, sqlTextFromStored } from \"@internal/sql-contract/sql-expression\";\nimport { assertWireNamePrefixLength, normalizeSqlBody } from \"@internal/sql-schema-ir/naming\";\nimport { assertDefined, invariant } from \"@internal/utils/assertions\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { singleGeneratorBinding } from \"@internal/framework-components/components\";\n//#region src/core/date-time-now-generators.ts\n/**\n* The Postgres \"now\" generators, one per date and time codec except `pg/timestamptz-date@1`, which uses the framework's `timestampNow`. All read the clock through `Date.now()` and write UTC. The time generators round down to their `precision` param. The string generators are named after the codec they serve and write the text PostgreSQL prints in a UTC session, with milliseconds and no trailing zeros in the fraction.\n*/\nconst INSTANT_NOW_GENERATOR_ID = \"instantNow\";\nconst PLAIN_DATE_TIME_NOW_GENERATOR_ID = \"plainDateTimeNow\";\nconst PLAIN_DATE_NOW_GENERATOR_ID = \"plainDateNow\";\nconst PLAIN_TIME_NOW_GENERATOR_ID = \"plainTimeNow\";\nconst TIMESTAMP_STRING_NOW_GENERATOR_ID = \"timestampStringNow\";\nconst TIMESTAMPTZ_STRING_NOW_GENERATOR_ID = \"timestamptzStringNow\";\nconst DATE_STRING_NOW_GENERATOR_ID = \"dateStringNow\";\nconst TIME_STRING_NOW_GENERATOR_ID = \"timeStringNow\";\nconst TIMETZ_NOW_GENERATOR_ID = \"timetzNow\";\nconst UTC_OFFSET = \"+00\";\nconst MAX_TIME_PRECISION = 6;\nfunction fractionDigitsOf(params) {\n\tconst precision = params?.[\"precision\"];\n\treturn typeof precision === \"number\" ? precision : MAX_TIME_PRECISION;\n}\nfunction utcNow(fractionDigits = MAX_TIME_PRECISION) {\n\tconst iso = new Date(Date.now()).toISOString();\n\tconst [wholeSeconds = \"\", fraction = \"\"] = iso.slice(11, -1).split(\".\");\n\tconst kept = fraction.slice(0, fractionDigits).replace(/0+$/, \"\");\n\treturn {\n\t\tdate: iso.slice(0, 10),\n\t\ttime: kept === \"\" ? wholeSeconds : `${wholeSeconds}.${kept}`\n\t};\n}\n/** Rounds down, so PostgreSQL stores the value without rounding it up, which can reach `24:00:00`. */\nfunction truncateTime(time, fractionDigits) {\n\tif (fractionDigits <= 0) return time.round({\n\t\tsmallestUnit: \"second\",\n\t\troundingMode: \"trunc\"\n\t});\n\tconst smallestUnit = fractionDigits <= 3 ? \"millisecond\" : \"microsecond\";\n\tconst unitDigits = fractionDigits <= 3 ? 3 : 6;\n\treturn time.round({\n\t\tsmallestUnit,\n\t\troundingIncrement: 10 ** (unitDigits - Math.min(fractionDigits, unitDigits)),\n\t\troundingMode: \"trunc\"\n\t});\n}\nfunction utcDateTimeNow(generatorId) {\n\treturn requireTemporal({ generatorId }).Instant.fromEpochMilliseconds(Date.now()).toZonedDateTimeISO(\"UTC\");\n}\nfunction instantNow() {\n\treturn requireTemporal({ generatorId: INSTANT_NOW_GENERATOR_ID }).Instant.fromEpochMilliseconds(Date.now());\n}\nfunction plainDateTimeNow() {\n\treturn utcDateTimeNow(PLAIN_DATE_TIME_NOW_GENERATOR_ID).toPlainDateTime();\n}\nfunction plainDateNow() {\n\treturn utcDateTimeNow(PLAIN_DATE_NOW_GENERATOR_ID).toPlainDate();\n}\nfunction plainTimeNow(params) {\n\treturn truncateTime(utcDateTimeNow(PLAIN_TIME_NOW_GENERATOR_ID).toPlainTime(), fractionDigitsOf(params));\n}\nfunction timestampStringNow() {\n\tconst { date, time } = utcNow();\n\treturn `${date} ${time}`;\n}\nfunction timestamptzStringNow() {\n\treturn `${timestampStringNow()}${UTC_OFFSET}`;\n}\nfunction dateStringNow() {\n\treturn utcNow().date;\n}\nfunction timeStringNow(params) {\n\treturn utcNow(fractionDigitsOf(params)).time;\n}\nfunction timetzNow(params) {\n\treturn `${timeStringNow(params)}${UTC_OFFSET}`;\n}\nconst postgresNowGenerators = [\n\t{\n\t\tid: INSTANT_NOW_GENERATOR_ID,\n\t\tgenerate: instantNow\n\t},\n\t{\n\t\tid: PLAIN_DATE_TIME_NOW_GENERATOR_ID,\n\t\tgenerate: plainDateTimeNow\n\t},\n\t{\n\t\tid: PLAIN_DATE_NOW_GENERATOR_ID,\n\t\tgenerate: plainDateNow\n\t},\n\t{\n\t\tid: PLAIN_TIME_NOW_GENERATOR_ID,\n\t\tgenerate: plainTimeNow\n\t},\n\t{\n\t\tid: TIMESTAMP_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: timestampStringNow\n\t},\n\t{\n\t\tid: TIMESTAMPTZ_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: timestamptzStringNow\n\t},\n\t{\n\t\tid: DATE_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: dateStringNow\n\t},\n\t{\n\t\tid: TIME_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: timeStringNow\n\t},\n\t{\n\t\tid: TIMETZ_NOW_GENERATOR_ID,\n\t\tgenerate: timetzNow\n\t}\n];\nfunction postgresNowGeneratorControlDescriptors() {\n\treturn postgresNowGenerators.map(({ id }) => ({ id }));\n}\n//#endregion\n//#region src/core/now-generators.ts\n/** The \"now\" generator for each codec that has one. The `temporal` field presets read it. */\nconst postgresNowGeneratorIds = {\n\t[PG_DATE_TEMPORAL_CODEC_ID]: PLAIN_DATE_NOW_GENERATOR_ID,\n\t[PG_DATE_STRING_CODEC_ID]: DATE_STRING_NOW_GENERATOR_ID,\n\t[PG_TIME_TEMPORAL_CODEC_ID]: PLAIN_TIME_NOW_GENERATOR_ID,\n\t[PG_TIME_STRING_CODEC_ID]: TIME_STRING_NOW_GENERATOR_ID,\n\t[PG_TIMETZ_CODEC_ID]: TIMETZ_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_TEMPORAL_CODEC_ID]: PLAIN_DATE_TIME_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_STRING_CODEC_ID]: TIMESTAMP_STRING_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]: INSTANT_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_STRING_CODEC_ID]: TIMESTAMPTZ_STRING_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_DATE_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID\n};\nnew Map(Object.entries(postgresNowGeneratorIds));\n/** The codecs whose \"now\" generator takes the column's precision, so that it rounds down where PostgreSQL would round a time up to `24:00:00`. */\nconst postgresNowGeneratorTakesPrecision = {\n\t[PG_TIME_TEMPORAL_CODEC_ID]: true,\n\t[PG_TIME_STRING_CODEC_ID]: true,\n\t[PG_TIMETZ_CODEC_ID]: true\n};\n/** The `now` generator function bound to each Postgres date and time codec, with the column's precision on the three time codecs. */\nconst postgresNowGeneratorFunction = {\n\tname: \"now\",\n\tbindings: Object.entries(postgresNowGeneratorIds).map(([codecId, generatorId]) => singleGeneratorBinding({\n\t\tcodecIds: [codecId],\n\t\tgeneratorId,\n\t\tparamsFromField: (column) => {\n\t\t\tconst precision = column.typeParams?.[\"precision\"];\n\t\t\treturn Object.hasOwn(postgresNowGeneratorTakesPrecision, codecId) && typeof precision === \"number\" ? { precision } : void 0;\n\t\t}\n\t}))\n};\n//#endregion\n//#region src/core/authoring.ts\nconst PSL_POLICY_INVALID_MAP = \"PSL_POLICY_INVALID_MAP\";\nconst PSL_FULL_TEXT_INDEX_TOO_MANY_GROUPS = \"PSL_FULL_TEXT_INDEX_TOO_MANY_GROUPS\";\nconst PSL_FULL_TEXT_INDEX_EMPTY_GROUP = \"PSL_FULL_TEXT_INDEX_EMPTY_GROUP\";\nconst PSL_FULL_TEXT_INDEX_DUPLICATE_FIELD = \"PSL_FULL_TEXT_INDEX_DUPLICATE_FIELD\";\nconst PSL_FULL_TEXT_INDEX_REQUIRES_NAME = \"PSL_FULL_TEXT_INDEX_REQUIRES_NAME\";\nconst PSL_FULL_TEXT_INDEX_NAME_XOR_MAP = \"PSL_FULL_TEXT_INDEX_NAME_XOR_MAP\";\nconst PSL_FULL_TEXT_INDEX_TEXT_FIELD = \"PSL_FULL_TEXT_INDEX_TEXT_FIELD\";\nconst PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE = \"PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE\";\nconst PSL_NATIVE_ENUM_MISSING_MEMBERS = \"PSL_NATIVE_ENUM_MISSING_MEMBERS\";\nconst PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE = \"PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE\";\n/**\n* `pg.enum(<ref>)` registers as an ordinary type constructor whose sole\n* positional argument names a `native_enum` entity instead of carrying a\n* literal value. The interpreter resolves the ref to the `native_enum`\n* entity generically (driven by `entityRefArg`); the `pg/enum@1` codec\n* descriptor's `columnFromEntity` hook (see `codecs.ts`) converts that\n* entity into the column's `typeParams`. The column's type name comes from the\n* `pg/enum` data type, which renders `typeParams.typeName`.\n*/\nconst postgresAuthoringTypes = {\n\tBigIntNumber: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A PostgreSQL 64-bit integer represented as a JavaScript number within its safe integer range.\",\n\t\toutput: { codecId: \"pg/int8number@1\" }\n\t},\n\tUnboundedInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An arbitrary-precision integer stored as PostgreSQL numeric and represented as bigint.\",\n\t\toutput: { codecId: \"pg/unboundedint@1\" }\n\t},\n\tpg: { enum: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tentityRefArg: {\n\t\t\tindex: 0,\n\t\t\tentityKind: \"native_enum\"\n\t\t},\n\t\toutput: { codecId: PG_ENUM_CODEC_ID }\n\t} }\n};\nconst policyTargetParam = {\n\ttype: entityRef({ kind: \"model\" }),\n\tdocumentation: \"The model protected by this policy; it must declare @@rls.\"\n};\nconst policyRolesParam = {\n\ttype: optional(list(oneOf(entityRef({\n\t\tkind: \"block\",\n\t\tkeyword: \"role\"\n\t}), identifier()))),\n\tdocumentation: \"The database roles to which this policy applies.\"\n};\nfunction policyUsingParam(ctx) {\n\treturn {\n\t\ttype: optional(dataTypeValue(SQL_EXPRESSION_DATA_TYPE_ID, ctx.dataTypes)),\n\t\tdocumentation: \"A SQL predicate controlling which rows this policy permits.\"\n\t};\n}\nfunction policyWithCheckParam(ctx) {\n\treturn {\n\t\ttype: optional(dataTypeValue(SQL_EXPRESSION_DATA_TYPE_ID, ctx.dataTypes)),\n\t\tdocumentation: \"A SQL predicate checking rows being written by this policy.\"\n\t};\n}\nconst policyPermissiveParam = {\n\ttype: optional(bool()),\n\tdocumentation: \"Whether the policy is permissive (combined with OR) rather than restrictive (combined with AND).\"\n};\nfunction policyUsingOnlySpec(ctx) {\n\treturn structBlock({ parameters: {\n\t\ttarget: policyTargetParam,\n\t\troles: policyRolesParam,\n\t\tusing: policyUsingParam(ctx),\n\t\tpermissive: policyPermissiveParam\n\t} });\n}\nfunction policyWithCheckOnlySpec(ctx) {\n\treturn structBlock({ parameters: {\n\t\ttarget: policyTargetParam,\n\t\troles: policyRolesParam,\n\t\twithCheck: policyWithCheckParam(ctx),\n\t\tpermissive: policyPermissiveParam\n\t} });\n}\nfunction policyBothPredicatesSpec(ctx) {\n\treturn structBlock({ parameters: {\n\t\ttarget: policyTargetParam,\n\t\troles: policyRolesParam,\n\t\tusing: policyUsingParam(ctx),\n\t\twithCheck: policyWithCheckParam(ctx),\n\t\tpermissive: policyPermissiveParam\n\t} });\n}\nfunction roleSpec() {\n\treturn structBlock({ parameters: {} });\n}\nfunction nativeEnumSpec() {\n\treturn mapBlock({ value: {\n\t\ttype: str(),\n\t\tdocumentation: \"The member value stored in the database enum type.\"\n\t} });\n}\n/**\n* The block keyword that authors each row-level security operation. The keyword is the operation, so\n* a policy block has no `operation` parameter. The reader looks a block's operation up here, and\n* `contract infer` and `contract print` look up the keyword to write.\n*/\nconst POLICY_BLOCK_KEYWORDS = {\n\tselect: \"policy_select\",\n\tinsert: \"policy_insert\",\n\tupdate: \"policy_update\",\n\tdelete: \"policy_delete\",\n\tall: \"policy_all\"\n};\nfunction isRlsPolicyOperation(value) {\n\treturn Object.hasOwn(POLICY_BLOCK_KEYWORDS, value);\n}\n/** The operation a `policy_<operation>` block keyword authors, or `undefined` for another keyword. */\nfunction policyOperationOfKeyword(keyword) {\n\treturn Object.keys(POLICY_BLOCK_KEYWORDS).filter(isRlsPolicyOperation).find((operation) => POLICY_BLOCK_KEYWORDS[operation] === keyword);\n}\n/**\n* Assembles a {@link PostgresRlsPolicy} from lowered inputs: normalizes the\n* predicates, computes the content-hash wire name, and constructs the frozen\n* entity. The single hash-assembly body shared by the PSL block lowering\n* ({@link lowerRlsPolicyFromBlock}) and the TS entity-handle lowering\n* ({@link postgresLowerEntityHandles}) so the two surfaces cannot drift.\n*/\nfunction buildRlsPolicyEntity(input) {\n\tconst permissive = input.permissive ?? true;\n\tconst wireHash = computeContentHash({\n\t\t...ifDefined(\"using\", input.using !== void 0 ? normalizeSqlBody(input.using) : void 0),\n\t\t...ifDefined(\"withCheck\", input.withCheck !== void 0 ? normalizeSqlBody(input.withCheck) : void 0),\n\t\troles: input.roles,\n\t\toperation: input.operation,\n\t\tpermissive\n\t});\n\treturn new PostgresRlsPolicy({\n\t\tnaming: {\n\t\t\tkind: \"wire\",\n\t\t\tprefix: input.prefix,\n\t\t\thash: wireHash\n\t\t},\n\t\ttableName: input.tableName,\n\t\tnamespaceId: input.namespaceId,\n\t\toperation: input.operation,\n\t\troles: input.roles,\n\t\tusing: input.using,\n\t\twithCheck: input.withCheck,\n\t\tpermissive\n\t});\n}\nfunction lowerRlsPolicyFromBlock(block, ctx) {\n\tconst prefix = block.name;\n\tconst operation = policyOperationOfKeyword(block.keyword) ?? \"select\";\n\tconst target = block.resolvedModelRefs?.[\"target\"];\n\tassertDefined(target, `lowerRlsPolicyFromBlock: policy \"${block.name}\" reached the factory without a projected \\`target\\` coordinate; the interpreter projects checked model references before invoking entity factories.`);\n\tconst roles = block.values.roles === void 0 ? [] : block.values.roles.map((role) => typeof role === \"string\" ? role : role.declaration.name).sort();\n\tconst using = block.values.using === void 0 ? void 0 : sqlTextFromStored(block.values.using.value.value);\n\tconst withCheck = block.values.withCheck === void 0 ? void 0 : sqlTextFromStored(block.values.withCheck.value.value);\n\tconst permissive = block.values.permissive ?? true;\n\tconst mapAttr = block.attributes[\"map\"];\n\tif (mapAttr !== void 0) {\n\t\tconst exactName = mapAttr.args[\"name\"];\n\t\tinvariant(typeof exactName === \"string\", \"@@map on a policy block parses one string argument\");\n\t\tctx.warnings?.push(exactNameBodyWarning(\"policy\", exactName));\n\t\treturn new PostgresRlsPolicy({\n\t\t\tnaming: {\n\t\t\t\tkind: \"exact\",\n\t\t\t\tname: exactName\n\t\t\t},\n\t\t\ttableName: target.tableName,\n\t\t\tnamespaceId: target.namespaceId,\n\t\t\toperation,\n\t\t\troles,\n\t\t\tusing,\n\t\t\twithCheck,\n\t\t\tpermissive\n\t\t});\n\t}\n\treturn buildRlsPolicyEntity({\n\t\tprefix,\n\t\ttableName: target.tableName,\n\t\tnamespaceId: target.namespaceId,\n\t\toperation,\n\t\troles,\n\t\t...ifDefined(\"using\", using),\n\t\t...ifDefined(\"withCheck\", withCheck),\n\t\tpermissive\n\t});\n}\nconst policyEntityTypeOutput = {\n\tfactory: lowerRlsPolicyFromBlock,\n\tpslPlacement: (entity) => ({ namespaceId: entity.namespaceId })\n};\nfunction lowerNativeEnumFromBlock(block, ctx) {\n\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\tconst diagnostics = ctx.diagnostics;\n\tconst mapAttr = block.attributes[\"map\"];\n\tlet typeName = block.name;\n\tif (mapAttr !== void 0) {\n\t\tconst mapped = mapAttr.args[\"name\"];\n\t\tinvariant(typeof mapped === \"string\", \"@@map on a native_enum block parses one string argument\");\n\t\ttypeName = mapped;\n\t}\n\tlet memberError = false;\n\tconst seenValues = /* @__PURE__ */ new Set();\n\tconst members = [];\n\tfor (const [memberName, value] of Object.entries(block.values)) {\n\t\tif (seenValues.has(value)) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE,\n\t\t\t\tmessage: `native_enum \"${block.name}\": duplicate member value \"${value}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.parameterSpans[memberName] ?? block.span\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tseenValues.add(value);\n\t\tmembers.push(value);\n\t}\n\tif (memberError) return void 0;\n\tif (members.length === 0) {\n\t\tdiagnostics?.push({\n\t\t\tcode: PSL_NATIVE_ENUM_MISSING_MEMBERS,\n\t\t\tmessage: `native_enum \"${block.name}\" must have at least one member`,\n\t\t\tsourceId,\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\treturn new PostgresNativeEnum({\n\t\ttypeName,\n\t\tmembers\n\t});\n}\n/**\n* `native_enum`'s entity-type factory output, checked separately from the assembled\n* `postgresAuthoringEntityTypes` map below: `deriveValueSet` is SQL-family surface\n* ({@link SqlValueSetDerivingEntityTypeOutput}), not part of the framework\n* `AuthoringEntityTypeFactoryOutput` shape, so folding it directly into the map's single\n* `satisfies AuthoringEntityTypeNamespace` check would trip an excess-property error. Checking it\n* here against the intersection of both shapes keeps it structurally valid against each without\n* widening the map's own check.\n*/\nconst nativeEnumEntityTypeOutput = {\n\tfactory: lowerNativeEnumFromBlock,\n\tderiveValueSet: (entity) => ({\n\t\tkind: \"valueSet\",\n\t\tvalues: [...entity.members]\n\t})\n};\n/**\n* Lowers a `role <name> {}` block into a {@link PostgresRole}. Roles are\n* cluster-scoped in Postgres, so the block must be declared inside\n* `namespace unbound { … }` — any other lexical namespace (a named schema,\n* or the default bucket top-level declarations resolve to) is a load-time\n* diagnostic. The lowered entity carries the unbound coordinate.\n*/\nfunction lowerRoleFromBlock(block, ctx) {\n\tif (block.namespaceId !== UNBOUND_NAMESPACE_ID) {\n\t\tctx.diagnostics?.push({\n\t\t\tcode: PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE,\n\t\t\tmessage: `\\`role\\` block \"${block.name}\" must be declared inside \\`namespace unbound { }\\`, not in namespace \"${block.namespaceId}\"`,\n\t\t\tsourceId: ctx.sourceId ?? \"unknown\",\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\treturn new PostgresRole({\n\t\tname: block.name,\n\t\tnamespaceId: UNBOUND_NAMESPACE_ID\n\t});\n}\nconst postgresAuthoringEntityTypes = {\n\trole: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"role\",\n\t\tvalidatorSchema: PostgresRoleSchema,\n\t\toutput: { factory: lowerRoleFromBlock }\n\t},\n\trls: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"rls\",\n\t\tvalidatorSchema: PostgresRlsEnablementSchema,\n\t\toutput: { factory: (input) => new PostgresRlsEnablement(input) }\n\t},\n\tpolicy: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"policy\",\n\t\tvalidatorSchema: PostgresRlsPolicySchema,\n\t\toutput: policyEntityTypeOutput\n\t},\n\tnative_enum: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"native_enum\",\n\t\tvalidatorSchema: PostgresNativeEnumSchema,\n\t\toutput: nativeEnumEntityTypeOutput\n\t}\n};\n/**\n* Field presets contributed by the Postgres target pack.\n*\n* These mirror the PSL scalar-to-codec mapping used by the Postgres adapter\n* (see `createPostgresPslScalarTypeDescriptors`), so that authoring a field\n* via the TS callback surface (e.g. `field.int()`) and via the PSL scalar\n* surface (e.g. `Int`) lowers to byte-identical contracts.\n*\n* The `uuidNative` / `id.uuidv4Native` / `id.uuidv7Native` presets use the\n* native Postgres `uuid` type (codecId `pg/uuid@1`). For cross-target\n* portability use `uuidString` / `id.uuidv4String` / `id.uuidv7String` from\n* the family pack instead.\n*/\nconst policyRequiresRls = {\n\tparameter: \"target\",\n\tattribute: \"rls\"\n};\nconst policyMapAttribute = blockAttribute(\"map\", {\n\tdocumentation: \"Maps this row-level security policy to its PostgreSQL policy name.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The nonempty PostgreSQL policy name.\"\n\t}],\n\trefine: (parsed, ctx, attributeNode) => parsed.name === \"\" ? [leafDiagnostic(ctx, attributeNode, \"@@map policy name must be a non-empty string\", PSL_POLICY_INVALID_MAP)] : []\n});\nconst policyBlockAttributes = { map: () => policyMapAttribute };\nconst nativeEnumMapAttribute = blockAttribute(\"map\", {\n\tdocumentation: \"Maps this native enum to its PostgreSQL type name.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The PostgreSQL enum type name.\"\n\t}]\n});\nconst postgresAuthoringPslBlockDescriptors = {\n\t[POLICY_BLOCK_KEYWORDS.select]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.select,\n\t\tdocumentation: \"Defines a row-level security policy controlling which rows can be selected.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyUsingOnlySpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.delete]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.delete,\n\t\tdocumentation: \"Defines a row-level security policy controlling which rows can be deleted.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyUsingOnlySpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.insert]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.insert,\n\t\tdocumentation: \"Defines a row-level security policy checking rows being inserted.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyWithCheckOnlySpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.update]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.update,\n\t\tdocumentation: \"Defines a row-level security policy controlling row visibility and checks for updates.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyBothPredicatesSpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.all]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.all,\n\t\tdocumentation: \"Defines a row-level security policy applying to all operations.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyBothPredicatesSpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\tnative_enum: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"native_enum\",\n\t\tdocumentation: \"Defines a PostgreSQL enum type with named string-valued members.\",\n\t\tdiscriminator: \"native_enum\",\n\t\tname: { required: true },\n\t\tspec: nativeEnumSpec,\n\t\tnameIsStorageName: true,\n\t\tattributes: { map: () => nativeEnumMapAttribute }\n\t},\n\t/**\n\t* PSL block descriptor for `role` (e.g. `role anon {}`). Name-only, no\n\t* parameters and no body content. Declared inside `namespace unbound { }`\n\t* — see {@link lowerRoleFromBlock} for the placement check and the\n\t* coordinate the lowered entity carries.\n\t*/\n\trole: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"role\",\n\t\tdocumentation: \"Declares an existing database role in namespace unbound for use in security policies.\",\n\t\tdiscriminator: \"role\",\n\t\tname: { required: true },\n\t\tspec: roleSpec\n\t}\n};\nconst postgresRlsSpec = modelAttribute(\"rls\", { documentation: \"Enables PostgreSQL row-level security on this model’s table.\" });\nconst postgresRlsSpecFactory = () => postgresRlsSpec;\nconst [firstLanguage, ...remainingLanguages] = POSTGRES_TEXT_SEARCH_LANGUAGES;\nconst fullTextField = fieldRef();\nfunction postgresFullTextIndexSpec(ctx) {\n\treturn modelAttribute(\"fullTextIndex\", {\n\t\tdocumentation: \"Indexes text fields for full-text search. Each item of the list is a weight group, strongest first; a nested list puts several fields in one group. Pass the index from the table's `indexes` to `fullTextMatches` and `fullTextRank` to search the same document.\",\n\t\tpositional: [{\n\t\t\tkey: \"fields\",\n\t\t\ttype: oneOf(fullTextField, list(oneOf(fullTextField, list(fullTextField)), {\n\t\t\t\tallowEmpty: false,\n\t\t\t\tlabel: \"(field name | field name[])[]\"\n\t\t\t})),\n\t\t\tdocumentation: \"The fields to index: one field, or a list of fields and lists of fields. Each top-level item is a weight group, from A down to D.\"\n\t\t}],\n\t\tnamed: {\n\t\t\tlanguage: {\n\t\t\t\ttype: optional(oneOf(str(firstLanguage), ...remainingLanguages.map((language) => str(language)))),\n\t\t\t\tdocumentation: \"The text-search configuration. Defaults to `english`, and must match the language the query operations are given.\"\n\t\t\t},\n\t\t\tname: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The index name. Mutually exclusive with `map`.\"\n\t\t\t},\n\t\t\tmap: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The database index name. Mutually exclusive with `name`.\"\n\t\t\t},\n\t\t\twhere: {\n\t\t\t\ttype: optional(dataTypeValue(SQL_EXPRESSION_DATA_TYPE_ID, ctx.dataTypes)),\n\t\t\t\tdocumentation: \"The SQL predicate restricting rows included in a partial index.\"\n\t\t\t}\n\t\t},\n\t\trefine: (value, ctx, attributeNode) => {\n\t\t\tconst diagnostics = fullTextIndexProblems({ weightGroups: weightGroupsOf(value.fields, isFieldName) }).filter(isPslFullTextIndexProblem).map((problem) => leafDiagnostic(ctx, attributeNode, describeFullTextIndexProblem(\"`@@fullTextIndex`\", problem), FULL_TEXT_INDEX_PROBLEM_CODES[problem.kind]));\n\t\t\tif (value.name === void 0 && value.map === void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@fullTextIndex` requires a `name` or `map` argument\", PSL_FULL_TEXT_INDEX_REQUIRES_NAME));\n\t\t\tif (value.name !== void 0 && value.map !== void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@fullTextIndex` takes at most one of `name` and `map`\", PSL_FULL_TEXT_INDEX_NAME_XOR_MAP));\n\t\t\treturn diagnostics;\n\t\t}\n\t});\n}\nfunction isFieldName(value) {\n\treturn typeof value === \"string\";\n}\nfunction isPslFullTextIndexProblem(problem) {\n\treturn problem.kind !== \"unique\" && problem.kind !== \"no-fields\";\n}\nconst FULL_TEXT_INDEX_PROBLEM_CODES = {\n\t\"too-many-groups\": PSL_FULL_TEXT_INDEX_TOO_MANY_GROUPS,\n\t\"empty-group\": PSL_FULL_TEXT_INDEX_EMPTY_GROUP,\n\t\"duplicate-field\": PSL_FULL_TEXT_INDEX_DUPLICATE_FIELD,\n\t\"not-text\": PSL_FULL_TEXT_INDEX_TEXT_FIELD\n};\nconst postgresFullTextIndexSpecFactory = (ctx) => postgresFullTextIndexSpec(ctx);\n/**\n* `@@` model attributes contributed by the Postgres target pack.\n*\n* `@@rls` is argument-less: presence marks the model's table\n* RLS-controlled. It lowers to a {@link PostgresRlsEnablement} marker in\n* the namespace's `entries.rls`, keyed by the model's table name — the\n* marker (never the policy set) is what drives\n* `ENABLE`/`DISABLE ROW LEVEL SECURITY` planning.\n*/\nconst postgresAuthoringModelAttributes = {\n\trls: {\n\t\tkind: \"modelAttribute\",\n\t\tattribute: \"rls\",\n\t\tspec: postgresRlsSpecFactory,\n\t\tlower: (_parsed, ctx) => ({\n\t\t\tkey: ctx.storageName,\n\t\t\tentity: new PostgresRlsEnablement({\n\t\t\t\ttableName: ctx.storageName,\n\t\t\t\tnamespaceId: ctx.namespaceId\n\t\t\t})\n\t\t})\n\t},\n\tfullTextIndex: {\n\t\tkind: \"modelAttribute\",\n\t\tattribute: \"fullTextIndex\",\n\t\tspec: postgresFullTextIndexSpecFactory,\n\t\trepeatable: true,\n\t\tlower: (parsed, ctx) => {\n\t\t\tconst fieldGroups = weightGroupsOf(parsed.fields, isFieldName);\n\t\t\tconst problems = fullTextIndexProblems({\n\t\t\t\tweightGroups: fieldGroups,\n\t\t\t\tcodecs: {\n\t\t\t\t\tcodecIdOf: (fieldName) => ctx.fieldStorageName(fieldName) === void 0 ? void 0 : ctx.fieldCodecId(fieldName),\n\t\t\t\t\ttraitsOf: postgresCodecTraitsOf\n\t\t\t\t}\n\t\t\t}).filter(isPslFullTextIndexProblem);\n\t\t\tfor (const problem of problems) ctx.diagnostics?.push({\n\t\t\t\tcode: FULL_TEXT_INDEX_PROBLEM_CODES[problem.kind],\n\t\t\t\tmessage: describeFullTextIndexProblem(\"`@@fullTextIndex`\", problem, (fieldName) => `${ctx.modelName}.${fieldName}`),\n\t\t\t\tsourceId: ctx.sourceId ?? \"unknown\"\n\t\t\t});\n\t\t\tif (problems.length > 0) return void 0;\n\t\t\tconst weightGroups = fieldGroups.map((group) => group.map((fieldName) => {\n\t\t\t\tconst columnName = ctx.fieldStorageName(fieldName);\n\t\t\t\tassertDefined(columnName, `@@fullTextIndex field \"${fieldName}\" has no storage column`);\n\t\t\t\treturn columnName;\n\t\t\t}));\n\t\t\treturn { index: {\n\t\t\t\tcolumns: weightGroups.flat(),\n\t\t\t\ttype: FULL_TEXT_INDEX_TYPE,\n\t\t\t\toptions: {\n\t\t\t\t\tweightGroups,\n\t\t\t\t\tlanguage: parsed.language ?? \"english\"\n\t\t\t\t},\n\t\t\t\twhere: parsed.where === void 0 ? void 0 : sqlTextFromStored(parsed.where.value.value),\n\t\t\t\tunique: void 0,\n\t\t\t\tname: parsed.name,\n\t\t\t\tmap: parsed.map\n\t\t\t} };\n\t\t}\n\t}\n};\nconst postgresAuthoringFieldPresets = {\n\ttext: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/text@1\" }\n\t},\n\tint: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/int4@1\" }\n\t},\n\tbigint: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/int8@1\" }\n\t},\n\tfloat: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/float8@1\" }\n\t},\n\tdecimal: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/numeric@1\" }\n\t},\n\tboolean: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/bool@1\" }\n\t},\n\tjson: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/jsonb@1\" }\n\t},\n\tbytes: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/bytea@1\" }\n\t},\n\tdateTime: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/timestamptz-temporal@1\" }\n\t},\n\ttemporal: {\n\t\tcreatedAtJsDate: (/* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]\n\t\t})).createdAt,\n\t\tupdatedAtJsDate: (/* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]\n\t\t})).updatedAt,\n\t\ttimestamptzJsDate: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]\n\t\t}),\n\t\t.../* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\t.../* @__PURE__ */ temporalStringAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_STRING_CODEC_ID]\n\t\t}),\n\t\ttimestamp: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMP_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMP_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\ttimestamptz: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\ttimestampString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMP_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMP_STRING_CODEC_ID]\n\t\t}),\n\t\ttimestamptzString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMPTZ_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_STRING_CODEC_ID]\n\t\t}),\n\t\tdate: /* @__PURE__ */ temporalCodecPreset({\n\t\t\tcodecId: PG_DATE_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_DATE_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\tdateString: /* @__PURE__ */ temporalCodecPreset({\n\t\t\tcodecId: PG_DATE_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_DATE_STRING_CODEC_ID]\n\t\t}),\n\t\ttime: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIME_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIME_TEMPORAL_CODEC_ID],\n\t\t\tnowTakesPrecision: postgresNowGeneratorTakesPrecision[PG_TIME_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\ttimeString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIME_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIME_STRING_CODEC_ID],\n\t\t\tnowTakesPrecision: postgresNowGeneratorTakesPrecision[PG_TIME_STRING_CODEC_ID]\n\t\t}),\n\t\t/** Produces a string: no Temporal type holds a time of day with an offset. */\n\t\ttimetz: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMETZ_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMETZ_CODEC_ID],\n\t\t\tnowTakesPrecision: postgresNowGeneratorTakesPrecision[PG_TIMETZ_CODEC_ID]\n\t\t})\n\t},\n\tuuidNative: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/uuid@1\" }\n\t},\n\tid: {\n\t\tuuidv4Native: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv4\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tuuidv7Native: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv7\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t}\n\t}\n};\nfunction predicateText(predicate, what) {\n\treturn predicate === void 0 ? void 0 : requireSqlExpression(predicate, what).text;\n}\n/**\n* Resolves an entity handle's `target` ref to a table coordinate of this\n* contract, or throws the load-time diagnostic naming the handle: a\n* cross-space target is rejected (you cannot CREATE POLICY on a table\n* another space owns) and an unresolved target names the model.\n*/\nfunction requireLocalTarget(refs, subject) {\n\tconst target = refs[\"target\"];\n\tif (target !== void 0 && target.kind === \"resolved\") return {\n\t\tnamespaceId: target.namespaceId,\n\t\ttableName: target.tableName\n\t};\n\tif (target !== void 0 && target.kind === \"cross-space\") throw postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: ${subject} targets model \"${target.modelName ?? target.tableName}\", which lives in another contract space. Policies and rlsEnabled entries must target a model declared in this contract.`, { meta: {\n\t\tmodel: target.modelName ?? target.tableName,\n\t\treason: \"cross-space-target\"\n\t} });\n\tthrow postgresError(\"CONTRACT.MODEL_UNKNOWN\", `defineContract: ${subject} targets model \"${target?.modelName ?? \"<anonymous>\"}\", which is not in the contract's models. Add the model to \\`models\\`.`, { meta: { model: target?.modelName ?? \"<anonymous>\" } });\n}\n/**\n* The SQL-family entity-handle batch lowering hook for the Postgres pack\n* (`SqlEntityHandleLoweringContribution`). Receives every `entities` handle\n* whose kind this pack registered — batch, so the cross-entity diagnostics\n* (duplicate prefix, policy without rlsEnabled, duplicate role) can see\n* sibling handles — and lowers them with the same keying and hash assembly\n* as the PSL path: `policy` keyed by prefix (wire name via\n* {@link buildRlsPolicyEntity}), `rls` keyed by table name, `role` keyed by\n* name and filed under the default namespace (roles are declared\n* contract-wide; PSL has no role block to set a precedent).\n*/\nfunction postgresLowerEntityHandles(input) {\n\tconst enablements = /* @__PURE__ */ new Map();\n\tconst roles = /* @__PURE__ */ new Map();\n\tconst policies = [];\n\tconst coordinateKey = (coordinate) => `${coordinate.namespaceId} ${coordinate.tableName}`;\n\tfor (const { handle, refs } of input.handles) switch (handle.entityKind) {\n\t\tcase \"rls\": {\n\t\t\tconst coordinate = requireLocalTarget(refs, \"an rlsEnabled entry\");\n\t\t\tconst key = coordinateKey(coordinate);\n\t\t\tif (!enablements.has(key)) enablements.set(key, {\n\t\t\t\tcoordinate,\n\t\t\t\tentity: new PostgresRlsEnablement({\n\t\t\t\t\ttableName: coordinate.tableName,\n\t\t\t\t\tnamespaceId: coordinate.namespaceId\n\t\t\t\t})\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\tcase \"role\": {\n\t\t\tconst roleHandle = blindCast(handle);\n\t\t\tif (roles.has(roleHandle.name)) throw postgresError(\"CONTRACT.ROLE_INVALID\", `defineContract: role \"${roleHandle.name}\" is declared more than once in the entities list.`, { meta: {\n\t\t\t\trole: roleHandle.name,\n\t\t\t\treason: \"duplicate\"\n\t\t\t} });\n\t\t\troles.set(roleHandle.name, new PostgresRole({\n\t\t\t\tname: roleHandle.name,\n\t\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID\n\t\t\t}));\n\t\t\tbreak;\n\t\t}\n\t\tcase \"policy\": {\n\t\t\tconst policyHandle = blindCast(handle);\n\t\t\tpolicies.push({\n\t\t\t\thandle: policyHandle,\n\t\t\t\trefs\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\tdefault: throw postgresError(\"CONTRACT.ENTITY_KIND_INVALID\", `defineContract: the postgres pack does not lower \"${handle.entityKind}\" handles from the entities list.`, { meta: { entityKind: handle.entityKind } });\n\t}\n\tconst rows = [];\n\tconst seenPrefixes = /* @__PURE__ */ new Set();\n\tfor (const { handle: policy, refs } of policies) {\n\t\tconst prefix = policy.name;\n\t\tassertWireNamePrefixLength(prefix, \"defineContract: policy prefix\");\n\t\tconst coordinate = requireLocalTarget(refs, `policy \"${prefix}\"`);\n\t\tif (!enablements.has(coordinateKey(coordinate))) {\n\t\t\tconst target = refs[\"target\"];\n\t\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: policy \"${prefix}\" targets model \"${target?.modelName ?? coordinate.tableName}\", whose table is not RLS-enabled. Add rlsEnabled(<model>) to the entities list.`, { meta: {\n\t\t\t\tprefix,\n\t\t\t\tmodel: target?.modelName ?? coordinate.tableName,\n\t\t\t\treason: \"target-not-rls-enabled\"\n\t\t\t} });\n\t\t}\n\t\tconst prefixKey = `${coordinate.namespaceId} ${prefix}`;\n\t\tif (seenPrefixes.has(prefixKey)) throw postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: policy prefix \"${prefix}\" is declared more than once in namespace \"${coordinate.namespaceId}\". Policy prefixes must be unique per namespace.`, { meta: {\n\t\t\tprefix,\n\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\treason: \"duplicate-prefix\"\n\t\t} });\n\t\tseenPrefixes.add(prefixKey);\n\t\tconst roleNames = [...new Set(policy.roles.map((roleHandle) => roleHandle.name))].sort();\n\t\trows.push({\n\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\tentityKind: \"policy\",\n\t\t\tkey: prefix,\n\t\t\tentity: buildRlsPolicyEntity({\n\t\t\t\tprefix,\n\t\t\t\ttableName: coordinate.tableName,\n\t\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\t\toperation: policy.operation,\n\t\t\t\troles: roleNames,\n\t\t\t\t...ifDefined(\"using\", predicateText(policy.using, `Policy \"${prefix}\" using`)),\n\t\t\t\t...ifDefined(\"withCheck\", predicateText(policy.withCheck, `Policy \"${prefix}\" withCheck`))\n\t\t\t})\n\t\t});\n\t}\n\tfor (const { coordinate, entity } of enablements.values()) rows.push({\n\t\tnamespaceId: coordinate.namespaceId,\n\t\tentityKind: \"rls\",\n\t\tkey: coordinate.tableName,\n\t\tentity\n\t});\n\tfor (const [name, entity] of roles) rows.push({\n\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\tentityKind: \"role\",\n\t\tkey: name,\n\t\tentity\n\t});\n\treturn rows;\n}\n//#endregion\nexport { postgresAuthoringPslBlockDescriptors as a, postgresNowGeneratorFunction as c, postgresAuthoringModelAttributes as i, postgresNowGeneratorControlDescriptors as l, postgresAuthoringEntityTypes as n, postgresAuthoringTypes as o, postgresAuthoringFieldPresets as r, postgresLowerEntityHandles as s, POLICY_BLOCK_KEYWORDS as t, postgresNowGenerators as u };\n\n//# sourceMappingURL=authoring-CArQ0ZSb.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAM,2BAA2B;AACjC,MAAM,mCAAmC;AACzC,MAAM,8BAA8B;AACpC,MAAM,8BAA8B;AACpC,MAAM,oCAAoC;AAC1C,MAAM,sCAAsC;AAC5C,MAAM,+BAA+B;AACrC,MAAM,+BAA+B;AACrC,MAAM,0BAA0B;AAChC,MAAM,aAAa;AACnB,MAAM,qBAAqB;AAC3B,SAAS,iBAAiB,QAAQ;CACjC,MAAM,YAAY,SAAS;CAC3B,OAAO,OAAO,cAAc,WAAW,YAAY;AACpD;AACA,SAAS,OAAO,iBAAiB,oBAAoB;CACpD,MAAM,MAAM,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY;CAC7C,MAAM,CAAC,eAAe,IAAI,WAAW,MAAM,IAAI,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG;CACtE,MAAM,OAAO,SAAS,MAAM,GAAG,cAAc,CAAC,CAAC,QAAQ,OAAO,EAAE;CAChE,OAAO;EACN,MAAM,IAAI,MAAM,GAAG,EAAE;EACrB,MAAM,SAAS,KAAK,eAAe,GAAG,aAAa,GAAG;CACvD;AACD;;AAEA,SAAS,aAAa,MAAM,gBAAgB;CAC3C,IAAI,kBAAkB,GAAG,OAAO,KAAK,MAAM;EAC1C,cAAc;EACd,cAAc;CACf,CAAC;CACD,MAAM,eAAe,kBAAkB,IAAI,gBAAgB;CAC3D,MAAM,aAAa,kBAAkB,IAAI,IAAI;CAC7C,OAAO,KAAK,MAAM;EACjB;EACA,mBAAmB,OAAO,aAAa,KAAK,IAAI,gBAAgB,UAAU;EAC1E,cAAc;CACf,CAAC;AACF;AACA,SAAS,eAAe,aAAa;CACpC,OAAO,gBAAgB,EAAE,YAAY,CAAC,CAAC,CAAC,QAAQ,sBAAs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R"}
@@ -1,5 +1,5 @@
1
- import { E as pgInt8, T as pgInt4, w as pgInt2 } from "./data-types-Cs-LkJBw-CJN57Y5M.mjs";
2
- //#region ../../../3-targets/3-targets/postgres/dist/autoincrement-widths-1v9UfTSw.mjs
1
+ import { E as pgInt8, T as pgInt4, w as pgInt2 } from "./data-types-DhBM9bIL-CVDQGAGw.mjs";
2
+ //#region ../../../3-targets/3-targets/postgres/dist/autoincrement-widths-BeDdQuMU.mjs
3
3
  const SMALL = {
4
4
  serialType: "SMALLSERIAL",
5
5
  sequenceType: "smallint",
@@ -55,4 +55,4 @@ function hasAutoincrementDefault(column) {
55
55
  //#endregion
56
56
  export { hasAutoincrementDefault as i, autoincrementWidthOfDataType as n, autoincrementWidthOfPseudoType as r, autoincrementWidth as t };
57
57
 
58
- //# sourceMappingURL=autoincrement-widths-1v9UfTSw-NFaqRGCV.mjs.map
58
+ //# sourceMappingURL=autoincrement-widths-BeDdQuMU-CFDf2ypW.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"autoincrement-widths-1v9UfTSw-NFaqRGCV.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/autoincrement-widths-1v9UfTSw.mjs"],"sourcesContent":["import { _ as pgInt8, g as pgInt4, h as pgInt2 } from \"./data-types-Cs-LkJBw.mjs\";\n//#region src/core/migrations/autoincrement-widths.ts\nconst SMALL = {\n\tserialType: \"SMALLSERIAL\",\n\tsequenceType: \"smallint\",\n\tmaxValue: \"32767\"\n};\nconst REGULAR = {\n\tserialType: \"SERIAL\",\n\tsequenceType: \"integer\",\n\tmaxValue: \"2147483647\"\n};\nconst BIG = {\n\tserialType: \"BIGSERIAL\",\n\tsequenceType: \"bigint\",\n\tmaxValue: \"9223372036854775807\"\n};\nconst WIDTH_BY_COLUMN_TYPE = /* @__PURE__ */ new Map([\n\t[\"int2\", SMALL],\n\t[\"smallint\", SMALL],\n\t[\"int4\", REGULAR],\n\t[\"integer\", REGULAR],\n\t[\"int8\", BIG],\n\t[\"bigint\", BIG]\n]);\n/** The autoincrement width of a column of `columnType`; `undefined` for a column that is not a scalar smallint, integer or bigint. */\nfunction autoincrementWidth(columnType) {\n\treturn WIDTH_BY_COLUMN_TYPE.get(columnType.toLowerCase());\n}\nconst WIDTH_BY_PSEUDO_TYPE = /* @__PURE__ */ new Map([\n\t[\"smallserial\", SMALL],\n\t[\"serial2\", SMALL],\n\t[\"serial\", REGULAR],\n\t[\"serial4\", REGULAR],\n\t[\"bigserial\", BIG],\n\t[\"serial8\", BIG]\n]);\n/** The autoincrement width of a column written with a SERIAL pseudo-type, such as `SERIAL` or `bigserial`; `undefined` for any other type. Postgres stores the column as the width's `sequenceType`. */\nfunction autoincrementWidthOfPseudoType(columnType) {\n\treturn WIDTH_BY_PSEUDO_TYPE.get(columnType.trim().toLowerCase());\n}\nconst WIDTH_BY_DATA_TYPE = /* @__PURE__ */ new Map([\n\t[pgInt2.id, SMALL],\n\t[pgInt4.id, REGULAR],\n\t[pgInt8.id, BIG]\n]);\n/** The autoincrement width of a column whose data type is `dataTypeId`; `undefined` unless it is `pg/int2`, `pg/int4` or `pg/int8`. */\nfunction autoincrementWidthOfDataType(dataTypeId) {\n\treturn WIDTH_BY_DATA_TYPE.get(dataTypeId);\n}\n/** Whether a schema column takes its values from a sequence: a SERIAL column's `nextval(...)` default and an identity column both read as `autoincrement()`. */\nfunction hasAutoincrementDefault(column) {\n\treturn column.resolvedDefault?.kind === \"function\" && column.resolvedDefault.expression === \"autoincrement()\";\n}\n//#endregion\nexport { hasAutoincrementDefault as i, autoincrementWidthOfDataType as n, autoincrementWidthOfPseudoType as r, autoincrementWidth as t };\n\n//# sourceMappingURL=autoincrement-widths-1v9UfTSw.mjs.map"],"mappings":";;AAEA,MAAM,QAAQ;CACb,YAAY;CACZ,cAAc;CACd,UAAU;AACX;AACA,MAAM,UAAU;CACf,YAAY;CACZ,cAAc;CACd,UAAU;AACX;AACA,MAAM,MAAM;CACX,YAAY;CACZ,cAAc;CACd,UAAU;AACX;AACA,MAAM,uCAAuC,IAAI,IAAI;CACpD,CAAC,QAAQ,KAAK;CACd,CAAC,YAAY,KAAK;CAClB,CAAC,QAAQ,OAAO;CAChB,CAAC,WAAW,OAAO;CACnB,CAAC,QAAQ,GAAG;CACZ,CAAC,UAAU,GAAG;AACf,CAAC;;AAED,SAAS,mBAAmB,YAAY;CACvC,OAAO,qBAAqB,IAAI,WAAW,YAAY,CAAC;AACzD;AACA,MAAM,uCAAuC,IAAI,IAAI;CACpD,CAAC,eAAe,KAAK;CACrB,CAAC,WAAW,KAAK;CACjB,CAAC,UAAU,OAAO;CAClB,CAAC,WAAW,OAAO;CACnB,CAAC,aAAa,GAAG;CACjB,CAAC,WAAW,GAAG;AAChB,CAAC;;AAED,SAAS,+BAA+B,YAAY;CACnD,OAAO,qBAAqB,IAAI,WAAW,KAAK,CAAC,CAAC,YAAY,CAAC;AAChE;AACA,MAAM,qCAAqC,IAAI,IAAI;CAClD,CAAC,OAAO,IAAI,KAAK;CACjB,CAAC,OAAO,IAAI,OAAO;CACnB,CAAC,OAAO,IAAI,GAAG;AAChB,CAAC;;AAED,SAAS,6BAA6B,YAAY;CACjD,OAAO,mBAAmB,IAAI,UAAU;AACzC;;AAEA,SAAS,wBAAwB,QAAQ;CACxC,OAAO,OAAO,iBAAiB,SAAS,cAAc,OAAO,gBAAgB,eAAe;AAC7F"}
1
+ {"version":3,"file":"autoincrement-widths-BeDdQuMU-CFDf2ypW.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/autoincrement-widths-BeDdQuMU.mjs"],"sourcesContent":["import { _ as pgInt8, g as pgInt4, h as pgInt2 } from \"./data-types-DhBM9bIL.mjs\";\n//#region src/core/migrations/autoincrement-widths.ts\nconst SMALL = {\n\tserialType: \"SMALLSERIAL\",\n\tsequenceType: \"smallint\",\n\tmaxValue: \"32767\"\n};\nconst REGULAR = {\n\tserialType: \"SERIAL\",\n\tsequenceType: \"integer\",\n\tmaxValue: \"2147483647\"\n};\nconst BIG = {\n\tserialType: \"BIGSERIAL\",\n\tsequenceType: \"bigint\",\n\tmaxValue: \"9223372036854775807\"\n};\nconst WIDTH_BY_COLUMN_TYPE = /* @__PURE__ */ new Map([\n\t[\"int2\", SMALL],\n\t[\"smallint\", SMALL],\n\t[\"int4\", REGULAR],\n\t[\"integer\", REGULAR],\n\t[\"int8\", BIG],\n\t[\"bigint\", BIG]\n]);\n/** The autoincrement width of a column of `columnType`; `undefined` for a column that is not a scalar smallint, integer or bigint. */\nfunction autoincrementWidth(columnType) {\n\treturn WIDTH_BY_COLUMN_TYPE.get(columnType.toLowerCase());\n}\nconst WIDTH_BY_PSEUDO_TYPE = /* @__PURE__ */ new Map([\n\t[\"smallserial\", SMALL],\n\t[\"serial2\", SMALL],\n\t[\"serial\", REGULAR],\n\t[\"serial4\", REGULAR],\n\t[\"bigserial\", BIG],\n\t[\"serial8\", BIG]\n]);\n/** The autoincrement width of a column written with a SERIAL pseudo-type, such as `SERIAL` or `bigserial`; `undefined` for any other type. Postgres stores the column as the width's `sequenceType`. */\nfunction autoincrementWidthOfPseudoType(columnType) {\n\treturn WIDTH_BY_PSEUDO_TYPE.get(columnType.trim().toLowerCase());\n}\nconst WIDTH_BY_DATA_TYPE = /* @__PURE__ */ new Map([\n\t[pgInt2.id, SMALL],\n\t[pgInt4.id, REGULAR],\n\t[pgInt8.id, BIG]\n]);\n/** The autoincrement width of a column whose data type is `dataTypeId`; `undefined` unless it is `pg/int2`, `pg/int4` or `pg/int8`. */\nfunction autoincrementWidthOfDataType(dataTypeId) {\n\treturn WIDTH_BY_DATA_TYPE.get(dataTypeId);\n}\n/** Whether a schema column takes its values from a sequence: a SERIAL column's `nextval(...)` default and an identity column both read as `autoincrement()`. */\nfunction hasAutoincrementDefault(column) {\n\treturn column.resolvedDefault?.kind === \"function\" && column.resolvedDefault.expression === \"autoincrement()\";\n}\n//#endregion\nexport { hasAutoincrementDefault as i, autoincrementWidthOfDataType as n, autoincrementWidthOfPseudoType as r, autoincrementWidth as t };\n\n//# sourceMappingURL=autoincrement-widths-BeDdQuMU.mjs.map"],"mappings":";;AAEA,MAAM,QAAQ;CACb,YAAY;CACZ,cAAc;CACd,UAAU;AACX;AACA,MAAM,UAAU;CACf,YAAY;CACZ,cAAc;CACd,UAAU;AACX;AACA,MAAM,MAAM;CACX,YAAY;CACZ,cAAc;CACd,UAAU;AACX;AACA,MAAM,uCAAuC,IAAI,IAAI;CACpD,CAAC,QAAQ,KAAK;CACd,CAAC,YAAY,KAAK;CAClB,CAAC,QAAQ,OAAO;CAChB,CAAC,WAAW,OAAO;CACnB,CAAC,QAAQ,GAAG;CACZ,CAAC,UAAU,GAAG;AACf,CAAC;;AAED,SAAS,mBAAmB,YAAY;CACvC,OAAO,qBAAqB,IAAI,WAAW,YAAY,CAAC;AACzD;AACA,MAAM,uCAAuC,IAAI,IAAI;CACpD,CAAC,eAAe,KAAK;CACrB,CAAC,WAAW,KAAK;CACjB,CAAC,UAAU,OAAO;CAClB,CAAC,WAAW,OAAO;CACnB,CAAC,aAAa,GAAG;CACjB,CAAC,WAAW,GAAG;AAChB,CAAC;;AAED,SAAS,+BAA+B,YAAY;CACnD,OAAO,qBAAqB,IAAI,WAAW,KAAK,CAAC,CAAC,YAAY,CAAC;AAChE;AACA,MAAM,qCAAqC,IAAI,IAAI;CAClD,CAAC,OAAO,IAAI,KAAK;CACjB,CAAC,OAAO,IAAI,OAAO;CACnB,CAAC,OAAO,IAAI,GAAG;AAChB,CAAC;;AAED,SAAS,6BAA6B,YAAY;CACjD,OAAO,mBAAmB,IAAI,UAAU;AACzC;;AAEA,SAAS,wBAAwB,QAAQ;CACxC,OAAO,OAAO,iBAAiB,SAAS,cAAc,OAAO,gBAAgB,eAAe;AAC7F"}
@@ -1,5 +1,5 @@
1
- import { SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID } from "@prisma/orm-family-sql/relational-core/ast";
2
- //#region ../../../3-targets/3-targets/postgres/dist/codec-ids-Cb0yO-IS.mjs
1
+ import { SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_RAW_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID } from "@prisma/orm-family-sql/relational-core/ast";
2
+ //#region ../../../3-targets/3-targets/postgres/dist/codec-ids-BMhEpFwv.mjs
3
3
  const PG_TEXT_CODEC_ID = "pg/text@1";
4
4
  const PG_TEXT_ARRAY_CODEC_ID = "pg/text-array@1";
5
5
  const PG_ENUM_CODEC_ID = "pg/enum@1";
@@ -36,6 +36,6 @@ const PG_UUID_CODEC_ID = "pg/uuid@1";
36
36
  const PG_INET_CODEC_ID = "pg/inet@1";
37
37
  const PG_TSQUERY_CODEC_ID = "pg/tsquery@1";
38
38
  //#endregion
39
- export { PG_TIME_TEMPORAL_CODEC_ID as A, SQL_VARCHAR_CODEC_ID as B, PG_TIMESTAMPTZ_DATE_CODEC_ID as C, PG_TIMESTAMP_TEMPORAL_CODEC_ID as D, PG_TIMESTAMP_STRING_CODEC_ID as E, PG_VARCHAR_CODEC_ID as F, SQL_CHAR_CODEC_ID as I, SQL_FLOAT_CODEC_ID as L, PG_UNBOUNDED_INT_CODEC_ID as M, PG_UUID_CODEC_ID as N, PG_TIMETZ_CODEC_ID as O, PG_VARBIT_CODEC_ID as P, SQL_INT_CODEC_ID as R, PG_TEXT_CODEC_ID as S, PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID as T, PG_INT_CODEC_ID as _, PG_DATE_STRING_CODEC_ID as a, PG_NUMERIC_CODEC_ID as b, PG_FLOAT4_CODEC_ID as c, PG_INET_CODEC_ID as d, PG_INT2_CODEC_ID as f, PG_INTERVAL_CODEC_ID as g, PG_INT8_NUMBER_CODEC_ID as h, PG_CHAR_CODEC_ID as i, PG_TSQUERY_CODEC_ID as j, PG_TIME_STRING_CODEC_ID as k, PG_FLOAT8_CODEC_ID as l, PG_INT8_CODEC_ID as m, PG_BOOL_CODEC_ID as n, PG_DATE_TEMPORAL_CODEC_ID as o, PG_INT4_CODEC_ID as p, PG_BYTEA_CODEC_ID as r, PG_ENUM_CODEC_ID as s, PG_BIT_CODEC_ID as t, PG_FLOAT_CODEC_ID as u, PG_JSONB_CODEC_ID as v, PG_TIMESTAMPTZ_STRING_CODEC_ID as w, PG_TEXT_ARRAY_CODEC_ID as x, PG_JSON_CODEC_ID as y, SQL_TEXT_CODEC_ID as z };
39
+ export { PG_TIME_TEMPORAL_CODEC_ID as A, SQL_TEXT_CODEC_ID as B, PG_TIMESTAMPTZ_DATE_CODEC_ID as C, PG_TIMESTAMP_TEMPORAL_CODEC_ID as D, PG_TIMESTAMP_STRING_CODEC_ID as E, PG_VARCHAR_CODEC_ID as F, SQL_CHAR_CODEC_ID as I, SQL_FLOAT_CODEC_ID as L, PG_UNBOUNDED_INT_CODEC_ID as M, PG_UUID_CODEC_ID as N, PG_TIMETZ_CODEC_ID as O, PG_VARBIT_CODEC_ID as P, SQL_INT_CODEC_ID as R, PG_TEXT_CODEC_ID as S, PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID as T, SQL_VARCHAR_CODEC_ID as V, PG_INT_CODEC_ID as _, PG_DATE_STRING_CODEC_ID as a, PG_NUMERIC_CODEC_ID as b, PG_FLOAT4_CODEC_ID as c, PG_INET_CODEC_ID as d, PG_INT2_CODEC_ID as f, PG_INTERVAL_CODEC_ID as g, PG_INT8_NUMBER_CODEC_ID as h, PG_CHAR_CODEC_ID as i, PG_TSQUERY_CODEC_ID as j, PG_TIME_STRING_CODEC_ID as k, PG_FLOAT8_CODEC_ID as l, PG_INT8_CODEC_ID as m, PG_BOOL_CODEC_ID as n, PG_DATE_TEMPORAL_CODEC_ID as o, PG_INT4_CODEC_ID as p, PG_BYTEA_CODEC_ID as r, PG_ENUM_CODEC_ID as s, PG_BIT_CODEC_ID as t, PG_FLOAT_CODEC_ID as u, PG_JSONB_CODEC_ID as v, PG_TIMESTAMPTZ_STRING_CODEC_ID as w, PG_TEXT_ARRAY_CODEC_ID as x, PG_JSON_CODEC_ID as y, SQL_RAW_CODEC_ID as z };
40
40
 
41
- //# sourceMappingURL=codec-ids-Cb0yO-IS--e0P2rfI.mjs.map
41
+ //# sourceMappingURL=codec-ids-BMhEpFwv-BLIC4g3Y.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-ids-BMhEpFwv-BLIC4g3Y.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-ids-BMhEpFwv.mjs"],"sourcesContent":["import { SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_RAW_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID } from \"@internal/sql-relational-core/ast\";\n//#region src/core/codec-ids.ts\nconst PG_TEXT_CODEC_ID = \"pg/text@1\";\nconst PG_TEXT_ARRAY_CODEC_ID = \"pg/text-array@1\";\nconst PG_ENUM_CODEC_ID = \"pg/enum@1\";\nconst PG_CHAR_CODEC_ID = \"pg/char@1\";\nconst PG_VARCHAR_CODEC_ID = \"pg/varchar@1\";\nconst PG_INT_CODEC_ID = \"pg/int@1\";\nconst PG_INT2_CODEC_ID = \"pg/int2@1\";\nconst PG_INT4_CODEC_ID = \"pg/int4@1\";\nconst PG_INT8_CODEC_ID = \"pg/int8@1\";\nconst PG_INT8_NUMBER_CODEC_ID = \"pg/int8number@1\";\nconst PG_FLOAT_CODEC_ID = \"pg/float@1\";\nconst PG_FLOAT4_CODEC_ID = \"pg/float4@1\";\nconst PG_FLOAT8_CODEC_ID = \"pg/float8@1\";\nconst PG_NUMERIC_CODEC_ID = \"pg/numeric@1\";\nconst PG_UNBOUNDED_INT_CODEC_ID = \"pg/unboundedint@1\";\nconst PG_BOOL_CODEC_ID = \"pg/bool@1\";\nconst PG_BIT_CODEC_ID = \"pg/bit@1\";\nconst PG_VARBIT_CODEC_ID = \"pg/varbit@1\";\nconst PG_DATE_TEMPORAL_CODEC_ID = \"pg/date-temporal@1\";\nconst PG_TIMESTAMP_TEMPORAL_CODEC_ID = \"pg/timestamp-temporal@1\";\nconst PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID = \"pg/timestamptz-temporal@1\";\nconst PG_TIME_TEMPORAL_CODEC_ID = \"pg/time-temporal@1\";\nconst PG_DATE_STRING_CODEC_ID = \"pg/date-string@1\";\nconst PG_TIMESTAMP_STRING_CODEC_ID = \"pg/timestamp-string@1\";\nconst PG_TIMESTAMPTZ_STRING_CODEC_ID = \"pg/timestamptz-string@1\";\nconst PG_TIMESTAMPTZ_DATE_CODEC_ID = \"pg/timestamptz-date@1\";\nconst PG_TIME_STRING_CODEC_ID = \"pg/time-string@1\";\nconst PG_TIMETZ_CODEC_ID = \"pg/timetz@1\";\nconst PG_INTERVAL_CODEC_ID = \"pg/interval@1\";\nconst PG_JSON_CODEC_ID = \"pg/json@1\";\nconst PG_JSONB_CODEC_ID = \"pg/jsonb@1\";\nconst PG_BYTEA_CODEC_ID = \"pg/bytea@1\";\nconst PG_UUID_CODEC_ID = \"pg/uuid@1\";\nconst PG_INET_CODEC_ID = \"pg/inet@1\";\nconst PG_TSQUERY_CODEC_ID = \"pg/tsquery@1\";\n//#endregion\nexport { PG_TIME_TEMPORAL_CODEC_ID as A, SQL_TEXT_CODEC_ID as B, PG_TIMESTAMPTZ_DATE_CODEC_ID as C, PG_TIMESTAMP_TEMPORAL_CODEC_ID as D, PG_TIMESTAMP_STRING_CODEC_ID as E, PG_VARCHAR_CODEC_ID as F, SQL_CHAR_CODEC_ID as I, SQL_FLOAT_CODEC_ID as L, PG_UNBOUNDED_INT_CODEC_ID as M, PG_UUID_CODEC_ID as N, PG_TIMETZ_CODEC_ID as O, PG_VARBIT_CODEC_ID as P, SQL_INT_CODEC_ID as R, PG_TEXT_CODEC_ID as S, PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID as T, SQL_VARCHAR_CODEC_ID as V, PG_INT_CODEC_ID as _, PG_DATE_STRING_CODEC_ID as a, PG_NUMERIC_CODEC_ID as b, PG_FLOAT4_CODEC_ID as c, PG_INET_CODEC_ID as d, PG_INT2_CODEC_ID as f, PG_INTERVAL_CODEC_ID as g, PG_INT8_NUMBER_CODEC_ID as h, PG_CHAR_CODEC_ID as i, PG_TSQUERY_CODEC_ID as j, PG_TIME_STRING_CODEC_ID as k, PG_FLOAT8_CODEC_ID as l, PG_INT8_CODEC_ID as m, PG_BOOL_CODEC_ID as n, PG_DATE_TEMPORAL_CODEC_ID as o, PG_INT4_CODEC_ID as p, PG_BYTEA_CODEC_ID as r, PG_ENUM_CODEC_ID as s, PG_BIT_CODEC_ID as t, PG_FLOAT_CODEC_ID as u, PG_JSONB_CODEC_ID as v, PG_TIMESTAMPTZ_STRING_CODEC_ID as w, PG_TEXT_ARRAY_CODEC_ID as x, PG_JSON_CODEC_ID as y, SQL_RAW_CODEC_ID as z };\n\n//# sourceMappingURL=codec-ids-BMhEpFwv.mjs.map"],"mappings":";;AAEA,MAAM,mBAAmB;AACzB,MAAM,yBAAyB;AAC/B,MAAM,mBAAmB;AACzB,MAAM,mBAAmB;AACzB,MAAM,sBAAsB;AAC5B,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;AACzB,MAAM,mBAAmB;AACzB,MAAM,mBAAmB;AACzB,MAAM,0BAA0B;AAChC,MAAM,oBAAoB;AAC1B,MAAM,qBAAqB;AAC3B,MAAM,qBAAqB;AAC3B,MAAM,sBAAsB;AAC5B,MAAM,4BAA4B;AAClC,MAAM,mBAAmB;AACzB,MAAM,kBAAkB;AACxB,MAAM,qBAAqB;AAC3B,MAAM,4BAA4B;AAClC,MAAM,iCAAiC;AACvC,MAAM,mCAAmC;AACzC,MAAM,4BAA4B;AAClC,MAAM,0BAA0B;AAChC,MAAM,+BAA+B;AACrC,MAAM,iCAAiC;AACvC,MAAM,+BAA+B;AACrC,MAAM,0BAA0B;AAChC,MAAM,qBAAqB;AAC3B,MAAM,uBAAuB;AAC7B,MAAM,mBAAmB;AACzB,MAAM,oBAAoB;AAC1B,MAAM,oBAAoB;AAC1B,MAAM,mBAAmB;AACzB,MAAM,mBAAmB;AACzB,MAAM,sBAAsB"}
@@ -0,0 +1 @@
1
+ import "./codec-ids-C6II64Wy-CCU5G6CU.mjs";
@@ -1,5 +1,5 @@
1
- import { SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID } from "@prisma/orm-family-sql/relational-core/ast";
2
- //#region ../../../3-targets/3-targets/postgres/dist/codec-ids-jWpRZjZo.d.mts
1
+ import { SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_RAW_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID } from "@prisma/orm-family-sql/relational-core/ast";
2
+ //#region ../../../3-targets/3-targets/postgres/dist/codec-ids-C6II64Wy.d.mts
3
3
  //#region src/core/codec-ids.d.ts
4
4
  declare const PG_TEXT_CODEC_ID: "pg/text@1";
5
5
  declare const PG_TEXT_ARRAY_CODEC_ID: "pg/text-array@1";
@@ -37,5 +37,5 @@ declare const PG_UUID_CODEC_ID: "pg/uuid@1";
37
37
  declare const PG_INET_CODEC_ID: "pg/inet@1";
38
38
  declare const PG_TSQUERY_CODEC_ID: "pg/tsquery@1";
39
39
  //#endregion
40
- export { PG_TIME_TEMPORAL_CODEC_ID as A, SQL_VARCHAR_CODEC_ID as B, PG_TIMESTAMPTZ_DATE_CODEC_ID as C, PG_TIMESTAMP_TEMPORAL_CODEC_ID as D, PG_TIMESTAMP_STRING_CODEC_ID as E, PG_VARCHAR_CODEC_ID as F, SQL_CHAR_CODEC_ID as I, SQL_FLOAT_CODEC_ID as L, PG_UNBOUNDED_INT_CODEC_ID as M, PG_UUID_CODEC_ID as N, PG_TIMETZ_CODEC_ID as O, PG_VARBIT_CODEC_ID as P, SQL_INT_CODEC_ID as R, PG_TEXT_CODEC_ID as S, PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID as T, PG_INT_CODEC_ID as _, PG_DATE_STRING_CODEC_ID as a, PG_NUMERIC_CODEC_ID as b, PG_FLOAT4_CODEC_ID as c, PG_INET_CODEC_ID as d, PG_INT2_CODEC_ID as f, PG_INTERVAL_CODEC_ID as g, PG_INT8_NUMBER_CODEC_ID as h, PG_CHAR_CODEC_ID as i, PG_TSQUERY_CODEC_ID as j, PG_TIME_STRING_CODEC_ID as k, PG_FLOAT8_CODEC_ID as l, PG_INT8_CODEC_ID as m, PG_BOOL_CODEC_ID as n, PG_DATE_TEMPORAL_CODEC_ID as o, PG_INT4_CODEC_ID as p, PG_BYTEA_CODEC_ID as r, PG_ENUM_CODEC_ID as s, PG_BIT_CODEC_ID as t, PG_FLOAT_CODEC_ID as u, PG_JSONB_CODEC_ID as v, PG_TIMESTAMPTZ_STRING_CODEC_ID as w, PG_TEXT_ARRAY_CODEC_ID as x, PG_JSON_CODEC_ID as y, SQL_TEXT_CODEC_ID as z };
41
- //# sourceMappingURL=codec-ids-jWpRZjZo-BKIzyx-J.d.mts.map
40
+ export { PG_TIME_TEMPORAL_CODEC_ID as A, SQL_TEXT_CODEC_ID as B, PG_TIMESTAMPTZ_DATE_CODEC_ID as C, PG_TIMESTAMP_TEMPORAL_CODEC_ID as D, PG_TIMESTAMP_STRING_CODEC_ID as E, PG_VARCHAR_CODEC_ID as F, SQL_CHAR_CODEC_ID as I, SQL_FLOAT_CODEC_ID as L, PG_UNBOUNDED_INT_CODEC_ID as M, PG_UUID_CODEC_ID as N, PG_TIMETZ_CODEC_ID as O, PG_VARBIT_CODEC_ID as P, SQL_INT_CODEC_ID as R, PG_TEXT_CODEC_ID as S, PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID as T, SQL_VARCHAR_CODEC_ID as V, PG_INT_CODEC_ID as _, PG_DATE_STRING_CODEC_ID as a, PG_NUMERIC_CODEC_ID as b, PG_FLOAT4_CODEC_ID as c, PG_INET_CODEC_ID as d, PG_INT2_CODEC_ID as f, PG_INTERVAL_CODEC_ID as g, PG_INT8_NUMBER_CODEC_ID as h, PG_CHAR_CODEC_ID as i, PG_TSQUERY_CODEC_ID as j, PG_TIME_STRING_CODEC_ID as k, PG_FLOAT8_CODEC_ID as l, PG_INT8_CODEC_ID as m, PG_BOOL_CODEC_ID as n, PG_DATE_TEMPORAL_CODEC_ID as o, PG_INT4_CODEC_ID as p, PG_BYTEA_CODEC_ID as r, PG_ENUM_CODEC_ID as s, PG_BIT_CODEC_ID as t, PG_FLOAT_CODEC_ID as u, PG_JSONB_CODEC_ID as v, PG_TIMESTAMPTZ_STRING_CODEC_ID as w, PG_TEXT_ARRAY_CODEC_ID as x, PG_JSON_CODEC_ID as y, SQL_RAW_CODEC_ID as z };
41
+ //# sourceMappingURL=codec-ids-C6II64Wy-CCU5G6CU.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec-ids-jWpRZjZo-BKIzyx-J.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-ids-jWpRZjZo.d.mts"],"mappings":";;;cAEc;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA"}
1
+ {"version":3,"file":"codec-ids-C6II64Wy-CCU5G6CU.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-ids-C6II64Wy.d.mts"],"mappings":";;;cAEc;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA"}
@@ -1,10 +1,10 @@
1
1
  import { n as buildPostgresCodecDescriptorRegistry } from "./codec-descriptor-DSMjoW72-ZoCcTHLX.mjs";
2
- import { i as createPostgresBuiltinDataTypeLookup } from "./data-types-Cs-LkJBw-CJN57Y5M.mjs";
3
- import { r as codecDescriptors } from "./codecs-UZ1NEbvk-CMnI6Ti0.mjs";
2
+ import { i as createPostgresBuiltinDataTypeLookup } from "./data-types-DhBM9bIL-CVDQGAGw.mjs";
3
+ import { r as codecDescriptors } from "./codecs-DNjF5kIh-BkybYk_D.mjs";
4
4
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
5
5
  import { extractCodecLookup } from "@prisma/orm-framework/components/control";
6
6
  import { buildCodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/codec-descriptor-registry";
7
- //#region ../../../3-targets/3-targets/postgres/dist/codec-registry-T79ktJL4.mjs
7
+ //#region ../../../3-targets/3-targets/postgres/dist/codec-registry-C8ymMRsH.mjs
8
8
  /**
9
9
  * Registry of every codec descriptor shipped by `@internal/target-postgres`.
10
10
  *
@@ -58,4 +58,4 @@ function createPostgresBuiltinCodecLookup() {
58
58
  //#endregion
59
59
  export { postgresCodecDescriptorRegistry as a, createPostgresCodecRegistryWithBuiltins as i, assemblePostgresCodecRegistryWithBuiltins as n, postgresCodecRegistry as o, createPostgresBuiltinCodecLookup as r, assemblePostgresCodecRegistry as t };
60
60
 
61
- //# sourceMappingURL=codec-registry-T79ktJL4-B9_zlIhI.mjs.map
61
+ //# sourceMappingURL=codec-registry-C8ymMRsH-B48NRqXL.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec-registry-T79ktJL4-B9_zlIhI.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-registry-T79ktJL4.mjs"],"sourcesContent":["import { t as createPostgresBuiltinDataTypeLookup } from \"./data-types-Cs-LkJBw.mjs\";\nimport { n as buildPostgresCodecDescriptorRegistry } from \"./codec-descriptor-DSMjoW72.mjs\";\nimport { t as codecDescriptors } from \"./codecs-UZ1NEbvk.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { extractCodecLookup } from \"@internal/framework-components/control\";\nimport { buildCodecDescriptorRegistry } from \"@internal/sql-relational-core/codec-descriptor-registry\";\n//#region src/core/registry.ts\n/**\n* Registry of every codec descriptor shipped by `@internal/target-postgres`.\n*\n* Public consumer surface for the postgres codec set: the postgres adapter and any other consumer that needs to enumerate or look up a postgres codec by id consumes this rather than the raw descriptor array. See ADR 208.\n*/\nconst postgresCodecRegistry = buildCodecDescriptorRegistry(codecDescriptors);\nconst postgresCodecDescriptorRegistry = buildPostgresCodecDescriptorRegistry(codecDescriptors);\n//#endregion\n//#region src/core/codec-registry.ts\n/**\n* A registry of `descriptors`, refusing a codec whose data type `dataTypeLookup` does not have: the\n* SQL renderer writes a parameter's cast from the data type its codec represents.\n*/\nfunction buildPostgresCodecRegistry(descriptors, dataTypeLookup) {\n\tconst descriptorRegistry = buildPostgresCodecDescriptorRegistry(descriptors);\n\tconst validatedDescriptors = Array.from(descriptorRegistry.values());\n\tfor (const descriptor of validatedDescriptors) if (!dataTypeLookup.has(descriptor.dataType)) throw structuredError(\"CONTRACT.DATA_TYPE_UNREGISTERED\", `Codec \"${descriptor.codecId}\" represents data type \"${descriptor.dataType}\", which no component registers.`, {\n\t\twhy: \"A parameter of this codec is written with a cast named by its data type.\",\n\t\tfix: \"Pass the data type beside the codec: in `dataTypes` of createPostgresAdapter, or in the `dataTypes` of the extension that contributes the codec.\",\n\t\tmeta: {\n\t\t\tcodecId: descriptor.codecId,\n\t\t\tdataType: descriptor.dataType\n\t\t}\n\t});\n\tconst registry = {\n\t\t...extractCodecLookup([{\n\t\t\tid: \"postgres-codecs\",\n\t\t\ttypes: { codecTypes: { codecDescriptors: validatedDescriptors } }\n\t\t}]),\n\t\tdescriptorFor: (codecId) => descriptorRegistry.descriptorFor(codecId),\n\t\tvalues: () => descriptorRegistry.values()\n\t};\n\treturn Object.freeze(registry);\n}\nfunction assemblePostgresCodecRegistry(components, dataTypeLookup) {\n\treturn buildPostgresCodecRegistry(components.flatMap((component) => component.types?.codecTypes?.codecDescriptors ?? []), dataTypeLookup);\n}\nfunction assemblePostgresCodecRegistryWithBuiltins(extensions, dataTypeLookup) {\n\treturn buildPostgresCodecRegistry([...postgresCodecDescriptorRegistry.values(), ...extensions.flatMap((extension) => extension.types?.codecTypes?.codecDescriptors ?? [])], dataTypeLookup);\n}\n/** A registry of the built-in codecs and `codecDescriptors`, whose data types `dataTypeLookup` has. */\nfunction createPostgresCodecRegistryWithBuiltins(codecDescriptors = [], dataTypeLookup = createPostgresBuiltinDataTypeLookup()) {\n\treturn buildPostgresCodecRegistry([...postgresCodecDescriptorRegistry.values(), ...codecDescriptors], dataTypeLookup);\n}\n/**\n* Build a coherent PostgreSQL codec registry populated with built-in descriptors only.\n*\n* The returned registry supports both ordinary codec materialization and PostgreSQL target behavior. Stack-composed paths build the same combined registry from their complete ordered descriptor contributions.\n*/\nfunction createPostgresBuiltinCodecLookup() {\n\treturn createPostgresCodecRegistryWithBuiltins();\n}\n//#endregion\nexport { postgresCodecDescriptorRegistry as a, createPostgresCodecRegistryWithBuiltins as i, assemblePostgresCodecRegistryWithBuiltins as n, postgresCodecRegistry as o, createPostgresBuiltinCodecLookup as r, assemblePostgresCodecRegistry as t };\n\n//# sourceMappingURL=codec-registry-T79ktJL4.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,wBAAwB,6BAA6B,gBAAgB;AAC3E,MAAM,kCAAkC,qCAAqC,gBAAgB;;;;;AAO7F,SAAS,2BAA2B,aAAa,gBAAgB;CAChE,MAAM,qBAAqB,qCAAqC,WAAW;CAC3E,MAAM,uBAAuB,MAAM,KAAK,mBAAmB,OAAO,CAAC;CACnE,KAAK,MAAM,cAAc,sBAAsB,IAAI,CAAC,eAAe,IAAI,WAAW,QAAQ,GAAG,MAAM,gBAAgB,mCAAmC,UAAU,WAAW,QAAQ,0BAA0B,WAAW,SAAS,mCAAmC;EACnQ,KAAK;EACL,KAAK;EACL,MAAM;GACL,SAAS,WAAW;GACpB,UAAU,WAAW;EACtB;CACD,CAAC;CACD,MAAM,WAAW;EAChB,GAAG,mBAAmB,CAAC;GACtB,IAAI;GACJ,OAAO,EAAE,YAAY,EAAE,kBAAkB,qBAAqB,EAAE;EACjE,CAAC,CAAC;EACF,gBAAgB,YAAY,mBAAmB,cAAc,OAAO;EACpE,cAAc,mBAAmB,OAAO;CACzC;CACA,OAAO,OAAO,OAAO,QAAQ;AAC9B;AACA,SAAS,8BAA8B,YAAY,gBAAgB;CAClE,OAAO,2BAA2B,WAAW,SAAS,cAAc,UAAU,OAAO,YAAY,oBAAoB,CAAC,CAAC,GAAG,cAAc;AACzI;AACA,SAAS,0CAA0C,YAAY,gBAAgB;CAC9E,OAAO,2BAA2B,CAAC,GAAG,gCAAgC,OAAO,GAAG,GAAG,WAAW,SAAS,cAAc,UAAU,OAAO,YAAY,oBAAoB,CAAC,CAAC,CAAC,GAAG,cAAc;AAC3L;;AAEA,SAAS,wCAAwC,mBAAmB,CAAC,GAAG,iBAAiB,oCAAoC,GAAG;CAC/H,OAAO,2BAA2B,CAAC,GAAG,gCAAgC,OAAO,GAAG,GAAG,gBAAgB,GAAG,cAAc;AACrH;;;;;;AAMA,SAAS,mCAAmC;CAC3C,OAAO,wCAAwC;AAChD"}
1
+ {"version":3,"file":"codec-registry-C8ymMRsH-B48NRqXL.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-registry-C8ymMRsH.mjs"],"sourcesContent":["import { t as createPostgresBuiltinDataTypeLookup } from \"./data-types-DhBM9bIL.mjs\";\nimport { n as buildPostgresCodecDescriptorRegistry } from \"./codec-descriptor-DSMjoW72.mjs\";\nimport { t as codecDescriptors } from \"./codecs-DNjF5kIh.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { extractCodecLookup } from \"@internal/framework-components/control\";\nimport { buildCodecDescriptorRegistry } from \"@internal/sql-relational-core/codec-descriptor-registry\";\n//#region src/core/registry.ts\n/**\n* Registry of every codec descriptor shipped by `@internal/target-postgres`.\n*\n* Public consumer surface for the postgres codec set: the postgres adapter and any other consumer that needs to enumerate or look up a postgres codec by id consumes this rather than the raw descriptor array. See ADR 208.\n*/\nconst postgresCodecRegistry = buildCodecDescriptorRegistry(codecDescriptors);\nconst postgresCodecDescriptorRegistry = buildPostgresCodecDescriptorRegistry(codecDescriptors);\n//#endregion\n//#region src/core/codec-registry.ts\n/**\n* A registry of `descriptors`, refusing a codec whose data type `dataTypeLookup` does not have: the\n* SQL renderer writes a parameter's cast from the data type its codec represents.\n*/\nfunction buildPostgresCodecRegistry(descriptors, dataTypeLookup) {\n\tconst descriptorRegistry = buildPostgresCodecDescriptorRegistry(descriptors);\n\tconst validatedDescriptors = Array.from(descriptorRegistry.values());\n\tfor (const descriptor of validatedDescriptors) if (!dataTypeLookup.has(descriptor.dataType)) throw structuredError(\"CONTRACT.DATA_TYPE_UNREGISTERED\", `Codec \"${descriptor.codecId}\" represents data type \"${descriptor.dataType}\", which no component registers.`, {\n\t\twhy: \"A parameter of this codec is written with a cast named by its data type.\",\n\t\tfix: \"Pass the data type beside the codec: in `dataTypes` of createPostgresAdapter, or in the `dataTypes` of the extension that contributes the codec.\",\n\t\tmeta: {\n\t\t\tcodecId: descriptor.codecId,\n\t\t\tdataType: descriptor.dataType\n\t\t}\n\t});\n\tconst registry = {\n\t\t...extractCodecLookup([{\n\t\t\tid: \"postgres-codecs\",\n\t\t\ttypes: { codecTypes: { codecDescriptors: validatedDescriptors } }\n\t\t}]),\n\t\tdescriptorFor: (codecId) => descriptorRegistry.descriptorFor(codecId),\n\t\tvalues: () => descriptorRegistry.values()\n\t};\n\treturn Object.freeze(registry);\n}\nfunction assemblePostgresCodecRegistry(components, dataTypeLookup) {\n\treturn buildPostgresCodecRegistry(components.flatMap((component) => component.types?.codecTypes?.codecDescriptors ?? []), dataTypeLookup);\n}\nfunction assemblePostgresCodecRegistryWithBuiltins(extensions, dataTypeLookup) {\n\treturn buildPostgresCodecRegistry([...postgresCodecDescriptorRegistry.values(), ...extensions.flatMap((extension) => extension.types?.codecTypes?.codecDescriptors ?? [])], dataTypeLookup);\n}\n/** A registry of the built-in codecs and `codecDescriptors`, whose data types `dataTypeLookup` has. */\nfunction createPostgresCodecRegistryWithBuiltins(codecDescriptors = [], dataTypeLookup = createPostgresBuiltinDataTypeLookup()) {\n\treturn buildPostgresCodecRegistry([...postgresCodecDescriptorRegistry.values(), ...codecDescriptors], dataTypeLookup);\n}\n/**\n* Build a coherent PostgreSQL codec registry populated with built-in descriptors only.\n*\n* The returned registry supports both ordinary codec materialization and PostgreSQL target behavior. Stack-composed paths build the same combined registry from their complete ordered descriptor contributions.\n*/\nfunction createPostgresBuiltinCodecLookup() {\n\treturn createPostgresCodecRegistryWithBuiltins();\n}\n//#endregion\nexport { postgresCodecDescriptorRegistry as a, createPostgresCodecRegistryWithBuiltins as i, assemblePostgresCodecRegistryWithBuiltins as n, postgresCodecRegistry as o, createPostgresBuiltinCodecLookup as r, assemblePostgresCodecRegistry as t };\n\n//# sourceMappingURL=codec-registry-C8ymMRsH.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,wBAAwB,6BAA6B,gBAAgB;AAC3E,MAAM,kCAAkC,qCAAqC,gBAAgB;;;;;AAO7F,SAAS,2BAA2B,aAAa,gBAAgB;CAChE,MAAM,qBAAqB,qCAAqC,WAAW;CAC3E,MAAM,uBAAuB,MAAM,KAAK,mBAAmB,OAAO,CAAC;CACnE,KAAK,MAAM,cAAc,sBAAsB,IAAI,CAAC,eAAe,IAAI,WAAW,QAAQ,GAAG,MAAM,gBAAgB,mCAAmC,UAAU,WAAW,QAAQ,0BAA0B,WAAW,SAAS,mCAAmC;EACnQ,KAAK;EACL,KAAK;EACL,MAAM;GACL,SAAS,WAAW;GACpB,UAAU,WAAW;EACtB;CACD,CAAC;CACD,MAAM,WAAW;EAChB,GAAG,mBAAmB,CAAC;GACtB,IAAI;GACJ,OAAO,EAAE,YAAY,EAAE,kBAAkB,qBAAqB,EAAE;EACjE,CAAC,CAAC;EACF,gBAAgB,YAAY,mBAAmB,cAAc,OAAO;EACpE,cAAc,mBAAmB,OAAO;CACzC;CACA,OAAO,OAAO,OAAO,QAAQ;AAC9B;AACA,SAAS,8BAA8B,YAAY,gBAAgB;CAClE,OAAO,2BAA2B,WAAW,SAAS,cAAc,UAAU,OAAO,YAAY,oBAAoB,CAAC,CAAC,GAAG,cAAc;AACzI;AACA,SAAS,0CAA0C,YAAY,gBAAgB;CAC9E,OAAO,2BAA2B,CAAC,GAAG,gCAAgC,OAAO,GAAG,GAAG,WAAW,SAAS,cAAc,UAAU,OAAO,YAAY,oBAAoB,CAAC,CAAC,CAAC,GAAG,cAAc;AAC3L;;AAEA,SAAS,wCAAwC,mBAAmB,CAAC,GAAG,iBAAiB,oCAAoC,GAAG;CAC/H,OAAO,2BAA2B,CAAC,GAAG,gCAAgC,OAAO,GAAG,GAAG,gBAAgB,GAAG,cAAc;AACrH;;;;;;AAMA,SAAS,mCAAmC;CAC3C,OAAO,wCAAwC;AAChD"}
@@ -1,7 +1,7 @@
1
1
  import { t as AdaptedPostgresCodecDescriptor } from "./codec-descriptor-Cbz5bbma-dxeoAwS2.mjs";
2
- import { A as PgTimestamptzDateDescriptor, C as PgNumericDescriptor, D as PgTimestampStringDescriptor, E as PgTimeTemporalDescriptor, F as PgUnboundedIntDescriptor, I as PgUuidDescriptor, L as PgVarbitDescriptor, M as PgTimestamptzTemporalDescriptor, N as PgTimetzDescriptor, O as PgTimestampTemporalDescriptor, P as PgTsqueryDescriptor, R as PgVarcharDescriptor, S as PgJsonbDescriptor, T as PgTimeStringDescriptor, _ as PgInt8NumberDescriptor, a as PgDateStringDescriptor, b as PgIntervalDescriptor, c as PgEnumDescriptor, d as PgFloat8Descriptor, f as PgFloatDescriptor, g as PgInt8Descriptor, h as PgInt4Descriptor, i as PgCharDescriptor, j as PgTimestamptzStringDescriptor, m as PgInt2Descriptor, n as PgBoolDescriptor, o as PgDateTemporalDescriptor, p as PgInetDescriptor, r as PgByteaDescriptor, t as PgBitDescriptor, u as PgFloat4Descriptor, v as PgIntDescriptor, w as PgTextDescriptor, x as PgJsonDescriptor } from "./codecs-ByHL7NZ0-B_903MRF.mjs";
2
+ import { A as PgTimestamptzDateDescriptor, C as PgNumericDescriptor, D as PgTimestampStringDescriptor, E as PgTimeTemporalDescriptor, F as PgUnboundedIntDescriptor, I as PgUuidDescriptor, L as PgVarbitDescriptor, M as PgTimestamptzTemporalDescriptor, N as PgTimetzDescriptor, O as PgTimestampTemporalDescriptor, P as PgTsqueryDescriptor, R as PgVarcharDescriptor, S as PgJsonbDescriptor, T as PgTimeStringDescriptor, _ as PgInt8NumberDescriptor, a as PgDateStringDescriptor, b as PgIntervalDescriptor, c as PgEnumDescriptor, d as PgFloat8Descriptor, f as PgFloatDescriptor, g as PgInt8Descriptor, h as PgInt4Descriptor, i as PgCharDescriptor, j as PgTimestamptzStringDescriptor, m as PgInt2Descriptor, n as PgBoolDescriptor, o as PgDateTemporalDescriptor, p as PgInetDescriptor, r as PgByteaDescriptor, t as PgBitDescriptor, u as PgFloat4Descriptor, v as PgIntDescriptor, w as PgTextDescriptor, x as PgJsonDescriptor } from "./codecs-DgslvOOU-eZpfm_fU.mjs";
3
3
  import { ExtractCodecTypes } from "@prisma/orm-family-sql/relational-core/ast";
4
- //#region ../../../3-targets/3-targets/postgres/dist/codec-type-map-ulrHZjWI.d.mts
4
+ //#region ../../../3-targets/3-targets/postgres/dist/codec-type-map-DiWClTtc.d.mts
5
5
  //#region src/core/codec-type-map.d.ts
6
6
  declare const codecDescriptorMap: {
7
7
  readonly char: AdaptedPostgresCodecDescriptor<import("@prisma/orm-family-sql/relational-core/ast").SqlCharDescriptor>;
@@ -43,10 +43,11 @@ declare const codecDescriptorMap: {
43
43
  readonly json: PgJsonDescriptor;
44
44
  readonly jsonb: PgJsonbDescriptor;
45
45
  readonly tsquery: PgTsqueryDescriptor;
46
+ readonly raw: AdaptedPostgresCodecDescriptor<import("@prisma/orm-family-sql/relational-core/ast").SqlRawDescriptor>;
46
47
  };
47
48
  type Resolve<T> = { readonly [K in keyof T]: { readonly [P in keyof T[K]]: T[K][P]; }; };
48
49
  type CodecDescriptorMap = typeof codecDescriptorMap;
49
50
  type ExtractedCodecTypes = ExtractCodecTypes<CodecDescriptorMap>;
50
51
  //#endregion
51
52
  export { Resolve as n, ExtractedCodecTypes as t };
52
- //# sourceMappingURL=codec-type-map-ulrHZjWI-DMkq8jy2.d.mts.map
53
+ //# sourceMappingURL=codec-type-map-DiWClTtc-CUWQbVA0.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec-type-map-ulrHZjWI-DMkq8jy2.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-type-map-ulrHZjWI.d.mts"],"mappings":";;;;;cAIc;WACH,MAAM,2EAA2E;WACjF,SAAS,2EAA2E;WACpF,KAAK,2EAA2E;WAChF,OAAO,2EAA2E;WAClF,YAAY,2EAA2E;WACvF,MAAM;WACN,MAAM;WACN,WAAW;WACX,qBAAqB;WACrB,SAAS;WACT,oBAAoB;WACpB,MAAM;WACN,MAAM;WACN,MAAM;WACN,YAAY;WACZ,QAAQ;WACR,QAAQ;WACR,SAAS;WACT,cAAc;WACd,iBAAiB;WACjB,sBAAsB;WACtB,wBAAwB;WACxB,iBAAiB;WACjB,eAAe;WACf,oBAAoB;WACpB,sBAAsB;WACtB,oBAAoB;WACpB,eAAe;WACf,QAAQ;WACR,MAAM;WACN,KAAK;WACL,eAAe;WACf,OAAO;WACP,MAAM;WACN,MAAM;WACN,UAAU;WACV,MAAM;WACN,OAAO;WACP,SAAS;;KAEf,QAAQ,iBAAiB,WAAW,gBAAgB,WAAW,EAAE,KAAK,EAAE,GAAG;KAC3E,4BAA4B;KAC5B,sBAAsB,kBAAkB"}
1
+ {"version":3,"file":"codec-type-map-DiWClTtc-CUWQbVA0.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-type-map-DiWClTtc.d.mts"],"mappings":";;;;;cAIc;WACH,MAAM,2EAA2E;WACjF,SAAS,2EAA2E;WACpF,KAAK,2EAA2E;WAChF,OAAO,2EAA2E;WAClF,YAAY,2EAA2E;WACvF,MAAM;WACN,MAAM;WACN,WAAW;WACX,qBAAqB;WACrB,SAAS;WACT,oBAAoB;WACpB,MAAM;WACN,MAAM;WACN,MAAM;WACN,YAAY;WACZ,QAAQ;WACR,QAAQ;WACR,SAAS;WACT,cAAc;WACd,iBAAiB;WACjB,sBAAsB;WACtB,wBAAwB;WACxB,iBAAiB;WACjB,eAAe;WACf,oBAAoB;WACpB,sBAAsB;WACtB,oBAAoB;WACpB,eAAe;WACf,QAAQ;WACR,MAAM;WACN,KAAK;WACL,eAAe;WACf,OAAO;WACP,MAAM;WACN,MAAM;WACN,UAAU;WACV,MAAM;WACN,OAAO;WACP,SAAS;WACT,KAAK,2EAA2E;;KAEtF,QAAQ,iBAAiB,WAAW,gBAAgB,WAAW,EAAE,KAAK,EAAE,GAAG;KAC3E,4BAA4B;KAC5B,sBAAsB,kBAAkB"}
@@ -0,0 +1,2 @@
1
+ import "./codecs-DgslvOOU-eZpfm_fU.mjs";
2
+ import "./codec-types-yRnVORmz-C5oISm2L.mjs";
@@ -1,7 +1,7 @@
1
- import "./codecs-ByHL7NZ0-B_903MRF.mjs";
2
- import { n as Resolve, t as ExtractedCodecTypes } from "./codec-type-map-ulrHZjWI-DMkq8jy2.mjs";
1
+ import "./codecs-DgslvOOU-eZpfm_fU.mjs";
2
+ import { n as Resolve, t as ExtractedCodecTypes } from "./codec-type-map-DiWClTtc-CUWQbVA0.mjs";
3
3
  import { JsonValue as JsonValue$1, ParameterizedOutputTypesFunction } from "@prisma/orm-framework/contract/types";
4
- //#region ../../../3-targets/3-targets/postgres/dist/codec-types-DX-72F9v.d.mts
4
+ //#region ../../../3-targets/3-targets/postgres/dist/codec-types-yRnVORmz.d.mts
5
5
  //#region src/exports/codec-types.d.ts
6
6
  type CodecTypes = Resolve<ExtractedCodecTypes>;
7
7
  type Branded<T, Shape extends Record<string, unknown>> = T & { readonly [K in keyof Shape]: Shape[K]; };
@@ -81,4 +81,4 @@ interface ParameterizedOutputTypesForTypeParams extends ParameterizedOutputTypes
81
81
  }
82
82
  //#endregion
83
83
  export { JsonValue$1 as a, Time as c, TimestampString as d, Timestamptz as f, Varchar as g, VarBit as h, Interval as i, TimeString as l, Timetz as m, Char as n, Numeric as o, TimestamptzString as p, CodecTypes as r, ParameterizedOutputTypesForTypeParams as s, Bit as t, Timestamp as u };
84
- //# sourceMappingURL=codec-types-DX-72F9v-CORaQjWv.d.mts.map
84
+ //# sourceMappingURL=codec-types-yRnVORmz-C5oISm2L.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec-types-DX-72F9v-CORaQjWv.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-types-DX-72F9v.d.mts"],"mappings":";;;;;KAIK,aAAa,QAAQ;KACrB,QAAQ,GAAG,cAAc,2BAA2B,gBAAgB,WAAW,QAAQ,MAAM;KAC7F,cAAc,cAAc,2BAA2B,gBAAgB;KACvE,KAAK,oBAAoB;EAC5B,cAAc;;KAEX,QAAQ,oBAAoB;EAC/B,iBAAiB;;KAEd,QAAQ,kBAAkB,4CAA4C;EACzE,oBAAoB;EACpB,gBAAgB;;KAEb,IAAI,oBAAoB;EAC3B,aAAa;;KAEV,OAAO,oBAAoB;EAC9B,gBAAgB;;KAEb,UAAU,4CAA4C;EACzD,sBAAsB;;KAEnB,YAAY,4CAA4C;EAC3D,wBAAwB;;KAErB,KAAK,4CAA4C;EACpD,iBAAiB;;KAEd,OAAO,4CAA4C;EACtD,mBAAmB;;KAEhB,gBAAgB,4CAA4C;EAC/D,4BAA4B;;KAEzB,kBAAkB,4CAA4C;EACjE,8BAA8B;;KAE3B,WAAW,4CAA4C;EAC1D,uBAAuB;;KAEpB,SAAS,4CAA4C;EACxD,qBAAqB;;KAElB,YAAY,cAAc;WACpB,cAAc;IACrB;KACC,eAAe,cAAc;WACvB,iBAAiB;IACxB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8B;;KAE3B,WAAW,4CAA4C;EAC1D,uBAAuB;;KAEpB,SAAS,4CAA4C;EACxD,qBAAqB;;KAElB,YAAY,cAAc;WACpB,cAAc;IACrB;KACC,eAAe,cAAc;WACvB,iBAAiB;IACxB;KACC,cAAc,cAAc;WACtB,iBAAiB;IACxB;WACO,aAAa;IACpB,QAAQ,GAAG,KAAK,QAAQ;KACvB,aAAa,YAAY,WAAW,YAAY,uCAAuC;KACvF,cAAc;WACR,gBAAgB,cAAc;WAC9B,aAAa,aAAa,YAAY,KAAK,YAAY;WACvD,cAAc,aAAa,YAAY,KAAK,YAAY;WACxD,gBAAgB,aAAa,YAAY,QAAQ,YAAY;WAC7D,iBAAiB,aAAa,YAAY,QAAQ,YAAY;WAC9D,YAAY,aAAa,YAAY,IAAI,YAAY;WACrD,eAAe,aAAa,YAAY,OAAO,YAAY;WAC3D,eAAe,OAAO,eAAe;WACrC,iBAAiB,SAAS,eAAe;WACzC,oBAAoB,WAAW,eAAe;WAC9C,yBAAyB,gBAAgB,eAAe;WACxD,2BAA2B,kBAAkB,eAAe;WAC5D,yBAAyB;;;;;UAK1B,8CAA8C;WAC7C,aAAa"}
@@ -1,17 +1,17 @@
1
- import { A as PG_TIME_TEMPORAL_CODEC_ID, C as PG_TIMESTAMPTZ_DATE_CODEC_ID, D as PG_TIMESTAMP_TEMPORAL_CODEC_ID, E as PG_TIMESTAMP_STRING_CODEC_ID, F as PG_VARCHAR_CODEC_ID, M as PG_UNBOUNDED_INT_CODEC_ID, N as PG_UUID_CODEC_ID, O as PG_TIMETZ_CODEC_ID, P as PG_VARBIT_CODEC_ID, S as PG_TEXT_CODEC_ID, T as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, _ as PG_INT_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, b as PG_NUMERIC_CODEC_ID, c as PG_FLOAT4_CODEC_ID, d as PG_INET_CODEC_ID, f as PG_INT2_CODEC_ID, g as PG_INTERVAL_CODEC_ID, h as PG_INT8_NUMBER_CODEC_ID, i as PG_CHAR_CODEC_ID, j as PG_TSQUERY_CODEC_ID, k as PG_TIME_STRING_CODEC_ID, l as PG_FLOAT8_CODEC_ID, m as PG_INT8_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID, p as PG_INT4_CODEC_ID, r as PG_BYTEA_CODEC_ID, s as PG_ENUM_CODEC_ID, t as PG_BIT_CODEC_ID, u as PG_FLOAT_CODEC_ID, v as PG_JSONB_CODEC_ID, w as PG_TIMESTAMPTZ_STRING_CODEC_ID, x as PG_TEXT_ARRAY_CODEC_ID, y as PG_JSON_CODEC_ID } from "./codec-ids-Cb0yO-IS--e0P2rfI.mjs";
1
+ import { A as PG_TIME_TEMPORAL_CODEC_ID, C as PG_TIMESTAMPTZ_DATE_CODEC_ID, D as PG_TIMESTAMP_TEMPORAL_CODEC_ID, E as PG_TIMESTAMP_STRING_CODEC_ID, F as PG_VARCHAR_CODEC_ID, M as PG_UNBOUNDED_INT_CODEC_ID, N as PG_UUID_CODEC_ID, O as PG_TIMETZ_CODEC_ID, P as PG_VARBIT_CODEC_ID, S as PG_TEXT_CODEC_ID, T as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, _ as PG_INT_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, b as PG_NUMERIC_CODEC_ID, c as PG_FLOAT4_CODEC_ID, d as PG_INET_CODEC_ID, f as PG_INT2_CODEC_ID, g as PG_INTERVAL_CODEC_ID, h as PG_INT8_NUMBER_CODEC_ID, i as PG_CHAR_CODEC_ID, j as PG_TSQUERY_CODEC_ID, k as PG_TIME_STRING_CODEC_ID, l as PG_FLOAT8_CODEC_ID, m as PG_INT8_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID, p as PG_INT4_CODEC_ID, r as PG_BYTEA_CODEC_ID, s as PG_ENUM_CODEC_ID, t as PG_BIT_CODEC_ID, u as PG_FLOAT_CODEC_ID, v as PG_JSONB_CODEC_ID, w as PG_TIMESTAMPTZ_STRING_CODEC_ID, x as PG_TEXT_ARRAY_CODEC_ID, y as PG_JSON_CODEC_ID } from "./codec-ids-BMhEpFwv-BLIC4g3Y.mjs";
2
2
  import { a as postgresCodec, r as definePostgresCodecs, t as PostgresCodecDescriptor } from "./codec-descriptor-DSMjoW72-ZoCcTHLX.mjs";
3
3
  import { a as errorTemporalUnrepresentable, c as postgresError, i as errorTemporalUnavailableForDefault, n as errorTemporalNonIsoCalendar, o as errorTemporalWrongType, r as errorTemporalUnavailable, s as errorTimestampTextWrongType } from "./errors-BrhQYgdL-D_lIrddD.mjs";
4
- import { A as pgJsonb, B as pgTimestamptz, C as pgInet, D as pgInterval, E as pgInt8, F as pgTextArray, G as pgUuid, H as pgTimetz, I as pgTime, K as pgVarbit, M as pgNumericParams, N as pgPrecisionParams, P as pgText, R as pgTimestamp, S as pgFloat8, T as pgInt4, V as pgTimestamptzStoredText, W as pgTsquery, X as postgresYearText, Y as postgresIntervalFields, _ as pgDate, a as formatIsoDuration, b as pgEnumParams, c as microsFromFraction, d as pgBool, f as pgBytea, g as pgCharacterLengthParams, h as pgChar, j as pgNumeric, k as pgJson, l as pgBit, n as ISO_DURATION, o as intervalFieldsOf, q as pgVarchar, r as MICROS_PER_SECOND, s as isoYearText, t as BYTEA_TEXT, u as pgBitLengthParams, w as pgInt2, x as pgFloat4, y as pgEnum } from "./data-types-Cs-LkJBw-CJN57Y5M.mjs";
4
+ import { A as pgJsonb, B as pgTimestamptz, C as pgInet, D as pgInterval, E as pgInt8, F as pgTextArray, G as pgUuid, H as pgTimetz, I as pgTime, K as pgVarbit, M as pgNumericParams, N as pgPrecisionParams, P as pgText, R as pgTimestamp, S as pgFloat8, T as pgInt4, V as pgTimestamptzStoredText, W as pgTsquery, X as postgresYearText, Y as postgresIntervalFields, _ as pgDate, a as formatIsoDuration, b as pgEnumParams, c as microsFromFraction, d as pgBool, f as pgBytea, g as pgCharacterLengthParams, h as pgChar, j as pgNumeric, k as pgJson, l as pgBit, n as ISO_DURATION, o as intervalFieldsOf, q as pgVarchar, r as MICROS_PER_SECOND, s as isoYearText, t as BYTEA_TEXT, u as pgBitLengthParams, w as pgInt2, x as pgFloat4, y as pgEnum } from "./data-types-DhBM9bIL-CVDQGAGw.mjs";
5
5
  import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs";
6
- import { CastExpr, SqlCharCodec, SqlFloatCodec, SqlIntCodec, SqlTextCodec, SqlVarcharCodec, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlTextDescriptor, sqlVarcharDescriptor } from "@prisma/orm-family-sql/relational-core/ast";
6
+ import { CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, NullCheckExpr, SqlCharCodec, SqlFloatCodec, SqlIntCodec, SqlRawCodec, SqlTextCodec, SqlVarcharCodec, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlRawDescriptor, sqlTextDescriptor, sqlVarcharDescriptor } from "@prisma/orm-family-sql/relational-core/ast";
7
7
  import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
8
8
  import { CodecImpl, SAFE_INTEGER_BIGINT_RANGE, column, floatToJson, isNonFiniteText, readJsonFloat, readJsonIntegerText, refuseJsonValue, renderTsLiteral } from "@prisma/orm-framework/components/codec";
9
9
  import { blindCast } from "@prisma/orm-framework/utils/casts";
10
- import { numeralText } from "@prisma/orm-family-sql/contract/data-type";
10
+ import { numeralText, sqlRawDataType } from "@prisma/orm-family-sql/contract/data-type";
11
11
  import { storedNumeralText } from "@prisma/orm-family-sql/contract/data-type-support";
12
12
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
13
13
  import { parse } from "postgres-array";
14
- //#region ../../../3-targets/3-targets/postgres/dist/codecs-UZ1NEbvk.mjs
14
+ //#region ../../../3-targets/3-targets/postgres/dist/codecs-DNjF5kIh.mjs
15
15
  /**
16
16
  * A `numeric` value as its canonical decimal text. A number is written out without an exponent,
17
17
  * because `numeric` text has no exponent syntax and `toDataTypeValue` refuses one.
@@ -764,6 +764,22 @@ const postgresSqlTextDescriptor = postgresCodec(sqlTextDescriptor, {
764
764
  jsonProjection: identityJsonProjection,
765
765
  factory: (descriptor, dataType) => () => new SqlTextCodec(descriptor, dataType)
766
766
  });
767
+ /**
768
+ * Projects a raw value as the text its type's output function prints, which a flat read returns
769
+ * too, so an include reads the same value. Postgres' JSON form of `integer` or `boolean` would be a
770
+ * number or a boolean, and a cast to `text` does not always print the output form: `true::text` is
771
+ * `true` where the output is `t`. `format('%s', …)` prints through the output function, and turns
772
+ * NULL into an empty string, so NULL is kept apart.
773
+ */
774
+ const outputFunctionJsonProjection = (expression) => CaseExpr.of([{
775
+ condition: NullCheckExpr.isNull(expression),
776
+ value: LiteralExpr.of(null)
777
+ }], FunctionCallExpr.of("format", [LiteralExpr.of("%s"), expression]));
778
+ const postgresSqlRawDescriptor = postgresCodec(sqlRawDescriptor, {
779
+ dataType: sqlRawDataType,
780
+ jsonProjection: outputFunctionJsonProjection,
781
+ factory: (descriptor, dataType, params) => () => new SqlRawCodec(descriptor, dataType, params)
782
+ });
767
783
  var PgTextCodec = class extends CodecImpl {
768
784
  async toWire(value, _ctx) {
769
785
  return value;
@@ -1668,6 +1684,7 @@ const codecDescriptors = definePostgresCodecs([
1668
1684
  postgresSqlIntDescriptor,
1669
1685
  postgresSqlFloatDescriptor,
1670
1686
  postgresSqlTextDescriptor,
1687
+ postgresSqlRawDescriptor,
1671
1688
  pgTextDescriptor,
1672
1689
  pgEnumDescriptor,
1673
1690
  pgCharDescriptor,
@@ -1707,4 +1724,4 @@ const codecDescriptors = definePostgresCodecs([
1707
1724
  //#endregion
1708
1725
  export { pgVarbitColumn as A, pgNumericColumn as C, pgTimetzColumn as D, pgTimestamptzDateDescriptor as E, postgresQualifyColumnType as M, requireTemporal as N, pgUnboundedIntColumn as O, setFallbackTemporal as P, pgJsonbColumn as S, pgTimestamptzDateColumn as T, pgInt8Column as _, isPgEnumParams as a, pgIntervalColumn as b, pgBoolColumn as c, pgFloat4Column as d, pgFloat8Column as f, pgInt4Column as g, pgInt2Column as h, decodePostgresListText as i, pgVarcharColumn as j, pgUuidColumn as k, pgCharColumn as l, pgInetColumn as m, PgTimestamptzDateDescriptor as n, parsePostgresListText as o, pgFloatColumn as p, codecDescriptors as r, pgBitColumn as s, PgTimestamptzDateCodec as t, pgEnumDescriptor as u, pgInt8NumberColumn as v, pgTextColumn as w, pgJsonColumn as x, pgIntColumn as y };
1709
1726
 
1710
- //# sourceMappingURL=codecs-UZ1NEbvk-CMnI6Ti0.mjs.map
1727
+ //# sourceMappingURL=codecs-DNjF5kIh-BkybYk_D.mjs.map