@prisma/orm-target-postgres 8.0.0-rc.16-dev.4 → 8.0.0-rc.16-dev.5

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 (112) hide show
  1. package/dist/{adapter-RtS8vD8U-BvmL3EaF.mjs → adapter-RtS8vD8U-m4U_WTpQ.mjs} +5 -5
  2. package/dist/{adapter-RtS8vD8U-BvmL3EaF.mjs.map → adapter-RtS8vD8U-m4U_WTpQ.mjs.map} +1 -1
  3. package/dist/adapter.mjs +5 -5
  4. package/dist/adapter__adapter.mjs +2 -2
  5. package/dist/adapter__control.mjs +6 -6
  6. package/dist/adapter__runtime.mjs +4 -4
  7. package/dist/adapter__sql-renderer.mjs +1 -1
  8. package/dist/{authoring-CfPWv_-P-BHAGgGYI.mjs → authoring-vHbPLrW4-BsHR7gUE.mjs} +5 -5
  9. package/dist/{authoring-CfPWv_-P-BHAGgGYI.mjs.map → authoring-vHbPLrW4-BsHR7gUE.mjs.map} +1 -1
  10. package/dist/{check-expressions-BRuSxJ5d-CC5OFfR1.mjs → check-expressions-Dlt334zg-CV5Vkh3G.mjs} +3 -3
  11. package/dist/{check-expressions-BRuSxJ5d-CC5OFfR1.mjs.map → check-expressions-Dlt334zg-CV5Vkh3G.mjs.map} +1 -1
  12. package/dist/{codec-registry-CyhMngN6-BlKEiEni.mjs → codec-registry-nSGjxm-H-BeUu5zV2.mjs} +4 -4
  13. package/dist/{codec-registry-CyhMngN6-BlKEiEni.mjs.map → codec-registry-nSGjxm-H-BeUu5zV2.mjs.map} +1 -1
  14. package/dist/{codecs-hSJgX8qY-fZSDQFIE.mjs → codecs-DelwJv6h-CFbyTJIJ.mjs} +3 -3
  15. package/dist/{codecs-hSJgX8qY-fZSDQFIE.mjs.map → codecs-DelwJv6h-CFbyTJIJ.mjs.map} +1 -1
  16. package/dist/{contract-free-DlLLhKi4.d.mts → contract-free-DY8vDIxh.d.mts} +19 -2
  17. package/dist/contract-free-DY8vDIxh.d.mts.map +1 -0
  18. package/dist/{contract-free-DAGgx1J-.mjs → contract-free-DaK6wmmo.mjs} +3 -3
  19. package/dist/contract-free-DaK6wmmo.mjs.map +1 -0
  20. package/dist/{control-BVAy0J9w.mjs → control-YKrabf1Q.mjs} +11 -11
  21. package/dist/{control-BVAy0J9w.mjs.map → control-YKrabf1Q.mjs.map} +1 -1
  22. package/dist/{control-adapter-Co30P4lH-B8vk7fsI.mjs → control-adapter-Co30P4lH-B5euUoQ4.mjs} +6 -6
  23. package/dist/{control-adapter-Co30P4lH-B8vk7fsI.mjs.map → control-adapter-Co30P4lH-B5euUoQ4.mjs.map} +1 -1
  24. package/dist/{control-policy-C16wMazs-O_wlPuFC.mjs → control-policy-bwcdB78Y-DgRaWAzu.mjs} +16 -22
  25. package/dist/control-policy-bwcdB78Y-DgRaWAzu.mjs.map +1 -0
  26. package/dist/{data-type-entries-C2zpNOAQ-BJh8QNDa.mjs → data-type-entries-DgKLUrqt-TKDikzti.mjs} +3 -3
  27. package/dist/{data-type-entries-C2zpNOAQ-BJh8QNDa.mjs.map → data-type-entries-DgKLUrqt-TKDikzti.mjs.map} +1 -1
  28. package/dist/{data-types-BRBW3ouc-ZtyZE7nE.mjs → data-types-k3Ebk3kj-DWk3nh_k.mjs} +3 -3
  29. package/dist/{data-types-BRBW3ouc-ZtyZE7nE.mjs.map → data-types-k3Ebk3kj-DWk3nh_k.mjs.map} +1 -1
  30. package/dist/{ddl-BzsT_-qY-Cdzm0YIK.mjs → ddl-C_vTj7b5-vyGLBKLo.mjs} +50 -5
  31. package/dist/ddl-C_vTj7b5-vyGLBKLo.mjs.map +1 -0
  32. package/dist/default-constraint-names-CtcRXhV8-nz3ff6b8.mjs +18 -0
  33. package/dist/default-constraint-names-CtcRXhV8-nz3ff6b8.mjs.map +1 -0
  34. package/dist/{descriptor-meta-ARufwwWW-DUiQQsOX.mjs → descriptor-meta-ARufwwWW-DMQsPNAl.mjs} +3 -3
  35. package/dist/{descriptor-meta-ARufwwWW-DUiQQsOX.mjs.map → descriptor-meta-ARufwwWW-DMQsPNAl.mjs.map} +1 -1
  36. package/dist/{descriptor-meta-Dp8tWKKU-5RiFTCA_.mjs → descriptor-meta-BgOMP4hF-CfUJsgjc.mjs} +8 -8
  37. package/dist/{descriptor-meta-Dp8tWKKU-5RiFTCA_.mjs.map → descriptor-meta-BgOMP4hF-CfUJsgjc.mjs.map} +1 -1
  38. package/dist/{descriptor-meta-runtime-BycwK4wx-CuDo_Atu.mjs → descriptor-meta-runtime-CG2S236D-CUkzqeCr.mjs} +3 -3
  39. package/dist/{descriptor-meta-runtime-BycwK4wx-CuDo_Atu.mjs.map → descriptor-meta-runtime-CG2S236D-CUkzqeCr.mjs.map} +1 -1
  40. package/dist/{diff-database-schema-DRPIV4Ae-BSY-cBm0.mjs → diff-database-schema-zc7d2uxC-BVe8D7vG.mjs} +5 -5
  41. package/dist/{diff-database-schema-DRPIV4Ae-BSY-cBm0.mjs.map → diff-database-schema-zc7d2uxC-BVe8D7vG.mjs.map} +1 -1
  42. package/dist/{full-text-index-expression-2O1p7zJA--CcXJUdq.mjs → full-text-index-expression-BpUM2Td6-2Q7y7DnO.mjs} +4 -4
  43. package/dist/{full-text-index-expression-2O1p7zJA--CcXJUdq.mjs.map → full-text-index-expression-BpUM2Td6-2Q7y7DnO.mjs.map} +1 -1
  44. package/dist/{infer-psl-contract-shHWsRbe-C65aVFOB.mjs → infer-psl-contract-B5yExD61-Cmye68li.mjs} +6 -6
  45. package/dist/{infer-psl-contract-shHWsRbe-C65aVFOB.mjs.map → infer-psl-contract-B5yExD61-Cmye68li.mjs.map} +1 -1
  46. package/dist/migration-PTHAY9Cv.mjs.map +1 -1
  47. package/dist/{op-factory-call-B-4nf1jC-DkRw5e1q.mjs → op-factory-call-DdXVWQlV-DzfLhTkh.mjs} +70 -18
  48. package/dist/op-factory-call-DdXVWQlV-DzfLhTkh.mjs.map +1 -0
  49. package/dist/{planner-B5wkfdZ_-bckhSgt5.mjs → planner-ZmK0aNuY-Cak-8zwa.mjs} +16 -12
  50. package/dist/planner-ZmK0aNuY-Cak-8zwa.mjs.map +1 -0
  51. package/dist/{planner-ddl-builders-ClaAKDuZ-DpDBj2cs.mjs → planner-ddl-builders-DRProi99-D0K5ZiD0.mjs} +44 -14
  52. package/dist/planner-ddl-builders-DRProi99-D0K5ZiD0.mjs.map +1 -0
  53. package/dist/{planner-identity-values-BZpK0CdX-BJo672Ml.mjs → planner-identity-values-C1eV916m-D0p3EfYc.mjs} +3 -3
  54. package/dist/{planner-identity-values-BZpK0CdX-BJo672Ml.mjs.map → planner-identity-values-C1eV916m-D0p3EfYc.mjs.map} +1 -1
  55. package/dist/{planner-produced-postgres-migration-B3dM0fTf-XkTUm5wR.mjs → planner-produced-postgres-migration-BAWQ6iqr-C06XurYw.mjs} +3 -3
  56. package/dist/{planner-produced-postgres-migration-B3dM0fTf-XkTUm5wR.mjs.map → planner-produced-postgres-migration-BAWQ6iqr-C06XurYw.mjs.map} +1 -1
  57. package/dist/{planner-sql-checks-Bhp0Iq_X-DwwIxJHj.mjs → planner-sql-checks-rqOH8naU-B6xOE5lC.mjs} +4 -4
  58. package/dist/{planner-sql-checks-Bhp0Iq_X-DwwIxJHj.mjs.map → planner-sql-checks-rqOH8naU-B6xOE5lC.mjs.map} +1 -1
  59. package/dist/{postgres-contract-view-rT0ZLNqw-DThfALEV.mjs → postgres-contract-view-B0KloSYp-Cbbl_pIv.mjs} +6 -6
  60. package/dist/{postgres-contract-view-rT0ZLNqw-DThfALEV.mjs.map → postgres-contract-view-B0KloSYp-Cbbl_pIv.mjs.map} +1 -1
  61. package/dist/{postgres-migration-CmD95Eh_-DGLByWZD.mjs → postgres-migration-UVh2xeV0-DW8V_8aj.mjs} +84 -58
  62. package/dist/postgres-migration-UVh2xeV0-DW8V_8aj.mjs.map +1 -0
  63. package/dist/postgres-object-name-FPikIvOw-BNs44hTu.mjs +23 -0
  64. package/dist/postgres-object-name-FPikIvOw-BNs44hTu.mjs.map +1 -0
  65. package/dist/{postgres-schema-DXd0mebY-CExd_GcQ.mjs → postgres-schema-AlEVkXXS-ZfXWYddl.mjs} +3 -3
  66. package/dist/{postgres-schema-DXd0mebY-CExd_GcQ.mjs.map → postgres-schema-AlEVkXXS-ZfXWYddl.mjs.map} +1 -1
  67. package/dist/{prisma7-binding-DNckHEx8.d.mts → prisma7-binding-FvF1AZxQ.d.mts} +11 -1
  68. package/dist/prisma7-binding-FvF1AZxQ.d.mts.map +1 -0
  69. package/dist/{prisma7-binding-CArLf1qk.mjs → prisma7-binding-GebhdAGS.mjs} +11 -6
  70. package/dist/prisma7-binding-GebhdAGS.mjs.map +1 -0
  71. package/dist/{resolve-ddl-schema-CadTChyu-C7F31wpN.mjs → resolve-ddl-schema-BthOWVjF-DuZ9iUh-.mjs} +3 -3
  72. package/dist/{resolve-ddl-schema-CadTChyu-C7F31wpN.mjs.map → resolve-ddl-schema-BthOWVjF-DuZ9iUh-.mjs.map} +1 -1
  73. package/dist/{sql-renderer-DT4IEOVi-G0Q8NmyB.mjs → sql-renderer-DT4IEOVi-CE0YIu9V.mjs} +3 -3
  74. package/dist/{sql-renderer-DT4IEOVi-G0Q8NmyB.mjs.map → sql-renderer-DT4IEOVi-CE0YIu9V.mjs.map} +1 -1
  75. package/dist/{sql-utils-BMXJi06b-CAQOplfq.mjs → sql-utils-CVsvXiX4-C7xD0Bgv.mjs} +5 -9
  76. package/dist/sql-utils-CVsvXiX4-C7xD0Bgv.mjs.map +1 -0
  77. package/dist/target.d.mts +3 -3
  78. package/dist/target.mjs +25 -25
  79. package/dist/target__codecs.mjs +2 -2
  80. package/dist/target__contract-free.d.mts +2 -2
  81. package/dist/target__contract-free.mjs +4 -4
  82. package/dist/target__control.mjs +3 -3
  83. package/dist/target__data-types.mjs +2 -2
  84. package/dist/target__diff-database-schema.mjs +1 -1
  85. package/dist/target__issue-planner.mjs +1 -1
  86. package/dist/target__migration.mjs +2 -2
  87. package/dist/target__op-factory-call.mjs +1 -1
  88. package/dist/target__pack.mjs +1 -1
  89. package/dist/target__planner-ddl-builders.mjs +1 -1
  90. package/dist/target__planner-identity-values.mjs +1 -1
  91. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  92. package/dist/target__planner-sql-checks.mjs +1 -1
  93. package/dist/target__planner.mjs +2 -2
  94. package/dist/target__prisma7-binding.d.mts +1 -1
  95. package/dist/target__prisma7-binding.mjs +1 -1
  96. package/dist/target__runtime.mjs +3 -3
  97. package/dist/target__runtime.mjs.map +1 -1
  98. package/dist/target__schema-ir-annotations.mjs +1 -1
  99. package/dist/target__sql-utils.mjs +2 -2
  100. package/dist/target__types.mjs +2 -2
  101. package/package.json +9 -9
  102. package/dist/contract-free-DAGgx1J-.mjs.map +0 -1
  103. package/dist/contract-free-DlLLhKi4.d.mts.map +0 -1
  104. package/dist/control-policy-C16wMazs-O_wlPuFC.mjs.map +0 -1
  105. package/dist/ddl-BzsT_-qY-Cdzm0YIK.mjs.map +0 -1
  106. package/dist/op-factory-call-B-4nf1jC-DkRw5e1q.mjs.map +0 -1
  107. package/dist/planner-B5wkfdZ_-bckhSgt5.mjs.map +0 -1
  108. package/dist/planner-ddl-builders-ClaAKDuZ-DpDBj2cs.mjs.map +0 -1
  109. package/dist/postgres-migration-CmD95Eh_-DGLByWZD.mjs.map +0 -1
  110. package/dist/prisma7-binding-CArLf1qk.mjs.map +0 -1
  111. package/dist/prisma7-binding-DNckHEx8.d.mts.map +0 -1
  112. package/dist/sql-utils-BMXJi06b-CAQOplfq.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"descriptor-meta-ARufwwWW-DUiQQsOX.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/descriptor-meta-ARufwwWW.mjs"],"sourcesContent":["import { n as postgresAdapterCapabilities } from \"./control-adapter-Co30P4lH.mjs\";\nimport { postgresCodecRegistry } from \"@internal/target-postgres/codecs\";\nimport { postgresAggregateDescriptors } from \"@internal/target-postgres/aggregates\";\n//#region src/core/descriptor-meta.ts\n/** Creates a type import spec for codec types */\nconst codecTypeImport = (named) => ({\n\tpackage: \"@internal/target-postgres/codec-types\",\n\tnamed,\n\talias: named\n});\nconst postgresAdapterDescriptorMeta = {\n\tkind: \"adapter\",\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tid: \"postgres\",\n\tversion: \"0.0.1\",\n\tcapabilities: postgresAdapterCapabilities,\n\ttypes: {\n\t\taggregateDescriptors: postgresAggregateDescriptors,\n\t\tcodecTypes: {\n\t\t\tcodecDescriptors: Array.from(postgresCodecRegistry.values()),\n\t\t\timport: {\n\t\t\t\tpackage: \"@internal/target-postgres/codec-types\",\n\t\t\t\tnamed: \"CodecTypes\",\n\t\t\t\talias: \"PgTypes\"\n\t\t\t},\n\t\t\ttypeImports: [\n\t\t\t\t{\n\t\t\t\t\tpackage: \"@internal/target-postgres/codec-types\",\n\t\t\t\t\tnamed: \"JsonValue\",\n\t\t\t\t\talias: \"JsonValue\"\n\t\t\t\t},\n\t\t\t\tcodecTypeImport(\"Char\"),\n\t\t\t\tcodecTypeImport(\"Varchar\"),\n\t\t\t\tcodecTypeImport(\"Numeric\"),\n\t\t\t\tcodecTypeImport(\"Bit\"),\n\t\t\t\tcodecTypeImport(\"VarBit\"),\n\t\t\t\tcodecTypeImport(\"Timestamp\"),\n\t\t\t\tcodecTypeImport(\"Timestamptz\"),\n\t\t\t\tcodecTypeImport(\"Time\"),\n\t\t\t\tcodecTypeImport(\"Timetz\"),\n\t\t\t\tcodecTypeImport(\"Interval\"),\n\t\t\t\tcodecTypeImport(\"TimestampString\"),\n\t\t\t\tcodecTypeImport(\"TimestamptzString\"),\n\t\t\t\tcodecTypeImport(\"TimeString\")\n\t\t\t]\n\t\t}\n\t}\n};\n//#endregion\nexport { postgresAdapterDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-ARufwwWW.mjs.map"],"mappings":";;;;;AAKA,MAAM,mBAAmB,WAAW;CACnC,SAAS;CACT;CACA,OAAO;AACR;AACA,MAAM,gCAAgC;CACrC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc;CACd,OAAO;EACN,sBAAsB;EACtB,YAAY;GACX,kBAAkB,MAAM,KAAK,sBAAsB,OAAO,CAAC;GAC3D,QAAQ;IACP,SAAS;IACT,OAAO;IACP,OAAO;GACR;GACA,aAAa;IACZ;KACC,SAAS;KACT,OAAO;KACP,OAAO;IACR;IACA,gBAAgB,MAAM;IACtB,gBAAgB,SAAS;IACzB,gBAAgB,SAAS;IACzB,gBAAgB,KAAK;IACrB,gBAAgB,QAAQ;IACxB,gBAAgB,WAAW;IAC3B,gBAAgB,aAAa;IAC7B,gBAAgB,MAAM;IACtB,gBAAgB,QAAQ;IACxB,gBAAgB,UAAU;IAC1B,gBAAgB,iBAAiB;IACjC,gBAAgB,mBAAmB;IACnC,gBAAgB,YAAY;GAC7B;EACD;CACD;AACD"}
