@prisma/orm-target-postgres 8.0.0-rc.21-dev.12 → 8.0.0-rc.21-dev.14

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 (160) hide show
  1. package/dist/{adapter-t3IEEEbY-BKJyNGtz.mjs → adapter-DJoHcCZV-CWdrs4yI.mjs} +3 -3
  2. package/dist/{adapter-t3IEEEbY-BKJyNGtz.mjs.map → adapter-DJoHcCZV-CWdrs4yI.mjs.map} +1 -1
  3. package/dist/{adapter-BdL6nOY0.d.mts → adapter-Dz86ldS1.d.mts} +14 -14
  4. package/dist/{adapter-BdL6nOY0.d.mts.map → adapter-Dz86ldS1.d.mts.map} +1 -1
  5. package/dist/adapter.d.mts +7 -7
  6. package/dist/adapter.mjs +2 -2
  7. package/dist/adapter__adapter.d.mts +1 -1
  8. package/dist/adapter__adapter.mjs +2 -2
  9. package/dist/adapter__control.d.mts +1 -1
  10. package/dist/adapter__control.mjs +2 -2
  11. package/dist/adapter__control.mjs.map +1 -1
  12. package/dist/adapter__runtime.d.mts +1 -1
  13. package/dist/adapter__runtime.mjs +2 -2
  14. package/dist/adapter__runtime.mjs.map +1 -1
  15. package/dist/adapter__sql-renderer.d.mts +1 -1
  16. package/dist/adapter__types.d.mts +3 -3
  17. package/dist/{aggregates-CCEULCRK.d.mts → aggregates-CJGvlOCM.d.mts} +12 -12
  18. package/dist/{aggregates-CCEULCRK.d.mts.map → aggregates-CJGvlOCM.d.mts.map} +1 -1
  19. package/dist/{authoring-D7EAP1iG-DlpkOeVt.mjs → authoring-BFb5LVsK-CkHmM-aP.mjs} +50 -3
  20. package/dist/authoring-BFb5LVsK-CkHmM-aP.mjs.map +1 -0
  21. package/dist/{authoring-DWd5pnnV-BBX7P1wT.d.mts → authoring-BRqyCnBa-CAzlQNHw.d.mts} +5 -4
  22. package/dist/{authoring-DWd5pnnV-BBX7P1wT.d.mts.map → authoring-BRqyCnBa-CAzlQNHw.d.mts.map} +1 -1
  23. package/dist/{contract-contributions-CbLCF8jV-BOZHg83r.mjs → contract-contributions-DS1YZqxl-CipEzWQj.mjs} +17 -5
  24. package/dist/contract-contributions-DS1YZqxl-CipEzWQj.mjs.map +1 -0
  25. package/dist/{contract-free-B6-wuc6M.d.mts → contract-free-DcaYH2c5.d.mts} +6 -2
  26. package/dist/contract-free-DcaYH2c5.d.mts.map +1 -0
  27. package/dist/{contract-free-DtJ1gJxN.mjs → contract-free-DmNEp1_Y.mjs} +3 -3
  28. package/dist/contract-free-DmNEp1_Y.mjs.map +1 -0
  29. package/dist/{control-DKpIWFg_.d.mts → control-2DHRXqEz.d.mts} +5 -3
  30. package/dist/{control-DKpIWFg_.d.mts.map → control-2DHRXqEz.d.mts.map} +1 -1
  31. package/dist/{control-policy-DZzwyc3L-_Bf4iEaW.mjs → control-policy-DYDR6FhY-CPBeYqu5.mjs} +45 -10
  32. package/dist/control-policy-DYDR6FhY-CPBeYqu5.mjs.map +1 -0
  33. package/dist/{ddl-URS0VlHr--s2jpN6c.mjs → ddl-qu-IzeH4-CFpSpY0X.mjs} +11 -4
  34. package/dist/ddl-qu-IzeH4-CFpSpY0X.mjs.map +1 -0
  35. package/dist/{descriptor-meta-BPjw5dIw-DSlWgzbV.mjs → descriptor-meta-5gncreHF-BD1kpxJu.mjs} +3 -3
  36. package/dist/{descriptor-meta-BPjw5dIw-DSlWgzbV.mjs.map → descriptor-meta-5gncreHF-BD1kpxJu.mjs.map} +1 -1
  37. package/dist/{descriptor-meta-DokyxrzY-D2S-BLI0.mjs → descriptor-meta-CszCf4Hs-DVGeuxNv.mjs} +4 -4
  38. package/dist/{descriptor-meta-DokyxrzY-D2S-BLI0.mjs.map → descriptor-meta-CszCf4Hs-DVGeuxNv.mjs.map} +1 -1
  39. package/dist/{diff-database-schema-BxzhZaVN.d.mts → diff-database-schema-COp7SqEI.d.mts} +5 -3
  40. package/dist/{diff-database-schema-BxzhZaVN.d.mts.map → diff-database-schema-COp7SqEI.d.mts.map} +1 -1
  41. package/dist/{diff-database-schema-DrOE5ahI-BfrNtMDu.mjs → diff-database-schema-DyoCp8VS-BKtXp-eB.mjs} +30 -8
  42. package/dist/diff-database-schema-DyoCp8VS-BKtXp-eB.mjs.map +1 -0
  43. package/dist/{infer-psl-contract-Du026CJo-sRmqBsId.mjs → infer-psl-contract-BP2DgxTx-BqV8gUu4.mjs} +45 -6
  44. package/dist/infer-psl-contract-BP2DgxTx-BqV8gUu4.mjs.map +1 -0
  45. package/dist/{issue-planner-BLiMn8iP.d.mts → issue-planner-BUo9S9Ge.d.mts} +3 -3
  46. package/dist/{issue-planner-BLiMn8iP.d.mts.map → issue-planner-BUo9S9Ge.d.mts.map} +1 -1
  47. package/dist/migration-Be_iuIpn.mjs.map +1 -1
  48. package/dist/{migration-cnT6b-9x.d.mts → migration-Drs_EeiM.d.mts} +10 -3
  49. package/dist/migration-Drs_EeiM.d.mts.map +1 -0
  50. package/dist/op-factory-call-D2HXLJQJ.d.mts +1 -0
  51. package/dist/{op-factory-call-DsQATX-o-BHcqPXrs.mjs → op-factory-call-DyQO1ZdB-CnbOJIf8.mjs} +115 -20
  52. package/dist/op-factory-call-DyQO1ZdB-CnbOJIf8.mjs.map +1 -0
  53. package/dist/{op-factory-call-DeaoFqMW-XAP00c7U.d.mts → op-factory-call-L1gqYhhk-DMnspvjf.d.mts} +30 -6
  54. package/dist/{op-factory-call-DeaoFqMW-XAP00c7U.d.mts.map → op-factory-call-L1gqYhhk-DMnspvjf.d.mts.map} +1 -1
  55. package/dist/{pack-CjVhjxir.d.mts → pack-CLpRLkRQ.d.mts} +27 -4
  56. package/dist/{pack-CjVhjxir.d.mts.map → pack-CLpRLkRQ.d.mts.map} +1 -1
  57. package/dist/{planner-RW8za3Vm.d.mts → planner-Bl3kIyMG.d.mts} +4 -4
  58. package/dist/{planner-RW8za3Vm.d.mts.map → planner-Bl3kIyMG.d.mts.map} +1 -1
  59. package/dist/{planner-CNoNH9bo-3g7WX476.mjs → planner-D1mzh6Cb-B1Z2YTiQ.mjs} +19 -13
  60. package/dist/planner-D1mzh6Cb-B1Z2YTiQ.mjs.map +1 -0
  61. package/dist/{planner-produced-postgres-migration-DnAk6KxF-Vj31eyEf.mjs → planner-produced-postgres-migration-Cw8gbwED-tyj9TLlB.mjs} +4 -4
  62. package/dist/{planner-produced-postgres-migration-DnAk6KxF-Vj31eyEf.mjs.map → planner-produced-postgres-migration-Cw8gbwED-tyj9TLlB.mjs.map} +1 -1
  63. package/dist/{planner-produced-postgres-migration-DtjZyo7p-CQxcHWwC.d.mts → planner-produced-postgres-migration-Cx9bERx3-DRNnR16E.d.mts} +3 -3
  64. package/dist/planner-produced-postgres-migration-Cx9bERx3-DRNnR16E.d.mts.map +1 -0
  65. package/dist/planner-produced-postgres-migration-DRPVY4iL.d.mts +1 -0
  66. package/dist/{planner-sql-checks-CvI80tt0-B5bKCucD.mjs → planner-sql-checks-FU4T7wgu-C-tIJOH-.mjs} +3 -3
  67. package/dist/{planner-sql-checks-CvI80tt0-B5bKCucD.mjs.map → planner-sql-checks-FU4T7wgu-C-tIJOH-.mjs.map} +1 -1
  68. package/dist/{postgres-contract-view-CRy_3BMc-60fosJRZ.mjs → postgres-contract-view-iwNgaXQw-QzVSakJT.mjs} +30 -4
  69. package/dist/postgres-contract-view-iwNgaXQw-QzVSakJT.mjs.map +1 -0
  70. package/dist/{postgres-database-schema-node-Cv8usVNX-BmvGozi4.d.mts → postgres-database-schema-node-BjmJ6_Cs-LyZ0n9oj.d.mts} +33 -5
  71. package/dist/postgres-database-schema-node-BjmJ6_Cs-LyZ0n9oj.d.mts.map +1 -0
  72. package/dist/{postgres-migration-CSU_fUlQ-C5TNpgq4.mjs → postgres-migration-BhijSOgq-CP_oflub.mjs} +29 -11
  73. package/dist/postgres-migration-BhijSOgq-CP_oflub.mjs.map +1 -0
  74. package/dist/{postgres-migration-CDPlleMc-B4JQjDcN.d.mts → postgres-migration-DNnmFBsR-BJU9865a.d.mts} +19 -2
  75. package/dist/{postgres-migration-CDPlleMc-B4JQjDcN.d.mts.map → postgres-migration-DNnmFBsR-BJU9865a.d.mts.map} +1 -1
  76. package/dist/{postgres-role-schema-node-B8Z5i5D--BzOKm4N1.mjs → postgres-role-schema-node-DuljIQWp-D6Q5JyEs.mjs} +12 -5
  77. package/dist/postgres-role-schema-node-DuljIQWp-D6Q5JyEs.mjs.map +1 -0
  78. package/dist/{postgres-schema-osNZNX0D-BpKJDg4M.mjs → postgres-schema-BBWgs4fX-DWdYxNi8.mjs} +35 -4
  79. package/dist/postgres-schema-BBWgs4fX-DWdYxNi8.mjs.map +1 -0
  80. package/dist/{postgres-schema-Xsjt3RKO-bis-SVSB.d.mts → postgres-schema-CJvUnBU9-Bvn7zbr1.d.mts} +21 -3
  81. package/dist/postgres-schema-CJvUnBU9-Bvn7zbr1.d.mts.map +1 -0
  82. package/dist/{postgres-table-schema-node-BBkitBQh-Dll8iaZT.mjs → postgres-table-schema-node-nY6II-Uv-Bj-lgmSi.mjs} +50 -6
  83. package/dist/postgres-table-schema-node-nY6II-Uv-Bj-lgmSi.mjs.map +1 -0
  84. package/dist/{prisma7-binding-DiHnmsNq.d.mts → prisma7-binding-BFypqPE0.d.mts} +48 -4
  85. package/dist/{prisma7-binding-DiHnmsNq.d.mts.map → prisma7-binding-BFypqPE0.d.mts.map} +1 -1
  86. package/dist/{prisma7-binding-CPcA6N3v.mjs → prisma7-binding-DWW3L3C4.mjs} +26 -5
  87. package/dist/{prisma7-binding-CPcA6N3v.mjs.map → prisma7-binding-DWW3L3C4.mjs.map} +1 -1
  88. package/dist/{render-ops-Cj7mog0v-DPzODjA0.mjs → render-ops-5VMQY7FM-Cdil7oOP.mjs} +3 -3
  89. package/dist/{render-ops-Cj7mog0v-DPzODjA0.mjs.map → render-ops-5VMQY7FM-Cdil7oOP.mjs.map} +1 -1
  90. package/dist/{resolve-ddl-schema-uDXEVepU-COWNfVPC.mjs → resolve-ddl-schema-BZzteXH1-C57Iavtu.mjs} +3 -3
  91. package/dist/{resolve-ddl-schema-uDXEVepU-COWNfVPC.mjs.map → resolve-ddl-schema-BZzteXH1-C57Iavtu.mjs.map} +1 -1
  92. package/dist/{runtime-DMle_B4T.d.mts → runtime-BJetnmVm.d.mts} +2 -1
  93. package/dist/runtime-BJetnmVm.d.mts.map +1 -0
  94. package/dist/{runtime-R_BCXCp_.d.mts → runtime-K2strEv6.d.mts} +3 -3
  95. package/dist/{runtime-R_BCXCp_.d.mts.map → runtime-K2strEv6.d.mts.map} +1 -1
  96. package/dist/{schema-node-kinds-C52Bb1ve-DmxQRPPS.d.mts → schema-node-kinds-Baf4tcly-CI3SyVG4.d.mts} +3 -2
  97. package/dist/schema-node-kinds-Baf4tcly-CI3SyVG4.d.mts.map +1 -0
  98. package/dist/{sql-renderer-BnO2fkSf.d.mts → sql-renderer-PT6pQ66O.d.mts} +3 -3
  99. package/dist/{sql-renderer-BnO2fkSf.d.mts.map → sql-renderer-PT6pQ66O.d.mts.map} +1 -1
  100. package/dist/target.d.mts +19 -19
  101. package/dist/target.mjs +18 -18
  102. package/dist/target__aggregates.d.mts +1 -1
  103. package/dist/target__contract-free.d.mts +2 -2
  104. package/dist/target__contract-free.mjs +4 -4
  105. package/dist/target__control.mjs +44 -18
  106. package/dist/target__control.mjs.map +1 -1
  107. package/dist/target__diff-database-schema.d.mts +1 -1
  108. package/dist/target__diff-database-schema.mjs +1 -1
  109. package/dist/target__issue-planner.d.mts +1 -1
  110. package/dist/target__issue-planner.mjs +1 -1
  111. package/dist/target__migration.d.mts +2 -2
  112. package/dist/target__migration.mjs +2 -2
  113. package/dist/target__op-factory-call.d.mts +3 -3
  114. package/dist/target__op-factory-call.mjs +2 -2
  115. package/dist/target__pack.d.mts +1 -1
  116. package/dist/target__pack.mjs +1 -1
  117. package/dist/target__planner-produced-postgres-migration.d.mts +2 -2
  118. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  119. package/dist/target__planner-sql-checks.mjs +1 -1
  120. package/dist/target__planner.d.mts +1 -1
  121. package/dist/target__planner.mjs +2 -2
  122. package/dist/target__prisma7-binding.d.mts +1 -1
  123. package/dist/target__prisma7-binding.mjs +1 -1
  124. package/dist/target__render-ops.mjs +1 -1
  125. package/dist/target__runtime.d.mts +1 -1
  126. package/dist/target__runtime.mjs +1 -1
  127. package/dist/target__runtime.mjs.map +1 -1
  128. package/dist/target__schema-ir-annotations.mjs +1 -1
  129. package/dist/target__types.d.mts +5 -5
  130. package/dist/target__types.mjs +4 -4
  131. package/dist/{types-D6lgKhE5-BrgAgVCq.d.mts → types-D6lgKhE5-DVHMZPbP.d.mts} +2 -2
  132. package/dist/{types-D6lgKhE5-BrgAgVCq.d.mts.map → types-D6lgKhE5-DVHMZPbP.d.mts.map} +1 -1
  133. package/dist/{types-D-U10Lyo.d.mts → types-D6p1198n.d.mts} +4 -4
  134. package/dist/{types-D-U10Lyo.d.mts.map → types-D6p1198n.d.mts.map} +1 -1
  135. package/dist/types-oaZIR8i0.d.mts +2 -0
  136. package/package.json +9 -9
  137. package/dist/authoring-D7EAP1iG-DlpkOeVt.mjs.map +0 -1
  138. package/dist/contract-contributions-CbLCF8jV-BOZHg83r.mjs.map +0 -1
  139. package/dist/contract-free-B6-wuc6M.d.mts.map +0 -1
  140. package/dist/contract-free-DtJ1gJxN.mjs.map +0 -1
  141. package/dist/control-policy-DZzwyc3L-_Bf4iEaW.mjs.map +0 -1
  142. package/dist/ddl-URS0VlHr--s2jpN6c.mjs.map +0 -1
  143. package/dist/diff-database-schema-DrOE5ahI-BfrNtMDu.mjs.map +0 -1
  144. package/dist/infer-psl-contract-Du026CJo-sRmqBsId.mjs.map +0 -1
  145. package/dist/migration-cnT6b-9x.d.mts.map +0 -1
  146. package/dist/op-factory-call-D9O6cXRE.d.mts +0 -1
  147. package/dist/op-factory-call-DsQATX-o-BHcqPXrs.mjs.map +0 -1
  148. package/dist/planner-CNoNH9bo-3g7WX476.mjs.map +0 -1
  149. package/dist/planner-produced-postgres-migration-DtjZyo7p-CQxcHWwC.d.mts.map +0 -1
  150. package/dist/planner-produced-postgres-migration-JI4uclWQ.d.mts +0 -1
  151. package/dist/postgres-contract-view-CRy_3BMc-60fosJRZ.mjs.map +0 -1
  152. package/dist/postgres-database-schema-node-Cv8usVNX-BmvGozi4.d.mts.map +0 -1
  153. package/dist/postgres-migration-CSU_fUlQ-C5TNpgq4.mjs.map +0 -1
  154. package/dist/postgres-role-schema-node-B8Z5i5D--BzOKm4N1.mjs.map +0 -1
  155. package/dist/postgres-schema-Xsjt3RKO-bis-SVSB.d.mts.map +0 -1
  156. package/dist/postgres-schema-osNZNX0D-BpKJDg4M.mjs.map +0 -1
  157. package/dist/postgres-table-schema-node-BBkitBQh-Dll8iaZT.mjs.map +0 -1
  158. package/dist/runtime-DMle_B4T.d.mts.map +0 -1
  159. package/dist/schema-node-kinds-C52Bb1ve-DmxQRPPS.d.mts.map +0 -1
  160. package/dist/types-DNbQLBpx.d.mts +0 -2
