@prisma-next/target-postgres 0.9.0 → 0.10.0-dev.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 (124) hide show
  1. package/dist/{codec-ids-RvYfmUmi.d.mts → codec-ids-D9fJ4HP5.d.mts} +1 -1
  2. package/dist/{codec-ids-RvYfmUmi.d.mts.map → codec-ids-D9fJ4HP5.d.mts.map} +1 -1
  3. package/dist/codec-ids.d.mts +1 -1
  4. package/dist/{codec-types-667FxIW8.d.mts → codec-types-CRlHq7Cz.d.mts} +2 -2
  5. package/dist/{codec-types-667FxIW8.d.mts.map → codec-types-CRlHq7Cz.d.mts.map} +1 -1
  6. package/dist/codec-types.d.mts +1 -1
  7. package/dist/{codecs-DXeDABSO.d.mts → codecs-Dud5KDNk.d.mts} +2 -2
  8. package/dist/{codecs-DXeDABSO.d.mts.map → codecs-Dud5KDNk.d.mts.map} +1 -1
  9. package/dist/codecs.d.mts +1 -1
  10. package/dist/control.d.mts +1 -1
  11. package/dist/control.mjs +5 -5
  12. package/dist/{data-transform-COkGR6Ns.mjs → data-transform-CdtGUWp2.mjs} +1 -1
  13. package/dist/{data-transform-COkGR6Ns.mjs.map → data-transform-CdtGUWp2.mjs.map} +1 -1
  14. package/dist/{data-transform-B6p02mFJ.d.mts → data-transform-bmOKkygi.d.mts} +2 -2
  15. package/dist/{data-transform-B6p02mFJ.d.mts.map → data-transform-bmOKkygi.d.mts.map} +1 -1
  16. package/dist/data-transform.d.mts +1 -1
  17. package/dist/data-transform.mjs +1 -1
  18. package/dist/descriptor-meta-zrZzWmJF.mjs +91 -0
  19. package/dist/{descriptor-meta-DFUCClk_.mjs.map → descriptor-meta-zrZzWmJF.mjs.map} +1 -1
  20. package/dist/enum-planning.d.mts +1 -1
  21. package/dist/{errors-BiOloWUh.mjs → errors--zafB5_n.mjs} +1 -1
  22. package/dist/{errors-BiOloWUh.mjs.map → errors--zafB5_n.mjs.map} +1 -1
  23. package/dist/errors.mjs +1 -1
  24. package/dist/{issue-planner-BhWVYyE1.mjs → issue-planner-qalHRCI2.mjs} +179 -77
  25. package/dist/issue-planner-qalHRCI2.mjs.map +1 -0
  26. package/dist/issue-planner.d.mts +2 -2
  27. package/dist/issue-planner.d.mts.map +1 -1
  28. package/dist/issue-planner.mjs +1 -1
  29. package/dist/migration.d.mts +3 -3
  30. package/dist/migration.mjs +3 -3
  31. package/dist/{op-factory-call-c1zELk3U.d.mts → op-factory-call-Drccm_JD.d.mts} +3 -3
  32. package/dist/{op-factory-call-c1zELk3U.d.mts.map → op-factory-call-Drccm_JD.d.mts.map} +1 -1
  33. package/dist/{op-factory-call-DerP9BoT.mjs → op-factory-call-Zsrdty3k.mjs} +2 -2
  34. package/dist/{op-factory-call-DerP9BoT.mjs.map → op-factory-call-Zsrdty3k.mjs.map} +1 -1
  35. package/dist/op-factory-call.d.mts +1 -1
  36. package/dist/op-factory-call.mjs +1 -1
  37. package/dist/pack.d.mts +2 -2
  38. package/dist/pack.mjs +1 -1
  39. package/dist/{planner-DnzPpv1j.mjs → planner-C8yhbXOq.mjs} +84 -5
  40. package/dist/planner-C8yhbXOq.mjs.map +1 -0
  41. package/dist/{planner-ddl-builders-5QIyhBUF.mjs → planner-ddl-builders-DINYrbJ3.mjs} +4 -4
  42. package/dist/{planner-ddl-builders-5QIyhBUF.mjs.map → planner-ddl-builders-DINYrbJ3.mjs.map} +1 -1
  43. package/dist/planner-ddl-builders.d.mts +1 -1
  44. package/dist/planner-ddl-builders.mjs +1 -1
  45. package/dist/{planner-identity-values-BUYNOCwb.mjs → planner-identity-values-ojX-6cPV.mjs} +1 -1
  46. package/dist/{planner-identity-values-BUYNOCwb.mjs.map → planner-identity-values-ojX-6cPV.mjs.map} +1 -1
  47. package/dist/planner-identity-values.mjs +1 -1
  48. package/dist/{planner-produced-postgres-migration-FYsKh26I.mjs → planner-produced-postgres-migration-BqGLw7VT.mjs} +4 -4
  49. package/dist/{planner-produced-postgres-migration-FYsKh26I.mjs.map → planner-produced-postgres-migration-BqGLw7VT.mjs.map} +1 -1
  50. package/dist/{planner-produced-postgres-migration-D34ftfEK.d.mts → planner-produced-postgres-migration-c9lpjPv1.d.mts} +3 -3
  51. package/dist/{planner-produced-postgres-migration-D34ftfEK.d.mts.map → planner-produced-postgres-migration-c9lpjPv1.d.mts.map} +1 -1
  52. package/dist/planner-produced-postgres-migration.d.mts +1 -1
  53. package/dist/planner-produced-postgres-migration.mjs +1 -1
  54. package/dist/planner-schema-lookup-BGyukuzG.mjs +57 -0
  55. package/dist/planner-schema-lookup-BGyukuzG.mjs.map +1 -0
  56. package/dist/planner-schema-lookup.d.mts.map +1 -1
  57. package/dist/planner-schema-lookup.mjs +1 -1
  58. package/dist/{planner-sql-checks-Cd016Ycs.mjs → planner-sql-checks-BM4sD6Xc.mjs} +28 -11
  59. package/dist/planner-sql-checks-BM4sD6Xc.mjs.map +1 -0
  60. package/dist/planner-sql-checks.d.mts +11 -0
  61. package/dist/planner-sql-checks.d.mts.map +1 -1
  62. package/dist/planner-sql-checks.mjs +1 -1
  63. package/dist/{planner-target-details-iYJwzFHP.d.mts → planner-target-details-CIj61DUj.d.mts} +1 -1
  64. package/dist/{planner-target-details-iYJwzFHP.d.mts.map → planner-target-details-CIj61DUj.d.mts.map} +1 -1
  65. package/dist/planner-target-details.d.mts +1 -1
  66. package/dist/planner.d.mts +1 -1
  67. package/dist/planner.d.mts.map +1 -1
  68. package/dist/planner.mjs +1 -1
  69. package/dist/postgres-contract-serializer-CcZO9ukP.mjs +83 -0
  70. package/dist/postgres-contract-serializer-CcZO9ukP.mjs.map +1 -0
  71. package/dist/{postgres-enum-type-CrKq8au9.d.mts → postgres-enum-type-CNhPTDhy.d.mts} +1 -1
  72. package/dist/{postgres-enum-type-CrKq8au9.d.mts.map → postgres-enum-type-CNhPTDhy.d.mts.map} +1 -1
  73. package/dist/{postgres-migration-q4oWyNJE.mjs → postgres-migration-C5os-tkl.mjs} +3 -3
  74. package/dist/{postgres-migration-q4oWyNJE.mjs.map → postgres-migration-C5os-tkl.mjs.map} +1 -1
  75. package/dist/{postgres-migration-CiQzhcMe.d.mts → postgres-migration-jvsKgUDM.d.mts} +3 -3
  76. package/dist/{postgres-migration-CiQzhcMe.d.mts.map → postgres-migration-jvsKgUDM.d.mts.map} +1 -1
  77. package/dist/postgres-schema-BosNxhWq.mjs +163 -0
  78. package/dist/postgres-schema-BosNxhWq.mjs.map +1 -0
  79. package/dist/{render-ops-CkiuHSNj.mjs → render-ops-BC2PtCkj.mjs} +1 -1
  80. package/dist/{render-ops-CkiuHSNj.mjs.map → render-ops-BC2PtCkj.mjs.map} +1 -1
  81. package/dist/render-ops.d.mts +1 -1
  82. package/dist/render-ops.mjs +1 -1
  83. package/dist/{render-typescript-C9XWI8Ld.mjs → render-typescript-nRHbqLbI.mjs} +1 -1
  84. package/dist/{render-typescript-C9XWI8Ld.mjs.map → render-typescript-nRHbqLbI.mjs.map} +1 -1
  85. package/dist/render-typescript.mjs +1 -1
  86. package/dist/runtime.d.mts +7 -17
  87. package/dist/runtime.d.mts.map +1 -1
  88. package/dist/runtime.mjs +2 -2
  89. package/dist/{shared-DLYdmYo-.d.mts → shared-ByhSooBS.d.mts} +6 -4
  90. package/dist/shared-ByhSooBS.d.mts.map +1 -0
  91. package/dist/{statement-builders-BSIQMClE.mjs → statement-builders-vImtdfmM.mjs} +1 -1
  92. package/dist/{statement-builders-BSIQMClE.mjs.map → statement-builders-vImtdfmM.mjs.map} +1 -1
  93. package/dist/statement-builders.mjs +1 -1
  94. package/dist/{tables-Ce_Q0I8B.mjs → tables-DZ-5Yxi0.mjs} +3 -3
  95. package/dist/tables-DZ-5Yxi0.mjs.map +1 -0
  96. package/dist/{types-Dq74Z3eu.d.mts → types-D-XIpzHA.d.mts} +1 -1
  97. package/dist/types-D-XIpzHA.d.mts.map +1 -0
  98. package/dist/types.d.mts +125 -3
  99. package/dist/types.d.mts.map +1 -0
  100. package/dist/types.mjs +2 -1
  101. package/package.json +17 -17
  102. package/src/core/migrations/issue-planner.ts +131 -41
  103. package/src/core/migrations/operations/constraints.ts +1 -1
  104. package/src/core/migrations/operations/shared.ts +4 -2
  105. package/src/core/migrations/planner-ddl-builders.ts +2 -2
  106. package/src/core/migrations/planner-schema-lookup.ts +30 -6
  107. package/src/core/migrations/planner-sql-checks.ts +29 -11
  108. package/src/core/migrations/planner-strategies.ts +138 -43
  109. package/src/core/migrations/planner.ts +14 -1
  110. package/src/core/migrations/verify-postgres-namespaces.ts +87 -0
  111. package/src/core/postgres-contract-serializer.ts +139 -60
  112. package/src/core/postgres-schema.ts +208 -0
  113. package/src/exports/types.ts +5 -0
  114. package/dist/descriptor-meta-DFUCClk_.mjs +0 -124
  115. package/dist/issue-planner-BhWVYyE1.mjs.map +0 -1
  116. package/dist/planner-DnzPpv1j.mjs.map +0 -1
  117. package/dist/planner-schema-lookup--u9whY_Y.mjs +0 -29
  118. package/dist/planner-schema-lookup--u9whY_Y.mjs.map +0 -1
  119. package/dist/planner-sql-checks-Cd016Ycs.mjs.map +0 -1
  120. package/dist/postgres-contract-serializer-D5VJk6lo.mjs +0 -61
  121. package/dist/postgres-contract-serializer-D5VJk6lo.mjs.map +0 -1
  122. package/dist/shared-DLYdmYo-.d.mts.map +0 -1
  123. package/dist/tables-Ce_Q0I8B.mjs.map +0 -1
  124. package/dist/types-Dq74Z3eu.d.mts.map +0 -1