1
+ {"version":3,"file":"descriptor-meta-ARufwwWW-DMQsPNAl.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/descriptor-meta-ARufwwWW.mjs"],"sourcesContent":["import { n as postgresAdapterCapabilities } from \"./control-adapter-Co30P4lH.mjs\";\nimport { postgresCodecRegistry } from \"@internal/target-postgres/codecs\";\nimport { postgresAggregateDescriptors } from \"@internal/target-postgres/aggregates\";\n//#region src/core/descriptor-meta.ts\n/** Creates a type import spec for codec types */\nconst codecTypeImport = (named) => ({\n\tpackage: \"@internal/target-postgres/codec-types\",\n\tnamed,\n\talias: named\n});\nconst postgresAdapterDescriptorMeta = {\n\tkind: \"adapter\",\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tid: \"postgres\",\n\tversion: \"0.0.1\",\n\tcapabilities: postgresAdapterCapabilities,\n\ttypes: {\n\t\taggregateDescriptors: postgresAggregateDescriptors,\n\t\tcodecTypes: {\n\t\t\tcodecDescriptors: Array.from(postgresCodecRegistry.values()),\n\t\t\timport: {\n\t\t\t\tpackage: \"@internal/target-postgres/codec-types\",\n\t\t\t\tnamed: \"CodecTypes\",\n\t\t\t\talias: \"PgTypes\"\n\t\t\t},\n\t\t\ttypeImports: [\n\t\t\t\t{\n\t\t\t\t\tpackage: \"@internal/target-postgres/codec-types\",\n\t\t\t\t\tnamed: \"JsonValue\",\n\t\t\t\t\talias: \"JsonValue\"\n\t\t\t\t},\n\t\t\t\tcodecTypeImport(\"Char\"),\n\t\t\t\tcodecTypeImport(\"Varchar\"),\n\t\t\t\tcodecTypeImport(\"Numeric\"),\n\t\t\t\tcodecTypeImport(\"Bit\"),\n\t\t\t\tcodecTypeImport(\"VarBit\"),\n\t\t\t\tcodecTypeImport(\"Timestamp\"),\n\t\t\t\tcodecTypeImport(\"Timestamptz\"),\n\t\t\t\tcodecTypeImport(\"Time\"),\n\t\t\t\tcodecTypeImport(\"Timetz\"),\n\t\t\t\tcodecTypeImport(\"Interval\"),\n\t\t\t\tcodecTypeImport(\"TimestampString\"),\n\t\t\t\tcodecTypeImport(\"TimestamptzString\"),\n\t\t\t\tcodecTypeImport(\"TimeString\")\n\t\t\t]\n\t\t}\n\t}\n};\n//#endregion\nexport { postgresAdapterDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-ARufwwWW.mjs.map"],"mappings":";;;;;AAKA,MAAM,mBAAmB,WAAW;CACnC,SAAS;CACT;CACA,OAAO;AACR;AACA,MAAM,gCAAgC;CACrC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc;CACd,OAAO;EACN,sBAAsB;EACtB,YAAY;GACX,kBAAkB,MAAM,KAAK,sBAAsB,OAAO,CAAC;GAC3D,QAAQ;IACP,SAAS;IACT,OAAO;IACP,OAAO;GACR;GACA,aAAa;IACZ;KACC,SAAS;KACT,OAAO;KACP,OAAO;IACR;IACA,gBAAgB,MAAM;IACtB,gBAAgB,SAAS;IACzB,gBAAgB,SAAS;IACzB,gBAAgB,KAAK;IACrB,gBAAgB,QAAQ;IACxB,gBAAgB,WAAW;IAC3B,gBAAgB,aAAa;IAC7B,gBAAgB,MAAM;IACtB,gBAAgB,QAAQ;IACxB,gBAAgB,UAAU;IAC1B,gBAAgB,iBAAiB;IACjC,gBAAgB,mBAAmB;IACnC,gBAAgB,YAAY;GAC7B;EACD;CACD;AACD"}
@@ -1,13 +1,13 @@
1
1
  import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs";