@@ -5,22 +5,22 @@ import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cxc0dBbO.mjs
5
5
  import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-DgG3pi5p.mjs";
6
6
  import { G as setFallbackTemporal, c as decodePostgresListText, u as parsePostgresListText } from "./codecs-BtalD4yQ-BVQxal3w.mjs";
7
7
  import { s as fullTextIndexDefinitionOf } from "./full-text-index-definition-MfjtL-x7-ImaTAFMs.mjs";
8
- import { i as PostgresRlsPolicy, n as PostgresRlsEnablement, o as PostgresRole } from "./postgres-schema-osNZNX0D-BpKJDg4M.mjs";
8
+ import { c as PostgresRole, i as PostgresRlsEnablement, o as PostgresRlsPolicy, t as PostgresExtension } from "./postgres-schema-BBWgs4fX-DWdYxNi8.mjs";
9
9
  import { r as computeContentHash } from "./canonicalize-RdxoUHao-FTTkizfe.mjs";
10
- import { c as postgresScalarAndNativeTypeConstructors, l as postgresScalarAuthoringTypes, s as postgresNativeAuthoringTypes, t as POLICY_BLOCK_KEYWORDS } from "./authoring-D7EAP1iG-DlpkOeVt.mjs";
10
+ import { c as postgresScalarAndNativeTypeConstructors, l as postgresScalarAuthoringTypes, s as postgresNativeAuthoringTypes, t as POLICY_BLOCK_KEYWORDS } from "./authoring-BFb5LVsK-CkHmM-aP.mjs";
11
11
  import { t as postgresRenderCheckExpressions } from "./check-expressions-DL9WtMO5-CUcbN2JG.mjs";