@@ -2,6 +2,17 @@ import { CodecControlHooks } from "@prisma-next/family-sql/control";
2
2
  import { PostgresEnumStorageEntry, StorageColumn, StorageTypeInstance } from "@prisma-next/sql-contract/types";
3
3
 
4
4
  //#region src/core/migrations/planner-sql-checks.d.ts
5
+ /**
6
+ * String-keyed entry points the migration ops use to render
7
+ * schema-qualified DDL and catalog checks. The `schema` argument is
8
+ * interpreted as a namespace coordinate: the framework `__unbound__`
9
+ * sentinel resolves to the late-bound `PostgresUnboundSchema` singleton
10
+ * (which elides the qualifier so `search_path` decides at runtime); any
11
+ * other id materialises a `PostgresSchema(id)` whose qualifier is the
12
+ * named schema. Helpers route through these `Namespace` concretions so
13
+ * the unbound branch lives in the polymorphic override, not the call
14
+ * site.
15
+ */
5
16
  declare function qualifyTableName(schema: string, table: string): string;
6
17
  declare function toRegclassLiteral(schema: string, name: string): string;
7
18
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"planner-sql-checks.d.mts","names":[],"sources":["../src/core/migrations/planner-sql-checks.ts"],"mappings":";;;;iBASgB,gBAAA,CAAiB,MAAA,UAAgB,KAAA;AAAA,iBAIjC,iBAAA,CAAkB,MAAA,UAAgB,IAAA;AAJlD;;;;;AAAA,iBAcgB,qBAAA,CAAA;EACd,cAAA;EACA,MAAA;EACA,KAAA;EACA;AAAA;EAEA,cAAA;EACA,MAAA;EACA,KAAA;EACA,MAAA;AAAA;AAAA,iBAec,iBAAA,CAAA;EACd,MAAA;EACA,KAAA;EACA,MAAA;EACA;AAAA;EAEA,MAAA;EACA,KAAA;EACA,MAAA;EACA,MAAA;AAAA;AAAA,iBAYc,sBAAA,CAAA;EACd,MAAA;EACA,KAAA;EACA,MAAA;EACA;AAAA;EAEA,MAAA;EACA,KAAA;EACA,MAAA;EACA,QAAA;AAAA;AAAA,iBAac,iBAAA,CAAkB,kBAAA;AAAA,iBAIlB,uBAAA,CAAwB,IAAA;EACtC,MAAA;EACA,KAAA;EACA,MAAA;AAAA;AAAA,iBAwIc,uBAAA,CACd,MAAA,EAAQ,aAAA,EACR,UAAA,EAAY,GAAA,SAAY,iBAAA,GACxB,YAAA,GAAc,MAAA,SAAe,mBAAA,GAAsB,wBAAA;AAAA,iBAoErC,uBAAA,CACd,MAAA,UACA,KAAA,UACA,MAAA,WACA,cAAA"}
1
+ {"version":3,"file":"planner-sql-checks.d.mts","names":[],"sources":["../src/core/migrations/planner-sql-checks.ts"],"mappings":";;;;;;AAqBA;;;;;AAIA;;;;iBAJgB,gBAAA,CAAiB,MAAA,UAAgB,KAAA;AAAA,iBAIjC,iBAAA,CAAkB,MAAA,UAAgB,IAAA;;;;;;iBASlC,qBAAA,CAAA;EACd,cAAA;EACA,MAAA;EACA,KAAA;EACA;AAAA;EAEA,cAAA;EACA,MAAA;EACA,KAAA;EACA,MAAA;AAAA;AAAA,iBAgBc,iBAAA,CAAA;EACd,MAAA;EACA,KAAA;EACA,MAAA;EACA;AAAA;EAEA,MAAA;EACA,KAAA;EACA,MAAA;EACA,MAAA;AAAA;AAAA,iBAac,sBAAA,CAAA;EACd,MAAA;EACA,KAAA;EACA,MAAA;EACA;AAAA;EAEA,MAAA;EACA,KAAA;EACA,MAAA;EACA,QAAA;AAAA;AAAA,iBAcc,iBAAA,CAAkB,kBAAA;AAAA,iBAIlB,uBAAA,CAAwB,IAAA;EACtC,MAAA;EACA,KAAA;EACA,MAAA;AAAA;AAAA,iBAyIc,uBAAA,CACd,MAAA,EAAQ,aAAA,EACR,UAAA,EAAY,GAAA,SAAY,iBAAA,GACxB,YAAA,GAAc,MAAA,SAAe,mBAAA,GAAsB,wBAAA;AAAA,iBAsErC,uBAAA,CACd,MAAA,UACA,KAAA,UACA,MAAA,WACA,cAAA"}
@@ -1,2 +1,2 @@
1
- import { a as columnNullabilityCheck, c as qualifyTableName, d as toRegclassLiteral, i as columnHasNoDefaultCheck, l as tableHasPrimaryKeyCheck, r as columnExistsCheck, s as constraintExistsCheck, t as buildExpectedFormatType, u as tableIsEmptyCheck } from "./planner-sql-checks-Cd016Ycs.mjs";
1
+ import { a as columnNullabilityCheck, c as qualifyTableName, d as toRegclassLiteral, i as columnHasNoDefaultCheck, l as tableHasPrimaryKeyCheck, r as columnExistsCheck, s as constraintExistsCheck, t as buildExpectedFormatType, u as tableIsEmptyCheck } from "./planner-sql-checks-BM4sD6Xc.mjs";
2
2
  export { buildExpectedFormatType, columnExistsCheck, columnHasNoDefaultCheck, columnNullabilityCheck, constraintExistsCheck, qualifyTableName, tableHasPrimaryKeyCheck, tableIsEmptyCheck, toRegclassLiteral };
@@ -8,4 +8,4 @@ interface PostgresPlanTargetDetails {
8
8
  }
9
9
  //#endregion
10
10
  export { PostgresPlanTargetDetails as t };
11
- //# sourceMappingURL=planner-target-details-iYJwzFHP.d.mts.map
11
+ //# sourceMappingURL=planner-target-details-CIj61DUj.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"planner-target-details-iYJwzFHP.d.mts","names":[],"sources":["../src/core/migrations/planner-target-details.ts"],"mappings":";KAEY,cAAA;AAAA,UAUK,yBAAA;EAAA,SACN,MAAA;EAAA,SACA,UAAA,EAAY,cAAA;EAAA,SACZ,IAAA;EAAA,SACA,KAAA;AAAA"}
1
+ {"version":3,"file":"planner-target-details-CIj61DUj.d.mts","names":[],"sources":["../src/core/migrations/planner-target-details.ts"],"mappings":";KAEY,cAAA;AAAA,UAUK,yBAAA;EAAA,SACN,MAAA;EAAA,SACA,UAAA,EAAY,cAAA;EAAA,SACZ,IAAA;EAAA,SACA,KAAA;AAAA"}
@@ -1,2 +1,2 @@
1
- import { t as PostgresPlanTargetDetails } from "./planner-target-details-iYJwzFHP.mjs";
1
+ import { t as PostgresPlanTargetDetails } from "./planner-target-details-CIj61DUj.mjs";
2
2
  export { type PostgresPlanTargetDetails };
@@ -1,4 +1,4 @@
1
- import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-D34ftfEK.mjs";
1
+ import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-c9lpjPv1.mjs";
2
2
  import { MigrationOperationPolicy, SqlPlannerFailureResult } from "@prisma-next/family-sql/control";
3
3
  import { MigrationPlanWithAuthoringSurface, MigrationPlanner, MigrationScaffoldContext } from "@prisma-next/framework-components/control";
4
4
  import { Contract } from "@prisma-next/contract/types";
@@ -1 +1 @@
1
- {"version":3,"file":"planner.d.mts","names":[],"sources":["../src/core/migrations/planner.ts"],"mappings":";;;;;;;UAwCU,aAAA;EAAA,SACC,aAAA;AAAA;AAAA,iBAOK,8BAAA,CACd,MAAA,GAAQ,OAAA,CAAQ,aAAA,IACf,wBAAA;;;;AAFH;;;;KAgBY,kBAAA;EAAA,SACG,IAAA;EAAA,SAA0B,IAAA,EAAM,qCAAA;AAAA,IAC3C,uBAAA;;;;;;;AAFJ;;;;;;;;;;cAoBa,wBAAA,YAAoC,gBAAA;EAAA,iBAClB,MAAA;cAAA,MAAA,EAAQ,aAAA;EAErC,IAAA,CAAK,OAAA;IAAA,SACM,QAAA;IAAA,SACA,MAAA;IAAA,SACA,MAAA,EAAQ,wBAAA;IAiBa;;;;;;;;;;;;;;IAAA,SAFrB,YAAA,EAAc,QAAA;IAAA,SACd,UAAA;IAAA,SACA,mBAAA,EAAqB,aAAA,CAAc,8BAAA;IAFnC;;;;;IAAA,SAQA,OAAA;EAAA,IACP,kBAAA;EAIJ,cAAA,CACE,OAAA,EAAS,wBAAA,EACT,OAAA,WACC,iCAAA;EAAA,QAWK,OAAA;EAAA,QA6DA,oBAAA;EAAA,QAaA,mBAAA;AAAA"}
1
+ {"version":3,"file":"planner.d.mts","names":[],"sources":["../src/core/migrations/planner.ts"],"mappings":";;;;;;;UAyCU,aAAA;EAAA,SACC,aAAA;AAAA;AAAA,iBAOK,8BAAA,CACd,MAAA,GAAQ,OAAA,CAAQ,aAAA,IACf,wBAAA;;;;AAFH;;;;KAgBY,kBAAA;EAAA,SACG,IAAA;EAAA,SAA0B,IAAA,EAAM,qCAAA;AAAA,IAC3C,uBAAA;;;;;;;AAFJ;;;;;;;;;;cAoBa,wBAAA,YAAoC,gBAAA;EAAA,iBAClB,MAAA;cAAA,MAAA,EAAQ,aAAA;EAErC,IAAA,CAAK,OAAA;IAAA,SACM,QAAA;IAAA,SACA,MAAA;IAAA,SACA,MAAA,EAAQ,wBAAA;IAiBa;;;;;;;;;;;;;;IAAA,SAFrB,YAAA,EAAc,QAAA;IAAA,SACd,UAAA;IAAA,SACA,mBAAA,EAAqB,aAAA,CAAc,8BAAA;IAFnC;;;;;IAAA,SAQA,OAAA;EAAA,IACP,kBAAA;EAIJ,cAAA,CACE,OAAA,EAAS,wBAAA,EACT,OAAA,WACC,iCAAA;EAAA,QAWK,OAAA;EAAA,QA6DA,oBAAA;EAAA,QAaA,mBAAA;AAAA"}
package/dist/planner.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { t as createPostgresMigrationPlanner } from "./planner-DnzPpv1j.mjs";
1
+ import { t as createPostgresMigrationPlanner } from "./planner-C8yhbXOq.mjs";
2
2
  export { createPostgresMigrationPlanner };
