@prisma/orm-target-postgres 8.0.0-rc.18-dev.25 → 8.0.0-rc.18-dev.27

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 (187) hide show
  1. package/dist/{adapter-UEtFYllx-DXa1Ekth.mjs → adapter-BkfuSVLm-DmjWB5c9.mjs} +14 -14
  2. package/dist/adapter-BkfuSVLm-DmjWB5c9.mjs.map +1 -0
  3. package/dist/{adapter-CA0jY1EK.d.mts → adapter-vfsQ80l6.d.mts} +3 -3
  4. package/dist/adapter-vfsQ80l6.d.mts.map +1 -0
  5. package/dist/adapter.d.mts +3 -4
  6. package/dist/adapter.mjs +6 -7
  7. package/dist/adapter__adapter.d.mts +1 -1
  8. package/dist/adapter__adapter.mjs +2 -2
  9. package/dist/adapter__control.d.mts +2 -3
  10. package/dist/adapter__control.mjs +8 -9
  11. package/dist/adapter__control.mjs.map +1 -1
  12. package/dist/adapter__runtime.mjs +6 -6
  13. package/dist/adapter__runtime.mjs.map +1 -1
  14. package/dist/adapter__sql-renderer.mjs +1 -1
  15. package/dist/{authoring-mmK5aduF-BltVG_HJ.mjs → authoring-DhyLHFHA-pB4NuFxh.mjs} +5 -5
  16. package/dist/{authoring-mmK5aduF-BltVG_HJ.mjs.map → authoring-DhyLHFHA-pB4NuFxh.mjs.map} +1 -1
  17. package/dist/{autoincrement-widths-djl9Gw7k-C4Vk6s7I.mjs → autoincrement-widths-1v9UfTSw-NFaqRGCV.mjs} +3 -3
  18. package/dist/{autoincrement-widths-djl9Gw7k-C4Vk6s7I.mjs.map → autoincrement-widths-1v9UfTSw-NFaqRGCV.mjs.map} +1 -1
  19. package/dist/{check-expressions-DoxKokL1-RVvYRdA6.mjs → check-expressions-7uCCP01t-WtUqfqkP.mjs} +3 -3
  20. package/dist/{check-expressions-DoxKokL1-RVvYRdA6.mjs.map → check-expressions-7uCCP01t-WtUqfqkP.mjs.map} +1 -1
  21. package/dist/{codec-registry-CvKdYTYj-4xXqgKKs.mjs → codec-registry-T79ktJL4-B9_zlIhI.mjs} +4 -4
  22. package/dist/{codec-registry-CvKdYTYj-4xXqgKKs.mjs.map → codec-registry-T79ktJL4-B9_zlIhI.mjs.map} +1 -1
  23. package/dist/{codecs-D183NDmb-DKryvPH2.mjs → codecs-UZ1NEbvk-CMnI6Ti0.mjs} +3 -3
  24. package/dist/{codecs-D183NDmb-DKryvPH2.mjs.map → codecs-UZ1NEbvk-CMnI6Ti0.mjs.map} +1 -1
  25. package/dist/{contract-contributions-DrHk5h_E-BbmViVsC.mjs → contract-contributions-CQqafzSC-DrMFSSO4.mjs} +49 -40
  26. package/dist/contract-contributions-CQqafzSC-DrMFSSO4.mjs.map +1 -0
  27. package/dist/{contract-free-CiUW36L2.mjs → contract-free-Kwm74Hg9.mjs} +3 -3
  28. package/dist/{contract-free-CiUW36L2.mjs.map → contract-free-Kwm74Hg9.mjs.map} +1 -1
  29. package/dist/{control-policy-BdfDPcjX-BueP9PBT.mjs → control-policy-BHjZnca1-DUWuKmdJ.mjs} +65 -89
  30. package/dist/control-policy-BHjZnca1-DUWuKmdJ.mjs.map +1 -0
  31. package/dist/{control-l0spLFiu.d.mts → control-vBNwKZ7Q.d.mts} +6 -4
  32. package/dist/control-vBNwKZ7Q.d.mts.map +1 -0
  33. package/dist/{data-type-entries-KJ4Mn8C5-DY3rLz33.mjs → data-type-entries-CqnLlCkK-uN0WjREd.mjs} +3 -3
  34. package/dist/{data-type-entries-KJ4Mn8C5-DY3rLz33.mjs.map → data-type-entries-CqnLlCkK-uN0WjREd.mjs.map} +1 -1
  35. package/dist/{data-types-BkFfMhgz.d.mts → data-types-BTUMiCZS.d.mts} +5 -2
  36. package/dist/data-types-BTUMiCZS.d.mts.map +1 -0
  37. package/dist/{data-types-CQs1yW4F-CSexn8mK.mjs → data-types-Cs-LkJBw-CJN57Y5M.mjs} +4 -4
  38. package/dist/{data-types-CQs1yW4F-CSexn8mK.mjs.map → data-types-Cs-LkJBw-CJN57Y5M.mjs.map} +1 -1
  39. package/dist/{ddl-V9Yxnoa6-BcStSw33.mjs → ddl-2L13tYjC-enYPQJnG.mjs} +5 -5
  40. package/dist/{ddl-V9Yxnoa6-BcStSw33.mjs.map → ddl-2L13tYjC-enYPQJnG.mjs.map} +1 -1
  41. package/dist/{default-normalizer-BqFHmlox-CP8ywN-r.mjs → default-normalizer-BqK6XxdC-BAgxt9FF.mjs} +10 -12
  42. package/dist/default-normalizer-BqK6XxdC-BAgxt9FF.mjs.map +1 -0
  43. package/dist/{default-normalizer-CTAiFe9Y.d.mts → default-normalizer-P-u2VRBf.d.mts} +5 -5
  44. package/dist/default-normalizer-P-u2VRBf.d.mts.map +1 -0
  45. package/dist/{descriptor-meta-axWY-kHl-Bt2_NjH4.mjs → descriptor-meta-Bzs7kSyA-BjbnpZLW.mjs} +8 -8
  46. package/dist/{descriptor-meta-axWY-kHl-Bt2_NjH4.mjs.map → descriptor-meta-Bzs7kSyA-BjbnpZLW.mjs.map} +1 -1
  47. package/dist/{descriptor-meta-CvJvXGfx-CGIgsveo.mjs → descriptor-meta-DDh7-s6c-D6qC3SDx.mjs} +4 -4
  48. package/dist/{descriptor-meta-CvJvXGfx-CGIgsveo.mjs.map → descriptor-meta-DDh7-s6c-D6qC3SDx.mjs.map} +1 -1
  49. package/dist/{descriptor-meta-runtime-CMaPJG46-CPYTMJ7t.mjs → descriptor-meta-runtime-C1AjrKaP-CYer0qt7.mjs} +3 -3
  50. package/dist/{descriptor-meta-runtime-CMaPJG46-CPYTMJ7t.mjs.map → descriptor-meta-runtime-C1AjrKaP-CYer0qt7.mjs.map} +1 -1
  51. package/dist/{diff-database-schema-DLIpM5BX-DlEJquxk.mjs → diff-database-schema-DyCIRT80-C1zMCmRx.mjs} +7 -7
  52. package/dist/{diff-database-schema-DLIpM5BX-DlEJquxk.mjs.map → diff-database-schema-DyCIRT80-C1zMCmRx.mjs.map} +1 -1
  53. package/dist/{full-text-search-document-DbegbX0J-jrbc8kfp.mjs → full-text-search-document-Doy5TF7c-DezgYsP-.mjs} +3 -3
  54. package/dist/{full-text-search-document-DbegbX0J-jrbc8kfp.mjs.map → full-text-search-document-Doy5TF7c-DezgYsP-.mjs.map} +1 -1
  55. package/dist/{indexes-ca4Dxsym-By_PZuYD.d.mts → indexes-DtIXFHAb-DBubdl32.d.mts} +3 -2
  56. package/dist/indexes-DtIXFHAb-DBubdl32.d.mts.map +1 -0
  57. package/dist/{issue-planner-B3E9yChD.d.mts → issue-planner-DrWlNiAf.d.mts} +5 -6
  58. package/dist/issue-planner-DrWlNiAf.d.mts.map +1 -0
  59. package/dist/migration-CbOh59ZJ.mjs.map +1 -1
  60. package/dist/{migration-cGzKlTv0.d.mts → migration-DO23kNde.d.mts} +3 -3
  61. package/dist/{migration-cGzKlTv0.d.mts.map → migration-DO23kNde.d.mts.map} +1 -1
  62. package/dist/native-type-normalizer-DFE5L3YY.d.mts +30 -0
  63. package/dist/native-type-normalizer-DFE5L3YY.d.mts.map +1 -0
  64. package/dist/native-type-normalizer-a1XJSlk6.mjs +24 -0
  65. package/dist/native-type-normalizer-a1XJSlk6.mjs.map +1 -0
  66. package/dist/op-factory-call-CijzNDaJ.d.mts +1 -0
  67. package/dist/{op-factory-call-B-EoYQIO-BIfzqVX6.mjs → op-factory-call-No9Z2tdw-Lap8xvVy.mjs} +35 -27
  68. package/dist/op-factory-call-No9Z2tdw-Lap8xvVy.mjs.map +1 -0
  69. package/dist/{op-factory-call-z5TKsamx-DDfPa57U.d.mts → op-factory-call-kdPO0kgG-DV8hS6qA.d.mts} +10 -9
  70. package/dist/op-factory-call-kdPO0kgG-DV8hS6qA.d.mts.map +1 -0
  71. package/dist/{planner-BBGH1cAB.d.mts → planner-B_MRApHM.d.mts} +3 -3
  72. package/dist/{planner-BBGH1cAB.d.mts.map → planner-B_MRApHM.d.mts.map} +1 -1
  73. package/dist/{planner-BNoWx3rb-rkajA65G.mjs → planner-C1czBCmI-C-x1Ip-_.mjs} +10 -10
  74. package/dist/{planner-BNoWx3rb-rkajA65G.mjs.map → planner-C1czBCmI-C-x1Ip-_.mjs.map} +1 -1
  75. package/dist/{planner-ddl-builders-Bo_8ozOV-AMIs8Og7.mjs → planner-ddl-builders-B8PhQZ2T-D1KBJxcS.mjs} +3 -3
  76. package/dist/{planner-ddl-builders-Bo_8ozOV-AMIs8Og7.mjs.map → planner-ddl-builders-B8PhQZ2T-D1KBJxcS.mjs.map} +1 -1
  77. package/dist/{planner-ddl-builders-Byw5BICu.d.mts → planner-ddl-builders-DbG9_uAk.d.mts} +3 -3
  78. package/dist/{planner-ddl-builders-Byw5BICu.d.mts.map → planner-ddl-builders-DbG9_uAk.d.mts.map} +1 -1
  79. package/dist/{planner-identity-values-Dr5FgyF1.d.mts → planner-identity-values-B-NAiN7I.d.mts} +3 -3
  80. package/dist/planner-identity-values-B-NAiN7I.d.mts.map +1 -0
  81. package/dist/{planner-identity-values--pbIuAZR-lgKcM-Zu.mjs → planner-identity-values-BnxSwhlS-CzyBeK0a.mjs} +3 -3
  82. package/dist/{planner-identity-values--pbIuAZR-lgKcM-Zu.mjs.map → planner-identity-values-BnxSwhlS-CzyBeK0a.mjs.map} +1 -1
  83. package/dist/{planner-produced-postgres-migration-sxhIP3Te-Cn3sD9zE.d.mts → planner-produced-postgres-migration-B6NsNaam-BmvloI2L.d.mts} +3 -3
  84. package/dist/planner-produced-postgres-migration-B6NsNaam-BmvloI2L.d.mts.map +1 -0
  85. package/dist/planner-produced-postgres-migration-BW8GJFjS.d.mts +1 -0
  86. package/dist/{planner-produced-postgres-migration-BIKLMKpf-B5h4hpvf.mjs → planner-produced-postgres-migration-F9joIngl-C04yYu-i.mjs} +4 -4
  87. package/dist/{planner-produced-postgres-migration-BIKLMKpf-B5h4hpvf.mjs.map → planner-produced-postgres-migration-F9joIngl-C04yYu-i.mjs.map} +1 -1
  88. package/dist/planner-sql-checks-CB4oLSuZ.d.mts +1 -0
  89. package/dist/planner-sql-checks-CxlrM4J2-VqQpmMwn.d.mts +37 -0
  90. package/dist/planner-sql-checks-CxlrM4J2-VqQpmMwn.d.mts.map +1 -0
  91. package/dist/planner-sql-checks-pkURMYMz-2QAIKyW-.mjs +139 -0
  92. package/dist/planner-sql-checks-pkURMYMz-2QAIKyW-.mjs.map +1 -0
  93. package/dist/{postgres-codec-traits-Da2UyO_9-BsGjYJHf.mjs → postgres-codec-traits-D3muwxMS-OwnBG0Mz.mjs} +3 -3
  94. package/dist/{postgres-codec-traits-Da2UyO_9-BsGjYJHf.mjs.map → postgres-codec-traits-D3muwxMS-OwnBG0Mz.mjs.map} +1 -1
  95. package/dist/{postgres-contract-view-csjnSNLt-M2QaYBn0.mjs → postgres-contract-view-B-bLZB7o-zpuamDXT.mjs} +7 -7
  96. package/dist/{postgres-contract-view-csjnSNLt-M2QaYBn0.mjs.map → postgres-contract-view-B-bLZB7o-zpuamDXT.mjs.map} +1 -1
  97. package/dist/{postgres-migration-BGkcs09r-BmUXCs80.mjs → postgres-migration-BbXm1l5I-DDy8IgYB.mjs} +15 -32
  98. package/dist/postgres-migration-BbXm1l5I-DDy8IgYB.mjs.map +1 -0
  99. package/dist/{postgres-migration-D6_R3__I-rFg_i2gz.d.mts → postgres-migration-CRLV93uK-ThJW3tFf.d.mts} +3 -3
  100. package/dist/{postgres-migration-D6_R3__I-rFg_i2gz.d.mts.map → postgres-migration-CRLV93uK-ThJW3tFf.d.mts.map} +1 -1
  101. package/dist/{postgres-schema-BtW3Sw0F-CH3NqoOo.mjs → postgres-schema-DyUXtYIT-vb-RxpRN.mjs} +3 -3
  102. package/dist/{postgres-schema-BtW3Sw0F-CH3NqoOo.mjs.map → postgres-schema-DyUXtYIT-vb-RxpRN.mjs.map} +1 -1
  103. package/dist/{prisma7-binding-XSuxkjqy.d.mts → prisma7-binding-C5RLV6kJ.d.mts} +12 -121
  104. package/dist/prisma7-binding-C5RLV6kJ.d.mts.map +1 -0
  105. package/dist/{prisma7-binding-ZUOUC530.mjs → prisma7-binding-CzO7rkpS.mjs} +80 -141
  106. package/dist/prisma7-binding-CzO7rkpS.mjs.map +1 -0
  107. package/dist/{render-ops-WhXRiDGu-LZMJf0aV.mjs → render-ops-MeXLgeOa-nL4PdJzz.mjs} +3 -3
  108. package/dist/{render-ops-WhXRiDGu-LZMJf0aV.mjs.map → render-ops-MeXLgeOa-nL4PdJzz.mjs.map} +1 -1
  109. package/dist/{resolve-ddl-schema-B8cX92k0-DzN6Alxy.mjs → resolve-ddl-schema-IdPEiyLX-BZGpy8Wz.mjs} +3 -3
  110. package/dist/{resolve-ddl-schema-B8cX92k0-DzN6Alxy.mjs.map → resolve-ddl-schema-IdPEiyLX-BZGpy8Wz.mjs.map} +1 -1
  111. package/dist/{sql-renderer-CD5aYQos-DZotmt9U.mjs → sql-renderer-CD5aYQos-1hGCWT0S.mjs} +3 -3
  112. package/dist/{sql-renderer-CD5aYQos-DZotmt9U.mjs.map → sql-renderer-CD5aYQos-1hGCWT0S.mjs.map} +1 -1
  113. package/dist/{sql-utils-DxE_vJt4-Dkjw9U45.mjs → sql-utils-Bnw3JbWf-zvWDkyrr.mjs} +3 -178
  114. package/dist/sql-utils-Bnw3JbWf-zvWDkyrr.mjs.map +1 -0
  115. package/dist/target.d.mts +17 -16
  116. package/dist/target.mjs +29 -29
  117. package/dist/target__codecs.mjs +2 -2
  118. package/dist/target__contract-free.mjs +3 -3
  119. package/dist/target__control.mjs +2558 -3
  120. package/dist/target__control.mjs.map +1 -0
  121. package/dist/target__data-types.d.mts +2 -2
  122. package/dist/target__data-types.mjs +3 -3
  123. package/dist/target__default-normalizer.d.mts +1 -1
  124. package/dist/target__default-normalizer.mjs +1 -1
  125. package/dist/target__diff-database-schema.mjs +1 -1
  126. package/dist/target__full-text-index-authoring.mjs +1 -1
  127. package/dist/target__issue-planner.d.mts +1 -1
  128. package/dist/target__issue-planner.mjs +1 -1
  129. package/dist/target__migration.d.mts +2 -2
  130. package/dist/target__migration.mjs +2 -2
  131. package/dist/target__native-type-normalizer.d.mts +2 -2
  132. package/dist/target__native-type-normalizer.mjs +2 -2
  133. package/dist/target__op-factory-call.d.mts +2 -2
  134. package/dist/target__op-factory-call.mjs +1 -1
  135. package/dist/target__pack.mjs +1 -1
  136. package/dist/target__planner-ddl-builders.d.mts +1 -1
  137. package/dist/target__planner-ddl-builders.mjs +1 -1
  138. package/dist/target__planner-identity-values.d.mts +1 -1
  139. package/dist/target__planner-identity-values.mjs +1 -1
  140. package/dist/target__planner-produced-postgres-migration.d.mts +2 -2
  141. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  142. package/dist/target__planner-sql-checks.d.mts +3 -2
  143. package/dist/target__planner-sql-checks.mjs +2 -2
  144. package/dist/target__planner.d.mts +1 -1
  145. package/dist/target__planner.mjs +2 -2
  146. package/dist/target__prisma7-binding.d.mts +1 -1
  147. package/dist/target__prisma7-binding.mjs +1 -1
  148. package/dist/target__render-ops.mjs +1 -1
  149. package/dist/target__runtime.mjs +5 -5
  150. package/dist/target__runtime.mjs.map +1 -1
  151. package/dist/target__schema-ir-annotations.mjs +1 -1
  152. package/dist/target__sql-utils.mjs +2 -2
  153. package/dist/target__types.mjs +2 -2
  154. package/dist/{infer-psl-contract-CKP3nwjB-x1_ji7Z9.mjs → type-constructors-CrNUrtwZ-dmWF-mtV.mjs} +385 -15
  155. package/dist/type-constructors-CrNUrtwZ-dmWF-mtV.mjs.map +1 -0
  156. package/package.json +9 -9
  157. package/dist/adapter-CA0jY1EK.d.mts.map +0 -1
  158. package/dist/adapter-UEtFYllx-DXa1Ekth.mjs.map +0 -1
  159. package/dist/contract-contributions-DrHk5h_E-BbmViVsC.mjs.map +0 -1
  160. package/dist/control-CwTFk4YS.mjs +0 -2929
  161. package/dist/control-CwTFk4YS.mjs.map +0 -1
  162. package/dist/control-l0spLFiu.d.mts.map +0 -1
  163. package/dist/control-policy-BdfDPcjX-BueP9PBT.mjs.map +0 -1
  164. package/dist/data-types-BkFfMhgz.d.mts.map +0 -1
  165. package/dist/default-normalizer-BqFHmlox-CP8ywN-r.mjs.map +0 -1
  166. package/dist/default-normalizer-CTAiFe9Y.d.mts.map +0 -1
  167. package/dist/indexes-ca4Dxsym-By_PZuYD.d.mts.map +0 -1
  168. package/dist/infer-psl-contract-CKP3nwjB-x1_ji7Z9.mjs.map +0 -1
  169. package/dist/issue-planner-B3E9yChD.d.mts.map +0 -1
  170. package/dist/native-type-normalizer-BFo5tSyh.d.mts +0 -37
  171. package/dist/native-type-normalizer-BFo5tSyh.d.mts.map +0 -1
  172. package/dist/native-type-normalizer-CwyVR7xB.mjs +0 -96
  173. package/dist/native-type-normalizer-CwyVR7xB.mjs.map +0 -1
  174. package/dist/op-factory-call-B-EoYQIO-BIfzqVX6.mjs.map +0 -1
  175. package/dist/op-factory-call-uVDKZqw1.d.mts +0 -1
  176. package/dist/op-factory-call-z5TKsamx-DDfPa57U.d.mts.map +0 -1
  177. package/dist/planner-identity-values-Dr5FgyF1.d.mts.map +0 -1
  178. package/dist/planner-produced-postgres-migration-D-ZcNy7h.d.mts +0 -1
  179. package/dist/planner-produced-postgres-migration-sxhIP3Te-Cn3sD9zE.d.mts.map +0 -1
  180. package/dist/planner-sql-checks-C54jJ5qt.d.mts +0 -39
  181. package/dist/planner-sql-checks-C54jJ5qt.d.mts.map +0 -1
  182. package/dist/planner-sql-checks-pAQfWJz_-CosbjrRp.mjs +0 -132
  183. package/dist/planner-sql-checks-pAQfWJz_-CosbjrRp.mjs.map +0 -1
  184. package/dist/postgres-migration-BGkcs09r-BmUXCs80.mjs.map +0 -1
  185. package/dist/prisma7-binding-XSuxkjqy.d.mts.map +0 -1
  186. package/dist/prisma7-binding-ZUOUC530.mjs.map +0 -1
  187. package/dist/sql-utils-DxE_vJt4-Dkjw9U45.mjs.map +0 -1
