@prisma/orm-target-postgres 8.0.0-rc.11-dev.16 → 8.0.0-rc.11-dev.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/{adapter-DDfZMW0M-Cqq4b6_G.mjs → adapter-bTD1EPrl-DQ66tQwz.mjs} +3 -3
  2. package/dist/{adapter-DDfZMW0M-Cqq4b6_G.mjs.map → adapter-bTD1EPrl-DQ66tQwz.mjs.map} +1 -1
  3. package/dist/adapter.d.mts +2 -2
  4. package/dist/adapter.mjs +3 -3
  5. package/dist/adapter__adapter.mjs +1 -1
  6. package/dist/adapter__control.d.mts +2 -2
  7. package/dist/adapter__control.mjs +5 -4
  8. package/dist/adapter__control.mjs.map +1 -1
  9. package/dist/adapter__runtime.mjs +8 -3
  10. package/dist/adapter__runtime.mjs.map +1 -1
  11. package/dist/{authoring-DgeWf8RC-C-jQzf_w.mjs → authoring-Beq66XGy-D-GgvlBG.mjs} +63 -20
  12. package/dist/authoring-Beq66XGy-D-GgvlBG.mjs.map +1 -0
  13. package/dist/authoring-xyQRYoem-DWCGb5Py.d.mts +36 -0
  14. package/dist/authoring-xyQRYoem-DWCGb5Py.d.mts.map +1 -0
  15. package/dist/control-206OMpyA.mjs +470 -0
  16. package/dist/control-206OMpyA.mjs.map +1 -0
  17. package/dist/{control--T7XaMS8.d.mts → control-BvK2pHHh.d.mts} +2 -2
  18. package/dist/{control--T7XaMS8.d.mts.map → control-BvK2pHHh.d.mts.map} +1 -1
  19. package/dist/{control-xdW1bgaP.d.mts → control-DmVutloY.d.mts} +2 -2
  20. package/dist/{control-xdW1bgaP.d.mts.map → control-DmVutloY.d.mts.map} +1 -1
  21. package/dist/{control-adapter-5et6pVM9-B5CKg-5B.mjs → control-adapter-Bdz-Xa1p-rKiOVhsh.mjs} +96 -28
  22. package/dist/control-adapter-Bdz-Xa1p-rKiOVhsh.mjs.map +1 -0
  23. package/dist/{control-policy-BKgU_M65-BWedWA-f.mjs → control-policy-B8x7UxGf-BjTez7am.mjs} +24 -17
  24. package/dist/control-policy-B8x7UxGf-BjTez7am.mjs.map +1 -0
  25. package/dist/{default-normalizer-Ba5ZebHM-isV86rjy.mjs → default-normalizer-Bjtm2F4f-uV5vvkVt.mjs} +160 -33
  26. package/dist/default-normalizer-Bjtm2F4f-uV5vvkVt.mjs.map +1 -0
  27. package/dist/{default-normalizer-B36TOul4.d.mts → default-normalizer-D9WbKo20.d.mts} +2 -2
  28. package/dist/{default-normalizer-B36TOul4.d.mts.map → default-normalizer-D9WbKo20.d.mts.map} +1 -1
  29. package/dist/{descriptor-meta-C4i4pLQn-CmdN74uG.mjs → descriptor-meta-BhJOswpM-CqvnQMC0.mjs} +3 -3
  30. package/dist/{descriptor-meta-C4i4pLQn-CmdN74uG.mjs.map → descriptor-meta-BhJOswpM-CqvnQMC0.mjs.map} +1 -1
  31. package/dist/{diff-database-schema-BaSP2z4y-Ch42uw-j.mjs → diff-database-schema-BFX0ZWWK-KVfAPOLF.mjs} +4 -4
  32. package/dist/{diff-database-schema-BaSP2z4y-Ch42uw-j.mjs.map → diff-database-schema-BFX0ZWWK-KVfAPOLF.mjs.map} +1 -1
  33. package/dist/{control-BC3oXXIK.mjs → infer-psl-contract-BaZaJAD9-DTVu5Zab.mjs} +110 -488
  34. package/dist/infer-psl-contract-BaZaJAD9-DTVu5Zab.mjs.map +1 -0
  35. package/dist/migration-PTHAY9Cv.mjs.map +1 -1
  36. package/dist/{op-factory-call-6Jg-ycA--4AC_11Od.mjs → op-factory-call-B3-CevCo-CSV5SL9W.mjs} +3 -3
  37. package/dist/{op-factory-call-6Jg-ycA--4AC_11Od.mjs.map → op-factory-call-B3-CevCo-CSV5SL9W.mjs.map} +1 -1
  38. package/dist/{pack-D8V-43m8.d.mts → pack-CRA_2QjF.d.mts} +8 -38
  39. package/dist/pack-CRA_2QjF.d.mts.map +1 -0
  40. package/dist/plain-date-time-now-generator-DJ3icyVr-B-rdIVd3.d.mts +23 -0
  41. package/dist/plain-date-time-now-generator-DJ3icyVr-B-rdIVd3.d.mts.map +1 -0
  42. package/dist/{planner-C70Loeo_-qHTNBO3Q.mjs → planner-D_VBDqX0-C2jCXuIt.mjs} +6 -6
  43. package/dist/{planner-C70Loeo_-qHTNBO3Q.mjs.map → planner-D_VBDqX0-C2jCXuIt.mjs.map} +1 -1
  44. package/dist/{planner-ddl-builders-Cf6-fTvi-CKp-yZkB.mjs → planner-ddl-builders-CpXQ-J0X-CL5gNUSG.mjs} +14 -5
  45. package/dist/{planner-ddl-builders-Cf6-fTvi-CKp-yZkB.mjs.map → planner-ddl-builders-CpXQ-J0X-CL5gNUSG.mjs.map} +1 -1
  46. package/dist/{planner-ddl-builders-ijp60-JO.d.mts → planner-ddl-builders-bBCUsq_0.d.mts} +2 -2
  47. package/dist/planner-ddl-builders-bBCUsq_0.d.mts.map +1 -0
  48. package/dist/{planner-produced-postgres-migration-ButAgK7L-CZXweEva.mjs → planner-produced-postgres-migration-DwcW5RrQ-D0DPBmoS.mjs} +3 -3
  49. package/dist/{planner-produced-postgres-migration-ButAgK7L-CZXweEva.mjs.map → planner-produced-postgres-migration-DwcW5RrQ-D0DPBmoS.mjs.map} +1 -1
  50. package/dist/{postgres-contract-view-C22aDeL9-BWJIOpCz.mjs → postgres-contract-view-D7tYWHwD-DJNOh9Qo.mjs} +3 -3
  51. package/dist/{postgres-contract-view-C22aDeL9-BWJIOpCz.mjs.map → postgres-contract-view-D7tYWHwD-DJNOh9Qo.mjs.map} +1 -1
  52. package/dist/{postgres-migration-Cj-DvDY8-CIrWHp9I.mjs → postgres-migration-DXHNRgZA-HzAql-Bj.mjs} +4 -4
  53. package/dist/{postgres-migration-Cj-DvDY8-CIrWHp9I.mjs.map → postgres-migration-DXHNRgZA-HzAql-Bj.mjs.map} +1 -1
  54. package/dist/prisma7-binding-C38o_ABR.d.mts +1012 -0
  55. package/dist/prisma7-binding-C38o_ABR.d.mts.map +1 -0
  56. package/dist/prisma7-binding-DjpSw5G6.mjs +331 -0
  57. package/dist/prisma7-binding-DjpSw5G6.mjs.map +1 -0
  58. package/dist/{runtime-CpeP58Y6.d.mts → runtime-BRbiY5Vj.d.mts} +2 -2
  59. package/dist/{runtime-CpeP58Y6.d.mts.map → runtime-BRbiY5Vj.d.mts.map} +1 -1
  60. package/dist/target.d.mts +8 -7
  61. package/dist/target.mjs +13 -12
  62. package/dist/target__control.d.mts +3 -3
  63. package/dist/target__control.mjs +3 -3
  64. package/dist/target__default-normalizer.d.mts +1 -1
  65. package/dist/target__default-normalizer.mjs +1 -1
  66. package/dist/target__diff-database-schema.mjs +1 -1
  67. package/dist/target__issue-planner.mjs +1 -1
  68. package/dist/target__migration.mjs +2 -2
  69. package/dist/target__op-factory-call.mjs +1 -1
  70. package/dist/target__pack.d.mts +1 -1
  71. package/dist/target__pack.mjs +1 -1
  72. package/dist/target__planner-ddl-builders.d.mts +1 -1
  73. package/dist/target__planner-ddl-builders.mjs +1 -1
  74. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  75. package/dist/target__planner.mjs +2 -2
  76. package/dist/target__prisma7-binding.d.mts +2 -0
  77. package/dist/target__prisma7-binding.mjs +2 -0
  78. package/dist/target__runtime.d.mts +3 -3
  79. package/dist/target__runtime.mjs +3 -3
  80. package/dist/target__runtime.mjs.map +1 -1
  81. package/package.json +10 -9
  82. package/dist/authoring-DgeWf8RC-C-jQzf_w.mjs.map +0 -1
  83. package/dist/control-BC3oXXIK.mjs.map +0 -1
  84. package/dist/control-adapter-5et6pVM9-B5CKg-5B.mjs.map +0 -1
  85. package/dist/control-policy-BKgU_M65-BWedWA-f.mjs.map +0 -1
  86. package/dist/default-normalizer-Ba5ZebHM-isV86rjy.mjs.map +0 -1
  87. package/dist/list-decoder-8mZBUNe0-C9dPXUP0.d.mts +0 -13
  88. package/dist/list-decoder-8mZBUNe0-C9dPXUP0.d.mts.map +0 -1
  89. package/dist/pack-D8V-43m8.d.mts.map +0 -1
  90. package/dist/planner-ddl-builders-ijp60-JO.d.mts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-policy-B8x7UxGf-BjTez7am.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/control-policy-B8x7UxGf.mjs"],"sourcesContent":["import { r as isPostgresSchema } from \"./postgres-schema-PFL-fpel.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, F as buildTargetDetails, M as SetDefaultCall, N as SetNotNullCall, O as RawSqlCall, P as postgresDefaultToDdlColumnDefault, 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, 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-B3-CevCo.mjs\";\nimport { t as buildExpectedFormatType } from \"./planner-sql-checks-CaRMR5SA.mjs\";\nimport { n as buildColumnTypeSql, t as buildColumnDefaultSql } from \"./planner-ddl-builders-CpXQ-J0X.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 { 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\treturn {\n\t\t...columnTypeLike(`column \"${column.name}\"`, column),\n\t\tnullable: column.nullable,\n\t\t...ifDefined(\"default\", column.resolvedDefault)\n\t};\n}\nfunction columnTypeLike(owner, identity) {\n\tif (identity.codecRef === void 0 || identity.codecBaseNativeType === void 0) throw new InternalError(`columnTypeLike: expected ${owner} carries no codec identity — the expected tree must be derived via contractToSchemaIR for planning`);\n\treturn {\n\t\tnativeType: identity.codecBaseNativeType,\n\t\tcodecId: identity.codecRef.codecId,\n\t\t...ifDefined(\"many\", identity.many ?? identity.codecRef.many),\n\t\t...ifDefined(\"typeParams\", identity.codecRef.typeParams !== void 0 ? blindCast(identity.codecRef.typeParams) : void 0),\n\t\t...identity.codecNamedType ? { typeRef: \"<resolved>\" } : {}\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. A list default\n* is cast to the column type as the column's DDL writes it.\n*/\nfunction renderColumnDefaultSql(defaultNode, codecHooks) {\n\tif (defaultNode.resolved === void 0) return \"\";\n\tconst typeLike = columnTypeLike(\"column default\", defaultNode);\n\treturn buildColumnDefaultSql(defaultNode.resolved, {\n\t\tnativeType: buildColumnTypeSql(typeLike, codecHooks, {}, false),\n\t\t...ifDefined(\"many\", typeLike.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* 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* 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\tstorageTypePlanCallStrategy,\n\tnotNullAddColumnCallStrategy\n];\n//#endregion\n//#region src/core/migrations/issue-planner.ts\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\":\n\t\tcase \"renameCheckConstraint\": 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\telse if (anyCall.newConstraintName) location.constraint = anyCall.newConstraintName;\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/** 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 every declared CHECK 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 declaredChecks = (table.checks ?? []).map((c) => contractFree.checkExpression(c.name, c.expression));\n\tconst allTableConstraints = [...primaryKeyConstraints, ...declaredChecks];\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 8 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, codecHooks) {\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), codecHooks);\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}\n/**\n* The index treatment: a missing check is added, an undeclared live check is\n* dropped, and a paired divergence is a conflict. `not-equal` is reachable only\n* for an exact-named expected check — a wire-named one compares by name, so a\n* changed predicate re-suffixes the name and arrives as missing + extra\n* instead.\n*/\nfunction mapCheckNodeIssue(issue, schemaName, tableName) {\n\tif (issueOutcome(issue) === \"not-found\") {\n\t\tconst check = blindCast(issue.expected);\n\t\treturn ok([new AddCheckConstraintCall(schemaName, tableName, check.name, check.expression)]);\n\t}\n\tif (issueOutcome(issue) === \"not-expected\") return ok([new DropCheckConstraintCall(schemaName, tableName, blindCast(issue.actual).name)]);\n\treturn notOk(nodeConflict(\"unsupportedOperation\", 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, ctx.codecHooks);\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-B8x7UxGf.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,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,OAAO;EACN,GAAG,eAAe,WAAW,OAAO,KAAK,IAAI,MAAM;EACnD,UAAU,OAAO;EACjB,GAAG,UAAU,WAAW,OAAO,eAAe;CAC/C;AACD;AACA,SAAS,eAAe,OAAO,UAAU;CACxC,IAAI,SAAS,aAAa,KAAK,KAAK,SAAS,wBAA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AM,KAAK;EAC/E;CACD;CACA,MAAM,YAAY,MAAM,KAAK;CAC7B,IAAI,cAAc,KAAK,GAAG,OAAO,KAAK;CACtC,MAAM,gBAAgB,MAAM,KAAK;CACjC,MAAM,cAAc,2BAA2B,UAAU,WAAW,aAAa;CACjF,MAAM,QAAQ,SAAS,SAAS,SAAS;EACxC;EACA,YAAY;EACZ,YAAY;CACb,CAAC;CACD,OAAO;EACN;EACA,YAAY;EACZ,YAAY;EACZ,GAAG,UAAU,UAAU,gBAAgB,KAAK,CAAC;EAC7C,GAAG,UAAU,6BAA6B,OAAO,OAAO;EACxD,kBAAkB,4CAA4C,KAAK,MAAM,KAAK;CAC/E;AACD"}