@@ -0,0 +1,83 @@
1
+ import { t as PostgresEnumType } from "./postgres-enum-type-DS-KLVRH.mjs";
2
+ import { r as isPostgresSchema, t as PostgresSchema } from "./postgres-schema-BosNxhWq.mjs";
3
+ import { NamespaceBase, UNBOUND_NAMESPACE_ID } from "@prisma-next/framework-components/ir";
4
+ import { StorageTable } from "@prisma-next/sql-contract/types";
5
+ import { SqlContractSerializerBase } from "@prisma-next/family-sql/ir";
6
+ //#region src/core/postgres-contract-serializer.ts
7
+ var PostgresContractSerializer = class extends SqlContractSerializerBase {
8
+ constructor() {
9
+ super(/* @__PURE__ */ new Map());
10
+ }
11
+ hydrateSqlNamespaceEntry(nsId, raw) {
12
+ if (raw instanceof NamespaceBase) return raw;
13
+ const obj = raw;
14
+ const id = obj.id ?? nsId;
15
+ const tables = Object.fromEntries(Object.entries(obj.tables ?? {}).map(([tableName, table]) => [tableName, table instanceof StorageTable ? table : new StorageTable(table)]));
16
+ const typeEntries = obj.types;
17
+ const hydratedNsTypes = typeEntries !== void 0 && Object.keys(typeEntries).length > 0 ? Object.fromEntries(Object.entries(typeEntries).map(([typeName, entry]) => {
18
+ if (entry instanceof PostgresEnumType) return [typeName, entry];
19
+ const plain = entry;
20
+ const name = typeof plain["name"] === "string" ? plain["name"] : typeName;
21
+ return [typeName, new PostgresEnumType({
22
+ name,
23
+ nativeType: typeof plain["nativeType"] === "string" ? plain["nativeType"] : name,
24
+ values: Array.isArray(plain["values"]) ? plain["values"] : []
25
+ })];
26
+ })) : void 0;
27
+ const emptyTables = Object.keys(tables).length === 0;
28
+ const emptyTypes = !hydratedNsTypes || Object.keys(hydratedNsTypes).length === 0;
29
+ if (id === UNBOUND_NAMESPACE_ID && emptyTables && emptyTypes) return PostgresSchema.unbound;
30
+ return new PostgresSchema({
31
+ id,
32
+ tables,
33
+ ...hydratedNsTypes !== void 0 ? { types: hydratedNsTypes } : {}
34
+ });
35
+ }
36
+ serializeContract(contract) {
37
+ const { storage, ...rest } = contract;
38
+ const namespacesJson = {};
39
+ for (const [nsId, ns] of Object.entries(storage.namespaces)) if (isPostgresSchema(ns)) namespacesJson[nsId] = this.serializePostgresNamespace(ns, ns.id === UNBOUND_NAMESPACE_ID);
40
+ else {
41
+ const isUnboundSlot = nsId === UNBOUND_NAMESPACE_ID;
42
+ const nsTypes = ns.types ?? {};
43
+ namespacesJson[nsId] = {
44
+ id: nsId,
45
+ kind: isUnboundSlot ? "postgres-unbound-schema" : "postgres-schema",
46
+ tables: Object.fromEntries(Object.entries(ns.tables).map(([tableName, table]) => [tableName, this.serializeJsonValue(table)])),
47
+ types: Object.fromEntries(Object.entries(nsTypes).map(([typeName, entry]) => [typeName, this.serializeJsonValue(entry)]))
48
+ };
49
+ }
50
+ const storageOut = {
51
+ storageHash: String(storage.storageHash),
52
+ namespaces: namespacesJson
53
+ };
54
+ if (storage.types !== void 0) {
55
+ const typesOut = {};
56
+ for (const [name, entry] of Object.entries(storage.types)) typesOut[name] = this.serializeJsonValue(entry);
57
+ storageOut["types"] = typesOut;
58
+ }
59
+ return {
60
+ ...rest,
61
+ storage: storageOut
62
+ };
63
+ }
64
+ serializePostgresNamespace(ns, isUnboundSlot) {
65
+ const tablesOut = {};
66
+ for (const [tableName, table] of Object.entries(ns.tables)) tablesOut[tableName] = this.serializeJsonValue(table);
67
+ const typesOut = {};
68
+ for (const [typeName, ty] of Object.entries(ns.types)) typesOut[typeName] = this.serializeJsonValue(ty);
69
+ return {
70
+ id: ns.id,
71
+ kind: isUnboundSlot ? "postgres-unbound-schema" : "postgres-schema",
72
+ tables: tablesOut,
73
+ types: typesOut
74
+ };
75
+ }
76
+ serializeJsonValue(value) {
77
+ return JSON.parse(JSON.stringify(value));
78
+ }
79
+ };
80
+ //#endregion
81
+ export { PostgresContractSerializer as t };
82
+
83
+ //# sourceMappingURL=postgres-contract-serializer-CcZO9ukP.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postgres-contract-serializer-CcZO9ukP.mjs","names":[],"sources":["../src/core/postgres-contract-serializer.ts"],"sourcesContent":["import type { Contract } from '@prisma-next/contract/types';\nimport { SqlContractSerializerBase } from '@prisma-next/family-sql/ir';\nimport {\n type Namespace,\n NamespaceBase,\n UNBOUND_NAMESPACE_ID,\n} from '@prisma-next/framework-components/ir';\nimport {\n type SqlNamespaceTablesInput,\n type SqlStorage,\n StorageTable,\n type StorageTableInput,\n} from '@prisma-next/sql-contract/types';\nimport type { JsonObject } from '@prisma-next/utils/json';\nimport { PostgresEnumType, type PostgresEnumTypeInput } from './postgres-enum-type';\nimport { isPostgresSchema, PostgresSchema } from './postgres-schema';\n\nexport class PostgresContractSerializer extends SqlContractSerializerBase<Contract<SqlStorage>> {\n constructor() {\n // Postgres entity types (enums) are namespace-level and hydrated in\n // hydrateSqlNamespaceEntry; there are no storage-level codec alias entities\n // specific to Postgres, so the registry is empty.\n super(new Map());\n }\n\n protected override hydrateSqlNamespaceEntry(\n nsId: string,\n raw: Namespace | Record<string, unknown>,\n ): Namespace | SqlNamespaceTablesInput {\n if (raw instanceof NamespaceBase) {\n return raw;\n }\n const obj = raw as {\n id?: string;\n tables?: Record<string, unknown>;\n types?: Record<string, unknown>;\n };\n const id = obj.id ?? nsId;\n const tables = Object.fromEntries(\n Object.entries(obj.tables ?? {}).map(([tableName, table]) => [\n tableName,\n table instanceof StorageTable ? table : new StorageTable(table as StorageTableInput),\n ]),\n );\n const typeEntries = obj.types;\n const hydratedNsTypes =\n typeEntries !== undefined && Object.keys(typeEntries).length > 0\n ? Object.fromEntries(\n Object.entries(typeEntries).map(([typeName, entry]) => {\n if (entry instanceof PostgresEnumType) {\n return [typeName, entry];\n }\n const plain = entry as Record<string, unknown>;\n const name = typeof plain['name'] === 'string' ? plain['name'] : typeName;\n const nativeType =\n typeof plain['nativeType'] === 'string' ? plain['nativeType'] : name;\n const values = Array.isArray(plain['values']) ? (plain['values'] as string[]) : [];\n return [\n typeName,\n new PostgresEnumType({ name, nativeType, values } as PostgresEnumTypeInput),\n ];\n }),\n )\n : undefined;\n\n const emptyTables = Object.keys(tables).length === 0;\n const emptyTypes = !hydratedNsTypes || Object.keys(hydratedNsTypes).length === 0;\n if (id === UNBOUND_NAMESPACE_ID && emptyTables && emptyTypes) {\n return PostgresSchema.unbound;\n }\n return new PostgresSchema({\n id,\n tables,\n ...(hydratedNsTypes !== undefined ? { types: hydratedNsTypes } : {}),\n });\n }\n\n override serializeContract(contract: Contract<SqlStorage>): JsonObject {\n const { storage, ...rest } = contract;\n const namespacesJson: Record<string, JsonObject> = {};\n for (const [nsId, ns] of Object.entries(storage.namespaces)) {\n if (isPostgresSchema(ns)) {\n namespacesJson[nsId] = this.serializePostgresNamespace(ns, ns.id === UNBOUND_NAMESPACE_ID);\n } else {\n // Family-level SqlNamespacePayload / SqlUnboundNamespace haven't\n // been promoted to a PostgresSchema instance yet (e.g. they came\n // straight from the TS builder, which uses the family-shared\n // SqlStorage constructor). Serialise them as postgres-schema /\n // postgres-unbound-schema so the round-trip through\n // deserializeContract hydrates them back into PostgresSchema\n // instances.\n const isUnboundSlot = nsId === UNBOUND_NAMESPACE_ID;\n const nsTypes = (ns as { readonly types?: Readonly<Record<string, unknown>> }).types ?? {};\n namespacesJson[nsId] = {\n id: nsId,\n kind: isUnboundSlot ? 'postgres-unbound-schema' : 'postgres-schema',\n tables: Object.fromEntries(\n Object.entries(ns.tables).map(([tableName, table]) => [\n tableName,\n this.serializeJsonValue(table) as JsonObject,\n ]),\n ),\n types: Object.fromEntries(\n Object.entries(nsTypes).map(([typeName, entry]) => [\n typeName,\n this.serializeJsonValue(entry) as JsonObject,\n ]),\n ),\n };\n }\n }\n const storageOut: Record<string, unknown> = {\n storageHash: String(storage.storageHash),\n namespaces: namespacesJson,\n };\n if (storage.types !== undefined) {\n const typesOut: Record<string, JsonObject> = {};\n for (const [name, entry] of Object.entries(storage.types)) {\n typesOut[name] = this.serializeJsonValue(entry) as JsonObject;\n }\n storageOut['types'] = typesOut;\n }\n return {\n ...rest,\n storage: storageOut,\n } as unknown as JsonObject;\n }\n\n private serializePostgresNamespace(ns: PostgresSchema, isUnboundSlot: boolean): JsonObject {\n const tablesOut: Record<string, JsonObject> = {};\n for (const [tableName, table] of Object.entries(ns.tables)) {\n tablesOut[tableName] = this.serializeJsonValue(table) as JsonObject;\n }\n const typesOut: Record<string, JsonObject> = {};\n for (const [typeName, ty] of Object.entries(ns.types)) {\n typesOut[typeName] = this.serializeJsonValue(ty) as JsonObject;\n }\n return {\n id: ns.id,\n kind: isUnboundSlot ? 'postgres-unbound-schema' : 'postgres-schema',\n tables: tablesOut,\n types: typesOut,\n };\n }\n\n private serializeJsonValue(value: unknown): unknown {\n return JSON.parse(JSON.stringify(value)) as unknown;\n }\n}\n"],"mappings":";;;;;;AAiBA,IAAa,6BAAb,cAAgD,0BAAgD;CAC9F,cAAc;EAIZ,sBAAM,IAAI,KAAK,CAAC;;CAGlB,yBACE,MACA,KACqC;EACrC,IAAI,eAAe,eACjB,OAAO;EAET,MAAM,MAAM;EAKZ,MAAM,KAAK,IAAI,MAAM;EACrB,MAAM,SAAS,OAAO,YACpB,OAAO,QAAQ,IAAI,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,WAAW,CAC3D,WACA,iBAAiB,eAAe,QAAQ,IAAI,aAAa,MAA2B,CACrF,CAAC,CACH;EACD,MAAM,cAAc,IAAI;EACxB,MAAM,kBACJ,gBAAgB,KAAA,KAAa,OAAO,KAAK,YAAY,CAAC,SAAS,IAC3D,OAAO,YACL,OAAO,QAAQ,YAAY,CAAC,KAAK,CAAC,UAAU,WAAW;GACrD,IAAI,iBAAiB,kBACnB,OAAO,CAAC,UAAU,MAAM;GAE1B,MAAM,QAAQ;GACd,MAAM,OAAO,OAAO,MAAM,YAAY,WAAW,MAAM,UAAU;GAIjE,OAAO,CACL,UACA,IAAI,iBAAiB;IAAE;IAAM,YAJ7B,OAAO,MAAM,kBAAkB,WAAW,MAAM,gBAAgB;IAIvB,QAH5B,MAAM,QAAQ,MAAM,UAAU,GAAI,MAAM,YAAyB,EAAE;IAG/B,CAA0B,CAC5E;IACD,CACH,GACD,KAAA;EAEN,MAAM,cAAc,OAAO,KAAK,OAAO,CAAC,WAAW;EACnD,MAAM,aAAa,CAAC,mBAAmB,OAAO,KAAK,gBAAgB,CAAC,WAAW;EAC/E,IAAI,OAAO,wBAAwB,eAAe,YAChD,OAAO,eAAe;EAExB,OAAO,IAAI,eAAe;GACxB;GACA;GACA,GAAI,oBAAoB,KAAA,IAAY,EAAE,OAAO,iBAAiB,GAAG,EAAE;GACpE,CAAC;;CAGJ,kBAA2B,UAA4C;EACrE,MAAM,EAAE,SAAS,GAAG,SAAS;EAC7B,MAAM,iBAA6C,EAAE;EACrD,KAAK,MAAM,CAAC,MAAM,OAAO,OAAO,QAAQ,QAAQ,WAAW,EACzD,IAAI,iBAAiB,GAAG,EACtB,eAAe,QAAQ,KAAK,2BAA2B,IAAI,GAAG,OAAO,qBAAqB;OACrF;GAQL,MAAM,gBAAgB,SAAS;GAC/B,MAAM,UAAW,GAA8D,SAAS,EAAE;GAC1F,eAAe,QAAQ;IACrB,IAAI;IACJ,MAAM,gBAAgB,4BAA4B;IAClD,QAAQ,OAAO,YACb,OAAO,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,WAAW,CACpD,WACA,KAAK,mBAAmB,MAAM,CAC/B,CAAC,CACH;IACD,OAAO,OAAO,YACZ,OAAO,QAAQ,QAAQ,CAAC,KAAK,CAAC,UAAU,WAAW,CACjD,UACA,KAAK,mBAAmB,MAAM,CAC/B,CAAC,CACH;IACF;;EAGL,MAAM,aAAsC;GAC1C,aAAa,OAAO,QAAQ,YAAY;GACxC,YAAY;GACb;EACD,IAAI,QAAQ,UAAU,KAAA,GAAW;GAC/B,MAAM,WAAuC,EAAE;GAC/C,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,QAAQ,MAAM,EACvD,SAAS,QAAQ,KAAK,mBAAmB,MAAM;GAEjD,WAAW,WAAW;;EAExB,OAAO;GACL,GAAG;GACH,SAAS;GACV;;CAGH,2BAAmC,IAAoB,eAAoC;EACzF,MAAM,YAAwC,EAAE;EAChD,KAAK,MAAM,CAAC,WAAW,UAAU,OAAO,QAAQ,GAAG,OAAO,EACxD,UAAU,aAAa,KAAK,mBAAmB,MAAM;EAEvD,MAAM,WAAuC,EAAE;EAC/C,KAAK,MAAM,CAAC,UAAU,OAAO,OAAO,QAAQ,GAAG,MAAM,EACnD,SAAS,YAAY,KAAK,mBAAmB,GAAG;EAElD,OAAO;GACL,IAAI,GAAG;GACP,MAAM,gBAAgB,4BAA4B;GAClD,QAAQ;GACR,OAAO;GACR;;CAGH,mBAA2B,OAAyB;EAClD,OAAO,KAAK,MAAM,KAAK,UAAU,MAAM,CAAC"}
@@ -66,4 +66,4 @@ declare class PostgresEnumType<TName extends string = string, TValues extends re
66
66
  }