@@ -1,2 +1,2 @@
1
- import { n as resolveIdentityValue, t as buildBuiltinIdentityValue } from "./planner-identity-values-Dr5FgyF1.mjs";
1
+ import { n as resolveIdentityValue, t as buildBuiltinIdentityValue } from "./planner-identity-values-B-NAiN7I.mjs";
2
2
  export { buildBuiltinIdentityValue, resolveIdentityValue };
@@ -1,2 +1,2 @@
1
- import { n as resolveIdentityValue, t as buildBuiltinIdentityValue } from "./planner-identity-values--pbIuAZR-lgKcM-Zu.mjs";
1
+ import { n as resolveIdentityValue, t as buildBuiltinIdentityValue } from "./planner-identity-values-BnxSwhlS-CzyBeK0a.mjs";
2
2
  export { buildBuiltinIdentityValue, resolveIdentityValue };
@@ -1,3 +1,3 @@
1
- import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-sxhIP3Te-Cn3sD9zE.mjs";
2
- import "./planner-produced-postgres-migration-D-ZcNy7h.mjs";
1
+ import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-B6NsNaam-BmvloI2L.mjs";
2
+ import "./planner-produced-postgres-migration-BW8GJFjS.mjs";
3
3
  export { TypeScriptRenderablePostgresMigration };