2
- import { A as postgresQualifyColumnType } from "./codecs-hSJgX8qY-fZSDQFIE.mjs";
3
- import { h as postgresCreateNamespace } from "./postgres-schema-DXd0mebY-CExd_GcQ.mjs";
4
- import { c as postgresAuthoringEntityTypes, d as postgresAuthoringPslBlockDescriptors, f as postgresAuthoringTypes, l as postgresAuthoringFieldPresets, p as postgresLowerEntityHandles, u as postgresAuthoringModelAttributes } from "./authoring-CfPWv_-P-BHAGgGYI.mjs";
5
- import { t as postgresRenderCheckExpressions } from "./check-expressions-BRuSxJ5d-CC5OFfR1.mjs";
6
- import { t as postgresDataTypeEntries } from "./data-type-entries-C2zpNOAQ-BJh8QNDa.mjs";
7
- import { t as postgresTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-BycwK4wx-CuDo_Atu.mjs";
2
+ import { A as postgresQualifyColumnType } from "./codecs-DelwJv6h-CFbyTJIJ.mjs";
3
+ import { h as postgresCreateNamespace } from "./postgres-schema-AlEVkXXS-ZfXWYddl.mjs";
4
+ import { c as postgresAuthoringEntityTypes, d as postgresAuthoringPslBlockDescriptors, f as postgresAuthoringTypes, l as postgresAuthoringFieldPresets, p as postgresLowerEntityHandles, u as postgresAuthoringModelAttributes } from "./authoring-vHbPLrW4-BsHR7gUE.mjs";
5
+ import { t as postgresRenderCheckExpressions } from "./check-expressions-Dlt334zg-CV5Vkh3G.mjs";
6
+ import { t as postgresDataTypeEntries } from "./data-type-entries-DgKLUrqt-TKDikzti.mjs";
7
+ import { t as postgresTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-CG2S236D-CUkzqeCr.mjs";
8
8
  import { type } from "arktype";
9
9
  import { defineIndexTypes } from "@prisma/orm-family-sql/contract/index-types";
10
- //#region ../../../3-targets/3-targets/postgres/dist/descriptor-meta-Dp8tWKKU.mjs
10
+ //#region ../../../3-targets/3-targets/postgres/dist/descriptor-meta-BgOMP4hF.mjs
11
11
  const postgresIndexTypes = defineIndexTypes().add("btree", { options: type("object") }).add("hash", { options: type("object") }).add("gin", { options: type("object") }).add("gist", { options: type("object") }).add("spgist", { options: type("object") }).add("brin", { options: type("object") });
12
12
  const postgresTargetDescriptorMeta = {
13
13
  ...postgresTargetDescriptorMetaRuntime,
@@ -35,4 +35,4 @@ const postgresTargetDescriptorMeta = {
35
35
  //#endregion
36
36
  export { postgresTargetDescriptorMeta as t };
37
37
 
38
- //# sourceMappingURL=descriptor-meta-Dp8tWKKU-5RiFTCA_.mjs.map
38
+ //# sourceMappingURL=descriptor-meta-BgOMP4hF-CfUJsgjc.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"descriptor-meta-Dp8tWKKU-5RiFTCA_.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/descriptor-meta-Dp8tWKKU.mjs"],"sourcesContent":["import { t as postgresDataTypeEntries } from \"./data-type-entries-C2zpNOAQ.mjs\";\nimport { E as postgresQualifyColumnType } from \"./codecs-hSJgX8qY.mjs\";\nimport { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { a as postgresAuthoringPslBlockDescriptors, i as postgresAuthoringModelAttributes, n as postgresAuthoringEntityTypes, o as postgresAuthoringTypes, r as postgresAuthoringFieldPresets, s as postgresLowerEntityHandles } from \"./authoring-CfPWv_-P.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-DXd0mebY.mjs\";\nimport { t as postgresRenderCheckExpressions } from \"./check-expressions-BRuSxJ5d.mjs\";\nimport { t as postgresTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-BycwK4wx.mjs\";\nimport { type } from \"arktype\";\nimport { defineIndexTypes } from \"@internal/sql-contract/index-types\";\n//#region src/core/index-types.ts\nconst postgresIndexTypes = defineIndexTypes().add(\"btree\", { options: type(\"object\") }).add(\"hash\", { options: type(\"object\") }).add(\"gin\", { options: type(\"object\") }).add(\"gist\", { options: type(\"object\") }).add(\"spgist\", { options: type(\"object\") }).add(\"brin\", { options: type(\"object\") });\nconst postgresTargetDescriptorMeta = {\n\t...postgresTargetDescriptorMetaRuntime,\n\tdefaultNamespaceId: DEFAULT_NAMESPACE_ID,\n\tsupportsNamespaces: true,\n\tindexTypes: postgresIndexTypes,\n\tauthoring: {\n\t\ttype: postgresAuthoringTypes,\n\t\tfield: postgresAuthoringFieldPresets,\n\t\tdataTypes: postgresDataTypeEntries(),\n\t\tentityTypes: postgresAuthoringEntityTypes,\n\t\tpslBlockDescriptors: postgresAuthoringPslBlockDescriptors,\n\t\tmodelAttributes: postgresAuthoringModelAttributes,\n\t\tcreateNamespace: postgresCreateNamespace,\n\t\tqualifyColumnType: postgresQualifyColumnType,\n\t\trenderCheckExpressions: postgresRenderCheckExpressions,\n\t\tlowerEntityHandles: postgresLowerEntityHandles\n\t},\n\ttypes: { queryOperationTypes: { import: {\n\t\tpackage: \"@internal/target-postgres/operation-types\",\n\t\tnamed: \"QueryOperationTypes\",\n\t\talias: \"PgTargetQueryOps\"\n\t} } }\n};\n//#endregion\nexport { postgresTargetDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-Dp8tWKKU.mjs.map"],"mappings":";;;;;;;;;;AAUA,MAAM,qBAAqB,iBAAiB,CAAC,CAAC,IAAI,SAAS,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC;AACpS,MAAM,+BAA+B;CACpC,GAAG;CACH,oBAAoB;CACpB,oBAAoB;CACpB,YAAY;CACZ,WAAW;EACV,MAAM;EACN,OAAO;EACP,WAAW,wBAAwB;EACnC,aAAa;EACb,qBAAqB;EACrB,iBAAiB;EACjB,iBAAiB;EACjB,mBAAmB;EACnB,wBAAwB;EACxB,oBAAoB;CACrB;CACA,OAAO,EAAE,qBAAqB,EAAE,QAAQ;EACvC,SAAS;EACT,OAAO;EACP,OAAO;CACR,EAAE,EAAE;AACL"}
1
+ {"version":3,"file":"descriptor-meta-BgOMP4hF-CfUJsgjc.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/descriptor-meta-BgOMP4hF.mjs"],"sourcesContent":["import { t as postgresDataTypeEntries } from \"./data-type-entries-DgKLUrqt.mjs\";\nimport { E as postgresQualifyColumnType } from \"./codecs-DelwJv6h.mjs\";\nimport { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { a as postgresAuthoringPslBlockDescriptors, i as postgresAuthoringModelAttributes, n as postgresAuthoringEntityTypes, o as postgresAuthoringTypes, r as postgresAuthoringFieldPresets, s as postgresLowerEntityHandles } from \"./authoring-vHbPLrW4.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-AlEVkXXS.mjs\";\nimport { t as postgresRenderCheckExpressions } from \"./check-expressions-Dlt334zg.mjs\";\nimport { t as postgresTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-CG2S236D.mjs\";\nimport { type } from \"arktype\";\nimport { defineIndexTypes } from \"@internal/sql-contract/index-types\";\n//#region src/core/index-types.ts\nconst postgresIndexTypes = defineIndexTypes().add(\"btree\", { options: type(\"object\") }).add(\"hash\", { options: type(\"object\") }).add(\"gin\", { options: type(\"object\") }).add(\"gist\", { options: type(\"object\") }).add(\"spgist\", { options: type(\"object\") }).add(\"brin\", { options: type(\"object\") });\nconst postgresTargetDescriptorMeta = {\n\t...postgresTargetDescriptorMetaRuntime,\n\tdefaultNamespaceId: DEFAULT_NAMESPACE_ID,\n\tsupportsNamespaces: true,\n\tindexTypes: postgresIndexTypes,\n\tauthoring: {\n\t\ttype: postgresAuthoringTypes,\n\t\tfield: postgresAuthoringFieldPresets,\n\t\tdataTypes: postgresDataTypeEntries(),\n\t\tentityTypes: postgresAuthoringEntityTypes,\n\t\tpslBlockDescriptors: postgresAuthoringPslBlockDescriptors,\n\t\tmodelAttributes: postgresAuthoringModelAttributes,\n\t\tcreateNamespace: postgresCreateNamespace,\n\t\tqualifyColumnType: postgresQualifyColumnType,\n\t\trenderCheckExpressions: postgresRenderCheckExpressions,\n\t\tlowerEntityHandles: postgresLowerEntityHandles\n\t},\n\ttypes: { queryOperationTypes: { import: {\n\t\tpackage: \"@internal/target-postgres/operation-types\",\n\t\tnamed: \"QueryOperationTypes\",\n\t\talias: \"PgTargetQueryOps\"\n\t} } }\n};\n//#endregion\nexport { postgresTargetDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-BgOMP4hF.mjs.map"],"mappings":";;;;;;;;;;AAUA,MAAM,qBAAqB,iBAAiB,CAAC,CAAC,IAAI,SAAS,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC;AACpS,MAAM,+BAA+B;CACpC,GAAG;CACH,oBAAoB;CACpB,oBAAoB;CACpB,YAAY;CACZ,WAAW;EACV,MAAM;EACN,OAAO;EACP,WAAW,wBAAwB;EACnC,aAAa;EACb,qBAAqB;EACrB,iBAAiB;EACjB,iBAAiB;EACjB,mBAAmB;EACnB,wBAAwB;EACxB,oBAAoB;CACrB;CACA,OAAO,EAAE,qBAAqB,EAAE,QAAQ;EACvC,SAAS;EACT,OAAO;EACP,OAAO;CACR,EAAE,EAAE;AACL"}
@@ -1,5 +1,5 @@
1
- import { R as postgresDataTypes } from "./data-types-BRBW3ouc-ZtyZE7nE.mjs";
2
- //#region ../../../3-targets/3-targets/postgres/dist/descriptor-meta-runtime-BycwK4wx.mjs
1
+ import { R as postgresDataTypes } from "./data-types-k3Ebk3kj-DWk3nh_k.mjs";
2
+ //#region ../../../3-targets/3-targets/postgres/dist/descriptor-meta-runtime-CG2S236D.mjs
3
3
  const postgresTargetDescriptorMetaRuntime = {
4
4
  kind: "target",
5
5
  familyId: "sql",
@@ -12,4 +12,4 @@ const postgresTargetDescriptorMetaRuntime = {
12
12
  //#endregion
13
13
  export { postgresTargetDescriptorMetaRuntime as t };
14
14
 
15
- //# sourceMappingURL=descriptor-meta-runtime-BycwK4wx-CuDo_Atu.mjs.map
15
+ //# sourceMappingURL=descriptor-meta-runtime-CG2S236D-CUkzqeCr.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"descriptor-meta-runtime-BycwK4wx-CuDo_Atu.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/descriptor-meta-runtime-BycwK4wx.mjs"],"sourcesContent":["import { R as postgresDataTypes } from \"./data-types-BRBW3ouc.mjs\";\nconst postgresTargetDescriptorMetaRuntime = {\n\tkind: \"target\",\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tid: \"postgres\",\n\tversion: \"0.0.1\",\n\tcapabilities: {},\n\tdataTypes: postgresDataTypes\n};\n//#endregion\nexport { postgresTargetDescriptorMetaRuntime as t };\n\n//# sourceMappingURL=descriptor-meta-runtime-BycwK4wx.mjs.map"],"mappings":";;AACA,MAAM,sCAAsC;CAC3C,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,CAAC;CACf,WAAW;AACZ"}
1
+ {"version":3,"file":"descriptor-meta-runtime-CG2S236D-CUkzqeCr.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/descriptor-meta-runtime-CG2S236D.mjs"],"sourcesContent":["import { R as postgresDataTypes } from \"./data-types-k3Ebk3kj.mjs\";\nconst postgresTargetDescriptorMetaRuntime = {\n\tkind: \"target\",\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tid: \"postgres\",\n\tversion: \"0.0.1\",\n\tcapabilities: {},\n\tdataTypes: postgresDataTypes\n};\n//#endregion\nexport { postgresTargetDescriptorMetaRuntime as t };\n\n//# sourceMappingURL=descriptor-meta-runtime-CG2S236D.mjs.map"],"mappings":";;AACA,MAAM,sCAAsC;CAC3C,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,CAAC;CACf,WAAW;AACZ"}
@@ -1,10 +1,10 @@
1
1
  import { s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
2
- import { d as isPostgresSchema } from "./postgres-schema-DXd0mebY-CExd_GcQ.mjs";
2
+ import { d as isPostgresSchema } from "./postgres-schema-AlEVkXXS-ZfXWYddl.mjs";
3
3
  import { a as postgresDiffSubjectGranularity, n as PostgresSchemaNodeKind, r as PostgresTableSchemaNode, t as PostgresNativeEnumSchemaNode } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
4
4
  import { i as PostgresRoleSchemaNode, n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
5
5
  import { n as postgresResolveDefault } from "./default-normalizer-CrMBHF0W-BaUR4Ec8.mjs";
6
- import { t as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-CadTChyu-C7F31wpN.mjs";
7
- import { m as resolvePostgresNodeIssueControlPolicySubject } from "./control-policy-C16wMazs-O_wlPuFC.mjs";
6
+ import { t as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-BthOWVjF-DuZ9iUh-.mjs";
7
+ import { d as resolvePostgresNodeIssueControlPolicySubject } from "./control-policy-bwcdB78Y-DgRaWAzu.mjs";
8
8
  import { blindCast } from "@prisma/orm-framework/utils/casts";
9
9
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
10
10
  import { diffSchemas, issueOutcome } from "@prisma/orm-framework/components/control";
@@ -13,7 +13,7 @@ import { ifDefined } from "@prisma/orm-framework/utils/defined";
13
13
  import { contractNamespaceToSchemaIR, sqlTypeLookupsOf } from "@prisma/orm-family-sql/family/control";
14
14
  import { PrimaryKey, RelationalSchemaNodeKind, SqlForeignKeyIR, SqlIndexIR, SqlUniqueIR } from "@prisma/orm-family-sql/schema-ir/types";
15
15
  import { classifyDiffSubjectGranularity } from "@prisma/orm-family-sql/family/diff";
16
- //#region ../../../3-targets/3-targets/postgres/dist/diff-database-schema-DRPIV4Ae.mjs
16
+ //#region ../../../3-targets/3-targets/postgres/dist/diff-database-schema-zc7d2uxC.mjs
17
17
  /** The database root's fixed sentinel id (`PostgresDatabaseSchemaNode#id`). */
18
18
  function databaseStep() {
19
19
  return {
@@ -391,4 +391,4 @@ function buildPostgresPlanDiff(input) {
391
391
  //#endregion
392
392
  export { contractToPostgresDatabaseSchemaNode as n, diffPostgresSchema as r, buildPostgresPlanDiff as t };
393
393
 
394
- //# sourceMappingURL=diff-database-schema-DRPIV4Ae-BSY-cBm0.mjs.map
394
+ //# sourceMappingURL=diff-database-schema-zc7d2uxC-BVe8D7vG.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"diff-database-schema-DRPIV4Ae-BSY-cBm0.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/diff-database-schema-DRPIV4Ae.mjs"],"sourcesContent":["import { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { r as isPostgresSchema } from \"./postgres-schema-DXd0mebY.mjs\";\nimport { n as postgresResolveDefault } from \"./default-normalizer-CrMBHF0W.mjs\";\nimport { a as postgresDiffSubjectGranularity, n as PostgresNativeEnumSchemaNode, r as PostgresSchemaNodeKind, t as PostgresTableSchemaNode } from \"./postgres-table-schema-node-BBkitBQh.mjs\";\nimport { i as PostgresDatabaseSchemaNode, n as PostgresPolicySchemaNode, r as PostgresNamespaceSchemaNode, t as PostgresRoleSchemaNode } from \"./postgres-role-schema-node-B8Z5i5D-.mjs\";\nimport { t as resolveDdlSchemaForNamespaceStorage } from \"./resolve-ddl-schema-CadTChyu.mjs\";\nimport { i as resolvePostgresNodeIssueControlPolicySubject } from \"./control-policy-C16wMazs.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { diffSchemas, issueOutcome } from \"@internal/framework-components/control\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { contractNamespaceToSchemaIR, sqlTypeLookupsOf } from \"@internal/family-sql/control\";\nimport { namingOf } from \"@internal/sql-schema-ir/naming\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { classifyDiffSubjectGranularity } from \"@internal/family-sql/diff\";\nimport { PrimaryKey, RelationalSchemaNodeKind, SqlForeignKeyIR, SqlIndexIR, SqlUniqueIR } from \"@internal/sql-schema-ir/types\";\n//#region src/core/migrations/contract-to-postgres-database-schema-node.ts\n/** The database root's fixed sentinel id (`PostgresDatabaseSchemaNode#id`). */\nfunction databaseStep() {\n\treturn {\n\t\tnodeKind: PostgresSchemaNodeKind.database,\n\t\tid: \"database\"\n\t};\n}\nfunction tableDependsOn(namespaceId, tableName) {\n\treturn [\n\t\tdatabaseStep(),\n\t\t{\n\t\t\tnodeKind: PostgresSchemaNodeKind.namespace,\n\t\t\tid: namespaceId\n\t\t},\n\t\t{\n\t\t\tnodeKind: PostgresSchemaNodeKind.table,\n\t\t\tid: tableName\n\t\t}\n\t];\n}\nfunction roleDependsOn(role) {\n\treturn [databaseStep(), {\n\t\tnodeKind: PostgresSchemaNodeKind.role,\n\t\tid: role\n\t}];\n}\n/**\n* The chains from a table-child object (foreign key, index, unique, primary\n* key) to each of the own columns it is built on, in the Postgres tree.\n* Dropping a covered column auto-drops the object, so the object's drop must\n* precede the column's; the graph derives that direction from these edges.\n*/\nfunction columnDependsOn(namespaceId, tableName, columns) {\n\treturn columns.map((column) => [...tableDependsOn(namespaceId, tableName), {\n\t\tnodeKind: RelationalSchemaNodeKind.column,\n\t\tid: `column:${column}`\n\t}]);\n}\nfunction toPolicyNode(policy, namespaceId) {\n\treturn new PostgresPolicySchemaNode({\n\t\tnaming: namingOf(policy.name, policy.prefix),\n\t\ttableName: policy.tableName,\n\t\tnamespaceId,\n\t\toperation: policy.operation,\n\t\troles: [...policy.roles],\n\t\tusing: policy.using,\n\t\twithCheck: policy.withCheck,\n\t\tpermissive: policy.permissive,\n\t\tdependsOn: [tableDependsOn(namespaceId, policy.tableName), ...policy.roles.map(roleDependsOn)]\n\t});\n}\n/**\n* Projects a Postgres contract into the expected schema-diff tree: a\n* `PostgresDatabaseSchemaNode` root holding one `PostgresNamespaceSchemaNode`\n* per Postgres namespace, each holding its `PostgresTableSchemaNode`s with\n* their `PostgresPolicySchemaNode`s, plus the database roles on the root.\n*\n* Not a duplicate of the family's `contractToSchemaIR`: that builds a flat,\n* single `{ tables }` map (and throws on cross-namespace name collisions, with\n* no RLS/role concept) for SQLite's single-schema world. This is the\n* Postgres-specific *tree* shape — multi-schema, RLS-policy-aware, role-aware.\n* It reuses the family's per-namespace table conversion (`contractNamespaceToSchemaIR`)\n* for column/FK/index building and only adds the Postgres tree/policy/role shape.\n*\n* Tables are grouped by their owning namespace (resolved DDL schema name) so\n* the tree mirrors Postgres's object hierarchy. The DDL schema name is\n* resolved once per namespace.\n*\n* A policy that references a table absent from its namespace is a malformed\n* contract — the loop throws rather than fabricating a stub table.\n*/\nfunction contractToPostgresDatabaseSchemaNode(contract, options) {\n\tif (contract === null) return new PostgresDatabaseSchemaNode({\n\t\tnamespaces: {},\n\t\troles: [],\n\t\texistingSchemas: [],\n\t\tpgVersion: \"\"\n\t});\n\tconst namespaces = {};\n\tconst roles = [];\n\tconst ownedSchemas = [];\n\tfor (const ns of Object.values(contract.storage.namespaces)) {\n\t\tif (!isPostgresSchema(ns)) continue;\n\t\tfor (const role of Object.values(ns.role)) roles.push(new PostgresRoleSchemaNode({\n\t\t\tname: role.name,\n\t\t\tnamespaceId: role.namespaceId\n\t\t}));\n\t\tif (ns.id === UNBOUND_NAMESPACE_ID) {\n\t\t\tif (!Object.entries(ns.entries).some(([entriesKey, slot]) => entriesKey !== \"role\" && Object.keys(slot).length > 0)) continue;\n\t\t}\n\t\tconst ddlSchema = resolveDdlSchemaForNamespaceStorage(contract.storage, ns.id);\n\t\townedSchemas.push(ddlSchema);\n\t\tconst sqlTables = contractNamespaceToSchemaIR(contract.storage, ns.id, options).tables;\n\t\tconst policiesByTable = /* @__PURE__ */ new Map();\n\t\tfor (const policy of Object.values(ns.policy)) {\n\t\t\tconst list = policiesByTable.get(policy.tableName) ?? [];\n\t\t\tlist.push(toPolicyNode(policy, ddlSchema));\n\t\t\tpoliciesByTable.set(policy.tableName, list);\n\t\t}\n\t\tconst tables = {};\n\t\tfor (const tableName of Object.keys(ns.table)) {\n\t\t\tconst sqlTable = sqlTables[tableName];\n\t\t\tif (sqlTable === void 0) continue;\n\t\t\tconst foreignKeys = sqlTable.foreignKeys.map((fk) => {\n\t\t\t\tconst resolvedReferencedNamespace = resolveDdlSchemaForNamespaceStorage(contract.storage, fk.referencedSchema ?? UNBOUND_NAMESPACE_ID);\n\t\t\t\treturn new SqlForeignKeyIR({\n\t\t\t\t\tcolumns: fk.columns,\n\t\t\t\t\treferencedTable: fk.referencedTable,\n\t\t\t\t\treferencedColumns: fk.referencedColumns,\n\t\t\t\t\treferencedSchema: fk.referencedSchema ?? UNBOUND_NAMESPACE_ID,\n\t\t\t\t\t...ifDefined(\"name\", fk.name),\n\t\t\t\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t\t\t\t...ifDefined(\"onUpdate\", fk.onUpdate),\n\t\t\t\t\t...ifDefined(\"annotations\", fk.annotations),\n\t\t\t\t\tresolvedReferencedNamespace,\n\t\t\t\t\tdependsOn: [tableDependsOn(resolvedReferencedNamespace, fk.referencedTable), ...columnDependsOn(ddlSchema, tableName, fk.columns)]\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst uniques = sqlTable.uniques.map((u) => new SqlUniqueIR({\n\t\t\t\tcolumns: u.columns,\n\t\t\t\t...ifDefined(\"name\", u.name),\n\t\t\t\t...ifDefined(\"annotations\", u.annotations),\n\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, u.columns)\n\t\t\t}));\n\t\t\tconst indexes = sqlTable.indexes.map((i) => {\n\t\t\t\tconst base = {\n\t\t\t\t\tnaming: namingOf(i.name, i.prefix),\n\t\t\t\t\twhere: i.where,\n\t\t\t\t\tunique: i.unique,\n\t\t\t\t\tpartial: i.partial,\n\t\t\t\t\ttype: i.type,\n\t\t\t\t\toptions: i.options,\n\t\t\t\t\tannotations: i.annotations,\n\t\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, i.columns ?? Object.keys(sqlTable.columns))\n\t\t\t\t};\n\t\t\t\treturn new SqlIndexIR(i.expression !== void 0 ? {\n\t\t\t\t\t...base,\n\t\t\t\t\texpression: i.expression\n\t\t\t\t} : {\n\t\t\t\t\t...base,\n\t\t\t\t\tcolumns: i.columns ?? []\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst primaryKey = sqlTable.primaryKey !== void 0 ? new PrimaryKey({\n\t\t\t\tcolumns: sqlTable.primaryKey.columns,\n\t\t\t\t...ifDefined(\"name\", sqlTable.primaryKey.name),\n\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, sqlTable.primaryKey.columns)\n\t\t\t}) : void 0;\n\t\t\ttables[tableName] = new PostgresTableSchemaNode({\n\t\t\t\tname: sqlTable.name,\n\t\t\t\tcolumns: sqlTable.columns,\n\t\t\t\tforeignKeys,\n\t\t\t\tuniques,\n\t\t\t\tindexes,\n\t\t\t\t...ifDefined(\"primaryKey\", primaryKey),\n\t\t\t\t...ifDefined(\"annotations\", sqlTable.annotations),\n\t\t\t\t...ifDefined(\"checks\", sqlTable.checks),\n\t\t\t\tpolicies: policiesByTable.get(tableName) ?? [],\n\t\t\t\trlsEnabled: Object.hasOwn(ns.rls, tableName)\n\t\t\t});\n\t\t}\n\t\tfor (const [tableName, tablePolicies] of policiesByTable) {\n\t\t\tif (!(tableName in tables)) {\n\t\t\t\tconst policyName = tablePolicies[0]?.name ?? \"(unknown)\";\n\t\t\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `contract-to-postgres-database-schema-node: policy \"${policyName}\" references table \"${tableName}\" not present in namespace \"${ddlSchema}\"`, { meta: {\n\t\t\t\t\tpolicyName,\n\t\t\t\t\ttableName,\n\t\t\t\t\tnamespaceId: ddlSchema,\n\t\t\t\t\treason: \"table-missing\"\n\t\t\t\t} });\n\t\t\t}\n\t\t\tif (!Object.hasOwn(ns.rls, tableName)) {\n\t\t\t\tconst policyLabel = tablePolicies[0]?.prefix ?? tablePolicies[0]?.name ?? \"(unknown)\";\n\t\t\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `contract-to-postgres-database-schema-node: policy \"${policyLabel}\" targets table \"${tableName}\" in namespace \"${ddlSchema}\", which is not RLS-controlled. Mark the model with @@rls (entries.rls[\"${tableName}\"]) or remove the policy.`, { meta: {\n\t\t\t\t\tpolicyName: policyLabel,\n\t\t\t\t\ttableName,\n\t\t\t\t\tnamespaceId: ddlSchema,\n\t\t\t\t\treason: \"table-not-rls-controlled\"\n\t\t\t\t} });\n\t\t\t}\n\t\t}\n\t\tnamespaces[ddlSchema] = new PostgresNamespaceSchemaNode({\n\t\t\tschemaName: ddlSchema,\n\t\t\ttables,\n\t\t\tnativeEnums: Object.values(ns.entries.native_enum ?? {}).map((entity) => new PostgresNativeEnumSchemaNode({\n\t\t\t\ttypeName: entity.typeName,\n\t\t\t\tnamespaceId: ddlSchema,\n\t\t\t\tmembers: entity.members,\n\t\t\t\t...ifDefined(\"control\", entity.control)\n\t\t\t}))\n\t\t});\n\t}\n\treturn new PostgresDatabaseSchemaNode({\n\t\tnamespaces,\n\t\troles,\n\t\texistingSchemas: ownedSchemas,\n\t\tpgVersion: \"\"\n\t});\n}\n//#endregion\n//#region src/core/migrations/diff-database-schema.ts\n/**\n* Whether a diff issue's subject node is cluster-scoped — it carries its own\n* `namespaceId` field (only role and policy diff nodes do) and that\n* coordinate is the unbound sentinel, meaning the node is not owned by any\n* schema/namespace. A role node is always cluster-scoped (roles are\n* cluster-level objects); a policy node's `namespaceId` is always its\n* table's resolved DDL schema, never the sentinel. Namespace-ownership\n* scoping (which compares `issue.path[1]` against the set of DDL schemas\n* the contract owns) makes no sense for a cluster-scoped subject — its path\n* segment at that index is the object's own name, not a schema name — so\n* such an issue bypasses that scoping entirely.\n*/\nfunction isClusterScopedIssue(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\treturn node !== void 0 && nodeNamespaceId(node) === UNBOUND_NAMESPACE_ID;\n}\nfunction nodeNamespaceId(node) {\n\tif (!Object.hasOwn(node, \"namespaceId\")) return void 0;\n\treturn blindCast(node).namespaceId;\n}\nfunction ownedSchemaNames(expected) {\n\tconst policyNamespaces = Object.values(expected.namespaces).flatMap((ns) => Object.values(ns.tables).flatMap((t) => t.policies.map((p) => p.namespaceId)));\n\treturn /* @__PURE__ */ new Set([...policyNamespaces, ...expected.existingSchemas]);\n}\n/**\n* Drops contract namespaces that declare no tables from the verdict-diff\n* expected tree and the relational owned-schema set. The legacy relational\n* walk skipped a table-less namespace (e.g. an enums-only schema) before\n* pairing, so neither its DDL schema's absence nor that schema's live\n* relational contents ever reached the verdict — the pruned tree\n* reproduces that. The prune loses no expected policies: policies attach\n* to tables, so a table-less namespace carries none (the projection\n* throws on a policy referencing an absent table). Live policies in a\n* pruned schema remain governed via the full owned set (see\n* {@link diffPostgresSchema}).\n*/\nfunction pruneTableLessNamespaces(expected) {\n\tconst namespaces = Object.fromEntries(Object.entries(expected.namespaces).filter(([, ns]) => Object.keys(ns.tables).length > 0));\n\treturn new PostgresDatabaseSchemaNode({\n\t\tnamespaces,\n\t\troles: [...expected.roles],\n\t\texistingSchemas: expected.existingSchemas.filter((s) => namespaces[s] !== void 0),\n\t\tpgVersion: expected.pgVersion\n\t});\n}\n/**\n* Resolves a verdict-diff issue's subject's declared control policy directly\n* from the contract, by delegating to the same node-typed resolver\n* ({@link resolvePostgresNodeIssueControlPolicySubject}) the planner uses to\n* gate DDL calls. `undefined` when the issue resolves to no contract subject.\n*\n* A role issue resolves through that same resolver to `external`\n* unconditionally (see its role branch), regardless of the contract's own\n* default policy: a role is referenced by the contract but not owned, and\n* `external`'s existing semantics — a missing declared subject still fails,\n* every extra is suppressed — are exactly the wanted asymmetric grading for\n* a cluster object the framework does not own.\n*/\nfunction resolveControlPolicy(issue, contract) {\n\treturn resolvePostgresNodeIssueControlPolicySubject(blindCast(issue), contract)?.explicitNodeControlPolicy;\n}\n/**\n* The Postgres full-tree node diff for the family verify verdict: derive\n* the expected tree (resolved leaf values, FK schemas\n* resolved, table-less namespaces pruned), run the generic\n* differ over the trees as derived, and scope out `not-expected` findings under namespaces the\n* contract does not own. Ownership scoping bypasses cluster-scoped subjects\n* (roles today), mirroring the legacy decomposition: relational extras check\n* the PRUNED owned set (the legacy\n* per-namespace walk never visited a table-less namespace, so its live\n* relational contents are invisible), while `structural` extras (RLS\n* policies) check the FULL owned set (the legacy policy diff governed\n* every contract schema regardless of tables — RLS governance does not\n* shrink because a namespace declares no tables). The codec `verifyType`\n* hooks run once per contract namespace with tables against that\n* namespace's paired actual node (the hooks read namespace-scoped state\n* such as `nativeEnums`).\n*/\nfunction diffPostgresSchema(input) {\n\tconst postgresContract = blindCast(input.contract);\n\tPostgresDatabaseSchemaNode.assert(input.schema);\n\tconst actual = input.schema;\n\tconst types = sqlTypeLookupsOf(input.frameworkComponents);\n\tconst fullExpected = contractToPostgresDatabaseSchemaNode(postgresContract, {\n\t\tannotationNamespace: \"pg\",\n\t\tdataTypeLookup: types.dataTypeLookup,\n\t\tcodecLookup: types.codecLookup,\n\t\tresolveDefault: postgresResolveDefault\n\t});\n\tconst expected = pruneTableLessNamespaces(fullExpected);\n\tconst relationalOwned = ownedSchemaNames(expected);\n\tconst structuralOwned = ownedSchemaNames(fullExpected);\n\treturn {\n\t\tissues: diffSchemas(expected, actual).filter((issue) => {\n\t\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\t\tif (isClusterScopedIssue(issue)) return true;\n\t\t\tconst granularity = classifyDiffSubjectGranularity(issue, postgresDiffSubjectGranularity);\n\t\t\tconst namespaceSegment = issue.path[1];\n\t\t\tif (namespaceSegment === void 0) return true;\n\t\t\treturn (granularity === \"structural\" ? structuralOwned : relationalOwned).has(namespaceSegment);\n\t\t}),\n\t\tresolveControlPolicy: (issue) => resolveControlPolicy(issue, postgresContract),\n\t\tnamespacePairs: Object.values(expected.namespaces).map((ns) => ({ actual: actual.namespaces[ns.schemaName] }))\n\t};\n}\n/**\n* Adds an empty namespace node to the actual tree for every expected namespace\n* absent from it. The relational plan diff pairs on namespace: a contract\n* namespace whose live schema does not exist yet must surface each of its\n* tables as `not-found` (→ `CREATE TABLE`), NOT as a single namespace\n* `not-found` that subtree-coalescing would collapse (leaving `CREATE SCHEMA`\n* with no tables). Padding makes the namespaces pair, so only table/column/\n* policy drift surfaces; `CREATE SCHEMA` comes separately from the synthesized\n* namespace-presence stitch (`verifyPostgresNamespacePresence`), never from the\n* tree diff — matching the retired per-namespace-paired relational walk, which\n* paired a missing schema against an empty namespace node.\n*/\nfunction padActualNamespaces(expected, actual) {\n\tconst namespaces = { ...actual.namespaces };\n\tlet padded = false;\n\tfor (const schemaName of Object.keys(expected.namespaces)) if (namespaces[schemaName] === void 0) {\n\t\tnamespaces[schemaName] = new PostgresNamespaceSchemaNode({\n\t\t\tschemaName,\n\t\t\ttables: {}\n\t\t});\n\t\tpadded = true;\n\t}\n\tif (!padded) return actual;\n\treturn new PostgresDatabaseSchemaNode({\n\t\tnamespaces,\n\t\troles: [...actual.roles],\n\t\texistingSchemas: [...actual.existingSchemas],\n\t\tpgVersion: actual.pgVersion\n\t});\n}\n/**\n* The Postgres planner's diff input: the SAME tree-building\n* `diffPostgresSchema` uses (FK schemas resolved,\n* table-less namespaces pruned, cluster-scope-aware ownership filter) plus\n* actual namespace padding (so a missing\n* schema's tables surface as `not-found` instead of a swallowed namespace\n* `not-found`). One differ drives both verify and plan; this is the\n* plan-side derivation. The single issue list covers tables / columns /\n* constraints / indexes / defaults AND policies — the caller splits it\n* (relational → `mapNodeIssueToCall`; policy → RLS ops) and stitches in\n* `CREATE SCHEMA` separately.\n*/\nfunction buildPostgresPlanDiff(input) {\n\tconst postgresContract = blindCast(input.contract);\n\tPostgresDatabaseSchemaNode.assert(input.actualSchema);\n\tconst actual = input.actualSchema;\n\tconst types = sqlTypeLookupsOf(input.frameworkComponents);\n\tconst fullExpected = contractToPostgresDatabaseSchemaNode(postgresContract, {\n\t\tannotationNamespace: \"pg\",\n\t\tdataTypeLookup: types.dataTypeLookup,\n\t\tcodecLookup: types.codecLookup,\n\t\tresolveDefault: postgresResolveDefault\n\t});\n\tconst expected = pruneTableLessNamespaces(fullExpected);\n\tconst paddedActual = padActualNamespaces(expected, actual);\n\tconst relationalOwned = ownedSchemaNames(expected);\n\tconst structuralOwned = ownedSchemaNames(fullExpected);\n\treturn {\n\t\texpected,\n\t\tactual: paddedActual,\n\t\tissues: blindCast(diffSchemas(expected, paddedActual)).filter((issue) => {\n\t\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\t\tif (isClusterScopedIssue(issue)) return true;\n\t\t\tconst granularity = classifyDiffSubjectGranularity(issue, postgresDiffSubjectGranularity);\n\t\t\tconst namespaceSegment = issue.path[1];\n\t\t\tif (namespaceSegment === void 0) return true;\n\t\t\treturn (granularity === \"structural\" ? structuralOwned : relationalOwned).has(namespaceSegment);\n\t\t})\n\t};\n}\n//#endregion\nexport { diffPostgresSchema as n, contractToPostgresDatabaseSchemaNode as r, buildPostgresPlanDiff as t };\n\n//# sourceMappingURL=diff-database-schema-DRPIV4Ae.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAS,eAAe;CACvB,OAAO;EACN,UAAU,uBAAuB;EACjC,IAAI;CACL;AACD;AACA,SAAS,eAAe,aAAa,WAAW;CAC/C,OAAO;EACN,aAAa;EACb;GACC,UAAU,uBAAuB;GACjC,IAAI;EACL;EACA;GACC,UAAU,uBAAuB;GACjC,IAAI;EACL;CACD;AACD;AACA,SAAS,cAAc,MAAM;CAC5B,OAAO,CAAC,aAAa,GAAG;EACvB,UAAU,uBAAuB;EACjC,IAAI;CACL,CAAC;AACF;;;;;;;AAOA,SAAS,gBAAgB,aAAa,WAAW,SAAS;CACzD,OAAO,QAAQ,KAAK,WAAW,CAAC,GAAG,eAAe,aAAa,SAAS,GAAG;EAC1E,UAAU,yBAAyB;EACnC,IAAI,UAAU;CACf,CAAC,CAAC;AACH;AACA,SAAS,aAAa,QAAQ,aAAa;CAC1C,OAAO,IAAI,yBAAyB;EACnC,QAAQ,SAAS,OAAO,MAAM,OAAO,MAAM;EAC3C,WAAW,OAAO;EAClB;EACA,WAAW,OAAO;EAClB,OAAO,CAAC,GAAG,OAAO,KAAK;EACvB,OAAO,OAAO;EACd,WAAW,OAAO;EAClB,YAAY,OAAO;EACnB,WAAW,CAAC,eAAe,aAAa,OAAO,SAAS,GAAG,GAAG,OAAO,MAAM,IAAI,aAAa,CAAC;CAC9F,CAAC;AACF;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,qCAAqC,UAAU,SAAS;CAChE,IAAI,aAAa,MAAM,OAAO,IAAI,2BAA2B;EAC5D,YAAY,CAAC;EACb,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B;EACrB,gBAAgB,MAAM;EACtB,aAAa,MAAM;EACnB,gBAAgB;CACjB,CAAC;CACD,MAAM,WAAW,yBAAyB,YAAY;CACtD,MAAM,eAAe,oBAAoB,UAAU,MAAM;CACzD,MAAM,kBAAkB,iBAAiB,QAAQ;CACjD,MAAM,kBAAkB,iBAAiB,YAAY;CACrD,OAAO;EACN;EACA,QAAQ;EACR,QAAQ,UAAU,YAAY,UAAU,YAAY,CAAC,CAAC,CAAC,QAAQ,UAAU;GACxE,IAAI,aAAa,KAAK,MAAM,gBAAgB,OAAO;GACnD,IAAI,qBAAqB,KAAK,GAAG,OAAO;GACxC,MAAM,cAAc,+BAA+B,OAAO,8BAA8B;GACxF,MAAM,mBAAmB,MAAM,KAAK;GACpC,IAAI,qBAAqB,KAAK,GAAG,OAAO;GACxC,QAAQ,gBAAgB,eAAe,kBAAkB,gBAAA,CAAiB,IAAI,gBAAgB;EAC/F,CAAC;CACF;AACD"}
1
+ {"version":3,"file":"diff-database-schema-zc7d2uxC-BVe8D7vG.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/diff-database-schema-zc7d2uxC.mjs"],"sourcesContent":["import { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { r as isPostgresSchema } from \"./postgres-schema-AlEVkXXS.mjs\";\nimport { n as postgresResolveDefault } from \"./default-normalizer-CrMBHF0W.mjs\";\nimport { a as postgresDiffSubjectGranularity, n as PostgresNativeEnumSchemaNode, r as PostgresSchemaNodeKind, t as PostgresTableSchemaNode } from \"./postgres-table-schema-node-BBkitBQh.mjs\";\nimport { i as PostgresDatabaseSchemaNode, n as PostgresPolicySchemaNode, r as PostgresNamespaceSchemaNode, t as PostgresRoleSchemaNode } from \"./postgres-role-schema-node-B8Z5i5D-.mjs\";\nimport { t as resolveDdlSchemaForNamespaceStorage } from \"./resolve-ddl-schema-BthOWVjF.mjs\";\nimport { i as resolvePostgresNodeIssueControlPolicySubject } from \"./control-policy-bwcdB78Y.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { diffSchemas, issueOutcome } from \"@internal/framework-components/control\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { contractNamespaceToSchemaIR, sqlTypeLookupsOf } from \"@internal/family-sql/control\";\nimport { namingOf } from \"@internal/sql-schema-ir/naming\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { classifyDiffSubjectGranularity } from \"@internal/family-sql/diff\";\nimport { PrimaryKey, RelationalSchemaNodeKind, SqlForeignKeyIR, SqlIndexIR, SqlUniqueIR } from \"@internal/sql-schema-ir/types\";\n//#region src/core/migrations/contract-to-postgres-database-schema-node.ts\n/** The database root's fixed sentinel id (`PostgresDatabaseSchemaNode#id`). */\nfunction databaseStep() {\n\treturn {\n\t\tnodeKind: PostgresSchemaNodeKind.database,\n\t\tid: \"database\"\n\t};\n}\nfunction tableDependsOn(namespaceId, tableName) {\n\treturn [\n\t\tdatabaseStep(),\n\t\t{\n\t\t\tnodeKind: PostgresSchemaNodeKind.namespace,\n\t\t\tid: namespaceId\n\t\t},\n\t\t{\n\t\t\tnodeKind: PostgresSchemaNodeKind.table,\n\t\t\tid: tableName\n\t\t}\n\t];\n}\nfunction roleDependsOn(role) {\n\treturn [databaseStep(), {\n\t\tnodeKind: PostgresSchemaNodeKind.role,\n\t\tid: role\n\t}];\n}\n/**\n* The chains from a table-child object (foreign key, index, unique, primary\n* key) to each of the own columns it is built on, in the Postgres tree.\n* Dropping a covered column auto-drops the object, so the object's drop must\n* precede the column's; the graph derives that direction from these edges.\n*/\nfunction columnDependsOn(namespaceId, tableName, columns) {\n\treturn columns.map((column) => [...tableDependsOn(namespaceId, tableName), {\n\t\tnodeKind: RelationalSchemaNodeKind.column,\n\t\tid: `column:${column}`\n\t}]);\n}\nfunction toPolicyNode(policy, namespaceId) {\n\treturn new PostgresPolicySchemaNode({\n\t\tnaming: namingOf(policy.name, policy.prefix),\n\t\ttableName: policy.tableName,\n\t\tnamespaceId,\n\t\toperation: policy.operation,\n\t\troles: [...policy.roles],\n\t\tusing: policy.using,\n\t\twithCheck: policy.withCheck,\n\t\tpermissive: policy.permissive,\n\t\tdependsOn: [tableDependsOn(namespaceId, policy.tableName), ...policy.roles.map(roleDependsOn)]\n\t});\n}\n/**\n* Projects a Postgres contract into the expected schema-diff tree: a\n* `PostgresDatabaseSchemaNode` root holding one `PostgresNamespaceSchemaNode`\n* per Postgres namespace, each holding its `PostgresTableSchemaNode`s with\n* their `PostgresPolicySchemaNode`s, plus the database roles on the root.\n*\n* Not a duplicate of the family's `contractToSchemaIR`: that builds a flat,\n* single `{ tables }` map (and throws on cross-namespace name collisions, with\n* no RLS/role concept) for SQLite's single-schema world. This is the\n* Postgres-specific *tree* shape — multi-schema, RLS-policy-aware, role-aware.\n* It reuses the family's per-namespace table conversion (`contractNamespaceToSchemaIR`)\n* for column/FK/index building and only adds the Postgres tree/policy/role shape.\n*\n* Tables are grouped by their owning namespace (resolved DDL schema name) so\n* the tree mirrors Postgres's object hierarchy. The DDL schema name is\n* resolved once per namespace.\n*\n* A policy that references a table absent from its namespace is a malformed\n* contract — the loop throws rather than fabricating a stub table.\n*/\nfunction contractToPostgresDatabaseSchemaNode(contract, options) {\n\tif (contract === null) return new PostgresDatabaseSchemaNode({\n\t\tnamespaces: {},\n\t\troles: [],\n\t\texistingSchemas: [],\n\t\tpgVersion: \"\"\n\t});\n\tconst namespaces = {};\n\tconst roles = [];\n\tconst ownedSchemas = [];\n\tfor (const ns of Object.values(contract.storage.namespaces)) {\n\t\tif (!isPostgresSchema(ns)) continue;\n\t\tfor (const role of Object.values(ns.role)) roles.push(new PostgresRoleSchemaNode({\n\t\t\tname: role.name,\n\t\t\tnamespaceId: role.namespaceId\n\t\t}));\n\t\tif (ns.id === UNBOUND_NAMESPACE_ID) {\n\t\t\tif (!Object.entries(ns.entries).some(([entriesKey, slot]) => entriesKey !== \"role\" && Object.keys(slot).length > 0)) continue;\n\t\t}\n\t\tconst ddlSchema = resolveDdlSchemaForNamespaceStorage(contract.storage, ns.id);\n\t\townedSchemas.push(ddlSchema);\n\t\tconst sqlTables = contractNamespaceToSchemaIR(contract.storage, ns.id, options).tables;\n\t\tconst policiesByTable = /* @__PURE__ */ new Map();\n\t\tfor (const policy of Object.values(ns.policy)) {\n\t\t\tconst list = policiesByTable.get(policy.tableName) ?? [];\n\t\t\tlist.push(toPolicyNode(policy, ddlSchema));\n\t\t\tpoliciesByTable.set(policy.tableName, list);\n\t\t}\n\t\tconst tables = {};\n\t\tfor (const tableName of Object.keys(ns.table)) {\n\t\t\tconst sqlTable = sqlTables[tableName];\n\t\t\tif (sqlTable === void 0) continue;\n\t\t\tconst foreignKeys = sqlTable.foreignKeys.map((fk) => {\n\t\t\t\tconst resolvedReferencedNamespace = resolveDdlSchemaForNamespaceStorage(contract.storage, fk.referencedSchema ?? UNBOUND_NAMESPACE_ID);\n\t\t\t\treturn new SqlForeignKeyIR({\n\t\t\t\t\tcolumns: fk.columns,\n\t\t\t\t\treferencedTable: fk.referencedTable,\n\t\t\t\t\treferencedColumns: fk.referencedColumns,\n\t\t\t\t\treferencedSchema: fk.referencedSchema ?? UNBOUND_NAMESPACE_ID,\n\t\t\t\t\t...ifDefined(\"name\", fk.name),\n\t\t\t\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t\t\t\t...ifDefined(\"onUpdate\", fk.onUpdate),\n\t\t\t\t\t...ifDefined(\"annotations\", fk.annotations),\n\t\t\t\t\tresolvedReferencedNamespace,\n\t\t\t\t\tdependsOn: [tableDependsOn(resolvedReferencedNamespace, fk.referencedTable), ...columnDependsOn(ddlSchema, tableName, fk.columns)]\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst uniques = sqlTable.uniques.map((u) => new SqlUniqueIR({\n\t\t\t\tcolumns: u.columns,\n\t\t\t\t...ifDefined(\"name\", u.name),\n\t\t\t\t...ifDefined(\"annotations\", u.annotations),\n\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, u.columns)\n\t\t\t}));\n\t\t\tconst indexes = sqlTable.indexes.map((i) => {\n\t\t\t\tconst base = {\n\t\t\t\t\tnaming: namingOf(i.name, i.prefix),\n\t\t\t\t\twhere: i.where,\n\t\t\t\t\tunique: i.unique,\n\t\t\t\t\tpartial: i.partial,\n\t\t\t\t\ttype: i.type,\n\t\t\t\t\toptions: i.options,\n\t\t\t\t\tannotations: i.annotations,\n\t\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, i.columns ?? Object.keys(sqlTable.columns))\n\t\t\t\t};\n\t\t\t\treturn new SqlIndexIR(i.expression !== void 0 ? {\n\t\t\t\t\t...base,\n\t\t\t\t\texpression: i.expression\n\t\t\t\t} : {\n\t\t\t\t\t...base,\n\t\t\t\t\tcolumns: i.columns ?? []\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst primaryKey = sqlTable.primaryKey !== void 0 ? new PrimaryKey({\n\t\t\t\tcolumns: sqlTable.primaryKey.columns,\n\t\t\t\t...ifDefined(\"name\", sqlTable.primaryKey.name),\n\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, sqlTable.primaryKey.columns)\n\t\t\t}) : void 0;\n\t\t\ttables[tableName] = new PostgresTableSchemaNode({\n\t\t\t\tname: sqlTable.name,\n\t\t\t\tcolumns: sqlTable.columns,\n\t\t\t\tforeignKeys,\n\t\t\t\tuniques,\n\t\t\t\tindexes,\n\t\t\t\t...ifDefined(\"primaryKey\", primaryKey),\n\t\t\t\t...ifDefined(\"annotations\", sqlTable.annotations),\n\t\t\t\t...ifDefined(\"checks\", sqlTable.checks),\n\t\t\t\tpolicies: policiesByTable.get(tableName) ?? [],\n\t\t\t\trlsEnabled: Object.hasOwn(ns.rls, tableName)\n\t\t\t});\n\t\t}\n\t\tfor (const [tableName, tablePolicies] of policiesByTable) {\n\t\t\tif (!(tableName in tables)) {\n\t\t\t\tconst policyName = tablePolicies[0]?.name ?? \"(unknown)\";\n\t\t\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `contract-to-postgres-database-schema-node: policy \"${policyName}\" references table \"${tableName}\" not present in namespace \"${ddlSchema}\"`, { meta: {\n\t\t\t\t\tpolicyName,\n\t\t\t\t\ttableName,\n\t\t\t\t\tnamespaceId: ddlSchema,\n\t\t\t\t\treason: \"table-missing\"\n\t\t\t\t} });\n\t\t\t}\n\t\t\tif (!Object.hasOwn(ns.rls, tableName)) {\n\t\t\t\tconst policyLabel = tablePolicies[0]?.prefix ?? tablePolicies[0]?.name ?? \"(unknown)\";\n\t\t\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `contract-to-postgres-database-schema-node: policy \"${policyLabel}\" targets table \"${tableName}\" in namespace \"${ddlSchema}\", which is not RLS-controlled. Mark the model with @@rls (entries.rls[\"${tableName}\"]) or remove the policy.`, { meta: {\n\t\t\t\t\tpolicyName: policyLabel,\n\t\t\t\t\ttableName,\n\t\t\t\t\tnamespaceId: ddlSchema,\n\t\t\t\t\treason: \"table-not-rls-controlled\"\n\t\t\t\t} });\n\t\t\t}\n\t\t}\n\t\tnamespaces[ddlSchema] = new PostgresNamespaceSchemaNode({\n\t\t\tschemaName: ddlSchema,\n\t\t\ttables,\n\t\t\tnativeEnums: Object.values(ns.entries.native_enum ?? {}).map((entity) => new PostgresNativeEnumSchemaNode({\n\t\t\t\ttypeName: entity.typeName,\n\t\t\t\tnamespaceId: ddlSchema,\n\t\t\t\tmembers: entity.members,\n\t\t\t\t...ifDefined(\"control\", entity.control)\n\t\t\t}))\n\t\t});\n\t}\n\treturn new PostgresDatabaseSchemaNode({\n\t\tnamespaces,\n\t\troles,\n\t\texistingSchemas: ownedSchemas,\n\t\tpgVersion: \"\"\n\t});\n}\n//#endregion\n//#region src/core/migrations/diff-database-schema.ts\n/**\n* Whether a diff issue's subject node is cluster-scoped — it carries its own\n* `namespaceId` field (only role and policy diff nodes do) and that\n* coordinate is the unbound sentinel, meaning the node is not owned by any\n* schema/namespace. A role node is always cluster-scoped (roles are\n* cluster-level objects); a policy node's `namespaceId` is always its\n* table's resolved DDL schema, never the sentinel. Namespace-ownership\n* scoping (which compares `issue.path[1]` against the set of DDL schemas\n* the contract owns) makes no sense for a cluster-scoped subject — its path\n* segment at that index is the object's own name, not a schema name — so\n* such an issue bypasses that scoping entirely.\n*/\nfunction isClusterScopedIssue(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\treturn node !== void 0 && nodeNamespaceId(node) === UNBOUND_NAMESPACE_ID;\n}\nfunction nodeNamespaceId(node) {\n\tif (!Object.hasOwn(node, \"namespaceId\")) return void 0;\n\treturn blindCast(node).namespaceId;\n}\nfunction ownedSchemaNames(expected) {\n\tconst policyNamespaces = Object.values(expected.namespaces).flatMap((ns) => Object.values(ns.tables).flatMap((t) => t.policies.map((p) => p.namespaceId)));\n\treturn /* @__PURE__ */ new Set([...policyNamespaces, ...expected.existingSchemas]);\n}\n/**\n* Drops contract namespaces that declare no tables from the verdict-diff\n* expected tree and the relational owned-schema set. The legacy relational\n* walk skipped a table-less namespace (e.g. an enums-only schema) before\n* pairing, so neither its DDL schema's absence nor that schema's live\n* relational contents ever reached the verdict — the pruned tree\n* reproduces that. The prune loses no expected policies: policies attach\n* to tables, so a table-less namespace carries none (the projection\n* throws on a policy referencing an absent table). Live policies in a\n* pruned schema remain governed via the full owned set (see\n* {@link diffPostgresSchema}).\n*/\nfunction pruneTableLessNamespaces(expected) {\n\tconst namespaces = Object.fromEntries(Object.entries(expected.namespaces).filter(([, ns]) => Object.keys(ns.tables).length > 0));\n\treturn new PostgresDatabaseSchemaNode({\n\t\tnamespaces,\n\t\troles: [...expected.roles],\n\t\texistingSchemas: expected.existingSchemas.filter((s) => namespaces[s] !== void 0),\n\t\tpgVersion: expected.pgVersion\n\t});\n}\n/**\n* Resolves a verdict-diff issue's subject's declared control policy directly\n* from the contract, by delegating to the same node-typed resolver\n* ({@link resolvePostgresNodeIssueControlPolicySubject}) the planner uses to\n* gate DDL calls. `undefined` when the issue resolves to no contract subject.\n*\n* A role issue resolves through that same resolver to `external`\n* unconditionally (see its role branch), regardless of the contract's own\n* default policy: a role is referenced by the contract but not owned, and\n* `external`'s existing semantics — a missing declared subject still fails,\n* every extra is suppressed — are exactly the wanted asymmetric grading for\n* a cluster object the framework does not own.\n*/\nfunction resolveControlPolicy(issue, contract) {\n\treturn resolvePostgresNodeIssueControlPolicySubject(blindCast(issue), contract)?.explicitNodeControlPolicy;\n}\n/**\n* The Postgres full-tree node diff for the family verify verdict: derive\n* the expected tree (resolved leaf values, FK schemas\n* resolved, table-less namespaces pruned), run the generic\n* differ over the trees as derived, and scope out `not-expected` findings under namespaces the\n* contract does not own. Ownership scoping bypasses cluster-scoped subjects\n* (roles today), mirroring the legacy decomposition: relational extras check\n* the PRUNED owned set (the legacy\n* per-namespace walk never visited a table-less namespace, so its live\n* relational contents are invisible), while `structural` extras (RLS\n* policies) check the FULL owned set (the legacy policy diff governed\n* every contract schema regardless of tables — RLS governance does not\n* shrink because a namespace declares no tables). The codec `verifyType`\n* hooks run once per contract namespace with tables against that\n* namespace's paired actual node (the hooks read namespace-scoped state\n* such as `nativeEnums`).\n*/\nfunction diffPostgresSchema(input) {\n\tconst postgresContract = blindCast(input.contract);\n\tPostgresDatabaseSchemaNode.assert(input.schema);\n\tconst actual = input.schema;\n\tconst types = sqlTypeLookupsOf(input.frameworkComponents);\n\tconst fullExpected = contractToPostgresDatabaseSchemaNode(postgresContract, {\n\t\tannotationNamespace: \"pg\",\n\t\tdataTypeLookup: types.dataTypeLookup,\n\t\tcodecLookup: types.codecLookup,\n\t\tresolveDefault: postgresResolveDefault\n\t});\n\tconst expected = pruneTableLessNamespaces(fullExpected);\n\tconst relationalOwned = ownedSchemaNames(expected);\n\tconst structuralOwned = ownedSchemaNames(fullExpected);\n\treturn {\n\t\tissues: diffSchemas(expected, actual).filter((issue) => {\n\t\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\t\tif (isClusterScopedIssue(issue)) return true;\n\t\t\tconst granularity = classifyDiffSubjectGranularity(issue, postgresDiffSubjectGranularity);\n\t\t\tconst namespaceSegment = issue.path[1];\n\t\t\tif (namespaceSegment === void 0) return true;\n\t\t\treturn (granularity === \"structural\" ? structuralOwned : relationalOwned).has(namespaceSegment);\n\t\t}),\n\t\tresolveControlPolicy: (issue) => resolveControlPolicy(issue, postgresContract),\n\t\tnamespacePairs: Object.values(expected.namespaces).map((ns) => ({ actual: actual.namespaces[ns.schemaName] }))\n\t};\n}\n/**\n* Adds an empty namespace node to the actual tree for every expected namespace\n* absent from it. The relational plan diff pairs on namespace: a contract\n* namespace whose live schema does not exist yet must surface each of its\n* tables as `not-found` (→ `CREATE TABLE`), NOT as a single namespace\n* `not-found` that subtree-coalescing would collapse (leaving `CREATE SCHEMA`\n* with no tables). Padding makes the namespaces pair, so only table/column/\n* policy drift surfaces; `CREATE SCHEMA` comes separately from the synthesized\n* namespace-presence stitch (`verifyPostgresNamespacePresence`), never from the\n* tree diff — matching the retired per-namespace-paired relational walk, which\n* paired a missing schema against an empty namespace node.\n*/\nfunction padActualNamespaces(expected, actual) {\n\tconst namespaces = { ...actual.namespaces };\n\tlet padded = false;\n\tfor (const schemaName of Object.keys(expected.namespaces)) if (namespaces[schemaName] === void 0) {\n\t\tnamespaces[schemaName] = new PostgresNamespaceSchemaNode({\n\t\t\tschemaName,\n\t\t\ttables: {}\n\t\t});\n\t\tpadded = true;\n\t}\n\tif (!padded) return actual;\n\treturn new PostgresDatabaseSchemaNode({\n\t\tnamespaces,\n\t\troles: [...actual.roles],\n\t\texistingSchemas: [...actual.existingSchemas],\n\t\tpgVersion: actual.pgVersion\n\t});\n}\n/**\n* The Postgres planner's diff input: the SAME tree-building\n* `diffPostgresSchema` uses (FK schemas resolved,\n* table-less namespaces pruned, cluster-scope-aware ownership filter) plus\n* actual namespace padding (so a missing\n* schema's tables surface as `not-found` instead of a swallowed namespace\n* `not-found`). One differ drives both verify and plan; this is the\n* plan-side derivation. The single issue list covers tables / columns /\n* constraints / indexes / defaults AND policies — the caller splits it\n* (relational → `mapNodeIssueToCall`; policy → RLS ops) and stitches in\n* `CREATE SCHEMA` separately.\n*/\nfunction buildPostgresPlanDiff(input) {\n\tconst postgresContract = blindCast(input.contract);\n\tPostgresDatabaseSchemaNode.assert(input.actualSchema);\n\tconst actual = input.actualSchema;\n\tconst types = sqlTypeLookupsOf(input.frameworkComponents);\n\tconst fullExpected = contractToPostgresDatabaseSchemaNode(postgresContract, {\n\t\tannotationNamespace: \"pg\",\n\t\tdataTypeLookup: types.dataTypeLookup,\n\t\tcodecLookup: types.codecLookup,\n\t\tresolveDefault: postgresResolveDefault\n\t});\n\tconst expected = pruneTableLessNamespaces(fullExpected);\n\tconst paddedActual = padActualNamespaces(expected, actual);\n\tconst relationalOwned = ownedSchemaNames(expected);\n\tconst structuralOwned = ownedSchemaNames(fullExpected);\n\treturn {\n\t\texpected,\n\t\tactual: paddedActual,\n\t\tissues: blindCast(diffSchemas(expected, paddedActual)).filter((issue) => {\n\t\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\t\tif (isClusterScopedIssue(issue)) return true;\n\t\t\tconst granularity = classifyDiffSubjectGranularity(issue, postgresDiffSubjectGranularity);\n\t\t\tconst namespaceSegment = issue.path[1];\n\t\t\tif (namespaceSegment === void 0) return true;\n\t\t\treturn (granularity === \"structural\" ? structuralOwned : relationalOwned).has(namespaceSegment);\n\t\t})\n\t};\n}\n//#endregion\nexport { diffPostgresSchema as n, contractToPostgresDatabaseSchemaNode as r, buildPostgresPlanDiff as t };\n\n//# sourceMappingURL=diff-database-schema-zc7d2uxC.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAS,eAAe;CACvB,OAAO;EACN,UAAU,uBAAuB;EACjC,IAAI;CACL;AACD;AACA,SAAS,eAAe,aAAa,WAAW;CAC/C,OAAO;EACN,aAAa;EACb;GACC,UAAU,uBAAuB;GACjC,IAAI;EACL;EACA;GACC,UAAU,uBAAuB;GACjC,IAAI;EACL;CACD;AACD;AACA,SAAS,cAAc,MAAM;CAC5B,OAAO,C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kB,gBAAA,CAAiB,IAAI,gBAAgB;EAC/F,CAAC;CACF;AACD"}
@@ -1,6 +1,6 @@
1
- import { r as quoteIdentifier } from "./sql-utils-BMXJi06b-CAQOplfq.mjs";
2
- import { r as codecDescriptors } from "./codecs-hSJgX8qY-fZSDQFIE.mjs";
3
- //#region ../../../3-targets/3-targets/postgres/dist/full-text-index-expression-2O1p7zJA.mjs
1
+ import { r as quoteIdentifier } from "./sql-utils-CVsvXiX4-C7xD0Bgv.mjs";
2
+ import { r as codecDescriptors } from "./codecs-DelwJv6h-CFbyTJIJ.mjs";
3
+ //#region ../../../3-targets/3-targets/postgres/dist/full-text-index-expression-BpUM2Td6.mjs
4
4
  /**
5
5
  * The index expression that covers `fullTextMatches`, `fullTextRank` and
6
6
  * `fullTextHeadline` on a column. Postgres uses an expression index only when the
@@ -27,4 +27,4 @@ function isFullTextIndexableCodec(codecId) {
27
27
  //#endregion
28
28
  export { renderFullTextIndexExpression as n, isFullTextIndexableCodec as t };
29
29
 
30
- //# sourceMappingURL=full-text-index-expression-2O1p7zJA--CcXJUdq.mjs.map
30
+ //# sourceMappingURL=full-text-index-expression-BpUM2Td6-2Q7y7DnO.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"full-text-index-expression-2O1p7zJA--CcXJUdq.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/full-text-index-expression-2O1p7zJA.mjs"],"sourcesContent":["import { r as quoteIdentifier } from \"./sql-utils-BMXJi06b.mjs\";\nimport { t as codecDescriptors } from \"./codecs-hSJgX8qY.mjs\";\n//#region src/core/full-text-index-expression.ts\n/**\n* The index expression that covers `fullTextMatches`, `fullTextRank` and\n* `fullTextHeadline` on a column. Postgres uses an expression index only when the\n* indexed expression is the same `to_tsvector` over the same configuration literal and\n* the same column as the query, so both the `@@fullTextIndex` attribute and the\n* TypeScript helper render it here rather than each spelling it out.\n*/\nfunction renderFullTextIndexExpression(language, columnName) {\n\treturn `to_tsvector('${language}', ${quoteIdentifier(columnName)})`;\n}\n/** Widens a descriptor's trait tuple, so membership is a plain string test. */\nfunction traitsOf(descriptor) {\n\treturn descriptor.traits;\n}\nconst TEXTUAL_CODEC_IDS = new Set(codecDescriptors.filter((descriptor) => traitsOf(descriptor).includes(\"textual\")).map((descriptor) => descriptor.codecId));\n/**\n* Whether a column stored through this codec can be indexed for full-text search.\n* Read from the codec descriptors themselves, so both authoring surfaces accept\n* exactly the columns the `textual` operations dispatch on.\n*/\nfunction isFullTextIndexableCodec(codecId) {\n\treturn TEXTUAL_CODEC_IDS.has(codecId);\n}\n//#endregion\nexport { renderFullTextIndexExpression as n, isFullTextIndexableCodec as t };\n\n//# sourceMappingURL=full-text-index-expression-2O1p7zJA.mjs.map"],"mappings":";;;;;;;;;;AAUA,SAAS,8BAA8B,UAAU,YAAY;CAC5D,OAAO,gBAAgB,SAAS,KAAK,gBAAgB,UAAU,EAAE;AAClE;;AAEA,SAAS,SAAS,YAAY;CAC7B,OAAO,WAAW;AACnB;AACA,MAAM,oBAAoB,IAAI,IAAI,iBAAiB,QAAQ,eAAe,SAAS,UAAU,CAAC,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,KAAK,eAAe,WAAW,OAAO,CAAC;;;;;;AAM3J,SAAS,yBAAyB,SAAS;CAC1C,OAAO,kBAAkB,IAAI,OAAO;AACrC"}
1
+ {"version":3,"file":"full-text-index-expression-BpUM2Td6-2Q7y7DnO.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/full-text-index-expression-BpUM2Td6.mjs"],"sourcesContent":["import { r as quoteIdentifier } from \"./sql-utils-CVsvXiX4.mjs\";\nimport { t as codecDescriptors } from \"./codecs-DelwJv6h.mjs\";\n//#region src/core/full-text-index-expression.ts\n/**\n* The index expression that covers `fullTextMatches`, `fullTextRank` and\n* `fullTextHeadline` on a column. Postgres uses an expression index only when the\n* indexed expression is the same `to_tsvector` over the same configuration literal and\n* the same column as the query, so both the `@@fullTextIndex` attribute and the\n* TypeScript helper render it here rather than each spelling it out.\n*/\nfunction renderFullTextIndexExpression(language, columnName) {\n\treturn `to_tsvector('${language}', ${quoteIdentifier(columnName)})`;\n}\n/** Widens a descriptor's trait tuple, so membership is a plain string test. */\nfunction traitsOf(descriptor) {\n\treturn descriptor.traits;\n}\nconst TEXTUAL_CODEC_IDS = new Set(codecDescriptors.filter((descriptor) => traitsOf(descriptor).includes(\"textual\")).map((descriptor) => descriptor.codecId));\n/**\n* Whether a column stored through this codec can be indexed for full-text search.\n* Read from the codec descriptors themselves, so both authoring surfaces accept\n* exactly the columns the `textual` operations dispatch on.\n*/\nfunction isFullTextIndexableCodec(codecId) {\n\treturn TEXTUAL_CODEC_IDS.has(codecId);\n}\n//#endregion\nexport { renderFullTextIndexExpression as n, isFullTextIndexableCodec as t };\n\n//# sourceMappingURL=full-text-index-expression-BpUM2Td6.mjs.map"],"mappings":";;;;;;;;;;AAUA,SAAS,8BAA8B,UAAU,YAAY;CAC5D,OAAO,gBAAgB,SAAS,KAAK,gBAAgB,UAAU,EAAE;AAClE;;AAEA,SAAS,SAAS,YAAY;CAC7B,OAAO,WAAW;AACnB;AACA,MAAM,oBAAoB,IAAI,IAAI,iBAAiB,QAAQ,eAAe,SAAS,UAAU,CAAC,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,KAAK,eAAe,WAAW,OAAO,CAAC;;;;;;AAM3J,SAAS,yBAAyB,SAAS;CAC1C,OAAO,kBAAkB,IAAI,OAAO;AACrC"}
@@ -1,9 +1,9 @@
1
1
  import { S as PG_TEXT_CODEC_ID } from "./codec-ids-Cb0yO-IS--e0P2rfI.mjs";
2
2
  import { s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
3
- import { t as createPostgresBuiltinDataTypeLookup } from "./data-types-BRBW3ouc-ZtyZE7nE.mjs";
4
- import { r as POLICY_BLOCK_KEYWORDS } from "./authoring-CfPWv_-P-BHAGgGYI.mjs";
5
- import { t as postgresRenderCheckExpressions } from "./check-expressions-BRuSxJ5d-CC5OFfR1.mjs";
6
- import { t as postgresDataTypeEntries } from "./data-type-entries-C2zpNOAQ-BJh8QNDa.mjs";
3
+ import { t as createPostgresBuiltinDataTypeLookup } from "./data-types-k3Ebk3kj-DWk3nh_k.mjs";
4
+ import { r as POLICY_BLOCK_KEYWORDS } from "./authoring-vHbPLrW4-BsHR7gUE.mjs";
5
+ import { t as postgresRenderCheckExpressions } from "./check-expressions-Dlt334zg-CV5Vkh3G.mjs";
6
+ import { t as postgresDataTypeEntries } from "./data-type-entries-DgKLUrqt-TKDikzti.mjs";
7
7
  import { t as parsePostgresDefault } from "./default-normalizer-CrMBHF0W-BaUR4Ec8.mjs";
8
8
  import { canonicalFormOf, codecForRef } from "@prisma/orm-framework/components/codec";
9
9
  import { blindCast } from "@prisma/orm-framework/utils/casts";
@@ -21,7 +21,7 @@ import { UNSPECIFIED_PSL_NAMESPACE_ID, makePslNamespace, makePslNamespaceEntries
21
21
  import { parsePslPositionalArgs } from "@prisma/orm-framework/psl-parser/interpret";
22
22
  import { mapDefault, toEnumMemberName } from "@prisma/orm-family-sql/family/psl-build";
23
23
  import { isColumnDefault } from "@prisma/orm-framework/contract/types";
24
- //#region ../../../3-targets/3-targets/postgres/dist/infer-psl-contract-shHWsRbe.mjs
24
+ //#region ../../../3-targets/3-targets/postgres/dist/infer-psl-contract-B5yExD61.mjs
25
25
  /** A contract written for an existing database reads every date and time column as PostgreSQL's text. */
26
26
  const EXISTING_COLUMN_DATE_TIME_TYPES = {
27
27
  timestamp: "TimestampString",
@@ -1079,4 +1079,4 @@ function buildPslDocumentAst(schemaIR, options, foreignKeyExtras, namespaceName,
1079
1079
  //#endregion
1080
1080
  export { buildIndexAttribute as a, buildNativeEnumBlock as c, createPostgresTypeMap as d, inferPostgresPslContract as f, positionalArg as g, parseDefaultAttributeString as h, buildCheckAttribute as i, buildPslDocumentAst as l, noColumnDefaults as m, SYNTHETIC_SPAN as n, buildMapAttribute as o, namedArg as p, buildAttribute as r, buildModelConstraintAttribute as s, EXISTING_COLUMN_DATE_TIME_TYPES as t, createPostgresDefaultMapping as u };
1081
1081
 
1082
- //# sourceMappingURL=infer-psl-contract-shHWsRbe-C65aVFOB.mjs.map
1082
+ //# sourceMappingURL=infer-psl-contract-B5yExD61-Cmye68li.mjs.map