@prisma/orm-target-postgres 8.0.0-rc.1-dev.46 → 8.0.0-rc.10

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 (188) hide show
  1. package/README.md +1 -5
  2. package/dist/{adapter-B0xsc80z-sYcF0RVF.mjs → adapter-BO4-D_sb-Dv6OpO1E.mjs} +4 -4
  3. package/dist/{adapter-B0xsc80z-sYcF0RVF.mjs.map → adapter-BO4-D_sb-Dv6OpO1E.mjs.map} +1 -1
  4. package/dist/{adapter-CPesdzv0.d.mts → adapter-BQrsKoUs.d.mts} +2 -2
  5. package/dist/{adapter-CPesdzv0.d.mts.map → adapter-BQrsKoUs.d.mts.map} +1 -1
  6. package/dist/adapter.d.mts +8 -8
  7. package/dist/adapter.mjs +6 -6
  8. package/dist/adapter__adapter.d.mts +1 -1
  9. package/dist/adapter__adapter.mjs +1 -1
  10. package/dist/adapter__column-types.d.mts +2 -2
  11. package/dist/adapter__column-types.mjs +2 -2
  12. package/dist/adapter__control.d.mts +1 -1
  13. package/dist/adapter__control.mjs +78 -12
  14. package/dist/adapter__control.mjs.map +1 -1
  15. package/dist/adapter__runtime.d.mts +1 -1
  16. package/dist/adapter__runtime.mjs +23 -14
  17. package/dist/adapter__runtime.mjs.map +1 -1
  18. package/dist/adapter__sql-renderer.d.mts +1 -1
  19. package/dist/adapter__sql-renderer.mjs +1 -1
  20. package/dist/adapter__types.d.mts +2 -2
  21. package/dist/{aggregates-Dh6HPdvC.mjs → aggregates-Ckjhz1o7.mjs} +15 -10
  22. package/dist/aggregates-Ckjhz1o7.mjs.map +1 -0
  23. package/dist/{authoring-BOpdZa2N-ClrLFiXw.mjs → authoring-Dm1jBKhq-i8FD48I-.mjs} +84 -48
  24. package/dist/authoring-Dm1jBKhq-i8FD48I-.mjs.map +1 -0
  25. package/dist/{check-expressions-DRgG8RN5-DiA-22aC.d.mts → check-expressions-D4R7JhiZ-q-dFPGT2.d.mts} +7 -9
  26. package/dist/check-expressions-D4R7JhiZ-q-dFPGT2.d.mts.map +1 -0
  27. package/dist/{check-expressions-5vhxWaFy-CBcjFeur.mjs → check-expressions-DFTeR0rd-CSxSpyMV.mjs} +14 -11
  28. package/dist/check-expressions-DFTeR0rd-CSxSpyMV.mjs.map +1 -0
  29. package/dist/codec-ids-CmcC76hX-C0JIyoua.d.mts +39 -0
  30. package/dist/codec-ids-CmcC76hX-C0JIyoua.d.mts.map +1 -0
  31. package/dist/codec-ids-D3ZEAmt2-DjoKUAas.mjs +39 -0
  32. package/dist/codec-ids-D3ZEAmt2-DjoKUAas.mjs.map +1 -0
  33. package/dist/codec-ids-cWPqrkcF.d.mts +1 -0
  34. package/dist/{codec-types-BRU4F-7t-BaJbKF_i.d.mts → codec-types-X0ENu4sQ-C6GS_WDR.d.mts} +21 -9
  35. package/dist/codec-types-X0ENu4sQ-C6GS_WDR.d.mts.map +1 -0
  36. package/dist/codec-types-Zel4Dk7S.d.mts +2 -0
  37. package/dist/{codecs-BmPCJWqb-DveZGJvm.mjs → codecs-CxWg7WrX-DtVAuuXA.mjs} +351 -255
  38. package/dist/codecs-CxWg7WrX-DtVAuuXA.mjs.map +1 -0
  39. package/dist/{codecs-B1HgsJZ2.mjs → codecs-DZMfLjGe.mjs} +2 -2
  40. package/dist/codecs-DZMfLjGe.mjs.map +1 -0
  41. package/dist/{codecs-D8tLswBi-_nbo-Z8x.d.mts → codecs-bwX5JaME-ByuPNLC5.d.mts} +146 -86
  42. package/dist/codecs-bwX5JaME-ByuPNLC5.d.mts.map +1 -0
  43. package/dist/{codecs-DmCKO7dg.d.mts → codecs-ePpDWH7z.d.mts} +2 -2
  44. package/dist/codecs-ePpDWH7z.d.mts.map +1 -0
  45. package/dist/{column-types-BH-MU6uU.d.mts → column-types-CwjYfNCi.d.mts} +33 -7
  46. package/dist/column-types-CwjYfNCi.d.mts.map +1 -0
  47. package/dist/{column-types-Bh92dNjD.mjs → column-types-DU7C_gwa.mjs} +37 -9
  48. package/dist/column-types-DU7C_gwa.mjs.map +1 -0
  49. package/dist/{contract-free-aQ4nT-_R.mjs → contract-free-CzTZEwpt.mjs} +5 -5
  50. package/dist/contract-free-CzTZEwpt.mjs.map +1 -0
  51. package/dist/{control-Drq2rquV.mjs → control-BF220oqr.mjs} +82 -24
  52. package/dist/control-BF220oqr.mjs.map +1 -0
  53. package/dist/{control-2F195jJk.d.mts → control-ByalKcpe.d.mts} +2 -1
  54. package/dist/control-ByalKcpe.d.mts.map +1 -0
  55. package/dist/{control-Y6FxMu3o.mjs → control-DzK5mSLo.mjs} +3 -3
  56. package/dist/control-DzK5mSLo.mjs.map +1 -0
  57. package/dist/{control-adapter-DFr4gS-r-DM3KcZdQ.mjs → control-adapter-BM70RkWS-kIC873DD.mjs} +21 -10
  58. package/dist/control-adapter-BM70RkWS-kIC873DD.mjs.map +1 -0
  59. package/dist/{control-policy-B53lnBCT-B9K9Cj1x.mjs → control-policy-BN8Ouun3-BtGYeb4f.mjs} +7 -7
  60. package/dist/control-policy-BN8Ouun3-BtGYeb4f.mjs.map +1 -0
  61. package/dist/{control-DLTOAEHj.d.mts → control-xdW1bgaP.d.mts} +3 -3
  62. package/dist/{control-DLTOAEHj.d.mts.map → control-xdW1bgaP.d.mts.map} +1 -1
  63. package/dist/{ddl-CNQJds-C-WfZ3y4y8.mjs → ddl-GXbCrKp_-CBKFkq1r.mjs} +4 -4
  64. package/dist/{ddl-CNQJds-C-WfZ3y4y8.mjs.map → ddl-GXbCrKp_-CBKFkq1r.mjs.map} +1 -1
  65. package/dist/{descriptor-meta-rilAH3ep-dAmiVLpe.mjs → descriptor-meta-D41CePyY-B0L9RIgT.mjs} +7 -6
  66. package/dist/descriptor-meta-D41CePyY-B0L9RIgT.mjs.map +1 -0
  67. package/dist/{descriptor-meta-KVX21fsl-DBDoB4eg.mjs → descriptor-meta-zQNj82MZ-CDwEiYdj.mjs} +50 -21
  68. package/dist/descriptor-meta-zQNj82MZ-CDwEiYdj.mjs.map +1 -0
  69. package/dist/{diff-database-schema-DKq76rCk-uehceHYz.mjs → diff-database-schema-C9UxdmYu-BzQjQb1e.mjs} +6 -6
  70. package/dist/{diff-database-schema-DKq76rCk-uehceHYz.mjs.map → diff-database-schema-C9UxdmYu-BzQjQb1e.mjs.map} +1 -1
  71. package/dist/driver.d.mts +2 -2
  72. package/dist/driver.mjs +3 -2
  73. package/dist/driver__control.mjs +1 -1
  74. package/dist/driver__runtime.d.mts +2 -2
  75. package/dist/driver__runtime.mjs +2 -639
  76. package/dist/{errors-CU4xIwwk.d.mts → errors-5fMq0U66.d.mts} +2 -2
  77. package/dist/{errors-CU4xIwwk.d.mts.map → errors-5fMq0U66.d.mts.map} +1 -1
  78. package/dist/errors-DYyzTYzE-39CV_aMo.mjs +92 -0
  79. package/dist/errors-DYyzTYzE-39CV_aMo.mjs.map +1 -0
  80. package/dist/instant-now-generator-lJQqn_8K-JOzseqXI.d.mts +9 -0
  81. package/dist/instant-now-generator-lJQqn_8K-JOzseqXI.d.mts.map +1 -0
  82. package/dist/migration-PTHAY9Cv.mjs.map +1 -1
  83. package/dist/{op-factory-call-H6zeDGLe-_1pAftJk.mjs → op-factory-call-CSkQdszU-C43tr0rP.mjs} +7 -7
  84. package/dist/{op-factory-call-H6zeDGLe-_1pAftJk.mjs.map → op-factory-call-CSkQdszU-C43tr0rP.mjs.map} +1 -1
  85. package/dist/{pack-CySS3DQU.d.mts → pack-BByvVlUw.d.mts} +177 -13
  86. package/dist/pack-BByvVlUw.d.mts.map +1 -0
  87. package/dist/{planner-D0uogzvT-1WyGIC5p.mjs → planner-DtwSy6w3--x0IvtI9.mjs} +8 -8
  88. package/dist/{planner-D0uogzvT-1WyGIC5p.mjs.map → planner-DtwSy6w3--x0IvtI9.mjs.map} +1 -1
  89. package/dist/{planner-ddl-builders-Chxh-LEQ-DXvwOeeA.mjs → planner-ddl-builders-CsfmnnKR-CNn0fLyx.mjs} +5 -5
  90. package/dist/{planner-ddl-builders-Chxh-LEQ-DXvwOeeA.mjs.map → planner-ddl-builders-CsfmnnKR-CNn0fLyx.mjs.map} +1 -1
  91. package/dist/{planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs → planner-produced-postgres-migration-BResV739-meZQaWcU.mjs} +4 -4
  92. package/dist/{planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs.map → planner-produced-postgres-migration-BResV739-meZQaWcU.mjs.map} +1 -1
  93. package/dist/{planner-sql-checks-ftgzvIO9-BTtBg2Vz.mjs → planner-sql-checks-Bcngv5YZ-Dnp05hSM.mjs} +4 -4
  94. package/dist/{planner-sql-checks-ftgzvIO9-BTtBg2Vz.mjs.map → planner-sql-checks-Bcngv5YZ-Dnp05hSM.mjs.map} +1 -1
  95. package/dist/{postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs → postgres-contract-view-dWcpuV6T-CJPsHGox.mjs} +5 -5
  96. package/dist/{postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs.map → postgres-contract-view-dWcpuV6T-CJPsHGox.mjs.map} +1 -1
  97. package/dist/{postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs → postgres-migration-DRKw86P7-C1eWF86n.mjs} +6 -6
  98. package/dist/{postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs.map → postgres-migration-DRKw86P7-C1eWF86n.mjs.map} +1 -1
  99. package/dist/{postgres-schema-CF0yHESb-D7n2X21R.mjs → postgres-schema-B3t7Zr52-CMlY9aGw.mjs} +4 -4
  100. package/dist/{postgres-schema-CF0yHESb-D7n2X21R.mjs.map → postgres-schema-B3t7Zr52-CMlY9aGw.mjs.map} +1 -1
  101. package/dist/{render-ops-DOsRP0Po-BKn_c_Ia.mjs → render-ops-D2vJApKB-B281fzmn.mjs} +3 -3
  102. package/dist/{render-ops-DOsRP0Po-BKn_c_Ia.mjs.map → render-ops-D2vJApKB-B281fzmn.mjs.map} +1 -1
  103. package/dist/{resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs → resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs} +3 -3
  104. package/dist/{resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs.map → resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs.map} +1 -1
  105. package/dist/{runtime-DOXznQe0.d.mts → runtime-BdRKoWQu.d.mts} +2 -2
  106. package/dist/{runtime-DOXznQe0.d.mts.map → runtime-BdRKoWQu.d.mts.map} +1 -1
  107. package/dist/runtime-Di_BFzUC.mjs +685 -0
  108. package/dist/runtime-Di_BFzUC.mjs.map +1 -0
  109. package/dist/{runtime-lHBKgjB9.d.mts → runtime-DtoNQntj.d.mts} +3 -2
  110. package/dist/runtime-DtoNQntj.d.mts.map +1 -0
  111. package/dist/{runtime-_TfO66h5.d.mts → runtime-bbCw9Omq.d.mts} +2 -1
  112. package/dist/runtime-bbCw9Omq.d.mts.map +1 -0
  113. package/dist/{sql-renderer-BgC0ZgLS.d.mts → sql-renderer-Cshx9dNa.d.mts} +2 -2
  114. package/dist/{sql-renderer-BgC0ZgLS.d.mts.map → sql-renderer-Cshx9dNa.d.mts.map} +1 -1
  115. package/dist/{sql-renderer-ComgusFq-BBlqM1fw.mjs → sql-renderer-DMMtw8lD-K9zLsg-g.mjs} +8 -75
  116. package/dist/sql-renderer-DMMtw8lD-K9zLsg-g.mjs.map +1 -0
  117. package/dist/{sql-utils-DuzN3JZg-DiXy4Vah.mjs → sql-utils-6j9YTLpr-BCyCBPBg.mjs} +3 -3
  118. package/dist/{sql-utils-DuzN3JZg-DiXy4Vah.mjs.map → sql-utils-6j9YTLpr-BCyCBPBg.mjs.map} +1 -1
  119. package/dist/target.d.mts +14 -13
  120. package/dist/target.mjs +24 -23
  121. package/dist/target__aggregates.mjs +1 -1
  122. package/dist/target__codec-ids.d.mts +3 -3
  123. package/dist/target__codec-ids.mjs +2 -2
  124. package/dist/target__codec-types.d.mts +4 -4
  125. package/dist/target__codecs.d.mts +3 -3
  126. package/dist/target__codecs.mjs +3 -3
  127. package/dist/target__contract-free.mjs +3 -3
  128. package/dist/target__control.d.mts +3 -2
  129. package/dist/target__control.mjs +3 -2
  130. package/dist/target__diff-database-schema.mjs +1 -1
  131. package/dist/target__errors.d.mts +1 -1
  132. package/dist/target__errors.mjs +1 -1
  133. package/dist/target__issue-planner.mjs +1 -1
  134. package/dist/target__migration.mjs +2 -2
  135. package/dist/target__op-factory-call.mjs +1 -1
  136. package/dist/target__pack.d.mts +1 -1
  137. package/dist/target__pack.mjs +1 -1
  138. package/dist/target__planner-ddl-builders.mjs +1 -1
  139. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  140. package/dist/target__planner-sql-checks.mjs +1 -1
  141. package/dist/target__planner.mjs +2 -2
  142. package/dist/target__render-ops.mjs +1 -1
  143. package/dist/target__runtime.d.mts +3 -2
  144. package/dist/target__runtime.mjs +3 -2
  145. package/dist/target__runtime.mjs.map +1 -1
  146. package/dist/target__schema-ir-annotations.mjs +1 -1
  147. package/dist/target__sql-utils.mjs +1 -1
  148. package/dist/target__types.d.mts +2 -2
  149. package/dist/target__types.mjs +2 -2
  150. package/dist/{types-CjGjPLr5.d.mts → types-B4IkFolc.d.mts} +2 -2
  151. package/dist/{types-CjGjPLr5.d.mts.map → types-B4IkFolc.d.mts.map} +1 -1
  152. package/dist/types-C7BEZmFD.d.mts +1 -0
  153. package/dist/{types-CkryN1AS-BcQRGsDn.d.mts → types-CkryN1AS-CZtzRJFZ.d.mts} +2 -2
  154. package/dist/{types-CkryN1AS-BcQRGsDn.d.mts.map → types-CkryN1AS-CZtzRJFZ.d.mts.map} +1 -1
  155. package/package.json +13 -12
  156. package/dist/aggregates-Dh6HPdvC.mjs.map +0 -1
  157. package/dist/authoring-BOpdZa2N-ClrLFiXw.mjs.map +0 -1
  158. package/dist/check-expressions-5vhxWaFy-CBcjFeur.mjs.map +0 -1
  159. package/dist/check-expressions-DRgG8RN5-DiA-22aC.d.mts.map +0 -1
  160. package/dist/codec-ids-Bqu_IwO0-DKOdPizQ.d.mts +0 -35
  161. package/dist/codec-ids-Bqu_IwO0-DKOdPizQ.d.mts.map +0 -1
  162. package/dist/codec-ids-C5Rkltkw-DMf87l9s.mjs +0 -35
  163. package/dist/codec-ids-C5Rkltkw-DMf87l9s.mjs.map +0 -1
  164. package/dist/codec-ids-DJ6j6pZc.d.mts +0 -1
  165. package/dist/codec-types-BRU4F-7t-BaJbKF_i.d.mts.map +0 -1
  166. package/dist/codec-types-bX63JRLf.d.mts +0 -2
  167. package/dist/codecs-B1HgsJZ2.mjs.map +0 -1
  168. package/dist/codecs-BmPCJWqb-DveZGJvm.mjs.map +0 -1
  169. package/dist/codecs-D8tLswBi-_nbo-Z8x.d.mts.map +0 -1
  170. package/dist/codecs-DmCKO7dg.d.mts.map +0 -1
  171. package/dist/column-types-BH-MU6uU.d.mts.map +0 -1
  172. package/dist/column-types-Bh92dNjD.mjs.map +0 -1
  173. package/dist/contract-free-aQ4nT-_R.mjs.map +0 -1
  174. package/dist/control-2F195jJk.d.mts.map +0 -1
  175. package/dist/control-Drq2rquV.mjs.map +0 -1
  176. package/dist/control-Y6FxMu3o.mjs.map +0 -1
  177. package/dist/control-adapter-DFr4gS-r-DM3KcZdQ.mjs.map +0 -1
  178. package/dist/control-policy-B53lnBCT-B9K9Cj1x.mjs.map +0 -1
  179. package/dist/descriptor-meta-KVX21fsl-DBDoB4eg.mjs.map +0 -1
  180. package/dist/descriptor-meta-rilAH3ep-dAmiVLpe.mjs.map +0 -1
  181. package/dist/driver__runtime.mjs.map +0 -1
  182. package/dist/errors-DKjQzNaN-DFcF1thx.mjs +0 -39
  183. package/dist/errors-DKjQzNaN-DFcF1thx.mjs.map +0 -1
  184. package/dist/pack-CySS3DQU.d.mts.map +0 -1
  185. package/dist/runtime-_TfO66h5.d.mts.map +0 -1
  186. package/dist/runtime-lHBKgjB9.d.mts.map +0 -1
  187. package/dist/sql-renderer-ComgusFq-BBlqM1fw.mjs.map +0 -1
  188. package/dist/types-B-4d5_4a.d.mts +0 -1
@@ -1,7 +1,7 @@
1
- import { t as PostgresMigration } from "./postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs";
2
- import { t as renderOps } from "./render-ops-DOsRP0Po-BKn_c_Ia.mjs";
1
+ import { t as PostgresMigration } from "./postgres-migration-DRKw86P7-C1eWF86n.mjs";
2
+ import { t as renderOps } from "./render-ops-D2vJApKB-B281fzmn.mjs";
3
3
  import { t as renderCallsToTypeScript } from "./render-typescript-Dqp1Spgn-B128r1qw.mjs";