@@ -1,4 +1,4 @@
1
- //#region ../../../3-targets/3-targets/postgres/dist/default-normalizer-Ba5ZebHM.mjs
1
+ //#region ../../../3-targets/3-targets/postgres/dist/default-normalizer-Bjtm2F4f.mjs
2
2
  /**
3
3
  * Pre-compiled regex patterns for performance.
4
4
  * These are compiled once at module load time rather than on each function call.
@@ -14,8 +14,26 @@ const UUID_OSSP_PATTERN = /^uuid_generate_v4\s*\(\s*\)$/i;
14
14
  const NULL_PATTERN = /^NULL(?:::.+)?$/i;
15
15
  const TRUE_PATTERN = /^true$/i;
16
16
  const FALSE_PATTERN = /^false$/i;
17
- const NUMERIC_PATTERN = /^-?\d+(\.\d+)?$/;
18
- const STRING_LITERAL_PATTERN = /^'((?:[^']|'')*)'(?:::(?:"[^"]+"|[\w\s]+)(?:\(\d+\))?)?$/;
17
+ /**
18
+ * A decimal numeral with an optional sign and an optional exponent. Postgres prints a `real` or
19
+ * `double precision` default in exponent notation once its magnitude is large or small enough:
20
+ * `'1e+20'::real`, `'1e-320'::double precision`.
21
+ */
22
+ const NUMERAL = String.raw`[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?`;
23
+ const NUMERIC_PATTERN = new RegExp(`^${NUMERAL}$`);
24
+ /**
25
+ * A cast target type: a builtin of one or more words, where any word may carry a modifier
26
+ * (`timestamp(3) without time zone`, `numeric(65,30)`), or a quoted identifier (`"AuditAction"`);
27
+ * either may be qualified by a possibly quoted schema (`audit."AuditAction"`, `"my schema".t`).
28
+ */
29
+ const TYPE_NAME = String.raw`(?:(?:"(?:[^"]|"")+"|\w+)\.)?(?:"(?:[^"]|"")+"|\w+(?:\(\d+(?:,\s*\d+)?\))?(?:\s+\w+(?:\(\d+(?:,\s*\d+)?\))?)*)`;
30
+ const QUOTED_LITERAL_PATTERN = new RegExp(`^'((?:[^']|'')*)'(?:::(${TYPE_NAME}))?$`);
31
+ const NUMBER_LITERAL_PATTERN = new RegExp(`^(${NUMERAL})(?:::(${TYPE_NAME}))?$`);
32
+ const PARENTHESISED_CAST_PATTERN = new RegExp(String.raw`^\((.+)\)::(${TYPE_NAME})$`, "s");
33
+ const INTEGER_PATTERN = /^-?\d+$/;
34
+ const INTEGER_TYPE_PATTERN = /^(?:smallint|integer|bigint|int2|int4|int8)$/i;
35
+ const NUMBER_TYPE_PATTERN = /^(?:smallint|integer|bigint|int2|int4|int8|real|double precision|float4|float8|numeric|decimal)(?:\(\d+(?:,\s*\d+)?\))?$/i;
36
+ const DECIMAL_TEXT_TYPE_PATTERN = /^(?:bigint|int8|numeric|decimal)(?:\(\d+(?:,\s*\d+)?\))?$/i;
19
37
  /**
20
38
  * Matches a Postgres array literal default of the form `'{...}'::elemtype[]`.
21
39
  * The literal body is captured in group 1; the cast (including `[]`) is optional.
@@ -23,6 +41,13 @@ const STRING_LITERAL_PATTERN = /^'((?:[^']|'')*)'(?:::(?:"[^"]+"|[\w\s]+)(?:\(\d
23
41
  */