@@ -1,2 +1,2 @@
1
- import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-BIKLMKpf-B5h4hpvf.mjs";
1
+ import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-F9joIngl-C04yYu-i.mjs";
2
2
  export { TypeScriptRenderablePostgresMigration };
@@ -1,2 +1,3 @@
1
- import { i as stackDataTypes, n as buildExpectedFormatType, r as qualifyTableName, t as alterTypeCheckText } from "./planner-sql-checks-C54jJ5qt.mjs";
2
- export { alterTypeCheckText, buildExpectedFormatType, qualifyTableName, stackDataTypes };
1
+ import { i as stackDataTypes, n as alterTypeCheck, r as qualifyTableName, t as ColumnTypeCheck } from "./planner-sql-checks-CxlrM4J2-VqQpmMwn.mjs";
2
+ import "./planner-sql-checks-CB4oLSuZ.mjs";
3
+ export { type ColumnTypeCheck, alterTypeCheck, qualifyTableName, stackDataTypes };
@@ -1,2 +1,2 @@
1
- import { a as stackDataTypes, i as qualifyTableName, n as buildExpectedFormatType, t as alterTypeCheckText } from "./planner-sql-checks-pAQfWJz_-CosbjrRp.mjs";
2
- export { alterTypeCheckText, buildExpectedFormatType, qualifyTableName, stackDataTypes };
1
+ import { a as stackDataTypes, i as qualifyTableName, t as alterTypeCheck } from "./planner-sql-checks-pkURMYMz-2QAIKyW-.mjs";
2
+ export { alterTypeCheck, qualifyTableName, stackDataTypes };
@@ -1,2 +1,2 @@
1
- import { n as createPostgresMigrationPlanner, t as contractToPostgresDatabaseSchemaNode } from "./planner-BBGH1cAB.mjs";
1
+ import { n as createPostgresMigrationPlanner, t as contractToPostgresDatabaseSchemaNode } from "./planner-B_MRApHM.mjs";
2
2
  export { contractToPostgresDatabaseSchemaNode, createPostgresMigrationPlanner };
@@ -1,3 +1,3 @@
1
- import { n as contractToPostgresDatabaseSchemaNode } from "./diff-database-schema-DLIpM5BX-DlEJquxk.mjs";
2
- import { t as createPostgresMigrationPlanner } from "./planner-BNoWx3rb-rkajA65G.mjs";
1
+ import { n as contractToPostgresDatabaseSchemaNode } from "./diff-database-schema-DyCIRT80-C1zMCmRx.mjs";
2
+ import { t as createPostgresMigrationPlanner } from "./planner-C1czBCmI-C-x1Ip-_.mjs";
3
3
  export { contractToPostgresDatabaseSchemaNode, createPostgresMigrationPlanner };
@@ -1,2 +1,2 @@
1
- import { t as prisma7PostgresBinding } from "./prisma7-binding-XSuxkjqy.mjs";
1
+ import { t as prisma7PostgresBinding } from "./prisma7-binding-C5RLV6kJ.mjs";
2
2
  export { prisma7PostgresBinding };
@@ -1,2 +1,2 @@
1
- import { t as prisma7PostgresBinding } from "./prisma7-binding-ZUOUC530.mjs";
1
+ import { t as prisma7PostgresBinding } from "./prisma7-binding-CzO7rkpS.mjs";
2
2
  export { prisma7PostgresBinding };
@@ -1,2 +1,2 @@
1
- import { t as renderOps } from "./render-ops-WhXRiDGu-LZMJf0aV.mjs";
1
+ import { t as renderOps } from "./render-ops-MeXLgeOa-nL4PdJzz.mjs";
2
2
  export { renderOps };
@@ -1,11 +1,11 @@
1
1
  import { S as PG_TEXT_CODEC_ID, c as PG_FLOAT4_CODEC_ID, j as PG_TSQUERY_CODEC_ID, n as PG_BOOL_CODEC_ID } from "./codec-ids-Cb0yO-IS--e0P2rfI.mjs";
2
2
  import { c as postgresError } from "./errors-BrhQYgdL-D_lIrddD.mjs";
3
- import { i as decodePostgresListText } from "./codecs-D183NDmb-DKryvPH2.mjs";
3
+ import { i as decodePostgresListText } from "./codecs-UZ1NEbvk-CMnI6Ti0.mjs";
4
4
  import { c as fullTextIndexOptions, n as FULL_TEXT_INDEX_TYPE } from "./full-text-index-definition-BPxQQBuC-BrpDsuJu.mjs";