12
12
  import { u as postgresNowGeneratorControlDescriptors } from "./date-time-now-generators-CEqbD2GP-B95xid7h.mjs";
13
- import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-DokyxrzY-D2S-BLI0.mjs";
14
- import { a as postgresDiffSubjectGranularity, i as postgresDiffSubjectEntityKind } from "./postgres-table-schema-node-BBkitBQh-Dll8iaZT.mjs";
15
- import { t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--BzOKm4N1.mjs";
16
- import { i as qualifyTableName } from "./planner-sql-checks-CvI80tt0-B5bKCucD.mjs";
17
- import { G as dropCheckConstraintId, Q as schemaObjectsSummary, R as SCHEMA_OBJECTS_SQL, X as schemaBlockingObjects, Z as schemaContentsOf } from "./op-factory-call-DsQATX-o-BHcqPXrs.mjs";
18
- import { r as diffPostgresSchema } from "./diff-database-schema-DrOE5ahI-BfrNtMDu.mjs";
19
- import { t as PostgresContractSerializer } from "./postgres-contract-view-CRy_3BMc-60fosJRZ.mjs";
20
- import { o as postgresContractToSchema } from "./postgres-migration-CSU_fUlQ-C5TNpgq4.mjs";
21
- import { n as keepRowsEdit, t as createPostgresMigrationPlanner } from "./planner-CNoNH9bo-3g7WX476.mjs";
13
+ import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-CszCf4Hs-DVGeuxNv.mjs";
14
+ import { a as postgresDiffSubjectEntityKind, o as postgresDiffSubjectGranularity } from "./postgres-table-schema-node-nY6II-Uv-Bj-lgmSi.mjs";
15
+ import { t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-DuljIQWp-D6Q5JyEs.mjs";
16
+ import { i as qualifyTableName } from "./planner-sql-checks-FU4T7wgu-C-tIJOH-.mjs";
17
+ import { $ as schemaContentsOf, Q as schemaBlockingObjects, et as schemaObjectsSummary, q as dropCheckConstraintId, z as SCHEMA_OBJECTS_SQL } from "./op-factory-call-DyQO1ZdB-CnbOJIf8.mjs";
18
+ import { r as diffPostgresSchema } from "./diff-database-schema-DyoCp8VS-BKtXp-eB.mjs";
19
+ import { t as PostgresContractSerializer } from "./postgres-contract-view-iwNgaXQw-QzVSakJT.mjs";
20
+ import { o as postgresContractToSchema } from "./postgres-migration-BhijSOgq-CP_oflub.mjs";
21
+ import { n as keepRowsEdit, t as createPostgresMigrationPlanner } from "./planner-D1mzh6Cb-B1Z2YTiQ.mjs";
22
22
  import { n as MARKER_LOCK_SQL, t as MARKER_LOCK_KEY } from "./marker-lock-DFc1Tfv5-BkBKBRE3.mjs";
23
- import { _ as typeArgument, a as buildIndexAttribute, c as buildNativeEnumBlock, d as inferPostgresPslContract, f as namedArg, g as positionalArg, h as parseDefaultAttributeString, i as buildFullTextIndexAttribute, n as buildAttribute, o as buildMapAttribute, r as buildCheckAttribute, s as buildModelConstraintAttribute, t as SYNTHETIC_SPAN } from "./infer-psl-contract-Du026CJo-sRmqBsId.mjs";
23
+ import { _ as positionalArg, a as buildFullTextIndexAttribute, c as buildModelConstraintAttribute, f as inferPostgresPslContract, g as parseDefaultAttributeString, i as buildExtensionBlock, l as buildNativeEnumBlock, n as buildAttribute, o as buildIndexAttribute, p as namedArg, r as buildCheckAttribute, s as buildMapAttribute, t as SYNTHETIC_SPAN, v as typeArgument } from "./infer-psl-contract-BP2DgxTx-BqV8gUu4.mjs";
24
24
  import { dataTypeParams, requiredParamKeys, validateCodecTypeParams } from "@prisma/orm-framework/components/codec";
25
25
  import { blindCast } from "@prisma/orm-framework/utils/casts";
26
26
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
@@ -1218,6 +1218,14 @@ function refuseNativeEnumControl(namespaceId, nativeEnum) {
1218
1218
  control: nativeEnum.control
1219
1219
  });
1220
1220
  }