24
42
  const ARRAY_LITERAL_PATTERN = /^'(\{.*\})'(?:::.+\[\])?$/;
25
43
  /**
44
+ * Matches the constructor spelling Postgres reports for a default written as
45
+ * `ARRAY[...]`: `ARRAY['a'::text, 'b'::text]`, `ARRAY[1, 2]`, `ARRAY[]::text[]`.
46
+ * The element list is captured in group 1; the outer cast is optional.
47
+ */
48
+ const ARRAY_CONSTRUCTOR_PATTERN = new RegExp(String.raw`^ARRAY\[(.*?)\](?:::${TYPE_NAME}\[\])?$`, "is");
49
+ const OUTER_ARRAY_CAST_PATTERN = new RegExp(String.raw`^\((.+)\)::${TYPE_NAME}\[\]$`, "s");
50
+ /**
26
51
  * Returns the canonical expression for a timestamp default function, or undefined
27
52
  * if the expression is not a recognized timestamp default.
28
53
  *
@@ -46,6 +71,54 @@ function canonicalizeTimestampDefault(expr) {
46
71
  if (NOW_LITERAL_PATTERN.test(inner)) return "now()";
47
72
  }
48
73
  /**
74
+ * A numeral cast to a number type. A cast to an integer type rounds a fraction, so that numeral is
75
+ * not the value.
76
+ */
77
+ function castNumber(numeral, castType) {
78
+ if (castType === void 0) return {
79
+ kind: "number",
80
+ numeral
81
+ };
82
+ if (!NUMBER_TYPE_PATTERN.test(castType)) return void 0;
83
+ if (INTEGER_TYPE_PATTERN.test(castType) && !INTEGER_PATTERN.test(numeral)) return void 0;
84
+ return {
85
+ kind: "number",
86
+ numeral
87
+ };
88
+ }
89
+ /**
90
+ * Reads a literal by its cast type: `'-1'::integer` and `(1)::bigint` are numbers, `'a'::text` is a
91
+ * string. A parenthesised cast is read only from number to number: `('now'::text)::date` is
92
+ * evaluated on insert. Anything else, such as an operator or a function call, is not a literal.
93
+ */
94
+ function readLiteralToken(expression) {
95
+ const quoted = QUOTED_LITERAL_PATTERN.exec(expression);
96
+ if (quoted?.[1] !== void 0) {
97
+ const text = quoted[1].replace(/''/g, "'");
98
+ const castType = quoted[2];
99
+ return castType !== void 0 && NUMBER_TYPE_PATTERN.test(castType) && NUMERIC_PATTERN.test(text) ? castNumber(text, castType) : {
100
+ kind: "string",
101
+ text
102
+ };
103
+ }
104
+ const number = NUMBER_LITERAL_PATTERN.exec(expression);
105
+ if (number?.[1] !== void 0) return castNumber(number[1], number[2]);
106
+ const parenthesised = PARENTHESISED_CAST_PATTERN.exec(expression);
107
+ if (parenthesised?.[1] === void 0 || parenthesised[2] === void 0) return void 0;
108
+ const inner = readLiteralToken(parenthesised[1].trim());
109
+ return inner?.kind === "number" ? castNumber(inner.numeral, parenthesised[2]) : void 0;
110
+ }
111
+ /**
112
+ * `int8` and `numeric` defaults are decimal text, the JSON form of their codecs, so no digit is
113
+ * lost to a JavaScript number. A column that is not a number type stores the numeral as text.
114
+ */
115
+ function numberValue(numeral, nativeType) {
116
+ if (nativeType !== void 0 && DECIMAL_TEXT_TYPE_PATTERN.test(nativeType)) return numeral;
117
+ if (nativeType !== void 0 && !NUMBER_TYPE_PATTERN.test(nativeType)) return numeral;
118
+ const parsed = Number(numeral);
119
+ return Number.isFinite(parsed) ? parsed : void 0;
120
+ }
121
+ /**
49
122
  * Splits a Postgres array literal body (without the enclosing braces) into its
50
123
  * element tokens, honouring quoting. A comma only separates elements when it is
51
124
  * outside double quotes; inside a quoted element a doubled quote (`""`) or a
@@ -113,7 +186,7 @@ function splitArrayElements(inner) {
113
186
  * - quoted elements that contain commas, doubled/escaped quotes, and the literal
114
187
  * strings `NULL`/`true`/`false` (a quoted token is always a string)
115
188
  */
