@prisma/orm-target-postgres 8.0.0-rc.1-dev.1 → 8.0.0-rc.1-dev.3
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.
- package/dist/{adapter-BwjBEeND-B7-Hx3r9.mjs → adapter-Ddgpoq1S-D-Ftx9Ls.mjs} +3 -3
- package/dist/{adapter-BwjBEeND-B7-Hx3r9.mjs.map → adapter-Ddgpoq1S-D-Ftx9Ls.mjs.map} +1 -1
- package/dist/adapter.mjs +2 -2
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__control.mjs +1 -1
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.mjs +2 -2
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/check-expressions-DwM1V1Ky-D9m3Uf8w.d.mts +52 -0
- package/dist/check-expressions-DwM1V1Ky-D9m3Uf8w.d.mts.map +1 -0
- package/dist/check-expressions-drXwak3W-DqFpQtdc.mjs +41 -0
- package/dist/check-expressions-drXwak3W-DqFpQtdc.mjs.map +1 -0
- package/dist/{control-BzDnaGim.mjs → control-8ofLM59h.mjs} +4 -4
- package/dist/{control-BzDnaGim.mjs.map → control-8ofLM59h.mjs.map} +1 -1
- package/dist/{control-adapter-CipVam9p-B-E2SF8_.mjs → control-adapter-D4fT5c42-nSea-5cg.mjs} +10 -81
- package/dist/control-adapter-D4fT5c42-nSea-5cg.mjs.map +1 -0
- package/dist/{control-policy-Cl3RRSPg-BUi6pcI-.mjs → control-policy-wC4BmQy8-Db4igfEn.mjs} +18 -139
- package/dist/control-policy-wC4BmQy8-Db4igfEn.mjs.map +1 -0
- package/dist/{descriptor-meta-DnHabAS3-BiTguA3K.mjs → descriptor-meta-B2fGOCSX-DTh_flIG.mjs} +4 -2
- package/dist/descriptor-meta-B2fGOCSX-DTh_flIG.mjs.map +1 -0
- package/dist/{diff-database-schema-BfRs2vrG-DInOv5LW.mjs → diff-database-schema-wl9GusaU-BjDyKMS6.mjs} +3 -3
- package/dist/{diff-database-schema-BfRs2vrG-DInOv5LW.mjs.map → diff-database-schema-wl9GusaU-BjDyKMS6.mjs.map} +1 -1
- package/dist/driver__runtime.mjs +11 -6
- package/dist/driver__runtime.mjs.map +1 -1
- package/dist/{issue-planner-jkY6p-Ca.d.mts → issue-planner-aw7grdXe.d.mts} +2 -2
- package/dist/{issue-planner-jkY6p-Ca.d.mts.map → issue-planner-aw7grdXe.d.mts.map} +1 -1
- package/dist/{migration-CBSAPE8S.d.mts → migration-DyZpdeyj.d.mts} +3 -3
- package/dist/{migration-CBSAPE8S.d.mts.map → migration-DyZpdeyj.d.mts.map} +1 -1
- package/dist/migration-PTHAY9Cv.mjs.map +1 -1
- package/dist/op-factory-call-ClseZgmP.d.mts +1 -0
- package/dist/{op-factory-call-jd4cgfjA-CyNT4YVn.d.mts → op-factory-call-DJEyoQmT-DSMQffKu.d.mts} +5 -5
- package/dist/{op-factory-call-jd4cgfjA-CyNT4YVn.d.mts.map → op-factory-call-DJEyoQmT-DSMQffKu.d.mts.map} +1 -1
- package/dist/{op-factory-call-DifL68KT-CNFEDNsf.mjs → op-factory-call-rf1FJg8l-C6KLaBY1.mjs} +12 -14
- package/dist/op-factory-call-rf1FJg8l-C6KLaBY1.mjs.map +1 -0
- package/dist/{pack-DFM4tmob.d.mts → pack-j8ePkv1A.d.mts} +3 -1
- package/dist/pack-j8ePkv1A.d.mts.map +1 -0
- package/dist/{planner-DL4Bh5Nk.d.mts → planner-BMBEF8Kc.d.mts} +2 -2
- package/dist/{planner-DL4Bh5Nk.d.mts.map → planner-BMBEF8Kc.d.mts.map} +1 -1
- package/dist/{planner-Bmje9ii8-DdjXZxyD.mjs → planner-CqFym7lA-BKHIkh3V.mjs} +6 -6
- package/dist/{planner-Bmje9ii8-DdjXZxyD.mjs.map → planner-CqFym7lA-BKHIkh3V.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-Cicg2sXg-CZI7mdz9.mjs → planner-produced-postgres-migration-Ci6O7OL5-5k5_6lcD.mjs} +3 -3
- package/dist/{planner-produced-postgres-migration-Cicg2sXg-CZI7mdz9.mjs.map → planner-produced-postgres-migration-Ci6O7OL5-5k5_6lcD.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-B0PQLLUb-qsS6cQqX.d.mts → planner-produced-postgres-migration-Cs252KpU-BvXMZvzX.d.mts} +3 -3
- package/dist/planner-produced-postgres-migration-Cs252KpU-BvXMZvzX.d.mts.map +1 -0
- package/dist/planner-produced-postgres-migration-Cua5YEYV.d.mts +1 -0
- package/dist/{postgres-migration-CJshdIZn-CT6Cxd4x.mjs → postgres-migration-DJqjEDIS-CP437pha.mjs} +4 -4
- package/dist/{postgres-migration-CJshdIZn-CT6Cxd4x.mjs.map → postgres-migration-DJqjEDIS-CP437pha.mjs.map} +1 -1
- package/dist/{postgres-migration-CDJj7CvD-Bsqs_fVo.d.mts → postgres-migration-DPK9WNF5-DHAXtwys.d.mts} +4 -5
- package/dist/postgres-migration-DPK9WNF5-DHAXtwys.d.mts.map +1 -0
- package/dist/target.d.mts +11 -10
- package/dist/target.mjs +9 -8
- package/dist/target__control.mjs +1 -1
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__issue-planner.d.mts +1 -1
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__migration.d.mts +2 -2
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.d.mts +2 -2
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__planner-produced-postgres-migration.d.mts +2 -2
- package/dist/target__planner-produced-postgres-migration.mjs +1 -1
- package/dist/target__planner.d.mts +1 -1
- package/dist/target__planner.mjs +2 -2
- package/dist/target__types.d.mts +2 -1
- package/dist/target__types.mjs +2 -1
- package/dist/types-xa86TkcV.d.mts.map +1 -1
- package/package.json +9 -9
- package/dist/control-adapter-CipVam9p-B-E2SF8_.mjs.map +0 -1
- package/dist/control-policy-Cl3RRSPg-BUi6pcI-.mjs.map +0 -1
- package/dist/descriptor-meta-DnHabAS3-BiTguA3K.mjs.map +0 -1
- package/dist/op-factory-call-DifL68KT-CNFEDNsf.mjs.map +0 -1
- package/dist/op-factory-call-FEA5mnWH.d.mts +0 -1
- package/dist/pack-DFM4tmob.d.mts.map +0 -1
- package/dist/planner-produced-postgres-migration-B0PQLLUb-qsS6cQqX.d.mts.map +0 -1
- package/dist/planner-produced-postgres-migration-C3GPZWeC.d.mts +0 -1
- package/dist/postgres-migration-CDJj7CvD-Bsqs_fVo.d.mts.map +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as DropIndexCall, D as DropTableCall, E as DropPostgresRlsPolicyCall, F as SetDefaultCall, I as SetNotNullCall, M as RawSqlCall, N as RenameIndexCall, O as EnableRowLevelSecurityCall, P as RenamePostgresRlsPolicyCall, S as DropDefaultCall, T as DropNotNullCall, _ as DataTransformCall, a as AddNotNullColumnWithTempDefaultCall, b as DropColumnCall, c as AlterColumnTypeCall, d as CreateIndexCall, g as CreateTableCall, h as CreateSchemaCall, i as AddNativeEnumValueCall, m as CreatePostgresRlsPolicyCall, n as AddColumnCall, o as AddPrimaryKeyCall, p as CreateNativeEnumTypeCall, r as AddForeignKeyCall, s as AddUniqueCall, t as AddCheckConstraintCall, u as CreateExtensionCall, v as DisableRowLevelSecurityCall, w as DropNativeEnumTypeCall, x as DropConstraintCall, y as DropCheckConstraintCall } from "./op-factory-call-
|
|
2
|
-
import "./op-factory-call-
|
|
1
|
+
import { C as DropIndexCall, D as DropTableCall, E as DropPostgresRlsPolicyCall, F as SetDefaultCall, I as SetNotNullCall, M as RawSqlCall, N as RenameIndexCall, O as EnableRowLevelSecurityCall, P as RenamePostgresRlsPolicyCall, S as DropDefaultCall, T as DropNotNullCall, _ as DataTransformCall, a as AddNotNullColumnWithTempDefaultCall, b as DropColumnCall, c as AlterColumnTypeCall, d as CreateIndexCall, g as CreateTableCall, h as CreateSchemaCall, i as AddNativeEnumValueCall, m as CreatePostgresRlsPolicyCall, n as AddColumnCall, o as AddPrimaryKeyCall, p as CreateNativeEnumTypeCall, r as AddForeignKeyCall, s as AddUniqueCall, t as AddCheckConstraintCall, u as CreateExtensionCall, v as DisableRowLevelSecurityCall, w as DropNativeEnumTypeCall, x as DropConstraintCall, y as DropCheckConstraintCall } from "./op-factory-call-DJEyoQmT-DSMQffKu.mjs";
|
|
2
|
+
import "./op-factory-call-ClseZgmP.mjs";
|
|
3
3
|
export { AddCheckConstraintCall, AddColumnCall, AddForeignKeyCall, AddNativeEnumValueCall, AddNotNullColumnWithTempDefaultCall, AddPrimaryKeyCall, AddUniqueCall, AlterColumnTypeCall, CreateExtensionCall, CreateIndexCall, CreateNativeEnumTypeCall, CreatePostgresRlsPolicyCall, CreateSchemaCall, CreateTableCall, DataTransformCall, DisableRowLevelSecurityCall, DropCheckConstraintCall, DropColumnCall, DropConstraintCall, DropDefaultCall, DropIndexCall, DropNativeEnumTypeCall, DropNotNullCall, DropPostgresRlsPolicyCall, DropTableCall, EnableRowLevelSecurityCall, RawSqlCall, RenameIndexCall, RenamePostgresRlsPolicyCall, SetDefaultCall, SetNotNullCall };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as RenamePostgresRlsPolicyCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, M as SetNotNullCall, O as RawSqlCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, g as DataTransformCall, h as CreateTableCall, i as AddNativeEnumValueCall, j as SetDefaultCall, k as RenameIndexCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, o as AddNotNullColumnWithTempDefaultCall, p as CreatePostgresRlsPolicyCall, r as AddForeignKeyCall, s as AddPrimaryKeyCall, t as AddCheckConstraintCall, u as CreateExtensionCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from "./op-factory-call-
|
|
1
|
+
import { A as RenamePostgresRlsPolicyCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, M as SetNotNullCall, O as RawSqlCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, g as DataTransformCall, h as CreateTableCall, i as AddNativeEnumValueCall, j as SetDefaultCall, k as RenameIndexCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, o as AddNotNullColumnWithTempDefaultCall, p as CreatePostgresRlsPolicyCall, r as AddForeignKeyCall, s as AddPrimaryKeyCall, t as AddCheckConstraintCall, u as CreateExtensionCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from "./op-factory-call-rf1FJg8l-C6KLaBY1.mjs";
|
|
2
2
|
export { AddCheckConstraintCall, AddColumnCall, AddForeignKeyCall, AddNativeEnumValueCall, AddNotNullColumnWithTempDefaultCall, AddPrimaryKeyCall, AddUniqueCall, AlterColumnTypeCall, CreateExtensionCall, CreateIndexCall, CreateNativeEnumTypeCall, CreatePostgresRlsPolicyCall, CreateSchemaCall, CreateTableCall, DataTransformCall, DisableRowLevelSecurityCall, DropCheckConstraintCall, DropColumnCall, DropConstraintCall, DropDefaultCall, DropIndexCall, DropNativeEnumTypeCall, DropNotNullCall, DropPostgresRlsPolicyCall, DropTableCall, EnableRowLevelSecurityCall, RawSqlCall, RenameIndexCall, RenamePostgresRlsPolicyCall, SetDefaultCall, SetNotNullCall };
|
package/dist/target__pack.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as postgresTargetDescriptorMeta } from "./pack-
|
|
1
|
+
import { t as postgresTargetDescriptorMeta } from "./pack-j8ePkv1A.mjs";
|
|
2
2
|
export { postgresTargetDescriptorMeta as default };
|
package/dist/target__pack.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-
|
|
1
|
+
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-B2fGOCSX-DTh_flIG.mjs";
|
|
2
2
|
export { postgresTargetDescriptorMeta as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-
|
|
2
|
-
import "./planner-produced-postgres-migration-
|
|
1
|
+
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-Cs252KpU-BvXMZvzX.mjs";
|
|
2
|
+
import "./planner-produced-postgres-migration-Cua5YEYV.mjs";
|
|
3
3
|
export { TypeScriptRenderablePostgresMigration };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-
|
|
1
|
+
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-Ci6O7OL5-5k5_6lcD.mjs";
|
|
2
2
|
export { TypeScriptRenderablePostgresMigration };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createPostgresMigrationPlanner, t as contractToPostgresDatabaseSchemaNode } from "./planner-
|
|
1
|
+
import { n as createPostgresMigrationPlanner, t as contractToPostgresDatabaseSchemaNode } from "./planner-BMBEF8Kc.mjs";
|
|
2
2
|
export { contractToPostgresDatabaseSchemaNode, createPostgresMigrationPlanner };
|
package/dist/target__planner.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as contractToPostgresDatabaseSchemaNode } from "./diff-database-schema-
|
|
2
|
-
import { t as createPostgresMigrationPlanner } from "./planner-
|
|
1
|
+
import { n as contractToPostgresDatabaseSchemaNode } from "./diff-database-schema-wl9GusaU-BjDyKMS6.mjs";
|
|
2
|
+
import { t as createPostgresMigrationPlanner } from "./planner-CqFym7lA-BKHIkh3V.mjs";
|
|
3
3
|
export { contractToPostgresDatabaseSchemaNode, createPostgresMigrationPlanner };
|
package/dist/target__types.d.mts
CHANGED
|
@@ -3,5 +3,6 @@ import { a as PostgresNativeEnumSchemaNode, c as PostgresPolicySchemaNodeInput,
|
|
|
3
3
|
import { t as PostgresSchemaNodeKind } from "./schema-node-kinds-qlnURWJy-Bo30pwTM.mjs";
|
|
4
4
|
import { t as PostgresColumnDefault } from "./types-ue6jkJyF-BQJzjx1P.mjs";
|
|
5
5
|
import { a as PostgresRlsEnablementInput, c as PostgresSchema, d as postgresCreateNamespace, i as PostgresRlsEnablement, l as PostgresUnboundSchema, n as PostgresNativeEnum, o as PostgresRole, r as PostgresNativeEnumInput, s as PostgresRoleInput, t as PostgresContract, u as isPostgresSchema } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
|
|
6
|
+
import { i as postgresRenderCheckExpressions, n as PostgresCheckExpressionInput, r as PostgresCheckKind, t as PostgresCheckExpressionCandidate } from "./check-expressions-DwM1V1Ky-D9m3Uf8w.mjs";
|
|
6
7
|
import { n as policyInputFromSerialized, t as SerializedRlsPolicy } from "./types-xa86TkcV.mjs";
|
|
7
|
-
export { type PostgresColumnDefault, type PostgresContract, PostgresDatabaseSchemaNode, type PostgresDatabaseSchemaNodeInput, PostgresNamespaceSchemaNode, type PostgresNamespaceSchemaNodeInput, PostgresNativeEnum, type PostgresNativeEnumInput, PostgresNativeEnumSchemaNode, type PostgresNativeEnumSchemaNodeInput, PostgresPolicySchemaNode, type PostgresPolicySchemaNodeInput, PostgresRlsEnablement, type PostgresRlsEnablementInput, PostgresRlsPolicy, type PostgresRlsPolicyInput, PostgresRole, type PostgresRoleInput, PostgresRoleSchemaNode, type PostgresRoleSchemaNodeInput, PostgresSchema, PostgresSchemaNodeKind, PostgresTableSchemaNode, type PostgresTableSchemaNodeInput, PostgresUnboundSchema, type RenderedRlsPolicyLiteral, type RlsPolicyOperation, type SerializedRlsPolicy, isPostgresSchema, policyInputFromSerialized, postgresCreateNamespace };
|
|
8
|
+
export { type PostgresCheckExpressionCandidate, type PostgresCheckExpressionInput, type PostgresCheckKind, type PostgresColumnDefault, type PostgresContract, PostgresDatabaseSchemaNode, type PostgresDatabaseSchemaNodeInput, PostgresNamespaceSchemaNode, type PostgresNamespaceSchemaNodeInput, PostgresNativeEnum, type PostgresNativeEnumInput, PostgresNativeEnumSchemaNode, type PostgresNativeEnumSchemaNodeInput, PostgresPolicySchemaNode, type PostgresPolicySchemaNodeInput, PostgresRlsEnablement, type PostgresRlsEnablementInput, PostgresRlsPolicy, type PostgresRlsPolicyInput, PostgresRole, type PostgresRoleInput, PostgresRoleSchemaNode, type PostgresRoleSchemaNodeInput, PostgresSchema, PostgresSchemaNodeKind, PostgresTableSchemaNode, type PostgresTableSchemaNodeInput, PostgresUnboundSchema, type RenderedRlsPolicyLiteral, type RlsPolicyOperation, type SerializedRlsPolicy, isPostgresSchema, policyInputFromSerialized, postgresCreateNamespace, postgresRenderCheckExpressions };
|
package/dist/target__types.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs";
|
|
2
2
|
import { c as PostgresSchema, d as isPostgresSchema, h as postgresCreateNamespace, i as PostgresRlsPolicy, m as policyInputFromSerialized, n as PostgresRlsEnablement, o as PostgresRole, u as PostgresUnboundSchema } from "./postgres-schema-KSzLDONj-CsXGoY8b.mjs";
|
|
3
|
+
import { t as postgresRenderCheckExpressions } from "./check-expressions-drXwak3W-DqFpQtdc.mjs";
|
|
3
4
|
import { n as PostgresSchemaNodeKind, r as PostgresTableSchemaNode, t as PostgresNativeEnumSchemaNode } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
|
|
4
5
|
import { i as PostgresRoleSchemaNode, n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
|
|
5
|
-
export { PostgresDatabaseSchemaNode, PostgresNamespaceSchemaNode, PostgresNativeEnum, PostgresNativeEnumSchemaNode, PostgresPolicySchemaNode, PostgresRlsEnablement, PostgresRlsPolicy, PostgresRole, PostgresRoleSchemaNode, PostgresSchema, PostgresSchemaNodeKind, PostgresTableSchemaNode, PostgresUnboundSchema, isPostgresSchema, policyInputFromSerialized, postgresCreateNamespace };
|
|
6
|
+
export { PostgresDatabaseSchemaNode, PostgresNamespaceSchemaNode, PostgresNativeEnum, PostgresNativeEnumSchemaNode, PostgresPolicySchemaNode, PostgresRlsEnablement, PostgresRlsPolicy, PostgresRole, PostgresRoleSchemaNode, PostgresSchema, PostgresSchemaNodeKind, PostgresTableSchemaNode, PostgresUnboundSchema, isPostgresSchema, policyInputFromSerialized, postgresCreateNamespace, postgresRenderCheckExpressions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-xa86TkcV.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/types.d.mts"],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"types-xa86TkcV.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/types.d.mts"],"mappings":";;;;;;;;;;;;KAYK;WACM;WACA;WACA;WACA;WACA,WAAW;WACX;WACA;WACA;WACA;;;;;;;iBAOM,0BAA0B,MAAM,sBAAsB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-target-postgres",
|
|
3
|
-
"version": "8.0.0-rc.1-dev.
|
|
3
|
+
"version": "8.0.0-rc.1-dev.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@prisma/orm-family-sql": "8.0.0-rc.1-dev.
|
|
13
|
-
"@prisma/orm-framework": "8.0.0-rc.1-dev.
|
|
14
|
-
"@prisma/orm-toolchain": "8.0.0-rc.1-dev.
|
|
12
|
+
"@prisma/orm-family-sql": "8.0.0-rc.1-dev.3",
|
|
13
|
+
"@prisma/orm-framework": "8.0.0-rc.1-dev.3",
|
|
14
|
+
"@prisma/orm-toolchain": "8.0.0-rc.1-dev.3",
|
|
15
15
|
"@standard-schema/spec": "^1.1.0",
|
|
16
16
|
"@types/pg": "8.20.0",
|
|
17
17
|
"arktype": "^2.2.2",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"pg-cursor": "^2.21.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@internal/adapter-postgres": "8.0.0-rc.1-dev.
|
|
24
|
-
"@internal/driver-postgres": "8.0.0-rc.1-dev.
|
|
25
|
-
"@internal/target-postgres": "8.0.0-rc.1-dev.
|
|
26
|
-
"@repo/tsconfig": "8.0.0-rc.1-dev.
|
|
27
|
-
"@repo/tsdown": "8.0.0-rc.1-dev.
|
|
23
|
+
"@internal/adapter-postgres": "8.0.0-rc.1-dev.3",
|
|
24
|
+
"@internal/driver-postgres": "8.0.0-rc.1-dev.3",
|
|
25
|
+
"@internal/target-postgres": "8.0.0-rc.1-dev.3",
|
|
26
|
+
"@repo/tsconfig": "8.0.0-rc.1-dev.3",
|
|
27
|
+
"@repo/tsdown": "8.0.0-rc.1-dev.3",
|
|
28
28
|
"tsdown": "0.22.14",
|
|
29
29
|
"typescript": "5.9.3",
|
|
30
30
|
"vitest": "4.1.10"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-adapter-CipVam9p-B-E2SF8_.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/control-adapter-CipVam9p.mjs"],"sourcesContent":["import { n as adapterError, t as renderLoweredSql } from \"./sql-renderer-CZE98PJj.mjs\";\nimport { APP_SPACE_ID, extractCodecLookup } from \"@internal/framework-components/control\";\nimport { RawExpr, isDdlNode } from \"@internal/sql-relational-core/ast\";\nimport { buildPostgresCodecDescriptorRegistry } from \"@internal/target-postgres/codec-descriptor\";\nimport { postgresCodecDescriptorRegistry, postgresCodecRegistry } from \"@internal/target-postgres/codecs\";\nimport { parseMarkerRowSafely, rethrowMarkerReadError, withMarkerReadErrorHandling } from \"@internal/errors/execution\";\nimport { parseContractMarkerRow } from \"@internal/family-sql/verify\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { REFERENTIAL_ACTION_SQL } from \"@internal/sql-contract/referential-action-sql\";\nimport { namingOfLiveName } from \"@internal/sql-schema-ir/naming\";\nimport { RelationalSchemaNodeKind } from \"@internal/sql-schema-ir/types\";\nimport { buildControlTableBootstrapQueries, buildSignMarkerBootstrapQueries, int4, int8, jsonb, pgTable, text, textArray, timestamptz } from \"@internal/target-postgres/contract-free\";\nimport { parsePostgresDefault } from \"@internal/target-postgres/default-normalizer\";\nimport { postgresError } from \"@internal/target-postgres/errors\";\nimport { normalizeSchemaNativeType } from \"@internal/target-postgres/native-type-normalizer\";\nimport { escapeLiteral, quoteIdentifier } from \"@internal/target-postgres/sql-utils\";\nimport { PostgresDatabaseSchemaNode, PostgresNamespaceSchemaNode, PostgresNativeEnumSchemaNode, PostgresPolicySchemaNode, PostgresRoleSchemaNode, PostgresSchemaNodeKind, PostgresTableSchemaNode } from \"@internal/target-postgres/types\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { createAstCodecRegistry, deriveParamMetadata, encodeParamsWithMetadata } from \"@internal/sql-runtime\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { PG_TIMESTAMPTZ_CODEC_ID } from \"@internal/target-postgres/codec-ids\";\n//#region src/core/codec-lookup.ts\nfunction buildPostgresCodecRegistry(descriptors) {\n\tconst descriptorRegistry = buildPostgresCodecDescriptorRegistry(descriptors);\n\tconst registry = {\n\t\t...extractCodecLookup([{\n\t\t\tid: \"postgres-codecs\",\n\t\t\ttypes: { codecTypes: { codecDescriptors: Array.from(descriptorRegistry.values()) } }\n\t\t}]),\n\t\tdescriptorFor: (codecId) => descriptorRegistry.descriptorFor(codecId),\n\t\tvalues: () => descriptorRegistry.values()\n\t};\n\treturn Object.freeze(registry);\n}\nfunction assemblePostgresCodecRegistry(components) {\n\treturn buildPostgresCodecRegistry(components.flatMap((component) => component.types?.codecTypes?.codecDescriptors ?? []));\n}\nfunction createPostgresCodecRegistryWithBuiltins(codecDescriptors = []) {\n\treturn buildPostgresCodecRegistry([...postgresCodecDescriptorRegistry.values(), ...codecDescriptors]);\n}\n/**\n* Build a coherent PostgreSQL codec registry populated with built-in descriptors only.\n*\n* The returned registry supports both ordinary codec materialization and PostgreSQL target behavior. Stack-composed paths build the same combined registry from their complete ordered descriptor contributions.\n*/\nfunction createPostgresBuiltinCodecLookup() {\n\treturn createPostgresCodecRegistryWithBuiltins();\n}\n//#endregion\n//#region ../../../1-framework/3-tooling/migration/dist/exports/ledger-origin.mjs\nfunction ledgerOriginFromStored(originCoreHash) {\n\tif (originCoreHash === null || originCoreHash === \"\" || originCoreHash === \"empty\") return null;\n\treturn originCoreHash;\n}\n//#endregion\n//#region src/core/control-codecs.ts\nconst CONTROL_CODECS = createAstCodecRegistry(postgresCodecRegistry);\nasync function encodeControlQueryParams(lowered, ast, codecs = CONTROL_CODECS) {\n\treturn encodeParamsWithMetadata(lowered.params.map((slot) => {\n\t\tif (slot.kind === \"literal\") return slot.value;\n\t\tthrow new InternalError(`control query lowered to a bind slot '${slot.name}', which is unsupported`);\n\t}), deriveParamMetadata(ast), {}, codecs);\n}\n//#endregion\n//#region src/core/marker-ledger.ts\nconst marker = pgTable({\n\tname: \"marker\",\n\tschema: \"prisma_contract\"\n}, {\n\tspace: text(),\n\tcore_hash: text(),\n\tprofile_hash: text(),\n\tcontract_json: jsonb({ nullable: true }),\n\tcanonical_version: int4({ nullable: true }),\n\tupdated_at: timestamptz(),\n\tapp_tag: text({ nullable: true }),\n\tmeta: jsonb({ nullable: true }),\n\tinvariants: textArray()\n});\n/**\n* Writeable subset of the `prisma_contract.ledger` table. Omits the\n* DB-generated `id` (bigserial) and `created_at` (default `now()`) so the\n* insert path doesn't have to pass them.\n*/\nconst ledger = pgTable({\n\tname: \"ledger\",\n\tschema: \"prisma_contract\"\n}, {\n\tspace: text(),\n\tmigration_name: text(),\n\tmigration_hash: text(),\n\torigin_core_hash: text({ nullable: true }),\n\tdestination_core_hash: text(),\n\toperations: jsonb()\n});\n/**\n* Content-addressed contract store: one row per distinct contract, keyed\n* by its storage hash. The ledger's `origin_core_hash` /\n* `destination_core_hash` resolve here by hash equality, so both\n* endpoints of every edge are direct lookups and a contract revisited by\n* a rollback cycle is stored exactly once (upsert DO NOTHING).\n*/\nconst ledgerContract = pgTable({\n\tname: \"contract\",\n\tschema: \"prisma_contract\"\n}, {\n\tcore_hash: text(),\n\tcontract_json: jsonb()\n});\n/**\n* Read-side handle covering every column of `prisma_contract.ledger`,\n* including the DB-generated `id` (for ORDER BY) and `created_at`.\n*/\nconst ledgerReadShape = pgTable({\n\tname: \"ledger\",\n\tschema: \"prisma_contract\"\n}, {\n\tid: int8(),\n\tspace: text(),\n\tmigration_name: text(),\n\tmigration_hash: text(),\n\torigin_core_hash: text({ nullable: true }),\n\tdestination_core_hash: text(),\n\toperations: jsonb(),\n\tcreated_at: timestamptz()\n});\nconst infoSchemaTables = pgTable({\n\tname: \"tables\",\n\tschema: \"information_schema\"\n}, {\n\ttable_schema: text(),\n\ttable_name: text()\n});\nconst NOW = new RawExpr({\n\tparts: [\"now()\"],\n\treturns: {\n\t\tcodecId: PG_TIMESTAMPTZ_CODEC_ID,\n\t\tnullable: false\n\t}\n});\nfunction mergeInvariants(current, incoming) {\n\treturn [.../* @__PURE__ */ new Set([...current, ...incoming])].sort();\n}\nasync function execute(lower, driver, query) {\n\tconst lowered = lower(query);\n\tconst encoded = await encodeControlQueryParams(lowered, query);\n\treturn (await driver.query(lowered.sql, encoded)).rows;\n}\n//#endregion\n//#region src/core/control-adapter.ts\nconst POSTGRES_MARKER_TABLE = \"prisma_contract.marker\";\nconst POSTGRES_LEDGER_TABLE = \"prisma_contract.ledger\";\n/**\n* Postgres control plane adapter for control-plane operations like introspection.\n* Provides target-specific implementations for control-plane domain actions.\n*/\nvar PostgresControlAdapter = class {\n\tcodecRegistry;\n\tfamilyId = \"sql\";\n\ttargetId = \"postgres\";\n\tconstructor(codecRegistry) {\n\t\tthis.codecRegistry = codecRegistry;\n\t}\n\t/**\n\t* Target-specific normalizer for raw Postgres default expressions.\n\t* Used by schema verification to normalize raw defaults before comparison.\n\t*/\n\tnormalizeDefault = parsePostgresDefault;\n\t/**\n\t* Target-specific normalizer for Postgres schema native type names.\n\t* Used by schema verification to normalize introspected type names\n\t* before comparison with contract native types.\n\t*/\n\tnormalizeNativeType = normalizeSchemaNativeType;\n\tbootstrapControlTableQueries() {\n\t\treturn buildControlTableBootstrapQueries();\n\t}\n\tbootstrapSignMarkerQueries() {\n\t\treturn buildSignMarkerBootstrapQueries();\n\t}\n\t/**\n\t* Lower a SQL query AST into a Postgres-flavored `{ sql, params }` payload.\n\t*\n\t* Delegates to the shared `renderLoweredSql` renderer so the control adapter\n\t* emits byte-identical SQL to `PostgresAdapterImpl.lower()` for the same AST\n\t* and contract. Used at migration plan/emit time (e.g. by `dataTransform`)\n\t* without instantiating the runtime adapter.\n\t*/\n\tlower(ast, context) {\n\t\tif (isDdlNode(ast)) throw adapterError(\"RUNTIME.DDL_UNSUPPORTED\", \"lower() cannot lower DDL: DDL default literals require inline codec encoding, which is async. Use lowerToExecuteRequest().\", { meta: { surface: \"control-adapter\" } });\n\t\treturn renderLoweredSql(ast, blindCast(context.contract), this.codecRegistry);\n\t}\n\t/**\n\t* Lower an AST all the way to a driver-ready statement. For DDL nodes,\n\t* literal column defaults are formatted as inline SQL with proper quoting and\n\t* `::nativeType` cast suffixes. For query ASTs, params are kept as `$N`\n\t* placeholders; wire values go in `params`. Does NOT call `this.lower()` —\n\t* independent implementation.\n\t*/\n\tasync lowerToExecuteRequest(ast, context) {\n\t\tif (isDdlNode(ast)) return pgRenderDdlExecuteRequest(blindCast(ast), this.codecRegistry);\n\t\tconst lowered = renderLoweredSql(ast, blindCast(context?.contract), this.codecRegistry);\n\t\tconst params = await encodeControlQueryParams(lowered, ast, blindCast(this.codecRegistry));\n\t\treturn {\n\t\t\tsql: lowered.sql,\n\t\t\tparams\n\t\t};\n\t}\n\t/**\n\t* Reads the contract marker from `prisma_contract.marker`. Probes\n\t* `information_schema.tables` first so a fresh database (where the\n\t* `prisma_contract` schema doesn't yet exist) returns `null` instead of a\n\t* \"relation does not exist\" error — some Postgres wire-protocol clients\n\t* (e.g. PGlite's TCP proxy) don't fully recover from extended-protocol\n\t* parse errors, so we probe before reading.\n\t*/\n\tasync readMarker(driver, space) {\n\t\tconst result = await this.readMarkerDiscriminated(driver, space);\n\t\treturn result.kind === \"present\" ? result.record : null;\n\t}\n\tasync readMarkerDiscriminated(driver, space) {\n\t\treturn withMarkerReadErrorHandling(() => this.readMarkerResult(driver, space), {\n\t\t\tspace,\n\t\t\tmarkerLocation: POSTGRES_MARKER_TABLE\n\t\t});\n\t}\n\t/**\n\t* Reads every row from `prisma_contract.marker` and returns them keyed\n\t* by `space`. Mirrors the existence probe in {@link readMarker}: a\n\t* fresh database without the `prisma_contract` schema returns an empty\n\t* map rather than raising \"relation does not exist\".\n\t*/\n\tasync readAllMarkers(driver) {\n\t\treturn withMarkerReadErrorHandling(() => this.readAllMarkersResult(driver), {\n\t\t\tspace: APP_SPACE_ID,\n\t\t\tmarkerLocation: POSTGRES_MARKER_TABLE\n\t\t});\n\t}\n\tasync readAllMarkersResult(driver) {\n\t\tconst lower = (query) => this.lower(query, { contract: void 0 });\n\t\tif ((await execute(lower, driver, infoSchemaTables.select(infoSchemaTables.table_schema).where(infoSchemaTables.table_schema.eq(\"prisma_contract\").and(infoSchemaTables.table_name.eq(\"marker\"))).build())).length === 0) return /* @__PURE__ */ new Map();\n\t\tawait this.assertMarkerTableHasSpaceColumn(driver, APP_SPACE_ID);\n\t\tconst rows = blindCast(await execute(lower, driver, marker.select(marker.space, marker.core_hash, marker.profile_hash, marker.contract_json, marker.canonical_version, marker.updated_at, marker.app_tag, marker.meta, marker.invariants).build()));\n\t\tconst out = /* @__PURE__ */ new Map();\n\t\tfor (const row of rows) out.set(row.space, parseMarkerRowSafely(row, parseContractMarkerRow, {\n\t\t\tspace: row.space,\n\t\t\tmarkerLocation: POSTGRES_MARKER_TABLE\n\t\t}));\n\t\treturn out;\n\t}\n\t/**\n\t* Reads per-migration ledger rows from `prisma_contract.ledger` in apply\n\t* order. Probes `information_schema.tables` first so a fresh database\n\t* without the ledger table returns `[]` instead of raising \"relation does\n\t* not exist\".\n\t*/\n\tasync readLedger(driver, space) {\n\t\treturn withMarkerReadErrorHandling(() => this.readLedgerResult(driver, space), {\n\t\t\tspace: space ?? \"*\",\n\t\t\tmarkerLocation: POSTGRES_LEDGER_TABLE\n\t\t});\n\t}\n\tasync readLedgerResult(driver, space) {\n\t\tconst lower = (query) => this.lower(query, { contract: void 0 });\n\t\tif ((await execute(lower, driver, infoSchemaTables.select(infoSchemaTables.table_schema).where(infoSchemaTables.table_schema.eq(\"prisma_contract\").and(infoSchemaTables.table_name.eq(\"ledger\"))).build())).length === 0) return [];\n\t\tconst base = ledgerReadShape.select(ledgerReadShape.space, ledgerReadShape.migration_name, ledgerReadShape.migration_hash, ledgerReadShape.origin_core_hash, ledgerReadShape.destination_core_hash, ledgerReadShape.operations, ledgerReadShape.created_at);\n\t\treturn blindCast(await execute(lower, driver, (space !== void 0 ? base.where(ledgerReadShape.space.eq(space)) : base).orderBy(ledgerReadShape.id).build())).map((row) => {\n\t\t\tconst appliedAt = row.created_at instanceof Date ? row.created_at : new Date(row.created_at);\n\t\t\treturn {\n\t\t\t\tspace: row.space,\n\t\t\t\tmigrationName: row.migration_name,\n\t\t\t\tmigrationHash: row.migration_hash,\n\t\t\t\tfrom: ledgerOriginFromStored(row.origin_core_hash),\n\t\t\t\tto: row.destination_core_hash,\n\t\t\t\tappliedAt,\n\t\t\t\toperationCount: Array.isArray(row.operations) ? row.operations.length : 0\n\t\t\t};\n\t\t});\n\t}\n\t/**\n\t* Stamps the initial marker row for `space` via the shared contract-free DML\n\t* builder, lowered through {@link lower} and executed on the driver. See the\n\t* `SqlControlAdapter.initMarker` contract.\n\t*/\n\tasync insertMarker(driver, space, destination) {\n\t\tawait execute((query) => this.lower(query, { contract: void 0 }), driver, marker.insert({\n\t\t\tspace,\n\t\t\tcore_hash: destination.storageHash,\n\t\t\tprofile_hash: destination.profileHash,\n\t\t\tcontract_json: null,\n\t\t\tcanonical_version: null,\n\t\t\tupdated_at: NOW,\n\t\t\tapp_tag: null,\n\t\t\tmeta: {},\n\t\t\tinvariants: destination.invariants ?? []\n\t\t}).build());\n\t}\n\tasync initMarker(driver, space, destination) {\n\t\tawait execute((query) => this.lower(query, { contract: void 0 }), driver, marker.upsert({\n\t\t\tspace,\n\t\t\tcore_hash: destination.storageHash,\n\t\t\tprofile_hash: destination.profileHash,\n\t\t\tcontract_json: null,\n\t\t\tcanonical_version: null,\n\t\t\tupdated_at: NOW,\n\t\t\tapp_tag: null,\n\t\t\tmeta: {},\n\t\t\tinvariants: destination.invariants ?? []\n\t\t}).onConflict(marker.space).doUpdate((excluded) => ({\n\t\t\tcore_hash: excluded.core_hash,\n\t\t\tprofile_hash: excluded.profile_hash,\n\t\t\tcontract_json: excluded.contract_json,\n\t\t\tcanonical_version: excluded.canonical_version,\n\t\t\tupdated_at: NOW,\n\t\t\tapp_tag: excluded.app_tag,\n\t\t\tmeta: excluded.meta,\n\t\t\tinvariants: excluded.invariants\n\t\t})).build());\n\t}\n\t/**\n\t* Compare-and-swap advance of the marker row for `space`. See the\n\t* `SqlControlAdapter.updateMarker` contract.\n\t*/\n\tasync updateMarker(driver, space, expectedFrom, destination) {\n\t\tconst currentInvariants = destination.invariants === void 0 ? [] : (await this.readMarker(driver, space))?.invariants ?? [];\n\t\tconst mergedInvariants = destination.invariants === void 0 ? void 0 : mergeInvariants(currentInvariants, destination.invariants);\n\t\treturn (await execute((q) => this.lower(q, { contract: void 0 }), driver, marker.update().set({\n\t\t\tcore_hash: destination.storageHash,\n\t\t\tprofile_hash: destination.profileHash,\n\t\t\tupdated_at: NOW,\n\t\t\t...mergedInvariants !== void 0 ? { invariants: mergedInvariants } : {}\n\t\t}).where(marker.space.eq(space).and(marker.core_hash.eq(expectedFrom))).returning(marker.space).build())).length > 0;\n\t}\n\t/**\n\t* Appends a ledger entry for `space`. When the edge carries a\n\t* destination contract snapshot, the content-addressed\n\t* `prisma_contract.contract` store is populated first (keyed by the\n\t* destination hash, DO NOTHING on revisit) so a reader never sees a\n\t* ledger row whose stored destination contract is missing. See the\n\t* `SqlControlAdapter.writeLedgerEntry` contract.\n\t*/\n\tasync writeLedgerEntry(driver, space, entry) {\n\t\tconst lower = (query) => this.lower(query, { contract: void 0 });\n\t\tif (entry.destinationContractJson !== void 0) await execute(lower, driver, ledgerContract.upsert({\n\t\t\tcore_hash: entry.to,\n\t\t\tcontract_json: entry.destinationContractJson\n\t\t}).onConflict(ledgerContract.core_hash).doNothing().build());\n\t\tawait execute(lower, driver, ledger.insert({\n\t\t\tspace,\n\t\t\tmigration_name: entry.migrationName,\n\t\t\tmigration_hash: entry.migrationHash,\n\t\t\torigin_core_hash: entry.from,\n\t\t\tdestination_core_hash: entry.to,\n\t\t\toperations: entry.operations\n\t\t}).build());\n\t}\n\tasync assertMarkerTableHasSpaceColumn(driver, space) {\n\t\tconst rows = (await driver.query(`select column_name\n from information_schema.columns\n where table_schema = 'prisma_contract'\n and table_name = 'marker'`)).rows;\n\t\tif (rows.length === 0) return;\n\t\tif (!rows.every((row) => typeof row.column_name === \"string\")) return;\n\t\tif (rows.some((row) => row.column_name === \"space\")) return;\n\t\trethrowMarkerReadError(/* @__PURE__ */ new Error(\"column \\\"space\\\" does not exist\"), {\n\t\t\tspace,\n\t\t\tmarkerLocation: POSTGRES_MARKER_TABLE\n\t\t});\n\t}\n\tasync readMarkerResult(driver, space) {\n\t\tconst lower = (query) => this.lower(query, { contract: void 0 });\n\t\tif ((await execute(lower, driver, infoSchemaTables.select(infoSchemaTables.table_schema).where(infoSchemaTables.table_schema.eq(\"prisma_contract\").and(infoSchemaTables.table_name.eq(\"marker\"))).build())).length === 0) return { kind: \"no-table\" };\n\t\tawait this.assertMarkerTableHasSpaceColumn(driver, space);\n\t\tconst row = (await execute(lower, driver, marker.select(marker.core_hash, marker.profile_hash, marker.contract_json, marker.canonical_version, marker.updated_at, marker.app_tag, marker.meta, marker.invariants).where(marker.space.eq(space)).build()))[0];\n\t\tif (!row) return { kind: \"absent\" };\n\t\treturn {\n\t\t\tkind: \"present\",\n\t\t\trecord: parseContractMarkerRow(row)\n\t\t};\n\t}\n\t/**\n\t* Introspects a Postgres database schema and returns a raw SqlSchemaIR.\n\t*\n\t* This is a pure schema discovery operation that queries the Postgres catalog\n\t* and returns the schema structure without type mapping or contract enrichment.\n\t* Type mapping and enrichment are handled separately by enrichment helpers.\n\t*\n\t* When `contract` is provided and its storage declares more than one\n\t* namespace (or any explicit bound namespace), the adapter walks every\n\t* declared namespace and merges the per-schema introspection results\n\t* into a single `SqlSchemaIR`. `UNBOUND_NAMESPACE_ID` resolves to the\n\t* connection's `current_schema()` so late-bound tables follow the\n\t* runtime `search_path`. When no contract is passed, the adapter falls\n\t* back to introspecting the single `schema` argument (defaulting to\n\t* `'public'`).\n\t*\n\t* Uses batched queries to minimize database round trips (6 queries per\n\t* schema walked).\n\t*\n\t* @param driver - SqlControlDriverInstance<'postgres'> instance for executing queries\n\t* @param contract - Optional contract for contract-guided introspection (multi-namespace walk, filtering)\n\t* @param schema - Schema name to introspect when no contract is provided (defaults to 'public')\n\t* @returns Promise resolving to SqlSchemaIR representing the live database schema\n\t*/\n\tasync introspect(driver, contract, schema = \"public\") {\n\t\tconst declaredNamespaces = extractContractNamespaceIds(contract);\n\t\tconst resolvedSchemas = declaredNamespaces.length > 0 ? await this.resolveNamespaceSchemas(driver, declaredNamespaces) : [schema];\n\t\tconst namespaces = {};\n\t\tlet pgVersion = \"unknown\";\n\t\tfor (const resolved of resolvedSchemas) {\n\t\t\tconst { namespace, pgVersion: version } = await this.introspectSchema(driver, resolved);\n\t\t\tnamespaces[resolved] = namespace;\n\t\t\tpgVersion = version;\n\t\t}\n\t\treturn new PostgresDatabaseSchemaNode({\n\t\t\tnamespaces,\n\t\t\troles: await this.introspectRoles(driver),\n\t\t\texistingSchemas: await this.listExistingSchemas(driver),\n\t\t\tpgVersion\n\t\t});\n\t}\n\t/**\n\t* Reads cluster-scoped database roles. Roles are not schema-qualified, so\n\t* this is queried once for the whole database rather than per namespace.\n\t*/\n\tasync introspectRoles(driver) {\n\t\treturn (await driver.query(`SELECT rolname\n FROM pg_catalog.pg_roles\n WHERE rolname NOT LIKE 'pg_%'\n AND rolname != 'postgres'\n ORDER BY rolname`)).rows.map((row) => new PostgresRoleSchemaNode({\n\t\t\tname: row.rolname,\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID\n\t\t}));\n\t}\n\t/**\n\t* Lists every non-system schema present in the connected database.\n\t* The introspection consumer (`verifyPostgresNamespacePresence`)\n\t* treats the result as the authoritative ground truth — declared\n\t* namespaces whose `ddlSchemaName` is missing from this list become\n\t* `missing_schema` issues, and the planner emits the matching\n\t* `CREATE SCHEMA` before table DDL.\n\t*/\n\tasync listExistingSchemas(driver) {\n\t\treturn (await driver.query(`SELECT nspname\n FROM pg_catalog.pg_namespace\n WHERE nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast')\n AND nspname NOT LIKE 'pg_temp_%'\n AND nspname NOT LIKE 'pg_toast_temp_%'\n ORDER BY nspname`)).rows.map((row) => row.nspname);\n\t}\n\t/**\n\t* Resolves the declared namespace ids to their live DDL schema names,\n\t* mapping `UNBOUND_NAMESPACE_ID` to the connection's `current_schema()`\n\t* and de-duplicating. The caller introspects one namespace node per\n\t* resolved schema — there is no flat cross-schema merge, so two schemas\n\t* holding a same-named table no longer collide.\n\t*/\n\tasync resolveNamespaceSchemas(driver, namespaceIds) {\n\t\tconst resolvedSchemas = [];\n\t\tfor (const id of namespaceIds) if (id === UNBOUND_NAMESPACE_ID) {\n\t\t\tconst { rows } = await driver.query(\"SELECT current_schema() AS current_schema\");\n\t\t\tresolvedSchemas.push(rows[0]?.current_schema ?? \"public\");\n\t\t} else resolvedSchemas.push(id);\n\t\treturn Array.from(new Set(resolvedSchemas));\n\t}\n\t/**\n\t* Introspects a single Postgres schema and returns the namespace node for\n\t* that schema (its tables, their policies, and its native enum type names),\n\t* alongside the cluster-scoped Postgres version. Used by `introspect` as\n\t* the per-namespace walk.\n\t*/\n\tasync introspectSchema(driver, schema) {\n\t\tconst tablesResult = await driver.query(`SELECT table_name\n FROM information_schema.tables\n WHERE table_schema = $1\n AND table_type = 'BASE TABLE'\n ORDER BY table_name`, [schema]);\n\t\tconst columnsResult = await driver.query(`SELECT\n c.table_name,\n column_name,\n data_type,\n udt_name,\n is_nullable,\n character_maximum_length,\n numeric_precision,\n numeric_scale,\n column_default,\n format_type(a.atttypid, a.atttypmod) AS formatted_type,\n a.attidentity\n FROM information_schema.columns c\n JOIN pg_catalog.pg_class cl\n ON cl.relname = c.table_name\n JOIN pg_catalog.pg_namespace ns\n ON ns.nspname = c.table_schema\n AND ns.oid = cl.relnamespace\n JOIN pg_catalog.pg_attribute a\n ON a.attrelid = cl.oid\n AND a.attname = c.column_name\n AND a.attnum > 0\n AND NOT a.attisdropped\n WHERE c.table_schema = $1\n ORDER BY c.table_name, c.ordinal_position`, [schema]);\n\t\tconst pkResult = await driver.query(`SELECT\n cl.relname AS table_name,\n con.conname AS constraint_name,\n a.attname AS column_name,\n k.ord AS ordinal_position\n FROM pg_catalog.pg_constraint con\n JOIN pg_catalog.pg_class cl ON cl.oid = con.conrelid\n JOIN pg_catalog.pg_namespace ns ON ns.oid = cl.relnamespace\n JOIN LATERAL unnest(con.conkey) WITH ORDINALITY AS k(attnum, ord) ON true\n JOIN pg_catalog.pg_attribute a\n ON a.attrelid = con.conrelid\n AND a.attnum = k.attnum\n WHERE ns.nspname = $1\n AND con.contype = 'p'\n ORDER BY cl.relname, k.ord`, [schema]);\n\t\tconst fkResult = await driver.query(`SELECT\n cl.relname AS table_name,\n con.conname AS constraint_name,\n a.attname AS column_name,\n k.ord AS ordinal_position,\n ref_ns.nspname AS referenced_table_schema,\n ref_cl.relname AS referenced_table_name,\n ref_att.attname AS referenced_column_name,\n CASE con.confdeltype\n WHEN 'a' THEN 'NO ACTION'\n WHEN 'r' THEN 'RESTRICT'\n WHEN 'c' THEN 'CASCADE'\n WHEN 'n' THEN 'SET NULL'\n WHEN 'd' THEN 'SET DEFAULT'\n END AS delete_rule,\n CASE con.confupdtype\n WHEN 'a' THEN 'NO ACTION'\n WHEN 'r' THEN 'RESTRICT'\n WHEN 'c' THEN 'CASCADE'\n WHEN 'n' THEN 'SET NULL'\n WHEN 'd' THEN 'SET DEFAULT'\n END AS update_rule\n FROM pg_catalog.pg_constraint con\n JOIN pg_catalog.pg_class cl ON cl.oid = con.conrelid\n JOIN pg_catalog.pg_namespace ns ON ns.oid = cl.relnamespace\n JOIN LATERAL unnest(con.conkey) WITH ORDINALITY AS k(attnum, ord) ON true\n JOIN pg_catalog.pg_attribute a\n ON a.attrelid = con.conrelid\n AND a.attnum = k.attnum\n JOIN pg_catalog.pg_class ref_cl\n ON ref_cl.oid = con.confrelid\n JOIN pg_catalog.pg_namespace ref_ns\n ON ref_ns.oid = ref_cl.relnamespace\n JOIN pg_catalog.pg_attribute ref_att\n ON ref_att.attrelid = con.confrelid\n AND ref_att.attnum = con.confkey[k.ord]\n WHERE ns.nspname = $1\n AND con.contype = 'f'\n ORDER BY cl.relname, con.conname, k.ord`, [schema]);\n\t\tconst uniqueResult = await driver.query(`SELECT\n cl.relname AS table_name,\n con.conname AS constraint_name,\n a.attname AS column_name,\n k.ord AS ordinal_position\n FROM pg_catalog.pg_constraint con\n JOIN pg_catalog.pg_class cl ON cl.oid = con.conrelid\n JOIN pg_catalog.pg_namespace ns ON ns.oid = cl.relnamespace\n JOIN LATERAL unnest(con.conkey) WITH ORDINALITY AS k(attnum, ord) ON true\n JOIN pg_catalog.pg_attribute a\n ON a.attrelid = con.conrelid\n AND a.attnum = k.attnum\n WHERE ns.nspname = $1\n AND con.contype = 'u'\n ORDER BY cl.relname, con.conname, k.ord`, [schema]);\n\t\tconst indexResult = await driver.query(`SELECT\n i.tablename,\n i.indexname,\n ix.indisunique,\n pg_get_expr(ix.indpred, ix.indrelid) AS where_predicate,\n a.attname,\n CASE WHEN 0 = ANY(ix.indkey::int[]) THEN pg_get_indexdef(ix.indexrelid, k.ord::int, true) END AS element_def,\n k.ord AS index_position,\n am.amname,\n ic.reloptions\n FROM pg_indexes i\n JOIN pg_class ic ON ic.relname = i.indexname\n JOIN pg_namespace ins ON ins.oid = ic.relnamespace AND ins.nspname = $1\n JOIN pg_index ix ON ix.indexrelid = ic.oid\n JOIN pg_am am ON am.oid = ic.relam\n JOIN pg_class t ON t.oid = ix.indrelid\n JOIN pg_namespace tn ON tn.oid = t.relnamespace AND tn.nspname = $1\n JOIN LATERAL unnest(ix.indkey::int[]) WITH ORDINALITY AS k(attnum, ord) ON true\n LEFT JOIN pg_attribute a ON a.attrelid = t.oid AND a.attnum = k.attnum AND a.attnum > 0\n WHERE i.schemaname = $1\n AND NOT EXISTS (\n SELECT 1\n FROM pg_catalog.pg_constraint con\n WHERE con.conindid = ic.oid\n AND con.contype IN ('p', 'u', 'x')\n )\n ORDER BY i.tablename, i.indexname, k.ord`, [schema]);\n\t\tconst checkResult = await driver.query(`SELECT\n cl.relname AS table_name,\n c.conname AS constraint_name,\n pg_get_constraintdef(c.oid) AS constraintdef\n FROM pg_catalog.pg_constraint c\n JOIN pg_catalog.pg_class cl ON cl.oid = c.conrelid\n JOIN pg_catalog.pg_namespace ns ON ns.oid = cl.relnamespace\n WHERE ns.nspname = $1\n AND c.contype = 'c'\n ORDER BY cl.relname, c.conname`, [schema]);\n\t\tconst columnsByTable = groupBy(columnsResult.rows, \"table_name\");\n\t\tconst pksByTable = groupBy(pkResult.rows, \"table_name\");\n\t\tconst fksByTable = groupBy(fkResult.rows, \"table_name\");\n\t\tconst uniquesByTable = groupBy(uniqueResult.rows, \"table_name\");\n\t\tconst indexesByTable = groupBy(indexResult.rows, \"tablename\");\n\t\tconst checksByTable = groupBy(checkResult.rows, \"table_name\");\n\t\tconst pkConstraintsByTable = /* @__PURE__ */ new Map();\n\t\tfor (const row of pkResult.rows) {\n\t\t\tlet constraints = pkConstraintsByTable.get(row.table_name);\n\t\t\tif (!constraints) {\n\t\t\t\tconstraints = /* @__PURE__ */ new Set();\n\t\t\t\tpkConstraintsByTable.set(row.table_name, constraints);\n\t\t\t}\n\t\t\tconstraints.add(row.constraint_name);\n\t\t}\n\t\tconst tableInputs = {};\n\t\tfor (const tableRow of tablesResult.rows) {\n\t\t\tconst tableName = tableRow.table_name;\n\t\t\tconst columns = {};\n\t\t\tfor (const colRow of columnsByTable.get(tableName) ?? []) {\n\t\t\t\tlet nativeType = colRow.udt_name;\n\t\t\t\tconst formattedType = colRow.formatted_type ? normalizeFormattedType(colRow.formatted_type, colRow.data_type, colRow.udt_name) : null;\n\t\t\t\tif (formattedType) nativeType = formattedType;\n\t\t\t\telse if (colRow.data_type === \"character varying\" || colRow.data_type === \"character\") if (colRow.character_maximum_length) nativeType = `${colRow.data_type}(${colRow.character_maximum_length})`;\n\t\t\t\telse nativeType = colRow.data_type;\n\t\t\t\telse if (colRow.data_type === \"numeric\" || colRow.data_type === \"decimal\") if (colRow.numeric_precision && colRow.numeric_scale !== null) nativeType = `${colRow.data_type}(${colRow.numeric_precision},${colRow.numeric_scale})`;\n\t\t\t\telse if (colRow.numeric_precision) nativeType = `${colRow.data_type}(${colRow.numeric_precision})`;\n\t\t\t\telse nativeType = colRow.data_type;\n\t\t\t\telse nativeType = colRow.udt_name || colRow.data_type;\n\t\t\t\tconst many = nativeType.endsWith(\"[]\") ? true : void 0;\n\t\t\t\tif (many) nativeType = normalizeSchemaNativeType(nativeType.slice(0, -2));\n\t\t\t\tconst resolvedNativeType = `${normalizeSchemaNativeType(nativeType)}${many ? \"[]\" : \"\"}`;\n\t\t\t\tconst rawDefault = colRow.column_default ?? void 0;\n\t\t\t\tconst resolvedDefault = colRow.attidentity === \"a\" || colRow.attidentity === \"d\" ? {\n\t\t\t\t\tkind: \"function\",\n\t\t\t\t\texpression: \"autoincrement()\"\n\t\t\t\t} : rawDefault !== void 0 ? parsePostgresDefault(rawDefault, resolvedNativeType) : void 0;\n\t\t\t\tcolumns[colRow.column_name] = {\n\t\t\t\t\tname: colRow.column_name,\n\t\t\t\t\tnativeType,\n\t\t\t\t\tnullable: colRow.is_nullable === \"YES\",\n\t\t\t\t\t...ifDefined(\"default\", rawDefault),\n\t\t\t\t\t...ifDefined(\"many\", many),\n\t\t\t\t\tresolvedNativeType,\n\t\t\t\t\t...ifDefined(\"resolvedDefault\", resolvedDefault)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst pkRows = [...pksByTable.get(tableName) ?? []];\n\t\t\tconst primaryKeyColumns = pkRows.sort((a, b) => a.ordinal_position - b.ordinal_position).map((row) => row.column_name);\n\t\t\tconst primaryKey = primaryKeyColumns.length > 0 ? {\n\t\t\t\tcolumns: primaryKeyColumns,\n\t\t\t\t...pkRows[0]?.constraint_name ? { name: pkRows[0].constraint_name } : {},\n\t\t\t\tdependsOn: postgresColumnDependsOn(schema, tableName, primaryKeyColumns)\n\t\t\t} : void 0;\n\t\t\tconst foreignKeysMap = /* @__PURE__ */ new Map();\n\t\t\tfor (const fkRow of fksByTable.get(tableName) ?? []) {\n\t\t\t\tconst existing = foreignKeysMap.get(fkRow.constraint_name);\n\t\t\t\tif (existing) {\n\t\t\t\t\texisting.columns.push(fkRow.column_name);\n\t\t\t\t\texisting.referencedColumns.push(fkRow.referenced_column_name);\n\t\t\t\t} else foreignKeysMap.set(fkRow.constraint_name, {\n\t\t\t\t\tcolumns: [fkRow.column_name],\n\t\t\t\t\treferencedTable: fkRow.referenced_table_name,\n\t\t\t\t\treferencedSchema: fkRow.referenced_table_schema,\n\t\t\t\t\treferencedColumns: [fkRow.referenced_column_name],\n\t\t\t\t\tname: fkRow.constraint_name,\n\t\t\t\t\tdeleteRule: fkRow.delete_rule,\n\t\t\t\t\tupdateRule: fkRow.update_rule\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst foreignKeys = Array.from(foreignKeysMap.values()).map((fk) => ({\n\t\t\t\tcolumns: Object.freeze([...fk.columns]),\n\t\t\t\treferencedTable: fk.referencedTable,\n\t\t\t\treferencedSchema: fk.referencedSchema,\n\t\t\t\treferencedColumns: Object.freeze([...fk.referencedColumns]),\n\t\t\t\tname: fk.name,\n\t\t\t\t...ifDefined(\"onDelete\", mapReferentialAction(fk.deleteRule)),\n\t\t\t\t...ifDefined(\"onUpdate\", mapReferentialAction(fk.updateRule)),\n\t\t\t\tdependsOn: [postgresTableDependsOn(fk.referencedSchema, fk.referencedTable), ...postgresColumnDependsOn(schema, tableName, fk.columns)]\n\t\t\t}));\n\t\t\tconst pkConstraints = pkConstraintsByTable.get(tableName) ?? /* @__PURE__ */ new Set();\n\t\t\tconst uniquesMap = /* @__PURE__ */ new Map();\n\t\t\tfor (const uniqueRow of uniquesByTable.get(tableName) ?? []) {\n\t\t\t\tif (pkConstraints.has(uniqueRow.constraint_name)) continue;\n\t\t\t\tconst existing = uniquesMap.get(uniqueRow.constraint_name);\n\t\t\t\tif (existing) existing.columns.push(uniqueRow.column_name);\n\t\t\t\telse uniquesMap.set(uniqueRow.constraint_name, {\n\t\t\t\t\tcolumns: [uniqueRow.column_name],\n\t\t\t\t\tname: uniqueRow.constraint_name\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst uniques = Array.from(uniquesMap.values()).map((uq) => ({\n\t\t\t\tcolumns: Object.freeze([...uq.columns]),\n\t\t\t\tname: uq.name,\n\t\t\t\tdependsOn: postgresColumnDependsOn(schema, tableName, uq.columns)\n\t\t\t}));\n\t\t\tconst indexesMap = /* @__PURE__ */ new Map();\n\t\t\tfor (const idxRow of indexesByTable.get(tableName) ?? []) {\n\t\t\t\tconst existing = indexesMap.get(idxRow.indexname);\n\t\t\t\tif (existing) existing.elements.push({\n\t\t\t\t\tattname: idxRow.attname,\n\t\t\t\t\telementDef: idxRow.element_def\n\t\t\t\t});\n\t\t\t\telse {\n\t\t\t\t\tconst indexType = idxRow.amname ?? void 0;\n\t\t\t\t\tconst indexOptions = parsePgReloptions(idxRow.reloptions, idxRow.indexname);\n\t\t\t\t\tindexesMap.set(idxRow.indexname, {\n\t\t\t\t\t\tname: idxRow.indexname,\n\t\t\t\t\t\telements: [{\n\t\t\t\t\t\t\tattname: idxRow.attname,\n\t\t\t\t\t\t\telementDef: idxRow.element_def\n\t\t\t\t\t\t}],\n\t\t\t\t\t\tunique: idxRow.indisunique,\n\t\t\t\t\t\twhere: idxRow.where_predicate,\n\t\t\t\t\t\ttype: indexType,\n\t\t\t\t\t\toptions: indexOptions\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst indexes = Array.from(indexesMap.values()).map((idx) => {\n\t\t\t\tconst isExpression = idx.elements.some((el) => el.attname === null);\n\t\t\t\tconst columnNames = idx.elements.flatMap((el) => el.attname !== null ? [el.attname] : []);\n\t\t\t\tconst base = {\n\t\t\t\t\tnaming: namingOfLiveName(idx.name),\n\t\t\t\t\twhere: idx.where ?? void 0,\n\t\t\t\t\tunique: idx.unique,\n\t\t\t\t\tpartial: idx.where !== null,\n\t\t\t\t\ttype: idx.type,\n\t\t\t\t\toptions: idx.options,\n\t\t\t\t\tannotations: void 0,\n\t\t\t\t\tdependsOn: postgresColumnDependsOn(schema, tableName, isExpression ? Object.keys(columns) : columnNames)\n\t\t\t\t};\n\t\t\t\treturn isExpression ? {\n\t\t\t\t\t...base,\n\t\t\t\t\texpression: idx.elements.map((el) => el.elementDef ?? \"\").join(\", \")\n\t\t\t\t} : {\n\t\t\t\t\t...base,\n\t\t\t\t\tcolumns: Object.freeze([...columnNames])\n\t\t\t\t};\n\t\t\t});\n\t\t\tconst checksForTable = [];\n\t\t\tfor (const checkRow of checksByTable.get(tableName) ?? []) {\n\t\t\t\tconst parsed = parseCheckConstraintDef(checkRow.constraintdef);\n\t\t\t\tif (parsed) checksForTable.push({\n\t\t\t\t\tname: checkRow.constraint_name,\n\t\t\t\t\tcolumn: parsed.column,\n\t\t\t\t\tpermittedValues: parsed.permittedValues\n\t\t\t\t});\n\t\t\t}\n\t\t\ttableInputs[tableName] = {\n\t\t\t\tname: tableName,\n\t\t\t\tcolumns,\n\t\t\t\t...ifDefined(\"primaryKey\", primaryKey),\n\t\t\t\tforeignKeys,\n\t\t\t\tuniques,\n\t\t\t\tindexes,\n\t\t\t\t...ifDefined(\"checks\", checksForTable.length > 0 ? checksForTable : void 0)\n\t\t\t};\n\t\t}\n\t\tconst enums = (await driver.query(`SELECT t.typname, array_agg(e.enumlabel ORDER BY e.enumsortorder) AS enumvalues\n FROM pg_catalog.pg_type t\n JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace\n JOIN pg_catalog.pg_enum e ON e.enumtypid = t.oid\n WHERE t.typtype = 'e'\n AND n.nspname = $1\n GROUP BY t.typname\n ORDER BY t.typname`, [schema])).rows.map((r) => new PostgresNativeEnumSchemaNode({\n\t\t\ttypeName: r.typname,\n\t\t\tnamespaceId: schema,\n\t\t\tmembers: parsePgNameArray(r.enumvalues)\n\t\t}));\n\t\tconst policiesResult = await driver.query(`SELECT schemaname, tablename, policyname, cmd, roles, qual, with_check, permissive\n FROM pg_catalog.pg_policies\n WHERE schemaname = $1\n ORDER BY tablename, policyname`, [schema]);\n\t\tconst policiesByTable = /* @__PURE__ */ new Map();\n\t\tfor (const row of policiesResult.rows) {\n\t\t\tconst operation = mapPgCmd(row.cmd);\n\t\t\tconst policyRoles = [...new Set(parsePgNameArray(row.roles).map((r) => r.toLowerCase()))].sort();\n\t\t\tconst permissive = row.permissive.toUpperCase() === \"PERMISSIVE\";\n\t\t\tconst policy = new PostgresPolicySchemaNode({\n\t\t\t\tnaming: namingOfLiveName(row.policyname),\n\t\t\t\ttableName: row.tablename,\n\t\t\t\tnamespaceId: row.schemaname,\n\t\t\t\toperation,\n\t\t\t\troles: policyRoles,\n\t\t\t\tusing: row.qual ?? void 0,\n\t\t\t\twithCheck: row.with_check ?? void 0,\n\t\t\t\tpermissive,\n\t\t\t\tdependsOn: [postgresTableDependsOn(row.schemaname, row.tablename), ...policyRoles.map(postgresRoleDependsOn)]\n\t\t\t});\n\t\t\tconst list = policiesByTable.get(row.tablename) ?? [];\n\t\t\tlist.push(policy);\n\t\t\tpoliciesByTable.set(row.tablename, list);\n\t\t}\n\t\tconst rlsEnabledResult = await driver.query(`SELECT c.relname AS tablename, c.relrowsecurity AS rls_enabled\n FROM pg_catalog.pg_class c\n JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n WHERE n.nspname = $1\n AND c.relkind IN ('r', 'p')\n ORDER BY c.relname`, [schema]);\n\t\tconst rlsEnabledByTable = new Map(rlsEnabledResult.rows.map((row) => [row.tablename, row.rls_enabled]));\n\t\tconst tables = {};\n\t\tfor (const [tableName, input] of Object.entries(tableInputs)) tables[tableName] = new PostgresTableSchemaNode({\n\t\t\t...input,\n\t\t\tpolicies: policiesByTable.get(tableName) ?? [],\n\t\t\trlsEnabled: rlsEnabledByTable.get(tableName) ?? false\n\t\t});\n\t\treturn {\n\t\t\tnamespace: new PostgresNamespaceSchemaNode({\n\t\t\t\tschemaName: schema,\n\t\t\t\ttables,\n\t\t\t\tnativeEnums: enums\n\t\t\t}),\n\t\t\tpgVersion: await this.getPostgresVersion(driver)\n\t\t};\n\t}\n\t/**\n\t* Gets the Postgres version from the database.\n\t*/\n\tasync getPostgresVersion(driver) {\n\t\treturn ((await driver.query(\"SELECT version() AS version\", [])).rows[0]?.version ?? \"\").match(/PostgreSQL (\\d+\\.\\d+)/)?.[1] ?? \"unknown\";\n\t}\n};\n/**\n* Normalises a `name[]` column value from `pg_policies.roles`.\n*\n* The `pg` client's type-parser registry handles `text[]` (OID 1009) but not\n* `name[]` (OID 1003). When the parser is absent the raw Postgres text-array\n* literal (`{role1,role2}`) is returned as a string instead of a JS array.\n* This function accepts either form and returns a plain string array.\n*\n* The string branch honors Postgres array-literal quoting: an element\n* containing a comma, quote, backslash, brace, or significant whitespace is\n* emitted double-quoted with `\\\"` / `\\\\` escapes, and unquoted elements are\n* whitespace-trimmed — so a label like `in progress` or `say \"hi\"` parses to\n* its true value instead of being split or kept escaped.\n*/\nfunction parsePgNameArray(value) {\n\tif (Array.isArray(value)) return value.map(String);\n\tif (typeof value !== \"string\") return [];\n\tconst trimmed = value.trim();\n\tif (!trimmed.startsWith(\"{\") || !trimmed.endsWith(\"}\")) return [];\n\tconst inner = trimmed.slice(1, -1);\n\tif (inner === \"\") return [];\n\tconst elements = [];\n\tlet current = \"\";\n\tlet inQuotes = false;\n\tlet wasQuoted = false;\n\tconst pushCurrent = () => {\n\t\telements.push(wasQuoted ? current : current.trim());\n\t\tcurrent = \"\";\n\t\twasQuoted = false;\n\t};\n\tlet i = 0;\n\twhile (i < inner.length) {\n\t\tconst char = inner.charAt(i);\n\t\tif (inQuotes) {\n\t\t\tif (char === \"\\\\\") {\n\t\t\t\tcurrent += inner[i + 1] ?? \"\";\n\t\t\t\ti += 2;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (char === \"\\\"\") {\n\t\t\t\tinQuotes = false;\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tcurrent += char;\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (char === \"\\\"\") {\n\t\t\tinQuotes = true;\n\t\t\twasQuoted = true;\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (char === \",\") {\n\t\t\tpushCurrent();\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\t\tcurrent += char;\n\t\ti++;\n\t}\n\tif (inQuotes) return [];\n\tpushCurrent();\n\treturn elements;\n}\n/**\n* Maps `pg_policies.cmd` text values to the `RlsPolicyOperation` union.\n* The `pg_policies` view renders the internal command code as an uppercase\n* English keyword; this function lowercases to match the IR type.\n*/\nfunction mapPgCmd(cmd) {\n\tswitch (cmd.toUpperCase()) {\n\t\tcase \"SELECT\": return \"select\";\n\t\tcase \"INSERT\": return \"insert\";\n\t\tcase \"UPDATE\": return \"update\";\n\t\tcase \"DELETE\": return \"delete\";\n\t\tdefault: return \"all\";\n\t}\n}\n/**\n* Extracts the namespace coordinate ids declared on a contract's storage,\n* or returns an empty array when no contract (or no storage / namespaces)\n* is present. Used by `PostgresControlAdapter.introspect` to decide\n* between the multi-namespace walk and the single-schema fallback.\n*/\nfunction extractContractNamespaceIds(contract) {\n\tif (contract === null || typeof contract !== \"object\") return [];\n\tconst storage = contract.storage;\n\tif (storage === null || typeof storage !== \"object\") return [];\n\tconst namespaces = storage.namespaces;\n\tif (namespaces === null || typeof namespaces !== \"object\") return [];\n\treturn Object.keys(namespaces);\n}\nfunction normalizeFormattedType(formattedType, dataType, udtName) {\n\tif (formattedType.endsWith(\"[]\")) return `${normalizeFormattedType(formattedType.slice(0, -2), dataType, udtName)}[]`;\n\tif (formattedType === \"integer\") return \"int4\";\n\tif (formattedType === \"smallint\") return \"int2\";\n\tif (formattedType === \"bigint\") return \"int8\";\n\tif (formattedType === \"real\") return \"float4\";\n\tif (formattedType === \"double precision\") return \"float8\";\n\tif (formattedType === \"boolean\") return \"bool\";\n\tif (formattedType.startsWith(\"varchar\")) return formattedType.replace(\"varchar\", \"character varying\");\n\tif (formattedType.startsWith(\"bpchar\")) return formattedType.replace(\"bpchar\", \"character\");\n\tif (formattedType.startsWith(\"varbit\")) return formattedType.replace(\"varbit\", \"bit varying\");\n\tif (dataType === \"timestamp with time zone\" || udtName === \"timestamptz\") return formattedType.replace(\"timestamp\", \"timestamptz\").replace(\" with time zone\", \"\").trim();\n\tif (dataType === \"timestamp without time zone\" || udtName === \"timestamp\") return formattedType.replace(\" without time zone\", \"\").trim();\n\tif (dataType === \"time with time zone\" || udtName === \"timetz\") return formattedType.replace(\"time\", \"timetz\").replace(\" with time zone\", \"\").trim();\n\tif (dataType === \"time without time zone\" || udtName === \"time\") return formattedType.replace(\" without time zone\", \"\").trim();\n\tif (formattedType.startsWith(\"\\\"\") && formattedType.endsWith(\"\\\"\")) return formattedType.slice(1, -1);\n\treturn formattedType;\n}\nconst PG_REFERENTIAL_ACTION_MAP = {\n\t\"NO ACTION\": \"noAction\",\n\tRESTRICT: \"restrict\",\n\tCASCADE: \"cascade\",\n\t\"SET NULL\": \"setNull\",\n\t\"SET DEFAULT\": \"setDefault\"\n};\n/**\n* Maps a Postgres referential action rule to the canonical SqlReferentialAction.\n* Returns undefined for 'NO ACTION' (the database default) to keep the IR sparse.\n* Throws for unrecognized rules to prevent silent data loss.\n*/\nfunction mapReferentialAction(rule) {\n\tconst mapped = PG_REFERENTIAL_ACTION_MAP[rule];\n\tif (mapped === void 0) throw adapterError(\"CONTRACT.INTROSPECTION_UNSUPPORTED\", `Unknown PostgreSQL referential action rule: \"${rule}\". Expected one of: NO ACTION, RESTRICT, CASCADE, SET NULL, SET DEFAULT.`, { meta: { rule } });\n\tif (mapped === \"noAction\") return void 0;\n\treturn mapped;\n}\n/**\n* A FK/policy dependency chain, mirroring the shape the expected-side\n* derivation stamps (`contractToPostgresDatabaseSchemaNode`): the database\n* root's fixed sentinel id, then the namespace, then the table.\n*/\nfunction postgresTableDependsOn(namespaceId, tableName) {\n\treturn [\n\t\t{\n\t\t\tnodeKind: PostgresSchemaNodeKind.database,\n\t\t\tid: \"database\"\n\t\t},\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}\n/** A policy's dependency chain onto one of the roles it grants to. */\nfunction postgresRoleDependsOn(role) {\n\treturn [{\n\t\tnodeKind: PostgresSchemaNodeKind.database,\n\t\tid: \"database\"\n\t}, {\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 — the introspection-side\n* mirror of `contractToPostgresDatabaseSchemaNode`'s `columnDependsOn`. An\n* object is dropped before the columns it covers.\n*/\nfunction postgresColumnDependsOn(namespaceId, tableName, columns) {\n\treturn columns.map((column) => [...postgresTableDependsOn(namespaceId, tableName), {\n\t\tnodeKind: RelationalSchemaNodeKind.column,\n\t\tid: `column:${column}`\n\t}]);\n}\n/**\n* Groups an array of objects by a specified key.\n* Returns a Map for O(1) lookup by group key.\n*/\n/**\n* Parses a `pg_class.reloptions` array into a `Record<string, string>`.\n*\n* Postgres returns reloptions as a `text[]` whose entries are `key=value`\n* strings; the value side is always a string regardless of the underlying\n* scalar type. The verifier compares contract options to introspected\n* options after coercing both sides to strings, so keeping the raw text\n* here is correct.\n*\n* Returns `undefined` when the input is null/empty (no WITH clause).\n*/\nfunction parsePgReloptions(reloptions, indexName) {\n\tif (!reloptions || reloptions.length === 0) return;\n\tconst result = {};\n\tfor (const entry of reloptions) {\n\t\tconst eq = entry.indexOf(\"=\");\n\t\tif (eq === -1) throw adapterError(\"CONTRACT.INTROSPECTION_UNSUPPORTED\", `Postgres introspection: malformed reloption entry \"${entry}\" on index \"${indexName}\" (expected \"key=value\")`, { meta: {\n\t\t\tentry,\n\t\t\tindexName\n\t\t} });\n\t\tconst key = entry.slice(0, eq);\n\t\tresult[key] = entry.slice(eq + 1);\n\t}\n\treturn Object.keys(result).length > 0 ? result : void 0;\n}\nfunction groupBy(items, key) {\n\tconst map = /* @__PURE__ */ new Map();\n\tfor (const item of items) {\n\t\tconst groupKey = item[key];\n\t\tlet group = map.get(groupKey);\n\t\tif (!group) {\n\t\t\tgroup = [];\n\t\t\tmap.set(groupKey, group);\n\t\t}\n\t\tgroup.push(item);\n\t}\n\treturn map;\n}\n/**\n* Parses a Postgres check-constraint definition string (as returned by\n* `pg_get_constraintdef`) into a column name and permitted values array.\n*\n* Handles two shapes that Postgres emits for enum-style checks:\n*\n* 1. `= ANY (ARRAY[...])` — Postgres rewrites `col IN ('a','b')` to this form:\n* `CHECK ((col = ANY (ARRAY['a'::text, 'b'::text])))`\n*\n* 2. `IN (...)` — stays as-is when written directly:\n* `CHECK ((col IN ('a', 'b')))`\n*\n* Column names may be plain identifiers (`status`) or double-quoted identifiers\n* (`\"my-col\"`). Double-quoted identifiers with embedded `\"\"` are un-escaped to a\n* single `\"`.\n*\n* String literal values may contain Postgres-style doubled single-quotes (`''`),\n* which are un-escaped to a single `'` (e.g. `O''Brien` → `O'Brien`).\n*\n* Returns `{ column, permittedValues }` when the predicate matches one of\n* the two recognised shapes. Returns `undefined` for anything else (e.g.\n* a free-form SQL predicate that wasn't emitted by this slice).\n*/\nfunction parseCheckConstraintDef(constraintdef) {\n\tconst afterCheck = constraintdef.replace(/^CHECK\\s*\\(/i, \"\").replace(/\\)$/, \"\").trim();\n\tconst inner = afterCheck.startsWith(\"(\") && afterCheck.endsWith(\")\") ? afterCheck.slice(1, -1).trim() : afterCheck;\n\tconst anyArrayMatch = inner.match(/^(?:\"((?:[^\"]|\"\")*)\"|(\\w+))\\s*=\\s*ANY\\s*\\(\\s*ARRAY\\s*\\[(.+)\\]\\s*\\)\\s*$/i);\n\tif (anyArrayMatch) {\n\t\tconst column = anyArrayMatch[1] !== void 0 ? anyArrayMatch[1].replace(/\"\"/g, \"\\\"\") : anyArrayMatch[2];\n\t\tconst arrayBody = anyArrayMatch[3];\n\t\tif (!column || !arrayBody) return void 0;\n\t\tconst permittedValues = extractArrayLiterals(arrayBody);\n\t\treturn permittedValues ? {\n\t\t\tcolumn,\n\t\t\tpermittedValues\n\t\t} : void 0;\n\t}\n\tconst inMatch = inner.match(/^(?:\"((?:[^\"]|\"\")*)\"|(\\w+))\\s+IN\\s*\\((.+)\\)\\s*$/i);\n\tif (inMatch) {\n\t\tconst column = inMatch[1] !== void 0 ? inMatch[1].replace(/\"\"/g, \"\\\"\") : inMatch[2];\n\t\tconst listBody = inMatch[3];\n\t\tif (!column || !listBody) return void 0;\n\t\tconst permittedValues = extractQuotedLiterals(listBody);\n\t\treturn permittedValues ? {\n\t\t\tcolumn,\n\t\t\tpermittedValues\n\t\t} : void 0;\n\t}\n}\n/**\n* Extracts string literals from an `ARRAY[...]` body.\n* Handles `'value'::type` casts by stripping the cast part.\n* Postgres stores single quotes inside values as doubled single-quotes (`''`);\n* each extracted value is un-escaped so `O''Brien` becomes `O'Brien`.\n*/\nfunction extractArrayLiterals(arrayBody) {\n\tconst values = [...arrayBody.matchAll(/'((?:[^'\\\\]|\\\\.|'')*)'\\s*(?:::[^\\s,\\]]+)?/g)].map((m) => (m[1] ?? \"\").replace(/''/g, \"'\"));\n\treturn values.length > 0 ? values : void 0;\n}\n/**\n* Extracts string literals from an `IN (...)` list.\n* Handles single-quoted literals with possible escaped quotes.\n* Postgres stores single quotes inside values as doubled single-quotes (`''`);\n* each extracted value is un-escaped so `O''Brien` becomes `O'Brien`.\n*/\nfunction extractQuotedLiterals(listBody) {\n\tconst values = [...listBody.matchAll(/'((?:[^'\\\\]|\\\\.|'')*)'/g)].map((m) => (m[1] ?? \"\").replace(/''/g, \"'\"));\n\treturn values.length > 0 ? values : void 0;\n}\nfunction pgIsTextLikeNativeType(nativeType) {\n\treturn nativeType === \"text\" || nativeType === \"varchar\" || nativeType.startsWith(\"varchar(\") || nativeType === \"character varying\" || nativeType.startsWith(\"character varying(\") || nativeType === \"char\" || nativeType.startsWith(\"char(\") || nativeType === \"character\" || nativeType.startsWith(\"character(\");\n}\nfunction pgRenderArrayElement(el) {\n\tif (el === null) return \"NULL\";\n\tif (typeof el === \"number\" || typeof el === \"boolean\") return String(el);\n\tif (typeof el === \"string\") return `'${escapeLiteral(el)}'`;\n\treturn `'${escapeLiteral(JSON.stringify(el))}'`;\n}\nfunction pgRenderArrayLiteral(elements) {\n\tif (elements.length === 0) return \"'{}'\";\n\treturn `ARRAY[${elements.map(pgRenderArrayElement).join(\", \")}]`;\n}\nfunction pgInlineLiteral(wire, nativeType) {\n\tif (wire === null) return \"NULL\";\n\tif (typeof wire === \"boolean\") return wire ? \"true\" : \"false\";\n\tif (typeof wire === \"number\") {\n\t\tif (!Number.isFinite(wire)) throw adapterError(\"CONTRACT.DEFAULT_INVALID\", `pgRenderDdlExecuteRequest: non-finite number wire value ${String(wire)} cannot be emitted as a DEFAULT literal for native type \"${nativeType}\"`, { meta: { nativeType } });\n\t\treturn String(wire);\n\t}\n\tif (typeof wire === \"bigint\") return String(wire);\n\tif (wire instanceof Date) {\n\t\tif (Number.isNaN(wire.getTime())) throw adapterError(\"CONTRACT.DEFAULT_INVALID\", `pgRenderDdlExecuteRequest: invalid Date value cannot be emitted as a DEFAULT literal for native type \"${nativeType}\"`, { meta: { nativeType } });\n\t\tconst quoted = `'${escapeLiteral(wire.toISOString())}'`;\n\t\treturn pgIsTextLikeNativeType(nativeType) ? quoted : `${quoted}::${nativeType}`;\n\t}\n\tif (typeof wire === \"string\") {\n\t\tconst quoted = `'${escapeLiteral(wire)}'`;\n\t\treturn pgIsTextLikeNativeType(nativeType) ? quoted : `${quoted}::${nativeType}`;\n\t}\n\tif (wire instanceof Uint8Array) return `'\\\\x${Array.from(wire).map((b) => b.toString(16).padStart(2, \"0\")).join(\"\")}'::${nativeType}`;\n\tif (Array.isArray(wire) && nativeType.endsWith(\"[]\")) return pgRenderArrayLiteral(wire);\n\tif (typeof wire === \"object\") return `${`'${escapeLiteral(JSON.stringify(wire))}'`}::${nativeType}`;\n\tthrow adapterError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `pgRenderDdlExecuteRequest: unexpected wire type \"${typeof wire}\" for native type \"${nativeType}\"`, { meta: {\n\t\twireType: typeof wire,\n\t\tnativeType\n\t} });\n}\nasync function pgRenderDdlColumnDefault(def, nativeType, codecLookup, codecRef) {\n\tif (def.kind === \"function\") {\n\t\tif (def.expression === \"autoincrement()\") return \"\";\n\t\treturn `DEFAULT (${def.expression})`;\n\t}\n\tif (codecRef !== void 0) {\n\t\tconst codec = codecLookup.get(codecRef.codecId);\n\t\tif (codec !== void 0) return `DEFAULT ${pgInlineLiteral(await codec.encode(def.value, {}), nativeType)}`;\n\t}\n\treturn `DEFAULT ${pgInlineLiteral(def.value, nativeType)}`;\n}\nasync function pgRenderDdlColumn(column, codecLookup) {\n\tconst parts = [quoteIdentifier(column.name), column.type];\n\tif (column.default) {\n\t\tconst clause = await pgRenderDdlColumnDefault(column.default, column.type, codecLookup, column.codecRef);\n\t\tif (clause.length > 0) parts.push(clause);\n\t}\n\tif (column.notNull) parts.push(\"NOT NULL\");\n\tif (column.primaryKey) parts.push(\"PRIMARY KEY\");\n\treturn parts.join(\" \");\n}\nfunction pgRenderDdlConstraint(constraint) {\n\tif (constraint.kind === \"primary-key\") {\n\t\tconst cols = constraint.columns.map(quoteIdentifier).join(\", \");\n\t\tif (constraint.name !== void 0) return `CONSTRAINT ${quoteIdentifier(constraint.name)} PRIMARY KEY (${cols})`;\n\t\treturn `PRIMARY KEY (${cols})`;\n\t}\n\tif (constraint.kind === \"foreign-key\") {\n\t\tlet sql = `FOREIGN KEY (${constraint.columns.map(quoteIdentifier).join(\", \")}) REFERENCES ${constraint.refTable.split(\".\").map(quoteIdentifier).join(\".\")} (${constraint.refColumns.map(quoteIdentifier).join(\", \")})`;\n\t\tif (constraint.onDelete !== void 0) sql += ` ON DELETE ${REFERENTIAL_ACTION_SQL[constraint.onDelete]}`;\n\t\tif (constraint.onUpdate !== void 0) sql += ` ON UPDATE ${REFERENTIAL_ACTION_SQL[constraint.onUpdate]}`;\n\t\tif (constraint.name !== void 0) sql = `CONSTRAINT ${quoteIdentifier(constraint.name)} ${sql}`;\n\t\treturn sql;\n\t}\n\tif (constraint.kind === \"check-expression\") return `CONSTRAINT ${quoteIdentifier(constraint.name)} CHECK (${constraint.expression})`;\n\tconst cols = constraint.columns.map(quoteIdentifier).join(\", \");\n\tif (constraint.name !== void 0) return `CONSTRAINT ${quoteIdentifier(constraint.name)} UNIQUE (${cols})`;\n\treturn `UNIQUE (${cols})`;\n}\nasync function pgRenderCreateTable(node, codecLookup) {\n\tconst ifNotExists = node.ifNotExists ? \"IF NOT EXISTS \" : \"\";\n\tconst tableRef = node.schema ? `${quoteIdentifier(node.schema)}.${quoteIdentifier(node.table)}` : quoteIdentifier(node.table);\n\tconst columnDefs = await Promise.all(node.columns.map((col) => pgRenderDdlColumn(col, codecLookup)));\n\tconst constraintDefs = node.constraints !== void 0 ? node.constraints.map(pgRenderDdlConstraint) : [];\n\treturn {\n\t\tsql: `CREATE TABLE ${ifNotExists}${tableRef} (\\n ${[...columnDefs, ...constraintDefs].join(\",\\n \")}\\n)`,\n\t\tparams: []\n\t};\n}\nfunction pgRenderCreateSchema(node) {\n\treturn {\n\t\tsql: `CREATE SCHEMA ${node.ifNotExists ? \"IF NOT EXISTS \" : \"\"}${quoteIdentifier(node.schema)}`,\n\t\tparams: []\n\t};\n}\nfunction pgRenderCreateType(node) {\n\treturn {\n\t\tsql: `CREATE TYPE ${node.schema ? `${quoteIdentifier(node.schema)}.${quoteIdentifier(node.name)}` : quoteIdentifier(node.name)} AS ENUM (${node.values.map((value) => `'${escapeLiteral(value)}'`).join(\", \")})`,\n\t\tparams: []\n\t};\n}\nfunction pgRenderDropType(node) {\n\treturn {\n\t\tsql: `DROP TYPE ${node.schema ? `${quoteIdentifier(node.schema)}.${quoteIdentifier(node.name)}` : quoteIdentifier(node.name)}`,\n\t\tparams: []\n\t};\n}\nasync function pgRenderAlterTable(node, codecLookup) {\n\tconst tableRef = node.schema ? `${quoteIdentifier(node.schema)}.${quoteIdentifier(node.table)}` : quoteIdentifier(node.table);\n\tconst actionVisitor = {\n\t\tasync addColumn(action) {\n\t\t\treturn `ADD COLUMN ${await pgRenderDdlColumn(action.column, codecLookup)}`;\n\t\t},\n\t\tdropDefault(action) {\n\t\t\treturn Promise.resolve(`ALTER COLUMN ${quoteIdentifier(action.columnName)} DROP DEFAULT`);\n\t\t}\n\t};\n\treturn {\n\t\tsql: `ALTER TABLE ${tableRef} ${(await Promise.all(node.actions.map((a) => a.accept(actionVisitor)))).join(\", \")}`,\n\t\tparams: []\n\t};\n}\nconst POLICY_OPERATION_SQL = {\n\tselect: \"SELECT\",\n\tinsert: \"INSERT\",\n\tupdate: \"UPDATE\",\n\tdelete: \"DELETE\",\n\tall: \"ALL\"\n};\nfunction pgRenderCreatePolicy(node) {\n\tconst tableRef = `${quoteIdentifier(node.schema)}.${quoteIdentifier(node.table)}`;\n\tconst permissiveness = node.permissive ? \"PERMISSIVE\" : \"RESTRICTIVE\";\n\tconst command = POLICY_OPERATION_SQL[node.operation];\n\tconst roles = node.roles.length === 0 ? \"PUBLIC\" : node.roles.join(\", \");\n\tlet sql = `CREATE POLICY ${quoteIdentifier(node.name)} ON ${tableRef} AS ${permissiveness} FOR ${command} TO ${roles}`;\n\tif (node.using !== void 0) sql += ` USING (${node.using})`;\n\tif (node.withCheck !== void 0) sql += ` WITH CHECK (${node.withCheck})`;\n\treturn {\n\t\tsql,\n\t\tparams: []\n\t};\n}\nfunction pgRenderDropPolicy(node) {\n\tconst tableRef = `${quoteIdentifier(node.schema)}.${quoteIdentifier(node.table)}`;\n\treturn {\n\t\tsql: `DROP POLICY ${quoteIdentifier(node.name)} ON ${tableRef}`,\n\t\tparams: []\n\t};\n}\nfunction pgRenderAlterPolicyRename(node) {\n\tconst tableRef = `${quoteIdentifier(node.schema)}.${quoteIdentifier(node.table)}`;\n\treturn {\n\t\tsql: `ALTER POLICY ${quoteIdentifier(node.name)} ON ${tableRef} RENAME TO ${quoteIdentifier(node.newName)}`,\n\t\tparams: []\n\t};\n}\n/**\n* Renders one index reloption value: strings single-quote-escaped, finite\n* numbers verbatim, booleans in the `on`/`off` catalog spelling (the\n* canonical form the wire hash and the option equality commit to).\n*/\nfunction pgRenderIndexOptionValue(key, value) {\n\tif (typeof value === \"string\") return `'${escapeLiteral(value)}'`;\n\tif (typeof value === \"number\" && Number.isFinite(value)) return String(value);\n\tif (typeof value === \"boolean\") return value ? \"on\" : \"off\";\n\tthrow postgresError(\"CONTRACT.INDEX_INVALID\", `Index option \"${key}\" must be a string, finite number, or boolean; got ${typeof value}`, { meta: {\n\t\tkey,\n\t\tvalueType: typeof value\n\t} });\n}\n/** Qualifies an object name; an absent schema renders it unqualified (unbound namespace). */\nfunction pgQualify(schema, name) {\n\treturn schema === void 0 ? quoteIdentifier(name) : `${quoteIdentifier(schema)}.${quoteIdentifier(name)}`;\n}\nfunction pgRenderCreateIndex(node) {\n\tconst elementList = \"columns\" in node.elements ? node.elements.columns.map(quoteIdentifier).join(\", \") : node.elements.expression;\n\tconst unique = node.unique ? \"UNIQUE \" : \"\";\n\tconst using = node.type !== void 0 ? ` USING ${quoteIdentifier(node.type)}` : \"\";\n\tconst withClause = node.options !== void 0 && Object.keys(node.options).length > 0 ? ` WITH (${Object.entries(node.options).map(([key, value]) => `${quoteIdentifier(key)} = ${pgRenderIndexOptionValue(key, value)}`).join(\", \")})` : \"\";\n\tconst whereClause = node.where !== void 0 ? ` WHERE (${node.where})` : \"\";\n\treturn {\n\t\tsql: `CREATE ${unique}INDEX ${quoteIdentifier(node.name)} ON ${pgQualify(node.schema, node.table)}${using} (${elementList})${withClause}${whereClause}`,\n\t\tparams: []\n\t};\n}\nfunction pgRenderDropIndex(node) {\n\treturn {\n\t\tsql: `DROP INDEX ${pgQualify(node.schema, node.name)}`,\n\t\tparams: []\n\t};\n}\nfunction pgRenderAlterIndexRename(node) {\n\treturn {\n\t\tsql: `ALTER INDEX ${pgQualify(node.schema, node.from)} RENAME TO ${quoteIdentifier(node.to)}`,\n\t\tparams: []\n\t};\n}\nfunction pgRenderDisableRowLevelSecurity(node) {\n\treturn {\n\t\tsql: `ALTER TABLE ${`${quoteIdentifier(node.schema)}.${quoteIdentifier(node.table)}`} DISABLE ROW LEVEL SECURITY`,\n\t\tparams: []\n\t};\n}\nasync function pgRenderDdlExecuteRequest(ast, codecLookup) {\n\treturn ast.accept({\n\t\tcreateTable: (node) => pgRenderCreateTable(node, codecLookup),\n\t\tcreateSchema: (node) => Promise.resolve(pgRenderCreateSchema(node)),\n\t\tcreateType: (node) => Promise.resolve(pgRenderCreateType(node)),\n\t\tdropType: (node) => Promise.resolve(pgRenderDropType(node)),\n\t\talterTable: (node) => pgRenderAlterTable(node, codecLookup),\n\t\tcreatePolicy: (node) => Promise.resolve(pgRenderCreatePolicy(node)),\n\t\tdropPolicy: (node) => Promise.resolve(pgRenderDropPolicy(node)),\n\t\talterPolicyRename: (node) => Promise.resolve(pgRenderAlterPolicyRename(node)),\n\t\tcreateIndex: (node) => Promise.resolve(pgRenderCreateIndex(node)),\n\t\tdropIndex: (node) => Promise.resolve(pgRenderDropIndex(node)),\n\t\talterIndexRename: (node) => Promise.resolve(pgRenderAlterIndexRename(node)),\n\t\tdisableRowLevelSecurity: (node) => Promise.resolve(pgRenderDisableRowLevelSecurity(node))\n\t});\n}\n//#endregion\nexport { createPostgresCodecRegistryWithBuiltins as i, assemblePostgresCodecRegistry as n, createPostgresBuiltinCodecLookup as r, PostgresControlAdapter as t };\n\n//# sourceMappingURL=control-adapter-CipVam9p.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAS,2BAA2B,aAAa;CAChD,MAAM,qBAAqB,qCAAqC,WAAW;CAC3E,MAAM,WAAW;EAChB,GAAG,mBAAmB,CAAC;GACtB,IAAI;GACJ,OAAO,EAAE,YAAY,EAAE,kBAAkB,MAAM,KAAK,mBAAmB,OAAO,CAAC,EAAE,EAAE;EACpF,CAAC,CAAC;EACF,gBAAgB,YAAY,mBAAmB,cAAc,OAAO;EACpE,cAAc,mBAAmB,OAAO;CACzC;CACA,OAAO,OAAO,OAAO,QAAQ;AAC9B;AACA,SAAS,8BAA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AgC,IAAI,CAAC;CACzF,CAAC;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-policy-Cl3RRSPg-BUi6pcI-.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/control-policy-Cl3RRSPg.mjs"],"sourcesContent":["import { r as isPostgresSchema } from \"./postgres-schema-KSzLDONj.mjs\";\nimport { r as quoteIdentifier } from \"./sql-utils-BnBlQxyh.mjs\";\nimport { n as PostgresNativeEnumSchemaNode, o as postgresNodeEntityKind, r as PostgresSchemaNodeKind, t as PostgresTableSchemaNode } from \"./postgres-table-schema-node-BBkitBQh.mjs\";\nimport { C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, M as SetNotNullCall, N as postgresDefaultToDdlColumnDefault, O as RawSqlCall, P as buildTargetDetails, S as DropIndexCall, _ as DisableRowLevelSecurityCall, a as AddNotNullColumnDirectCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, g as DataTransformCall, h as CreateTableCall, i as AddNativeEnumValueCall, j as SetDefaultCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, o as AddNotNullColumnWithTempDefaultCall, r as AddForeignKeyCall, s as AddPrimaryKeyCall, t as AddCheckConstraintCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from \"./op-factory-call-DifL68KT.mjs\";\nimport { t as buildExpectedFormatType } from \"./planner-sql-checks-DRc_78n8.mjs\";\nimport { n as buildColumnTypeSql, t as buildColumnDefaultSql } from \"./planner-ddl-builders-CbfICQfm.mjs\";\nimport { n as resolveIdentityValue } from \"./planner-identity-values-BmHn5C6U.mjs\";\nimport { i as hasUniqueConstraint, n as hasForeignKey, t as buildSchemaLookupMap } from \"./planner-schema-lookup-kMIVP2y-.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID, entityAt } from \"@internal/framework-components/ir\";\nimport { StorageTable } from \"@internal/sql-contract/types\";\nimport { resolveValueSetValues } from \"@internal/family-sql/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport * as contractFree from \"@internal/sql-relational-core/contract-free\";\nimport { RelationalSchemaNodeKind, SqlSchemaIR } from \"@internal/sql-schema-ir/types\";\nimport { issueOutcome, orderIssuesByDependencies } from \"@internal/framework-components/control\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/core/schema-ir/node-storage-coordinate.ts\n/**\n* The storage-`entries` coordinate `(entityKind, entityName)` a Postgres diff\n* node addresses — a table by its name, a native enum by its physical type\n* name. `undefined` for a node that is not a whole storage entity (a namespace,\n* a column, a policy). Lets ownership/subject resolution treat every entity kind\n* uniformly, the node self-describing its storage identity.\n*/\nfunction postgresNodeStorageCoordinate(node) {\n\tif (PostgresTableSchemaNode.is(node)) {\n\t\tconst entityKind = postgresNodeEntityKind(node.nodeKind);\n\t\treturn entityKind === void 0 ? void 0 : {\n\t\t\tentityKind,\n\t\t\tentityName: node.name\n\t\t};\n\t}\n\tif (PostgresNativeEnumSchemaNode.is(node)) {\n\t\tconst entityKind = postgresNodeEntityKind(node.nodeKind);\n\t\treturn entityKind === void 0 ? void 0 : {\n\t\t\tentityKind,\n\t\t\tentityName: node.typeName\n\t\t};\n\t}\n}\n//#endregion\n//#region src/core/migrations/column-ddl-rendering.ts\n/**\n* Reconstructs the `StorageColumn`-shaped fields the DDL builder functions\n* (`buildColumnTypeSql`, `buildExpectedFormatType`, `resolveIdentityValue`)\n* expect, from a column node's own stamped codec identity (`codecRef` /\n* `codecBaseNativeType` / `codecNamedType`, Decision 5) — never the\n* contract. The builders were written against `StorageColumn` and are\n* unchanged here; only the shape feeding them moves from the contract to\n* the node. An empty `storageTypes` catalog is passed alongside: the\n* node's fields are already resolved past any `typeRef` indirection, so no\n* live lookup is needed, and passing a non-empty catalog would risk a\n* false `typeRef` hit against an unrelated storage type.\n*/\nfunction columnLike(column) {\n\tif (column.codecRef === void 0 || column.codecBaseNativeType === void 0) throw new InternalError(`columnLike: expected column \"${column.name}\" carries no codec identity — the expected tree must be derived via contractToSchemaIR for planning`);\n\treturn {\n\t\tnativeType: column.codecBaseNativeType,\n\t\tcodecId: column.codecRef.codecId,\n\t\tnullable: column.nullable,\n\t\t...ifDefined(\"many\", column.many ?? column.codecRef.many),\n\t\t...ifDefined(\"typeParams\", column.codecRef.typeParams !== void 0 ? blindCast(column.codecRef.typeParams) : void 0),\n\t\t...column.codecNamedType ? { typeRef: \"<resolved>\" } : {},\n\t\t...ifDefined(\"default\", column.resolvedDefault)\n\t};\n}\n/**\n* Builds the `CREATE TABLE` / `ADD COLUMN` DDL column for an expected column\n* node, resolving type rendering from the node's codec identity against the\n* codec hooks the caller holds — the same builder the pre-`plan(start, end)`\n* op-path called, so the output is byte-identical.\n*/\nfunction renderColumnDdl(name, column, codecHooks) {\n\tconst like = columnLike(column);\n\tconst typeSql = buildColumnTypeSql(like, codecHooks, {});\n\tconst ddlDefault = postgresDefaultToDdlColumnDefault(like.default);\n\treturn contractFree.col(name, typeSql, {\n\t\t...!column.nullable ? { notNull: true } : {},\n\t\t...ifDefined(\"default\", ddlDefault),\n\t\t...ifDefined(\"codecRef\", column.codecRef)\n\t});\n}\n/**\n* Builds the `ALTER COLUMN … TYPE` operands for an expected column node.\n*/\nfunction renderColumnAlterType(column, codecHooks) {\n\tconst like = columnLike(column);\n\treturn {\n\t\tqualifiedTargetType: buildColumnTypeSql(like, codecHooks, {}, false),\n\t\tformatTypeExpected: buildExpectedFormatType(like, codecHooks, {})\n\t};\n}\n/**\n* Resolves the identity value (monoid neutral element) SQL literal used as\n* the temporary default when adding a NOT-NULL column with no contract\n* default (`notNullAddColumnCallStrategy`'s shared-temp-default backfill).\n* `null` when the column's type has no built-in/codec-provided identity\n* value.\n*/\nfunction resolveColumnTemporaryDefault(column, codecHooks) {\n\treturn resolveIdentityValue(columnLike(column), codecHooks, {});\n}\n/**\n* The column's `SET DEFAULT` clause SQL, resolved from a column-default\n* diff node. `''` when the node carries no resolved default.\n*/\nfunction renderColumnDefaultSql(defaultNode) {\n\tif (defaultNode.resolved === void 0) return \"\";\n\treturn buildColumnDefaultSql(defaultNode.resolved, {\n\t\tnativeType: defaultNode.nativeTypeContext ?? \"\",\n\t\t...ifDefined(\"many\", defaultNode.many)\n\t});\n}\n//#endregion\n//#region src/core/migrations/planner-strategies.ts\n/**\n* Look up a storage table by its explicit namespace coordinate. Returns\n* `undefined` when the namespace has no table by that name (or no such\n* namespace exists). Callers that get `undefined` MUST treat it as an\n* explicit conflict — never silently fall back to a global default\n* schema or a name-only walk, because that footgun would resolve a\n* stale or duplicate table name to whichever namespace the iteration\n* order surfaced first (a real data-loss hazard in multi-namespace\n* contracts where two namespaces can carry the same table name).\n*/\nfunction tableAt(storage, namespaceId, tableName) {\n\tconst ns = storage.namespaces[namespaceId];\n\tif (ns === void 0) return void 0;\n\treturn ns.entries.table?.[tableName];\n}\n/**\n* Resolve the DDL schema name for a namespace coordinate. Postgres-aware\n* namespaces dispatch to their polymorphic `ddlSchemaName` override —\n* named schemas return their own id; the unbound singleton returns\n* `UNBOUND_NAMESPACE_ID`. Legacy single-namespace contracts whose\n* `__unbound__` slot is the framework-default `SqlUnboundNamespace`\n* (rather than the Postgres-aware `PostgresUnboundSchema`) flow the\n* coordinate through unchanged so downstream `qualifyTableName`\n* resolves polymorphically.\n*/\nfunction resolveDdlSchemaForNamespace(ctx, namespaceId) {\n\tconst namespace = ctx.toContract.storage.namespaces[namespaceId];\n\tif (isPostgresSchema(namespace)) return namespace.ddlSchemaName(ctx.toContract.storage);\n\treturn namespaceId;\n}\n/**\n* Recovers the contract namespace id for a DDL schema name embedded in a\n* diff-issue path (`path[1]`). The strategies need the CONTRACT column/table\n* (for codec-hook reads and eligibility probes the retained subsystems still\n* run) even though the issue itself only carries the resolved DDL schema —\n* this is the reverse of `resolveDdlSchemaForNamespace`.\n*/\nfunction namespaceIdForDdlSchema(ctx, ddlSchemaName) {\n\treturn resolveNamespaceIdForDdlSchema(ctx.toContract, ddlSchemaName);\n}\n/** A `not-equal` column issue whose node pair is narrowed to `SqlColumnIR`. */\nfunction columnNodePair(issue) {\n\tconst node = issueNode(issue);\n\tif (node === void 0 || node.nodeKind !== RelationalSchemaNodeKind.column) return void 0;\n\tif (issue.expected === void 0 || issue.actual === void 0) return void 0;\n\treturn {\n\t\texpected: blindCast(issue.expected),\n\t\tactual: blindCast(issue.actual)\n\t};\n}\nconst notNullBackfillCallStrategy = (issues, ctx) => {\n\tif (!ctx.policy.allowedOperationClasses.includes(\"data\")) return { kind: \"no_match\" };\n\tconst matched = [];\n\tconst calls = [];\n\tfor (const issue of issues) {\n\t\tif (issueOutcome(issue) !== \"not-found\") continue;\n\t\tconst node = issueNode(issue);\n\t\tif (node === void 0 || node.nodeKind !== RelationalSchemaNodeKind.column) continue;\n\t\tconst expected = blindCast(issue.expected);\n\t\tif (expected.nullable !== false || expected.resolvedDefault !== void 0) continue;\n\t\tconst ddlSchemaName = issueSchemaName(issue);\n\t\tconst tableName = issueTableName(issue);\n\t\tif (ddlSchemaName === void 0 || tableName === void 0) continue;\n\t\tconst schemaName = emissionSchemaName(ctx, ddlSchemaName);\n\t\tmatched.push(issue);\n\t\tconst ddl = renderColumnDdl(expected.name, expected, ctx.codecHooks);\n\t\tconst nullableSpec = contractFree.col(ddl.name, ddl.type, { ...ddl.codecRef !== void 0 ? { codecRef: ddl.codecRef } : {} });\n\t\tcalls.push(new AddColumnCall(schemaName, tableName, nullableSpec), new DataTransformCall(`backfill-${tableName}-${expected.name}`, `backfill-${tableName}-${expected.name}:check`, `backfill-${tableName}-${expected.name}:run`), new SetNotNullCall(schemaName, tableName, expected.name));\n\t}\n\tif (matched.length === 0) return { kind: \"no_match\" };\n\treturn {\n\t\tkind: \"match\",\n\t\tissues: issues.filter((i) => !matched.includes(i)),\n\t\tcalls,\n\t\trecipe: true\n\t};\n};\nconst SAFE_WIDENINGS = /* @__PURE__ */ new Set([\n\t\"int2→int4\",\n\t\"int2→int8\",\n\t\"int4→int8\",\n\t\"float4→float8\"\n]);\n/**\n* Handles `not-equal` column issues whose TYPE differs. `fromContract` is\n* only supplied by `migration plan` — for reconciliation (`db update` /\n* `db init`, `fromContract === null`) this strategy never fires, mirroring\n* the legacy `typeChangeCallStrategy`'s requirement of a prior contract:\n* `mapNodeIssueToCall`'s in-place ALTER covers reconciliation directly.\n*\n* A single node issue can carry BOTH type and nullability drift (Postgres\n* alters in place, so the differ emits one `not-equal` column issue where\n* the legacy coordinate walk emitted two: `type_mismatch` +\n* `nullability_mismatch`). When this strategy consumes the issue for its\n* type portion, it also emits whatever nullability delta the same node pair\n* carries — using the same construction `nullableTighteningCallStrategy` /\n* the mapper's direct dispatch would have used — so the issue is never\n* partially handled.\n*/\nconst typeChangeCallStrategy = (issues, ctx) => {\n\tif (ctx.fromContract === null) return { kind: \"no_match\" };\n\tconst dataAllowed = ctx.policy.allowedOperationClasses.includes(\"data\");\n\tconst matched = [];\n\tconst calls = [];\n\tfor (const issue of issues) {\n\t\tif (issueOutcome(issue) !== \"not-equal\") continue;\n\t\tconst pair = columnNodePair(issue);\n\t\tif (pair === void 0) continue;\n\t\tconst { expected, actual } = pair;\n\t\tif (!columnTypeChangedNativeOnly(expected, actual)) continue;\n\t\tconst fromType = actual.nativeType;\n\t\tconst toType = expected.nativeType;\n\t\tconst isSafeWidening = SAFE_WIDENINGS.has(`${fromType}→${toType}`);\n\t\tif (!isSafeWidening && !dataAllowed) continue;\n\t\tconst ddlSchemaName = issueSchemaName(issue);\n\t\tconst tableName = issueTableName(issue);\n\t\tif (ddlSchemaName === void 0 || tableName === void 0) continue;\n\t\tconst schemaName = emissionSchemaName(ctx, ddlSchemaName);\n\t\tmatched.push(issue);\n\t\tconst { qualifiedTargetType, formatTypeExpected } = renderColumnAlterType(expected, ctx.codecHooks);\n\t\tconst alterOpts = {\n\t\t\tqualifiedTargetType,\n\t\t\tformatTypeExpected,\n\t\t\trawTargetTypeForLabel: qualifiedTargetType\n\t\t};\n\t\tif (isSafeWidening) calls.push(new AlterColumnTypeCall(schemaName, tableName, expected.name, alterOpts));\n\t\telse calls.push(new DataTransformCall(`typechange-${tableName}-${expected.name}`, `typechange-${tableName}-${expected.name}:check`, `typechange-${tableName}-${expected.name}:run`), new AlterColumnTypeCall(schemaName, tableName, expected.name, alterOpts));\n\t\tif (expected.nullable !== actual.nullable) if (expected.nullable) calls.push(new DropNotNullCall(schemaName, tableName, expected.name));\n\t\telse if (dataAllowed) calls.push(new DataTransformCall(`handle-nulls-${tableName}-${expected.name}`, `handle-nulls-${tableName}-${expected.name}:check`, `handle-nulls-${tableName}-${expected.name}:run`), new SetNotNullCall(schemaName, tableName, expected.name));\n\t\telse calls.push(new SetNotNullCall(schemaName, tableName, expected.name));\n\t}\n\tif (matched.length === 0) return { kind: \"no_match\" };\n\treturn {\n\t\tkind: \"match\",\n\t\tissues: issues.filter((i) => !matched.includes(i)),\n\t\tcalls,\n\t\trecipe: true\n\t};\n};\n/**\n* Whether the raw (unresolved) native type differs — the SAME comparison\n* `typeChangeCallStrategy` always used (`fromColumn.nativeType !==\n* toColumn.nativeType`), which for the widenable numeric/float types\n* `SAFE_WIDENINGS` lists is identical to the resolved comparison\n* `columnTypeChanged` (in `issue-planner.ts`) performs.\n*/\nfunction columnTypeChangedNativeOnly(expected, actual) {\n\treturn expected.nativeType !== actual.nativeType;\n}\n/**\n* Handles `not-equal` column issues whose type did NOT change but\n* nullability tightened (contract requires NOT NULL, live column is\n* nullable). A type-changed issue's nullability delta (if any) is already\n* handled by `typeChangeCallStrategy`, which runs first — this strategy\n* only ever sees issues that strategy left behind.\n*/\nconst nullableTighteningCallStrategy = (issues, ctx) => {\n\tif (!ctx.policy.allowedOperationClasses.includes(\"data\")) return { kind: \"no_match\" };\n\tconst matched = [];\n\tconst calls = [];\n\tfor (const issue of issues) {\n\t\tif (issueOutcome(issue) !== \"not-equal\") continue;\n\t\tconst pair = columnNodePair(issue);\n\t\tif (pair === void 0) continue;\n\t\tconst { expected, actual } = pair;\n\t\tif (columnTypeChangedNativeOnly(expected, actual)) continue;\n\t\tif (expected.nullable !== false || actual.nullable !== true) continue;\n\t\tconst ddlSchemaName = issueSchemaName(issue);\n\t\tconst tableName = issueTableName(issue);\n\t\tif (ddlSchemaName === void 0 || tableName === void 0) continue;\n\t\tconst schemaName = emissionSchemaName(ctx, ddlSchemaName);\n\t\tmatched.push(issue);\n\t\tcalls.push(new DataTransformCall(`handle-nulls-${tableName}-${expected.name}`, `handle-nulls-${tableName}-${expected.name}:check`, `handle-nulls-${tableName}-${expected.name}:run`), new SetNotNullCall(schemaName, tableName, expected.name));\n\t}\n\tif (matched.length === 0) return { kind: \"no_match\" };\n\treturn {\n\t\tkind: \"match\",\n\t\tissues: issues.filter((i) => !matched.includes(i)),\n\t\tcalls,\n\t\trecipe: true\n\t};\n};\n/**\n* Collects every check constraint from a table in the contract storage.\n* Returns an empty array when the table has no checks or the table is absent.\n*/\nfunction collectContractChecks(storage, namespaceId, tableName) {\n\tconst ns = storage.namespaces[namespaceId];\n\tconst tableRaw = ns !== void 0 ? ns.entries.table?.[tableName] : void 0;\n\tif (!(tableRaw instanceof StorageTable)) return [];\n\tconst checks = tableRaw.checks;\n\tif (!checks || checks.length === 0) return [];\n\treturn checks.map((c) => ({\n\t\tname: c.name,\n\t\tcolumn: c.column,\n\t\tpermittedValues: resolveValueSetValues(c.valueSet, storage, `check \"${c.name}\" on \"${tableName}\"`)\n\t}));\n}\n/**\n* Compares two value arrays as unordered sets.\n*/\nfunction checkValueSetsEqual(a, b) {\n\tif (a.length !== b.length) return false;\n\tconst bSet = new Set(b);\n\treturn a.every((v) => bSet.has(v));\n}\n/**\n* Plans check-constraint migrations for `enumType`-authored columns.\n*\n* Walks every namespace's tables in the target contract (the check nodes'\n* resolved `permittedValues` are ultimately sourced from the same\n* contract-declared value sets, so walking the contract directly is the\n* simplest faithful port — the strategy's decisions never depend on which\n* ISSUES happen to be in the input list, only on the contract + live schema\n* shapes). For each table that carries `checks`, diffs the contract-expected\n* checks against the live schema's checks:\n*\n* - Check in contract, absent from live DB → `AddCheckConstraintCall`.\n* - Check in live DB, absent from contract → `DropCheckConstraintCall`.\n* - Check on both sides but value sets differ → `DropCheckConstraintCall`\n* then `AddCheckConstraintCall` (drop + recreate; a check predicate cannot\n* be altered in place).\n*\n* Consumes every `sql-check-constraint` issue on a table this walk handles\n* (not-found/not-expected/not-equal), leaving check issues on tables with\n* NO contract checks to `mapNodeIssueToCall`'s `not-expected` fallback.\n*/\nconst checkConstraintPlanCallStrategy = (issues, ctx) => {\n\tconst calls = [];\n\tconst handledIssueKeys = /* @__PURE__ */ new Set();\n\tfor (const [namespaceId, ns] of Object.entries(ctx.toContract.storage.namespaces)) for (const tableName of Object.keys(ns.entries.table ?? {})) {\n\t\tconst contractChecks = collectContractChecks(ctx.toContract.storage, namespaceId, tableName);\n\t\tif (contractChecks.length === 0) continue;\n\t\tconst liveChecks = ctx.schema.tables[tableName]?.checks ?? [];\n\t\tconst ddlSchema = resolveDdlSchemaForNamespace(ctx, namespaceId);\n\t\tfor (const contractCheck of contractChecks) {\n\t\t\tconst liveCheck = liveChecks.find((c) => c.name === contractCheck.name);\n\t\t\tconst issueKey = `${tableName} ${contractCheck.name}`;\n\t\t\tif (!liveCheck) {\n\t\t\t\tcalls.push(new AddCheckConstraintCall(ddlSchema, tableName, contractCheck.name, contractCheck.column, contractCheck.permittedValues));\n\t\t\t\thandledIssueKeys.add(issueKey);\n\t\t\t} else if (!checkValueSetsEqual(contractCheck.permittedValues, liveCheck.permittedValues)) {\n\t\t\t\tcalls.push(new DropCheckConstraintCall(ddlSchema, tableName, contractCheck.name), new AddCheckConstraintCall(ddlSchema, tableName, contractCheck.name, contractCheck.column, contractCheck.permittedValues));\n\t\t\t\thandledIssueKeys.add(issueKey);\n\t\t\t} else handledIssueKeys.add(issueKey);\n\t\t}\n\t\tfor (const liveCheck of liveChecks) if (!contractChecks.some((c) => c.name === liveCheck.name)) {\n\t\t\tconst issueKey = `${tableName} ${liveCheck.name}`;\n\t\t\tcalls.push(new DropCheckConstraintCall(ddlSchema, tableName, liveCheck.name));\n\t\t\thandledIssueKeys.add(issueKey);\n\t\t}\n\t}\n\tif (calls.length === 0 && handledIssueKeys.size === 0) return { kind: \"no_match\" };\n\treturn {\n\t\tkind: \"match\",\n\t\tissues: issues.filter((issue) => {\n\t\t\tconst node = issueNode(issue);\n\t\t\tif (node === void 0 || node.nodeKind !== RelationalSchemaNodeKind.check) return true;\n\t\t\tconst tableName = issueTableName(issue);\n\t\t\tif (tableName === void 0) return true;\n\t\t\tconst checkName = blindCast(node).name;\n\t\t\treturn !handledIssueKeys.has(`${tableName} ${checkName}`);\n\t\t}),\n\t\tcalls\n\t};\n};\n/**\n* Dispatches codec-typed storage types through their codec's\n* `planTypeOperations` hook (the authoritative source for codec-driven DDL\n* such as custom type creation). Codec extension/type ops are not modeled as\n* diff nodes — this strategy drives entirely off `ctx.toContract.storage.types`\n* + codec hooks, consuming nothing from the node issue list (there is no\n* node-vocabulary equivalent of `type_missing` / `enum_values_changed`).\n*/\nconst storageTypePlanCallStrategy = (issues, ctx) => {\n\tconst storageTypes = ctx.toContract.storage.types ?? {};\n\tif (Object.keys(storageTypes).length === 0) return { kind: \"no_match\" };\n\tconst calls = [];\n\tfor (const [typeName, typeInstance] of Object.entries(storageTypes).sort(([a], [b]) => a.localeCompare(b))) {\n\t\tconst codecInstance = typeInstance;\n\t\tconst hook = ctx.codecHooks.get(codecInstance.codecId);\n\t\tif (!hook?.planTypeOperations) continue;\n\t\tconst planResult = hook.planTypeOperations({\n\t\t\ttypeName,\n\t\t\ttypeInstance: codecInstance,\n\t\t\tcontract: ctx.toContract,\n\t\t\tschema: ctx.schema,\n\t\t\tschemaName: ctx.schemaName,\n\t\t\tpolicy: ctx.policy\n\t\t});\n\t\tif (!planResult) continue;\n\t\tfor (const op of planResult.operations) calls.push(new RawSqlCall({\n\t\t\t...op,\n\t\t\ttarget: {\n\t\t\t\tid: op.target.id,\n\t\t\t\tdetails: buildTargetDetails(\"type\", typeName, ctx.schemaName)\n\t\t\t}\n\t\t}));\n\t}\n\tif (calls.length === 0) return { kind: \"no_match\" };\n\treturn {\n\t\tkind: \"match\",\n\t\tissues,\n\t\tcalls\n\t};\n};\n/**\n* Handles `not-found` column issues for NOT NULL columns without a contract\n* default. Replaces the legacy `buildAddColumnItem` non-default branches.\n*\n* Two shapes:\n* - Shared-temp-default safe: emit a single atomic composite op (add\n* nullable → backfill identity value → `SET NOT NULL` → `DROP DEFAULT`).\n* The temp-default value is resolved from the column node's `codecRef`\n* (`resolveColumnTemporaryDefault`, wrapping `resolveIdentityValue`).\n* - Empty-table guarded: emit a hand-built op with a `tableIsEmptyCheck`\n* precheck so the failure message is \"table is not empty\" rather than the\n* raw PG NOT NULL violation.\n*\n* \"Normal\" not-found column cases (nullable or has a contract default) are\n* left for `mapNodeIssueToCall`'s default `AddColumnCall` emission.\n*/\nconst notNullAddColumnCallStrategy = (issues, ctx) => {\n\tconst matched = [];\n\tconst calls = [];\n\tconst schemaLookups = buildSchemaLookupMap(ctx.schema);\n\tconst mutableCodecHooks = ctx.codecHooks;\n\tconst mutableStorageTypes = ctx.storageTypes;\n\tfor (const issue of issues) {\n\t\tif (issueOutcome(issue) !== \"not-found\") continue;\n\t\tconst node = issueNode(issue);\n\t\tif (node === void 0 || node.nodeKind !== RelationalSchemaNodeKind.column) continue;\n\t\tconst expected = blindCast(issue.expected);\n\t\tif (expected.nullable !== false || expected.resolvedDefault !== void 0) continue;\n\t\tconst ddlSchemaName = issueSchemaName(issue);\n\t\tconst tableName = issueTableName(issue);\n\t\tif (ddlSchemaName === void 0 || tableName === void 0) continue;\n\t\tconst namespaceId = namespaceIdForDdlSchema(ctx, ddlSchemaName);\n\t\tconst schemaName = namespaceId === UNBOUND_NAMESPACE_ID ? UNBOUND_NAMESPACE_ID : ddlSchemaName;\n\t\tconst contractTable = tableAt(ctx.toContract.storage, namespaceId, tableName);\n\t\tconst column = contractTable?.columns[expected.name];\n\t\tif (!contractTable || !column) continue;\n\t\tconst schemaTable = ctx.schema.tables[tableName];\n\t\tif (!schemaTable) continue;\n\t\tconst temporaryDefault = resolveColumnTemporaryDefault(expected, ctx.codecHooks);\n\t\tconst schemaLookup = schemaLookups.get(tableName);\n\t\tconst canUseSharedTempDefault = temporaryDefault !== null && canUseSharedTemporaryDefaultStrategy({\n\t\t\ttable: contractTable,\n\t\t\tschemaTable,\n\t\t\tschemaLookup,\n\t\t\tcolumnName: expected.name\n\t\t});\n\t\tmatched.push(issue);\n\t\tif (canUseSharedTempDefault && temporaryDefault !== null) {\n\t\t\tcalls.push(new AddNotNullColumnWithTempDefaultCall({\n\t\t\t\tschemaName,\n\t\t\t\ttableName,\n\t\t\t\tcolumnName: expected.name,\n\t\t\t\tcolumn,\n\t\t\t\tcodecHooks: mutableCodecHooks,\n\t\t\t\tstorageTypes: mutableStorageTypes,\n\t\t\t\ttemporaryDefault\n\t\t\t}));\n\t\t\tcontinue;\n\t\t}\n\t\tcalls.push(new AddNotNullColumnDirectCall(schemaName, tableName, expected.name, renderColumnDdl(expected.name, expected, ctx.codecHooks)));\n\t}\n\tif (matched.length === 0) return { kind: \"no_match\" };\n\treturn {\n\t\tkind: \"match\",\n\t\tissues: issues.filter((i) => !matched.includes(i)),\n\t\tcalls\n\t};\n};\nfunction canUseSharedTemporaryDefaultStrategy(options) {\n\tconst { table, schemaTable, schemaLookup, columnName } = options;\n\tif (table.primaryKey?.columns.includes(columnName) && !schemaTable.primaryKey) return false;\n\tfor (const unique of table.uniques) {\n\t\tif (!unique.columns.includes(columnName)) continue;\n\t\tif (!schemaLookup || !hasUniqueConstraint(schemaLookup, unique.columns)) return false;\n\t}\n\tfor (const foreignKey of table.foreignKeys) {\n\t\tif (!foreignKey.source.columns.includes(columnName)) continue;\n\t\tif (!schemaLookup || !hasForeignKey(schemaLookup, foreignKey)) return false;\n\t}\n\treturn true;\n}\n/**\n* Ordered list of Postgres planner strategies, shared by `migration plan`\n* and `db update` / `db init`. The issue planner runs each strategy in\n* order, letting it consume any issues it handles, and routes whatever's\n* left through `mapNodeIssueToCall`. Behavior diverges purely on\n* `policy.allowedOperationClasses`:\n*\n* - When `'data'` is allowed (`migration plan`), the data-safe strategies\n* (`notNullBackfillCallStrategy`, `typeChangeCallStrategy`,\n* `nullableTighteningCallStrategy`) consume their matching issues and emit\n* `DataTransformCall` placeholders or recipe ops.\n*\n* - When `'data'` is not allowed (`db update` / `db init`), the\n* placeholder-emitting strategies short-circuit to `no_match`, leaving\n* the issue for the downstream strategies (`storageTypePlanCallStrategy`,\n* `notNullAddColumnCallStrategy`) or the `mapNodeIssueToCall` default to\n* handle with direct DDL.\n*\n* Codec-typed storage type entries are dispatched through\n* `storageTypePlanCallStrategy`.\n*/\nconst postgresPlannerStrategies = [\n\tnotNullBackfillCallStrategy,\n\ttypeChangeCallStrategy,\n\tnullableTighteningCallStrategy,\n\tcheckConstraintPlanCallStrategy,\n\tstorageTypePlanCallStrategy,\n\tnotNullAddColumnCallStrategy\n];\n//#endregion\n//#region src/core/migrations/issue-planner.ts\n/**\n* Deterministic name for the element-non-null CHECK constraint on a scalar-array\n* column. Distinct `_elem_not_null` suffix avoids collision with the enum\n* value-set `_check` constraints. Re-emitting the same schema produces the same\n* name, so `pg_get_constraintdef`-based verify sees no drift.\n*/\nfunction elementNonNullCheckName(tableName, columnName) {\n\treturn `${tableName}_${columnName}_elem_not_null`;\n}\n/**\n* Predicate enforcing that a scalar-array column carries no NULL element. The\n* array column itself may be NULL (container nullability is the column's NOT NULL\n* clause); `array_position` over a NULL array yields NULL, which a CHECK treats\n* as satisfied, so a nullable array column is unaffected.\n*/\nfunction elementNonNullCheckExpression(columnName) {\n\treturn `array_position(${quoteIdentifier(columnName)}, NULL) IS NULL`;\n}\nfunction issueConflict(kind, summary, location) {\n\treturn {\n\t\tkind,\n\t\tsummary,\n\t\twhy: \"Use `migration new` to author a custom migration for this change.\",\n\t\t...location ? { location } : {}\n\t};\n}\n/**\n* Classifies calls into DDL sequencing buckets. The order matches the\n* legacy walk-schema planner's emission order so `db init` and `db update`\n* produce byte-identical plans for the shared shape (deps → drops → tables\n* → columns → alters → PKs → uniques → indexes → FKs).\n*\n* `dropType` (DROP TYPE for a managed native enum) is its own bucket, ordered\n* after the general drop bucket: a type can only be dropped once every table\n* whose column uses it is gone. A column→enum edge would make this precise,\n* but `coalesceSubtreeIssues` removes the column issue under a whole-table\n* drop, so the edge never reaches the graph; the coarse bucket stands in until\n* that edge lands (the coordinate work is a later slice).\n*/\nfunction classifyCall(call) {\n\tswitch (call.factoryName) {\n\t\tcase \"createExtension\":\n\t\tcase \"createSchema\":\n\t\tcase \"createNativeEnumType\":\n\t\tcase \"addNativeEnumValue\": return \"dep\";\n\t\tcase \"dropNativeEnumType\": return \"dropType\";\n\t\tcase \"dropTable\":\n\t\tcase \"dropColumn\":\n\t\tcase \"dropConstraint\":\n\t\tcase \"dropCheckConstraint\":\n\t\tcase \"dropIndex\":\n\t\tcase \"dropDefault\": return \"drop\";\n\t\tcase \"addCheckConstraint\": return \"unique\";\n\t\tcase \"createTable\": return \"table\";\n\t\tcase \"enableRowLevelSecurity\":\n\t\tcase \"disableRowLevelSecurity\": return \"rlsEnable\";\n\t\tcase \"createRlsPolicy\": return \"rlsPolicy\";\n\t\tcase \"dropRlsPolicy\": return \"drop\";\n\t\tcase \"addColumn\": return \"column\";\n\t\tcase \"alterColumnType\":\n\t\tcase \"setNotNull\":\n\t\tcase \"dropNotNull\":\n\t\tcase \"setDefault\": return \"alter\";\n\t\tcase \"addPrimaryKey\": return \"primaryKey\";\n\t\tcase \"addUnique\": return \"unique\";\n\t\tcase \"createIndex\":\n\t\tcase \"renameIndex\": return \"index\";\n\t\tcase \"addForeignKey\": return \"foreignKey\";\n\t\tcase \"rawSql\":\n\t\t\tif (call.op?.target?.details?.objectType === \"type\") return \"dep\";\n\t\t\treturn \"alter\";\n\t\tdefault: return \"alter\";\n\t}\n}\nconst DEFAULT_POLICY = { allowedOperationClasses: [\n\t\"additive\",\n\t\"widening\",\n\t\"destructive\",\n\t\"data\"\n] };\nfunction emptySchemaIR() {\n\treturn new SqlSchemaIR({ tables: {} });\n}\nfunction conflictKindForCall(call) {\n\tswitch (call.factoryName) {\n\t\tcase \"alterColumnType\": return \"typeMismatch\";\n\t\tcase \"setNotNull\":\n\t\tcase \"dropNotNull\": return \"nullabilityConflict\";\n\t\tcase \"addForeignKey\":\n\t\tcase \"dropConstraint\": return \"foreignKeyConflict\";\n\t\tcase \"createIndex\":\n\t\tcase \"renameIndex\":\n\t\tcase \"dropIndex\": return \"indexIncompatible\";\n\t\tcase \"createRlsPolicy\":\n\t\tcase \"dropRlsPolicy\":\n\t\tcase \"renameRlsPolicy\": return \"rlsPolicyIncompatible\";\n\t\tdefault: return \"missingButNonAdditive\";\n\t}\n}\nfunction locationForCall(call) {\n\tconst anyCall = call;\n\tconst location = {};\n\tif (anyCall.tableName) {\n\t\tlocation.entityKind = \"table\";\n\t\tlocation.entityName = anyCall.tableName;\n\t} else if (anyCall.typeName) {\n\t\tlocation.entityKind = \"native_enum\";\n\t\tlocation.entityName = anyCall.typeName;\n\t}\n\tif (anyCall.columnName) location.column = anyCall.columnName;\n\tif (anyCall.indexName) location.index = anyCall.indexName;\n\telse if (anyCall.newIndexName) location.index = anyCall.newIndexName;\n\tif (anyCall.constraintName) location.constraint = anyCall.constraintName;\n\tif (anyCall.policyName) location.rlsPolicy = anyCall.policyName;\n\telse if (anyCall.policy?.name) location.rlsPolicy = anyCall.policy.name;\n\telse if (anyCall.newPolicyName) location.rlsPolicy = anyCall.newPolicyName;\n\treturn Object.keys(location).length > 0 ? location : void 0;\n}\nfunction conflictForDisallowedCall(call, allowed) {\n\tconst summary = `Operation \"${call.label}\" requires class \"${call.operationClass}\", but policy allows only: ${allowed.join(\", \")}`;\n\tconst location = locationForCall(call);\n\treturn {\n\t\tkind: conflictKindForCall(call),\n\t\tsummary,\n\t\twhy: \"Use `migration new` to author a custom migration for this change.\",\n\t\t...location ? { location } : {}\n\t};\n}\n/** The diff node an issue concerns — expected when present, else the actual (extra) node. */\nfunction issueNode(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\treturn blindCast(node);\n}\n/** DDL schema segment of a table-or-descendant issue path: `[database, ddlSchema, table, …]`. */\nfunction issueSchemaName(issue) {\n\treturn issue.path[1];\n}\n/** Table segment of a table-or-descendant issue path: `[database, ddlSchema, table, …]`. */\nfunction issueTableName(issue) {\n\treturn issue.path[2];\n}\n/** Column name embedded in a column/default issue path segment (`column:<name>`). */\nfunction issueColumnName(issue) {\n\tconst segment = issue.path[3];\n\tif (segment === void 0 || !segment.startsWith(\"column:\")) return void 0;\n\treturn segment.slice(7);\n}\n/**\n* The DDL schema name to use when EMITTING an op against `ddlSchemaName` (the\n* diff tree's resolved physical schema, `issueSchemaName(issue)`). The\n* unbound namespace's diff-tree identity resolves to `public` (a concrete\n* physical default the differ needs in order to compare its tree against\n* introspection — `resolveDdlSchemaForNamespaceStorage`), but DDL EMISSION\n* must stay unqualified so the live connection's `search_path` resolves it\n* at runtime (`boundSchema`). Recovers the logical namespace id via the\n* contract and substitutes the unbound sentinel back in when it resolves\n* there; every other namespace's `ddlSchemaName` already agrees between the\n* two resolution paths, so it passes through unchanged.\n*/\nfunction emissionSchemaName(ctx, ddlSchemaName) {\n\treturn resolveNamespaceIdForDdlSchema(ctx.toContract, ddlSchemaName) === UNBOUND_NAMESPACE_ID ? UNBOUND_NAMESPACE_ID : ddlSchemaName;\n}\n/**\n* Whether a column node is a scalar-array (`many: true`) column. The family\n* converter (`contractToSchemaIR`'s `convertColumn`) never stamps `many` on\n* the derived node — array-ness is folded into the `[]` suffix on\n* `nativeType` instead — so the node-derived check reads the suffix; `.many`\n* is still checked first for nodes a caller stamps directly (e.g. hand-built\n* test fixtures, or an adapter that populates it at introspection).\n*/\nfunction isManyColumn(column) {\n\treturn column.many === true || column.nativeType.endsWith(\"[]\");\n}\n/** Whether the expected/actual native type (resolved, or raw+many fallback) differs — mirrors `SqlColumnIR.isEqualTo`'s type comparison. */\nfunction columnTypeChanged(expected, actual) {\n\tif (expected.resolvedNativeType !== void 0 && actual.resolvedNativeType !== void 0) return expected.resolvedNativeType !== actual.resolvedNativeType;\n\treturn expected.nativeType !== actual.nativeType || Boolean(expected.many) !== Boolean(actual.many);\n}\n/**\n* The generic differ is total: a missing/extra table (or column) emits an\n* issue for itself AND for every node in its subtree. `CreateTable`/`DropTable`\n* and `AddColumn`/`DropColumn` already account for the whole subtree, so the\n* nested issues are redundant — coalescing drops any issue whose path is a\n* strict descendant of a `not-found`/`not-expected` issue's path. Run over the\n* relational subset ONLY (policy issues and synthesized namespace issues are\n* handled on their own paths, never coalesced against tables).\n*/\nfunction coalesceSubtreeIssues(issues) {\n\tconst collapsingPaths = issues.filter((issue) => issueOutcome(issue) !== \"not-equal\").map((issue) => issue.path);\n\tif (collapsingPaths.length === 0) return issues;\n\treturn issues.filter((issue) => !collapsingPaths.some((ancestor) => isStrictDescendantPath(issue.path, ancestor)));\n}\nfunction isStrictDescendantPath(path, ancestor) {\n\tif (path.length <= ancestor.length) return false;\n\tfor (let i = 0; i < ancestor.length; i += 1) if (path[i] !== ancestor[i]) return false;\n\treturn true;\n}\nfunction fkSpecFromNode(fk, tableName) {\n\treturn {\n\t\tname: fk.name ?? `${tableName}_${fk.columns.join(\"_\")}_fkey`,\n\t\tcolumns: [...fk.columns],\n\t\treferences: {\n\t\t\tschema: fk.referencedSchema ?? \"\",\n\t\t\ttable: fk.referencedTable,\n\t\t\tcolumns: [...fk.referencedColumns]\n\t\t},\n\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t...ifDefined(\"onUpdate\", fk.onUpdate)\n\t};\n}\n/**\n* Builds the `CreateTable` + child `CreateIndex` / `AddForeignKey` / `AddUnique`\n* calls for a newly-expected table, reading only the table node's children. The\n* PK and element-non-null CHECKs go inline as table constraints; indexes\n* (declared + FK-backing, already merged and ordered at derivation) and the\n* FK / unique constraints are separate calls (re-bucketed downstream). Every\n* column's DDL is resolved from its `codecRef` via `renderColumnDdl`.\n*/\nfunction buildCreateTableCallsFromNode(schemaName, ddlSchemaName, table, codecHooks) {\n\tconst ddlColumns = Object.values(table.columns).map((c) => renderColumnDdl(c.name, c, codecHooks));\n\tconst primaryKeyConstraints = table.primaryKey ? [contractFree.primaryKey([...table.primaryKey.columns], { ...ifDefined(\"name\", table.primaryKey.name) })] : [];\n\tconst elementNonNullChecks = Object.values(table.columns).filter((c) => isManyColumn(c)).map((c) => contractFree.checkExpression(elementNonNullCheckName(table.name, c.name), elementNonNullCheckExpression(c.name)));\n\tconst allTableConstraints = [...primaryKeyConstraints, ...elementNonNullChecks];\n\tconst calls = [new CreateTableCall(schemaName, table.name, ddlColumns, allTableConstraints.length > 0 ? allTableConstraints : void 0)];\n\tfor (const index of table.indexes) calls.push(createIndexCallFromNode(index, schemaName, table.name));\n\tfor (const fk of table.foreignKeys) calls.push(new AddForeignKeyCall(schemaName, table.name, fkSpecFromNode(fk, table.name)));\n\tfor (const unique of table.uniques) {\n\t\tconst constraintName = unique.name ?? `${table.name}_${unique.columns.join(\"_\")}_key`;\n\t\tcalls.push(new AddUniqueCall(schemaName, table.name, constraintName, [...unique.columns]));\n\t}\n\tif (table.rlsEnabled) calls.push(new EnableRowLevelSecurityCall(ddlSchemaName, table.name));\n\treturn calls;\n}\nfunction nodeConflict(kind, message) {\n\treturn issueConflict(kind, message);\n}\n/**\n* True when `actualMembers` (the live database's ordered members) is a\n* strict, order-preserving prefix of `expectedMembers` (the contract's) —\n* the database already carries every contract member, in declaration\n* order, and the contract declares at least one member the database still\n* lacks. Any other relationship — a renamed value, a removed value, a\n* reordering, or the database holding members the contract lacks — is not\n* a suffix append.\n*/\nfunction isNativeEnumSuffixAppend(actualMembers, expectedMembers) {\n\tif (actualMembers.length >= expectedMembers.length) return false;\n\treturn actualMembers.every((member, index) => member === expectedMembers[index]);\n}\n/** Operator-worded refusal for a native-enum member change beyond a suffix append (design ruling — tests match this verbatim). */\nfunction nativeEnumMemberChangeRefusal(options) {\n\treturn `Native enum type \"${options.ddlSchemaName}\".\"${options.typeName}\" changed beyond appending new values (contract declares [${options.expectedMembers.join(\", \")}], database has [${options.actualMembers.join(\", \")}]). Prisma Next does not modify a native enum's existing values (rename, removal, reorder) — see https://pris.ly/d/postgres-native-enums. Author the change manually with \\`migration new\\`.`;\n}\n/**\n* Managed native-enum issue -> op lowering. A missing declared type creates\n* it; an unclaimed live type drops it (ownership-scoped upstream by\n* `retainUnownedExtras`, destructiveness gated by the operation-class\n* policy); a paired member-value mismatch lowers to one `ALTER TYPE ... ADD\n* VALUE` per appended member when the database's members are a strict,\n* order-preserving prefix of the contract's — any other change (rename,\n* removal, reorder, or the database holding members the contract lacks) is\n* refused with a NAMED diagnostic, never a silent no-op and never a\n* drop-and-recreate.\n*/\nfunction mapNativeEnumNodeIssue(issue, ctx) {\n\tconst ddlSchemaName = issueSchemaName(issue);\n\tif (ddlSchemaName === void 0) return notOk(nodeConflict(\"unsupportedOperation\", `Enum issue has no schema in its path: ${issue.path.join(\"/\")}`));\n\tconst schemaName = emissionSchemaName(ctx, ddlSchemaName);\n\tif (issueOutcome(issue) === \"not-found\") {\n\t\tconst expected = blindCast(issue.expected);\n\t\treturn ok([new CreateNativeEnumTypeCall(schemaName, expected.typeName, expected.members)]);\n\t}\n\tif (issueOutcome(issue) === \"not-expected\") return ok([new DropNativeEnumTypeCall(schemaName, blindCast(issue.actual).typeName)]);\n\tconst expected = blindCast(issue.expected);\n\tconst actual = blindCast(issue.actual);\n\tif (isNativeEnumSuffixAppend(actual.members, expected.members)) return ok(expected.members.slice(actual.members.length).map((value) => new AddNativeEnumValueCall(schemaName, expected.typeName, value)));\n\treturn notOk(nodeConflict(\"unsupportedOperation\", nativeEnumMemberChangeRefusal({\n\t\tddlSchemaName,\n\t\ttypeName: expected.typeName,\n\t\texpectedMembers: expected.members,\n\t\tactualMembers: actual.members\n\t})));\n}\nfunction mapTableNodeIssue(issue, schemaName, ddlSchemaName, codecHooks) {\n\tif (issueOutcome(issue) === \"not-found\") return ok(buildCreateTableCallsFromNode(schemaName, ddlSchemaName, blindCast(issue.expected), codecHooks));\n\tif (issueOutcome(issue) === \"not-expected\") return ok([new DropTableCall(schemaName, blindCast(issue.actual).name)]);\n\tconst expected = blindCast(issue.expected);\n\tconst actual = blindCast(issue.actual);\n\tif (expected.rlsEnabled && !actual.rlsEnabled) return ok([new EnableRowLevelSecurityCall(ddlSchemaName, expected.name)]);\n\tif (!expected.rlsEnabled && actual.rlsEnabled) return ok([new DisableRowLevelSecurityCall(ddlSchemaName, expected.name)]);\n\treturn notOk(nodeConflict(\"unsupportedOperation\", `unhandled table-attribute drift on \"${expected.name}\": table not-equal with no rlsEnabled delta (a second table attribute drifted)`));\n}\nfunction mapColumnNodeIssue(issue, schemaName, tableName, codecHooks) {\n\tif (issueOutcome(issue) === \"not-found\") {\n\t\tconst column = blindCast(issue.expected);\n\t\treturn ok([new AddColumnCall(schemaName, tableName, renderColumnDdl(column.name, column, codecHooks))]);\n\t}\n\tif (issueOutcome(issue) === \"not-expected\") return ok([new DropColumnCall(schemaName, tableName, blindCast(issue.actual).name)]);\n\tconst expected = blindCast(issue.expected);\n\tconst actual = blindCast(issue.actual);\n\tconst calls = [];\n\tif (columnTypeChanged(expected, actual)) {\n\t\tconst { qualifiedTargetType, formatTypeExpected } = renderColumnAlterType(expected, codecHooks);\n\t\tcalls.push(new AlterColumnTypeCall(schemaName, tableName, expected.name, {\n\t\t\tqualifiedTargetType,\n\t\t\tformatTypeExpected,\n\t\t\trawTargetTypeForLabel: qualifiedTargetType\n\t\t}));\n\t}\n\tif (expected.nullable !== actual.nullable) calls.push(expected.nullable ? new DropNotNullCall(schemaName, tableName, expected.name) : new SetNotNullCall(schemaName, tableName, expected.name));\n\treturn ok(calls);\n}\nfunction mapColumnDefaultNodeIssue(issue, schemaName, tableName, columnName) {\n\tif (issueOutcome(issue) === \"not-expected\") return ok([new DropDefaultCall(schemaName, tableName, columnName)]);\n\tif (issue.expected === void 0) return ok([]);\n\tconst defaultSql = renderColumnDefaultSql(blindCast(issue.expected));\n\tif (!defaultSql) return ok([]);\n\treturn ok([new SetDefaultCall(schemaName, tableName, columnName, defaultSql, issueOutcome(issue) === \"not-equal\" ? \"widening\" : \"additive\")]);\n}\nfunction mapPrimaryKeyNodeIssue(issue, schemaName, tableName) {\n\tif (issueOutcome(issue) === \"not-found\") {\n\t\tconst pk = blindCast(issue.expected);\n\t\treturn ok([new AddPrimaryKeyCall(schemaName, tableName, pk.name ?? `${tableName}_pkey`, [...pk.columns])]);\n\t}\n\tif (issueOutcome(issue) === \"not-expected\") return ok([new DropConstraintCall(schemaName, tableName, blindCast(issue.actual).name ?? `${tableName}_pkey`, \"primaryKey\")]);\n\treturn notOk(nodeConflict(\"indexIncompatible\", issue.path.join(\"/\")));\n}\nfunction mapForeignKeyNodeIssue(issue, schemaName, tableName) {\n\tif (issueOutcome(issue) === \"not-found\") return ok([new AddForeignKeyCall(schemaName, tableName, fkSpecFromNode(blindCast(issue.expected), tableName))]);\n\tif (issueOutcome(issue) === \"not-expected\") {\n\t\tconst fk = blindCast(issue.actual);\n\t\treturn ok([new DropConstraintCall(schemaName, tableName, fk.name ?? `${tableName}_${fk.columns.join(\"_\")}_fkey`, \"foreignKey\")]);\n\t}\n\treturn notOk(nodeConflict(\"foreignKeyConflict\", issue.path.join(\"/\")));\n}\nfunction mapUniqueNodeIssue(issue, schemaName, tableName) {\n\tif (issueOutcome(issue) === \"not-found\") {\n\t\tconst unique = blindCast(issue.expected);\n\t\treturn ok([new AddUniqueCall(schemaName, tableName, unique.name ?? `${tableName}_${unique.columns.join(\"_\")}_key`, [...unique.columns])]);\n\t}\n\tif (issueOutcome(issue) === \"not-expected\") {\n\t\tconst unique = blindCast(issue.actual);\n\t\treturn ok([new DropConstraintCall(schemaName, tableName, unique.name ?? `${tableName}_${unique.columns.join(\"_\")}_key`, \"unique\")]);\n\t}\n\treturn notOk(nodeConflict(\"indexIncompatible\", issue.path.join(\"/\")));\n}\n/**\n* The CreateIndexCall for a name-identified index node: the node's own name\n* verbatim, its element list (column tuple or opaque expression), and the\n* unique/type/options/where attributes carried through.\n*/\nfunction createIndexCallFromNode(index, schemaName, tableName) {\n\tconst extras = {};\n\tif (index.type !== void 0) extras.type = index.type;\n\tif (index.options !== void 0) extras.options = index.options;\n\tif (index.where !== void 0) extras.where = index.where;\n\tif (index.unique) extras.unique = true;\n\treturn new CreateIndexCall(schemaName, tableName, index.name, index.columns !== void 0 ? { columns: [...index.columns] } : { expression: index.expression ?? \"\" }, extras);\n}\nfunction mapIndexNodeIssue(issue, schemaName, tableName) {\n\tif (issueOutcome(issue) === \"not-found\") return ok([createIndexCallFromNode(blindCast(issue.expected), schemaName, tableName)]);\n\tif (issueOutcome(issue) === \"not-expected\") return ok([new DropIndexCall(schemaName, tableName, blindCast(issue.actual).name)]);\n\treturn notOk(nodeConflict(\"indexIncompatible\", issue.path.join(\"/\")));\n}\nfunction mapCheckNodeIssue(issue, schemaName, tableName) {\n\tif (issueOutcome(issue) === \"not-expected\") return ok([new DropCheckConstraintCall(schemaName, tableName, blindCast(issue.actual).name)]);\n\treturn notOk(nodeConflict(\"unsupportedOperation\", `Check constraint drift on \"${tableName}\" — handled by checkConstraintPlanCallStrategy: ${issue.path.join(\"/\")}`));\n}\n/**\n* Maps one node-typed diff issue to its migration call(s), dispatching on the\n* node's `nodeKind` and the issue's presence-derived `issueOutcome`, reading\n* nodes and resolving column DDL from `codecRef` via `column-ddl-rendering.ts`.\n*/\nfunction mapNodeIssueToCall(issue, ctx) {\n\tconst node = issueNode(issue);\n\tif (node === void 0) return notOk(nodeConflict(\"unsupportedOperation\", `Issue carries neither an expected nor an actual node: ${issue.path.join(\"/\")}`));\n\tif (node.nodeKind === PostgresSchemaNodeKind.namespace) {\n\t\tif (issueOutcome(issue) !== \"not-found\") return notOk(nodeConflict(\"unsupportedOperation\", `Unexpected namespace drift: ${issue.path.join(\"/\")}`));\n\t\treturn ok([new CreateSchemaCall(blindCast(issue.expected).schemaName)]);\n\t}\n\tif (node.nodeKind === PostgresSchemaNodeKind.nativeEnum) return mapNativeEnumNodeIssue(issue, ctx);\n\tconst ddlSchemaName = issueSchemaName(issue);\n\tconst tableName = issueTableName(issue);\n\tif (ddlSchemaName === void 0 || tableName === void 0) return notOk(nodeConflict(\"unsupportedOperation\", `Issue has no schema/table in its path: ${issue.path.join(\"/\")}`));\n\tconst schemaName = emissionSchemaName(ctx, ddlSchemaName);\n\tswitch (node.nodeKind) {\n\t\tcase PostgresSchemaNodeKind.table: return mapTableNodeIssue(issue, schemaName, ddlSchemaName, ctx.codecHooks);\n\t\tcase RelationalSchemaNodeKind.column: return mapColumnNodeIssue(issue, schemaName, tableName, ctx.codecHooks);\n\t\tcase RelationalSchemaNodeKind.columnDefault: {\n\t\t\tconst columnName = issueColumnName(issue);\n\t\t\tif (columnName === void 0) return notOk(nodeConflict(\"unsupportedOperation\", `Default issue has no column in its path: ${issue.path.join(\"/\")}`));\n\t\t\treturn mapColumnDefaultNodeIssue(issue, schemaName, tableName, columnName);\n\t\t}\n\t\tcase RelationalSchemaNodeKind.primaryKey: return mapPrimaryKeyNodeIssue(issue, schemaName, tableName);\n\t\tcase RelationalSchemaNodeKind.foreignKey: return mapForeignKeyNodeIssue(issue, schemaName, tableName);\n\t\tcase RelationalSchemaNodeKind.unique: return mapUniqueNodeIssue(issue, schemaName, tableName);\n\t\tcase RelationalSchemaNodeKind.index: return mapIndexNodeIssue(issue, schemaName, tableName);\n\t\tcase RelationalSchemaNodeKind.check: return mapCheckNodeIssue(issue, schemaName, tableName);\n\t\tdefault: return notOk(nodeConflict(\"unsupportedOperation\", `Unhandled node kind: ${node.nodeKind}`));\n\t}\n}\n/**\n* Runs the ordered strategy list over the node-typed diff issues, maps\n* leftover issues via {@link mapNodeIssueToCall}, applies operation-class\n* policy gating, and buckets calls into the fixed DDL emission order (dep →\n* drop → table → column → recipe → alter → primaryKey → unique → index →\n* foreignKey).\n*/\nfunction planIssues(options) {\n\tconst policyProvided = options.policy !== void 0;\n\tconst policy = options.policy ?? DEFAULT_POLICY;\n\tconst schema = options.schema ?? emptySchemaIR();\n\tconst frameworkComponents = options.frameworkComponents ?? [];\n\tconst context = {\n\t\ttoContract: options.toContract,\n\t\tfromContract: options.fromContract,\n\t\tschemaName: options.schemaName,\n\t\tcodecHooks: options.codecHooks,\n\t\tstorageTypes: options.storageTypes,\n\t\tschema,\n\t\tpolicy,\n\t\tframeworkComponents\n\t};\n\tconst strategies = options.strategies ?? postgresPlannerStrategies;\n\tlet remaining = options.issues;\n\tconst recipeCalls = [];\n\tconst bucketablePatternCalls = [];\n\tfor (const strategy of strategies) {\n\t\tconst result = strategy(remaining, context);\n\t\tif (result.kind === \"match\") {\n\t\t\tremaining = result.issues;\n\t\t\tif (result.recipe) recipeCalls.push(...result.calls);\n\t\t\telse bucketablePatternCalls.push(...result.calls);\n\t\t}\n\t}\n\tconst sorted = orderIssuesByDependencies(remaining);\n\tconst defaultCalls = [];\n\tconst conflicts = [];\n\tfor (const issue of sorted) {\n\t\tconst result = mapNodeIssueToCall(issue, context);\n\t\tif (result.ok) defaultCalls.push(...result.value);\n\t\telse conflicts.push(result.failure);\n\t}\n\tconst allowed = policy.allowedOperationClasses;\n\tlet gatedDefault = defaultCalls;\n\tlet gatedRecipe = recipeCalls;\n\tlet gatedBucketable = bucketablePatternCalls;\n\tif (policyProvided) {\n\t\tconst keepIfAllowed = (bucket) => (call) => {\n\t\t\tif (allowed.includes(call.operationClass)) {\n\t\t\t\tbucket.push(call);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconflicts.push(conflictForDisallowedCall(call, allowed));\n\t\t};\n\t\tconst gatedDefaultBucket = [];\n\t\tconst gatedRecipeBucket = [];\n\t\tconst gatedBucketableBucket = [];\n\t\tdefaultCalls.forEach(keepIfAllowed(gatedDefaultBucket));\n\t\trecipeCalls.forEach(keepIfAllowed(gatedRecipeBucket));\n\t\tbucketablePatternCalls.forEach(keepIfAllowed(gatedBucketableBucket));\n\t\tgatedDefault = gatedDefaultBucket;\n\t\tgatedRecipe = gatedRecipeBucket;\n\t\tgatedBucketable = gatedBucketableBucket;\n\t}\n\tif (conflicts.length > 0) return notOk(conflicts);\n\tconst combinedBucketable = [...gatedDefault, ...gatedBucketable];\n\tconst byCategory = (cat) => combinedBucketable.filter((c) => classifyCall(c) === cat);\n\treturn ok({ calls: [\n\t\t...byCategory(\"dep\"),\n\t\t...byCategory(\"drop\"),\n\t\t...byCategory(\"dropType\"),\n\t\t...byCategory(\"table\"),\n\t\t...byCategory(\"column\"),\n\t\t...gatedRecipe,\n\t\t...byCategory(\"alter\"),\n\t\t...byCategory(\"primaryKey\"),\n\t\t...byCategory(\"unique\"),\n\t\t...byCategory(\"index\"),\n\t\t...byCategory(\"foreignKey\"),\n\t\t...byCategory(\"rlsEnable\")\n\t] });\n}\n//#endregion\n//#region src/core/migrations/control-policy.ts\n/**\n* Factory calls that create a whole, previously-absent top-level storage\n* object. Used to decide whether `tolerated` permits a call (it only allows\n* creating absent objects, never modifying existing ones).\n*\n* Deliberately an explicit, closed set rather than a `factoryName`\n* create/alter/drop classification: it answers exactly one yes/no question\n* and is fail-closed. Any call not listed here — including future or\n* extension-contributed factories — is treated as NOT object-creation, so it\n* is suppressed under `tolerated` rather than permissively emitted.\n*\n* Lists the creation factories that actually reach the call-side resolver\n* (`resolvePostgresCallControlPolicySubject`) — today only RLS policy\n* creation, from `planPostgresSchemaDiff`. Every other whole-object create\n* (table, schema, native enum, and RLS enablement) is constructed inside\n* `planIssues` and graded on the node side by\n* `resolvePostgresNodeIssueCreationFactoryName`, so none of them are listed\n* here.\n*/\nconst OBJECT_CREATION_FACTORIES = /* @__PURE__ */ new Set([\"createRlsPolicy\"]);\nfunction createsNewTopLevelObject(call) {\n\treturn OBJECT_CREATION_FACTORIES.has(call.factoryName);\n}\nfunction ddlSchemaNameForNamespace(contract, namespaceId) {\n\tconst namespace = contract.storage.namespaces[namespaceId];\n\treturn isPostgresSchema(namespace) ? namespace.ddlSchemaName(contract.storage) : namespaceId;\n}\n/**\n* Resolve the namespace a declared storage entity lives in by walking every\n* namespace for one whose `entries` map actually contains the coordinate —\n* a table by its name, a native enum by its physical type name (see\n* {@link postgresNodeStorageCoordinate}). When `ddlSchemaName` is given, the\n* match must also land in that DDL schema (disambiguates same-named entities\n* declared under different namespaces); when omitted, the first namespace\n* that declares the entity wins. Falls back to {@link UNBOUND_NAMESPACE_ID}\n* when no namespace declares it — e.g. an extra/dropped entity the contract\n* doesn't claim at all.\n*/\nfunction resolveNamespaceIdForEntity(contract, coordinate, ddlSchemaName) {\n\tfor (const namespaceId of Object.keys(contract.storage.namespaces)) {\n\t\tif (!entityAt(contract.storage, {\n\t\t\tnamespaceId,\n\t\t\t...coordinate\n\t\t})) continue;\n\t\tif (ddlSchemaName === void 0 || ddlSchemaNameForNamespace(contract, namespaceId) === ddlSchemaName) return namespaceId;\n\t}\n\treturn UNBOUND_NAMESPACE_ID;\n}\nfunction resolveNamespaceIdForTable(contract, tableName, ddlSchemaName) {\n\treturn resolveNamespaceIdForEntity(contract, {\n\t\tentityKind: \"table\",\n\t\tentityName: tableName\n\t}, ddlSchemaName);\n}\nfunction resolveNamespaceIdForDdlSchema(contract, ddlSchemaName) {\n\tfor (const namespaceId of Object.keys(contract.storage.namespaces)) {\n\t\tconst ns = contract.storage.namespaces[namespaceId];\n\t\tif (isPostgresSchema(ns) && ns.ddlSchemaName(contract.storage) === ddlSchemaName) return namespaceId;\n\t\tif (namespaceId === ddlSchemaName) return namespaceId;\n\t}\n\treturn UNBOUND_NAMESPACE_ID;\n}\nfunction postgresCallFields(call) {\n\treturn {\n\t\t...ifDefined(\"schemaName\", \"schemaName\" in call ? call.schemaName : void 0),\n\t\t...ifDefined(\"tableName\", \"tableName\" in call ? call.tableName : void 0),\n\t\t...ifDefined(\"columnName\", \"columnName\" in call ? call.columnName : void 0)\n\t};\n}\nfunction formatSuppressionSubjectLabel(subject, contract) {\n\tif (subject === void 0) return \"unknown\";\n\tconst ddlSchema = ddlSchemaNameForNamespace(contract, subject.namespaceId);\n\tif (subject.entityKind !== void 0 && subject.entityName !== void 0) {\n\t\tconst entityLabel = `${subject.entityKind} \"${ddlSchema}.${subject.entityName}\"`;\n\t\treturn subject.rlsPolicy !== void 0 ? `RLS policy \"${subject.rlsPolicy}\" on ${entityLabel}` : entityLabel;\n\t}\n\treturn `namespace \"${ddlSchema}\"`;\n}\nfunction postgresSuppressionSummary(subjectLabel, subject, policy) {\n\tconst namespace = subject?.namespaceId ?? \"unknown\";\n\tconst declared = subject?.explicitNodeControlPolicy;\n\tif (policy === \"external\" && declared === \"managed\") return `control policy suppressed: ${subjectLabel} — namespace '${namespace}' has effective control 'external' but declared 'managed'`;\n\treturn `control policy suppressed: ${subjectLabel} — namespace '${namespace}' has effective control '${policy}'${declared ? ` but declared '${declared}'` : \"\"}`;\n}\n/**\n* Render one family {@link SuppressionRecord} into a target `SqlPlannerConflict`.\n* The family decides *that* a subject is suppressed and hands over the raw\n* coordinate + policy; the label, message, and location are rendered here,\n* driven entirely by the subject's own `(entityKind, entityName)` coordinate\n* — no target-owned table-vs-enum vocabulary.\n*/\nfunction renderPostgresSuppression(record, contract) {\n\tconst subject = record.subject;\n\treturn {\n\t\tkind: \"controlPolicySuppressedCall\",\n\t\tsummary: postgresSuppressionSummary(formatSuppressionSubjectLabel(subject, contract), subject, record.policy),\n\t\tlocation: {\n\t\t\t...ifDefined(\"namespaceId\", subject?.namespaceId),\n\t\t\t...ifDefined(\"entityKind\", subject?.entityKind),\n\t\t\t...ifDefined(\"entityName\", subject?.entityName),\n\t\t\t...ifDefined(\"column\", subject?.column),\n\t\t\t...ifDefined(\"rlsPolicy\", subject?.rlsPolicy)\n\t\t},\n\t\tmeta: {\n\t\t\tcontrolPolicy: record.policy,\n\t\t\t...ifDefined(\"factoryName\", record.factoryName),\n\t\t\t...ifDefined(\"rlsPolicy\", subject?.rlsPolicy),\n\t\t\t...ifDefined(\"declaredControlPolicy\", subject?.explicitNodeControlPolicy)\n\t\t}\n\t};\n}\nfunction resolvePostgresCallControlPolicySubject(call, contract) {\n\tconst callFields = postgresCallFields(call);\n\tconst createsNewObject = createsNewTopLevelObject(call);\n\tif (call.factoryName === \"createSchema\" && callFields.schemaName) return {\n\t\tnamespaceId: resolveNamespaceIdForDdlSchema(contract, callFields.schemaName),\n\t\tcreatesNewObject\n\t};\n\tif (callFields.tableName) {\n\t\tconst namespaceId = resolveNamespaceIdForTable(contract, callFields.tableName, callFields.schemaName);\n\t\tconst tableControlPolicy = entityAt(contract.storage, {\n\t\t\tnamespaceId,\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: callFields.tableName\n\t\t})?.control;\n\t\treturn {\n\t\t\tnamespaceId,\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: callFields.tableName,\n\t\t\t...ifDefined(\"column\", callFields.columnName),\n\t\t\t...ifDefined(\"explicitNodeControlPolicy\", tableControlPolicy),\n\t\t\tcreatesNewObject\n\t\t};\n\t}\n\tif (callFields.schemaName) return {\n\t\tnamespaceId: resolveNamespaceIdForDdlSchema(contract, callFields.schemaName),\n\t\tcreatesNewObject\n\t};\n}\n/**\n* Node kinds whose *absence* is the creation of a whole, top-level Postgres\n* object: a namespace, a table, or a native enum. Used by\n* {@link resolvePostgresNodeIssueCreationFactoryName} to decide whether a\n* `tolerated` subject permits the issue to flow into the planner\n* (create-if-absent) and to seed the suppressed-subject warning's\n* `factoryName` when the planner is skipped. RLS policy creation is not\n* listed here — policy issues never reach this issue-based partition (they\n* are routed to `planPostgresSchemaDiff` and gated via the call-based\n* {@link resolvePostgresCallControlPolicySubject} instead).\n*/\nconst POSTGRES_NODE_CREATION_FACTORY = Object.freeze({\n\t[PostgresSchemaNodeKind.namespace]: \"createSchema\",\n\t[PostgresSchemaNodeKind.table]: \"createTable\",\n\t[PostgresSchemaNodeKind.nativeEnum]: \"createNativeEnumType\"\n});\n/**\n* A table `not-equal` issue whose `rlsEnabled` flips OFF→ON (expected on,\n* actual off) is enablement toward `ENABLE ROW LEVEL SECURITY`. It is\n* creation-class on the node side because `isEnablementCreationIssue` and\n* {@link resolvePostgresNodeIssueCreationFactoryName} treat this OFF→ON delta\n* as a creation: enabling RLS establishes the fail-closed guard the declared\n* policy set attaches to, the same grant `tolerated` extends to creating the\n* policies themselves. The opposite direction (`DISABLE`) is a modification\n* and stays managed-only. Keying on the actual delta (not just the expected\n* bit) keeps this correct if a second table attribute ever joins\n* `isEqualTo`: a not-equal with no `rlsEnabled` delta is not enablement, so\n* it is not admitted as creation-class here.\n*/\nfunction isEnablementCreationIssue(issue) {\n\tif (issueOutcome(issue) !== \"not-equal\") return false;\n\tconst { expected, actual } = issue;\n\treturn expected !== void 0 && actual !== void 0 && PostgresTableSchemaNode.is(expected) && PostgresTableSchemaNode.is(actual) && expected.rlsEnabled === true && actual.rlsEnabled === false;\n}\nfunction resolvePostgresNodeIssueCreationFactoryName(issue) {\n\tif (isEnablementCreationIssue(issue)) return \"enableRowLevelSecurity\";\n\tif (issueOutcome(issue) !== \"not-found\") return void 0;\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\treturn POSTGRES_NODE_CREATION_FACTORY[node.nodeKind];\n}\n/**\n* Resolves the control-policy subject for a node-typed {@link SchemaDiffIssue}\n* (the issue-side mirror of `resolvePostgresCallControlPolicySubject`).\n* Storage entities resolve off their node coordinate; a sub-entity issue\n* resolves off the enclosing table read from the issue path; an unclaimed\n* extra falls back to the unbound coordinate. A role always resolves\n* `'external'` — roles are referenced, never owned.\n*/\nfunction resolvePostgresNodeIssueControlPolicySubject(issue, contract) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\tif (node.nodeKind === PostgresSchemaNodeKind.namespace) return {\n\t\tnamespaceId: resolveNamespaceIdForDdlSchema(contract, blindCast(node).schemaName),\n\t\tcreatesNewObject: issueOutcome(issue) === \"not-found\"\n\t};\n\tif (node.nodeKind === PostgresSchemaNodeKind.role) {\n\t\tconst roleName = issue.path[1];\n\t\treturn {\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\texplicitNodeControlPolicy: (roleName === void 0 ? void 0 : entityAt(contract.storage, {\n\t\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\t\tentityKind: \"role\",\n\t\t\t\tentityName: roleName\n\t\t\t}))?.control ?? \"external\",\n\t\t\tcreatesNewObject: false\n\t\t};\n\t}\n\tconst coordinate = postgresNodeStorageCoordinate(node);\n\tif (coordinate !== void 0) {\n\t\tconst namespaceId = resolveNamespaceIdForEntity(contract, coordinate, issue.path[1]);\n\t\tconst entityControl = entityAt(contract.storage, {\n\t\t\tnamespaceId,\n\t\t\t...coordinate\n\t\t})?.control;\n\t\treturn {\n\t\t\tnamespaceId,\n\t\t\t...coordinate,\n\t\t\t...ifDefined(\"column\", issueColumnName(issue)),\n\t\t\t...ifDefined(\"explicitNodeControlPolicy\", entityControl),\n\t\t\tcreatesNewObject: resolvePostgresNodeIssueCreationFactoryName(issue) !== void 0\n\t\t};\n\t}\n\tconst tableName = issue.path[2];\n\tif (tableName === void 0) return void 0;\n\tconst ddlSchemaName = issue.path[1];\n\tconst namespaceId = resolveNamespaceIdForTable(contract, tableName, ddlSchemaName);\n\tconst table = entityAt(contract.storage, {\n\t\tnamespaceId,\n\t\tentityKind: \"table\",\n\t\tentityName: tableName\n\t});\n\treturn {\n\t\tnamespaceId,\n\t\tentityKind: \"table\",\n\t\tentityName: tableName,\n\t\t...ifDefined(\"column\", issueColumnName(issue)),\n\t\t...ifDefined(\"explicitNodeControlPolicy\", table?.control),\n\t\tcreatesNewObject: resolvePostgresNodeIssueCreationFactoryName(issue) !== void 0\n\t};\n}\n//#endregion\nexport { resolvePostgresNodeIssueCreationFactoryName as a, issueNode as c, postgresPlannerStrategies as d, postgresNodeStorageCoordinate as f, resolvePostgresNodeIssueControlPolicySubject as i, issueSchemaName as l, resolveNamespaceIdForDdlSchema as n, coalesceSubtreeIssues as o, resolvePostgresCallControlPolicySubject as r, conflictForDisallowedCall as s, renderPostgresSuppression as t, planIssues as u };\n\n//# sourceMappingURL=control-policy-Cl3RRSPg.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAS,8BAA8B,MAAM;CAC5C,IAAI,wBAAwB,GAAG,IAAI,GAAG;EACrC,MAAM,aAAa,uBAAuB,KAAK,QAAQ;EACvD,OAAO,eAAe,KAAK,IAAI,KAAK,IAAI;GACvC;GACA,YAAY,KAAK;EAClB;CACD;CACA,IAAI,6BAA6B,GAAG,IAAI,GAAG;EAC1C,MAAM,aAAa,uBAAuB,KAAK,QAAQ;EACvD,OAAO,eAAe,KAAK,IAAI,KAAK,IAAI;GACvC;GACA,YAAY,KAAK;EAClB;CACD;AACD;;;;;;;;;;;;;AAeA,SAAS,WAAW,QAAQ;CAC3B,IAAI,OAAO,aAAa,KAAK,KAAK,OAAO,wBAAwB,KAAK,GAAG,MAAM,IAAI,cAAc,gCAAgC,OAAO,KAAK,oGAAoG;CACjP,OAAO;EACN,YAAY,OAAO;EACnB,SAAS,OAAO,SAAS;EACzB,UAAU,OAAO;EACjB,GAAG,UAAU,QAAQ,OAAO,QAAQ,OAAO,SAAS,IAAI;EACxD,GAAG,UAAU,cAAc,OAAO,SAAS,eAAe,KAAK,IAAI,UAAU,OAAO,SAAS,UAAU,IAAI,KAAK,CAAC;EACjH,GAAG,OAAO,iBAAiB,EAAE,SAAS,aAAa,IAAI,CAAC;EACxD,GAAG,UAAU,WAAW,OAAO,eAAe;CAC/C;AACD;;;;;;;AAOA,SAAS,gBAAgB,MAAM,QAAQ,YAAY;CAClD,MAAM,OAAO,WAAW,MAAM;CAC9B,MAAM,UAAU,mBAAmB,MAAM,YAAY,CAAC,CAAC;CACvD,MAAM,aAAa,kCAAkC,KAAK,OAAO;CACjE,OAAO,aAAa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guA3K.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/descriptor-meta-DnHabAS3.mjs"],"sourcesContent":["import { O as postgresQualifyColumnType } from \"./codecs-CBl0nD44.mjs\";\nimport { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-KSzLDONj.mjs\";\nimport { a as postgresAuthoringTypes, i as postgresAuthoringPslBlockDescriptors, n as postgresAuthoringFieldPresets, o as postgresLowerEntityHandles, r as postgresAuthoringModelAttributes, t as postgresAuthoringEntityTypes } from \"./authoring-03FwIL2k.mjs\";\nimport { t as postgresTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-UwYdV8fD.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\tindexTypes: postgresIndexTypes,\n\tauthoring: {\n\t\ttype: postgresAuthoringTypes,\n\t\tfield: postgresAuthoringFieldPresets,\n\t\tentityTypes: postgresAuthoringEntityTypes,\n\t\tpslBlockDescriptors: postgresAuthoringPslBlockDescriptors,\n\t\tmodelAttributes: postgresAuthoringModelAttributes,\n\t\tcreateNamespace: postgresCreateNamespace,\n\t\tqualifyColumnType: postgresQualifyColumnType,\n\t\tlowerEntityHandles: postgresLowerEntityHandles\n\t}\n};\n//#endregion\nexport { postgresTargetDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-DnHabAS3.mjs.map"],"mappings":";;;;;;;;AAQA,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,YAAY;CACZ,WAAW;EACV,MAAM;EACN,OAAO;EACP,aAAa;EACb,qBAAqB;EACrB,iBAAiB;EACjB,iBAAiB;EACjB,mBAAmB;EACnB,oBAAoB;CACrB;AACD"}
|