1221
+ function refuseExtensionControl(namespaceId, extension) {
1222
+ if (extension.control === void 0) return;
1223
+ throw unsupported(`extension "${extension.name}" in namespace "${namespaceId}" carries its own control policy "${extension.control}", which cannot be written in Prisma 8 PSL.`, "An `extension` block has no control attribute.", "Drop the policy from the extension, or keep authoring this contract in its current source.", {
1224
+ namespaceId,
1225
+ name: extension.name,
1226
+ control: extension.control
1227
+ });
1228
+ }
1221
1229
  /**
1222
1230
  * Refuses a storage or domain namespace the PSL source would not create again: one holding nothing
1223
1231
  * the printer writes. The PSL source creates the default namespace in both planes, a storage
@@ -1330,9 +1338,10 @@ function refuseRoleOutsideUnbound(namespaceId, name) {
1330
1338
  }
1331
1339
  const FILED_UNDER = {
1332
1340
  rls: "The PSL source files the row-level security setting written as `@@rls` under the name of the table.",
1333
- role: "The PSL source files a role under the name its block is written with."
1341
+ role: "The PSL source files a role under the name its block is written with.",
1342
+ extension: "The PSL source files an extension under the name its block is written with."
1334
1343
  };
1335
- /** Refuses a row-level security setting or role filed under a key the PSL source would not use. */
1344
+ /** Refuses a row-level security setting, role or extension filed under a key the PSL source would not use. */
1336
1345
  function refuseEntryFiledUnderAnotherName(input) {
1337
1346
  if (input.name === input.readsBackAs) return;
1338
1347
  throw unsupported(`namespace "${input.namespaceId}" has a "${input.kind}" entry "${input.name}" that would read back as "${input.readsBackAs}", so it cannot be written in Prisma 8 PSL.`, FILED_UNDER[input.kind], KEEP_SOURCE, {
@@ -1384,14 +1393,15 @@ const PRINTED_ENTRY_KINDS = /* @__PURE__ */ new Set([
1384
1393
  "native_enum",
1385
1394
  "rls",
1386
1395
  "policy",
1387
- "role"
1396
+ "role",
1397
+ "extension"
1388
1398
  ]);
1389
1399
  function refuseUnprintedEntryKinds(namespaceId, entries) {
1390
1400
  for (const [kind, entities] of Object.entries(entries)) {
1391
1401
  if (PRINTED_ENTRY_KINDS.has(kind)) continue;
1392
1402
  const names = Object.keys(entities ?? {});
1393
1403
  if (names.length === 0) continue;
1394
- throw unsupported(`namespace "${namespaceId}" declares ${names.length} "${kind}" ${names.length === 1 ? "entity" : "entities"} (${names.join(", ")}), which the Postgres printer cannot write.`, "The printer writes tables, value sets, value objects, native enums, row-level security settings, policies and roles, and no other entity kind.", KEEP_SOURCE, {
1404
+ throw unsupported(`namespace "${namespaceId}" declares ${names.length} "${kind}" ${names.length === 1 ? "entity" : "entities"} (${names.join(", ")}), which the Postgres printer cannot write.`, "The printer writes tables, value sets, value objects, native enums, row-level security settings, policies, roles and extensions, and no other entity kind.", KEEP_SOURCE, {
1395
1405
  namespaceId,
1396
1406
  kind,
1397
1407
  names
@@ -1680,6 +1690,21 @@ function buildNativeEnumBlocksForNamespace(input) {
1680
1690
  derivedValueSets
1681
1691
  };
1682
1692
  }
1693
+ /** One `extension` block per extension a namespace declares. */
1694
+ function buildExtensionBlocks(namespaceId, entries) {
1695
+ return Object.entries(entries ?? {}).map(([name, entity]) => {
1696
+ invariant(PostgresExtension.is(entity), `"extension" entry "${name}" in namespace "${namespaceId}" is not an extension`);
1697
+ refuseExtensionControl(namespaceId, entity);
1698
+ refuseEntryFiledUnderAnotherName({
1699
+ namespaceId,
1700
+ kind: "extension",
1701
+ name,
1702
+ readsBackAs: entity.name
1703
+ });
1704
+ refuseUnwritableName("extension", entity.name);
1705
+ return buildExtensionBlock(entity.name);
1706
+ });
1707
+ }
1683
1708
  /**
1684
1709
  * The checks the PSL source derives itself for a table, keyed by name, so
1685
1710
  * they are not also written as `@@check`. A table that is not managed derives
@@ -2506,8 +2531,8 @@ function buildModel(all, entry, enums, rlsTables) {
2506
2531
  };
2507
2532
  }
2508
2533
  /**
2509
- * The namespace block of one storage namespace: its models, value objects, enum blocks, roles and
2510
- * policies. `undefined` when the namespace holds none of them.
2534
+ * The namespace block of one storage namespace: its models, value objects, extensions, enum blocks,
2535
+ * roles and policies. `undefined` when the namespace holds none of them.
2511
2536
  */
2512
2537
  function buildNamespace(all, namespaceId, namespace) {
2513
2538
  const { contract, models, variants } = all;
@@ -2537,6 +2562,7 @@ function buildNamespace(all, namespaceId, namespace) {
2537
2562
  const modelNameForTable = (tableName) => models.find((entry) => entry.namespaceId === namespaceId && entry.tableName === tableName && variants.get(entry)?.singleTable !== true)?.name;
2538
2563
  for (const tableName of rlsTables) if (modelNameForTable(tableName) === void 0) refuseRlsWithoutModel(namespaceId, tableName);
2539
2564
  const blocks = [
2565
+ ...buildExtensionBlocks(namespaceId, namespace.entries["extension"]),
2540
2566
  ...enums.blocks,
2541
2567
  ...buildRoleBlocks(namespaceId, namespace.entries["role"]),
2542
2568
  ...buildPolicyBlocks({