5
- import { u as postgresNowGenerators } from "./authoring-mmK5aduF-BltVG_HJ.mjs";
6
- import { t as postgresTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-CMaPJG46-CPYTMJ7t.mjs";
7
- import { t as renderFullTextDocument } from "./full-text-search-document-DbegbX0J-jrbc8kfp.mjs";
8
- import { n as PostgresContractView, t as PostgresContractSerializer } from "./postgres-contract-view-csjnSNLt-M2QaYBn0.mjs";
5
+ import { u as postgresNowGenerators } from "./authoring-DhyLHFHA-pB4NuFxh.mjs";
6
+ import { t as postgresTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-C1AjrKaP-CYer0qt7.mjs";
7
+ import { t as renderFullTextDocument } from "./full-text-search-document-Doy5TF7c-DezgYsP-.mjs";
8
+ import { n as PostgresContractView, t as PostgresContractSerializer } from "./postgres-contract-view-B-bLZB7o-zpuamDXT.mjs";
9
9
  import { a as normalizationLiteral, c as toTsquery, i as languageLiteral, l as websearchToTsquery, o as phrasetoTsquery, r as headlineOptionsLiteral, s as plaintoTsquery, t as FullTextDocument } from "./full-text-parsers-CrMjTR2n-CHDNR_vE.mjs";
10
10
  import { blindCast } from "@prisma/orm-framework/utils/casts";
11
11
  import { type } from "arktype";
@@ -1 +1 @@
1
- {"version":3,"file":"target__runtime.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/runtime.mjs"],"sourcesContent":["import { S as PG_TEXT_CODEC_ID, c as PG_FLOAT4_CODEC_ID, j as PG_TSQUERY_CODEC_ID, n as PG_BOOL_CODEC_ID } from \"./codec-ids-Cb0yO-IS.mjs\";\nimport { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport { D as decodePostgresListText } from \"./codecs-D183NDmb.mjs\";\nimport { a as fullTextIndexOptions, t as FULL_TEXT_INDEX_TYPE } from \"./full-text-index-definition-BPxQQBuC.mjs\";\nimport { u as postgresNowGenerators } from \"./authoring-mmK5aduF.mjs\";\nimport { t as postgresTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-CMaPJG46.mjs\";\nimport { t as renderFullTextDocument } from \"./full-text-search-document-DbegbX0J.mjs\";\nimport { n as PostgresContractSerializer, t as PostgresContractView } from \"./postgres-contract-view-csjnSNLt.mjs\";\nimport { a as headlineOptionsLiteral, c as FullTextDocument, i as websearchToTsquery, n as plaintoTsquery, o as languageLiteral, r as toTsquery, s as normalizationLiteral, t as phrasetoTsquery } from \"./full-text-parsers-CrMjTR2n.mjs\";\nimport { type } from \"arktype\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { buildOperation, isExpression, toExpr } from \"@internal/sql-relational-core/expression\";\nimport { uniqueIndexNamesOfType } from \"@internal/sql-relational-core/index-reference\";\n//#region src/core/full-text-collection-method.ts\nfunction indexFunction(tools, name) {\n\treturn blindCast(tools.fns[name]);\n}\nfunction fullTextMethod(indexName) {\n\treturn (collection, ...args) => collection.where((_model, tools) => indexFunction(tools, \"fullTextMatches\")(tools.indexes[indexName], ...args)).orderBy((_model, tools) => indexFunction(tools, \"fullTextRank\")(tools.indexes[indexName], ...args).desc());\n}\n/** The run-time half of `PostgresFullTextMethods`. */\nconst postgresFullTextMethods = {\n\tid: \"postgres/fullText\",\n\tmethodsFor: (model) => Object.fromEntries(uniqueIndexNamesOfType(model.table.indexes, FULL_TEXT_INDEX_TYPE).map((name) => [name, fullTextMethod(name)]))\n};\n//#endregion\n//#region src/core/query-operations.ts\nconst TEXT_REF = { codecId: PG_TEXT_CODEC_ID };\nconst TSQUERY_REF = { codecId: PG_TSQUERY_CODEC_ID };\nconst languageOf = (options) => options.language ?? \"english\";\nfunction isIndexReference(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value) && !isExpression(value) && \"type\" in value && \"options\" in value && \"columns\" in value;\n}\nfunction invalidDocument(method, argument, received, message, fix) {\n\treturn postgresError(\"RUNTIME.ARGUMENT_INVALID\", `${method}: ${message}`, {\n\t\twhy: \"Postgres uses a full-text index only for a query over the same search document, so the document comes from the index itself, from one column, or from `fullTextDocument`.\",\n\t\tfix,\n\t\tmeta: {\n\t\t\thelper: method,\n\t\t\targument,\n\t\t\treceived\n\t\t}\n\t});\n}\n/**\n* The weight groups and the language a search document stands for. A full-text index states both;\n* a column and a `fullTextDocument` take the language from the options.\n*/\nfunction documentGroups(method, document, options) {\n\tif (document instanceof FullTextDocument) return {\n\t\tweightGroups: document.weightGroups,\n\t\tlanguage: languageOf(options)\n\t};\n\tif (isExpression(document)) return {\n\t\tweightGroups: [[document]],\n\t\tlanguage: languageOf(options)\n\t};\n\tif (!isIndexReference(document)) throw invalidDocument(method, \"document\", Array.isArray(document) ? \"array\" : typeof document, \"the document must be a full-text index from a table's `indexes`, a column, or a document from `fullTextDocument`.\", \"Pass the index, as `table.indexes.<name>`, or wrap the weight groups in `fullTextDocument(...)`.\");\n\tif (document.type !== \"fullText\") throw invalidDocument(method, \"document\", document.type, `the index is of type \"${String(document.type)}\", not a full-text index.`, \"Pass an index declared with `@@fullTextIndex` or `fullTextIndex`.\");\n\tif (options.language !== void 0) throw invalidDocument(method, \"options\", options.language, \"a full-text index states its language, so the `language` option is not taken with one.\", \"Leave `language` out; the index decides it.\");\n\tconst definition = fullTextIndexOptions(document.options ?? {});\n\tif (definition instanceof type.errors) throw invalidDocument(method, \"document\", document.options, `the full-text index has invalid options: ${definition.summary}`, \"Pass the index as the table gives it.\");\n\tconst columns = document.columns;\n\tconst columnOf = (name) => {\n\t\tconst column = typeof columns === \"object\" && columns !== null && Object.hasOwn(columns, name) ? Reflect.get(columns, name) : void 0;\n\t\tif (!isExpression(column)) throw invalidDocument(method, \"document\", name, `the full-text index has no column \"${name}\", which its weight groups name.`, \"Pass the index as the table gives it.\");\n\t\treturn column;\n\t};\n\treturn {\n\t\tweightGroups: definition.weightGroups.map((group) => group.map(columnOf)),\n\t\tlanguage: definition.language\n\t};\n}\n/**\n* The search document an operation searches. The first column is the operation's `self`; the\n* others follow the `fixedArgs` the operation passes first, so the query, the language and any\n* further option keep their positions.\n*/\nfunction searchDocument(method, document, options, fixedArgs) {\n\tconst { weightGroups, language } = documentGroups(method, document, options);\n\tlet position = 0;\n\tconst template = renderFullTextDocument(weightGroups.map((group) => group.map(() => position++)), {\n\t\tcolumn: (index) => index === 0 ? \"{{self}}\" : `{{arg${fixedArgs + index - 1}}}`,\n\t\tlanguage: \"{{arg1}}\"\n\t});\n\tconst [self, ...rest] = weightGroups.flat().map((column) => toExpr(column));\n\tassertDefined(self, `${method}: a checked document has a first column`);\n\treturn {\n\t\tself,\n\t\trest,\n\t\ttemplate,\n\t\tlanguage: languageLiteral(method, language)\n\t};\n}\nfunction postgresQueryOperations() {\n\treturn {\n\t\tilike: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (self, pattern) => buildOperation({\n\t\t\t\tmethod: \"ilike\",\n\t\t\t\targs: [toExpr(self), toExpr(pattern, TEXT_REF)],\n\t\t\t\treturns: {\n\t\t\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\t\t\tnullable: false\n\t\t\t\t},\n\t\t\t\tlowering: {\n\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\ttemplate: \"{{self}} ILIKE {{arg0}}\"\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tfullTextMatches: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (document, query, options = {}) => {\n\t\t\t\tconst searched = searchDocument(\"fullTextMatches\", document, options, 2);\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextMatches\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tsearched.self,\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\tsearched.language,\n\t\t\t\t\t\t...searched.rest\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${searched.template} @@ {{arg0}}`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tfullTextRank: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (document, query, options = {}) => {\n\t\t\t\tconst fn = options.coverDensity === true ? \"ts_rank_cd\" : \"ts_rank\";\n\t\t\t\tconst normalization = options.normalization === void 0 ? void 0 : normalizationLiteral(\"fullTextRank\", options.normalization);\n\t\t\t\tconst searched = searchDocument(\"fullTextRank\", document, options, normalization === void 0 ? 2 : 3);\n\t\t\t\tconst fixed = normalization === void 0 ? [searched.language] : [searched.language, normalization];\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextRank\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tsearched.self,\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\t...fixed,\n\t\t\t\t\t\t...searched.rest\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_FLOAT4_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${fn}(${searched.template}, {{arg0}}${normalization === void 0 ? \"\" : \", {{arg2}}\"})`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tfullTextHeadline: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (self, query, options = {}) => {\n\t\t\t\tconst headlineOptions = headlineOptionsLiteral(\"fullTextHeadline\", options);\n\t\t\t\tconst base = \"ts_headline({{arg1}}, {{self}}, {{arg0}}\";\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextHeadline\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\ttoExpr(self),\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\tlanguageLiteral(\"fullTextHeadline\", languageOf(options)),\n\t\t\t\t\t\t...headlineOptions === void 0 ? [] : [headlineOptions]\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${base}${headlineOptions === void 0 ? \"\" : \", {{arg2}}\"})`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\twebsearchToTsquery: { impl: websearchToTsquery },\n\t\ttoTsquery: { impl: toTsquery },\n\t\tplaintoTsquery: { impl: plaintoTsquery },\n\t\tphrasetoTsquery: { impl: phrasetoTsquery }\n\t};\n}\n//#endregion\n//#region src/exports/runtime.ts\n/**\n* Target-postgres deliberately does NOT import `SqlRuntimeTargetDescriptor` from `@internal/sql-runtime`. The target package is a control-plane residence and must not pull the SQL execution-plane package into its dependency closure. The runtime descriptor here is shaped to satisfy the framework's `RuntimeTargetDescriptor` plus the structural `SqlStaticContributions` (`codecs:` returning a descriptor list) that\n* `@internal/sql-runtime` consumers narrow to at composition time.\n*\n* The target itself contributes no codecs — postgres-specific codecs ship from the postgres adapter and from extension packs (pgvector, arktype-json, etc.).\n*/\nconst postgresRuntimeTargetDescriptor = {\n\t...postgresTargetDescriptorMetaRuntime,\n\tcodecs: () => [],\n\tlistDecoder: () => decodePostgresListText,\n\tqueryOperations: () => postgresQueryOperations(),\n\tcollectionMethods: () => [postgresFullTextMethods],\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t}\n};\n//#endregion\nexport { PostgresContractSerializer, PostgresContractView, decodePostgresListText, postgresRuntimeTargetDescriptor as default, postgresNowGenerators };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,cAAc,OAAO,MAAM;CACnC,OAAO,UAAU,MAAM,IAAI,KAAK;AACjC;AACA,SAAS,eAAe,WAAW;CAClC,QAAQ,YAAY,GAAG,SAAS,WAAW,OAAO,QAAQ,UAAU,cAAc,OAAO,iBAAiB,CAAC,CAAC,MAAM,QAAQ,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,QAAQ,UAAU,cAAc,OAAO,cAAc,CAAC,CAAC,MAAM,QAAQ,YAAY,GAAG,IAAI,CAAC,CAAC,KAAK,CAAC;AAC1P;;AAEA,MAAM,0BAA0B;CAC/B,IAAI;CACJ,aAAa,UAAU,OAAO,YAAY,uBAAuB,MAAM,MAAM,SAAS,oBAAoB,CAAC,CAAC,KAAK,SAAS,CAAC,MAAM,eAAe,IAAI,CAAC,CAAC,CAAC;AACxJ;AAGA,MAAM,WAAW,EAAE,SAAS,iBAAiB;AAC7C,MAAM,cAAc,EAAE,SAAS,oBAAoB;AACnD,MAAM,cAAc,YAAY,QAAQ,YAAY;AACpD,SAAS,iBAAiB,OAAO;CAChC,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK,KAAK,CAAC,aAAa,KAAK,KAAK,UAAU,SAAS,aAAa,SAAS,aAAa;AAC9J;AACA,SAAS,gBAAgB,QAAQ,UAAU,UAAU,SAAS,KAAK;CAClE,OAAO,cAAc,4BAA4B,GAAG,OAAO,IAAI,WAAW;EACzE,KAAK;EACL;EAC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,wBAAwB;CAC/C,yBAAyB,CAAC,uBAAuB;CACjD,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD"}
1
+ {"version":3,"file":"target__runtime.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/runtime.mjs"],"sourcesContent":["import { S as PG_TEXT_CODEC_ID, c as PG_FLOAT4_CODEC_ID, j as PG_TSQUERY_CODEC_ID, n as PG_BOOL_CODEC_ID } from \"./codec-ids-Cb0yO-IS.mjs\";\nimport { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport { D as decodePostgresListText } from \"./codecs-UZ1NEbvk.mjs\";\nimport { a as fullTextIndexOptions, t as FULL_TEXT_INDEX_TYPE } from \"./full-text-index-definition-BPxQQBuC.mjs\";\nimport { u as postgresNowGenerators } from \"./authoring-DhyLHFHA.mjs\";\nimport { t as postgresTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-C1AjrKaP.mjs\";\nimport { t as renderFullTextDocument } from \"./full-text-search-document-Doy5TF7c.mjs\";\nimport { n as PostgresContractSerializer, t as PostgresContractView } from \"./postgres-contract-view-B-bLZB7o.mjs\";\nimport { a as headlineOptionsLiteral, c as FullTextDocument, i as websearchToTsquery, n as plaintoTsquery, o as languageLiteral, r as toTsquery, s as normalizationLiteral, t as phrasetoTsquery } from \"./full-text-parsers-CrMjTR2n.mjs\";\nimport { type } from \"arktype\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { buildOperation, isExpression, toExpr } from \"@internal/sql-relational-core/expression\";\nimport { uniqueIndexNamesOfType } from \"@internal/sql-relational-core/index-reference\";\n//#region src/core/full-text-collection-method.ts\nfunction indexFunction(tools, name) {\n\treturn blindCast(tools.fns[name]);\n}\nfunction fullTextMethod(indexName) {\n\treturn (collection, ...args) => collection.where((_model, tools) => indexFunction(tools, \"fullTextMatches\")(tools.indexes[indexName], ...args)).orderBy((_model, tools) => indexFunction(tools, \"fullTextRank\")(tools.indexes[indexName], ...args).desc());\n}\n/** The run-time half of `PostgresFullTextMethods`. */\nconst postgresFullTextMethods = {\n\tid: \"postgres/fullText\",\n\tmethodsFor: (model) => Object.fromEntries(uniqueIndexNamesOfType(model.table.indexes, FULL_TEXT_INDEX_TYPE).map((name) => [name, fullTextMethod(name)]))\n};\n//#endregion\n//#region src/core/query-operations.ts\nconst TEXT_REF = { codecId: PG_TEXT_CODEC_ID };\nconst TSQUERY_REF = { codecId: PG_TSQUERY_CODEC_ID };\nconst languageOf = (options) => options.language ?? \"english\";\nfunction isIndexReference(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value) && !isExpression(value) && \"type\" in value && \"options\" in value && \"columns\" in value;\n}\nfunction invalidDocument(method, argument, received, message, fix) {\n\treturn postgresError(\"RUNTIME.ARGUMENT_INVALID\", `${method}: ${message}`, {\n\t\twhy: \"Postgres uses a full-text index only for a query over the same search document, so the document comes from the index itself, from one column, or from `fullTextDocument`.\",\n\t\tfix,\n\t\tmeta: {\n\t\t\thelper: method,\n\t\t\targument,\n\t\t\treceived\n\t\t}\n\t});\n}\n/**\n* The weight groups and the language a search document stands for. A full-text index states both;\n* a column and a `fullTextDocument` take the language from the options.\n*/\nfunction documentGroups(method, document, options) {\n\tif (document instanceof FullTextDocument) return {\n\t\tweightGroups: document.weightGroups,\n\t\tlanguage: languageOf(options)\n\t};\n\tif (isExpression(document)) return {\n\t\tweightGroups: [[document]],\n\t\tlanguage: languageOf(options)\n\t};\n\tif (!isIndexReference(document)) throw invalidDocument(method, \"document\", Array.isArray(document) ? \"array\" : typeof document, \"the document must be a full-text index from a table's `indexes`, a column, or a document from `fullTextDocument`.\", \"Pass the index, as `table.indexes.<name>`, or wrap the weight groups in `fullTextDocument(...)`.\");\n\tif (document.type !== \"fullText\") throw invalidDocument(method, \"document\", document.type, `the index is of type \"${String(document.type)}\", not a full-text index.`, \"Pass an index declared with `@@fullTextIndex` or `fullTextIndex`.\");\n\tif (options.language !== void 0) throw invalidDocument(method, \"options\", options.language, \"a full-text index states its language, so the `language` option is not taken with one.\", \"Leave `language` out; the index decides it.\");\n\tconst definition = fullTextIndexOptions(document.options ?? {});\n\tif (definition instanceof type.errors) throw invalidDocument(method, \"document\", document.options, `the full-text index has invalid options: ${definition.summary}`, \"Pass the index as the table gives it.\");\n\tconst columns = document.columns;\n\tconst columnOf = (name) => {\n\t\tconst column = typeof columns === \"object\" && columns !== null && Object.hasOwn(columns, name) ? Reflect.get(columns, name) : void 0;\n\t\tif (!isExpression(column)) throw invalidDocument(method, \"document\", name, `the full-text index has no column \"${name}\", which its weight groups name.`, \"Pass the index as the table gives it.\");\n\t\treturn column;\n\t};\n\treturn {\n\t\tweightGroups: definition.weightGroups.map((group) => group.map(columnOf)),\n\t\tlanguage: definition.language\n\t};\n}\n/**\n* The search document an operation searches. The first column is the operation's `self`; the\n* others follow the `fixedArgs` the operation passes first, so the query, the language and any\n* further option keep their positions.\n*/\nfunction searchDocument(method, document, options, fixedArgs) {\n\tconst { weightGroups, language } = documentGroups(method, document, options);\n\tlet position = 0;\n\tconst template = renderFullTextDocument(weightGroups.map((group) => group.map(() => position++)), {\n\t\tcolumn: (index) => index === 0 ? \"{{self}}\" : `{{arg${fixedArgs + index - 1}}}`,\n\t\tlanguage: \"{{arg1}}\"\n\t});\n\tconst [self, ...rest] = weightGroups.flat().map((column) => toExpr(column));\n\tassertDefined(self, `${method}: a checked document has a first column`);\n\treturn {\n\t\tself,\n\t\trest,\n\t\ttemplate,\n\t\tlanguage: languageLiteral(method, language)\n\t};\n}\nfunction postgresQueryOperations() {\n\treturn {\n\t\tilike: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (self, pattern) => buildOperation({\n\t\t\t\tmethod: \"ilike\",\n\t\t\t\targs: [toExpr(self), toExpr(pattern, TEXT_REF)],\n\t\t\t\treturns: {\n\t\t\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\t\t\tnullable: false\n\t\t\t\t},\n\t\t\t\tlowering: {\n\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\ttemplate: \"{{self}} ILIKE {{arg0}}\"\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tfullTextMatches: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (document, query, options = {}) => {\n\t\t\t\tconst searched = searchDocument(\"fullTextMatches\", document, options, 2);\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextMatches\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tsearched.self,\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\tsearched.language,\n\t\t\t\t\t\t...searched.rest\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${searched.template} @@ {{arg0}}`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tfullTextRank: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (document, query, options = {}) => {\n\t\t\t\tconst fn = options.coverDensity === true ? \"ts_rank_cd\" : \"ts_rank\";\n\t\t\t\tconst normalization = options.normalization === void 0 ? void 0 : normalizationLiteral(\"fullTextRank\", options.normalization);\n\t\t\t\tconst searched = searchDocument(\"fullTextRank\", document, options, normalization === void 0 ? 2 : 3);\n\t\t\t\tconst fixed = normalization === void 0 ? [searched.language] : [searched.language, normalization];\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextRank\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tsearched.self,\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\t...fixed,\n\t\t\t\t\t\t...searched.rest\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_FLOAT4_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${fn}(${searched.template}, {{arg0}}${normalization === void 0 ? \"\" : \", {{arg2}}\"})`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tfullTextHeadline: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (self, query, options = {}) => {\n\t\t\t\tconst headlineOptions = headlineOptionsLiteral(\"fullTextHeadline\", options);\n\t\t\t\tconst base = \"ts_headline({{arg1}}, {{self}}, {{arg0}}\";\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextHeadline\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\ttoExpr(self),\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\tlanguageLiteral(\"fullTextHeadline\", languageOf(options)),\n\t\t\t\t\t\t...headlineOptions === void 0 ? [] : [headlineOptions]\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${base}${headlineOptions === void 0 ? \"\" : \", {{arg2}}\"})`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\twebsearchToTsquery: { impl: websearchToTsquery },\n\t\ttoTsquery: { impl: toTsquery },\n\t\tplaintoTsquery: { impl: plaintoTsquery },\n\t\tphrasetoTsquery: { impl: phrasetoTsquery }\n\t};\n}\n//#endregion\n//#region src/exports/runtime.ts\n/**\n* Target-postgres deliberately does NOT import `SqlRuntimeTargetDescriptor` from `@internal/sql-runtime`. The target package is a control-plane residence and must not pull the SQL execution-plane package into its dependency closure. The runtime descriptor here is shaped to satisfy the framework's `RuntimeTargetDescriptor` plus the structural `SqlStaticContributions` (`codecs:` returning a descriptor list) that\n* `@internal/sql-runtime` consumers narrow to at composition time.\n*\n* The target itself contributes no codecs — postgres-specific codecs ship from the postgres adapter and from extension packs (pgvector, arktype-json, etc.).\n*/\nconst postgresRuntimeTargetDescriptor = {\n\t...postgresTargetDescriptorMetaRuntime,\n\tcodecs: () => [],\n\tlistDecoder: () => decodePostgresListText,\n\tqueryOperations: () => postgresQueryOperations(),\n\tcollectionMethods: () => [postgresFullTextMethods],\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t}\n};\n//#endregion\nexport { PostgresContractSerializer, PostgresContractView, decodePostgresListText, postgresRuntimeTargetDescriptor as default, postgresNowGenerators };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,cAAc,OAAO,MAAM;CACnC,OAAO,UAAU,MAAM,IAAI,KAAK;AACjC;AACA,SAAS,eAAe,WAAW;CAClC,QAAQ,YAAY,GAAG,SAAS,WAAW,OAAO,QAAQ,UAAU,cAAc,OAAO,iBAAiB,CAAC,CAAC,MAAM,QAAQ,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,QAAQ,UAAU,cAAc,OAAO,cAAc,CAAC,CAAC,MAAM,QAAQ,YAAY,GAAG,IAAI,CAAC,CAAC,KAAK,CAAC;AAC1P;;AAEA,MAAM,0BAA0B;CAC/B,IAAI;CACJ,aAAa,UAAU,OAAO,YAAY,uBAAuB,MAAM,MAAM,SAAS,oBAAoB,CAAC,CAAC,KAAK,SAAS,CAAC,MAAM,eAAe,IAAI,CAAC,CAAC,CAAC;AACxJ;AAGA,MAAM,WAAW,EAAE,SAAS,iBAAiB;AAC7C,MAAM,cAAc,EAAE,SAAS,oBAAoB;AACnD,MAAM,cAAc,YAAY,QAAQ,YAAY;AACpD,SAAS,iBAAiB,OAAO;CAChC,OA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IACD,CAAC;GACF;EACD;EACA,oBAAoB,EAAE,MAAM,mBAAmB;EAC/C,WAAW,EAAE,MAAM,UAAU;EAC7B,gBAAgB,EAAE,MAAM,eAAe;EACvC,iBAAiB,EAAE,MAAM,gBAAgB;CAC1C;AACD;;;;;;;AASA,MAAM,kCAAkC;CACvC,GAAG;CACH,cAAc,CAAC;CACf,mBAAmB;CACnB,uBAAuB,wBAAwB;CAC/C,yBAAyB,CAAC,uBAAuB;CACjD,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD"}
@@ -1,2 +1,2 @@
1
- import { r as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-B8cX92k0-DzN6Alxy.mjs";
1
+ import { r as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-IdPEiyLX-BZGpy8Wz.mjs";
2
2
  export { resolveDdlSchemaForNamespaceStorage };
@@ -1,4 +1,4 @@
1
- import { i as quoteIdentifier, n as escapeLiteral, o as quoteQualifiedName, r as qualifyName, s as validateEnumValueLength } from "./sql-utils-DxE_vJt4-Dkjw9U45.mjs";
1
+ import { a as quoteQualifiedName, i as quoteIdentifier, n as escapeLiteral, o as validateEnumValueLength, r as qualifyName } from "./sql-utils-Bnw3JbWf-zvWDkyrr.mjs";
2
2
  import { t as DEFAULT_FULL_TEXT_SEARCH_LANGUAGE } from "./full-text-index-definition-BPxQQBuC-BrpDsuJu.mjs";
3
- import { n as renderFullTextIndexDocument } from "./full-text-search-document-DbegbX0J-jrbc8kfp.mjs";
3
+ import { n as renderFullTextIndexDocument } from "./full-text-search-document-Doy5TF7c-DezgYsP-.mjs";
4
4
  export { DEFAULT_FULL_TEXT_SEARCH_LANGUAGE, escapeLiteral, qualifyName, quoteIdentifier, quoteQualifiedName, renderFullTextIndexDocument, validateEnumValueLength };
@@ -1,6 +1,6 @@
1
1
  import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs";
2
- import { c as PostgresSchema, d as isPostgresSchema, h as postgresCreateNamespace, i as PostgresRlsPolicy, m as policyInputFromSerialized, n as PostgresRlsEnablement, o as PostgresRole, u as PostgresUnboundSchema } from "./postgres-schema-BtW3Sw0F-CH3NqoOo.mjs";
3
- import { t as postgresRenderCheckExpressions } from "./check-expressions-DoxKokL1-RVvYRdA6.mjs";
2
+ import { c as PostgresSchema, d as isPostgresSchema, h as postgresCreateNamespace, i as PostgresRlsPolicy, m as policyInputFromSerialized, n as PostgresRlsEnablement, o as PostgresRole, u as PostgresUnboundSchema } from "./postgres-schema-DyUXtYIT-vb-RxpRN.mjs";
3
+ import { t as postgresRenderCheckExpressions } from "./check-expressions-7uCCP01t-WtUqfqkP.mjs";
4
4
  import { n as PostgresSchemaNodeKind, r as PostgresTableSchemaNode, t as PostgresNativeEnumSchemaNode } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
5
5
  import { i as PostgresRoleSchemaNode, n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
6
6
  export { PostgresDatabaseSchemaNode, PostgresNamespaceSchemaNode, PostgresNativeEnum, PostgresNativeEnumSchemaNode, PostgresPolicySchemaNode, PostgresRlsEnablement, PostgresRlsPolicy, PostgresRole, PostgresRoleSchemaNode, PostgresSchema, PostgresSchemaNodeKind, PostgresTableSchemaNode, PostgresUnboundSchema, isPostgresSchema, policyInputFromSerialized, postgresCreateNamespace, postgresRenderCheckExpressions };
@@ -1,11 +1,11 @@
1
- import { S as PG_TEXT_CODEC_ID } from "./codec-ids-Cb0yO-IS--e0P2rfI.mjs";
1
+ import { C as PG_TIMESTAMPTZ_DATE_CODEC_ID, S as PG_TEXT_CODEC_ID } from "./codec-ids-Cb0yO-IS--e0P2rfI.mjs";
2
2
  import { c as postgresError } from "./errors-BrhQYgdL-D_lIrddD.mjs";
3
- import { A as pgJsonb, i as createPostgresBuiltinDataTypeLookup, k as pgJson } from "./data-types-CQs1yW4F-CSexn8mK.mjs";
4
- import { r as createPostgresBuiltinCodecLookup } from "./codec-registry-CvKdYTYj-4xXqgKKs.mjs";
5
- import { t as POLICY_BLOCK_KEYWORDS } from "./authoring-mmK5aduF-BltVG_HJ.mjs";
6
- import { t as postgresRenderCheckExpressions } from "./check-expressions-DoxKokL1-RVvYRdA6.mjs";
7
- import { t as postgresDataTypeEntries } from "./data-type-entries-KJ4Mn8C5-DY3rLz33.mjs";
8
- import { n as readPostgresDefault } from "./default-normalizer-BqFHmlox-CP8ywN-r.mjs";
3
+ import { A as pgJsonb, i as createPostgresBuiltinDataTypeLookup, k as pgJson } from "./data-types-Cs-LkJBw-CJN57Y5M.mjs";
4
+ import { r as createPostgresBuiltinCodecLookup } from "./codec-registry-T79ktJL4-B9_zlIhI.mjs";
5
+ import { t as POLICY_BLOCK_KEYWORDS } from "./authoring-DhyLHFHA-pB4NuFxh.mjs";
6
+ import { t as postgresRenderCheckExpressions } from "./check-expressions-7uCCP01t-WtUqfqkP.mjs";
7
+ import { t as postgresDataTypeEntries } from "./data-type-entries-CqnLlCkK-uN0WjREd.mjs";
8
+ import { n as readPostgresDefault } from "./default-normalizer-BqK6XxdC-BAgxt9FF.mjs";
9
9
  import { codecForRef, readContractValue } from "@prisma/orm-framework/components/codec";
10
10
  import { blindCast } from "@prisma/orm-framework/utils/casts";
11
11
  import { escapePslString } from "@prisma/orm-family-sql/contract/data-type-support";
@@ -24,7 +24,7 @@ import { buildChildRelationField, deriveRelationFieldName, inferRelations, toEnu
24
24
  import { UNSPECIFIED_PSL_NAMESPACE_ID, makePslNamespace, makePslNamespaceEntries } from "@prisma/orm-framework/components/psl-ast";
25
25
  import { parsePslPositionalArgs } from "@prisma/orm-framework/psl-parser/interpret";
26
26
  import { isColumnDefault } from "@prisma/orm-framework/contract/types";
27
- //#region ../../../3-targets/3-targets/postgres/dist/infer-psl-contract-CKP3nwjB.mjs
27
+ //#region ../../../3-targets/3-targets/postgres/dist/type-constructors-CrNUrtwZ.mjs
28
28
  const SYNTHETIC_SPAN = {
29
29
  start: {
30
30
  offset: 0,
@@ -895,13 +895,13 @@ async function readInferredDefaults(schema, columnTypes, isEnumColumn, context)
895
895
  async function readColumnDefault$1(column, pslType, isEnum, context) {
896
896
  const raw = column.default;
897
897
  if (typeof raw !== "string") return isColumnDefault(raw) ? raw : void 0;
898
- return readDefaultWithCodec(raw, column.many === true ? `${column.nativeType}[]` : column.nativeType, codecOf(pslType, isEnum, context));
898
+ return readDefaultWithCodec(raw, column.many === true, codecOf(pslType, isEnum, context));
899
899
  }
900
900
  /**
901
- * Reads one reported default, `nativeType` ending in `[]` for a list column, with `codec`: a function default and SQL NULL as themselves, a literal the codec reads as its stored JSON, and anything else as the raw expression as reported.
901
+ * Reads one reported default, of a list column when `many`, with `codec`: a function default and SQL NULL as themselves, a literal the codec reads as its stored JSON, and anything else as the raw expression as reported.
902
902
  */
903
- async function readDefaultWithCodec(raw, nativeType, codec) {
904
- const reported = readPostgresDefault(raw, nativeType);
903
+ async function readDefaultWithCodec(raw, many, codec) {
904
+ const reported = readPostgresDefault(raw, many);
905
905
  if (reported.kind === "function") return reported;
906
906
  if (reported.kind === "null") return {
907
907
  kind: "literal",
@@ -1016,7 +1016,7 @@ async function inferPostgresPslContract(tree, context, describedContracts) {
1016
1016
  entityKind: "native_enum",
1017
1017
  entityName: reported.name
1018
1018
  }))?.spaceId : void 0;
1019
- if (owningSpaceId !== void 0) throw postgresError("CONTRACT.INFER_UNSUPPORTED", `contract infer: column "${tableName}"."${column.name}" is typed by native enum type "${column.nativeType}", which extension pack space "${owningSpaceId}" already describes. A cross-space enum-typed column has no authorable PSL form yet; describe the table in that pack's contract or retype the column before re-running contract infer.`, { meta: {
1019
+ if (owningSpaceId !== void 0) throw postgresError("CONTRACT.INFER_UNSUPPORTED", `contract infer: column "${tableName}"."${column.name}" is typed by native enum type "${column.typeText}", which extension pack space "${owningSpaceId}" already describes. A cross-space enum-typed column has no authorable PSL form yet; describe the table in that pack's contract or retype the column before re-running contract infer.`, { meta: {
1020
1020
  tableName,
1021
1021
  columnName: column.name
1022
1022
  } });
@@ -1139,7 +1139,377 @@ function buildPslDocumentAst(schemaIR, options, foreignKeyExtras, namespaceName,
1139
1139
  span: SYNTHETIC_SPAN
1140
1140
  };
1141
1141
  }
1142
+ /**
1143
+ * The base PSL scalars as zero-arg type constructors in the unified authoring
1144
+ * channel. Each names a codec; the column's database type is its data type's.
1145
+ *
1146
+ * The type position is the only storage decider: a mutation-default generator
1147
+ * (`@default(uuid())`) never re-picks a column's storage.
1148
+ */
1149
+ const postgresScalarAuthoringTypes = {
1150
+ String: {
1151
+ kind: "typeConstructor",
1152
+ inferred: true,
1153
+ documentation: "Variable-length text stored as PostgreSQL text.",
1154
+ output: { codecId: "pg/text@1" }
1155
+ },
1156
+ Boolean: {
1157
+ kind: "typeConstructor",
1158
+ inferred: true,
1159
+ documentation: "A true or false value stored as PostgreSQL boolean.",
1160
+ output: { codecId: "pg/bool@1" }
1161
+ },
1162
+ Int: {
1163
+ kind: "typeConstructor",
1164
+ inferred: true,
1165
+ documentation: "A signed 32-bit integer represented as a JavaScript number.",
1166
+ output: { codecId: "pg/int4@1" }
1167
+ },
1168
+ BigInt: {
1169
+ kind: "typeConstructor",
1170
+ inferred: true,
1171
+ documentation: "A signed 64-bit integer represented as a JavaScript bigint.",
1172
+ output: { codecId: "pg/int8@1" }
1173
+ },
1174
+ Float: {
1175
+ kind: "typeConstructor",
1176
+ inferred: true,
1177
+ documentation: "A double-precision floating-point number.",
1178
+ output: { codecId: "pg/float8@1" }
1179
+ },
1180
+ Decimal: {
1181
+ kind: "typeConstructor",
1182
+ documentation: "An exact decimal value stored as PostgreSQL numeric.",
1183
+ output: { codecId: "pg/numeric@1" }
1184
+ },
1185
+ DateTime: {
1186
+ kind: "typeConstructor",
1187
+ documentation: "An instant stored as PostgreSQL timestamptz and represented as Temporal.Instant.",
1188
+ output: { codecId: "pg/timestamptz-temporal@1" }
1189
+ },
1190
+ Json: {
1191
+ kind: "typeConstructor",
1192
+ inferred: true,
1193
+ documentation: "A JSON value stored as PostgreSQL json.",
1194
+ output: { codecId: "pg/json@1" }
1195
+ },
1196
+ Jsonb: {
1197
+ kind: "typeConstructor",
1198
+ inferred: true,
1199
+ documentation: "A JSON value stored in PostgreSQL binary jsonb format.",
1200
+ output: { codecId: "pg/jsonb@1" }
1201
+ },
1202
+ Bytes: {
1203
+ kind: "typeConstructor",
1204
+ inferred: true,
1205
+ documentation: "Binary data stored as PostgreSQL bytea.",
1206
+ output: { codecId: "pg/bytea@1" }
1207
+ }
1208
+ };
1209
+ const postgresNativeAuthoringTypes = {
1210
+ VarChar: {
1211
+ kind: "typeConstructor",
1212
+ inferred: true,
1213
+ documentation: "Variable-length text with an optional maximum character length.",
1214
+ args: [{
1215
+ kind: "number",
1216
+ name: "length",
1217
+ integer: true,
1218
+ optional: true
1219
+ }],
1220
+ output: {
1221
+ codecId: "sql/varchar@1",
1222
+ typeParams: { length: {
1223
+ kind: "arg",
1224
+ index: 0
1225
+ } }
1226
+ }
1227
+ },
1228
+ Char: {
1229
+ kind: "typeConstructor",
1230
+ inferred: true,
1231
+ documentation: "Fixed-length, blank-padded text with an optional character length.",
1232
+ args: [{
1233
+ kind: "number",
1234
+ name: "length",
1235
+ integer: true,
1236
+ optional: true
1237
+ }],
1238
+ output: {
1239
+ codecId: "sql/char@1",
1240
+ typeParams: { length: {
1241
+ kind: "arg",
1242
+ index: 0
1243
+ } }
1244
+ }
1245
+ },
1246
+ Numeric: {
1247
+ kind: "typeConstructor",
1248
+ inferred: true,
1249
+ documentation: "An exact decimal value with optional precision and scale.",
1250
+ args: [{
1251
+ kind: "number",
1252
+ name: "precision",
1253
+ integer: true,
1254
+ optional: true
1255
+ }, {
1256
+ kind: "number",
1257
+ name: "scale",
1258
+ integer: true,
1259
+ optional: true
1260
+ }],
1261
+ output: {
1262
+ codecId: "pg/numeric@1",
1263
+ typeParams: {
1264
+ precision: {
1265
+ kind: "arg",
1266
+ index: 0
1267
+ },
1268
+ scale: {
1269
+ kind: "arg",
1270
+ index: 1
1271
+ }
1272
+ }
1273
+ }
1274
+ },
1275
+ Timestamp: {
1276
+ kind: "typeConstructor",
1277
+ documentation: "A date and time without a time zone, represented as Temporal.PlainDateTime.",
1278
+ args: [{
1279
+ kind: "number",
1280
+ name: "precision",
1281
+ integer: true,
1282
+ optional: true
1283
+ }],
1284
+ output: {
1285
+ codecId: "pg/timestamp-temporal@1",
1286
+ typeParams: { precision: {
1287
+ kind: "arg",
1288
+ index: 0
1289
+ } }
1290
+ }
1291
+ },
1292
+ Timestamptz: {
1293
+ kind: "typeConstructor",
1294
+ documentation: "An instant represented as Temporal.Instant, with optional fractional-second precision.",
1295
+ args: [{
1296
+ kind: "number",
1297
+ name: "precision",
1298
+ integer: true,
1299
+ optional: true
1300
+ }],
1301
+ output: {
1302
+ codecId: "pg/timestamptz-temporal@1",
1303
+ typeParams: { precision: {
1304
+ kind: "arg",
1305
+ index: 0
1306
+ } }
1307
+ }
1308
+ },
1309
+ Time: {
1310
+ kind: "typeConstructor",
1311
+ documentation: "A time of day without a time zone, represented as Temporal.PlainTime.",
1312
+ args: [{
1313
+ kind: "number",
1314
+ name: "precision",
1315
+ integer: true,
1316
+ optional: true
1317
+ }],
1318
+ output: {
1319
+ codecId: "pg/time-temporal@1",
1320
+ typeParams: { precision: {
1321
+ kind: "arg",
1322
+ index: 0
1323
+ } }
1324
+ }
1325
+ },
1326
+ Timetz: {
1327
+ kind: "typeConstructor",
1328
+ inferred: true,
1329
+ documentation: "A time of day with a UTC offset stored as PostgreSQL timetz.",
1330
+ args: [{
1331
+ kind: "number",
1332
+ name: "precision",
1333
+ integer: true,
1334
+ optional: true
1335
+ }],
1336
+ output: {
1337
+ codecId: "pg/timetz@1",
1338
+ typeParams: { precision: {
1339
+ kind: "arg",
1340
+ index: 0
1341
+ } }
1342
+ }
1343
+ },
1344
+ Uuid: {
1345
+ kind: "typeConstructor",
1346
+ inferred: true,
1347
+ documentation: "A universally unique identifier stored as PostgreSQL uuid.",
1348
+ output: { codecId: "pg/uuid@1" }
1349
+ },
1350
+ Inet: {
1351
+ kind: "typeConstructor",
1352
+ inferred: true,
1353
+ documentation: "An IPv4 or IPv6 address with an optional subnet mask.",
1354
+ output: { codecId: "pg/inet@1" }
1355
+ },
1356
+ SmallInt: {
1357
+ kind: "typeConstructor",
1358
+ inferred: true,
1359
+ documentation: "A signed 16-bit integer represented as a JavaScript number.",
1360
+ output: { codecId: "pg/int2@1" }
1361
+ },
1362
+ Real: {
1363
+ kind: "typeConstructor",
1364
+ inferred: true,
1365
+ documentation: "A single-precision floating-point number.",
1366
+ output: { codecId: "pg/float4@1" }
1367
+ },
1368
+ Date: {
1369
+ kind: "typeConstructor",
1370
+ documentation: "A calendar date represented as Temporal.PlainDate.",
1371
+ output: { codecId: "pg/date-temporal@1" }
1372
+ },
1373
+ DateString: {
1374
+ kind: "typeConstructor",
1375
+ inferred: true,
1376
+ documentation: "A PostgreSQL date represented as database text rather than Temporal.PlainDate.",
1377
+ output: { codecId: "pg/date-string@1" }
1378
+ },
1379
+ TimestampString: {
1380
+ kind: "typeConstructor",
1381
+ inferred: true,
1382
+ documentation: "A timestamp without a time zone represented as PostgreSQL text.",
1383
+ args: [{
1384
+ kind: "number",
1385
+ name: "precision",
1386
+ integer: true,
1387
+ optional: true
1388
+ }],
1389
+ output: {
1390
+ codecId: "pg/timestamp-string@1",
1391
+ typeParams: { precision: {
1392
+ kind: "arg",
1393
+ index: 0
1394
+ } }
1395
+ }
1396
+ },
1397
+ TimestamptzJsDate: {
1398
+ kind: "typeConstructor",
1399
+ documentation: "An instant stored as PostgreSQL timestamptz and represented as a JavaScript Date.",
1400
+ args: [{
1401
+ kind: "number",
1402
+ name: "precision",
1403
+ integer: true,
1404
+ optional: true
1405
+ }],
1406
+ output: {
1407
+ codecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,
1408
+ typeParams: { precision: {
1409
+ kind: "arg",
1410
+ index: 0
1411
+ } }
1412
+ }
1413
+ },
1414
+ TimestamptzString: {
1415
+ kind: "typeConstructor",
1416
+ inferred: true,
1417
+ documentation: "A timestamp with time zone represented as PostgreSQL text.",
1418
+ args: [{
1419
+ kind: "number",
1420
+ name: "precision",
1421
+ integer: true,
1422
+ optional: true
1423
+ }],
1424
+ output: {
1425
+ codecId: "pg/timestamptz-string@1",
1426
+ typeParams: { precision: {
1427
+ kind: "arg",
1428
+ index: 0
1429
+ } }
1430
+ }
1431
+ },
1432
+ TimeString: {
1433
+ kind: "typeConstructor",
1434
+ inferred: true,
1435
+ documentation: "A time of day without a time zone represented as PostgreSQL text.",
1436
+ args: [{
1437
+ kind: "number",
1438
+ name: "precision",
1439
+ integer: true,
1440
+ optional: true
1441
+ }],
1442
+ output: {
1443
+ codecId: "pg/time-string@1",
1444
+ typeParams: { precision: {
1445
+ kind: "arg",
1446
+ index: 0
1447
+ } }
1448
+ }
1449
+ },
1450
+ Bit: {
1451
+ kind: "typeConstructor",
1452
+ inferred: true,
1453
+ documentation: "A fixed-length bit string with an optional length in bits.",
1454
+ args: [{
1455
+ kind: "number",
1456
+ name: "length",
1457
+ integer: true,
1458
+ optional: true
1459
+ }],
1460
+ output: {
1461
+ codecId: "pg/bit@1",
1462
+ typeParams: { length: {
1463
+ kind: "arg",
1464
+ index: 0
1465
+ } }
1466
+ }
1467
+ },
1468
+ VarBit: {
1469
+ kind: "typeConstructor",
1470
+ inferred: true,
1471
+ documentation: "A variable-length bit string with an optional maximum length in bits.",
1472
+ args: [{
1473
+ kind: "number",
1474
+ name: "length",
1475
+ integer: true,
1476
+ optional: true
1477
+ }],
1478
+ output: {
1479
+ codecId: "pg/varbit@1",
1480
+ typeParams: { length: {
1481
+ kind: "arg",
1482
+ index: 0
1483
+ } }
1484
+ }
1485
+ },
1486
+ Interval: {
1487
+ kind: "typeConstructor",
1488
+ inferred: true,
1489
+ documentation: "A span of time stored as PostgreSQL interval, with optional fractional-second precision.",
1490
+ args: [{
1491
+ kind: "number",
1492
+ name: "precision",
1493
+ integer: true,
1494
+ optional: true
1495
+ }],
1496
+ output: {
1497
+ codecId: "pg/interval@1",
1498
+ typeParams: { precision: {
1499
+ kind: "arg",
1500
+ index: 0
1501
+ } }
1502
+ }
1503
+ }
1504
+ };
1505
+ /**
1506
+ * The constructors only PSL offers, defined here next to the codecs they name. The adapter contributes them: the TypeScript contract builder builds its `type.*` helpers from the target, so a target contribution would add `type.String()` and the like there. The constructors that should also be `type.*` helpers are the target's own, in `postgresAuthoringTypes`.
1507
+ */
1508
+ const postgresPslTypeConstructors = {
1509
+ ...postgresScalarAuthoringTypes,
1510
+ ...postgresNativeAuthoringTypes
1511
+ };
1142
1512
  //#endregion
1143
- export { buildIndexAttribute as a, buildNativeEnumBlock as c, inferPostgresPslContract as d, namedArg as f, positionalArg as g, parseDefaultAttributeString as h, buildFullTextIndexAttribute as i, buildPslDocumentAst as l, noInferredDefaults as m, buildAttribute as n, buildMapAttribute as o, noColumnDefaults as p, buildCheckAttribute as r, buildModelConstraintAttribute as s, SYNTHETIC_SPAN as t, createPostgresDefaultMapping as u };
1513
+ export { postgresNativeAuthoringTypes as _, buildIndexAttribute as a, buildNativeEnumBlock as c, inferPostgresPslContract as d, namedArg as f, positionalArg as g, parseDefaultAttributeString as h, buildFullTextIndexAttribute as i, buildPslDocumentAst as l, noInferredDefaults as m, buildAttribute as n, buildMapAttribute as o, noColumnDefaults as p, buildCheckAttribute as r, buildModelConstraintAttribute as s, SYNTHETIC_SPAN as t, createPostgresDefaultMapping as u, postgresPslTypeConstructors as v, postgresScalarAuthoringTypes as y };
1144
1514
 
1145
- //# sourceMappingURL=infer-psl-contract-CKP3nwjB-x1_ji7Z9.mjs.map
1515
+ //# sourceMappingURL=type-constructors-CrNUrtwZ-dmWF-mtV.mjs.map