116
- function parseArrayLiteralBody(body) {
189
+ function parseArrayLiteralBody(body, elementType) {
117
190
  const inner = body.slice(1, -1).trim();
118
191
  if (inner === "") return [];
119
192
  const tokens = splitArrayElements(inner);
@@ -138,7 +211,9 @@ function parseArrayLiteralBody(body) {
138
211
  continue;
139
212
  }
140
213
  if (NUMERIC_PATTERN.test(el)) {
141
- result.push(Number(el));
214
+ const value = numberValue(el, elementType);
215
+ if (value === void 0) return void 0;
216
+ result.push(value);
142
217
  continue;
143
218
  }
144
219
  return;
@@ -146,6 +221,59 @@ function parseArrayLiteralBody(body) {
146
221
  return result;
147
222
  }
148
223
  /**
224
+ * Splits an `ARRAY[...]` element list on the commas outside quotes and parentheses, so
225
+ * `numeric(65,30)` and `'a,b'` stay inside one element. A doubled quote inside an element is a
226
+ * literal quote, so it never closes one.
227
+ */
228
+ function splitConstructorElements(body) {
229
+ const elements = [];
230
+ let current = "";
231
+ let quote;
232
+ let depth = 0;
233
+ for (const char of body) {
234
+ if (quote !== void 0) {
235
+ if (char === quote) quote = void 0;
236
+ } else if (char === "'" || char === "\"") quote = char;
237
+ else if (char === "(") depth++;
238
+ else if (char === ")") depth--;
239
+ else if (char === "," && depth === 0) {
240
+ elements.push(current);
241
+ current = "";
242
+ continue;
243
+ }
244
+ current += char;
245
+ }
246
+ elements.push(current);
247
+ return elements.map((element) => element.trim());
248
+ }
249
+ /**
250
+ * Reads one `ARRAY[...]` element: NULL, a boolean, or a literal read by its cast type. Anything
251
+ * else, such as a function call, means the constructor is not a literal and the caller keeps the
252
+ * raw expression.
253
+ */
254
+ function parseConstructorElement(element, elementType) {
255
+ if (NULL_PATTERN.test(element)) return null;
256
+ if (TRUE_PATTERN.test(element)) return true;
257
+ if (FALSE_PATTERN.test(element)) return false;
258
+ const token = readLiteralToken(element);
259
+ if (token === void 0) return void 0;
260
+ return token.kind === "number" ? numberValue(token.numeral, elementType) : token.text;
261
+ }
262
+ function parseArrayConstructor(body, elementType) {
263
+ if (body.trim() === "") return [];
264
+ const values = [];
265
+ for (const element of splitConstructorElements(body)) {
266
+ const value = parseConstructorElement(element, elementType);
267
+ if (value === void 0) return void 0;
268
+ values.push(value);
269
+ }
270
+ return values;
271
+ }
272
+ function unwrapOuterArrayCasts(expression) {
273
+ const match = OUTER_ARRAY_CAST_PATTERN.exec(expression);
274
+ return match?.[1] === void 0 ? expression : unwrapOuterArrayCasts(match[1].trim());
275
+ }
276
+ /**
149
277
  * Parses a raw Postgres column default expression into a normalized ColumnDefault.
150
278
  * This enables semantic comparison between contract defaults and introspected schema defaults.
151
279
  *
@@ -153,22 +281,29 @@ function parseArrayLiteralBody(body) {
153
281
  * keeping the introspection layer focused on faithful data capture.
154
282
  *
155
283
  * @param rawDefault - Raw default expression from information_schema.columns.column_default
156
- * @param nativeType - Native column type, used for type-aware parsing (array, bigint, JSON)
284
+ * @param nativeType - Native column type, used for type-aware parsing (array, int8, numeric, JSON)
157
285
  * @returns Normalized ColumnDefault or undefined if the expression cannot be parsed
158
286
  */
159
287
  function parsePostgresDefault(rawDefault, nativeType) {
160
288
  const trimmed = rawDefault.trim();
161
289
  const normalizedType = nativeType?.toLowerCase();
162
- const isBigInt = normalizedType === "bigint" || normalizedType === "int8";
163
- const isArrayType = normalizedType?.endsWith("[]") ?? false;
164
290
  if (NEXTVAL_PATTERN.test(trimmed)) return {
165
291
  kind: "function",
166
292
  expression: "autoincrement()"
167
293
  };
168
- if (isArrayType) {
294
+ if (normalizedType?.endsWith("[]")) {
295
+ const elementType = normalizedType.slice(0, -2);
169
296
  const arrayMatch = trimmed.match(ARRAY_LITERAL_PATTERN);
170
297
  if (arrayMatch?.[1] !== void 0) {
171
- const parsed = parseArrayLiteralBody(arrayMatch[1]);
298
+ const parsed = parseArrayLiteralBody(arrayMatch[1], elementType);
299
+ if (parsed !== void 0) return {
300
+ kind: "literal",
301
+ value: parsed
302
+ };
303
+ }
304
+ const constructorMatch = unwrapOuterArrayCasts(trimmed).match(ARRAY_CONSTRUCTOR_PATTERN);
305
+ if (constructorMatch?.[1] !== void 0) {
306
+ const parsed = parseArrayConstructor(constructorMatch[1], elementType);
172
307
  if (parsed !== void 0) return {
173
308
  kind: "literal",
174
309
  value: parsed
@@ -200,35 +335,27 @@ function parsePostgresDefault(rawDefault, nativeType) {
200
335
  kind: "literal",
201
336
  value: false
202
337
  };
203
- if (NUMERIC_PATTERN.test(trimmed)) {
204
- const num = Number(trimmed);
205
- if (!Number.isFinite(num)) return void 0;
206
- if (isBigInt) return {
207
- kind: "literal",
208
- value: trimmed
209
- };
210
- return {
338
+ const token = readLiteralToken(trimmed);
339
+ if (token === void 0) return {
340
+ kind: "function",
341
+ expression: trimmed
342
+ };
343
+ if (token.kind === "number") {
344
+ const value = numberValue(token.numeral, normalizedType);
345
+ return value === void 0 ? void 0 : {
211
346
  kind: "literal",
212
- value: num
347
+ value
213
348
  };
214
349
  }
215
- const stringMatch = trimmed.match(STRING_LITERAL_PATTERN);
216
- if (stringMatch?.[1] !== void 0) {
217
- const unescaped = stringMatch[1].replace(/''/g, "'");
218
- if (normalizedType === "json" || normalizedType === "jsonb") try {
219
- return {
220
- kind: "literal",
221
- value: JSON.parse(unescaped)
222
- };
223
- } catch {}
350
+ if (normalizedType === "json" || normalizedType === "jsonb") try {
224
351
  return {
225
352
  kind: "literal",
226
- value: unescaped
353
+ value: JSON.parse(token.text)
227
354
  };
228
- }
355
+ } catch {}
229
356
  return {
230
- kind: "function",
231
- expression: trimmed
357
+ kind: "literal",
358
+ value: token.text
232
359
  };
233
360
  }
234
361
  /**
@@ -250,4 +377,4 @@ function postgresResolveDefault(def, resolvedNativeType) {
250
377
  //#endregion
251
378
  export { postgresResolveDefault as n, parsePostgresDefault as t };
252
379
 
253
- //# sourceMappingURL=default-normalizer-Ba5ZebHM-isV86rjy.mjs.map
380
+ //# sourceMappingURL=default-normalizer-Bjtm2F4f-uV5vvkVt.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-normalizer-Bjtm2F4f-uV5vvkVt.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/default-normalizer-Bjtm2F4f.mjs"],"sourcesContent":["//#region src/core/default-normalizer.ts\n/**\n* Pre-compiled regex patterns for performance.\n* These are compiled once at module load time rather than on each function call.\n*/\nconst NEXTVAL_PATTERN = /^nextval\\s*\\(/i;\nconst NOW_FUNCTION_PATTERN = /^(now\\s*\\(\\s*\\)|CURRENT_TIMESTAMP)$/i;\nconst CLOCK_TIMESTAMP_PATTERN = /^clock_timestamp\\s*\\(\\s*\\)$/i;\nconst TIMESTAMP_CAST_SUFFIX = /::timestamp(?:tz|\\s+(?:with|without)\\s+time\\s+zone)?$/i;\nconst TEXT_CAST_SUFFIX = /::text$/i;\nconst NOW_LITERAL_PATTERN = /^'now'$/i;\nconst UUID_PATTERN = /^gen_random_uuid\\s*\\(\\s*\\)$/i;\nconst UUID_OSSP_PATTERN = /^uuid_generate_v4\\s*\\(\\s*\\)$/i;\nconst NULL_PATTERN = /^NULL(?:::.+)?$/i;\nconst TRUE_PATTERN = /^true$/i;\nconst FALSE_PATTERN = /^false$/i;\n/**\n* A decimal numeral with an optional sign and an optional exponent. Postgres prints a `real` or\n* `double precision` default in exponent notation once its magnitude is large or small enough:\n* `'1e+20'::real`, `'1e-320'::double precision`.\n*/\nconst NUMERAL = String.raw`[+-]?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?`;\nconst NUMERIC_PATTERN = new RegExp(`^${NUMERAL}$`);\n/**\n* A cast target type: a builtin of one or more words, where any word may carry a modifier\n* (`timestamp(3) without time zone`, `numeric(65,30)`), or a quoted identifier (`\"AuditAction\"`);\n* either may be qualified by a possibly quoted schema (`audit.\"AuditAction\"`, `\"my schema\".t`).\n*/\nconst TYPE_NAME = String.raw`(?:(?:\"(?:[^\"]|\"\")+\"|\\w+)\\.)?(?:\"(?:[^\"]|\"\")+\"|\\w+(?:\\(\\d+(?:,\\s*\\d+)?\\))?(?:\\s+\\w+(?:\\(\\d+(?:,\\s*\\d+)?\\))?)*)`;\nconst QUOTED_LITERAL_PATTERN = new RegExp(`^'((?:[^']|'')*)'(?:::(${TYPE_NAME}))?$`);\nconst NUMBER_LITERAL_PATTERN = new RegExp(`^(${NUMERAL})(?:::(${TYPE_NAME}))?$`);\nconst PARENTHESISED_CAST_PATTERN = new RegExp(String.raw`^\\((.+)\\)::(${TYPE_NAME})$`, \"s\");\nconst INTEGER_PATTERN = /^-?\\d+$/;\nconst INTEGER_TYPE_PATTERN = /^(?:smallint|integer|bigint|int2|int4|int8)$/i;\nconst NUMBER_TYPE_PATTERN = /^(?:smallint|integer|bigint|int2|int4|int8|real|double precision|float4|float8|numeric|decimal)(?:\\(\\d+(?:,\\s*\\d+)?\\))?$/i;\nconst DECIMAL_TEXT_TYPE_PATTERN = /^(?:bigint|int8|numeric|decimal)(?:\\(\\d+(?:,\\s*\\d+)?\\))?$/i;\n/**\n* Matches a Postgres array literal default of the form `'{...}'::elemtype[]`.\n* The literal body is captured in group 1; the cast (including `[]`) is optional.\n* Examples: `'{}'::text[]`, `'{1,2}'::integer[]`, `'{}'`\n*/\nconst ARRAY_LITERAL_PATTERN = /^'(\\{.*\\})'(?:::.+\\[\\])?$/;\n/**\n* Matches the constructor spelling Postgres reports for a default written as\n* `ARRAY[...]`: `ARRAY['a'::text, 'b'::text]`, `ARRAY[1, 2]`, `ARRAY[]::text[]`.\n* The element list is captured in group 1; the outer cast is optional.\n*/\nconst ARRAY_CONSTRUCTOR_PATTERN = new RegExp(String.raw`^ARRAY\\[(.*?)\\](?:::${TYPE_NAME}\\[\\])?$`, \"is\");\nconst OUTER_ARRAY_CAST_PATTERN = new RegExp(String.raw`^\\((.+)\\)::${TYPE_NAME}\\[\\]$`, \"s\");\n/**\n* Returns the canonical expression for a timestamp default function, or undefined\n* if the expression is not a recognized timestamp default.\n*\n* Keeps now()/CURRENT_TIMESTAMP and clock_timestamp() distinct:\n* - now(), CURRENT_TIMESTAMP, ('now'::text)::timestamp... → 'now()'\n* - clock_timestamp(), clock_timestamp()::timestamptz → 'clock_timestamp()'\n*\n* These are semantically different in Postgres: now() returns the transaction\n* start time (constant within a transaction), while clock_timestamp() returns\n* the actual wall-clock time (can differ across rows in a single INSERT).\n*/\nfunction canonicalizeTimestampDefault(expr) {\n\tif (NOW_FUNCTION_PATTERN.test(expr)) return \"now()\";\n\tif (CLOCK_TIMESTAMP_PATTERN.test(expr)) return \"clock_timestamp()\";\n\tif (!TIMESTAMP_CAST_SUFFIX.test(expr)) return void 0;\n\tlet inner = expr.replace(TIMESTAMP_CAST_SUFFIX, \"\").trim();\n\tif (inner.startsWith(\"(\") && inner.endsWith(\")\")) inner = inner.slice(1, -1).trim();\n\tif (NOW_FUNCTION_PATTERN.test(inner)) return \"now()\";\n\tif (CLOCK_TIMESTAMP_PATTERN.test(inner)) return \"clock_timestamp()\";\n\tinner = inner.replace(TEXT_CAST_SUFFIX, \"\").trim();\n\tif (NOW_LITERAL_PATTERN.test(inner)) return \"now()\";\n}\n/**\n* A numeral cast to a number type. A cast to an integer type rounds a fraction, so that numeral is\n* not the value.\n*/\nfunction castNumber(numeral, castType) {\n\tif (castType === void 0) return {\n\t\tkind: \"number\",\n\t\tnumeral\n\t};\n\tif (!NUMBER_TYPE_PATTERN.test(castType)) return void 0;\n\tif (INTEGER_TYPE_PATTERN.test(castType) && !INTEGER_PATTERN.test(numeral)) return void 0;\n\treturn {\n\t\tkind: \"number\",\n\t\tnumeral\n\t};\n}\n/**\n* Reads a literal by its cast type: `'-1'::integer` and `(1)::bigint` are numbers, `'a'::text` is a\n* string. A parenthesised cast is read only from number to number: `('now'::text)::date` is\n* evaluated on insert. Anything else, such as an operator or a function call, is not a literal.\n*/\nfunction readLiteralToken(expression) {\n\tconst quoted = QUOTED_LITERAL_PATTERN.exec(expression);\n\tif (quoted?.[1] !== void 0) {\n\t\tconst text = quoted[1].replace(/''/g, \"'\");\n\t\tconst castType = quoted[2];\n\t\treturn castType !== void 0 && NUMBER_TYPE_PATTERN.test(castType) && NUMERIC_PATTERN.test(text) ? castNumber(text, castType) : {\n\t\t\tkind: \"string\",\n\t\t\ttext\n\t\t};\n\t}\n\tconst number = NUMBER_LITERAL_PATTERN.exec(expression);\n\tif (number?.[1] !== void 0) return castNumber(number[1], number[2]);\n\tconst parenthesised = PARENTHESISED_CAST_PATTERN.exec(expression);\n\tif (parenthesised?.[1] === void 0 || parenthesised[2] === void 0) return void 0;\n\tconst inner = readLiteralToken(parenthesised[1].trim());\n\treturn inner?.kind === \"number\" ? castNumber(inner.numeral, parenthesised[2]) : void 0;\n}\n/**\n* `int8` and `numeric` defaults are decimal text, the JSON form of their codecs, so no digit is\n* lost to a JavaScript number. A column that is not a number type stores the numeral as text.\n*/\nfunction numberValue(numeral, nativeType) {\n\tif (nativeType !== void 0 && DECIMAL_TEXT_TYPE_PATTERN.test(nativeType)) return numeral;\n\tif (nativeType !== void 0 && !NUMBER_TYPE_PATTERN.test(nativeType)) return numeral;\n\tconst parsed = Number(numeral);\n\treturn Number.isFinite(parsed) ? parsed : void 0;\n}\n/**\n* Splits a Postgres array literal body (without the enclosing braces) into its\n* element tokens, honouring quoting. A comma only separates elements when it is\n* outside double quotes; inside a quoted element a doubled quote (`\"\"`) or a\n* backslash-escaped quote (`\\\"`) is a literal quote, and a backslash escapes the\n* next character. Returns undefined if the body is malformed (e.g. an unbalanced\n* quote).\n*/\nfunction splitArrayElements(inner) {\n\tconst tokens = [];\n\tlet current = \"\";\n\tlet inQuotes = false;\n\tlet quoted = false;\n\tfor (let i = 0; i < inner.length; i++) {\n\t\tconst char = inner[i];\n\t\tif (inQuotes) {\n\t\t\tif (char === \"\\\\\") {\n\t\t\t\tconst next = inner[i + 1];\n\t\t\t\tif (next === void 0) return void 0;\n\t\t\t\tcurrent += next;\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (char === \"\\\"\") {\n\t\t\t\tif (inner[i + 1] === \"\\\"\") {\n\t\t\t\t\tcurrent += \"\\\"\";\n\t\t\t\t\ti++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tinQuotes = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tcurrent += char;\n\t\t\tcontinue;\n\t\t}\n\t\tif (char === \"\\\"\") {\n\t\t\tinQuotes = true;\n\t\t\tquoted = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (char === \",\") {\n\t\t\ttokens.push({\n\t\t\t\tvalue: current,\n\t\t\t\tquoted\n\t\t\t});\n\t\t\tcurrent = \"\";\n\t\t\tquoted = false;\n\t\t\tcontinue;\n\t\t}\n\t\tcurrent += char;\n\t}\n\tif (inQuotes) return void 0;\n\ttokens.push({\n\t\tvalue: current,\n\t\tquoted\n\t});\n\treturn tokens;\n}\n/**\n* Parses a Postgres array literal body (`{...}`) into a JS array of primitives.\n* Returns undefined if the body cannot be reliably parsed.\n*\n* Handles:\n* - `{}` → `[]`\n* - `{elem1,elem2,...}` → `[elem1, elem2, ...]` with numeric and string element coercion\n* - quoted elements that contain commas, doubled/escaped quotes, and the literal\n* strings `NULL`/`true`/`false` (a quoted token is always a string)\n*/\nfunction parseArrayLiteralBody(body, elementType) {\n\tconst inner = body.slice(1, -1).trim();\n\tif (inner === \"\") return [];\n\tconst tokens = splitArrayElements(inner);\n\tif (tokens === void 0) return void 0;\n\tconst result = [];\n\tfor (const token of tokens) {\n\t\tif (token.quoted) {\n\t\t\tresult.push(token.value);\n\t\t\tcontinue;\n\t\t}\n\t\tconst el = token.value.trim();\n\t\tif (el.toUpperCase() === \"NULL\") {\n\t\t\tresult.push(null);\n\t\t\tcontinue;\n\t\t}\n\t\tif (el === \"true\") {\n\t\t\tresult.push(true);\n\t\t\tcontinue;\n\t\t}\n\t\tif (el === \"false\") {\n\t\t\tresult.push(false);\n\t\t\tcontinue;\n\t\t}\n\t\tif (NUMERIC_PATTERN.test(el)) {\n\t\t\tconst value = numberValue(el, elementType);\n\t\t\tif (value === void 0) return void 0;\n\t\t\tresult.push(value);\n\t\t\tcontinue;\n\t\t}\n\t\treturn;\n\t}\n\treturn result;\n}\n/**\n* Splits an `ARRAY[...]` element list on the commas outside quotes and parentheses, so\n* `numeric(65,30)` and `'a,b'` stay inside one element. A doubled quote inside an element is a\n* literal quote, so it never closes one.\n*/\nfunction splitConstructorElements(body) {\n\tconst elements = [];\n\tlet current = \"\";\n\tlet quote;\n\tlet depth = 0;\n\tfor (const char of body) {\n\t\tif (quote !== void 0) {\n\t\t\tif (char === quote) quote = void 0;\n\t\t} else if (char === \"'\" || char === \"\\\"\") quote = char;\n\t\telse if (char === \"(\") depth++;\n\t\telse if (char === \")\") depth--;\n\t\telse if (char === \",\" && depth === 0) {\n\t\t\telements.push(current);\n\t\t\tcurrent = \"\";\n\t\t\tcontinue;\n\t\t}\n\t\tcurrent += char;\n\t}\n\telements.push(current);\n\treturn elements.map((element) => element.trim());\n}\n/**\n* Reads one `ARRAY[...]` element: NULL, a boolean, or a literal read by its cast type. Anything\n* else, such as a function call, means the constructor is not a literal and the caller keeps the\n* raw expression.\n*/\nfunction parseConstructorElement(element, elementType) {\n\tif (NULL_PATTERN.test(element)) return null;\n\tif (TRUE_PATTERN.test(element)) return true;\n\tif (FALSE_PATTERN.test(element)) return false;\n\tconst token = readLiteralToken(element);\n\tif (token === void 0) return void 0;\n\treturn token.kind === \"number\" ? numberValue(token.numeral, elementType) : token.text;\n}\nfunction parseArrayConstructor(body, elementType) {\n\tif (body.trim() === \"\") return [];\n\tconst values = [];\n\tfor (const element of splitConstructorElements(body)) {\n\t\tconst value = parseConstructorElement(element, elementType);\n\t\tif (value === void 0) return void 0;\n\t\tvalues.push(value);\n\t}\n\treturn values;\n}\nfunction unwrapOuterArrayCasts(expression) {\n\tconst match = OUTER_ARRAY_CAST_PATTERN.exec(expression);\n\treturn match?.[1] === void 0 ? expression : unwrapOuterArrayCasts(match[1].trim());\n}\n/**\n* Parses a raw Postgres column default expression into a normalized ColumnDefault.\n* This enables semantic comparison between contract defaults and introspected schema defaults.\n*\n* Used by the migration diff layer to normalize raw database defaults during comparison,\n* keeping the introspection layer focused on faithful data capture.\n*\n* @param rawDefault - Raw default expression from information_schema.columns.column_default\n* @param nativeType - Native column type, used for type-aware parsing (array, int8, numeric, JSON)\n* @returns Normalized ColumnDefault or undefined if the expression cannot be parsed\n*/\nfunction parsePostgresDefault(rawDefault, nativeType) {\n\tconst trimmed = rawDefault.trim();\n\tconst normalizedType = nativeType?.toLowerCase();\n\tif (NEXTVAL_PATTERN.test(trimmed)) return {\n\t\tkind: \"function\",\n\t\texpression: \"autoincrement()\"\n\t};\n\tif (normalizedType?.endsWith(\"[]\")) {\n\t\tconst elementType = normalizedType.slice(0, -2);\n\t\tconst arrayMatch = trimmed.match(ARRAY_LITERAL_PATTERN);\n\t\tif (arrayMatch?.[1] !== void 0) {\n\t\t\tconst parsed = parseArrayLiteralBody(arrayMatch[1], elementType);\n\t\t\tif (parsed !== void 0) return {\n\t\t\t\tkind: \"literal\",\n\t\t\t\tvalue: parsed\n\t\t\t};\n\t\t}\n\t\tconst constructorMatch = unwrapOuterArrayCasts(trimmed).match(ARRAY_CONSTRUCTOR_PATTERN);\n\t\tif (constructorMatch?.[1] !== void 0) {\n\t\t\tconst parsed = parseArrayConstructor(constructorMatch[1], elementType);\n\t\t\tif (parsed !== void 0) return {\n\t\t\t\tkind: \"literal\",\n\t\t\t\tvalue: parsed\n\t\t\t};\n\t\t}\n\t}\n\tconst canonicalTimestamp = canonicalizeTimestampDefault(trimmed);\n\tif (canonicalTimestamp) return {\n\t\tkind: \"function\",\n\t\texpression: canonicalTimestamp\n\t};\n\tif (UUID_PATTERN.test(trimmed)) return {\n\t\tkind: \"function\",\n\t\texpression: \"gen_random_uuid()\"\n\t};\n\tif (UUID_OSSP_PATTERN.test(trimmed)) return {\n\t\tkind: \"function\",\n\t\texpression: \"gen_random_uuid()\"\n\t};\n\tif (NULL_PATTERN.test(trimmed)) return {\n\t\tkind: \"literal\",\n\t\tvalue: null\n\t};\n\tif (TRUE_PATTERN.test(trimmed)) return {\n\t\tkind: \"literal\",\n\t\tvalue: true\n\t};\n\tif (FALSE_PATTERN.test(trimmed)) return {\n\t\tkind: \"literal\",\n\t\tvalue: false\n\t};\n\tconst token = readLiteralToken(trimmed);\n\tif (token === void 0) return {\n\t\tkind: \"function\",\n\t\texpression: trimmed\n\t};\n\tif (token.kind === \"number\") {\n\t\tconst value = numberValue(token.numeral, normalizedType);\n\t\treturn value === void 0 ? void 0 : {\n\t\t\tkind: \"literal\",\n\t\t\tvalue\n\t\t};\n\t}\n\tif (normalizedType === \"json\" || normalizedType === \"jsonb\") try {\n\t\treturn {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: JSON.parse(token.text)\n\t\t};\n\t} catch {}\n\treturn {\n\t\tkind: \"literal\",\n\t\tvalue: token.text\n\t};\n}\n/**\n* Normalizes a contract-declared default through {@link parsePostgresDefault}\n* — the same parser introspection uses — so a function-shaped default the\n* parser recognizes as a literal (e.g. `dbgenerated(\"'{}'::jsonb\")`)\n* resolves to the same `resolvedDefault` shape a live introspected column\n* would produce. Compensates once, at `SchemaIR` construction of the\n* expected (contract-derived) side (`contractToSchemaIR`'s `resolveDefault`\n* hook), instead of at every site that later compares the two sides. A\n* literal default, or a function form the parser doesn't recognize, passes\n* through unchanged; `nextval(...)` normalizes to `autoincrement()` on both\n* sides, matching a `serial`/identity column's introspected counterpart.\n*/\nfunction postgresResolveDefault(def, resolvedNativeType) {\n\tif (def.kind !== \"function\") return def;\n\treturn parsePostgresDefault(def.expression, resolvedNativeType) ?? def;\n}\n//#endregion\nexport { postgresResolveDefault as n, parsePostgresDefault as t };\n\n//# sourceMappingURL=default-normalizer-Bjtm2F4f.mjs.map"],"mappings":";;;;;AAKA,MAAM,kBAAkB;AACxB,MAAM,uBAAuB;AAC7B,MAAM,0BAA0B;AAChC,MAAM,wBAAwB;AAC9B,MAAM,mBAAmB;AACzB,MAAM,sBAAsB;AAC5B,MAAM,eAAe;AACrB,MAAM,oBAAoB;AAC1B,MAAM,eAAe;AACrB,MAAM,eAAe;AACrB,MAAM,gBAAgB;;;;;;AAMtB,MAAM,UAAU,OAAO,GAAG;AAC1B,MAAM,kBAAkB,IAAI,OAAO,IAAI,QAAQ,EAAE;;;;;;AAMjD,MAAM,YAAY,OAAO,GAAG;AAC5B,MAAM,yBAAyB,IAAI,OAAO,0BAA0B,UAAU,KAAK;AACnF,MAAM,yBAAyB,IAAI,OAAO,KAAK,QAAQ,SAAS,UAAU,KAAK;AAC/E,MAAM,6BAA6B,IAAI,OAAO,OAAO,GAAG,eAAe,UAAU,KAAK,GAAG;AACzF,MAAM,kBAAkB;AACxB,MAAM,uBAAuB;AAC7B,MAAM,sBAAsB;AAC5B,MAAM,4BAA4B;;;;;;AAMlC,MAAM,wBAAwB;;;;;;AAM9B,MAAM,4BAA4B,IAAI,OAAO,OAAO,GAAG,uBAAuB,UAAU,UAAU,IAAI;AACtG,MAAM,2BAA2B,IAAI,OAAO,OAAO,GAAG,cA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 @@ import { ColumnDefault } from "@prisma/orm-framework/contract/types";
9
9
  * keeping the introspection layer focused on faithful data capture.
10
10
  *
11
11
  * @param rawDefault - Raw default expression from information_schema.columns.column_default
12
- * @param nativeType - Native column type, used for type-aware parsing (array, bigint, JSON)
12
+ * @param nativeType - Native column type, used for type-aware parsing (array, int8, numeric, JSON)
13
13
  * @returns Normalized ColumnDefault or undefined if the expression cannot be parsed
14
14
  */
15
15
  declare function parsePostgresDefault(rawDefault: string, nativeType?: string): ColumnDefault | undefined;
@@ -28,4 +28,4 @@ declare function parsePostgresDefault(rawDefault: string, nativeType?: string):
28
28
  declare function postgresResolveDefault(def: ColumnDefault, resolvedNativeType: string): ColumnDefault;
29
29
  //#endregion
30
30
  export { postgresResolveDefault as n, parsePostgresDefault as t };
31
- //# sourceMappingURL=default-normalizer-B36TOul4.d.mts.map
31
+ //# sourceMappingURL=default-normalizer-D9WbKo20.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"default-normalizer-B36TOul4.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/default-normalizer.d.mts"],"mappings":";;;;;;;;;;;;;;iBAaiB,qBAAqB,oBAAoB,sBAAsB;;;;;;;;;;;;;iBAa/D,uBAAuB,KAAK,eAAe,6BAA6B"}
1
+ {"version":3,"file":"default-normalizer-D9WbKo20.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/default-normalizer.d.mts"],"mappings":";;;;;;;;;;;;;;iBAaiB,qBAAqB,oBAAoB,sBAAsB;;;;;;;;;;;;;iBAa/D,uBAAuB,KAAK,eAAe,6BAA6B"}
@@ -1,12 +1,12 @@
1
1
  import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs";
2
2
  import { A as postgresQualifyColumnType } from "./codecs-7isLDrZp-DmbSAn6K.mjs";
3
3
  import { h as postgresCreateNamespace } from "./postgres-schema-PFL-fpel-s3InB8T0.mjs";
4
- import { a as postgresAuthoringFieldPresets, c as postgresAuthoringTypes, i as postgresAuthoringEntityTypes, l as postgresLowerEntityHandles, o as postgresAuthoringModelAttributes, s as postgresAuthoringPslBlockDescriptors } from "./authoring-DgeWf8RC-C-jQzf_w.mjs";
4
+ import { c as postgresAuthoringFieldPresets, d as postgresAuthoringTypes, f as postgresLowerEntityHandles, l as postgresAuthoringModelAttributes, s as postgresAuthoringEntityTypes, u as postgresAuthoringPslBlockDescriptors } from "./authoring-Beq66XGy-D-GgvlBG.mjs";
5
5
  import { t as postgresRenderCheckExpressions } from "./check-expressions-DFTeR0rd-CSxSpyMV.mjs";
6
6
  import { t as postgresTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-UwYdV8fD-B_m_Ha8r.mjs";
7
7
  import { type } from "arktype";
8
8
  import { defineIndexTypes } from "@prisma/orm-family-sql/contract/index-types";
9
- //#region ../../../3-targets/3-targets/postgres/dist/descriptor-meta-C4i4pLQn.mjs
9
+ //#region ../../../3-targets/3-targets/postgres/dist/descriptor-meta-BhJOswpM.mjs
10
10
  const postgresIndexTypes = defineIndexTypes().add("btree", { options: type("object") }).add("hash", { options: type("object") }).add("gin", { options: type("object") }).add("gist", { options: type("object") }).add("spgist", { options: type("object") }).add("brin", { options: type("object") });
11
11
  const postgresTargetDescriptorMeta = {
12
12
  ...postgresTargetDescriptorMetaRuntime,
@@ -28,4 +28,4 @@ const postgresTargetDescriptorMeta = {
28
28
  //#endregion
29
29
  export { postgresTargetDescriptorMeta as t };
30
30
 
31
- //# sourceMappingURL=descriptor-meta-C4i4pLQn-CmdN74uG.mjs.map
31
+ //# sourceMappingURL=descriptor-meta-BhJOswpM-CqvnQMC0.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"descriptor-meta-C4i4pLQn-CmdN74uG.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/descriptor-meta-C4i4pLQn.mjs"],"sourcesContent":["import { E as postgresQualifyColumnType } from \"./codecs-7isLDrZp.mjs\";\nimport { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { a as postgresAuthoringTypes, i as postgresAuthoringPslBlockDescriptors, n as postgresAuthoringFieldPresets, o as postgresLowerEntityHandles, r as postgresAuthoringModelAttributes, t as postgresAuthoringEntityTypes } from \"./authoring-DgeWf8RC.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-PFL-fpel.mjs\";\nimport { t as postgresRenderCheckExpressions } from \"./check-expressions-DFTeR0rd.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\tsupportsNamespaces: true,\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\trenderCheckExpressions: postgresRenderCheckExpressions,\n\t\tlowerEntityHandles: postgresLowerEntityHandles\n\t}\n};\n//#endregion\nexport { postgresTargetDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-C4i4pLQn.mjs.map"],"mappings":";;;;;;;;;AASA,MAAM,qBAAqB,iBAAiB,CAAC,CAAC,IAAI,SAAS,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC;AACpS,MAAM,+BAA+B;CACpC,GAAG;CACH,oBAAoB;CACpB,oBAAoB;CACpB,YAAY;CACZ,WAAW;EACV,MAAM;EACN,OAAO;EACP,aAAa;EACb,qBAAqB;EACrB,iBAAiB;EACjB,iBAAiB;EACjB,mBAAmB;EACnB,wBAAwB;EACxB,oBAAoB;CACrB;AACD"}
1
+ {"version":3,"file":"descriptor-meta-BhJOswpM-CqvnQMC0.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/descriptor-meta-BhJOswpM.mjs"],"sourcesContent":["import { E as postgresQualifyColumnType } from \"./codecs-7isLDrZp.mjs\";\nimport { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { a as postgresAuthoringTypes, i as postgresAuthoringPslBlockDescriptors, n as postgresAuthoringFieldPresets, o as postgresLowerEntityHandles, r as postgresAuthoringModelAttributes, t as postgresAuthoringEntityTypes } from \"./authoring-Beq66XGy.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-PFL-fpel.mjs\";\nimport { t as postgresRenderCheckExpressions } from \"./check-expressions-DFTeR0rd.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\tsupportsNamespaces: true,\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\trenderCheckExpressions: postgresRenderCheckExpressions,\n\t\tlowerEntityHandles: postgresLowerEntityHandles\n\t}\n};\n//#endregion\nexport { postgresTargetDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-BhJOswpM.mjs.map"],"mappings":";;;;;;;;;AASA,MAAM,qBAAqB,iBAAiB,CAAC,CAAC,IAAI,SAAS,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC;AACpS,MAAM,+BAA+B;CACpC,GAAG;CACH,oBAAoB;CACpB,oBAAoB;CACpB,YAAY;CACZ,WAAW;EACV,MAAM;EACN,OAAO;EACP,aAAa;EACb,qBAAqB;EACrB,iBAAiB;EACjB,iBAAiB;EACjB,mBAAmB;EACnB,wBAAwB;EACxB,oBAAoB;CACrB;AACD"}
@@ -1,10 +1,10 @@
1
1
  import { s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
2
2
  import { d as isPostgresSchema } from "./postgres-schema-PFL-fpel-s3InB8T0.mjs";
3
- import { n as postgresResolveDefault } from "./default-normalizer-Ba5ZebHM-isV86rjy.mjs";
3
+ import { n as postgresResolveDefault } from "./default-normalizer-Bjtm2F4f-uV5vvkVt.mjs";
4
4
  import { a as postgresDiffSubjectGranularity, n as PostgresSchemaNodeKind, r as PostgresTableSchemaNode, t as PostgresNativeEnumSchemaNode } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
5
5
  import { i as PostgresRoleSchemaNode, n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
6
6
  import { t as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-DoVk6G3i-D6YoWjC9.mjs";
7
- import { d as resolvePostgresNodeIssueControlPolicySubject } from "./control-policy-BKgU_M65-BWedWA-f.mjs";
7
+ import { d as resolvePostgresNodeIssueControlPolicySubject } from "./control-policy-B8x7UxGf-BjTez7am.mjs";
8
8
  import { blindCast } from "@prisma/orm-framework/utils/casts";
9
9
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
10
10
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
@@ -13,7 +13,7 @@ import { diffSchemas, issueOutcome } from "@prisma/orm-framework/components/cont
13
13
  import { buildNativeTypeExpander, contractNamespaceToSchemaIR } from "@prisma/orm-family-sql/family/control";
14
14
  import { PrimaryKey, RelationalSchemaNodeKind, SqlForeignKeyIR, SqlIndexIR, SqlUniqueIR } from "@prisma/orm-family-sql/schema-ir/types";
15
15
  import { classifyDiffSubjectGranularity } from "@prisma/orm-family-sql/family/diff";
16
- //#region ../../../3-targets/3-targets/postgres/dist/diff-database-schema-BaSP2z4y.mjs
16
+ //#region ../../../3-targets/3-targets/postgres/dist/diff-database-schema-BFX0ZWWK.mjs
17
17
  /** The database root's fixed sentinel id (`PostgresDatabaseSchemaNode#id`). */
18
18
  function databaseStep() {
19
19
  return {
@@ -387,4 +387,4 @@ function buildPostgresPlanDiff(input) {
387
387
  //#endregion
388
388
  export { contractToPostgresDatabaseSchemaNode as n, diffPostgresSchema as r, buildPostgresPlanDiff as t };
389
389
 
390
- //# sourceMappingURL=diff-database-schema-BaSP2z4y-Ch42uw-j.mjs.map
390
+ //# sourceMappingURL=diff-database-schema-BFX0ZWWK-KVfAPOLF.mjs.map