67
67
  //#endregion
68
68
  export { PostgresEnumTypeInput as n, PostgresEnumType as t };
69
- //# sourceMappingURL=postgres-enum-type-CrKq8au9.d.mts.map
69
+ //# sourceMappingURL=postgres-enum-type-CNhPTDhy.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-enum-type-CrKq8au9.d.mts","names":[],"sources":["../src/core/postgres-enum-type.ts"],"mappings":";;;UAGiB,qBAAA;;AAAjB;;;;WASW,IAAA,EAAM,KAAA;EAPf;;;;;EAAA,SAaS,UAAA;EAAA,SACA,MAAA,EAAQ,OAAA;AAAA;AAClB;AAAA,cAGK,gBAAA;;;;AAyBN;;;;;;;;;;;;;;;;;;;;cAAa,gBAAA,+FAGH,OAAA;EAAA,SACU,IAAA;EAAA,SACT,IAAA,EAAM,KAAA;EAAA,SACN,UAAA;EAAA,SACA,MAAA,EAAQ,OAAA;;;;;;;;;;WAUR,OAAA,SAAgB,gBAAA;cAEb,KAAA,EAAO,qBAAA,CAAsB,KAAA,EAAO,OAAA;EAAA,IAW5C,YAAA,CAAA;IAAA,SACO,OAAA,SAAgB,gBAAA;IAAA,SAChB,UAAA;MAAA,SAAuB,MAAA,EAAQ,OAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"postgres-enum-type-CNhPTDhy.d.mts","names":[],"sources":["../src/core/postgres-enum-type.ts"],"mappings":";;;UAGiB,qBAAA;;AAAjB;;;;WASW,IAAA,EAAM,KAAA;EAPf;;;;;EAAA,SAaS,UAAA;EAAA,SACA,MAAA,EAAQ,OAAA;AAAA;AAClB;AAAA,cAGK,gBAAA;;;;AAyBN;;;;;;;;;;;;;;;;;;;;cAAa,gBAAA,+FAGH,OAAA;EAAA,SACU,IAAA;EAAA,SACT,IAAA,EAAM,KAAA;EAAA,SACN,UAAA;EAAA,SACA,MAAA,EAAQ,OAAA;;;;;;;;;;WAUR,OAAA,SAAgB,gBAAA;cAEb,KAAA,EAAO,qBAAA,CAAsB,KAAA,EAAO,OAAA;EAAA,IAW5C,YAAA,CAAA;IAAA,SACO,OAAA,SAAgB,gBAAA;IAAA,SAChB,UAAA;MAAA,SAAuB,MAAA,EAAQ,OAAA;IAAA;EAAA;AAAA"}
@@ -1,5 +1,5 @@
1
- import { t as errorPostgresMigrationStackMissing } from "./errors-BiOloWUh.mjs";
2
- import { t as dataTransform } from "./data-transform-COkGR6Ns.mjs";
1
+ import { t as errorPostgresMigrationStackMissing } from "./errors--zafB5_n.mjs";
2
+ import { t as dataTransform } from "./data-transform-CdtGUWp2.mjs";
3
3
  import { Migration } from "@prisma-next/family-sql/migration";
4
4
  //#region src/core/migrations/postgres-migration.ts