4
- //#region ../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-D5m8nK6s.mjs
4
+ //#region ../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-BResV739.mjs
5
5
  var TypeScriptRenderablePostgresMigration = class extends PostgresMigration {
6
6
  #calls;
7
7
  #meta;
@@ -44,4 +44,4 @@ var TypeScriptRenderablePostgresMigration = class extends PostgresMigration {
44
44
  //#endregion
45
45
  export { TypeScriptRenderablePostgresMigration as t };
46
46
 
47
- //# sourceMappingURL=planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs.map
47
+ //# sourceMappingURL=planner-produced-postgres-migration-BResV739-meZQaWcU.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs","names":["#calls","#meta","#spaceId","#snapshotsImportPath","#lowerer","#operationsCache"],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-D5m8nK6s.mjs"],"sourcesContent":["import { t as PostgresMigration } from \"./postgres-migration-Dbq3RGfZ.mjs\";\nimport { t as renderOps } from \"./render-ops-DOsRP0Po.mjs\";\nimport { t as renderCallsToTypeScript } from \"./render-typescript-Dqp1Spgn.mjs\";\n//#region src/core/migrations/planner-produced-postgres-migration.ts\nvar TypeScriptRenderablePostgresMigration = class extends PostgresMigration {\n\t#calls;\n\t#meta;\n\t#spaceId;\n\t#snapshotsImportPath;\n\t#lowerer;\n\t#operationsCache;\n\tconstructor(calls, meta, spaceId, snapshotsImportPath, lowerer) {\n\t\tsuper();\n\t\tthis.#calls = calls;\n\t\tthis.#meta = meta;\n\t\tthis.#spaceId = spaceId;\n\t\tthis.#snapshotsImportPath = snapshotsImportPath;\n\t\tthis.#lowerer = lowerer;\n\t}\n\tget operations() {\n\t\tthis.#operationsCache ??= renderOps(this.#calls, this.#lowerer);\n\t\treturn this.#operationsCache;\n\t}\n\tdescribe() {\n\t\treturn this.#meta;\n\t}\n\t/**\n\t* Contract space this planner-produced plan applies to. Threaded\n\t* from the planner options so the runner keys the marker row by\n\t* the right space when executing the plan.\n\t*/\n\tget spaceId() {\n\t\treturn this.#spaceId;\n\t}\n\trenderTypeScript(resolveImportSpecifier) {\n\t\treturn renderCallsToTypeScript(this.#calls, {\n\t\t\tfrom: this.#meta.from,\n\t\t\tto: this.#meta.to,\n\t\t\tsnapshotsImportPath: this.#snapshotsImportPath,\n\t\t\tresolveImportSpecifier\n\t\t});\n\t}\n};\n//#endregion\nexport { TypeScriptRenderablePostgresMigration as t };\n\n//# sourceMappingURL=planner-produced-postgres-migration-D5m8nK6s.mjs.map"],"mappings":";;;;AAIA,IAAI,wCAAwC,cAAc,kBAAkB;CAC3E;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,OAAO,MAAM,SAAS,qBAAqB,SAAS;EAC/D,MAAM;EACN,KAAKA,SAAS;EACd,KAAKC,QAAQ;EACb,KAAKC,WAAW;EAChB,KAAKC,uBAAuB;EAC5B,KAAKC,WAAW;CACjB;CACA,IAAI,aAAa;EAChB,KAAKC,qBAAqB,UAAU,KAAKL,QAAQ,KAAKI,QAAQ;EAC9D,OAAO,KAAKC;CACb;CACA,WAAW;EACV,OAAO,KAAKJ;CACb;;;;;;CAMA,IAAI,UAAU;EACb,OAAO,KAAKC;CACb;CACA,iBAAiB,wBAAwB;EACxC,OAAO,wBAAwB,KAAKF,QAAQ;GAC3C,MAAM,KAAKC,MAAM;GACjB,IAAI,KAAKA,MAAM;GACf,qBAAqB,KAAKE;GAC1B;EACD,CAAC;CACF;AACD"}
1
+ {"version":3,"file":"planner-produced-postgres-migration-BResV739-meZQaWcU.mjs","names":["#calls","#meta","#spaceId","#snapshotsImportPath","#lowerer","#operationsCache"],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-BResV739.mjs"],"sourcesContent":["import { t as PostgresMigration } from \"./postgres-migration-DRKw86P7.mjs\";\nimport { t as renderOps } from \"./render-ops-D2vJApKB.mjs\";\nimport { t as renderCallsToTypeScript } from \"./render-typescript-Dqp1Spgn.mjs\";\n//#region src/core/migrations/planner-produced-postgres-migration.ts\nvar TypeScriptRenderablePostgresMigration = class extends PostgresMigration {\n\t#calls;\n\t#meta;\n\t#spaceId;\n\t#snapshotsImportPath;\n\t#lowerer;\n\t#operationsCache;\n\tconstructor(calls, meta, spaceId, snapshotsImportPath, lowerer) {\n\t\tsuper();\n\t\tthis.#calls = calls;\n\t\tthis.#meta = meta;\n\t\tthis.#spaceId = spaceId;\n\t\tthis.#snapshotsImportPath = snapshotsImportPath;\n\t\tthis.#lowerer = lowerer;\n\t}\n\tget operations() {\n\t\tthis.#operationsCache ??= renderOps(this.#calls, this.#lowerer);\n\t\treturn this.#operationsCache;\n\t}\n\tdescribe() {\n\t\treturn this.#meta;\n\t}\n\t/**\n\t* Contract space this planner-produced plan applies to. Threaded\n\t* from the planner options so the runner keys the marker row by\n\t* the right space when executing the plan.\n\t*/\n\tget spaceId() {\n\t\treturn this.#spaceId;\n\t}\n\trenderTypeScript(resolveImportSpecifier) {\n\t\treturn renderCallsToTypeScript(this.#calls, {\n\t\t\tfrom: this.#meta.from,\n\t\t\tto: this.#meta.to,\n\t\t\tsnapshotsImportPath: this.#snapshotsImportPath,\n\t\t\tresolveImportSpecifier\n\t\t});\n\t}\n};\n//#endregion\nexport { TypeScriptRenderablePostgresMigration as t };\n\n//# sourceMappingURL=planner-produced-postgres-migration-BResV739.mjs.map"],"mappings":";;;;AAIA,IAAI,wCAAwC,cAAc,kBAAkB;CAC3E;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,OAAO,MAAM,SAAS,qBAAqB,SAAS;EAC/D,MAAM;EACN,KAAKA,SAAS;EACd,KAAKC,QAAQ;EACb,KAAKC,WAAW;EAChB,KAAKC,uBAAuB;EAC5B,KAAKC,WAAW;CACjB;CACA,IAAI,aAAa;EAChB,KAAKC,qBAAqB,UAAU,KAAKL,QAAQ,KAAKI,QAAQ;EAC9D,OAAO,KAAKC;CACb;CACA,WAAW;EACV,OAAO,KAAKJ;CACb;;;;;;CAMA,IAAI,UAAU;EACb,OAAO,KAAKC;CACb;CACA,iBAAiB,wBAAwB;EACxC,OAAO,wBAAwB,KAAKF,QAAQ;GAC3C,MAAM,KAAKC,MAAM;GACjB,IAAI,KAAKA,MAAM;GACf,qBAAqB,KAAKE;GAC1B;EACD,CAAC;CACF;AACD"}
@@ -1,7 +1,7 @@
1
- import { r as quoteIdentifier } from "./sql-utils-DuzN3JZg-DiXy4Vah.mjs";
2
- import { h as postgresCreateNamespace } from "./postgres-schema-CF0yHESb-D7n2X21R.mjs";
1
+ import { r as quoteIdentifier } from "./sql-utils-6j9YTLpr-BCyCBPBg.mjs";
2
+ import { h as postgresCreateNamespace } from "./postgres-schema-B3t7Zr52-CMlY9aGw.mjs";
3
3
  import { t as resolveColumnTypeMetadata } from "./planner-type-resolution-Bt2f_q-F-C4T6YTae.mjs";
4
- //#region ../../../3-targets/3-targets/postgres/dist/planner-sql-checks-ftgzvIO9.mjs
4
+ //#region ../../../3-targets/3-targets/postgres/dist/planner-sql-checks-Bcngv5YZ.mjs
5
5
  /**
6
6
  * String-keyed entry points the migration ops use to render
7
7
  * schema-qualified DDL and catalog checks. The `schema` argument is
@@ -149,4 +149,4 @@ function buildExpectedFormatType(column, codecHooks, storageTypes = {}) {
149
149
  //#endregion
150
150
  export { qualifyTableName as n, buildExpectedFormatType as t };
151
151
 
152
- //# sourceMappingURL=planner-sql-checks-ftgzvIO9-BTtBg2Vz.mjs.map
152
+ //# sourceMappingURL=planner-sql-checks-Bcngv5YZ-Dnp05hSM.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"planner-sql-checks-ftgzvIO9-BTtBg2Vz.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-sql-checks-ftgzvIO9.mjs"],"sourcesContent":["import { i as postgresCreateNamespace } from \"./postgres-schema-CF0yHESb.mjs\";\nimport { r as quoteIdentifier } from \"./sql-utils-DuzN3JZg.mjs\";\nimport { t as resolveColumnTypeMetadata } from \"./planner-type-resolution-Bt2f_q-F.mjs\";\n//#region src/core/migrations/planner-sql-checks.ts\n/**\n* String-keyed entry points the migration ops use to render\n* schema-qualified DDL and catalog checks. The `schema` argument is\n* interpreted as a namespace coordinate: the framework `__unbound__`\n* sentinel resolves to the late-bound `PostgresUnboundSchema` singleton\n* (which elides the qualifier so `search_path` decides at runtime); any\n* other id materialises a `PostgresSchema(id)` whose qualifier is the\n* named schema. Helpers route through these `Namespace` concretions so\n* the unbound branch lives in the polymorphic override, not the call\n* site.\n*/\nfunction qualifyTableName(schema, table) {\n\treturn postgresCreateNamespace({\n\t\tid: schema,\n\t\tentries: { table: {} }\n\t}).qualifyTable(table);\n}\nconst FORMAT_TYPE_DISPLAY = /* @__PURE__ */ new Map([\n\t[\"int2\", \"smallint\"],\n\t[\"int4\", \"integer\"],\n\t[\"int8\", \"bigint\"],\n\t[\"float4\", \"real\"],\n\t[\"float8\", \"double precision\"],\n\t[\"bool\", \"boolean\"],\n\t[\"timestamp\", \"timestamp without time zone\"],\n\t[\"timestamptz\", \"timestamp with time zone\"],\n\t[\"time\", \"time without time zone\"],\n\t[\"timetz\", \"time with time zone\"]\n]);\nconst UNQUOTED_POSTGRES_IDENTIFIER_PATTERN = /^[a-z_][a-z0-9_$]*$/;\nconst POSTGRES_RESERVED_IDENTIFIER_WORDS = /* @__PURE__ */ new Set([\n\t\"all\",\n\t\"analyse\",\n\t\"analyze\",\n\t\"and\",\n\t\"any\",\n\t\"array\",\n\t\"as\",\n\t\"asc\",\n\t\"asymmetric\",\n\t\"authorization\",\n\t\"between\",\n\t\"binary\",\n\t\"both\",\n\t\"case\",\n\t\"cast\",\n\t\"check\",\n\t\"collate\",\n\t\"column\",\n\t\"constraint\",\n\t\"create\",\n\t\"current_catalog\",\n\t\"current_date\",\n\t\"current_role\",\n\t\"current_time\",\n\t\"current_timestamp\",\n\t\"current_user\",\n\t\"default\",\n\t\"deferrable\",\n\t\"desc\",\n\t\"distinct\",\n\t\"do\",\n\t\"else\",\n\t\"end\",\n\t\"except\",\n\t\"false\",\n\t\"fetch\",\n\t\"for\",\n\t\"foreign\",\n\t\"freeze\",\n\t\"from\",\n\t\"full\",\n\t\"grant\",\n\t\"group\",\n\t\"having\",\n\t\"ilike\",\n\t\"in\",\n\t\"initially\",\n\t\"inner\",\n\t\"intersect\",\n\t\"into\",\n\t\"is\",\n\t\"isnull\",\n\t\"join\",\n\t\"lateral\",\n\t\"leading\",\n\t\"left\",\n\t\"like\",\n\t\"limit\",\n\t\"localtime\",\n\t\"localtimestamp\",\n\t\"natural\",\n\t\"not\",\n\t\"notnull\",\n\t\"null\",\n\t\"offset\",\n\t\"on\",\n\t\"only\",\n\t\"or\",\n\t\"order\",\n\t\"outer\",\n\t\"overlaps\",\n\t\"placing\",\n\t\"primary\",\n\t\"references\",\n\t\"right\",\n\t\"select\",\n\t\"session_user\",\n\t\"similar\",\n\t\"some\",\n\t\"symmetric\",\n\t\"table\",\n\t\"then\",\n\t\"to\",\n\t\"trailing\",\n\t\"true\",\n\t\"union\",\n\t\"unique\",\n\t\"user\",\n\t\"using\",\n\t\"variadic\",\n\t\"verbose\",\n\t\"when\",\n\t\"where\",\n\t\"window\",\n\t\"with\"\n]);\nfunction formatUserDefinedTypeName(identifier) {\n\tif (UNQUOTED_POSTGRES_IDENTIFIER_PATTERN.test(identifier) && !POSTGRES_RESERVED_IDENTIFIER_WORDS.has(identifier)) return identifier;\n\treturn quoteIdentifier(identifier);\n}\nfunction buildExpectedFormatType(column, codecHooks, storageTypes = {}) {\n\tconst resolved = resolveColumnTypeMetadata(column, storageTypes);\n\tif (resolved.typeParams && resolved.codecId) {\n\t\tconst hooks = codecHooks.get(resolved.codecId);\n\t\tif (hooks?.expandNativeType) return hooks.expandNativeType({\n\t\t\tnativeType: resolved.nativeType,\n\t\t\tcodecId: resolved.codecId,\n\t\t\ttypeParams: resolved.typeParams\n\t\t});\n\t}\n\tif (column.typeRef) return formatUserDefinedTypeName(resolved.nativeType);\n\treturn FORMAT_TYPE_DISPLAY.get(resolved.nativeType) ?? resolved.nativeType;\n}\n//#endregion\nexport { qualifyTableName as n, buildExpectedFormatType as t };\n\n//# sourceMappingURL=planner-sql-checks-ftgzvIO9.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,iBAAiB,QAAQ,OAAO;CACxC,OAAO,wBAAwB;EAC9B,IAAI;EACJ,SAAS,EAAE,OAAO,CAAC,EAAE;CACtB,CAAC,CAAC,CAAC,aAAa,KAAK;AACtB;AACA,MAAM,sCAAsC,IAAI,IAAI;CACnD,CAAC,QAAQ,UAAU;CACnB,CAAC,QAAQ,SAAS;CAClB,CAAC,QAAQ,QAAQ;CACjB,CAAC,UAAU,MAAM;CACjB,CAAC,UAAU,kBAAkB;CAC7B,CAAC,QAAQ,SAAS;CAClB,CAAC,aAAa,6BAA6B;CAC3C,CAAC,eAAe,0BAA0B;CAC1C,CAAC,QAAQ,wBAAwB;CACjC,CAAC,UAAU,qBAAqB;AACjC,CAAC;AACD,MAAM,uCAAuC;AAC7C,MAAM,qDAAqD,IAAI,IAAI;CAClE;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;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;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;AACD,CAAC;AACD,SAAS,0BAA0B,YAAY;CAC9C,IAAI,qCAAqC,KAAK,UAAU,KAAK,CAAC,mCAAmC,IAAI,UAAU,GAAG,OAAO;CACzH,OAAO,gBAAgB,UAAU;AAClC;AACA,SAAS,wBAAwB,QAAQ,YAAY,eAAe,CAAC,GAAG;CACvE,MAAM,WAAW,0BAA0B,QAAQ,YAAY;CAC/D,IAAI,SAAS,cAAc,SAAS,SAAS;EAC5C,MAAM,QAAQ,WAAW,IAAI,SAAS,OAAO;EAC7C,IAAI,OAAO,kBAAkB,OAAO,MAAM,iBAAiB;GAC1D,YAAY,SAAS;GACrB,SAAS,SAAS;GAClB,YAAY,SAAS;EACtB,CAAC;CACF;CACA,IAAI,OAAO,SAAS,OAAO,0BAA0B,SAAS,UAAU;CACxE,OAAO,oBAAoB,IAAI,SAAS,UAAU,KAAK,SAAS;AACjE"}
1
+ {"version":3,"file":"planner-sql-checks-Bcngv5YZ-Dnp05hSM.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-sql-checks-Bcngv5YZ.mjs"],"sourcesContent":["import { i as postgresCreateNamespace } from \"./postgres-schema-B3t7Zr52.mjs\";\nimport { r as quoteIdentifier } from \"./sql-utils-6j9YTLpr.mjs\";\nimport { t as resolveColumnTypeMetadata } from \"./planner-type-resolution-Bt2f_q-F.mjs\";\n//#region src/core/migrations/planner-sql-checks.ts\n/**\n* String-keyed entry points the migration ops use to render\n* schema-qualified DDL and catalog checks. The `schema` argument is\n* interpreted as a namespace coordinate: the framework `__unbound__`\n* sentinel resolves to the late-bound `PostgresUnboundSchema` singleton\n* (which elides the qualifier so `search_path` decides at runtime); any\n* other id materialises a `PostgresSchema(id)` whose qualifier is the\n* named schema. Helpers route through these `Namespace` concretions so\n* the unbound branch lives in the polymorphic override, not the call\n* site.\n*/\nfunction qualifyTableName(schema, table) {\n\treturn postgresCreateNamespace({\n\t\tid: schema,\n\t\tentries: { table: {} }\n\t}).qualifyTable(table);\n}\nconst FORMAT_TYPE_DISPLAY = /* @__PURE__ */ new Map([\n\t[\"int2\", \"smallint\"],\n\t[\"int4\", \"integer\"],\n\t[\"int8\", \"bigint\"],\n\t[\"float4\", \"real\"],\n\t[\"float8\", \"double precision\"],\n\t[\"bool\", \"boolean\"],\n\t[\"timestamp\", \"timestamp without time zone\"],\n\t[\"timestamptz\", \"timestamp with time zone\"],\n\t[\"time\", \"time without time zone\"],\n\t[\"timetz\", \"time with time zone\"]\n]);\nconst UNQUOTED_POSTGRES_IDENTIFIER_PATTERN = /^[a-z_][a-z0-9_$]*$/;\nconst POSTGRES_RESERVED_IDENTIFIER_WORDS = /* @__PURE__ */ new Set([\n\t\"all\",\n\t\"analyse\",\n\t\"analyze\",\n\t\"and\",\n\t\"any\",\n\t\"array\",\n\t\"as\",\n\t\"asc\",\n\t\"asymmetric\",\n\t\"authorization\",\n\t\"between\",\n\t\"binary\",\n\t\"both\",\n\t\"case\",\n\t\"cast\",\n\t\"check\",\n\t\"collate\",\n\t\"column\",\n\t\"constraint\",\n\t\"create\",\n\t\"current_catalog\",\n\t\"current_date\",\n\t\"current_role\",\n\t\"current_time\",\n\t\"current_timestamp\",\n\t\"current_user\",\n\t\"default\",\n\t\"deferrable\",\n\t\"desc\",\n\t\"distinct\",\n\t\"do\",\n\t\"else\",\n\t\"end\",\n\t\"except\",\n\t\"false\",\n\t\"fetch\",\n\t\"for\",\n\t\"foreign\",\n\t\"freeze\",\n\t\"from\",\n\t\"full\",\n\t\"grant\",\n\t\"group\",\n\t\"having\",\n\t\"ilike\",\n\t\"in\",\n\t\"initially\",\n\t\"inner\",\n\t\"intersect\",\n\t\"into\",\n\t\"is\",\n\t\"isnull\",\n\t\"join\",\n\t\"lateral\",\n\t\"leading\",\n\t\"left\",\n\t\"like\",\n\t\"limit\",\n\t\"localtime\",\n\t\"localtimestamp\",\n\t\"natural\",\n\t\"not\",\n\t\"notnull\",\n\t\"null\",\n\t\"offset\",\n\t\"on\",\n\t\"only\",\n\t\"or\",\n\t\"order\",\n\t\"outer\",\n\t\"overlaps\",\n\t\"placing\",\n\t\"primary\",\n\t\"references\",\n\t\"right\",\n\t\"select\",\n\t\"session_user\",\n\t\"similar\",\n\t\"some\",\n\t\"symmetric\",\n\t\"table\",\n\t\"then\",\n\t\"to\",\n\t\"trailing\",\n\t\"true\",\n\t\"union\",\n\t\"unique\",\n\t\"user\",\n\t\"using\",\n\t\"variadic\",\n\t\"verbose\",\n\t\"when\",\n\t\"where\",\n\t\"window\",\n\t\"with\"\n]);\nfunction formatUserDefinedTypeName(identifier) {\n\tif (UNQUOTED_POSTGRES_IDENTIFIER_PATTERN.test(identifier) && !POSTGRES_RESERVED_IDENTIFIER_WORDS.has(identifier)) return identifier;\n\treturn quoteIdentifier(identifier);\n}\nfunction buildExpectedFormatType(column, codecHooks, storageTypes = {}) {\n\tconst resolved = resolveColumnTypeMetadata(column, storageTypes);\n\tif (resolved.typeParams && resolved.codecId) {\n\t\tconst hooks = codecHooks.get(resolved.codecId);\n\t\tif (hooks?.expandNativeType) return hooks.expandNativeType({\n\t\t\tnativeType: resolved.nativeType,\n\t\t\tcodecId: resolved.codecId,\n\t\t\ttypeParams: resolved.typeParams\n\t\t});\n\t}\n\tif (column.typeRef) return formatUserDefinedTypeName(resolved.nativeType);\n\treturn FORMAT_TYPE_DISPLAY.get(resolved.nativeType) ?? resolved.nativeType;\n}\n//#endregion\nexport { qualifyTableName as n, buildExpectedFormatType as t };\n\n//# sourceMappingURL=planner-sql-checks-Bcngv5YZ.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,iBAAiB,QAAQ,OAAO;CACxC,OAAO,wBAAwB;EAC9B,IAAI;EACJ,SAAS,EAAE,OAAO,CAAC,EAAE;CACtB,CAAC,CAAC,CAAC,aAAa,KAAK;AACtB;AACA,MAAM,sCAAsC,IAAI,IAAI;CACnD,CAAC,QAAQ,UAAU;CACnB,CAAC,QAAQ,SAAS;CAClB,CAAC,QAAQ,QAAQ;CACjB,CAAC,UAAU,MAAM;CACjB,CAAC,UAAU,kBAAkB;CAC7B,CAAC,QAAQ,SAAS;CAClB,CAAC,aAAa,6BAA6B;CAC3C,CAAC,eAAe,0BAA0B;CAC1C,CAAC,QAAQ,wBAAwB;CACjC,CAAC,UAAU,qBAAqB;AACjC,CAAC;AACD,MAAM,uCAAuC;AAC7C,MAAM,qDAAqD,IAAI,IAAI;CAClE;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;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;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;AACD,CAAC;AACD,SAAS,0BAA0B,YAAY;CAC9C,IAAI,qCAAqC,KAAK,UAAU,KAAK,CAAC,mCAAmC,IAAI,UAAU,GAAG,OAAO;CACzH,OAAO,gBAAgB,UAAU;AAClC;AACA,SAAS,wBAAwB,QAAQ,YAAY,eAAe,CAAC,GAAG;CACvE,MAAM,WAAW,0BAA0B,QAAQ,YAAY;CAC/D,IAAI,SAAS,cAAc,SAAS,SAAS;EAC5C,MAAM,QAAQ,WAAW,IAAI,SAAS,OAAO;EAC7C,IAAI,OAAO,kBAAkB,OAAO,MAAM,iBAAiB;GAC1D,YAAY,SAAS;GACrB,SAAS,SAAS;GAClB,YAAY,SAAS;EACtB,CAAC;CACF;CACA,IAAI,OAAO,SAAS,OAAO,0BAA0B,SAAS,UAAU;CACxE,OAAO,oBAAoB,IAAI,SAAS,UAAU,KAAK,SAAS;AACjE"}
@@ -1,6 +1,6 @@
1
- import { g as PG_INT_CODEC_ID, x as PG_TEXT_CODEC_ID } from "./codec-ids-C5Rkltkw-DMf87l9s.mjs";
2
- import { _ as roleEntityKind, c as PostgresSchema, f as nativeEnumEntityKind, g as rlsEnablementEntityKind, p as policyEntityKind } from "./postgres-schema-CF0yHESb-D7n2X21R.mjs";
3
- import { t as postgresAuthoringEntityTypes } from "./authoring-BOpdZa2N-ClrLFiXw.mjs";
1
+ import { S as PG_TEXT_CODEC_ID, _ as PG_INT_CODEC_ID } from "./codec-ids-D3ZEAmt2-DjoKUAas.mjs";
2
+ import { _ as roleEntityKind, c as PostgresSchema, f as nativeEnumEntityKind, g as rlsEnablementEntityKind, p as policyEntityKind } from "./postgres-schema-B3t7Zr52-CMlY9aGw.mjs";
3
+ import { i as postgresAuthoringEntityTypes } from "./authoring-Dm1jBKhq-i8FD48I-.mjs";
4
4
  import { blindCast } from "@prisma/orm-framework/utils/casts";
5
5
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
6
6
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
@@ -9,7 +9,7 @@ import { createPreserveEmptyPredicate } from "@prisma/orm-framework/contract/has
9
9
  import { SqlContractSerializerBase } from "@prisma/orm-family-sql/family/ir";
10
10
  import { isAuthoringEntityTypeDescriptor } from "@prisma/orm-framework/components/authoring";
11
11
  import { sqlContractCanonicalizationHooks } from "@prisma/orm-family-sql/contract/canonicalization-hooks";
12
- //#region ../../../3-targets/3-targets/postgres/dist/postgres-contract-view-B8ykf2cO.mjs
12
+ //#region ../../../3-targets/3-targets/postgres/dist/postgres-contract-view-dWcpuV6T.mjs
13
13
  const POSTGRES_AUTHORING_CTX = {
14
14
  family: "sql",
15
15
  target: "postgres",
@@ -141,4 +141,4 @@ const PostgresContractView = {
141
141
  //#endregion
142
142
  export { PostgresContractView as n, PostgresContractSerializer as t };
143
143
 
144
- //# sourceMappingURL=postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs.map
144
+ //# sourceMappingURL=postgres-contract-view-dWcpuV6T-CJPsHGox.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/postgres-contract-view-B8ykf2cO.mjs"],"sourcesContent":["import { g as PG_INT_CODEC_ID, x as PG_TEXT_CODEC_ID } from \"./codec-ids-C5Rkltkw.mjs\";\nimport { a as nativeEnumEntityKind, c as roleEntityKind, o as policyEntityKind, s as rlsEnablementEntityKind, t as PostgresSchema } from \"./postgres-schema-CF0yHESb.mjs\";\nimport { t as postgresAuthoringEntityTypes } from \"./authoring-BOpdZa2N.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { buildSqlSchemaQualifiedView } from \"@internal/sql-contract/contract-view\";\nimport { createPreserveEmptyPredicate } from \"@internal/contract/hashing-utils\";\nimport { SqlContractSerializerBase } from \"@internal/family-sql/ir\";\nimport { isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { sqlContractCanonicalizationHooks } from \"@internal/sql-contract/canonicalization-hooks\";\n//#region src/core/postgres-contract-serializer.ts\nconst POSTGRES_AUTHORING_CTX = {\n\tfamily: \"sql\",\n\ttarget: \"postgres\",\n\tenumInferenceCodecs: {\n\t\ttext: PG_TEXT_CODEC_ID,\n\t\tint: PG_INT_CODEC_ID\n\t}\n};\nfunction isAuthoringEntityTypeFactoryOutput(output) {\n\treturn typeof output === \"object\" && output !== null && \"factory\" in output && typeof output.factory === \"function\";\n}\n/**\n* Walks a pack's entity-type namespace tree and emits hydration factories\n* keyed by the descriptor's `discriminator`. Used for `storage.types`\n* (codec-triple hydration). Namespace entries hydration dispatches by\n* entries key, not discriminator — handled by `hydrateNamespaceEntities`.\n*/\nfunction collectStorageTypesHydrators(namespace) {\n\tconst registry = /* @__PURE__ */ new Map();\n\tconst walk = (node) => {\n\t\tfor (const value of Object.values(node)) {\n\t\t\tif (isAuthoringEntityTypeDescriptor(value)) {\n\t\t\t\tif (isAuthoringEntityTypeFactoryOutput(value.output)) {\n\t\t\t\t\tconst { factory } = value.output;\n\t\t\t\t\tregistry.set(value.discriminator, (raw) => factory(raw, POSTGRES_AUTHORING_CTX));\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (typeof value === \"object\" && value !== null) walk(value);\n\t\t}\n\t};\n\twalk(namespace);\n\treturn registry;\n}\n/**\n* The canonicalization walk drops a field whose value equals its type's\n* default, which for a required field of an entity kind means the emitted\n* contract fails that kind's own schema on the next read (a RESTRICTIVE\n* policy's `permissive: false` is the live case). The set of fields that must\n* survive is therefore the required keys of the registered entity kinds —\n* read off the schemas rather than listed by hand, so a kind that gains a\n* required field is covered the day it gains one.\n*/\nfunction requiredEntityFieldsSurviveDefaults(kinds) {\n\treturn createPreserveEmptyPredicate(kinds.flatMap((kind) => requiredKeysOf(kind.schema).map((key) => [\n\t\t\"storage\",\n\t\t\"namespaces\",\n\t\t\"*\",\n\t\t\"entries\",\n\t\tkind.kind,\n\t\t\"*\",\n\t\tkey\n\t])));\n}\nfunction isSchemaPropList(value) {\n\treturn Array.isArray(value) && value.every((prop) => prop !== null && (typeof prop === \"object\" || typeof prop === \"function\") && \"kind\" in prop && \"key\" in prop);\n}\nfunction requiredKeysOf(schema) {\n\tconst props = \"props\" in schema ? schema.props : void 0;\n\tif (!isSchemaPropList(props)) throw new InternalError(\"entity-kind schema does not expose arktype object props; the required-field preserve set cannot be derived\");\n\treturn props.flatMap((prop) => prop.kind === \"required\" && typeof prop.key === \"string\" ? [prop.key] : []);\n}\nvar PostgresContractSerializer = class extends SqlContractSerializerBase {\n\tshouldPreserveEmpty;\n\tconstructor(extraPackEntityKinds = []) {\n\t\tconst storageTypesHydrators = collectStorageTypesHydrators(postgresAuthoringEntityTypes);\n\t\tconst entityKinds = [\n\t\t\tpolicyEntityKind,\n\t\t\troleEntityKind,\n\t\t\trlsEnablementEntityKind,\n\t\t\tnativeEnumEntityKind,\n\t\t\t...extraPackEntityKinds\n\t\t];\n\t\tsuper(storageTypesHydrators, entityKinds);\n\t\tconst preserveRequired = requiredEntityFieldsSurviveDefaults(entityKinds);\n\t\tthis.shouldPreserveEmpty = (path) => preserveRequired(path) || sqlContractCanonicalizationHooks.shouldPreserveEmpty(path);\n\t}\n\thydrateSqlNamespaceEntry(nsId, raw) {\n\t\tconst { id, entries } = blindCast(super.hydrateSqlNamespaceEntry(nsId, raw));\n\t\tconst allSlotsEmpty = Object.values(entries).every((slot) => slot === void 0 || Object.keys(slot).length === 0);\n\t\tif (id === UNBOUND_NAMESPACE_ID && allSlotsEmpty) return PostgresSchema.unbound;\n\t\tconst valueSetSlot = entries[\"valueSet\"];\n\t\tconst hasValueSets = valueSetSlot !== void 0 && Object.keys(valueSetSlot).length > 0;\n\t\treturn new PostgresSchema({\n\t\t\tid,\n\t\t\tentries: {\n\t\t\t\t...entries,\n\t\t\t\ttable: entries[\"table\"] ?? {},\n\t\t\t\t...hasValueSets ? { valueSet: valueSetSlot } : {}\n\t\t\t}\n\t\t});\n\t}\n\tserializeContract(contract) {\n\t\tconst { storage, ...rest } = contract;\n\t\tconst namespacesJson = {};\n\t\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) {\n\t\t\tconst isUnboundSlot = ns.id === UNBOUND_NAMESPACE_ID;\n\t\t\tnamespacesJson[nsId] = {\n\t\t\t\tid: ns.id,\n\t\t\t\tkind: isUnboundSlot ? \"postgres-unbound-schema\" : \"postgres-schema\",\n\t\t\t\tentries: this.serializeNamespaceEntries(ns.entries)\n\t\t\t};\n\t\t}\n\t\tconst storageOut = {\n\t\t\tstorageHash: String(storage.storageHash),\n\t\t\tnamespaces: namespacesJson\n\t\t};\n\t\tif (storage.types !== void 0) {\n\t\t\tconst typesOut = {};\n\t\t\tfor (const [name, entry] of Object.entries(storage.types)) typesOut[name] = this.serializeJsonObject(entry);\n\t\t\tstorageOut[\"types\"] = typesOut;\n\t\t}\n\t\treturn blindCast({\n\t\t\t...rest,\n\t\t\tstorage: storageOut\n\t\t});\n\t}\n};\n//#endregion\n//#region src/core/postgres-contract-view.ts\nconst PostgresContractView = {\n\t/** Wrap an already-deserialized Postgres contract in a schema-qualified view. */\n\tfrom(contract) {\n\t\treturn buildSqlSchemaQualifiedView(contract);\n\t},\n\t/** Deserialize a Postgres contract JSON envelope and wrap it in a view. */\n\tfromJson(json) {\n\t\treturn buildSqlSchemaQualifiedView(new PostgresContractSerializer().deserializeContract(json));\n\t}\n};\n//#endregion\nexport { PostgresContractSerializer as n, PostgresContractView as t };\n\n//# sourceMappingURL=postgres-contract-view-B8ykf2cO.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,yBAAyB;CAC9B,QAAQ;CACR,QAAQ;CACR,qBAAqB;EACpB,MAAM;EACN,KAAK;CACN;AACD;AACA,SAAS,mCAAmC,QAAQ;CACnD,OAAO,OAAO,WAAW,YAAY,WAAW,QAAQ,aAAa,UAAU,OAAO,OAAO,YAAY;AAC1G;;;;;;;AAOA,SAAS,6BAA6B,WAAW;CAChD,MAAM,2BAA2B,IAAI,IAAI;CACzC,MAAM,QAAQ,SAAS;EACtB,KAAK,MAAM,SAAS,OAAO,OAAO,IAAI,GAAG;GACxC,IAAI,gCAAgC,KAAK,GAAG;IAC3C,IAAI,mCAAmC,MAAM,MAAM,GAAG;KACrD,MAAM,EAAE,YAAY,MAAM;KAC1B,SAAS,IAAI,MAAM,gBAAgB,QAAQ,QAAQ,KAAK,sBAAsB,CAAC;IAChF;IACA;GACD;GACA,IAAI,OA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wB,eAAe,OAAO,eAAe;EACxE,MAAM,eAAe,QAAQ;EAC7B,MAAM,eAAe,iBAAiB,KAAK,KAAK,OAAO,KAAK,YAAY,CAAC,CAAC,SAAS;EACnF,OAAO,IAAI,eAAe;GACzB;GACA,SAAS;IACR,GAAG;IACH,OAAO,QAAQ,YAAY,CAAC;IAC5B,GAAG,eAAe,EAAE,UAAU,aAAa,IAAI,CAAC;GACjD;EACD,CAAC;CACF;CACA,kBAAkB,UAAU;EAC3B,MAAM,EAAE,SAAS,GAAG,SAAS;EAC7B,MAAM,iBAAiB,CAAC;EACxB,KAAK,MAAM,CAAC,MAAM,OAAO,OAAO,QAAQ,QAAQ,UAAU,GAAG;GAC5D,MAAM,gBAAgB,GAAG,OAAO;GAChC,eAAe,QAAQ;IACtB,IAAI,GAAG;IACP,MAAM,gBAAgB,4BAA4B;IAClD,SAAS,KAAK,0BAA0B,GAAG,OAAO;GACnD;EACD;EACA,MAAM,aAAa;GAClB,aAAa,OAAO,QAAQ,WAAW;GACvC,YAAY;EACb;EACA,IAAI,QAAQ,UAAU,KAAK,GAAG;GAC7B,MAAM,WAAW,CAAC;GAClB,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,QAAQ,KAAK,GAAG,SAAS,QAAQ,KAAK,oBAAoB,KAAK;GAC1G,WAAW,WAAW;EACvB;EACA,OAAO,UAAU;GAChB,GAAG;GACH,SAAS;EACV,CAAC;CACF;AACD;AAGA,MAAM,uBAAuB;;CAE5B,KAAK,UAAU;EACd,OAAO,4BAA4B,QAAQ;CAC5C;;CAEA,SAAS,MAAM;EACd,OAAO,4BAA4B,IAAI,2BAA2B,CAAC,CAAC,oBAAoB,IAAI,CAAC;CAC9F;AACD"}
1
+ {"version":3,"file":"postgres-contract-view-dWcpuV6T-CJPsHGox.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/postgres-contract-view-dWcpuV6T.mjs"],"sourcesContent":["import { S as PG_TEXT_CODEC_ID, _ as PG_INT_CODEC_ID } from \"./codec-ids-D3ZEAmt2.mjs\";\nimport { t as postgresAuthoringEntityTypes } from \"./authoring-Dm1jBKhq.mjs\";\nimport { a as nativeEnumEntityKind, c as roleEntityKind, o as policyEntityKind, s as rlsEnablementEntityKind, t as PostgresSchema } from \"./postgres-schema-B3t7Zr52.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { buildSqlSchemaQualifiedView } from \"@internal/sql-contract/contract-view\";\nimport { createPreserveEmptyPredicate } from \"@internal/contract/hashing-utils\";\nimport { SqlContractSerializerBase } from \"@internal/family-sql/ir\";\nimport { isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { sqlContractCanonicalizationHooks } from \"@internal/sql-contract/canonicalization-hooks\";\n//#region src/core/postgres-contract-serializer.ts\nconst POSTGRES_AUTHORING_CTX = {\n\tfamily: \"sql\",\n\ttarget: \"postgres\",\n\tenumInferenceCodecs: {\n\t\ttext: PG_TEXT_CODEC_ID,\n\t\tint: PG_INT_CODEC_ID\n\t}\n};\nfunction isAuthoringEntityTypeFactoryOutput(output) {\n\treturn typeof output === \"object\" && output !== null && \"factory\" in output && typeof output.factory === \"function\";\n}\n/**\n* Walks a pack's entity-type namespace tree and emits hydration factories\n* keyed by the descriptor's `discriminator`. Used for `storage.types`\n* (codec-triple hydration). Namespace entries hydration dispatches by\n* entries key, not discriminator — handled by `hydrateNamespaceEntities`.\n*/\nfunction collectStorageTypesHydrators(namespace) {\n\tconst registry = /* @__PURE__ */ new Map();\n\tconst walk = (node) => {\n\t\tfor (const value of Object.values(node)) {\n\t\t\tif (isAuthoringEntityTypeDescriptor(value)) {\n\t\t\t\tif (isAuthoringEntityTypeFactoryOutput(value.output)) {\n\t\t\t\t\tconst { factory } = value.output;\n\t\t\t\t\tregistry.set(value.discriminator, (raw) => factory(raw, POSTGRES_AUTHORING_CTX));\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (typeof value === \"object\" && value !== null) walk(value);\n\t\t}\n\t};\n\twalk(namespace);\n\treturn registry;\n}\n/**\n* The canonicalization walk drops a field whose value equals its type's\n* default, which for a required field of an entity kind means the emitted\n* contract fails that kind's own schema on the next read (a RESTRICTIVE\n* policy's `permissive: false` is the live case). The set of fields that must\n* survive is therefore the required keys of the registered entity kinds —\n* read off the schemas rather than listed by hand, so a kind that gains a\n* required field is covered the day it gains one.\n*/\nfunction requiredEntityFieldsSurviveDefaults(kinds) {\n\treturn createPreserveEmptyPredicate(kinds.flatMap((kind) => requiredKeysOf(kind.schema).map((key) => [\n\t\t\"storage\",\n\t\t\"namespaces\",\n\t\t\"*\",\n\t\t\"entries\",\n\t\tkind.kind,\n\t\t\"*\",\n\t\tkey\n\t])));\n}\nfunction isSchemaPropList(value) {\n\treturn Array.isArray(value) && value.every((prop) => prop !== null && (typeof prop === \"object\" || typeof prop === \"function\") && \"kind\" in prop && \"key\" in prop);\n}\nfunction requiredKeysOf(schema) {\n\tconst props = \"props\" in schema ? schema.props : void 0;\n\tif (!isSchemaPropList(props)) throw new InternalError(\"entity-kind schema does not expose arktype object props; the required-field preserve set cannot be derived\");\n\treturn props.flatMap((prop) => prop.kind === \"required\" && typeof prop.key === \"string\" ? [prop.key] : []);\n}\nvar PostgresContractSerializer = class extends SqlContractSerializerBase {\n\tshouldPreserveEmpty;\n\tconstructor(extraPackEntityKinds = []) {\n\t\tconst storageTypesHydrators = collectStorageTypesHydrators(postgresAuthoringEntityTypes);\n\t\tconst entityKinds = [\n\t\t\tpolicyEntityKind,\n\t\t\troleEntityKind,\n\t\t\trlsEnablementEntityKind,\n\t\t\tnativeEnumEntityKind,\n\t\t\t...extraPackEntityKinds\n\t\t];\n\t\tsuper(storageTypesHydrators, entityKinds);\n\t\tconst preserveRequired = requiredEntityFieldsSurviveDefaults(entityKinds);\n\t\tthis.shouldPreserveEmpty = (path) => preserveRequired(path) || sqlContractCanonicalizationHooks.shouldPreserveEmpty(path);\n\t}\n\thydrateSqlNamespaceEntry(nsId, raw) {\n\t\tconst { id, entries } = blindCast(super.hydrateSqlNamespaceEntry(nsId, raw));\n\t\tconst allSlotsEmpty = Object.values(entries).every((slot) => slot === void 0 || Object.keys(slot).length === 0);\n\t\tif (id === UNBOUND_NAMESPACE_ID && allSlotsEmpty) return PostgresSchema.unbound;\n\t\tconst valueSetSlot = entries[\"valueSet\"];\n\t\tconst hasValueSets = valueSetSlot !== void 0 && Object.keys(valueSetSlot).length > 0;\n\t\treturn new PostgresSchema({\n\t\t\tid,\n\t\t\tentries: {\n\t\t\t\t...entries,\n\t\t\t\ttable: entries[\"table\"] ?? {},\n\t\t\t\t...hasValueSets ? { valueSet: valueSetSlot } : {}\n\t\t\t}\n\t\t});\n\t}\n\tserializeContract(contract) {\n\t\tconst { storage, ...rest } = contract;\n\t\tconst namespacesJson = {};\n\t\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) {\n\t\t\tconst isUnboundSlot = ns.id === UNBOUND_NAMESPACE_ID;\n\t\t\tnamespacesJson[nsId] = {\n\t\t\t\tid: ns.id,\n\t\t\t\tkind: isUnboundSlot ? \"postgres-unbound-schema\" : \"postgres-schema\",\n\t\t\t\tentries: this.serializeNamespaceEntries(ns.entries)\n\t\t\t};\n\t\t}\n\t\tconst storageOut = {\n\t\t\tstorageHash: String(storage.storageHash),\n\t\t\tnamespaces: namespacesJson\n\t\t};\n\t\tif (storage.types !== void 0) {\n\t\t\tconst typesOut = {};\n\t\t\tfor (const [name, entry] of Object.entries(storage.types)) typesOut[name] = this.serializeJsonObject(entry);\n\t\t\tstorageOut[\"types\"] = typesOut;\n\t\t}\n\t\treturn blindCast({\n\t\t\t...rest,\n\t\t\tstorage: storageOut\n\t\t});\n\t}\n};\n//#endregion\n//#region src/core/postgres-contract-view.ts\nconst PostgresContractView = {\n\t/** Wrap an already-deserialized Postgres contract in a schema-qualified view. */\n\tfrom(contract) {\n\t\treturn buildSqlSchemaQualifiedView(contract);\n\t},\n\t/** Deserialize a Postgres contract JSON envelope and wrap it in a view. */\n\tfromJson(json) {\n\t\treturn buildSqlSchemaQualifiedView(new PostgresContractSerializer().deserializeContract(json));\n\t}\n};\n//#endregion\nexport { PostgresContractSerializer as n, PostgresContractView as t };\n\n//# sourceMappingURL=postgres-contract-view-dWcpuV6T.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,yBAAyB;CAC9B,QAAQ;CACR,QAAQ;CACR,qBAAqB;EACpB,MAAM;EACN,KAAK;CACN;AACD;AACA,SAAS,mCAAmC,QAAQ;CACnD,OAAO,OAAO,WAAW,YAAY,WAAW,QAAQ,aAAa,UAAU,OAAO,OAAO,YAAY;AAC1G;;;;;;;AAOA,SAAS,6BAA6B,WAAW;CAChD,MAAM,2BAA2B,IAAI,IAAI;CACzC,MAAM,QAAQ,SAAS;EACtB,KAAK,MAAM,SAAS,OAAO,OAAO,IAAI,GAAG;GACxC,IAAI,gCAAgC,KAAK,GAAG;IAC3C,IAAI,mCAAmC,MAAM,MAAM,GAAG;KACrD,MAAM,EAAE,YAAY,MAAM;KAC1B,SAAS,IAAI,MAAM,gBAAgB,QAAQ,QAAQ,KAAK,sBAAsB,CAAC;IAChF;IACA;GACD;GACA,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,KAAK,KAAK;EAC5D;CACD;CACA,KAAK,SAAS;CACd,OAAO;AACR;;;;;;;;;;AAUA,SAAS,oCAAoC,OAAO;CACnD,OAAO,6BAA6B,MAAM,SAAS,SAAS,eAAe,KAAK,MAAM,CAAC,CAAC,KAAK,QAAQ;EACpG;EACA;EACA;EACA;EACA,KAAK;EACL;EACA;CACD,CAAC,CAAC,CAAC;AACJ;AACA,SAAS,iBAAiB,OAAO;CAChC,OAAO,MAAM,QAAQ,KAAK,KAAK,MAAM,OAAO,SAAS,SAAS,SAAS,OAAO,SAAS,YAAY,OAAO,SAAS,eAAe,UAAU,QAAQ,SAAS,IAAI;AAClK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5D,MAAM,gBAAgB,GAAG,OAAO;GAChC,eAAe,QAAQ;IACtB,IAAI,GAAG;IACP,MAAM,gBAAgB,4BAA4B;IAClD,SAAS,KAAK,0BAA0B,GAAG,OAAO;GACnD;EACD;EACA,MAAM,aAAa;GAClB,aAAa,OAAO,QAAQ,WAAW;GACvC,YAAY;EACb;EACA,IAAI,QAAQ,UAAU,KAAK,GAAG;GAC7B,MAAM,WAAW,CAAC;GAClB,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,QAAQ,KAAK,GAAG,SAAS,QAAQ,KAAK,oBAAoB,KAAK;GAC1G,WAAW,WAAW;EACvB;EACA,OAAO,UAAU;GAChB,GAAG;GACH,SAAS;EACV,CAAC;CACF;AACD;AAGA,MAAM,uBAAuB;;CAE5B,KAAK,UAAU;EACd,OAAO,4BAA4B,QAAQ;CAC5C;;CAEA,SAAS,MAAM;EACd,OAAO,4BAA4B,IAAI,2BAA2B,CAAC,CAAC,oBAAoB,IAAI,CAAC;CAC9F;AACD"}
@@ -1,12 +1,12 @@
1
- import { t as errorPostgresMigrationStackMissing } from "./errors-DKjQzNaN-DFcF1thx.mjs";
2
- import { i as PostgresRlsPolicy } from "./postgres-schema-CF0yHESb-D7n2X21R.mjs";
3
- import { A as RenameIndexCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, I as installExtension, M as SetDefaultCall, N as SetNotNullCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, h as CreateTableCall, i as AddNativeEnumValueCall, j as RenamePostgresRlsPolicyCall, k as RenameCheckConstraintCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, p as CreatePostgresRlsPolicyCall, r as AddForeignKeyCall, s as AddPrimaryKeyCall, t as AddCheckConstraintCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from "./op-factory-call-H6zeDGLe-_1pAftJk.mjs";
4
- import { n as PostgresContractView } from "./postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs";
1
+ import { t as errorPostgresMigrationStackMissing } from "./errors-DYyzTYzE-39CV_aMo.mjs";
2
+ import { i as PostgresRlsPolicy } from "./postgres-schema-B3t7Zr52-CMlY9aGw.mjs";
3
+ import { A as RenameIndexCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, I as installExtension, M as SetDefaultCall, N as SetNotNullCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, h as CreateTableCall, i as AddNativeEnumValueCall, j as RenamePostgresRlsPolicyCall, k as RenameCheckConstraintCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, p as CreatePostgresRlsPolicyCall, r as AddForeignKeyCall, s as AddPrimaryKeyCall, t as AddCheckConstraintCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from "./op-factory-call-CSkQdszU-C43tr0rP.mjs";
4
+ import { n as PostgresContractView } from "./postgres-contract-view-dWcpuV6T-CJPsHGox.mjs";
5
5
  import { t as dataTransform } from "./data-transform-ChZzy2dP-CxVCat_8.mjs";
6
6
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
7
7
  import { Migration } from "@prisma/orm-family-sql/family/migration";
8
8
  import { MigrationContractViews } from "@prisma/orm-toolchain/migration-tools/migration";
9
- //#region ../../../3-targets/3-targets/postgres/dist/postgres-migration-Dbq3RGfZ.mjs
9
+ //#region ../../../3-targets/3-targets/postgres/dist/postgres-migration-DRKw86P7.mjs
10
10
  /**
11
11
  * Target-owned base class for Postgres migrations.
12
12
  *
@@ -202,4 +202,4 @@ var PostgresMigration = class extends Migration {
202
202
  //#endregion
203
203
  export { PostgresMigration as t };
204
204
 
205
- //# sourceMappingURL=postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs.map
205
+ //# sourceMappingURL=postgres-migration-DRKw86P7-C1eWF86n.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs","names":["#endView","#startView"],"sources":["../../../../3-targets/3-targets/postgres/dist/postgres-migration-Dbq3RGfZ.mjs"],"sourcesContent":["import { t as errorPostgresMigrationStackMissing } from \"./errors-DKjQzNaN.mjs\";\nimport { _ as PostgresRlsPolicy } from \"./postgres-schema-CF0yHESb.mjs\";\nimport { A as RenameIndexCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, L as installExtension, M as SetDefaultCall, N as SetNotNullCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, h as CreateTableCall, i as AddNativeEnumValueCall, j as RenamePostgresRlsPolicyCall, k as RenameCheckConstraintCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, p as CreatePostgresRlsPolicyCall, r as AddForeignKeyCall, s as AddPrimaryKeyCall, t as AddCheckConstraintCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from \"./op-factory-call-H6zeDGLe.mjs\";\nimport { t as PostgresContractView } from \"./postgres-contract-view-B8ykf2cO.mjs\";\nimport { t as dataTransform } from \"./data-transform-ChZzy2dP.mjs\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { Migration } from \"@internal/family-sql/migration\";\nimport { MigrationContractViews } from \"@internal/migration-tools/migration\";\n//#region src/core/migrations/postgres-migration.ts\n/**\n* Target-owned base class for Postgres migrations.\n*\n* Fixes the `SqlMigration` generic to `PostgresPlanTargetDetails` and the\n* abstract `targetId` to the Postgres target-id string literal, so both\n* user-authored migrations and renderer-generated scaffolds (the output of\n* `renderCallsToTypeScript`) can extend `PostgresMigration` directly without\n* redeclaring target-local identity.\n*\n* Mirrors `MongoMigration` in `@internal/family-mongo`: the renderer\n* emits `extends Migration` against a facade re-export of this class\n* from `@internal/postgres/migration`, keeping the authoring surface\n* target-scoped rather than family-scoped.\n*\n* The constructor materializes a single Postgres `SqlControlAdapter` from\n* `stack.adapter.create(stack)` and stores it; the protected `dataTransform`\n* instance method forwards to the free `dataTransform` factory with that\n* stored adapter, so user migrations can write `this.dataTransform(...)`\n* without threading the adapter through every call.\n*\n* Every method requires an explicit `schema`. Postgres migrations name their\n* schema deliberately — there is no default and no `search_path`-relative\n* option. A migration that left the schema unspecified would resolve against\n* whatever `search_path` the connection happened to carry, and that ambiguity\n* is an antipattern in a migration. (The unbound/unspecified namespace concept\n* remains for SQLite, which has no schemas, and for Mongo's connection `db`.)\n*/\nvar PostgresMigration = class extends Migration {\n\ttargetId = \"postgres\";\n\t/**\n\t* Materialized Postgres control adapter, created once per migration\n\t* instance from the injected stack. `undefined` only when the migration\n\t* was instantiated without a stack (test fixtures); `controlAdapterFor`\n\t* throws a MIGRATION.POSTGRES_CONTROL_STACK_MISSING in that case to surface the misuse.\n\t*/\n\tcontrolAdapter;\n\t#endView = new MigrationContractViews(this, \"PostgresMigration\", (json) => PostgresContractView.fromJson(json));\n\t#startView = new MigrationContractViews(this, \"PostgresMigration\", (json) => PostgresContractView.fromJson(json));\n\tconstructor(stack) {\n\t\tsuper(stack);\n\t\tthis.controlAdapter = stack?.adapter ? stack.adapter.create(stack) : void 0;\n\t}\n\t/**\n\t* Returns the materialized control adapter, or throws a MIGRATION.POSTGRES_CONTROL_STACK_MISSING naming\n\t* `operation` when the migration was constructed without a `ControlStack`.\n\t* Single home for the null-check that every DDL/DML method shares.\n\t*/\n\tcontrolAdapterFor(operation) {\n\t\tif (!this.controlAdapter) throw errorPostgresMigrationStackMissing(operation);\n\t\treturn this.controlAdapter;\n\t}\n\t/**\n\t* The typed, schema-qualified Postgres view over this migration's end-state\n\t* contract — `this.endContract.namespace.<schema>.table.<name>`, etc. Throws\n\t* if no `endContractJson` was provided.\n\t*/\n\tget endContract() {\n\t\treturn this.#endView.endContract;\n\t}\n\t/**\n\t* The typed Postgres view over this migration's start-state contract, or\n\t* `null` for a baseline migration (no `startContractJson`).\n\t*/\n\tget startContract() {\n\t\treturn this.#startView.startContract;\n\t}\n\t/**\n\t* Instance-method wrapper around the free `dataTransform` factory that\n\t* supplies the stored control adapter. Authors call this from inside\n\t* `get operations()`; the adapter argument is hidden from the call site.\n\t*/\n\tdataTransform(contract, name, options) {\n\t\treturn dataTransform(contract, name, options, this.controlAdapterFor(\"dataTransform\"));\n\t}\n\t/**\n\t* Emit a `CREATE TABLE` migration operation. Builds a typed DDL node from\n\t* the supplied options and lowers it through the stored control adapter.\n\t* Throws if no adapter is present (i.e. migration instantiated without a stack).\n\t*/\n\tcreateTable(options) {\n\t\treturn new CreateTableCall(options.schema, options.table, options.columns, options.constraints).toOp(this.controlAdapterFor(\"createTable\"));\n\t}\n\t/**\n\t* Emit a `CREATE SCHEMA` migration operation. Builds a typed DDL node from\n\t* the supplied options and lowers it through the stored control adapter.\n\t* Throws if no adapter is present (i.e. migration instantiated without a stack).\n\t*/\n\tcreateSchema(options) {\n\t\treturn new CreateSchemaCall(options.schema).toOp(this.controlAdapterFor(\"createSchema\"));\n\t}\n\t/**\n\t* Emit a `CREATE TYPE ... AS ENUM (...)` migration operation for a managed\n\t* native enum. Builds a typed DDL node and lowers it through the stored\n\t* control adapter (members render in declaration order). Throws if no adapter\n\t* is present.\n\t*/\n\tcreateNativeEnumType(options) {\n\t\treturn new CreateNativeEnumTypeCall(options.schema, options.typeName, options.members).toOp(this.controlAdapterFor(\"createNativeEnumType\"));\n\t}\n\t/**\n\t* Emit a `DROP TYPE` migration operation for a managed native enum, lowered\n\t* through the stored control adapter. Throws if no adapter is present.\n\t*/\n\tdropNativeEnumType(options) {\n\t\treturn new DropNativeEnumTypeCall(options.schema, options.typeName).toOp(this.controlAdapterFor(\"dropNativeEnumType\"));\n\t}\n\t/**\n\t* Emit an `ALTER TYPE ... ADD VALUE` migration operation appending one\n\t* member to a managed native enum, lowered through the stored control\n\t* adapter. Throws if no adapter is present. Every appended value is its\n\t* own operation — call this once per value to append more than one.\n\t*/\n\taddNativeEnumValue(options) {\n\t\treturn new AddNativeEnumValueCall(options.schema, options.typeName, options.value).toOp(this.controlAdapterFor(\"addNativeEnumValue\"));\n\t}\n\taddColumn(options) {\n\t\treturn new AddColumnCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"addColumn\"));\n\t}\n\taddPrimaryKey(options) {\n\t\treturn new AddPrimaryKeyCall(options.schema, options.table, options.constraint, options.columns).toOp(this.controlAdapterFor(\"addPrimaryKey\"));\n\t}\n\taddUnique(options) {\n\t\treturn new AddUniqueCall(options.schema, options.table, options.constraint, options.columns).toOp(this.controlAdapterFor(\"addUnique\"));\n\t}\n\taddForeignKey(options) {\n\t\treturn new AddForeignKeyCall(options.schema, options.table, options.foreignKey).toOp(this.controlAdapterFor(\"addForeignKey\"));\n\t}\n\taddCheckConstraint(options) {\n\t\treturn new AddCheckConstraintCall(options.schema, options.table, options.constraint, options.expression).toOp(this.controlAdapterFor(\"addCheckConstraint\"));\n\t}\n\trenameCheckConstraint(options) {\n\t\treturn new RenameCheckConstraintCall(options.schema ?? UNBOUND_NAMESPACE_ID, options.table, options.from, options.to).toOp(this.controlAdapterFor(\"renameCheckConstraint\"));\n\t}\n\tdropCheckConstraint(options) {\n\t\treturn new DropCheckConstraintCall(options.schema, options.table, options.constraint).toOp(this.controlAdapterFor(\"dropCheckConstraint\"));\n\t}\n\tdropConstraint(options) {\n\t\treturn new DropConstraintCall(options.schema, options.table, options.constraint, options.kind ?? \"unique\").toOp(this.controlAdapterFor(\"dropConstraint\"));\n\t}\n\tdropTable(options) {\n\t\treturn new DropTableCall(options.schema, options.table).toOp(this.controlAdapterFor(\"dropTable\"));\n\t}\n\tdropColumn(options) {\n\t\treturn new DropColumnCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"dropColumn\"));\n\t}\n\talterColumnType(options) {\n\t\treturn new AlterColumnTypeCall(options.schema, options.table, options.column, options.options).toOp(this.controlAdapterFor(\"alterColumnType\"));\n\t}\n\tsetNotNull(options) {\n\t\treturn new SetNotNullCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"setNotNull\"));\n\t}\n\tdropNotNull(options) {\n\t\treturn new DropNotNullCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"dropNotNull\"));\n\t}\n\tsetDefault(options) {\n\t\treturn new SetDefaultCall(options.schema, options.table, options.column, options.defaultSql, options.operationClass).toOp(this.controlAdapterFor(\"setDefault\"));\n\t}\n\tdropDefault(options) {\n\t\treturn new DropDefaultCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"dropDefault\"));\n\t}\n\tcreateIndex(options) {\n\t\treturn new CreateIndexCall(options.schema, options.table, options.index, options.columns !== void 0 ? { columns: options.columns } : { expression: options.expression }, options.extras).toOp(this.controlAdapterFor(\"createIndex\"));\n\t}\n\trenameIndex(options) {\n\t\treturn new RenameIndexCall(options.schema, options.table, options.from, options.to).toOp(this.controlAdapterFor(\"renameIndex\"));\n\t}\n\tdropIndex(options) {\n\t\treturn new DropIndexCall(options.schema, options.table, options.index).toOp(this.controlAdapterFor(\"dropIndex\"));\n\t}\n\tinstallExtension(options) {\n\t\treturn installExtension(options, this.controlAdapterFor(\"installExtension\"));\n\t}\n\tenableRowLevelSecurity(options) {\n\t\treturn new EnableRowLevelSecurityCall(options.schema, options.table).toOp(this.controlAdapterFor(\"enableRowLevelSecurity\"));\n\t}\n\tdisableRowLevelSecurity(options) {\n\t\treturn new DisableRowLevelSecurityCall(options.schema, options.table).toOp(this.controlAdapterFor(\"disableRowLevelSecurity\"));\n\t}\n\tcreateRlsPolicy(options) {\n\t\treturn new CreatePostgresRlsPolicyCall(options.schema, options.table, new PostgresRlsPolicy({\n\t\t\t...options.policy,\n\t\t\tusing: options.policy.using,\n\t\t\twithCheck: options.policy.withCheck\n\t\t})).toOp(this.controlAdapterFor(\"createRlsPolicy\"));\n\t}\n\tdropRlsPolicy(options) {\n\t\treturn new DropPostgresRlsPolicyCall(options.schema, options.table, options.policy).toOp(this.controlAdapterFor(\"dropRlsPolicy\"));\n\t}\n\trenameRlsPolicy(options) {\n\t\treturn new RenamePostgresRlsPolicyCall(options.schema, options.table, options.from, options.to).toOp(this.controlAdapterFor(\"renameRlsPolicy\"));\n\t}\n};\n//#endregion\nexport { PostgresMigration as t };\n\n//# sourceMappingURL=postgres-migration-Dbq3RGfZ.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,IAAI,oBAAoB,cAAc,UAAU;CAC/C,WAAW;;;;;;;CAOX;CACA,WAAW,IAAI,uBAAuB,MAAM,sBAAsB,SAAS,qBAAqB,SAAS,IAAI,CAAC;CAC9G,aAAa,IAAI,uBAAuB,MAAM,sBAAsB,SAAS,qBAAqB,SAAS,IAAI,CAAC;CAChH,YAAY,OAAO;EAClB,MAAM,KAAK;EACX,KAAK,iBAAiB,OAAO,UAAU,MAAM,QAAQ,OAAO,KAAK,IAAI,KAAK;CAC3E;;;;;;CAMA,kBAAkB,WAAW;EAC5B,IAAI,CAAC,KAAK,gBAAgB,MAAM,mCAAmC,SAAS;EAC5E,OAAO,KAAK;CACb;;;;;;CAMA,IAAI,cAAc;EACjB,OAAO,KAAKA,SAAS;CACtB;;;;;CAKA,IAAI,gBAAgB;EACnB,OAAO,KAAKC,WAAW;CACxB;;;;;;CAMA,cAAc,UAAU,MAAM,SAAS;EACtC,OAAO,cAAc,UAAU,MAAM,SAAS,KAAK,kBAAkB,eAAe,CAAC;CACtF;;;;;;CAMA,YAAY,SAAS;EACpB,OAAO,IAAI,gBAAgB,QAAQ,QAAQ,QAAQ,OAAO,QAAQ,SAAS,QAAQ,WAAW,CAAC,CAAC,KAAK,KAAK,kBAAkB,aAAa,CAAC;CAC3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,WAAW,QAAQ,OAAO;EAC3B,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,kBAAkB,iBAAiB,CAAC;CACnD;CACA,cAAc,SAAS;EACtB,OAAO,IAAI,0BAA0B,QAAQ,QAAQ,QAAQ,OAAO,QAAQ,MAAM,CAAC,CAAC,KAAK,KAAK,kBAAkB,eAAe,CAAC;CACjI;CACA,gBAAgB,SAAS;EACxB,OAAO,IAAI,4BAA4B,QAAQ,QAAQ,QAAQ,OAAO,QAAQ,MAAM,QAAQ,EAAE,CAAC,CAAC,KAAK,KAAK,kBAAkB,iBAAiB,CAAC;CAC/I;AACD"}
1
+ {"version":3,"file":"postgres-migration-DRKw86P7-C1eWF86n.mjs","names":["#endView","#startView"],"sources":["../../../../3-targets/3-targets/postgres/dist/postgres-migration-DRKw86P7.mjs"],"sourcesContent":["import { t as errorPostgresMigrationStackMissing } from \"./errors-DYyzTYzE.mjs\";\nimport { _ as PostgresRlsPolicy } from \"./postgres-schema-B3t7Zr52.mjs\";\nimport { A as RenameIndexCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, L as installExtension, M as SetDefaultCall, N as SetNotNullCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, h as CreateTableCall, i as AddNativeEnumValueCall, j as RenamePostgresRlsPolicyCall, k as RenameCheckConstraintCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, p as CreatePostgresRlsPolicyCall, r as AddForeignKeyCall, s as AddPrimaryKeyCall, t as AddCheckConstraintCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from \"./op-factory-call-CSkQdszU.mjs\";\nimport { t as PostgresContractView } from \"./postgres-contract-view-dWcpuV6T.mjs\";\nimport { t as dataTransform } from \"./data-transform-ChZzy2dP.mjs\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { Migration } from \"@internal/family-sql/migration\";\nimport { MigrationContractViews } from \"@internal/migration-tools/migration\";\n//#region src/core/migrations/postgres-migration.ts\n/**\n* Target-owned base class for Postgres migrations.\n*\n* Fixes the `SqlMigration` generic to `PostgresPlanTargetDetails` and the\n* abstract `targetId` to the Postgres target-id string literal, so both\n* user-authored migrations and renderer-generated scaffolds (the output of\n* `renderCallsToTypeScript`) can extend `PostgresMigration` directly without\n* redeclaring target-local identity.\n*\n* Mirrors `MongoMigration` in `@internal/family-mongo`: the renderer\n* emits `extends Migration` against a facade re-export of this class\n* from `@internal/postgres/migration`, keeping the authoring surface\n* target-scoped rather than family-scoped.\n*\n* The constructor materializes a single Postgres `SqlControlAdapter` from\n* `stack.adapter.create(stack)` and stores it; the protected `dataTransform`\n* instance method forwards to the free `dataTransform` factory with that\n* stored adapter, so user migrations can write `this.dataTransform(...)`\n* without threading the adapter through every call.\n*\n* Every method requires an explicit `schema`. Postgres migrations name their\n* schema deliberately — there is no default and no `search_path`-relative\n* option. A migration that left the schema unspecified would resolve against\n* whatever `search_path` the connection happened to carry, and that ambiguity\n* is an antipattern in a migration. (The unbound/unspecified namespace concept\n* remains for SQLite, which has no schemas, and for Mongo's connection `db`.)\n*/\nvar PostgresMigration = class extends Migration {\n\ttargetId = \"postgres\";\n\t/**\n\t* Materialized Postgres control adapter, created once per migration\n\t* instance from the injected stack. `undefined` only when the migration\n\t* was instantiated without a stack (test fixtures); `controlAdapterFor`\n\t* throws a MIGRATION.POSTGRES_CONTROL_STACK_MISSING in that case to surface the misuse.\n\t*/\n\tcontrolAdapter;\n\t#endView = new MigrationContractViews(this, \"PostgresMigration\", (json) => PostgresContractView.fromJson(json));\n\t#startView = new MigrationContractViews(this, \"PostgresMigration\", (json) => PostgresContractView.fromJson(json));\n\tconstructor(stack) {\n\t\tsuper(stack);\n\t\tthis.controlAdapter = stack?.adapter ? stack.adapter.create(stack) : void 0;\n\t}\n\t/**\n\t* Returns the materialized control adapter, or throws a MIGRATION.POSTGRES_CONTROL_STACK_MISSING naming\n\t* `operation` when the migration was constructed without a `ControlStack`.\n\t* Single home for the null-check that every DDL/DML method shares.\n\t*/\n\tcontrolAdapterFor(operation) {\n\t\tif (!this.controlAdapter) throw errorPostgresMigrationStackMissing(operation);\n\t\treturn this.controlAdapter;\n\t}\n\t/**\n\t* The typed, schema-qualified Postgres view over this migration's end-state\n\t* contract — `this.endContract.namespace.<schema>.table.<name>`, etc. Throws\n\t* if no `endContractJson` was provided.\n\t*/\n\tget endContract() {\n\t\treturn this.#endView.endContract;\n\t}\n\t/**\n\t* The typed Postgres view over this migration's start-state contract, or\n\t* `null` for a baseline migration (no `startContractJson`).\n\t*/\n\tget startContract() {\n\t\treturn this.#startView.startContract;\n\t}\n\t/**\n\t* Instance-method wrapper around the free `dataTransform` factory that\n\t* supplies the stored control adapter. Authors call this from inside\n\t* `get operations()`; the adapter argument is hidden from the call site.\n\t*/\n\tdataTransform(contract, name, options) {\n\t\treturn dataTransform(contract, name, options, this.controlAdapterFor(\"dataTransform\"));\n\t}\n\t/**\n\t* Emit a `CREATE TABLE` migration operation. Builds a typed DDL node from\n\t* the supplied options and lowers it through the stored control adapter.\n\t* Throws if no adapter is present (i.e. migration instantiated without a stack).\n\t*/\n\tcreateTable(options) {\n\t\treturn new CreateTableCall(options.schema, options.table, options.columns, options.constraints).toOp(this.controlAdapterFor(\"createTable\"));\n\t}\n\t/**\n\t* Emit a `CREATE SCHEMA` migration operation. Builds a typed DDL node from\n\t* the supplied options and lowers it through the stored control adapter.\n\t* Throws if no adapter is present (i.e. migration instantiated without a stack).\n\t*/\n\tcreateSchema(options) {\n\t\treturn new CreateSchemaCall(options.schema).toOp(this.controlAdapterFor(\"createSchema\"));\n\t}\n\t/**\n\t* Emit a `CREATE TYPE ... AS ENUM (...)` migration operation for a managed\n\t* native enum. Builds a typed DDL node and lowers it through the stored\n\t* control adapter (members render in declaration order). Throws if no adapter\n\t* is present.\n\t*/\n\tcreateNativeEnumType(options) {\n\t\treturn new CreateNativeEnumTypeCall(options.schema, options.typeName, options.members).toOp(this.controlAdapterFor(\"createNativeEnumType\"));\n\t}\n\t/**\n\t* Emit a `DROP TYPE` migration operation for a managed native enum, lowered\n\t* through the stored control adapter. Throws if no adapter is present.\n\t*/\n\tdropNativeEnumType(options) {\n\t\treturn new DropNativeEnumTypeCall(options.schema, options.typeName).toOp(this.controlAdapterFor(\"dropNativeEnumType\"));\n\t}\n\t/**\n\t* Emit an `ALTER TYPE ... ADD VALUE` migration operation appending one\n\t* member to a managed native enum, lowered through the stored control\n\t* adapter. Throws if no adapter is present. Every appended value is its\n\t* own operation — call this once per value to append more than one.\n\t*/\n\taddNativeEnumValue(options) {\n\t\treturn new AddNativeEnumValueCall(options.schema, options.typeName, options.value).toOp(this.controlAdapterFor(\"addNativeEnumValue\"));\n\t}\n\taddColumn(options) {\n\t\treturn new AddColumnCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"addColumn\"));\n\t}\n\taddPrimaryKey(options) {\n\t\treturn new AddPrimaryKeyCall(options.schema, options.table, options.constraint, options.columns).toOp(this.controlAdapterFor(\"addPrimaryKey\"));\n\t}\n\taddUnique(options) {\n\t\treturn new AddUniqueCall(options.schema, options.table, options.constraint, options.columns).toOp(this.controlAdapterFor(\"addUnique\"));\n\t}\n\taddForeignKey(options) {\n\t\treturn new AddForeignKeyCall(options.schema, options.table, options.foreignKey).toOp(this.controlAdapterFor(\"addForeignKey\"));\n\t}\n\taddCheckConstraint(options) {\n\t\treturn new AddCheckConstraintCall(options.schema, options.table, options.constraint, options.expression).toOp(this.controlAdapterFor(\"addCheckConstraint\"));\n\t}\n\trenameCheckConstraint(options) {\n\t\treturn new RenameCheckConstraintCall(options.schema ?? UNBOUND_NAMESPACE_ID, options.table, options.from, options.to).toOp(this.controlAdapterFor(\"renameCheckConstraint\"));\n\t}\n\tdropCheckConstraint(options) {\n\t\treturn new DropCheckConstraintCall(options.schema, options.table, options.constraint).toOp(this.controlAdapterFor(\"dropCheckConstraint\"));\n\t}\n\tdropConstraint(options) {\n\t\treturn new DropConstraintCall(options.schema, options.table, options.constraint, options.kind ?? \"unique\").toOp(this.controlAdapterFor(\"dropConstraint\"));\n\t}\n\tdropTable(options) {\n\t\treturn new DropTableCall(options.schema, options.table).toOp(this.controlAdapterFor(\"dropTable\"));\n\t}\n\tdropColumn(options) {\n\t\treturn new DropColumnCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"dropColumn\"));\n\t}\n\talterColumnType(options) {\n\t\treturn new AlterColumnTypeCall(options.schema, options.table, options.column, options.options).toOp(this.controlAdapterFor(\"alterColumnType\"));\n\t}\n\tsetNotNull(options) {\n\t\treturn new SetNotNullCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"setNotNull\"));\n\t}\n\tdropNotNull(options) {\n\t\treturn new DropNotNullCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"dropNotNull\"));\n\t}\n\tsetDefault(options) {\n\t\treturn new SetDefaultCall(options.schema, options.table, options.column, options.defaultSql, options.operationClass).toOp(this.controlAdapterFor(\"setDefault\"));\n\t}\n\tdropDefault(options) {\n\t\treturn new DropDefaultCall(options.schema, options.table, options.column).toOp(this.controlAdapterFor(\"dropDefault\"));\n\t}\n\tcreateIndex(options) {\n\t\treturn new CreateIndexCall(options.schema, options.table, options.index, options.columns !== void 0 ? { columns: options.columns } : { expression: options.expression }, options.extras).toOp(this.controlAdapterFor(\"createIndex\"));\n\t}\n\trenameIndex(options) {\n\t\treturn new RenameIndexCall(options.schema, options.table, options.from, options.to).toOp(this.controlAdapterFor(\"renameIndex\"));\n\t}\n\tdropIndex(options) {\n\t\treturn new DropIndexCall(options.schema, options.table, options.index).toOp(this.controlAdapterFor(\"dropIndex\"));\n\t}\n\tinstallExtension(options) {\n\t\treturn installExtension(options, this.controlAdapterFor(\"installExtension\"));\n\t}\n\tenableRowLevelSecurity(options) {\n\t\treturn new EnableRowLevelSecurityCall(options.schema, options.table).toOp(this.controlAdapterFor(\"enableRowLevelSecurity\"));\n\t}\n\tdisableRowLevelSecurity(options) {\n\t\treturn new DisableRowLevelSecurityCall(options.schema, options.table).toOp(this.controlAdapterFor(\"disableRowLevelSecurity\"));\n\t}\n\tcreateRlsPolicy(options) {\n\t\treturn new CreatePostgresRlsPolicyCall(options.schema, options.table, new PostgresRlsPolicy({\n\t\t\t...options.policy,\n\t\t\tusing: options.policy.using,\n\t\t\twithCheck: options.policy.withCheck\n\t\t})).toOp(this.controlAdapterFor(\"createRlsPolicy\"));\n\t}\n\tdropRlsPolicy(options) {\n\t\treturn new DropPostgresRlsPolicyCall(options.schema, options.table, options.policy).toOp(this.controlAdapterFor(\"dropRlsPolicy\"));\n\t}\n\trenameRlsPolicy(options) {\n\t\treturn new RenamePostgresRlsPolicyCall(options.schema, options.table, options.from, options.to).toOp(this.controlAdapterFor(\"renameRlsPolicy\"));\n\t}\n};\n//#endregion\nexport { PostgresMigration as t };\n\n//# sourceMappingURL=postgres-migration-DRKw86P7.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,IAAI,oBAAoB,cAAc,UAAU;CAC/C,WAAW;;;;;;;CAOX;CACA,WAAW,IAAI,uBAAuB,MAAM,sBAAsB,SAAS,qBAAqB,SAAS,IAAI,CAAC;CAC9G,aAAa,IAAI,uBAAuB,MAAM,sBAAsB,SAAS,qBAAqB,SAAS,IAAI,CAAC;CAChH,YAAY,OAAO;EAClB,MAAM,KAAK;EACX,KAAK,iBAAiB,OAAO,UAAU,MAAM,QAAQ,OAAO,KAAK,IAAI,KAAK;CAC3E;;;;;;CAMA,kBAAkB,WAAW;EAC5B,IAAI,CAAC,KAAK,gBAAgB,MAAM,mCAAmC,SAAS;EAC5E,OAAO,KAAK;CACb;;;;;;CAMA,IAAI,cAAc;EACjB,OAAO,KAAKA,SAAS;CACtB;;;;;CAKA,IAAI,gBAAgB;EACnB,OAAO,KAAKC,WAAW;CACxB;;;;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wB,SAAS;EAChC,OAAO,IAAI,4BAA4B,QAAQ,QAAQ,QAAQ,KAAK,CAAC,CAAC,KAAK,KAAK,kBAAkB,yBAAyB,CAAC;CAC7H;CACA,gBAAgB,SAAS;EACxB,OAAO,IAAI,4BAA4B,QAAQ,QAAQ,QAAQ,OAAO,IAAI,kBAAkB;GAC3F,GAAG,QAAQ;GACX,OAAO,QAAQ,OAAO;GACtB,WAAW,QAAQ,OAAO;EAC3B,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,kBAAkB,iBAAiB,CAAC;CACnD;CACA,cAAc,SAAS;EACtB,OAAO,IAAI,0BAA0B,QAAQ,QAAQ,QAAQ,OAAO,QAAQ,MAAM,CAAC,CAAC,KAAK,KAAK,kBAAkB,eAAe,CAAC;CACjI;CACA,gBAAgB,SAAS;EACxB,OAAO,IAAI,4BAA4B,QAAQ,QAAQ,QAAQ,OAAO,QAAQ,MAAM,QAAQ,EAAE,CAAC,CAAC,KAAK,KAAK,kBAAkB,iBAAiB,CAAC;CAC/I;AACD"}
@@ -1,6 +1,6 @@
1
- import { x as PG_TEXT_CODEC_ID } from "./codec-ids-C5Rkltkw-DMf87l9s.mjs";
1
+ import { S as PG_TEXT_CODEC_ID } from "./codec-ids-D3ZEAmt2-DjoKUAas.mjs";
2
2
  import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs";
3
- import { t as escapeLiteral } from "./sql-utils-DuzN3JZg-DiXy4Vah.mjs";
3
+ import { t as escapeLiteral } from "./sql-utils-6j9YTLpr-BCyCBPBg.mjs";
4
4
  import { TableSource } from "@prisma/orm-family-sql/relational-core/ast";
5
5
  import { blindCast } from "@prisma/orm-framework/utils/casts";
6
6
  import { UNBOUND_NAMESPACE_ID, freezeNode, hydrateNamespaceEntities } from "@prisma/orm-framework/components/ir";
@@ -11,7 +11,7 @@ import { nameOf, parseNaming } from "@prisma/orm-family-sql/schema-ir/naming";
11
11
  import { invariant } from "@prisma/orm-framework/utils/assertions";
12
12
  import { composeSqlEntityKinds } from "@prisma/orm-family-sql/contract/entity-kinds";
13
13
  import { cfExpr } from "@prisma/orm-family-sql/relational-core/contract-free";
14
- //#region ../../../3-targets/3-targets/postgres/dist/postgres-schema-CF0yHESb.mjs
14
+ //#region ../../../3-targets/3-targets/postgres/dist/postgres-schema-B3t7Zr52.mjs
15
15
  /**
16
16
  * Postgres contract-IR marker for `@@rls` on a model: the table named here is
17
17
  * RLS-controlled (`ENABLE ROW LEVEL SECURITY` is driven by this marker, never
@@ -418,4 +418,4 @@ function postgresCreateNamespace(input) {
418
418
  //#endregion
419
419
  export { roleEntityKind as _, PostgresRlsPolicySchema as a, PostgresSchema as c, isPostgresSchema as d, nativeEnumEntityKind as f, rlsEnablementEntityKind as g, postgresCreateNamespace as h, PostgresRlsPolicy as i, PostgresTableSource as l, policyInputFromSerialized as m, PostgresRlsEnablement as n, PostgresRole as o, policyEntityKind as p, PostgresRlsEnablementSchema as r, PostgresRoleSchema as s, PostgresNativeEnumSchema as t, PostgresUnboundSchema as u };
420
420
 
421
- //# sourceMappingURL=postgres-schema-CF0yHESb-D7n2X21R.mjs.map
421
+ //# sourceMappingURL=postgres-schema-B3t7Zr52-CMlY9aGw.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-schema-CF0yHESb-D7n2X21R.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/postgres-schema-CF0yHESb.mjs"],"sourcesContent":["import { x as PG_TEXT_CODEC_ID } from \"./codec-ids-C5Rkltkw.mjs\";\nimport { t as PostgresNativeEnum } from \"./postgres-native-enum-CdP3b_-R.mjs\";\nimport { t as escapeLiteral } from \"./sql-utils-DuzN3JZg.mjs\";\nimport { TableSource } from \"@internal/sql-relational-core/ast\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID, freezeNode, hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { type } from \"arktype\";\nimport { SqlNamespaceBase, SqlNode } from \"@internal/sql-contract/types\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { nameOf, parseNaming } from \"@internal/sql-schema-ir/naming\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport { composeSqlEntityKinds } from \"@internal/sql-contract/entity-kinds\";\nimport { cfExpr } from \"@internal/sql-relational-core/contract-free\";\n//#region src/core/postgres-rls-enablement.ts\n/**\n* Postgres contract-IR marker for `@@rls` on a model: the table named here is\n* RLS-controlled (`ENABLE ROW LEVEL SECURITY` is driven by this marker, never\n* by the policy set).\n*\n* This is an authored, serialized Contract-IR entity — it is registered as an\n* entity kind, extends `SqlNode`, and is stored in `contract.json` under\n* `entries.rls[tableName]`. Target-only concept — no SQL-family abstract.\n* Frozen at construction via `freezeNode(this)`. The `kind: 'rls'`\n* discriminant is enumerable so it survives JSON serialization; the literal\n* matches the entries key (one-string rule).\n*/\nvar PostgresRlsEnablement = class extends SqlNode {\n\tkind = \"rls\";\n\ttableName;\n\tnamespaceId;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.tableName = input.tableName;\n\t\tthis.namespaceId = input.namespaceId;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/core/postgres-rls-policy.ts\n/**\n* Postgres contract-IR class for a row-level security policy (`CREATE POLICY … ON …`).\n*\n* This is an authored, serialized Contract-IR entity — it is registered as an entity\n* kind, extends `SqlNode`, and is stored in `contract.json`. It is NOT a DiffableNode;\n* the schema-diff tree uses `PostgresPolicySchemaNode` for that role.\n*\n* Target-only concept — no SQL-family abstract. Extends `SqlNode` directly.\n* Frozen at construction via `freezeNode(this)`. The `kind: 'policy'`\n* discriminant is enumerable (overrides SqlNode's non-enumerable `'sql'`) so it\n* survives JSON serialization and enables dispatch. The literal matches the\n* entries key (one-string rule: node.kind === entries key === entity kind).\n*/\nvar PostgresRlsPolicy = class extends SqlNode {\n\tkind = \"policy\";\n\tname;\n\ttableName;\n\tnamespaceId;\n\toperation;\n\troles;\n\tpermissive;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = nameOf(input.naming);\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tthis.tableName = input.tableName;\n\t\tthis.namespaceId = input.namespaceId;\n\t\tthis.operation = input.operation;\n\t\tthis.roles = Object.freeze([...input.roles]);\n\t\tif (input.using !== void 0) this.using = input.using;\n\t\tif (input.withCheck !== void 0) this.withCheck = input.withCheck;\n\t\tthis.permissive = input.permissive;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/core/postgres-role.ts\n/**\n* Roles are referenced by the contract but never owned — the framework\n* issues no `CREATE`/`DROP ROLE`, so a role's effective governance is always\n* `external`: a missing declared role fails verify, an extra live role is\n* tolerated, and the planner emits zero role DDL. `external` is the only\n* value a role's control can ever carry.\n*/\nconst ROLE_DEFAULT_CONTROL_POLICY = \"external\";\n/**\n* Postgres contract-IR class for a database role (`CREATE ROLE …`).\n*\n* This is an authored, serialized Contract-IR entity — it is registered as an entity\n* kind, extends `SqlNode`, and is stored in `contract.json`. It is NOT a DiffableNode;\n* the schema-diff tree uses `PostgresRoleSchemaNode` for that role.\n*\n* Roles are cluster-scoped, so their namespace coordinate is always\n* `UNBOUND_NAMESPACE_ID`. Target-only concept — no SQL-family abstract.\n* Extends `SqlNode` directly, frozen at construction via `freezeNode(this)`.\n* The `kind: 'role'` discriminant is enumerable so it survives JSON.\n* Matches the entries key (one-string rule).\n*\n* `control` always carries a value (never omitted): it defaults to\n* {@link ROLE_DEFAULT_CONTROL_POLICY} in the constructor, so both a\n* freshly-authored role and one hydrated from an older `contract.json`\n* lacking the field resolve the same way — the control-policy resolver\n* reads it directly off the entity instead of special-casing role issues.\n*/\nvar PostgresRole = class extends SqlNode {\n\tkind = \"role\";\n\tname;\n\tnamespaceId;\n\tcontrol;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.namespaceId = input.namespaceId;\n\t\tthis.control = input.control ?? \"external\";\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/core/postgres-validators.ts\nconst PostgresRoleSchema = type({\n\tkind: \"'role'\",\n\tname: \"string\",\n\tnamespaceId: \"string\",\n\t\"control?\": \"'external'\"\n});\nconst PostgresRlsPolicySchema = type({\n\tkind: \"'policy'\",\n\tname: \"string\",\n\t\"prefix?\": \"string\",\n\ttableName: \"string\",\n\tnamespaceId: \"string\",\n\toperation: \"'select' | 'insert' | 'update' | 'delete' | 'all'\",\n\troles: type.string.array().readonly(),\n\t\"using?\": \"string\",\n\t\"withCheck?\": \"string\",\n\tpermissive: \"boolean\"\n});\nconst PostgresRlsEnablementSchema = type({\n\tkind: \"'rls'\",\n\ttableName: \"string\",\n\tnamespaceId: \"string\"\n});\nconst PostgresNativeEnumSchema = type({\n\tkind: \"'postgres-enum'\",\n\ttypeName: \"string\",\n\tmembers: type.string.array().readonly(),\n\t\"control?\": \"'managed' | 'tolerated' | 'external' | 'observed'\"\n});\n//#endregion\n//#region src/core/ast/table-source.ts\nvar PostgresTableSource = class extends TableSource {\n\tschema;\n\tconstructor(options) {\n\t\tsuper(options.name, options.alias);\n\t\tthis.schema = options.schema;\n\t\tthis.freeze();\n\t}\n\trewrite(rewriter) {\n\t\treturn rewriter.tableSource ? rewriter.tableSource(this) : this;\n\t}\n};\n//#endregion\n//#region src/core/serialized-rls-policy.ts\n/**\n* Hydrates one stored policy into constructor input. The name and the prefix\n* are separate fields in the file and can disagree there, so the pair is\n* checked on the way in.\n*/\nfunction policyInputFromSerialized(flat) {\n\treturn {\n\t\tnaming: parseNaming(flat.name, flat.prefix),\n\t\ttableName: flat.tableName,\n\t\tnamespaceId: flat.namespaceId,\n\t\toperation: flat.operation,\n\t\troles: flat.roles,\n\t\tusing: flat.using,\n\t\twithCheck: flat.withCheck,\n\t\tpermissive: flat.permissive\n\t};\n}\n//#endregion\n//#region src/core/entity-kinds.ts\nconst policyEntityKind = {\n\tkind: \"policy\",\n\tschema: PostgresRlsPolicySchema,\n\tconstruct: (input) => new PostgresRlsPolicy(policyInputFromSerialized(input))\n};\nconst roleEntityKind = {\n\tkind: \"role\",\n\tschema: PostgresRoleSchema,\n\tconstruct: (input) => new PostgresRole(input)\n};\nconst rlsEnablementEntityKind = {\n\tkind: \"rls\",\n\tschema: PostgresRlsEnablementSchema,\n\tconstruct: (input) => new PostgresRlsEnablement(input)\n};\nconst nativeEnumEntityKind = {\n\tkind: \"native_enum\",\n\tschema: PostgresNativeEnumSchema,\n\tconstruct: (input) => new PostgresNativeEnum(input)\n};\n//#endregion\n//#region src/core/postgres-schema.ts\n/**\n* Postgres target `Namespace` concretion — a Postgres schema (`CREATE\n* SCHEMA …`). Each Postgres `SqlStorage` carries a\n* `namespaces: Record<NamespaceId, PostgresSchema>` map populated by\n* the Postgres PSL interpreter from `namespace { … }` AST buckets.\n*\n* `entries` holds entity-kind maps (`table`, `valueSet`). Qualifier\n* emission is the rendering seam: DDL / SQL emission asks the namespace\n* for its qualifier (`\"<schema>\"`) or for a qualified table name\n* (`\"<schema>\".\"<table>\"`) and consumes the result polymorphically.\n* The unbound singleton below overrides these methods to elide the\n* prefix entirely — call sites stay polymorphic and never branch on\n* `id === UNBOUND_NAMESPACE_ID`.\n*/\nvar PostgresSchema = class extends SqlNamespaceBase {\n\t/**\n\t* Stable singleton reference for the late-bound slot. Materialised\n\t* lazily below the singleton subclass declaration so the static\n\t* initialiser sees the subclass before assigning. Consumers always\n\t* reach for `PostgresSchema.unbound` (or `PostgresUnboundSchema.instance`\n\t* — same identity).\n\t*/\n\tstatic unbound;\n\tid;\n\tentries;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.id = input.id;\n\t\tconst dispatched = hydrateNamespaceEntities(input.entries, composeSqlEntityKinds([\n\t\t\tpolicyEntityKind,\n\t\t\troleEntityKind,\n\t\t\trlsEnablementEntityKind,\n\t\t\tnativeEnumEntityKind\n\t\t]), \"carry\");\n\t\tconst nativeEnumSlot = dispatched[\"native_enum\"];\n\t\tif (nativeEnumSlot !== void 0) {\n\t\t\tconst rekeyed = {};\n\t\t\tfor (const [handle, entity] of Object.entries(nativeEnumSlot)) {\n\t\t\t\tconst physicalName = PostgresNativeEnum.is(entity) ? entity.typeName : handle;\n\t\t\t\tinvariant(!Object.hasOwn(rekeyed, physicalName), `PostgresSchema \"${input.id}\": two native_enum entities resolve to the same physical type name \"${physicalName}\". Give them distinct @@map type names.`);\n\t\t\t\trekeyed[physicalName] = entity;\n\t\t\t}\n\t\t\tdispatched[\"native_enum\"] = Object.freeze(rekeyed);\n\t\t}\n\t\tconst valueSetRaw = dispatched[\"valueSet\"];\n\t\tconst entriesInput = { ...valueSetRaw !== void 0 && Object.keys(valueSetRaw).length === 0 ? {\n\t\t\t...dispatched,\n\t\t\tvalueSet: void 0\n\t\t} : dispatched };\n\t\tthis.entries = Object.freeze(blindCast(entriesInput));\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"schema\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t\tfreezeNode(this);\n\t}\n\tget table() {\n\t\treturn this.entries.table ?? Object.freeze({});\n\t}\n\tget valueSet() {\n\t\treturn this.entries.valueSet;\n\t}\n\tget policy() {\n\t\treturn this.entries.policy ?? Object.freeze({});\n\t}\n\tget role() {\n\t\treturn this.entries.role ?? Object.freeze({});\n\t}\n\tget rls() {\n\t\treturn this.entries.rls ?? Object.freeze({});\n\t}\n\t/**\n\t* The bare schema qualifier as it would appear in a rendered SQL\n\t* fragment (already quoted). The unbound-schema singleton overrides\n\t* this to return `''`.\n\t*/\n\tqualifier() {\n\t\treturn `\"${this.id}\"`;\n\t}\n\t/**\n\t* Qualify a table name with the schema prefix\n\t* (`\"<schema>\".\"<table>\"`). The unbound-schema singleton overrides\n\t* this to emit just `\"<table>\"` so the resolved DDL is unqualified\n\t* and `search_path` decides where the object lands at runtime.\n\t*/\n\tqualifyTable(tableName) {\n\t\treturn `\"${this.id}\".\"${tableName}\"`;\n\t}\n\t/**\n\t* Render a SQL string-literal containing the qualified-name form\n\t* suitable for `to_regclass(...)` arguments (e.g. `'\"public\".\"user\"'`).\n\t* The unbound singleton overrides this to elide the schema prefix\n\t* (`'\"user\"'`) so `search_path` resolves the object at runtime.\n\t*/\n\tregclassLiteral(name) {\n\t\treturn `'${escapeLiteral(this.qualifyTable(name))}'`;\n\t}\n\t/**\n\t* Render a SQL expression that evaluates to this namespace's schema\n\t* name at runtime, ready to drop into a `WHERE table_schema = …` /\n\t* `WHERE n.nspname = …` clause. Named schemas emit a quoted SQL\n\t* literal (`'public'`); the unbound singleton overrides this to emit\n\t* `current_schema()` so catalog queries match whichever schema the\n\t* connection's `search_path` resolved at runtime.\n\t*/\n\tschemaSqlExpression() {\n\t\treturn `'${escapeLiteral(this.id)}'`;\n\t}\n\t/**\n\t* Typed-AST counterpart of {@link schemaSqlExpression}: the expression a\n\t* builder-built catalog check compares `n.nspname` / `table_schema`\n\t* against. Named schemas bind the schema name as a text parameter; the\n\t* unbound singleton overrides this to the opaque `current_schema()`\n\t* expression so the live connection's `search_path` decides at runtime.\n\t*/\n\tschemaFilterExpression() {\n\t\treturn cfExpr.param(this.id, PG_TEXT_CODEC_ID);\n\t}\n\t/**\n\t* Typed-AST counterpart of {@link qualifyTable}: the FROM source a\n\t* builder-built check uses to address a user table in this namespace.\n\t* Named schemas qualify (`\"schema\".\"table\"`); the unbound singleton\n\t* overrides this to leave the table unqualified so `search_path`\n\t* resolves it at runtime.\n\t*/\n\ttableSource(tableName, alias) {\n\t\treturn new PostgresTableSource({\n\t\t\tname: tableName,\n\t\t\tschema: this.id,\n\t\t\t...ifDefined(\"alias\", alias)\n\t\t});\n\t}\n\t/**\n\t* The bare schema name a DDL planner should target when emitting\n\t* statements that need to identify this namespace in the live\n\t* database (e.g. `CREATE TABLE \"<ddlSchemaName>\".\"<table>\" …`,\n\t* catalog filters, planner conflict lookups). Named schemas resolve\n\t* to their own id. The `PostgresUnboundSchema` singleton inherits\n\t* this and returns `UNBOUND_NAMESPACE_ID` — callers that dispatch\n\t* through `qualifyTableName` route through the polymorphic\n\t* `PostgresUnboundSchema` overrides and produce unqualified\n\t* (search-path-resolved) output automatically.\n\t*/\n\tddlSchemaName(_storage) {\n\t\treturn this.id;\n\t}\n};\n/**\n* Singleton subclass for the reserved sentinel namespace id\n* (`UNBOUND_NAMESPACE_ID`) — the late-bound Postgres slot whose binding\n* the connection's `search_path` resolves at runtime. Overrides\n* qualifier emission to elide the schema prefix; call sites that consume\n* `qualifier()` / `qualifyTable()` get unqualified output without\n* branching on the namespace id.\n*\n* This is the target-side materialization of \"the framework provides\n* affordances; targets implement specifics\": the framework names the\n* sentinel; Postgres decides what late-bound means here (the table\n* name, naked — the schema is supplied by the live connection's\n* `search_path`).\n*\n* `ddlSchemaName` is inherited from `PostgresSchema` and returns\n* `UNBOUND_NAMESPACE_ID`. Downstream helpers such as `qualifyTableName`\n* route through the polymorphic factory and produce unqualified output\n* automatically.\n*/\nvar PostgresUnboundSchema = class PostgresUnboundSchema extends PostgresSchema {\n\tstatic instance = new PostgresUnboundSchema();\n\tconstructor(input) {\n\t\tsuper(input ?? {\n\t\t\tid: UNBOUND_NAMESPACE_ID,\n\t\t\tentries: { table: {} }\n\t\t});\n\t}\n\tqualifier() {\n\t\treturn \"\";\n\t}\n\tqualifyTable(tableName) {\n\t\treturn `\"${tableName}\"`;\n\t}\n\tschemaSqlExpression() {\n\t\treturn \"current_schema()\";\n\t}\n\tschemaFilterExpression() {\n\t\treturn cfExpr.raw(\"current_schema()\", {\n\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\tnullable: false\n\t\t});\n\t}\n\ttableSource(tableName, alias) {\n\t\treturn new PostgresTableSource({\n\t\t\tname: tableName,\n\t\t\t...ifDefined(\"alias\", alias)\n\t\t});\n\t}\n};\nPostgresSchema.unbound = PostgresUnboundSchema.instance;\n/**\n* Narrow an arbitrary namespace (or `undefined`) to `PostgresSchema`\n* so callers can dispatch to the polymorphic emission methods without\n* branching at the call site. Uses the structural `kind` discriminator\n* (`'schema'`) rather than `instanceof` so the check survives realm /\n* bundle / hot-reload boundaries — matching the rest of the IR's\n* narrowing convention. `PostgresUnboundSchema` passes through because\n* it inherits the same `kind: 'schema'` from `PostgresSchema`.\n*/\nfunction isPostgresSchema(ns) {\n\treturn ns?.kind === \"schema\";\n}\n/**\n* Target-supplied `Namespace` factory the Postgres target plumbs\n* through `defineContract({ createNamespace })` and the SQL PSL\n* interpreter. Returns the unbound singleton for the framework\n* sentinel and a fresh `PostgresSchema` for any other coordinate.\n*\n* The factory has no per-call state — every named id deterministically\n* maps to a distinct schema instance — so callers can pass it through\n* by reference and trust the resulting `SqlStorage.namespaces` map to\n* be value-stable for a given input set. Native-enum column type names are\n* schema-qualified earlier, at column construction, via the target's\n* `authoring.qualifyColumnType` hook (`postgresQualifyColumnType`), so this\n* factory just materialises the namespace from already-qualified entries.\n*/\nfunction postgresCreateNamespace(input) {\n\tconst schemaInput = {\n\t\tid: input.id,\n\t\tentries: {\n\t\t\t...input.entries,\n\t\t\ttable: input.entries[\"table\"] ?? {}\n\t\t}\n\t};\n\tif (input.id === UNBOUND_NAMESPACE_ID) return new PostgresUnboundSchema(schemaInput);\n\treturn new PostgresSchema(schemaInput);\n}\n//#endregion\nexport { PostgresRlsPolicy as _, nativeEnumEntityKind as a, roleEntityKind as c, PostgresNativeEnumSchema as d, PostgresRlsEnablementSchema as f, ROLE_DEFAULT_CONTROL_POLICY as g, PostgresRole as h, postgresCreateNamespace as i, policyInputFromSerialized as l, PostgresRoleSchema as m, PostgresUnboundSchema as n, policyEntityKind as o, PostgresRlsPolicySchema as p, isPostgresSchema as r, rlsEnablementEntityKind as s, PostgresSchema as t, PostgresTableSource as u, PostgresRlsEnablement as v };\n\n//# sourceMappingURL=postgres-schema-CF0yHESb.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAI,wBAAwB,cAAc,QAAQ;CACjD,OAAO;CACP;CACA;CACA,YAAY,OAAO;EAClB,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IAAI,gBAAgB;CAC9C;;;;;;;;CAQA,YAAY,WAAW,OAAO;EAC7B,OAAO,IAAI,oBAAoB;GAC9B,MAAM;GACN,QAAQ,KAAK;GACb,GAAG,UAAU,SAAS,KAAK;EAC5B,CAAC;CACF;;;;;;;;;;;;CAYA,cAAc,UAAU;EACvB,OAAO,KAAK;CACb;AACD;;;;;;;;;;;;;;;;;;;;AAoBA,IAAI,wBAAwB,MAAM,8BAA8B,eAAe;CAC9E,OAAO,WAAW,IAAI,sBAAsB;CAC5C,YAAY,OAAO;EAClB,MAAM,SAAS;GACd,IAAI;GACJ,SAAS,EAAE,OAAO,CAAC,EAAE;EACtB,CAAC;CACF;CACA,YAAY;EACX,OAAO;CACR;CACA,aAAa,WAAW;EACvB,OAAO,IAAI,UAAU;CACtB;CACA,sBAAsB;EACrB,OAAO;CACR;CACA,yBAAyB;EACxB,OAAO,OAAO,IAAI,oBAAoB;GACrC,SAAS;GACT,UAAU;EACX,CAAC;CACF;CACA,YAAY,WAAW,OAAO;EAC7B,OAAO,IAAI,oBAAoB;GAC9B,MAAM;GACN,GAAG,UAAU,SAAS,KAAK;EAC5B,CAAC;CACF;AACD;AACA,eAAe,UAAU,sBAAsB;;;;;;;;;;AAU/C,SAAS,iBAAiB,IAAI;CAC7B,OAAO,IAAI,SAAS;AACrB;;;;;;;;;;;;;;;AAeA,SAAS,wBAAwB,OAAO;CACvC,MAAM,cAAc;EACnB,IAAI,MAAM;EACV,SAAS;GACR,GAAG,MAAM;GACT,OAAO,MAAM,QAAQ,YAAY,CAAC;EACnC;CACD;CACA,IAAI,MAAM,OAAO,sBAAsB,OAAO,IAAI,sBAAsB,WAAW;CACnF,OAAO,IAAI,eAAe,WAAW;AACtC"}
1
+ {"version":3,"file":"postgres-schema-B3t7Zr52-CMlY9aGw.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/postgres-schema-B3t7Zr52.mjs"],"sourcesContent":["import { S as PG_TEXT_CODEC_ID } from \"./codec-ids-D3ZEAmt2.mjs\";\nimport { t as PostgresNativeEnum } from \"./postgres-native-enum-CdP3b_-R.mjs\";\nimport { t as escapeLiteral } from \"./sql-utils-6j9YTLpr.mjs\";\nimport { TableSource } from \"@internal/sql-relational-core/ast\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID, freezeNode, hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { type } from \"arktype\";\nimport { SqlNamespaceBase, SqlNode } from \"@internal/sql-contract/types\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { nameOf, parseNaming } from \"@internal/sql-schema-ir/naming\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport { composeSqlEntityKinds } from \"@internal/sql-contract/entity-kinds\";\nimport { cfExpr } from \"@internal/sql-relational-core/contract-free\";\n//#region src/core/postgres-rls-enablement.ts\n/**\n* Postgres contract-IR marker for `@@rls` on a model: the table named here is\n* RLS-controlled (`ENABLE ROW LEVEL SECURITY` is driven by this marker, never\n* by the policy set).\n*\n* This is an authored, serialized Contract-IR entity — it is registered as an\n* entity kind, extends `SqlNode`, and is stored in `contract.json` under\n* `entries.rls[tableName]`. Target-only concept — no SQL-family abstract.\n* Frozen at construction via `freezeNode(this)`. The `kind: 'rls'`\n* discriminant is enumerable so it survives JSON serialization; the literal\n* matches the entries key (one-string rule).\n*/\nvar PostgresRlsEnablement = class extends SqlNode {\n\tkind = \"rls\";\n\ttableName;\n\tnamespaceId;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.tableName = input.tableName;\n\t\tthis.namespaceId = input.namespaceId;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/core/postgres-rls-policy.ts\n/**\n* Postgres contract-IR class for a row-level security policy (`CREATE POLICY … ON …`).\n*\n* This is an authored, serialized Contract-IR entity — it is registered as an entity\n* kind, extends `SqlNode`, and is stored in `contract.json`. It is NOT a DiffableNode;\n* the schema-diff tree uses `PostgresPolicySchemaNode` for that role.\n*\n* Target-only concept — no SQL-family abstract. Extends `SqlNode` directly.\n* Frozen at construction via `freezeNode(this)`. The `kind: 'policy'`\n* discriminant is enumerable (overrides SqlNode's non-enumerable `'sql'`) so it\n* survives JSON serialization and enables dispatch. The literal matches the\n* entries key (one-string rule: node.kind === entries key === entity kind).\n*/\nvar PostgresRlsPolicy = class extends SqlNode {\n\tkind = \"policy\";\n\tname;\n\ttableName;\n\tnamespaceId;\n\toperation;\n\troles;\n\tpermissive;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = nameOf(input.naming);\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tthis.tableName = input.tableName;\n\t\tthis.namespaceId = input.namespaceId;\n\t\tthis.operation = input.operation;\n\t\tthis.roles = Object.freeze([...input.roles]);\n\t\tif (input.using !== void 0) this.using = input.using;\n\t\tif (input.withCheck !== void 0) this.withCheck = input.withCheck;\n\t\tthis.permissive = input.permissive;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/core/postgres-role.ts\n/**\n* Roles are referenced by the contract but never owned — the framework\n* issues no `CREATE`/`DROP ROLE`, so a role's effective governance is always\n* `external`: a missing declared role fails verify, an extra live role is\n* tolerated, and the planner emits zero role DDL. `external` is the only\n* value a role's control can ever carry.\n*/\nconst ROLE_DEFAULT_CONTROL_POLICY = \"external\";\n/**\n* Postgres contract-IR class for a database role (`CREATE ROLE …`).\n*\n* This is an authored, serialized Contract-IR entity — it is registered as an entity\n* kind, extends `SqlNode`, and is stored in `contract.json`. It is NOT a DiffableNode;\n* the schema-diff tree uses `PostgresRoleSchemaNode` for that role.\n*\n* Roles are cluster-scoped, so their namespace coordinate is always\n* `UNBOUND_NAMESPACE_ID`. Target-only concept — no SQL-family abstract.\n* Extends `SqlNode` directly, frozen at construction via `freezeNode(this)`.\n* The `kind: 'role'` discriminant is enumerable so it survives JSON.\n* Matches the entries key (one-string rule).\n*\n* `control` always carries a value (never omitted): it defaults to\n* {@link ROLE_DEFAULT_CONTROL_POLICY} in the constructor, so both a\n* freshly-authored role and one hydrated from an older `contract.json`\n* lacking the field resolve the same way — the control-policy resolver\n* reads it directly off the entity instead of special-casing role issues.\n*/\nvar PostgresRole = class extends SqlNode {\n\tkind = \"role\";\n\tname;\n\tnamespaceId;\n\tcontrol;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.namespaceId = input.namespaceId;\n\t\tthis.control = input.control ?? \"external\";\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/core/postgres-validators.ts\nconst PostgresRoleSchema = type({\n\tkind: \"'role'\",\n\tname: \"string\",\n\tnamespaceId: \"string\",\n\t\"control?\": \"'external'\"\n});\nconst PostgresRlsPolicySchema = type({\n\tkind: \"'policy'\",\n\tname: \"string\",\n\t\"prefix?\": \"string\",\n\ttableName: \"string\",\n\tnamespaceId: \"string\",\n\toperation: \"'select' | 'insert' | 'update' | 'delete' | 'all'\",\n\troles: type.string.array().readonly(),\n\t\"using?\": \"string\",\n\t\"withCheck?\": \"string\",\n\tpermissive: \"boolean\"\n});\nconst PostgresRlsEnablementSchema = type({\n\tkind: \"'rls'\",\n\ttableName: \"string\",\n\tnamespaceId: \"string\"\n});\nconst PostgresNativeEnumSchema = type({\n\tkind: \"'postgres-enum'\",\n\ttypeName: \"string\",\n\tmembers: type.string.array().readonly(),\n\t\"control?\": \"'managed' | 'tolerated' | 'external' | 'observed'\"\n});\n//#endregion\n//#region src/core/ast/table-source.ts\nvar PostgresTableSource = class extends TableSource {\n\tschema;\n\tconstructor(options) {\n\t\tsuper(options.name, options.alias);\n\t\tthis.schema = options.schema;\n\t\tthis.freeze();\n\t}\n\trewrite(rewriter) {\n\t\treturn rewriter.tableSource ? rewriter.tableSource(this) : this;\n\t}\n};\n//#endregion\n//#region src/core/serialized-rls-policy.ts\n/**\n* Hydrates one stored policy into constructor input. The name and the prefix\n* are separate fields in the file and can disagree there, so the pair is\n* checked on the way in.\n*/\nfunction policyInputFromSerialized(flat) {\n\treturn {\n\t\tnaming: parseNaming(flat.name, flat.prefix),\n\t\ttableName: flat.tableName,\n\t\tnamespaceId: flat.namespaceId,\n\t\toperation: flat.operation,\n\t\troles: flat.roles,\n\t\tusing: flat.using,\n\t\twithCheck: flat.withCheck,\n\t\tpermissive: flat.permissive\n\t};\n}\n//#endregion\n//#region src/core/entity-kinds.ts\nconst policyEntityKind = {\n\tkind: \"policy\",\n\tschema: PostgresRlsPolicySchema,\n\tconstruct: (input) => new PostgresRlsPolicy(policyInputFromSerialized(input))\n};\nconst roleEntityKind = {\n\tkind: \"role\",\n\tschema: PostgresRoleSchema,\n\tconstruct: (input) => new PostgresRole(input)\n};\nconst rlsEnablementEntityKind = {\n\tkind: \"rls\",\n\tschema: PostgresRlsEnablementSchema,\n\tconstruct: (input) => new PostgresRlsEnablement(input)\n};\nconst nativeEnumEntityKind = {\n\tkind: \"native_enum\",\n\tschema: PostgresNativeEnumSchema,\n\tconstruct: (input) => new PostgresNativeEnum(input)\n};\n//#endregion\n//#region src/core/postgres-schema.ts\n/**\n* Postgres target `Namespace` concretion — a Postgres schema (`CREATE\n* SCHEMA …`). Each Postgres `SqlStorage` carries a\n* `namespaces: Record<NamespaceId, PostgresSchema>` map populated by\n* the Postgres PSL interpreter from `namespace { … }` AST buckets.\n*\n* `entries` holds entity-kind maps (`table`, `valueSet`). Qualifier\n* emission is the rendering seam: DDL / SQL emission asks the namespace\n* for its qualifier (`\"<schema>\"`) or for a qualified table name\n* (`\"<schema>\".\"<table>\"`) and consumes the result polymorphically.\n* The unbound singleton below overrides these methods to elide the\n* prefix entirely — call sites stay polymorphic and never branch on\n* `id === UNBOUND_NAMESPACE_ID`.\n*/\nvar PostgresSchema = class extends SqlNamespaceBase {\n\t/**\n\t* Stable singleton reference for the late-bound slot. Materialised\n\t* lazily below the singleton subclass declaration so the static\n\t* initialiser sees the subclass before assigning. Consumers always\n\t* reach for `PostgresSchema.unbound` (or `PostgresUnboundSchema.instance`\n\t* — same identity).\n\t*/\n\tstatic unbound;\n\tid;\n\tentries;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.id = input.id;\n\t\tconst dispatched = hydrateNamespaceEntities(input.entries, composeSqlEntityKinds([\n\t\t\tpolicyEntityKind,\n\t\t\troleEntityKind,\n\t\t\trlsEnablementEntityKind,\n\t\t\tnativeEnumEntityKind\n\t\t]), \"carry\");\n\t\tconst nativeEnumSlot = dispatched[\"native_enum\"];\n\t\tif (nativeEnumSlot !== void 0) {\n\t\t\tconst rekeyed = {};\n\t\t\tfor (const [handle, entity] of Object.entries(nativeEnumSlot)) {\n\t\t\t\tconst physicalName = PostgresNativeEnum.is(entity) ? entity.typeName : handle;\n\t\t\t\tinvariant(!Object.hasOwn(rekeyed, physicalName), `PostgresSchema \"${input.id}\": two native_enum entities resolve to the same physical type name \"${physicalName}\". Give them distinct @@map type names.`);\n\t\t\t\trekeyed[physicalName] = entity;\n\t\t\t}\n\t\t\tdispatched[\"native_enum\"] = Object.freeze(rekeyed);\n\t\t}\n\t\tconst valueSetRaw = dispatched[\"valueSet\"];\n\t\tconst entriesInput = { ...valueSetRaw !== void 0 && Object.keys(valueSetRaw).length === 0 ? {\n\t\t\t...dispatched,\n\t\t\tvalueSet: void 0\n\t\t} : dispatched };\n\t\tthis.entries = Object.freeze(blindCast(entriesInput));\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"schema\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t\tfreezeNode(this);\n\t}\n\tget table() {\n\t\treturn this.entries.table ?? Object.freeze({});\n\t}\n\tget valueSet() {\n\t\treturn this.entries.valueSet;\n\t}\n\tget policy() {\n\t\treturn this.entries.policy ?? Object.freeze({});\n\t}\n\tget role() {\n\t\treturn this.entries.role ?? Object.freeze({});\n\t}\n\tget rls() {\n\t\treturn this.entries.rls ?? Object.freeze({});\n\t}\n\t/**\n\t* The bare schema qualifier as it would appear in a rendered SQL\n\t* fragment (already quoted). The unbound-schema singleton overrides\n\t* this to return `''`.\n\t*/\n\tqualifier() {\n\t\treturn `\"${this.id}\"`;\n\t}\n\t/**\n\t* Qualify a table name with the schema prefix\n\t* (`\"<schema>\".\"<table>\"`). The unbound-schema singleton overrides\n\t* this to emit just `\"<table>\"` so the resolved DDL is unqualified\n\t* and `search_path` decides where the object lands at runtime.\n\t*/\n\tqualifyTable(tableName) {\n\t\treturn `\"${this.id}\".\"${tableName}\"`;\n\t}\n\t/**\n\t* Render a SQL string-literal containing the qualified-name form\n\t* suitable for `to_regclass(...)` arguments (e.g. `'\"public\".\"user\"'`).\n\t* The unbound singleton overrides this to elide the schema prefix\n\t* (`'\"user\"'`) so `search_path` resolves the object at runtime.\n\t*/\n\tregclassLiteral(name) {\n\t\treturn `'${escapeLiteral(this.qualifyTable(name))}'`;\n\t}\n\t/**\n\t* Render a SQL expression that evaluates to this namespace's schema\n\t* name at runtime, ready to drop into a `WHERE table_schema = …` /\n\t* `WHERE n.nspname = …` clause. Named schemas emit a quoted SQL\n\t* literal (`'public'`); the unbound singleton overrides this to emit\n\t* `current_schema()` so catalog queries match whichever schema the\n\t* connection's `search_path` resolved at runtime.\n\t*/\n\tschemaSqlExpression() {\n\t\treturn `'${escapeLiteral(this.id)}'`;\n\t}\n\t/**\n\t* Typed-AST counterpart of {@link schemaSqlExpression}: the expression a\n\t* builder-built catalog check compares `n.nspname` / `table_schema`\n\t* against. Named schemas bind the schema name as a text parameter; the\n\t* unbound singleton overrides this to the opaque `current_schema()`\n\t* expression so the live connection's `search_path` decides at runtime.\n\t*/\n\tschemaFilterExpression() {\n\t\treturn cfExpr.param(this.id, PG_TEXT_CODEC_ID);\n\t}\n\t/**\n\t* Typed-AST counterpart of {@link qualifyTable}: the FROM source a\n\t* builder-built check uses to address a user table in this namespace.\n\t* Named schemas qualify (`\"schema\".\"table\"`); the unbound singleton\n\t* overrides this to leave the table unqualified so `search_path`\n\t* resolves it at runtime.\n\t*/\n\ttableSource(tableName, alias) {\n\t\treturn new PostgresTableSource({\n\t\t\tname: tableName,\n\t\t\tschema: this.id,\n\t\t\t...ifDefined(\"alias\", alias)\n\t\t});\n\t}\n\t/**\n\t* The bare schema name a DDL planner should target when emitting\n\t* statements that need to identify this namespace in the live\n\t* database (e.g. `CREATE TABLE \"<ddlSchemaName>\".\"<table>\" …`,\n\t* catalog filters, planner conflict lookups). Named schemas resolve\n\t* to their own id. The `PostgresUnboundSchema` singleton inherits\n\t* this and returns `UNBOUND_NAMESPACE_ID` — callers that dispatch\n\t* through `qualifyTableName` route through the polymorphic\n\t* `PostgresUnboundSchema` overrides and produce unqualified\n\t* (search-path-resolved) output automatically.\n\t*/\n\tddlSchemaName(_storage) {\n\t\treturn this.id;\n\t}\n};\n/**\n* Singleton subclass for the reserved sentinel namespace id\n* (`UNBOUND_NAMESPACE_ID`) — the late-bound Postgres slot whose binding\n* the connection's `search_path` resolves at runtime. Overrides\n* qualifier emission to elide the schema prefix; call sites that consume\n* `qualifier()` / `qualifyTable()` get unqualified output without\n* branching on the namespace id.\n*\n* This is the target-side materialization of \"the framework provides\n* affordances; targets implement specifics\": the framework names the\n* sentinel; Postgres decides what late-bound means here (the table\n* name, naked — the schema is supplied by the live connection's\n* `search_path`).\n*\n* `ddlSchemaName` is inherited from `PostgresSchema` and returns\n* `UNBOUND_NAMESPACE_ID`. Downstream helpers such as `qualifyTableName`\n* route through the polymorphic factory and produce unqualified output\n* automatically.\n*/\nvar PostgresUnboundSchema = class PostgresUnboundSchema extends PostgresSchema {\n\tstatic instance = new PostgresUnboundSchema();\n\tconstructor(input) {\n\t\tsuper(input ?? {\n\t\t\tid: UNBOUND_NAMESPACE_ID,\n\t\t\tentries: { table: {} }\n\t\t});\n\t}\n\tqualifier() {\n\t\treturn \"\";\n\t}\n\tqualifyTable(tableName) {\n\t\treturn `\"${tableName}\"`;\n\t}\n\tschemaSqlExpression() {\n\t\treturn \"current_schema()\";\n\t}\n\tschemaFilterExpression() {\n\t\treturn cfExpr.raw(\"current_schema()\", {\n\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\tnullable: false\n\t\t});\n\t}\n\ttableSource(tableName, alias) {\n\t\treturn new PostgresTableSource({\n\t\t\tname: tableName,\n\t\t\t...ifDefined(\"alias\", alias)\n\t\t});\n\t}\n};\nPostgresSchema.unbound = PostgresUnboundSchema.instance;\n/**\n* Narrow an arbitrary namespace (or `undefined`) to `PostgresSchema`\n* so callers can dispatch to the polymorphic emission methods without\n* branching at the call site. Uses the structural `kind` discriminator\n* (`'schema'`) rather than `instanceof` so the check survives realm /\n* bundle / hot-reload boundaries — matching the rest of the IR's\n* narrowing convention. `PostgresUnboundSchema` passes through because\n* it inherits the same `kind: 'schema'` from `PostgresSchema`.\n*/\nfunction isPostgresSchema(ns) {\n\treturn ns?.kind === \"schema\";\n}\n/**\n* Target-supplied `Namespace` factory the Postgres target plumbs\n* through `defineContract({ createNamespace })` and the SQL PSL\n* interpreter. Returns the unbound singleton for the framework\n* sentinel and a fresh `PostgresSchema` for any other coordinate.\n*\n* The factory has no per-call state — every named id deterministically\n* maps to a distinct schema instance — so callers can pass it through\n* by reference and trust the resulting `SqlStorage.namespaces` map to\n* be value-stable for a given input set. Native-enum column type names are\n* schema-qualified earlier, at column construction, via the target's\n* `authoring.qualifyColumnType` hook (`postgresQualifyColumnType`), so this\n* factory just materialises the namespace from already-qualified entries.\n*/\nfunction postgresCreateNamespace(input) {\n\tconst schemaInput = {\n\t\tid: input.id,\n\t\tentries: {\n\t\t\t...input.entries,\n\t\t\ttable: input.entries[\"table\"] ?? {}\n\t\t}\n\t};\n\tif (input.id === UNBOUND_NAMESPACE_ID) return new PostgresUnboundSchema(schemaInput);\n\treturn new PostgresSchema(schemaInput);\n}\n//#endregion\nexport { PostgresRlsPolicy as _, nativeEnumEntityKind as a, roleEntityKind as c, PostgresNativeEnumSchema as d, PostgresRlsEnablementSchema as f, ROLE_DEFAULT_CONTROL_POLICY as g, PostgresRole as h, postgresCreateNamespace as i, policyInputFromSerialized as l, PostgresRoleSchema as m, PostgresUnboundSchema as n, policyEntityKind as o, PostgresRlsPolicySchema as p, isPostgresSchema as r, rlsEnablementEntityKind as s, PostgresSchema as t, PostgresTableSource as u, PostgresRlsEnablement as v };\n\n//# sourceMappingURL=postgres-schema-B3t7Zr52.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAI,wBAAwB,cAAc,QAAQ;CACjD,OAAO;CACP;CACA;CACA,YAAY,OAAO;EAClB,MAAM;EACN,KAAK,YAAY,MAAM;EACvB,KAAK,cAAc,MAAM;EACzB,WAAW,IAAI;CAChB;AACD;;;;;;;;;;;;;;AAgBA,IAAI,oBAAoB,cAAc,QAAQ;CAC7C,OAAO;CACP;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,OAAO;EAClB,MAAM;EACN,KAAK,OAAO,OAAO,MAAM,MAAM;EAC/B,IAAI,MAAM,OAAO,SAAS,QAAQ,KAAK,SAAS,MAAM,OAAO;EAC7D,KAAK,YAAY,MAAM;EACvB,KAAK,cAAc,MAAM;EACzB,KAAK,YAAY,MAAM;EACvB,KAAK,QAAQ,OAAO,OAAO,CAAC,GAAG,MAAM,KAAK,CAAC;EAC3C,IAAI,MAAM,UAAU,KAAK,GAAG,KAAK,QAAQ,MAAM;EAC/C,IAAI,MAAM,cAAc,KAAK,GAAG,KAAK,YAAY,MAAM;EACvD,KAAK,aAAa,MAAM;EACxB,WAAW,IAAI;CAChB;AACD;;;;;;;;;;;;;;;;;;;;AA8BA,IAAI,eAAe,cAAc,QAAQ;CACxC,OAAO;CACP;CACA;CACA;CACA,YAAY,OAAO;EAClB,MAAM;EACN,KAAK,OAAO,MAAM;EAClB,KAAK,cAAc,MAAM;EACzB,KAAK,UAAU,MAAM,WAAW;EAChC,WAAW,IAAI;CAChB;AACD;AAGA,MAAM,qBAAqB,KAAK;CAC/B,MAAM;CACN,MAAM;CACN,aAAa;CACb,YAAY;AACb,CAAC;AACD,MAAM,0BAA0B,KAAK;CACpC,MAAM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AAM,QAAQ,YAAY,CAAC;EACnC;CACD;CACA,IAAI,MAAM,OAAO,sBAAsB,OAAO,IAAI,sBAAsB,WAAW;CACnF,OAAO,IAAI,eAAe,WAAW;AACtC"}
@@ -1,7 +1,7 @@
1
- import { n as postgresError } from "./errors-DKjQzNaN-DFcF1thx.mjs";
1
+ import { s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
2
2
  import { blindCast } from "@prisma/orm-framework/utils/casts";
3
3
  import { isThenable } from "@prisma/orm-framework/utils/promise";
4
- //#region ../../../3-targets/3-targets/postgres/dist/render-ops-DOsRP0Po.mjs
4
+ //#region ../../../3-targets/3-targets/postgres/dist/render-ops-D2vJApKB.mjs
5
5
  /**
6
6
  * Asserts an op materialised by an `OpFactoryCall` targets postgres. The
7
7
  * extension surface lets any contributor emit calls, so this is the
@@ -31,4 +31,4 @@ function renderOps(calls, lowerer) {
31
31
  //#endregion
32
32
  export { renderOps as t };
33
33
 
34
- //# sourceMappingURL=render-ops-DOsRP0Po-BKn_c_Ia.mjs.map
34
+ //# sourceMappingURL=render-ops-D2vJApKB-B281fzmn.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"render-ops-DOsRP0Po-BKn_c_Ia.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/render-ops-DOsRP0Po.mjs"],"sourcesContent":["import { n as postgresError } from \"./errors-DKjQzNaN.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { isThenable } from \"@internal/utils/promise\";\n//#region src/core/migrations/render-ops.ts\n/**\n* Asserts an op materialised by an `OpFactoryCall` targets postgres. The\n* extension surface lets any contributor emit calls, so this is the\n* integration boundary where a stray non-postgres op would otherwise\n* silently flow through to postgres-shaped renderers — exactly the\n* place to fail loudly with op metadata (`id` + `target.id`).\n*/\nfunction assertPostgresOp(op, callFactoryName) {\n\tconst targetId = blindCast(op).target?.id;\n\tif (targetId !== \"postgres\") throw postgresError(\"MIGRATION.TARGET_MISMATCH\", `renderOps: expected postgres op but got target.id=\"${String(targetId)}\" for op.id=\"${op.id}\" (factoryName=\"${callFactoryName}\"). An OpFactoryCall produced an op for a different target on the postgres planner path; check the call's target binding.`, { meta: {\n\t\topId: op.id,\n\t\ttargetId: String(targetId),\n\t\tfactoryName: callFactoryName\n\t} });\n}\nfunction renderOps(calls, lowerer) {\n\treturn calls.map((c) => {\n\t\tconst opOrPromise = blindCast(c).toOp(lowerer);\n\t\tif (isThenable(opOrPromise)) return opOrPromise.then((op) => {\n\t\t\tassertPostgresOp(op, c.factoryName);\n\t\t\treturn op;\n\t\t});\n\t\tassertPostgresOp(opOrPromise, c.factoryName);\n\t\treturn opOrPromise;\n\t});\n}\n//#endregion\nexport { renderOps as t };\n\n//# sourceMappingURL=render-ops-DOsRP0Po.mjs.map"],"mappings":";;;;;;;;;;;AAWA,SAAS,iBAAiB,IAAI,iBAAiB;CAC9C,MAAM,WAAW,UAAU,EAAE,CAAC,CAAC,QAAQ;CACvC,IAAI,aAAa,YAAY,MAAM,cAAc,6BAA6B,sDAAsD,OAAO,QAAQ,EAAE,eAAe,GAAG,GAAG,kBAAkB,gBAAgB,4HAA4H,EAAE,MAAM;EAC/U,MAAM,GAAG;EACT,UAAU,OAAO,QAAQ;EACzB,aAAa;CACd,EAAE,CAAC;AACJ;AACA,SAAS,UAAU,OAAO,SAAS;CAClC,OAAO,MAAM,KAAK,MAAM;EACvB,MAAM,cAAc,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO;EAC7C,IAAI,WAAW,WAAW,GAAG,OAAO,YAAY,MAAM,OAAO;GAC5D,iBAAiB,IAAI,EAAE,WAAW;GAClC,OAAO;EACR,CAAC;EACD,iBAAiB,aAAa,EAAE,WAAW;EAC3C,OAAO;CACR,CAAC;AACF"}
1
+ {"version":3,"file":"render-ops-D2vJApKB-B281fzmn.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/render-ops-D2vJApKB.mjs"],"sourcesContent":["import { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { isThenable } from \"@internal/utils/promise\";\n//#region src/core/migrations/render-ops.ts\n/**\n* Asserts an op materialised by an `OpFactoryCall` targets postgres. The\n* extension surface lets any contributor emit calls, so this is the\n* integration boundary where a stray non-postgres op would otherwise\n* silently flow through to postgres-shaped renderers — exactly the\n* place to fail loudly with op metadata (`id` + `target.id`).\n*/\nfunction assertPostgresOp(op, callFactoryName) {\n\tconst targetId = blindCast(op).target?.id;\n\tif (targetId !== \"postgres\") throw postgresError(\"MIGRATION.TARGET_MISMATCH\", `renderOps: expected postgres op but got target.id=\"${String(targetId)}\" for op.id=\"${op.id}\" (factoryName=\"${callFactoryName}\"). An OpFactoryCall produced an op for a different target on the postgres planner path; check the call's target binding.`, { meta: {\n\t\topId: op.id,\n\t\ttargetId: String(targetId),\n\t\tfactoryName: callFactoryName\n\t} });\n}\nfunction renderOps(calls, lowerer) {\n\treturn calls.map((c) => {\n\t\tconst opOrPromise = blindCast(c).toOp(lowerer);\n\t\tif (isThenable(opOrPromise)) return opOrPromise.then((op) => {\n\t\t\tassertPostgresOp(op, c.factoryName);\n\t\t\treturn op;\n\t\t});\n\t\tassertPostgresOp(opOrPromise, c.factoryName);\n\t\treturn opOrPromise;\n\t});\n}\n//#endregion\nexport { renderOps as t };\n\n//# sourceMappingURL=render-ops-D2vJApKB.mjs.map"],"mappings":";;;;;;;;;;;AAWA,SAAS,iBAAiB,IAAI,iBAAiB;CAC9C,MAAM,WAAW,UAAU,EAAE,CAAC,CAAC,QAAQ;CACvC,IAAI,aAAa,YAAY,MAAM,cAAc,6BAA6B,sDAAsD,OAAO,QAAQ,EAAE,eAAe,GAAG,GAAG,kBAAkB,gBAAgB,4HAA4H,EAAE,MAAM;EAC/U,MAAM,GAAG;EACT,UAAU,OAAO,QAAQ;EACzB,aAAa;CACd,EAAE,CAAC;AACJ;AACA,SAAS,UAAU,OAAO,SAAS;CAClC,OAAO,MAAM,KAAK,MAAM;EACvB,MAAM,cAAc,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO;EAC7C,IAAI,WAAW,WAAW,GAAG,OAAO,YAAY,MAAM,OAAO;GAC5D,iBAAiB,IAAI,EAAE,WAAW;GAClC,OAAO;EACR,CAAC;EACD,iBAAiB,aAAa,EAAE,WAAW;EAC3C,OAAO;CACR,CAAC;AACF"}
@@ -1,7 +1,7 @@
1
1
  import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs";
2
- import { d as isPostgresSchema } from "./postgres-schema-CF0yHESb-D7n2X21R.mjs";
2
+ import { d as isPostgresSchema } from "./postgres-schema-B3t7Zr52-CMlY9aGw.mjs";
3
3
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
4
- //#region ../../../3-targets/3-targets/postgres/dist/resolve-ddl-schema-CoaeNP35.mjs
4
+ //#region ../../../3-targets/3-targets/postgres/dist/resolve-ddl-schema-Cab6g5MC.mjs
5
5
  /**
6
6
  * Given the contract's storage and a namespace id, returns the live Postgres
7
7
  * DDL schema name that namespace maps to. A named Postgres namespace dispatches
@@ -19,4 +19,4 @@ function resolveDdlSchemaForNamespaceStorage(storage, namespaceId) {
19
19
  //#endregion
20
20
  export { resolveDdlSchemaForNamespaceStorage as t };
21
21
 
22
- //# sourceMappingURL=resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs.map
22
+ //# sourceMappingURL=resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/resolve-ddl-schema-CoaeNP35.mjs"],"sourcesContent":["import { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { r as isPostgresSchema } from \"./postgres-schema-CF0yHESb.mjs\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\n//#region src/core/migrations/resolve-ddl-schema.ts\n/**\n* Given the contract's storage and a namespace id, returns the live Postgres\n* DDL schema name that namespace maps to. A named Postgres namespace dispatches\n* to its `ddlSchemaName(storage)`; the unbound sentinel resolves to\n* `DEFAULT_NAMESPACE_ID` (the search-path default for offline planning); a\n* bare object payload (used by some tests) falls back to the namespace id\n* itself.\n*/\nfunction resolveDdlSchemaForNamespaceStorage(storage, namespaceId) {\n\tif (namespaceId === UNBOUND_NAMESPACE_ID) return DEFAULT_NAMESPACE_ID;\n\tconst namespace = storage.namespaces[namespaceId];\n\tif (namespace && isPostgresSchema(namespace)) return namespace.ddlSchemaName(storage);\n\treturn namespaceId;\n}\n//#endregion\nexport { resolveDdlSchemaForNamespaceStorage as t };\n\n//# sourceMappingURL=resolve-ddl-schema-CoaeNP35.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,oCAAoC,SAAS,aAAa;CAClE,IAAI,gBAAgB,sBAAsB,OAAO;CACjD,MAAM,YAAY,QAAQ,WAAW;CACrC,IAAI,aAAa,iBAAiB,SAAS,GAAG,OAAO,UAAU,cAAc,OAAO;CACpF,OAAO;AACR"}
1
+ {"version":3,"file":"resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/resolve-ddl-schema-Cab6g5MC.mjs"],"sourcesContent":["import { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { r as isPostgresSchema } from \"./postgres-schema-B3t7Zr52.mjs\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\n//#region src/core/migrations/resolve-ddl-schema.ts\n/**\n* Given the contract's storage and a namespace id, returns the live Postgres\n* DDL schema name that namespace maps to. A named Postgres namespace dispatches\n* to its `ddlSchemaName(storage)`; the unbound sentinel resolves to\n* `DEFAULT_NAMESPACE_ID` (the search-path default for offline planning); a\n* bare object payload (used by some tests) falls back to the namespace id\n* itself.\n*/\nfunction resolveDdlSchemaForNamespaceStorage(storage, namespaceId) {\n\tif (namespaceId === UNBOUND_NAMESPACE_ID) return DEFAULT_NAMESPACE_ID;\n\tconst namespace = storage.namespaces[namespaceId];\n\tif (namespace && isPostgresSchema(namespace)) return namespace.ddlSchemaName(storage);\n\treturn namespaceId;\n}\n//#endregion\nexport { resolveDdlSchemaForNamespaceStorage as t };\n\n//# sourceMappingURL=resolve-ddl-schema-Cab6g5MC.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,oCAAoC,SAAS,aAAa;CAClE,IAAI,gBAAgB,sBAAsB,OAAO;CACjD,MAAM,YAAY,QAAQ,WAAW;CACrC,IAAI,aAAa,iBAAiB,SAAS,GAAG,OAAO,UAAU,cAAc,OAAO;CACpF,OAAO;AACR"}
@@ -1,5 +1,5 @@
1
1
  import { t as PostgresContract } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
2
- import { l as PostgresLoweredStatement } from "./types-CkryN1AS-BcQRGsDn.mjs";
2
+ import { l as PostgresLoweredStatement } from "./types-CkryN1AS-CZtzRJFZ.mjs";
3
3
  import { Adapter, AnyQueryAst } from "@prisma/orm-family-sql/relational-core/ast";
4
4
  import { SqlRuntimeAdapterDescriptor } from "@prisma/orm-family-sql/runtime";
5
5
  import { RuntimeAdapterInstance } from "@prisma/orm-framework/components/execution";
@@ -9,4 +9,4 @@ interface SqlRuntimeAdapter extends RuntimeAdapterInstance<'sql', 'postgres'>, A
9
9
  declare const postgresRuntimeAdapterDescriptor: SqlRuntimeAdapterDescriptor<'postgres', SqlRuntimeAdapter>;
10
10
  //#endregion
11
11
  export { postgresRuntimeAdapterDescriptor as n, SqlRuntimeAdapter as t };
12
- //# sourceMappingURL=runtime-DOXznQe0.d.mts.map
12
+ //# sourceMappingURL=runtime-BdRKoWQu.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-DOXznQe0.d.mts","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/runtime.d.mts"],"mappings":";;;;;;;UAKU,0BAA0B,2CAA2C,QAAQ,aAAa,kBAAkB;cACxG,kCAAkC,wCAAwC"}
1
+ {"version":3,"file":"runtime-BdRKoWQu.d.mts","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/runtime.d.mts"],"mappings":";;;;;;;UAKU,0BAA0B,2CAA2C,QAAQ,aAAa,kBAAkB;cACxG,kCAAkC,wCAAwC"}