5
5
  /**
@@ -48,4 +48,4 @@ var PostgresMigration = class extends Migration {
48
48
  //#endregion
49
49
  export { PostgresMigration as t };
50
50
 
51
- //# sourceMappingURL=postgres-migration-q4oWyNJE.mjs.map
51
+ //# sourceMappingURL=postgres-migration-C5os-tkl.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-migration-q4oWyNJE.mjs","names":["SqlMigration"],"sources":["../src/core/migrations/postgres-migration.ts"],"sourcesContent":["import type { Contract } from '@prisma-next/contract/types';\nimport type { SqlMigrationPlanOperation } from '@prisma-next/family-sql/control';\nimport type { SqlControlAdapter } from '@prisma-next/family-sql/control-adapter';\nimport { Migration as SqlMigration } from '@prisma-next/family-sql/migration';\nimport type { ControlStack } from '@prisma-next/framework-components/control';\nimport type { SqlStorage } from '@prisma-next/sql-contract/types';\nimport { errorPostgresMigrationStackMissing } from '../errors';\nimport { type DataTransformOptions, dataTransform } from './operations/data-transform';\nimport type { PostgresPlanTargetDetails } from './planner-target-details';\n\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 `@prisma-next/family-mongo`: the renderer\n * emits `extends Migration` against a target-specific re-export of this\n * class from `@prisma-next/target-postgres/migration`, keeping the\n * authoring surface 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 */\nexport abstract class PostgresMigration extends SqlMigration<\n PostgresPlanTargetDetails,\n 'postgres'\n> {\n readonly targetId = 'postgres' as const;\n\n /**\n * Materialized Postgres control adapter, created once per migration\n * instance from the injected stack. `undefined` only when the migration\n * was instantiated without a stack (test fixtures); `dataTransform`\n * throws in that case to surface the misuse.\n */\n protected readonly controlAdapter: SqlControlAdapter<'postgres'> | undefined;\n\n constructor(stack?: ControlStack<'sql', 'postgres'>) {\n super(stack);\n // The descriptor `create()` is typed as the wider `ControlAdapterInstance`;\n // the Postgres descriptor concretely returns a `SqlControlAdapter<'postgres'>`,\n // so the cast holds for any Postgres-target stack assembled at runtime.\n this.controlAdapter = stack?.adapter\n ? (stack.adapter.create(stack) as SqlControlAdapter<'postgres'>)\n : undefined;\n }\n\n /**\n * Instance-method wrapper around the free `dataTransform` factory that\n * supplies the stored control adapter. Authors call this from inside\n * `get operations()`; the adapter argument is hidden from the call site.\n */\n protected dataTransform<TContract extends Contract<SqlStorage>>(\n contract: TContract,\n name: string,\n options: DataTransformOptions,\n ): SqlMigrationPlanOperation<PostgresPlanTargetDetails> {\n if (!this.controlAdapter) {\n throw errorPostgresMigrationStackMissing();\n }\n return dataTransform(contract, name, options, this.controlAdapter);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAsB,oBAAtB,cAAgDA,UAG9C;CACA,WAAoB;;;;;;;CAQpB;CAEA,YAAY,OAAyC;EACnD,MAAM,MAAM;EAIZ,KAAK,iBAAiB,OAAO,UACxB,MAAM,QAAQ,OAAO,MAAM,GAC5B,KAAA;;;;;;;CAQN,cACE,UACA,MACA,SACsD;EACtD,IAAI,CAAC,KAAK,gBACR,MAAM,oCAAoC;EAE5C,OAAO,cAAc,UAAU,MAAM,SAAS,KAAK,eAAe"}
1
+ {"version":3,"file":"postgres-migration-C5os-tkl.mjs","names":["SqlMigration"],"sources":["../src/core/migrations/postgres-migration.ts"],"sourcesContent":["import type { Contract } from '@prisma-next/contract/types';\nimport type { SqlMigrationPlanOperation } from '@prisma-next/family-sql/control';\nimport type { SqlControlAdapter } from '@prisma-next/family-sql/control-adapter';\nimport { Migration as SqlMigration } from '@prisma-next/family-sql/migration';\nimport type { ControlStack } from '@prisma-next/framework-components/control';\nimport type { SqlStorage } from '@prisma-next/sql-contract/types';\nimport { errorPostgresMigrationStackMissing } from '../errors';\nimport { type DataTransformOptions, dataTransform } from './operations/data-transform';\nimport type { PostgresPlanTargetDetails } from './planner-target-details';\n\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 `@prisma-next/family-mongo`: the renderer\n * emits `extends Migration` against a target-specific re-export of this\n * class from `@prisma-next/target-postgres/migration`, keeping the\n * authoring surface 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 */\nexport abstract class PostgresMigration extends SqlMigration<\n PostgresPlanTargetDetails,\n 'postgres'\n> {\n readonly targetId = 'postgres' as const;\n\n /**\n * Materialized Postgres control adapter, created once per migration\n * instance from the injected stack. `undefined` only when the migration\n * was instantiated without a stack (test fixtures); `dataTransform`\n * throws in that case to surface the misuse.\n */\n protected readonly controlAdapter: SqlControlAdapter<'postgres'> | undefined;\n\n constructor(stack?: ControlStack<'sql', 'postgres'>) {\n super(stack);\n // The descriptor `create()` is typed as the wider `ControlAdapterInstance`;\n // the Postgres descriptor concretely returns a `SqlControlAdapter<'postgres'>`,\n // so the cast holds for any Postgres-target stack assembled at runtime.\n this.controlAdapter = stack?.adapter\n ? (stack.adapter.create(stack) as SqlControlAdapter<'postgres'>)\n : undefined;\n }\n\n /**\n * Instance-method wrapper around the free `dataTransform` factory that\n * supplies the stored control adapter. Authors call this from inside\n * `get operations()`; the adapter argument is hidden from the call site.\n */\n protected dataTransform<TContract extends Contract<SqlStorage>>(\n contract: TContract,\n name: string,\n options: DataTransformOptions,\n ): SqlMigrationPlanOperation<PostgresPlanTargetDetails> {\n if (!this.controlAdapter) {\n throw errorPostgresMigrationStackMissing();\n }\n return dataTransform(contract, name, options, this.controlAdapter);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAsB,oBAAtB,cAAgDA,UAG9C;CACA,WAAoB;;;;;;;CAQpB;CAEA,YAAY,OAAyC;EACnD,MAAM,MAAM;EAIZ,KAAK,iBAAiB,OAAO,UACxB,MAAM,QAAQ,OAAO,MAAM,GAC5B,KAAA;;;;;;;CAQN,cACE,UACA,MACA,SACsD;EACtD,IAAI,CAAC,KAAK,gBACR,MAAM,oCAAoC;EAE5C,OAAO,cAAc,UAAU,MAAM,SAAS,KAAK,eAAe"}
@@ -1,5 +1,5 @@
1
- import { t as PostgresPlanTargetDetails } from "./planner-target-details-iYJwzFHP.mjs";
2
- import { n as DataTransformOptions } from "./data-transform-B6p02mFJ.mjs";
1
+ import { t as PostgresPlanTargetDetails } from "./planner-target-details-CIj61DUj.mjs";
2
+ import { n as DataTransformOptions } from "./data-transform-bmOKkygi.mjs";
3
3
  import { SqlMigrationPlanOperation } from "@prisma-next/family-sql/control";
4
4
  import { SqlStorage } from "@prisma-next/sql-contract/types";
5
5
  import { Migration } from "@prisma-next/family-sql/migration";
@@ -47,4 +47,4 @@ declare abstract class PostgresMigration extends Migration<PostgresPlanTargetDet
47
47
  }
48
48
  //#endregion
49
49
  export { PostgresMigration as t };
50
- //# sourceMappingURL=postgres-migration-CiQzhcMe.d.mts.map
50
+ //# sourceMappingURL=postgres-migration-jvsKgUDM.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-migration-CiQzhcMe.d.mts","names":[],"sources":["../src/core/migrations/postgres-migration.ts"],"mappings":";;;;;;;;;;;;AA8BA;;;;;;;;;;;;;;;;;;uBAAsB,iBAAA,SAA0B,SAAA,CAC9C,yBAAA;EAAA,SAGS,QAAA;;;;;;;qBAQU,cAAA,EAAgB,iBAAA;cAEvB,KAAA,GAAQ,YAAA;EAgBlB;;;;;EAAA,UADQ,aAAA,mBAAgC,QAAA,CAAS,UAAA,EAAA,CACjD,QAAA,EAAU,SAAA,EACV,IAAA,UACA,OAAA,EAAS,oBAAA,GACR,yBAAA,CAA0B,yBAAA;AAAA"}
1
+ {"version":3,"file":"postgres-migration-jvsKgUDM.d.mts","names":[],"sources":["../src/core/migrations/postgres-migration.ts"],"mappings":";;;;;;;;;;;;AA8BA;;;;;;;;;;;;;;;;;;uBAAsB,iBAAA,SAA0B,SAAA,CAC9C,yBAAA;EAAA,SAGS,QAAA;;;;;;;qBAQU,cAAA,EAAgB,iBAAA;cAEvB,KAAA,GAAQ,YAAA;EAgBlB;;;;;EAAA,UADQ,aAAA,mBAAgC,QAAA,CAAS,UAAA,EAAA,CACjD,QAAA,EAAU,SAAA,EACV,IAAA,UACA,OAAA,EAAS,oBAAA,GACR,yBAAA,CAA0B,yBAAA;AAAA"}
@@ -0,0 +1,163 @@
1
+ import { t as PostgresEnumType } from "./postgres-enum-type-DS-KLVRH.mjs";
2
+ import { n as escapeLiteral } from "./sql-utils-BewXAnsG.mjs";
3
+ import { NamespaceBase, UNBOUND_NAMESPACE_ID, freezeNode } from "@prisma-next/framework-components/ir";
4
+ import { StorageTable } from "@prisma-next/sql-contract/types";
5
+ //#region src/core/postgres-schema.ts
6
+ /**
7
+ * Postgres target `Namespace` concretion — a Postgres schema (`CREATE
8
+ * SCHEMA …`). Each Postgres `SqlStorage` carries a
9
+ * `namespaces: Record<NamespaceId, PostgresSchema>` map populated by
10
+ * the Postgres PSL interpreter from `namespace { … }` AST buckets.
11
+ *
12
+ * Qualifier emission is the rendering seam: DDL / SQL emission asks the
13
+ * namespace for its qualifier (`"<schema>"`) or for a qualified table
14
+ * name (`"<schema>"."<table>"`) and consumes the result polymorphically.
15
+ * The unbound singleton below overrides these methods to elide the
16
+ * prefix entirely — call sites stay polymorphic and never branch on
17
+ * `id === UNBOUND_NAMESPACE_ID`.
18
+ */
19
+ var PostgresSchema = class extends NamespaceBase {
20
+ /**
21
+ * Stable singleton reference for the late-bound slot. Materialised
22
+ * lazily below the singleton subclass declaration so the static
23
+ * initialiser sees the subclass before assigning. Consumers always
24
+ * reach for `PostgresSchema.unbound` (or `PostgresUnboundSchema.instance`
25
+ * — same identity).
26
+ */
27
+ static unbound;
28
+ kind = "schema";
29
+ id;
30
+ tables;
31
+ types;
32
+ constructor(input) {
33
+ super();
34
+ this.id = input.id;
35
+ this.tables = Object.freeze(Object.fromEntries(Object.entries(input.tables ?? {}).map(([name, t]) => [name, t instanceof StorageTable ? t : new StorageTable(t)])));
36
+ this.types = Object.freeze(Object.fromEntries(Object.entries(input.types ?? {}).map(([name, ty]) => [name, ty instanceof PostgresEnumType ? ty : new PostgresEnumType(ty)])));
37
+ freezeNode(this);
38
+ }
39
+ /**
40
+ * The bare schema qualifier as it would appear in a rendered SQL
41
+ * fragment (already quoted). The unbound-schema singleton overrides
42
+ * this to return `''`.
43
+ */
44
+ qualifier() {
45
+ return `"${this.id}"`;
46
+ }
47
+ /**
48
+ * Qualify a table name with the schema prefix
49
+ * (`"<schema>"."<table>"`). The unbound-schema singleton overrides
50
+ * this to emit just `"<table>"` so the resolved DDL is unqualified
51
+ * and `search_path` decides where the object lands at runtime.
52
+ */
53
+ qualifyTable(tableName) {
54
+ return `"${this.id}"."${tableName}"`;
55
+ }
56
+ /**
57
+ * Render a SQL string-literal containing the qualified-name form
58
+ * suitable for `to_regclass(...)` arguments (e.g. `'"public"."user"'`).
59
+ * The unbound singleton overrides this to elide the schema prefix
60
+ * (`'"user"'`) so `search_path` resolves the object at runtime.
61
+ */
62
+ regclassLiteral(name) {
63
+ return `'${escapeLiteral(this.qualifyTable(name))}'`;
64
+ }
65
+ /**
66
+ * Render a SQL expression that evaluates to this namespace's schema
67
+ * name at runtime, ready to drop into a `WHERE table_schema = …` /
68
+ * `WHERE n.nspname = …` clause. Named schemas emit a quoted SQL
69
+ * literal (`'public'`); the unbound singleton overrides this to emit
70
+ * `current_schema()` so catalog queries match whichever schema the
71
+ * connection's `search_path` resolved at runtime.
72
+ */
73
+ schemaSqlExpression() {
74
+ return `'${escapeLiteral(this.id)}'`;
75
+ }
76
+ /**
77
+ * The bare schema name a DDL planner should target when emitting
78
+ * statements that need to identify this namespace in the live
79
+ * database (e.g. `CREATE TABLE "<ddlSchemaName>"."<table>" …`,
80
+ * catalog filters, planner conflict lookups). Named schemas resolve
81
+ * to their own id; the unbound singleton overrides this to project
82
+ * to `'public'` when a sibling public namespace exists in the same
83
+ * contract — and falls back to the framework sentinel otherwise so
84
+ * the planner can detect the missing-projection case explicitly.
85
+ */
86
+ ddlSchemaName(_storage) {
87
+ return this.id;
88
+ }
89
+ };
90
+ /**
91
+ * Singleton subclass for the reserved sentinel namespace id
92
+ * (`UNBOUND_NAMESPACE_ID`) — the late-bound Postgres slot whose binding
93
+ * the connection's `search_path` resolves at runtime. Overrides
94
+ * qualifier emission to elide the schema prefix; call sites that consume
95
+ * `qualifier()` / `qualifyTable()` get unqualified output without
96
+ * branching on the namespace id.
97
+ *
98
+ * This is the target-side materialization of "the framework provides
99
+ * affordances; targets implement specifics": the framework names the
100
+ * sentinel; Postgres decides what late-bound means here (the table
101
+ * name, naked — the schema is supplied by the live connection's
102
+ * `search_path`).
103
+ */
104
+ var PostgresUnboundSchema = class PostgresUnboundSchema extends PostgresSchema {
105
+ static instance = new PostgresUnboundSchema();
106
+ constructor(input) {
107
+ super(input ?? { id: UNBOUND_NAMESPACE_ID });
108
+ }
109
+ qualifier() {
110
+ return "";
111
+ }
112
+ qualifyTable(tableName) {
113
+ return `"${tableName}"`;
114
+ }
115
+ schemaSqlExpression() {
116
+ return "current_schema()";
117
+ }
118
+ /**
119
+ * The unbound slot has no schema name of its own, so DDL emission
120
+ * projects it onto a sibling when one is available: if the contract
121
+ * carries a `public` namespace, the late-bound slot resolves to
122
+ * `'public'` (the default Postgres landing schema); otherwise it
123
+ * resolves to the framework sentinel `UNBOUND_NAMESPACE_ID` so the
124
+ * planner can recognise the unprojected case and route accordingly
125
+ * (e.g. emit a conflict instead of silently picking a schema).
126
+ */
127
+ ddlSchemaName(storage) {
128
+ if (storage.namespaces["public"] !== void 0) return "public";
129
+ return UNBOUND_NAMESPACE_ID;
130
+ }
131
+ };
132
+ PostgresSchema.unbound = PostgresUnboundSchema.instance;
133
+ /**
134
+ * Narrow an arbitrary namespace (or `undefined`) to `PostgresSchema`
135
+ * so callers can dispatch to the polymorphic emission methods without
136
+ * branching at the call site. Uses the structural `kind` discriminator
137
+ * (`'schema'`) rather than `instanceof` so the check survives realm /
138
+ * bundle / hot-reload boundaries — matching the rest of the IR's
139
+ * narrowing convention. `PostgresUnboundSchema` passes through because
140
+ * it inherits the same `kind: 'schema'` from `PostgresSchema`.
141
+ */
142
+ function isPostgresSchema(ns) {
143
+ return ns?.kind === "schema";
144
+ }
145
+ /**
146
+ * Target-supplied `Namespace` factory the Postgres target plumbs
147
+ * through `defineContract({ createNamespace })` and the SQL PSL
148
+ * interpreter. Returns the unbound singleton for the framework
149
+ * sentinel and a fresh `PostgresSchema` for any other coordinate.
150
+ *
151
+ * The factory has no per-call state — every named id deterministically
152
+ * maps to a distinct schema instance — so callers can pass it through
153
+ * by reference and trust the resulting `SqlStorage.namespaces` map to
154
+ * be value-stable for a given input set.
155
+ */
156
+ function postgresCreateNamespace(input) {
157
+ if (input.id === UNBOUND_NAMESPACE_ID) return new PostgresUnboundSchema(input);
158
+ return new PostgresSchema(input);
159
+ }
160
+ //#endregion
161
+ export { postgresCreateNamespace as i, PostgresUnboundSchema as n, isPostgresSchema as r, PostgresSchema as t };
162
+
163
+ //# sourceMappingURL=postgres-schema-BosNxhWq.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postgres-schema-BosNxhWq.mjs","names":[],"sources":["../src/core/postgres-schema.ts"],"sourcesContent":["import {\n freezeNode,\n NamespaceBase,\n UNBOUND_NAMESPACE_ID,\n} from '@prisma-next/framework-components/ir';\nimport {\n type SqlNamespaceTablesInput,\n type SqlStorage,\n StorageTable,\n type StorageTableInput,\n} from '@prisma-next/sql-contract/types';\nimport { PostgresEnumType, type PostgresEnumTypeInput } from './postgres-enum-type';\nimport { escapeLiteral } from './sql-utils';\n\nexport interface PostgresSchemaInput {\n readonly id: string;\n readonly tables?: Record<string, StorageTable | StorageTableInput>;\n readonly types?: Record<string, PostgresEnumType | PostgresEnumTypeInput>;\n}\n\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 * Qualifier emission is the rendering seam: DDL / SQL emission asks the\n * namespace for its qualifier (`\"<schema>\"`) or for a qualified table\n * name (`\"<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 */\nexport class PostgresSchema extends NamespaceBase {\n /**\n * Stable singleton reference for the late-bound slot. Materialised\n * lazily below the singleton subclass declaration so the static\n * initialiser sees the subclass before assigning. Consumers always\n * reach for `PostgresSchema.unbound` (or `PostgresUnboundSchema.instance`\n * — same identity).\n */\n static unbound: PostgresUnboundSchema;\n\n readonly kind = 'schema' as const;\n readonly id: string;\n readonly tables: Readonly<Record<string, StorageTable>>;\n readonly types: Readonly<Record<string, PostgresEnumType>>;\n\n constructor(input: PostgresSchemaInput) {\n super();\n this.id = input.id;\n this.tables = Object.freeze(\n Object.fromEntries(\n Object.entries(input.tables ?? {}).map(([name, t]) => [\n name,\n t instanceof StorageTable ? t : new StorageTable(t),\n ]),\n ),\n );\n this.types = Object.freeze(\n Object.fromEntries(\n Object.entries(input.types ?? {}).map(([name, ty]) => [\n name,\n ty instanceof PostgresEnumType ? ty : new PostgresEnumType(ty),\n ]),\n ),\n );\n freezeNode(this);\n }\n\n /**\n * The bare schema qualifier as it would appear in a rendered SQL\n * fragment (already quoted). The unbound-schema singleton overrides\n * this to return `''`.\n */\n qualifier(): string {\n return `\"${this.id}\"`;\n }\n\n /**\n * Qualify a table name with the schema prefix\n * (`\"<schema>\".\"<table>\"`). The unbound-schema singleton overrides\n * this to emit just `\"<table>\"` so the resolved DDL is unqualified\n * and `search_path` decides where the object lands at runtime.\n */\n qualifyTable(tableName: string): string {\n return `\"${this.id}\".\"${tableName}\"`;\n }\n\n /**\n * Render a SQL string-literal containing the qualified-name form\n * suitable for `to_regclass(...)` arguments (e.g. `'\"public\".\"user\"'`).\n * The unbound singleton overrides this to elide the schema prefix\n * (`'\"user\"'`) so `search_path` resolves the object at runtime.\n */\n regclassLiteral(name: string): string {\n return `'${escapeLiteral(this.qualifyTable(name))}'`;\n }\n\n /**\n * Render a SQL expression that evaluates to this namespace's schema\n * name at runtime, ready to drop into a `WHERE table_schema = …` /\n * `WHERE n.nspname = …` clause. Named schemas emit a quoted SQL\n * literal (`'public'`); the unbound singleton overrides this to emit\n * `current_schema()` so catalog queries match whichever schema the\n * connection's `search_path` resolved at runtime.\n */\n schemaSqlExpression(): string {\n return `'${escapeLiteral(this.id)}'`;\n }\n\n /**\n * The bare schema name a DDL planner should target when emitting\n * statements that need to identify this namespace in the live\n * database (e.g. `CREATE TABLE \"<ddlSchemaName>\".\"<table>\" …`,\n * catalog filters, planner conflict lookups). Named schemas resolve\n * to their own id; the unbound singleton overrides this to project\n * to `'public'` when a sibling public namespace exists in the same\n * contract — and falls back to the framework sentinel otherwise so\n * the planner can detect the missing-projection case explicitly.\n */\n ddlSchemaName(_storage: SqlStorage): string {\n return this.id;\n }\n}\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 */\nexport class PostgresUnboundSchema extends PostgresSchema {\n static readonly instance: PostgresUnboundSchema = new PostgresUnboundSchema();\n\n constructor(input?: PostgresSchemaInput) {\n super(input ?? { id: UNBOUND_NAMESPACE_ID });\n }\n\n override qualifier(): string {\n return '';\n }\n\n override qualifyTable(tableName: string): string {\n return `\"${tableName}\"`;\n }\n\n override schemaSqlExpression(): string {\n return 'current_schema()';\n }\n\n /**\n * The unbound slot has no schema name of its own, so DDL emission\n * projects it onto a sibling when one is available: if the contract\n * carries a `public` namespace, the late-bound slot resolves to\n * `'public'` (the default Postgres landing schema); otherwise it\n * resolves to the framework sentinel `UNBOUND_NAMESPACE_ID` so the\n * planner can recognise the unprojected case and route accordingly\n * (e.g. emit a conflict instead of silently picking a schema).\n */\n override ddlSchemaName(storage: SqlStorage): string {\n if (storage.namespaces['public'] !== undefined) {\n return 'public';\n }\n return UNBOUND_NAMESPACE_ID;\n }\n}\n\nPostgresSchema.unbound = PostgresUnboundSchema.instance;\n\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 */\nexport function isPostgresSchema(ns: unknown): ns is PostgresSchema {\n return (ns as { kind?: unknown } | null | undefined)?.kind === 'schema';\n}\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.\n */\nexport function postgresCreateNamespace(input: SqlNamespaceTablesInput): PostgresSchema {\n if (input.id === UNBOUND_NAMESPACE_ID) {\n return new PostgresUnboundSchema(input);\n }\n return new PostgresSchema(input);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiCA,IAAa,iBAAb,cAAoC,cAAc;;;;;;;;CAQhD,OAAO;CAEP,OAAgB;CAChB;CACA;CACA;CAEA,YAAY,OAA4B;EACtC,OAAO;EACP,KAAK,KAAK,MAAM;EAChB,KAAK,SAAS,OAAO,OACnB,OAAO,YACL,OAAO,QAAQ,MAAM,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,OAAO,CACpD,MACA,aAAa,eAAe,IAAI,IAAI,aAAa,EAAE,CACpD,CAAC,CACH,CACF;EACD,KAAK,QAAQ,OAAO,OAClB,OAAO,YACL,OAAO,QAAQ,MAAM,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,QAAQ,CACpD,MACA,cAAc,mBAAmB,KAAK,IAAI,iBAAiB,GAAG,CAC/D,CAAC,CACH,CACF;EACD,WAAW,KAAK;;;;;;;CAQlB,YAAoB;EAClB,OAAO,IAAI,KAAK,GAAG;;;;;;;;CASrB,aAAa,WAA2B;EACtC,OAAO,IAAI,KAAK,GAAG,KAAK,UAAU;;;;;;;;CASpC,gBAAgB,MAAsB;EACpC,OAAO,IAAI,cAAc,KAAK,aAAa,KAAK,CAAC,CAAC;;;;;;;;;;CAWpD,sBAA8B;EAC5B,OAAO,IAAI,cAAc,KAAK,GAAG,CAAC;;;;;;;;;;;;CAapC,cAAc,UAA8B;EAC1C,OAAO,KAAK;;;;;;;;;;;;;;;;;AAkBhB,IAAa,wBAAb,MAAa,8BAA8B,eAAe;CACxD,OAAgB,WAAkC,IAAI,uBAAuB;CAE7E,YAAY,OAA6B;EACvC,MAAM,SAAS,EAAE,IAAI,sBAAsB,CAAC;;CAG9C,YAA6B;EAC3B,OAAO;;CAGT,aAAsB,WAA2B;EAC/C,OAAO,IAAI,UAAU;;CAGvB,sBAAuC;EACrC,OAAO;;;;;;;;;;;CAYT,cAAuB,SAA6B;EAClD,IAAI,QAAQ,WAAW,cAAc,KAAA,GACnC,OAAO;EAET,OAAO;;;AAIX,eAAe,UAAU,sBAAsB;;;;;;;;;;AAW/C,SAAgB,iBAAiB,IAAmC;CAClE,OAAQ,IAA8C,SAAS;;;;;;;;;;;;;AAcjE,SAAgB,wBAAwB,OAAgD;CACtF,IAAI,MAAM,OAAO,sBACf,OAAO,IAAI,sBAAsB,MAAM;CAEzC,OAAO,IAAI,eAAe,MAAM"}
@@ -20,4 +20,4 @@ function renderOps(calls) {
20
20
  //#endregion
21
21
  export { renderOps as t };
22
22
 
23
- //# sourceMappingURL=render-ops-CkiuHSNj.mjs.map
23
+ //# sourceMappingURL=render-ops-BC2PtCkj.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"render-ops-CkiuHSNj.mjs","names":[],"sources":["../src/core/migrations/render-ops.ts"],"sourcesContent":["import type { SqlMigrationPlanOperation } from '@prisma-next/family-sql/control';\nimport type { OpFactoryCall } from '@prisma-next/framework-components/control';\nimport type { PostgresPlanTargetDetails } from './planner-target-details';\n\ntype Op = SqlMigrationPlanOperation<PostgresPlanTargetDetails>;\n\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(\n op: ReturnType<OpFactoryCall['toOp']>,\n callFactoryName: string,\n): asserts op is Op {\n const targetId = (op as Partial<Op>).target?.id;\n if (targetId !== 'postgres') {\n throw new Error(\n `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.`,\n );\n }\n}\n\nexport function renderOps(calls: readonly OpFactoryCall[]): Op[] {\n return calls.map((c) => {\n const op = c.toOp();\n assertPostgresOp(op, c.factoryName);\n return op;\n });\n}\n"],"mappings":";;;;;;;;AAaA,SAAS,iBACP,IACA,iBACkB;CAClB,MAAM,WAAY,GAAmB,QAAQ;CAC7C,IAAI,aAAa,YACf,MAAM,IAAI,MACR,sDAAsD,OAAO,SAAS,CAAC,eAAe,GAAG,GAAG,kBAAkB,gBAAgB,2HAC/H;;AAIL,SAAgB,UAAU,OAAuC;CAC/D,OAAO,MAAM,KAAK,MAAM;EACtB,MAAM,KAAK,EAAE,MAAM;EACnB,iBAAiB,IAAI,EAAE,YAAY;EACnC,OAAO;GACP"}
1
+ {"version":3,"file":"render-ops-BC2PtCkj.mjs","names":[],"sources":["../src/core/migrations/render-ops.ts"],"sourcesContent":["import type { SqlMigrationPlanOperation } from '@prisma-next/family-sql/control';\nimport type { OpFactoryCall } from '@prisma-next/framework-components/control';\nimport type { PostgresPlanTargetDetails } from './planner-target-details';\n\ntype Op = SqlMigrationPlanOperation<PostgresPlanTargetDetails>;\n\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(\n op: ReturnType<OpFactoryCall['toOp']>,\n callFactoryName: string,\n): asserts op is Op {\n const targetId = (op as Partial<Op>).target?.id;\n if (targetId !== 'postgres') {\n throw new Error(\n `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.`,\n );\n }\n}\n\nexport function renderOps(calls: readonly OpFactoryCall[]): Op[] {\n return calls.map((c) => {\n const op = c.toOp();\n assertPostgresOp(op, c.factoryName);\n return op;\n });\n}\n"],"mappings":";;;;;;;;AAaA,SAAS,iBACP,IACA,iBACkB;CAClB,MAAM,WAAY,GAAmB,QAAQ;CAC7C,IAAI,aAAa,YACf,MAAM,IAAI,MACR,sDAAsD,OAAO,SAAS,CAAC,eAAe,GAAG,GAAG,kBAAkB,gBAAgB,2HAC/H;;AAIL,SAAgB,UAAU,OAAuC;CAC/D,OAAO,MAAM,KAAK,MAAM;EACtB,MAAM,KAAK,EAAE,MAAM;EACnB,iBAAiB,IAAI,EAAE,YAAY;EACnC,OAAO;GACP"}
@@ -1,4 +1,4 @@
1
- import { t as PostgresPlanTargetDetails } from "./planner-target-details-iYJwzFHP.mjs";
1
+ import { t as PostgresPlanTargetDetails } from "./planner-target-details-CIj61DUj.mjs";
2
2
  import { SqlMigrationPlanOperation } from "@prisma-next/family-sql/control";
3
3
  import { OpFactoryCall } from "@prisma-next/framework-components/control";
4
4
 
@@ -1,2 +1,2 @@
1
- import { t as renderOps } from "./render-ops-CkiuHSNj.mjs";
1
+ import { t as renderOps } from "./render-ops-BC2PtCkj.mjs";
2
2
  export { renderOps };
@@ -70,4 +70,4 @@ function indent(text, spaces) {
70
70
  //#endregion
71
71
  export { renderCallsToTypeScript as t };
72
72
 
73
- //# sourceMappingURL=render-typescript-C9XWI8Ld.mjs.map
73
+ //# sourceMappingURL=render-typescript-nRHbqLbI.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"render-typescript-C9XWI8Ld.mjs","names":[],"sources":["../src/core/migrations/render-typescript.ts"],"sourcesContent":["/**\n * Polymorphic TypeScript emitter for the Postgres migration IR.\n *\n * Each `OpFactoryCall` renders itself via `renderTypeScript()` and\n * declares its own `importRequirements()`; this file just composes the module\n * source around those contributions. The design mirrors the Mongo target's\n * `render-typescript.ts` deliberately — byte-for-byte alignment isn't required\n * (different factory module specifiers, different base-class name) but the\n * shape is, so future consolidation to a framework-level helper is mechanical.\n */\n\nimport type { OpFactoryCall } from '@prisma-next/framework-components/control';\nimport { detectScaffoldRuntime, shebangLineFor } from '@prisma-next/migration-tools/migration-ts';\nimport { type ImportRequirement, jsonToTsSource, renderImports } from '@prisma-next/ts-render';\n\nexport interface RenderMigrationMeta {\n readonly from: string | null;\n readonly to: string;\n readonly labels?: readonly string[];\n}\n\n/**\n * Always-present base imports for the rendered scaffold. Both come from\n * `@prisma-next/target-postgres/migration` so an authored Postgres\n * `migration.ts` only needs a single dependency for its base class and\n * its CLI entrypoint:\n *\n * - `Migration` — the target-owned re-export fixes the `SqlMigration`\n * generic to `PostgresPlanTargetDetails` and the abstract `targetId`\n * to `'postgres'`, so user-authored migrations don't need to thread\n * target-details or redeclare `targetId`.\n * - `MigrationCLI` — the migration-file CLI entrypoint, re-exported from\n * `@prisma-next/cli/migration-cli`. Loads `prisma-next.config.ts`,\n * assembles a `ControlStack`, and instantiates the migration class.\n * The migration file owns this dependency directly: pulling CLI\n * machinery in at script run time is acceptable because the script's\n * whole purpose is to be invoked from the project that owns the\n * config.\n */\nconst BASE_IMPORTS: readonly ImportRequirement[] = [\n { moduleSpecifier: '@prisma-next/target-postgres/migration', symbol: 'Migration' },\n { moduleSpecifier: '@prisma-next/target-postgres/migration', symbol: 'MigrationCLI' },\n];\n\nexport function renderCallsToTypeScript(\n calls: ReadonlyArray<OpFactoryCall>,\n meta: RenderMigrationMeta,\n): string {\n const imports = buildImports(calls);\n const operationsBody = calls.map((c) => c.renderTypeScript()).join(',\\n');\n\n return [\n shebangLineFor(detectScaffoldRuntime()),\n imports,\n '',\n 'export default class M extends Migration {',\n buildDescribeMethod(meta),\n ' override get operations() {',\n ' return [',\n indent(operationsBody, 6),\n ' ];',\n ' }',\n '}',\n '',\n 'MigrationCLI.run(import.meta.url, M);',\n '',\n ].join('\\n');\n}\n\nfunction buildImports(calls: ReadonlyArray<OpFactoryCall>): string {\n const requirements: ImportRequirement[] = [...BASE_IMPORTS];\n for (const call of calls) {\n for (const req of call.importRequirements()) {\n requirements.push(req);\n }\n }\n return renderImports(requirements);\n}\n\nfunction buildDescribeMethod(meta: RenderMigrationMeta): string {\n const lines: string[] = [];\n lines.push(' override describe() {');\n lines.push(' return {');\n lines.push(` from: ${JSON.stringify(meta.from)},`);\n lines.push(` to: ${JSON.stringify(meta.to)},`);\n if (meta.labels && meta.labels.length > 0) {\n lines.push(` labels: ${jsonToTsSource(meta.labels)},`);\n }\n lines.push(' };');\n lines.push(' }');\n lines.push('');\n return lines.join('\\n');\n}\n\nfunction indent(text: string, spaces: number): string {\n const pad = ' '.repeat(spaces);\n return text\n .split('\\n')\n .map((line) => (line.trim() ? `${pad}${line}` : line))\n .join('\\n');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuCA,MAAM,eAA6C,CACjD;CAAE,iBAAiB;CAA0C,QAAQ;CAAa,EAClF;CAAE,iBAAiB;CAA0C,QAAQ;CAAgB,CACtF;AAED,SAAgB,wBACd,OACA,MACQ;CACR,MAAM,UAAU,aAAa,MAAM;CACnC,MAAM,iBAAiB,MAAM,KAAK,MAAM,EAAE,kBAAkB,CAAC,CAAC,KAAK,MAAM;CAEzE,OAAO;EACL,eAAe,uBAAuB,CAAC;EACvC;EACA;EACA;EACA,oBAAoB,KAAK;EACzB;EACA;EACA,OAAO,gBAAgB,EAAE;EACzB;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAGd,SAAS,aAAa,OAA6C;CACjE,MAAM,eAAoC,CAAC,GAAG,aAAa;CAC3D,KAAK,MAAM,QAAQ,OACjB,KAAK,MAAM,OAAO,KAAK,oBAAoB,EACzC,aAAa,KAAK,IAAI;CAG1B,OAAO,cAAc,aAAa;;AAGpC,SAAS,oBAAoB,MAAmC;CAC9D,MAAM,QAAkB,EAAE;CAC1B,MAAM,KAAK,0BAA0B;CACrC,MAAM,KAAK,eAAe;CAC1B,MAAM,KAAK,eAAe,KAAK,UAAU,KAAK,KAAK,CAAC,GAAG;CACvD,MAAM,KAAK,aAAa,KAAK,UAAU,KAAK,GAAG,CAAC,GAAG;CACnD,IAAI,KAAK,UAAU,KAAK,OAAO,SAAS,GACtC,MAAM,KAAK,iBAAiB,eAAe,KAAK,OAAO,CAAC,GAAG;CAE7D,MAAM,KAAK,SAAS;CACpB,MAAM,KAAK,MAAM;CACjB,MAAM,KAAK,GAAG;CACd,OAAO,MAAM,KAAK,KAAK;;AAGzB,SAAS,OAAO,MAAc,QAAwB;CACpD,MAAM,MAAM,IAAI,OAAO,OAAO;CAC9B,OAAO,KACJ,MAAM,KAAK,CACX,KAAK,SAAU,KAAK,MAAM,GAAG,GAAG,MAAM,SAAS,KAAM,CACrD,KAAK,KAAK"}
1
+ {"version":3,"file":"render-typescript-nRHbqLbI.mjs","names":[],"sources":["../src/core/migrations/render-typescript.ts"],"sourcesContent":["/**\n * Polymorphic TypeScript emitter for the Postgres migration IR.\n *\n * Each `OpFactoryCall` renders itself via `renderTypeScript()` and\n * declares its own `importRequirements()`; this file just composes the module\n * source around those contributions. The design mirrors the Mongo target's\n * `render-typescript.ts` deliberately — byte-for-byte alignment isn't required\n * (different factory module specifiers, different base-class name) but the\n * shape is, so future consolidation to a framework-level helper is mechanical.\n */\n\nimport type { OpFactoryCall } from '@prisma-next/framework-components/control';\nimport { detectScaffoldRuntime, shebangLineFor } from '@prisma-next/migration-tools/migration-ts';\nimport { type ImportRequirement, jsonToTsSource, renderImports } from '@prisma-next/ts-render';\n\nexport interface RenderMigrationMeta {\n readonly from: string | null;\n readonly to: string;\n readonly labels?: readonly string[];\n}\n\n/**\n * Always-present base imports for the rendered scaffold. Both come from\n * `@prisma-next/target-postgres/migration` so an authored Postgres\n * `migration.ts` only needs a single dependency for its base class and\n * its CLI entrypoint:\n *\n * - `Migration` — the target-owned re-export fixes the `SqlMigration`\n * generic to `PostgresPlanTargetDetails` and the abstract `targetId`\n * to `'postgres'`, so user-authored migrations don't need to thread\n * target-details or redeclare `targetId`.\n * - `MigrationCLI` — the migration-file CLI entrypoint, re-exported from\n * `@prisma-next/cli/migration-cli`. Loads `prisma-next.config.ts`,\n * assembles a `ControlStack`, and instantiates the migration class.\n * The migration file owns this dependency directly: pulling CLI\n * machinery in at script run time is acceptable because the script's\n * whole purpose is to be invoked from the project that owns the\n * config.\n */\nconst BASE_IMPORTS: readonly ImportRequirement[] = [\n { moduleSpecifier: '@prisma-next/target-postgres/migration', symbol: 'Migration' },\n { moduleSpecifier: '@prisma-next/target-postgres/migration', symbol: 'MigrationCLI' },\n];\n\nexport function renderCallsToTypeScript(\n calls: ReadonlyArray<OpFactoryCall>,\n meta: RenderMigrationMeta,\n): string {\n const imports = buildImports(calls);\n const operationsBody = calls.map((c) => c.renderTypeScript()).join(',\\n');\n\n return [\n shebangLineFor(detectScaffoldRuntime()),\n imports,\n '',\n 'export default class M extends Migration {',\n buildDescribeMethod(meta),\n ' override get operations() {',\n ' return [',\n indent(operationsBody, 6),\n ' ];',\n ' }',\n '}',\n '',\n 'MigrationCLI.run(import.meta.url, M);',\n '',\n ].join('\\n');\n}\n\nfunction buildImports(calls: ReadonlyArray<OpFactoryCall>): string {\n const requirements: ImportRequirement[] = [...BASE_IMPORTS];\n for (const call of calls) {\n for (const req of call.importRequirements()) {\n requirements.push(req);\n }\n }\n return renderImports(requirements);\n}\n\nfunction buildDescribeMethod(meta: RenderMigrationMeta): string {\n const lines: string[] = [];\n lines.push(' override describe() {');\n lines.push(' return {');\n lines.push(` from: ${JSON.stringify(meta.from)},`);\n lines.push(` to: ${JSON.stringify(meta.to)},`);\n if (meta.labels && meta.labels.length > 0) {\n lines.push(` labels: ${jsonToTsSource(meta.labels)},`);\n }\n lines.push(' };');\n lines.push(' }');\n lines.push('');\n return lines.join('\\n');\n}\n\nfunction indent(text: string, spaces: number): string {\n const pad = ' '.repeat(spaces);\n return text\n .split('\\n')\n .map((line) => (line.trim() ? `${pad}${line}` : line))\n .join('\\n');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuCA,MAAM,eAA6C,CACjD;CAAE,iBAAiB;CAA0C,QAAQ;CAAa,EAClF;CAAE,iBAAiB;CAA0C,QAAQ;CAAgB,CACtF;AAED,SAAgB,wBACd,OACA,MACQ;CACR,MAAM,UAAU,aAAa,MAAM;CACnC,MAAM,iBAAiB,MAAM,KAAK,MAAM,EAAE,kBAAkB,CAAC,CAAC,KAAK,MAAM;CAEzE,OAAO;EACL,eAAe,uBAAuB,CAAC;EACvC;EACA;EACA;EACA,oBAAoB,KAAK;EACzB;EACA;EACA,OAAO,gBAAgB,EAAE;EACzB;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAGd,SAAS,aAAa,OAA6C;CACjE,MAAM,eAAoC,CAAC,GAAG,aAAa;CAC3D,KAAK,MAAM,QAAQ,OACjB,KAAK,MAAM,OAAO,KAAK,oBAAoB,EACzC,aAAa,KAAK,IAAI;CAG1B,OAAO,cAAc,aAAa;;AAGpC,SAAS,oBAAoB,MAAmC;CAC9D,MAAM,QAAkB,EAAE;CAC1B,MAAM,KAAK,0BAA0B;CACrC,MAAM,KAAK,eAAe;CAC1B,MAAM,KAAK,eAAe,KAAK,UAAU,KAAK,KAAK,CAAC,GAAG;CACvD,MAAM,KAAK,aAAa,KAAK,UAAU,KAAK,GAAG,CAAC,GAAG;CACnD,IAAI,KAAK,UAAU,KAAK,OAAO,SAAS,GACtC,MAAM,KAAK,iBAAiB,eAAe,KAAK,OAAO,CAAC,GAAG;CAE7D,MAAM,KAAK,SAAS;CACpB,MAAM,KAAK,MAAM;CACjB,MAAM,KAAK,GAAG;CACd,OAAO,MAAM,KAAK,KAAK;;AAGzB,SAAS,OAAO,MAAc,QAAwB;CACpD,MAAM,MAAM,IAAI,OAAO,OAAO;CAC9B,OAAO,KACJ,MAAM,KAAK,CACX,KAAK,SAAU,KAAK,MAAM,GAAG,GAAG,MAAM,SAAS,KAAM,CACrD,KAAK,KAAK"}
@@ -1,2 +1,2 @@
1
- import { t as renderCallsToTypeScript } from "./render-typescript-C9XWI8Ld.mjs";
1
+ import { t as renderCallsToTypeScript } from "./render-typescript-nRHbqLbI.mjs";
2
2
  export { renderCallsToTypeScript };
@@ -1,28 +1,18 @@
1
1
  import { AnyCodecDescriptor } from "@prisma-next/framework-components/codec";
2
- import { SqlStorage } from "@prisma-next/sql-contract/types";
2
+ import { Namespace } from "@prisma-next/framework-components/ir";
3
+ import { SqlNamespaceTablesInput, SqlStorage } from "@prisma-next/sql-contract/types";
3
4
  import { SqlContractSerializerBase } from "@prisma-next/family-sql/ir";
4
5
  import { Contract } from "@prisma-next/contract/types";
5
6
  import { RuntimeTargetDescriptor, RuntimeTargetInstance } from "@prisma-next/framework-components/execution";
7
+ import { JsonObject } from "@prisma-next/utils/json";
6
8
 
7
9
  //#region src/core/postgres-contract-serializer.d.ts
8
- /**
9
- * Postgres target `ContractSerializer` concretion. Inherits the full
10
- * SQL-family deserialization pipeline (structural validation +
11
- * hydration walker that materialises the SQL Contract IR class
12
- * hierarchy from the validated JSON envelope). Polymorphic
13
- * `storage.types` entries hydrate through the pack contribution registry
14
- * keyed by each entity type's declared `discriminator` (matching the
15
- * enumerable `kind` on the persisted JSON envelope).
16
- *
17
- * `serializeContract` falls through to the family-base default —
18
- * Postgres' contract is JSON-clean today (`PostgresEnumType`
19
- * instances are frozen with enumerable own properties, so
20
- * `JSON.stringify` produces the canonical envelope shape). Once
21
- * target-only fields land (e.g. per-target derived storage fields)
22
- * this is the home for stripping them from the persisted envelope.
23
- */
24
10
  declare class PostgresContractSerializer extends SqlContractSerializerBase<Contract<SqlStorage>> {
25
11
  constructor();
12
+ protected hydrateSqlNamespaceEntry(nsId: string, raw: Namespace | Record<string, unknown>): Namespace | SqlNamespaceTablesInput;
13
+ serializeContract(contract: Contract<SqlStorage>): JsonObject;
14
+ private serializePostgresNamespace;
15
+ private serializeJsonValue;
26
16
  }
27
17
  //#endregion
28
18
  //#region src/exports/runtime.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.mts","names":[],"sources":["../src/core/postgres-contract-serializer.ts","../src/exports/runtime.ts"],"mappings":";;;;;;;;;;;AAiEA;;;;;;;;;;;;cAAa,0BAAA,SAAmC,yBAAA,CAA0B,QAAA,CAAS,UAAA;;;;;UCxDlE,6BAAA,SAAsC,qBAAA;;;ADwDvD;;;;cChDM,+BAAA,EAAiC,uBAAA,oBAGrC,6BAAA;EAAA,SAES,MAAA,iBAAuB,kBAAA;AAAA"}
1
+ {"version":3,"file":"runtime.d.mts","names":[],"sources":["../src/core/postgres-contract-serializer.ts","../src/exports/runtime.ts"],"mappings":";;;;;;;;;cAiBa,0BAAA,SAAmC,yBAAA,CAA0B,QAAA,CAAS,UAAA;;YAQ9D,wBAAA,CACjB,IAAA,UACA,GAAA,EAAK,SAAA,GAAY,MAAA,oBAChB,SAAA,GAAY,uBAAA;EAiDN,iBAAA,CAAkB,QAAA,EAAU,QAAA,CAAS,UAAA,IAAc,UAAA;EAAA,QAmDpD,0BAAA;EAAA,QAiBA,kBAAA;AAAA;;;UCxIO,6BAAA,SAAsC,qBAAA;;;;;ADQvD;;cCAM,+BAAA,EAAiC,uBAAA,oBAGrC,6BAAA;EAAA,SAES,MAAA,iBAAuB,kBAAA;AAAA"}
package/dist/runtime.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-DFUCClk_.mjs";
2
- import { t as PostgresContractSerializer } from "./postgres-contract-serializer-D5VJk6lo.mjs";
1
+ import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-zrZzWmJF.mjs";
2
+ import { t as PostgresContractSerializer } from "./postgres-contract-serializer-CcZO9ukP.mjs";
3
3
  //#region src/exports/runtime.ts
4
4
  /**
5
5
  * Target-postgres deliberately does NOT import `SqlRuntimeTargetDescriptor` from `@prisma-next/sql-runtime`. The target package is a control-plane residence and must not pull the SQL execution-plane package into its dependency closure. The runtime descriptor here is shaped to satisfy the framework's `RuntimeTargetDescriptor` plus the structural `SqlStaticContributions` (`codecs:` returning a descriptor list) that
@@ -1,4 +1,4 @@
1
- import { t as PostgresPlanTargetDetails } from "./planner-target-details-iYJwzFHP.mjs";
1
+ import { t as PostgresPlanTargetDetails } from "./planner-target-details-CIj61DUj.mjs";
2
2
  import { SqlMigrationPlanOperation } from "@prisma-next/family-sql/control";
3
3
  import { ReferentialAction } from "@prisma-next/sql-contract/types";
4
4
 
@@ -23,13 +23,15 @@ interface ColumnSpec {
23
23
  readonly nullable: boolean;
24
24
  }
25
25
  /**
26
- * Literal-args shape for a foreign key definition. The referenced table is
27
- * assumed to live in the same schema as the constrained table.
26
+ * Literal-args shape for a foreign key definition. `references.schema`
27
+ * carries the target table's namespace (schema) coordinate so the rendered
28
+ * DDL qualifies the REFERENCES clause correctly for cross-schema FKs.
28
29
  */
29
30
  interface ForeignKeySpec {
30
31
  readonly name: string;
31
32
  readonly columns: readonly string[];
32
33
  readonly references: {
34
+ readonly schema: string;
33
35
  readonly table: string;
34
36
  readonly columns: readonly string[];
35
37
  };
@@ -38,4 +40,4 @@ interface ForeignKeySpec {
38
40
  }
39
41
  //#endregion
40
42
  export { ForeignKeySpec as n, Op as r, ColumnSpec as t };
41
- //# sourceMappingURL=shared-DLYdmYo-.d.mts.map
43
+ //# sourceMappingURL=shared-ByhSooBS.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-ByhSooBS.d.mts","names":[],"sources":["../src/core/migrations/operations/shared.ts"],"mappings":";;;;;KAMY,EAAA,GAAK,yBAAA,CAA0B,yBAAA;;AAA3C;;;;;AAcA;;;;;;UAAiB,UAAA;EAAA,SACN,IAAA;EAAA,SACA,OAAA;EAAA,SACA,UAAA;EAAA,SACA,QAAA;AAAA;;;;;;UAQM,cAAA;EAAA,SACN,IAAA;EAAA,SACA,OAAA;EAAA,SACA,UAAA;IAAA,SACE,MAAA;IAAA,SACA,KAAA;IAAA,SACA,OAAA;EAAA;EAAA,SAEF,QAAA,GAAW,iBAAA;EAAA,SACX,QAAA,GAAW,iBAAA;AAAA"}
@@ -128,4 +128,4 @@ function jsonParam(value) {
128
128
  //#endregion
129
129
  export { ensureMarkerTableStatement as a, ensureLedgerTableStatement as i, buildLedgerInsertStatement as n, ensurePrismaContractSchemaStatement as o, buildMergeMarkerStatements as r, APP_SPACE_ID$1 as t };
130
130
 
131
- //# sourceMappingURL=statement-builders-BSIQMClE.mjs.map
131
+ //# sourceMappingURL=statement-builders-vImtdfmM.mjs.map