@prisma-next/target-postgres 0.12.0-dev.4 → 0.12.0-dev.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{codec-ids-DliyCWPY.d.mts → codec-ids-Cx7C07Y_.d.mts} +3 -2
- package/dist/codec-ids-Cx7C07Y_.d.mts.map +1 -0
- package/dist/{codec-ids-C5qzBqus.mjs → codec-ids-DTqscwN9.mjs} +3 -2
- package/dist/codec-ids-DTqscwN9.mjs.map +1 -0
- package/dist/codec-ids.d.mts +2 -2
- package/dist/codec-ids.mjs +2 -2
- package/dist/{codec-types-BF1DXTPs.d.mts → codec-types-BoxMGJk-.d.mts} +2 -2
- package/dist/{codec-types-BF1DXTPs.d.mts.map → codec-types-BoxMGJk-.d.mts.map} +1 -1
- package/dist/codec-types.d.mts +1 -1
- package/dist/{codecs-DuP3d9Au.d.mts → codecs-DCSyTOCb.d.mts} +2 -2
- package/dist/codecs-DCSyTOCb.d.mts.map +1 -0
- package/dist/codecs.d.mts +1 -1
- package/dist/codecs.mjs +37 -2
- package/dist/codecs.mjs.map +1 -1
- package/dist/column-type-compatibility-Dzxz_CkP.mjs +11 -0
- package/dist/column-type-compatibility-Dzxz_CkP.mjs.map +1 -0
- package/dist/column-type-compatibility.d.mts +5 -0
- package/dist/column-type-compatibility.d.mts.map +1 -0
- package/dist/column-type-compatibility.mjs +2 -0
- package/dist/contract-free.d.mts +75 -0
- package/dist/contract-free.d.mts.map +1 -0
- package/dist/contract-free.mjs +139 -0
- package/dist/contract-free.mjs.map +1 -0
- package/dist/control.d.mts +1 -1
- package/dist/control.mjs +64 -36
- package/dist/control.mjs.map +1 -1
- package/dist/{data-transform-CAPmAdxS.d.mts → data-transform-5gLOgP68.d.mts} +2 -2
- package/dist/{data-transform-CAPmAdxS.d.mts.map → data-transform-5gLOgP68.d.mts.map} +1 -1
- package/dist/{data-transform-CRkv2T_U.mjs → data-transform-DIYwbe4S.mjs} +1 -1
- package/dist/{data-transform-CRkv2T_U.mjs.map → data-transform-DIYwbe4S.mjs.map} +1 -1
- package/dist/data-transform.d.mts +1 -1
- package/dist/data-transform.mjs +1 -1
- package/dist/ddl.d.mts +2 -0
- package/dist/ddl.mjs +2 -0
- package/dist/{default-normalizer-DaAhmzBV.mjs → default-normalizer-DFHtpCPH.mjs} +1 -1
- package/dist/{default-normalizer-DaAhmzBV.mjs.map → default-normalizer-DFHtpCPH.mjs.map} +1 -1
- package/dist/default-normalizer.mjs +1 -1
- package/dist/{descriptor-meta-Uu8QaClr.mjs → descriptor-meta-BqATo5Dz.mjs} +3 -2
- package/dist/descriptor-meta-BqATo5Dz.mjs.map +1 -0
- package/dist/{descriptor-meta-runtime-DMRX39kp.mjs → descriptor-meta-runtime-BBL7VdnR.mjs} +2 -2
- package/dist/{descriptor-meta-runtime-DMRX39kp.mjs.map → descriptor-meta-runtime-BBL7VdnR.mjs.map} +1 -1
- package/dist/{enum-planning-DRA9LaMU.mjs → enum-planning-Cb-NjaH6.mjs} +0 -0
- package/dist/{enum-planning-DRA9LaMU.mjs.map → enum-planning-Cb-NjaH6.mjs.map} +1 -1
- package/dist/enum-planning.d.mts +1 -1
- package/dist/enum-planning.mjs +1 -1
- package/dist/{errors-BbnITmAD.mjs → errors-De185dnO.mjs} +1 -1
- package/dist/{errors-BbnITmAD.mjs.map → errors-De185dnO.mjs.map} +1 -1
- package/dist/errors.mjs +1 -1
- package/dist/{issue-planner-BtaL6OfW.mjs → issue-planner-NzRtXfjR.mjs} +22 -23
- package/dist/issue-planner-NzRtXfjR.mjs.map +1 -0
- package/dist/issue-planner.d.mts +1 -1
- package/dist/issue-planner.d.mts.map +1 -1
- package/dist/issue-planner.mjs +1 -1
- package/dist/migration.d.mts +3 -3
- package/dist/migration.mjs +3 -3
- package/dist/{native-type-normalizer-BNEQ9VDs.mjs → native-type-normalizer-BUUe8USD.mjs} +1 -1
- package/dist/{native-type-normalizer-BNEQ9VDs.mjs.map → native-type-normalizer-BUUe8USD.mjs.map} +1 -1
- package/dist/native-type-normalizer.mjs +1 -1
- package/dist/nodes-DCC8-DhV.mjs +42 -0
- package/dist/nodes-DCC8-DhV.mjs.map +1 -0
- package/dist/nodes-DflxwrE8.d.mts +38 -0
- package/dist/nodes-DflxwrE8.d.mts.map +1 -0
- package/dist/{op-factory-call-CDlImOF_.d.mts → op-factory-call-B-HEOf41.d.mts} +3 -3
- package/dist/{op-factory-call-CDlImOF_.d.mts.map → op-factory-call-B-HEOf41.d.mts.map} +1 -1
- package/dist/{op-factory-call-ewOd5q6L.mjs → op-factory-call-ZqeS5JxZ.mjs} +2 -2
- package/dist/{op-factory-call-ewOd5q6L.mjs.map → op-factory-call-ZqeS5JxZ.mjs.map} +1 -1
- package/dist/op-factory-call.d.mts +1 -1
- package/dist/op-factory-call.mjs +1 -1
- package/dist/pack.d.mts +3 -2
- package/dist/pack.d.mts.map +1 -1
- package/dist/pack.mjs +1 -1
- package/dist/planner-BRGVWfq4.mjs +342 -0
- package/dist/planner-BRGVWfq4.mjs.map +1 -0
- package/dist/{planner-ddl-builders-BNMfSE9r.mjs → planner-ddl-builders-BfN5p8wr.mjs} +3 -3
- package/dist/{planner-ddl-builders-BNMfSE9r.mjs.map → planner-ddl-builders-BfN5p8wr.mjs.map} +1 -1
- package/dist/planner-ddl-builders.d.mts +1 -1
- package/dist/planner-ddl-builders.mjs +1 -1
- package/dist/{planner-identity-values-nhVj0hp-.mjs → planner-identity-values-DmwlJe_z.mjs} +1 -1
- package/dist/{planner-identity-values-nhVj0hp-.mjs.map → planner-identity-values-DmwlJe_z.mjs.map} +1 -1
- package/dist/planner-identity-values.mjs +1 -1
- package/dist/{planner-produced-postgres-migration-D02NOhVQ.d.mts → planner-produced-postgres-migration-Co71_VbU.d.mts} +3 -3
- package/dist/{planner-produced-postgres-migration-D02NOhVQ.d.mts.map → planner-produced-postgres-migration-Co71_VbU.d.mts.map} +1 -1
- package/dist/{planner-produced-postgres-migration-D_nsXbhl.mjs → planner-produced-postgres-migration-D6KXC2DH.mjs} +4 -4
- package/dist/{planner-produced-postgres-migration-D_nsXbhl.mjs.map → planner-produced-postgres-migration-D6KXC2DH.mjs.map} +1 -1
- package/dist/planner-produced-postgres-migration.d.mts +1 -1
- package/dist/planner-produced-postgres-migration.mjs +1 -1
- package/dist/{planner-schema-lookup-CGxxYfnD.mjs → planner-schema-lookup-Bm4S3LvB.mjs} +1 -1
- package/dist/{planner-schema-lookup-CGxxYfnD.mjs.map → planner-schema-lookup-Bm4S3LvB.mjs.map} +1 -1
- package/dist/planner-schema-lookup.mjs +1 -1
- package/dist/{planner-sql-checks-CfEiTXoQ.mjs → planner-sql-checks-C43dcyOd.mjs} +39 -12
- package/dist/planner-sql-checks-C43dcyOd.mjs.map +1 -0
- package/dist/planner-sql-checks.mjs +1 -1
- package/dist/{planner-target-details-a_wuOiYf.d.mts → planner-target-details-Dv5N6x6k.d.mts} +1 -1
- package/dist/{planner-target-details-a_wuOiYf.d.mts.map → planner-target-details-Dv5N6x6k.d.mts.map} +1 -1
- package/dist/planner-target-details.d.mts +1 -1
- package/dist/planner.d.mts +3 -2
- package/dist/planner.d.mts.map +1 -1
- package/dist/planner.mjs +1 -1
- package/dist/{postgres-contract-serializer-BnOboPWs.mjs → postgres-contract-serializer-K_3f7YlX.mjs} +33 -24
- package/dist/postgres-contract-serializer-K_3f7YlX.mjs.map +1 -0
- package/dist/{postgres-enum-type-CSzsvXrO.d.mts → postgres-enum-type-CWwVGBNK.d.mts} +1 -1
- package/dist/{postgres-enum-type-CSzsvXrO.d.mts.map → postgres-enum-type-CWwVGBNK.d.mts.map} +1 -1
- package/dist/{postgres-enum-type-BMgyxNyy.mjs → postgres-enum-type-CaGZ2mfI.mjs} +1 -1
- package/dist/{postgres-enum-type-BMgyxNyy.mjs.map → postgres-enum-type-CaGZ2mfI.mjs.map} +1 -1
- package/dist/{postgres-migration-DRY8V-bQ.d.mts → postgres-migration-BcKS2Lqq.d.mts} +3 -3
- package/dist/{postgres-migration-DRY8V-bQ.d.mts.map → postgres-migration-BcKS2Lqq.d.mts.map} +1 -1
- package/dist/{postgres-migration-BatbEvU6.mjs → postgres-migration-BnDg_Nj0.mjs} +3 -3
- package/dist/{postgres-migration-BatbEvU6.mjs.map → postgres-migration-BnDg_Nj0.mjs.map} +1 -1
- package/dist/{postgres-schema-BxAuNFX0.mjs → postgres-schema-BQG4laaB.mjs} +29 -14
- package/dist/postgres-schema-BQG4laaB.mjs.map +1 -0
- package/dist/{render-ops-XhICjX_P.mjs → render-ops-BpU-Qv06.mjs} +1 -1
- package/dist/{render-ops-XhICjX_P.mjs.map → render-ops-BpU-Qv06.mjs.map} +1 -1
- package/dist/render-ops.d.mts +1 -1
- package/dist/render-ops.mjs +1 -1
- package/dist/{render-typescript-K125n-RZ.mjs → render-typescript-D9O7aOS_.mjs} +1 -1
- package/dist/{render-typescript-K125n-RZ.mjs.map → render-typescript-D9O7aOS_.mjs.map} +1 -1
- package/dist/render-typescript.mjs +1 -1
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +2 -2
- package/dist/{shared-Do_a5ymU.d.mts → shared-CMqM-2BA.d.mts} +2 -2
- package/dist/{shared-Do_a5ymU.d.mts.map → shared-CMqM-2BA.d.mts.map} +1 -1
- package/dist/{sql-utils-CggjWNij.mjs → sql-utils-DR_F9aHR.mjs} +1 -1
- package/dist/{sql-utils-CggjWNij.mjs.map → sql-utils-DR_F9aHR.mjs.map} +1 -1
- package/dist/sql-utils.mjs +1 -1
- package/dist/{tables-DoA39Yqo.mjs → tables-DiNZG5Ln.mjs} +3 -3
- package/dist/{tables-DoA39Yqo.mjs.map → tables-DiNZG5Ln.mjs.map} +1 -1
- package/dist/{types-O40IcFV9.d.mts → types-kggVJs6C.d.mts} +1 -1
- package/dist/types-kggVJs6C.d.mts.map +1 -0
- package/dist/types.d.mts +16 -11
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +2 -2
- package/package.json +20 -18
- package/src/contract-free/columns.ts +49 -0
- package/src/contract-free/control-bootstrap.ts +55 -0
- package/src/contract-free/ddl.ts +32 -0
- package/src/core/ast/table-source.ts +23 -0
- package/src/core/codec-ids.ts +1 -0
- package/src/core/codecs.ts +44 -0
- package/src/core/column-type-compatibility.ts +13 -0
- package/src/core/ddl/nodes.ts +59 -0
- package/src/core/descriptor-meta.ts +1 -0
- package/src/core/migrations/control-policy.ts +234 -0
- package/src/core/migrations/issue-planner.ts +3 -3
- package/src/core/migrations/planner-sql-checks.ts +9 -9
- package/src/core/migrations/planner-strategies.ts +16 -10
- package/src/core/migrations/planner.ts +57 -6
- package/src/core/migrations/runner.ts +78 -45
- package/src/core/postgres-contract-serializer.ts +52 -46
- package/src/core/postgres-schema.ts +43 -25
- package/src/exports/column-type-compatibility.ts +1 -0
- package/src/exports/contract-free.ts +7 -0
- package/src/exports/ddl.ts +7 -0
- package/dist/codec-ids-C5qzBqus.mjs.map +0 -1
- package/dist/codec-ids-DliyCWPY.d.mts.map +0 -1
- package/dist/codecs-DuP3d9Au.d.mts.map +0 -1
- package/dist/descriptor-meta-Uu8QaClr.mjs.map +0 -1
- package/dist/issue-planner-BtaL6OfW.mjs.map +0 -1
- package/dist/planner-Bjz5pnLa.mjs +0 -177
- package/dist/planner-Bjz5pnLa.mjs.map +0 -1
- package/dist/planner-sql-checks-CfEiTXoQ.mjs.map +0 -1
- package/dist/postgres-contract-serializer-BnOboPWs.mjs.map +0 -1
- package/dist/postgres-schema-BxAuNFX0.mjs.map +0 -1
- package/dist/statement-builders-DVI5IVAa.mjs +0 -131
- package/dist/statement-builders-DVI5IVAa.mjs.map +0 -1
- package/dist/statement-builders.d.mts +0 -51
- package/dist/statement-builders.d.mts.map +0 -1
- package/dist/statement-builders.mjs +0 -2
- package/dist/types-O40IcFV9.d.mts.map +0 -1
- package/src/core/migrations/statement-builders.ts +0 -183
- package/src/exports/statement-builders.ts +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"op-factory-call-ewOd5q6L.mjs","names":[],"sources":["../src/core/migrations/op-factory-call.ts"],"sourcesContent":["/**\n * Postgres migration IR: one concrete `*Call` class per pure factory under\n * `operations/`, plus a shared `PostgresOpFactoryCallNode` abstract base.\n *\n * Every call class carries the literal arguments its backing factory would\n * receive, computes a human-readable `label` in its constructor, and\n * implements two polymorphic hooks:\n *\n * - `toOp()` — converts the IR node to a runtime\n * `SqlMigrationPlanOperation` by delegating to the matching pure factory\n * under `operations/`. `DataTransformCall.toOp()` always throws\n * `PN-MIG-2001` because a planner-generated data transform is an\n * unfilled authoring stub by construction.\n * - `renderTypeScript()` / `importRequirements()` — inherited from\n * `TsExpression`. Used by `renderCallsToTypeScript` to emit the call as\n * a TypeScript expression inside the scaffolded `migration.ts`.\n *\n * The abstract base and all concrete classes are package-private. External\n * consumers see only the framework-level `OpFactoryCall` interface and the\n * `PostgresOpFactoryCall` union.\n */\n\nimport { errorUnfilledPlaceholder } from '@prisma-next/errors/migration';\nimport type { SqlMigrationPlanOperation } from '@prisma-next/family-sql/control';\nimport type {\n OpFactoryCall as FrameworkOpFactoryCall,\n MigrationOperationClass,\n} from '@prisma-next/framework-components/control';\nimport { type ImportRequirement, jsonToTsSource, TsExpression } from '@prisma-next/ts-render';\nimport {\n addColumn,\n alterColumnType,\n dropColumn,\n dropDefault,\n dropNotNull,\n setDefault,\n setNotNull,\n} from './operations/columns';\nimport { addForeignKey, addPrimaryKey, addUnique, dropConstraint } from './operations/constraints';\nimport { createExtension, createSchema } from './operations/dependencies';\nimport { addEnumValues, createEnumType, dropEnumType, renameType } from './operations/enums';\nimport { createIndex, dropIndex } from './operations/indexes';\nimport type { ColumnSpec, ForeignKeySpec } from './operations/shared';\nimport { createTable, dropTable } from './operations/tables';\nimport type { PostgresPlanTargetDetails } from './planner-target-details';\n\ntype Op = SqlMigrationPlanOperation<PostgresPlanTargetDetails>;\n\nconst TARGET_MIGRATION_MODULE = '@prisma-next/postgres/migration';\n\nabstract class PostgresOpFactoryCallNode extends TsExpression implements FrameworkOpFactoryCall {\n abstract readonly factoryName: string;\n abstract readonly operationClass: MigrationOperationClass;\n abstract readonly label: string;\n abstract toOp(): Op;\n\n importRequirements(): readonly ImportRequirement[] {\n return [{ moduleSpecifier: TARGET_MIGRATION_MODULE, symbol: this.factoryName }];\n }\n\n protected freeze(): void {\n Object.freeze(this);\n }\n}\n\n// ============================================================================\n// Table\n// ============================================================================\n\nexport interface CreateTablePrimaryKey {\n readonly columns: readonly string[];\n}\n\nexport class CreateTableCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'createTable' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly columns: readonly ColumnSpec[];\n readonly primaryKey: CreateTablePrimaryKey | undefined;\n readonly label: string;\n\n constructor(\n schemaName: string,\n tableName: string,\n columns: readonly ColumnSpec[],\n primaryKey?: CreateTablePrimaryKey,\n ) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.columns = columns;\n this.primaryKey = primaryKey;\n this.label = `Create table \"${tableName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return createTable(this.schemaName, this.tableName, this.columns, this.primaryKey);\n }\n\n renderTypeScript(): string {\n const args = [\n jsonToTsSource(this.schemaName),\n jsonToTsSource(this.tableName),\n jsonToTsSource(this.columns),\n ];\n if (this.primaryKey) args.push(jsonToTsSource(this.primaryKey));\n return `createTable(${args.join(', ')})`;\n }\n}\n\nexport class DropTableCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'dropTable' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly label: string;\n\n constructor(schemaName: string, tableName: string) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.label = `Drop table \"${tableName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropTable(this.schemaName, this.tableName);\n }\n\n renderTypeScript(): string {\n return `dropTable(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)})`;\n }\n}\n\n// ============================================================================\n// Column\n// ============================================================================\n\nexport class AddColumnCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'addColumn' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly column: ColumnSpec;\n readonly label: string;\n\n constructor(schemaName: string, tableName: string, column: ColumnSpec) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.column = column;\n this.label = `Add column \"${column.name}\" to \"${tableName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return addColumn(this.schemaName, this.tableName, this.column);\n }\n\n renderTypeScript(): string {\n return `addColumn(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.column)})`;\n }\n}\n\nexport class DropColumnCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'dropColumn' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly columnName: string;\n readonly label: string;\n\n constructor(schemaName: string, tableName: string, columnName: string) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.columnName = columnName;\n this.label = `Drop column \"${columnName}\" from \"${tableName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropColumn(this.schemaName, this.tableName, this.columnName);\n }\n\n renderTypeScript(): string {\n return `dropColumn(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.columnName)})`;\n }\n}\n\nexport interface AlterColumnTypeOptions {\n readonly qualifiedTargetType: string;\n readonly formatTypeExpected: string;\n readonly rawTargetTypeForLabel: string;\n readonly using?: string;\n}\n\nexport class AlterColumnTypeCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'alterColumnType' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly columnName: string;\n readonly options: AlterColumnTypeOptions;\n readonly label: string;\n\n constructor(\n schemaName: string,\n tableName: string,\n columnName: string,\n options: AlterColumnTypeOptions,\n ) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.columnName = columnName;\n this.options = options;\n this.label = `Alter type of \"${tableName}\".\"${columnName}\" to ${options.rawTargetTypeForLabel}`;\n this.freeze();\n }\n\n toOp(): Op {\n return alterColumnType(this.schemaName, this.tableName, this.columnName, this.options);\n }\n\n renderTypeScript(): string {\n return `alterColumnType(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.columnName)}, ${jsonToTsSource(this.options)})`;\n }\n}\n\nexport class SetNotNullCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'setNotNull' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly columnName: string;\n readonly label: string;\n\n constructor(schemaName: string, tableName: string, columnName: string) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.columnName = columnName;\n this.label = `Set NOT NULL on \"${tableName}\".\"${columnName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return setNotNull(this.schemaName, this.tableName, this.columnName);\n }\n\n renderTypeScript(): string {\n return `setNotNull(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.columnName)})`;\n }\n}\n\nexport class DropNotNullCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'dropNotNull' as const;\n readonly operationClass = 'widening' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly columnName: string;\n readonly label: string;\n\n constructor(schemaName: string, tableName: string, columnName: string) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.columnName = columnName;\n this.label = `Drop NOT NULL on \"${tableName}\".\"${columnName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropNotNull(this.schemaName, this.tableName, this.columnName);\n }\n\n renderTypeScript(): string {\n return `dropNotNull(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.columnName)})`;\n }\n}\n\nexport class SetDefaultCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'setDefault' as const;\n readonly operationClass: 'additive' | 'widening';\n readonly schemaName: string;\n readonly tableName: string;\n readonly columnName: string;\n readonly defaultSql: string;\n readonly label: string;\n\n constructor(\n schemaName: string,\n tableName: string,\n columnName: string,\n defaultSql: string,\n operationClass: 'additive' | 'widening' = 'additive',\n ) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.columnName = columnName;\n this.defaultSql = defaultSql;\n this.operationClass = operationClass;\n this.label = `Set default on \"${tableName}\".\"${columnName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return setDefault(\n this.schemaName,\n this.tableName,\n this.columnName,\n this.defaultSql,\n this.operationClass,\n );\n }\n\n renderTypeScript(): string {\n const args = [\n jsonToTsSource(this.schemaName),\n jsonToTsSource(this.tableName),\n jsonToTsSource(this.columnName),\n jsonToTsSource(this.defaultSql),\n ];\n if (this.operationClass !== 'additive') {\n args.push(jsonToTsSource(this.operationClass));\n }\n return `setDefault(${args.join(', ')})`;\n }\n}\n\nexport class DropDefaultCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'dropDefault' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly columnName: string;\n readonly label: string;\n\n constructor(schemaName: string, tableName: string, columnName: string) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.columnName = columnName;\n this.label = `Drop default on \"${tableName}\".\"${columnName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropDefault(this.schemaName, this.tableName, this.columnName);\n }\n\n renderTypeScript(): string {\n return `dropDefault(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.columnName)})`;\n }\n}\n\n// ============================================================================\n// Constraints\n// ============================================================================\n\nexport class AddPrimaryKeyCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'addPrimaryKey' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly constraintName: string;\n readonly columns: readonly string[];\n readonly label: string;\n\n constructor(\n schemaName: string,\n tableName: string,\n constraintName: string,\n columns: readonly string[],\n ) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.constraintName = constraintName;\n this.columns = columns;\n this.label = `Add primary key on \"${tableName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return addPrimaryKey(this.schemaName, this.tableName, this.constraintName, this.columns);\n }\n\n renderTypeScript(): string {\n return `addPrimaryKey(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.constraintName)}, ${jsonToTsSource(this.columns)})`;\n }\n}\n\nexport class AddUniqueCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'addUnique' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly constraintName: string;\n readonly columns: readonly string[];\n readonly label: string;\n\n constructor(\n schemaName: string,\n tableName: string,\n constraintName: string,\n columns: readonly string[],\n ) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.constraintName = constraintName;\n this.columns = columns;\n this.label = `Add unique constraint on \"${tableName}\" (${columns.join(', ')})`;\n this.freeze();\n }\n\n toOp(): Op {\n return addUnique(this.schemaName, this.tableName, this.constraintName, this.columns);\n }\n\n renderTypeScript(): string {\n return `addUnique(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.constraintName)}, ${jsonToTsSource(this.columns)})`;\n }\n}\n\nexport class AddForeignKeyCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'addForeignKey' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly fk: ForeignKeySpec;\n readonly label: string;\n\n constructor(schemaName: string, tableName: string, fk: ForeignKeySpec) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.fk = fk;\n this.label = `Add foreign key \"${fk.name}\" on \"${tableName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return addForeignKey(this.schemaName, this.tableName, this.fk);\n }\n\n renderTypeScript(): string {\n return `addForeignKey(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.fk)})`;\n }\n}\n\nexport class DropConstraintCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'dropConstraint' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly constraintName: string;\n readonly kind: 'foreignKey' | 'unique' | 'primaryKey';\n readonly label: string;\n\n constructor(\n schemaName: string,\n tableName: string,\n constraintName: string,\n kind: 'foreignKey' | 'unique' | 'primaryKey' = 'unique',\n ) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.constraintName = constraintName;\n this.kind = kind;\n this.label = `Drop constraint \"${constraintName}\" on \"${tableName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropConstraint(this.schemaName, this.tableName, this.constraintName, this.kind);\n }\n\n renderTypeScript(): string {\n const args = [\n jsonToTsSource(this.schemaName),\n jsonToTsSource(this.tableName),\n jsonToTsSource(this.constraintName),\n ];\n if (this.kind !== 'unique') {\n args.push(jsonToTsSource(this.kind));\n }\n return `dropConstraint(${args.join(', ')})`;\n }\n}\n\n// ============================================================================\n// Indexes\n// ============================================================================\n\nexport class CreateIndexCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'createIndex' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly indexName: string;\n readonly columns: readonly string[];\n // Named indexType (not typeName) to avoid collision with CreateEnumTypeCall.typeName,\n // which identifies a CREATE TYPE target and is read by `locationForCall` in issue-planner.ts.\n readonly indexType: string | undefined;\n readonly options: Record<string, unknown> | undefined;\n readonly label: string;\n\n constructor(\n schemaName: string,\n tableName: string,\n indexName: string,\n columns: readonly string[],\n extras?: { readonly type?: string; readonly options?: Record<string, unknown> },\n ) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.indexName = indexName;\n this.columns = columns;\n this.indexType = extras?.type;\n this.options = extras?.options;\n this.label = `Create index \"${indexName}\" on \"${tableName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n const extras: { type?: string; options?: Record<string, unknown> } = {};\n if (this.indexType !== undefined) extras.type = this.indexType;\n if (this.options !== undefined) extras.options = this.options;\n return createIndex(this.schemaName, this.tableName, this.indexName, this.columns, extras);\n }\n\n renderTypeScript(): string {\n const args = [\n jsonToTsSource(this.schemaName),\n jsonToTsSource(this.tableName),\n jsonToTsSource(this.indexName),\n jsonToTsSource(this.columns),\n ];\n if (this.indexType !== undefined || this.options !== undefined) {\n const extrasParts: string[] = [];\n if (this.indexType !== undefined) extrasParts.push(`type: ${jsonToTsSource(this.indexType)}`);\n if (this.options !== undefined) extrasParts.push(`options: ${jsonToTsSource(this.options)}`);\n args.push(`{ ${extrasParts.join(', ')} }`);\n }\n return `createIndex(${args.join(', ')})`;\n }\n}\n\nexport class DropIndexCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'dropIndex' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly indexName: string;\n readonly label: string;\n\n constructor(schemaName: string, tableName: string, indexName: string) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.indexName = indexName;\n this.label = `Drop index \"${indexName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropIndex(this.schemaName, this.tableName, this.indexName);\n }\n\n renderTypeScript(): string {\n return `dropIndex(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.indexName)})`;\n }\n}\n\n// ============================================================================\n// Enum types\n// ============================================================================\n\nexport class CreateEnumTypeCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'createEnumType' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly typeName: string;\n readonly nativeType: string;\n readonly values: readonly string[];\n readonly label: string;\n\n constructor(\n schemaName: string,\n typeName: string,\n values: readonly string[],\n nativeType: string = typeName,\n ) {\n super();\n this.schemaName = schemaName;\n this.typeName = typeName;\n this.nativeType = nativeType;\n this.values = values;\n this.label = `Create enum type \"${typeName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return createEnumType(this.schemaName, this.typeName, this.values, this.nativeType);\n }\n\n renderTypeScript(): string {\n const nativeArg =\n this.nativeType === this.typeName ? '' : `, ${jsonToTsSource(this.nativeType)}`;\n return `createEnumType(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.typeName)}, ${jsonToTsSource(this.values)}${nativeArg})`;\n }\n}\n\nexport class AddEnumValuesCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'addEnumValues' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly typeName: string;\n readonly nativeType: string;\n readonly values: readonly string[];\n readonly label: string;\n\n constructor(schemaName: string, typeName: string, nativeType: string, values: readonly string[]) {\n super();\n this.schemaName = schemaName;\n this.typeName = typeName;\n this.nativeType = nativeType;\n this.values = values;\n this.label = `Add values to enum type \"${typeName}\": ${values.join(', ')}`;\n this.freeze();\n }\n\n toOp(): Op {\n return addEnumValues(this.schemaName, this.typeName, this.nativeType, this.values);\n }\n\n renderTypeScript(): string {\n return `addEnumValues(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.typeName)}, ${jsonToTsSource(this.nativeType)}, ${jsonToTsSource(this.values)})`;\n }\n}\n\nexport class DropEnumTypeCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'dropEnumType' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly typeName: string;\n readonly label: string;\n\n constructor(schemaName: string, typeName: string) {\n super();\n this.schemaName = schemaName;\n this.typeName = typeName;\n this.label = `Drop enum type \"${typeName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropEnumType(this.schemaName, this.typeName);\n }\n\n renderTypeScript(): string {\n return `dropEnumType(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.typeName)})`;\n }\n}\n\nexport class RenameTypeCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'renameType' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly fromName: string;\n readonly toName: string;\n readonly label: string;\n\n constructor(schemaName: string, fromName: string, toName: string) {\n super();\n this.schemaName = schemaName;\n this.fromName = fromName;\n this.toName = toName;\n this.label = `Rename type \"${fromName}\" to \"${toName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return renameType(this.schemaName, this.fromName, this.toName);\n }\n\n renderTypeScript(): string {\n return `renameType(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.fromName)}, ${jsonToTsSource(this.toName)})`;\n }\n}\n\n// ============================================================================\n// Raw SQL\n// ============================================================================\n\n/**\n * Laundered pre-built operation.\n *\n * Wraps an already-materialized `SqlMigrationPlanOperation` — typically one\n * produced by a SQL-family method or a codec control hook — so the planner\n * can carry it alongside IR nodes without reverse-engineering it into a\n * structured call class. Doubles as the user-facing escape hatch for raw\n * migrations: authors can pass a full op shape to `rawSql({...})`.\n *\n * `toOp()` returns the stored op unchanged. `renderTypeScript()` emits\n * `rawSql({...})` with the op serialized as a JSON literal — round-tripping\n * requires every field on the op to be JSON-serializable (no closures).\n */\nexport class RawSqlCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'rawSql' as const;\n readonly operationClass: MigrationOperationClass;\n readonly label: string;\n readonly op: Op;\n\n constructor(op: Op) {\n super();\n this.op = op;\n this.label = op.label;\n this.operationClass = op.operationClass;\n this.freeze();\n }\n\n toOp(): Op {\n return this.op;\n }\n\n renderTypeScript(): string {\n return `rawSql(${jsonToTsSource(this.op)})`;\n }\n}\n\n// ============================================================================\n// Database dependencies (structured DDL)\n// ============================================================================\n\nexport class CreateExtensionCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'createExtension' as const;\n readonly operationClass = 'additive' as const;\n readonly extensionName: string;\n readonly label: string;\n\n constructor(extensionName: string) {\n super();\n this.extensionName = extensionName;\n this.label = `Create extension \"${extensionName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return createExtension(this.extensionName);\n }\n\n renderTypeScript(): string {\n return `createExtension(${jsonToTsSource(this.extensionName)})`;\n }\n}\n\nexport class CreateSchemaCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'createSchema' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly label: string;\n\n constructor(schemaName: string) {\n super();\n this.schemaName = schemaName;\n this.label = `Create schema \"${schemaName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return createSchema(this.schemaName);\n }\n\n renderTypeScript(): string {\n return `createSchema(${jsonToTsSource(this.schemaName)})`;\n }\n}\n\n// ============================================================================\n// Data transform\n// ============================================================================\n\n/**\n * A planner-generated data-transform stub. `checkSlot` and `runSlot` name\n * the unfilled authoring slots that the rendered `migration.ts` will expose\n * to the user via `placeholder(\"…\")` calls. `toOp()` always throws\n * `PN-MIG-2001`: the planner cannot lower a stubbed transform to a runtime\n * op — the user must fill the rendered `migration.ts` and re-emit.\n */\nexport class DataTransformCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'dataTransform' as const;\n readonly operationClass: MigrationOperationClass;\n readonly label: string;\n readonly checkSlot: string;\n readonly runSlot: string;\n\n constructor(\n label: string,\n checkSlot: string,\n runSlot: string,\n operationClass: MigrationOperationClass = 'data',\n ) {\n super();\n this.label = label;\n this.checkSlot = checkSlot;\n this.runSlot = runSlot;\n this.operationClass = operationClass;\n this.freeze();\n }\n\n toOp(): Op {\n throw errorUnfilledPlaceholder(this.label);\n }\n\n renderTypeScript(): string {\n return [\n `this.dataTransform(endContract, ${jsonToTsSource(this.label)}, {`,\n ` check: () => placeholder(${jsonToTsSource(this.checkSlot)}),`,\n ` run: () => placeholder(${jsonToTsSource(this.runSlot)}),`,\n '})',\n ].join('\\n');\n }\n\n override importRequirements(): readonly ImportRequirement[] {\n return [\n { moduleSpecifier: TARGET_MIGRATION_MODULE, symbol: 'placeholder' },\n {\n moduleSpecifier: './end-contract.json',\n symbol: 'endContract',\n kind: 'default',\n attributes: { type: 'json' },\n },\n ];\n }\n}\n\nexport type PostgresOpFactoryCall =\n | CreateTableCall\n | DropTableCall\n | AddColumnCall\n | DropColumnCall\n | AlterColumnTypeCall\n | SetNotNullCall\n | DropNotNullCall\n | SetDefaultCall\n | DropDefaultCall\n | AddPrimaryKeyCall\n | AddForeignKeyCall\n | AddUniqueCall\n | CreateIndexCall\n | DropIndexCall\n | DropConstraintCall\n | CreateEnumTypeCall\n | AddEnumValuesCall\n | DropEnumTypeCall\n | RenameTypeCall\n | RawSqlCall\n | CreateExtensionCall\n | CreateSchemaCall\n | DataTransformCall;\n\n/**\n * Stable identity key for reconciliation-level dedup.\n *\n * Two calls whose runtime ops would share the same `id` return the same\n * key, so a `Set<string>` can collapse them before they're emitted. The\n * current implementation delegates to `toOp().id`, which is the\n * authoritative identity; isolating dedup behind this helper lets a future\n * pass replace it with an allocation-free computation directly from the\n * call's fields without touching call sites.\n *\n * `DataTransformCall` intentionally has no sensible identity today — it\n * throws `PN-MIG-2001` on `toOp()`. Reconciliation never produces one; the\n * helper is unspecified for that variant and only meant for\n * reconciliation-emitted calls.\n */\nexport function identityKeyFor(call: PostgresOpFactoryCall): string {\n return call.toOp().id;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAM,0BAA0B;AAEhC,IAAe,4BAAf,cAAiD,aAA+C;CAM9F,qBAAmD;EACjD,OAAO,CAAC;GAAE,iBAAiB;GAAyB,QAAQ,KAAK;EAAY,CAAC;CAChF;CAEA,SAAyB;EACvB,OAAO,OAAO,IAAI;CACpB;AACF;AAUA,IAAa,kBAAb,cAAqC,0BAA0B;CAC7D,cAAuB;CACvB,iBAA0B;CAC1B;CACA;CACA;CACA;CACA;CAEA,YACE,YACA,WACA,SACA,YACA;EACA,MAAM;EACN,KAAK,aAAa;EAClB,KAAK,YAAY;EACjB,KAAK,UAAU;EACf,KAAK,aAAa;EAClB,KAAK,QAAQ,iBAAiB,UAAU;EACxC,KAAK,OAAO;CACd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AiB;GACjB,QAAQ;GACR,MAAM;GACN,YAAY,EAAE,MAAM,OAAO;EAC7B,CACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"op-factory-call-ZqeS5JxZ.mjs","names":[],"sources":["../src/core/migrations/op-factory-call.ts"],"sourcesContent":["/**\n * Postgres migration IR: one concrete `*Call` class per pure factory under\n * `operations/`, plus a shared `PostgresOpFactoryCallNode` abstract base.\n *\n * Every call class carries the literal arguments its backing factory would\n * receive, computes a human-readable `label` in its constructor, and\n * implements two polymorphic hooks:\n *\n * - `toOp()` — converts the IR node to a runtime\n * `SqlMigrationPlanOperation` by delegating to the matching pure factory\n * under `operations/`. `DataTransformCall.toOp()` always throws\n * `PN-MIG-2001` because a planner-generated data transform is an\n * unfilled authoring stub by construction.\n * - `renderTypeScript()` / `importRequirements()` — inherited from\n * `TsExpression`. Used by `renderCallsToTypeScript` to emit the call as\n * a TypeScript expression inside the scaffolded `migration.ts`.\n *\n * The abstract base and all concrete classes are package-private. External\n * consumers see only the framework-level `OpFactoryCall` interface and the\n * `PostgresOpFactoryCall` union.\n */\n\nimport { errorUnfilledPlaceholder } from '@prisma-next/errors/migration';\nimport type { SqlMigrationPlanOperation } from '@prisma-next/family-sql/control';\nimport type {\n OpFactoryCall as FrameworkOpFactoryCall,\n MigrationOperationClass,\n} from '@prisma-next/framework-components/control';\nimport { type ImportRequirement, jsonToTsSource, TsExpression } from '@prisma-next/ts-render';\nimport {\n addColumn,\n alterColumnType,\n dropColumn,\n dropDefault,\n dropNotNull,\n setDefault,\n setNotNull,\n} from './operations/columns';\nimport { addForeignKey, addPrimaryKey, addUnique, dropConstraint } from './operations/constraints';\nimport { createExtension, createSchema } from './operations/dependencies';\nimport { addEnumValues, createEnumType, dropEnumType, renameType } from './operations/enums';\nimport { createIndex, dropIndex } from './operations/indexes';\nimport type { ColumnSpec, ForeignKeySpec } from './operations/shared';\nimport { createTable, dropTable } from './operations/tables';\nimport type { PostgresPlanTargetDetails } from './planner-target-details';\n\ntype Op = SqlMigrationPlanOperation<PostgresPlanTargetDetails>;\n\nconst TARGET_MIGRATION_MODULE = '@prisma-next/postgres/migration';\n\nabstract class PostgresOpFactoryCallNode extends TsExpression implements FrameworkOpFactoryCall {\n abstract readonly factoryName: string;\n abstract readonly operationClass: MigrationOperationClass;\n abstract readonly label: string;\n abstract toOp(): Op;\n\n importRequirements(): readonly ImportRequirement[] {\n return [{ moduleSpecifier: TARGET_MIGRATION_MODULE, symbol: this.factoryName }];\n }\n\n protected freeze(): void {\n Object.freeze(this);\n }\n}\n\n// ============================================================================\n// Table\n// ============================================================================\n\nexport interface CreateTablePrimaryKey {\n readonly columns: readonly string[];\n}\n\nexport class CreateTableCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'createTable' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly columns: readonly ColumnSpec[];\n readonly primaryKey: CreateTablePrimaryKey | undefined;\n readonly label: string;\n\n constructor(\n schemaName: string,\n tableName: string,\n columns: readonly ColumnSpec[],\n primaryKey?: CreateTablePrimaryKey,\n ) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.columns = columns;\n this.primaryKey = primaryKey;\n this.label = `Create table \"${tableName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return createTable(this.schemaName, this.tableName, this.columns, this.primaryKey);\n }\n\n renderTypeScript(): string {\n const args = [\n jsonToTsSource(this.schemaName),\n jsonToTsSource(this.tableName),\n jsonToTsSource(this.columns),\n ];\n if (this.primaryKey) args.push(jsonToTsSource(this.primaryKey));\n return `createTable(${args.join(', ')})`;\n }\n}\n\nexport class DropTableCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'dropTable' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly label: string;\n\n constructor(schemaName: string, tableName: string) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.label = `Drop table \"${tableName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropTable(this.schemaName, this.tableName);\n }\n\n renderTypeScript(): string {\n return `dropTable(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)})`;\n }\n}\n\n// ============================================================================\n// Column\n// ============================================================================\n\nexport class AddColumnCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'addColumn' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly column: ColumnSpec;\n readonly label: string;\n\n constructor(schemaName: string, tableName: string, column: ColumnSpec) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.column = column;\n this.label = `Add column \"${column.name}\" to \"${tableName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return addColumn(this.schemaName, this.tableName, this.column);\n }\n\n renderTypeScript(): string {\n return `addColumn(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.column)})`;\n }\n}\n\nexport class DropColumnCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'dropColumn' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly columnName: string;\n readonly label: string;\n\n constructor(schemaName: string, tableName: string, columnName: string) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.columnName = columnName;\n this.label = `Drop column \"${columnName}\" from \"${tableName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropColumn(this.schemaName, this.tableName, this.columnName);\n }\n\n renderTypeScript(): string {\n return `dropColumn(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.columnName)})`;\n }\n}\n\nexport interface AlterColumnTypeOptions {\n readonly qualifiedTargetType: string;\n readonly formatTypeExpected: string;\n readonly rawTargetTypeForLabel: string;\n readonly using?: string;\n}\n\nexport class AlterColumnTypeCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'alterColumnType' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly columnName: string;\n readonly options: AlterColumnTypeOptions;\n readonly label: string;\n\n constructor(\n schemaName: string,\n tableName: string,\n columnName: string,\n options: AlterColumnTypeOptions,\n ) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.columnName = columnName;\n this.options = options;\n this.label = `Alter type of \"${tableName}\".\"${columnName}\" to ${options.rawTargetTypeForLabel}`;\n this.freeze();\n }\n\n toOp(): Op {\n return alterColumnType(this.schemaName, this.tableName, this.columnName, this.options);\n }\n\n renderTypeScript(): string {\n return `alterColumnType(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.columnName)}, ${jsonToTsSource(this.options)})`;\n }\n}\n\nexport class SetNotNullCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'setNotNull' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly columnName: string;\n readonly label: string;\n\n constructor(schemaName: string, tableName: string, columnName: string) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.columnName = columnName;\n this.label = `Set NOT NULL on \"${tableName}\".\"${columnName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return setNotNull(this.schemaName, this.tableName, this.columnName);\n }\n\n renderTypeScript(): string {\n return `setNotNull(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.columnName)})`;\n }\n}\n\nexport class DropNotNullCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'dropNotNull' as const;\n readonly operationClass = 'widening' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly columnName: string;\n readonly label: string;\n\n constructor(schemaName: string, tableName: string, columnName: string) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.columnName = columnName;\n this.label = `Drop NOT NULL on \"${tableName}\".\"${columnName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropNotNull(this.schemaName, this.tableName, this.columnName);\n }\n\n renderTypeScript(): string {\n return `dropNotNull(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.columnName)})`;\n }\n}\n\nexport class SetDefaultCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'setDefault' as const;\n readonly operationClass: 'additive' | 'widening';\n readonly schemaName: string;\n readonly tableName: string;\n readonly columnName: string;\n readonly defaultSql: string;\n readonly label: string;\n\n constructor(\n schemaName: string,\n tableName: string,\n columnName: string,\n defaultSql: string,\n operationClass: 'additive' | 'widening' = 'additive',\n ) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.columnName = columnName;\n this.defaultSql = defaultSql;\n this.operationClass = operationClass;\n this.label = `Set default on \"${tableName}\".\"${columnName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return setDefault(\n this.schemaName,\n this.tableName,\n this.columnName,\n this.defaultSql,\n this.operationClass,\n );\n }\n\n renderTypeScript(): string {\n const args = [\n jsonToTsSource(this.schemaName),\n jsonToTsSource(this.tableName),\n jsonToTsSource(this.columnName),\n jsonToTsSource(this.defaultSql),\n ];\n if (this.operationClass !== 'additive') {\n args.push(jsonToTsSource(this.operationClass));\n }\n return `setDefault(${args.join(', ')})`;\n }\n}\n\nexport class DropDefaultCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'dropDefault' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly columnName: string;\n readonly label: string;\n\n constructor(schemaName: string, tableName: string, columnName: string) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.columnName = columnName;\n this.label = `Drop default on \"${tableName}\".\"${columnName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropDefault(this.schemaName, this.tableName, this.columnName);\n }\n\n renderTypeScript(): string {\n return `dropDefault(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.columnName)})`;\n }\n}\n\n// ============================================================================\n// Constraints\n// ============================================================================\n\nexport class AddPrimaryKeyCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'addPrimaryKey' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly constraintName: string;\n readonly columns: readonly string[];\n readonly label: string;\n\n constructor(\n schemaName: string,\n tableName: string,\n constraintName: string,\n columns: readonly string[],\n ) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.constraintName = constraintName;\n this.columns = columns;\n this.label = `Add primary key on \"${tableName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return addPrimaryKey(this.schemaName, this.tableName, this.constraintName, this.columns);\n }\n\n renderTypeScript(): string {\n return `addPrimaryKey(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.constraintName)}, ${jsonToTsSource(this.columns)})`;\n }\n}\n\nexport class AddUniqueCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'addUnique' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly constraintName: string;\n readonly columns: readonly string[];\n readonly label: string;\n\n constructor(\n schemaName: string,\n tableName: string,\n constraintName: string,\n columns: readonly string[],\n ) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.constraintName = constraintName;\n this.columns = columns;\n this.label = `Add unique constraint on \"${tableName}\" (${columns.join(', ')})`;\n this.freeze();\n }\n\n toOp(): Op {\n return addUnique(this.schemaName, this.tableName, this.constraintName, this.columns);\n }\n\n renderTypeScript(): string {\n return `addUnique(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.constraintName)}, ${jsonToTsSource(this.columns)})`;\n }\n}\n\nexport class AddForeignKeyCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'addForeignKey' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly fk: ForeignKeySpec;\n readonly label: string;\n\n constructor(schemaName: string, tableName: string, fk: ForeignKeySpec) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.fk = fk;\n this.label = `Add foreign key \"${fk.name}\" on \"${tableName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return addForeignKey(this.schemaName, this.tableName, this.fk);\n }\n\n renderTypeScript(): string {\n return `addForeignKey(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.fk)})`;\n }\n}\n\nexport class DropConstraintCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'dropConstraint' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly constraintName: string;\n readonly kind: 'foreignKey' | 'unique' | 'primaryKey';\n readonly label: string;\n\n constructor(\n schemaName: string,\n tableName: string,\n constraintName: string,\n kind: 'foreignKey' | 'unique' | 'primaryKey' = 'unique',\n ) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.constraintName = constraintName;\n this.kind = kind;\n this.label = `Drop constraint \"${constraintName}\" on \"${tableName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropConstraint(this.schemaName, this.tableName, this.constraintName, this.kind);\n }\n\n renderTypeScript(): string {\n const args = [\n jsonToTsSource(this.schemaName),\n jsonToTsSource(this.tableName),\n jsonToTsSource(this.constraintName),\n ];\n if (this.kind !== 'unique') {\n args.push(jsonToTsSource(this.kind));\n }\n return `dropConstraint(${args.join(', ')})`;\n }\n}\n\n// ============================================================================\n// Indexes\n// ============================================================================\n\nexport class CreateIndexCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'createIndex' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly indexName: string;\n readonly columns: readonly string[];\n // Named indexType (not typeName) to avoid collision with CreateEnumTypeCall.typeName,\n // which identifies a CREATE TYPE target and is read by `locationForCall` in issue-planner.ts.\n readonly indexType: string | undefined;\n readonly options: Record<string, unknown> | undefined;\n readonly label: string;\n\n constructor(\n schemaName: string,\n tableName: string,\n indexName: string,\n columns: readonly string[],\n extras?: { readonly type?: string; readonly options?: Record<string, unknown> },\n ) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.indexName = indexName;\n this.columns = columns;\n this.indexType = extras?.type;\n this.options = extras?.options;\n this.label = `Create index \"${indexName}\" on \"${tableName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n const extras: { type?: string; options?: Record<string, unknown> } = {};\n if (this.indexType !== undefined) extras.type = this.indexType;\n if (this.options !== undefined) extras.options = this.options;\n return createIndex(this.schemaName, this.tableName, this.indexName, this.columns, extras);\n }\n\n renderTypeScript(): string {\n const args = [\n jsonToTsSource(this.schemaName),\n jsonToTsSource(this.tableName),\n jsonToTsSource(this.indexName),\n jsonToTsSource(this.columns),\n ];\n if (this.indexType !== undefined || this.options !== undefined) {\n const extrasParts: string[] = [];\n if (this.indexType !== undefined) extrasParts.push(`type: ${jsonToTsSource(this.indexType)}`);\n if (this.options !== undefined) extrasParts.push(`options: ${jsonToTsSource(this.options)}`);\n args.push(`{ ${extrasParts.join(', ')} }`);\n }\n return `createIndex(${args.join(', ')})`;\n }\n}\n\nexport class DropIndexCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'dropIndex' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly tableName: string;\n readonly indexName: string;\n readonly label: string;\n\n constructor(schemaName: string, tableName: string, indexName: string) {\n super();\n this.schemaName = schemaName;\n this.tableName = tableName;\n this.indexName = indexName;\n this.label = `Drop index \"${indexName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropIndex(this.schemaName, this.tableName, this.indexName);\n }\n\n renderTypeScript(): string {\n return `dropIndex(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.indexName)})`;\n }\n}\n\n// ============================================================================\n// Enum types\n// ============================================================================\n\nexport class CreateEnumTypeCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'createEnumType' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly typeName: string;\n readonly nativeType: string;\n readonly values: readonly string[];\n readonly label: string;\n\n constructor(\n schemaName: string,\n typeName: string,\n values: readonly string[],\n nativeType: string = typeName,\n ) {\n super();\n this.schemaName = schemaName;\n this.typeName = typeName;\n this.nativeType = nativeType;\n this.values = values;\n this.label = `Create enum type \"${typeName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return createEnumType(this.schemaName, this.typeName, this.values, this.nativeType);\n }\n\n renderTypeScript(): string {\n const nativeArg =\n this.nativeType === this.typeName ? '' : `, ${jsonToTsSource(this.nativeType)}`;\n return `createEnumType(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.typeName)}, ${jsonToTsSource(this.values)}${nativeArg})`;\n }\n}\n\nexport class AddEnumValuesCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'addEnumValues' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly typeName: string;\n readonly nativeType: string;\n readonly values: readonly string[];\n readonly label: string;\n\n constructor(schemaName: string, typeName: string, nativeType: string, values: readonly string[]) {\n super();\n this.schemaName = schemaName;\n this.typeName = typeName;\n this.nativeType = nativeType;\n this.values = values;\n this.label = `Add values to enum type \"${typeName}\": ${values.join(', ')}`;\n this.freeze();\n }\n\n toOp(): Op {\n return addEnumValues(this.schemaName, this.typeName, this.nativeType, this.values);\n }\n\n renderTypeScript(): string {\n return `addEnumValues(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.typeName)}, ${jsonToTsSource(this.nativeType)}, ${jsonToTsSource(this.values)})`;\n }\n}\n\nexport class DropEnumTypeCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'dropEnumType' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly typeName: string;\n readonly label: string;\n\n constructor(schemaName: string, typeName: string) {\n super();\n this.schemaName = schemaName;\n this.typeName = typeName;\n this.label = `Drop enum type \"${typeName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropEnumType(this.schemaName, this.typeName);\n }\n\n renderTypeScript(): string {\n return `dropEnumType(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.typeName)})`;\n }\n}\n\nexport class RenameTypeCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'renameType' as const;\n readonly operationClass = 'destructive' as const;\n readonly schemaName: string;\n readonly fromName: string;\n readonly toName: string;\n readonly label: string;\n\n constructor(schemaName: string, fromName: string, toName: string) {\n super();\n this.schemaName = schemaName;\n this.fromName = fromName;\n this.toName = toName;\n this.label = `Rename type \"${fromName}\" to \"${toName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return renameType(this.schemaName, this.fromName, this.toName);\n }\n\n renderTypeScript(): string {\n return `renameType(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.fromName)}, ${jsonToTsSource(this.toName)})`;\n }\n}\n\n// ============================================================================\n// Raw SQL\n// ============================================================================\n\n/**\n * Laundered pre-built operation.\n *\n * Wraps an already-materialized `SqlMigrationPlanOperation` — typically one\n * produced by a SQL-family method or a codec control hook — so the planner\n * can carry it alongside IR nodes without reverse-engineering it into a\n * structured call class. Doubles as the user-facing escape hatch for raw\n * migrations: authors can pass a full op shape to `rawSql({...})`.\n *\n * `toOp()` returns the stored op unchanged. `renderTypeScript()` emits\n * `rawSql({...})` with the op serialized as a JSON literal — round-tripping\n * requires every field on the op to be JSON-serializable (no closures).\n */\nexport class RawSqlCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'rawSql' as const;\n readonly operationClass: MigrationOperationClass;\n readonly label: string;\n readonly op: Op;\n\n constructor(op: Op) {\n super();\n this.op = op;\n this.label = op.label;\n this.operationClass = op.operationClass;\n this.freeze();\n }\n\n toOp(): Op {\n return this.op;\n }\n\n renderTypeScript(): string {\n return `rawSql(${jsonToTsSource(this.op)})`;\n }\n}\n\n// ============================================================================\n// Database dependencies (structured DDL)\n// ============================================================================\n\nexport class CreateExtensionCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'createExtension' as const;\n readonly operationClass = 'additive' as const;\n readonly extensionName: string;\n readonly label: string;\n\n constructor(extensionName: string) {\n super();\n this.extensionName = extensionName;\n this.label = `Create extension \"${extensionName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return createExtension(this.extensionName);\n }\n\n renderTypeScript(): string {\n return `createExtension(${jsonToTsSource(this.extensionName)})`;\n }\n}\n\nexport class CreateSchemaCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'createSchema' as const;\n readonly operationClass = 'additive' as const;\n readonly schemaName: string;\n readonly label: string;\n\n constructor(schemaName: string) {\n super();\n this.schemaName = schemaName;\n this.label = `Create schema \"${schemaName}\"`;\n this.freeze();\n }\n\n toOp(): Op {\n return createSchema(this.schemaName);\n }\n\n renderTypeScript(): string {\n return `createSchema(${jsonToTsSource(this.schemaName)})`;\n }\n}\n\n// ============================================================================\n// Data transform\n// ============================================================================\n\n/**\n * A planner-generated data-transform stub. `checkSlot` and `runSlot` name\n * the unfilled authoring slots that the rendered `migration.ts` will expose\n * to the user via `placeholder(\"…\")` calls. `toOp()` always throws\n * `PN-MIG-2001`: the planner cannot lower a stubbed transform to a runtime\n * op — the user must fill the rendered `migration.ts` and re-emit.\n */\nexport class DataTransformCall extends PostgresOpFactoryCallNode {\n readonly factoryName = 'dataTransform' as const;\n readonly operationClass: MigrationOperationClass;\n readonly label: string;\n readonly checkSlot: string;\n readonly runSlot: string;\n\n constructor(\n label: string,\n checkSlot: string,\n runSlot: string,\n operationClass: MigrationOperationClass = 'data',\n ) {\n super();\n this.label = label;\n this.checkSlot = checkSlot;\n this.runSlot = runSlot;\n this.operationClass = operationClass;\n this.freeze();\n }\n\n toOp(): Op {\n throw errorUnfilledPlaceholder(this.label);\n }\n\n renderTypeScript(): string {\n return [\n `this.dataTransform(endContract, ${jsonToTsSource(this.label)}, {`,\n ` check: () => placeholder(${jsonToTsSource(this.checkSlot)}),`,\n ` run: () => placeholder(${jsonToTsSource(this.runSlot)}),`,\n '})',\n ].join('\\n');\n }\n\n override importRequirements(): readonly ImportRequirement[] {\n return [\n { moduleSpecifier: TARGET_MIGRATION_MODULE, symbol: 'placeholder' },\n {\n moduleSpecifier: './end-contract.json',\n symbol: 'endContract',\n kind: 'default',\n attributes: { type: 'json' },\n },\n ];\n }\n}\n\nexport type PostgresOpFactoryCall =\n | CreateTableCall\n | DropTableCall\n | AddColumnCall\n | DropColumnCall\n | AlterColumnTypeCall\n | SetNotNullCall\n | DropNotNullCall\n | SetDefaultCall\n | DropDefaultCall\n | AddPrimaryKeyCall\n | AddForeignKeyCall\n | AddUniqueCall\n | CreateIndexCall\n | DropIndexCall\n | DropConstraintCall\n | CreateEnumTypeCall\n | AddEnumValuesCall\n | DropEnumTypeCall\n | RenameTypeCall\n | RawSqlCall\n | CreateExtensionCall\n | CreateSchemaCall\n | DataTransformCall;\n\n/**\n * Stable identity key for reconciliation-level dedup.\n *\n * Two calls whose runtime ops would share the same `id` return the same\n * key, so a `Set<string>` can collapse them before they're emitted. The\n * current implementation delegates to `toOp().id`, which is the\n * authoritative identity; isolating dedup behind this helper lets a future\n * pass replace it with an allocation-free computation directly from the\n * call's fields without touching call sites.\n *\n * `DataTransformCall` intentionally has no sensible identity today — it\n * throws `PN-MIG-2001` on `toOp()`. Reconciliation never produces one; the\n * helper is unspecified for that variant and only meant for\n * reconciliation-emitted calls.\n */\nexport function identityKeyFor(call: PostgresOpFactoryCall): string {\n return call.toOp().id;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAM,0BAA0B;AAEhC,IAAe,4BAAf,cAAiD,aAA+C;CAM9F,qBAAmD;EACjD,OAAO,CAAC;GAAE,iBAAiB;GAAyB,QAAQ,KAAK;EAAY,CAAC;CAChF;CAEA,SAAyB;EACvB,OAAO,OAAO,IAAI;CACpB;AACF;AAUA,IAAa,kBAAb,cAAqC,0BAA0B;CAC7D,cAAuB;CACvB,iBAA0B;CAC1B;CACA;CACA;CACA;CACA;CAEA,YACE,YACA,WACA,SACA,YACA;EAC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KAAK,OAAO,EAAE;GACzD;EACF,EAAE,KAAK,IAAI;CACb;CAEA,qBAA4D;EAC1D,OAAO,CACL;GAAE,iBAAiB;GAAyB,QAAQ;EAAc,GAClE;GACE,iBAAiB;GACjB,QAAQ;GACR,MAAM;GACN,YAAY,EAAE,MAAM,OAAO;EAC7B,CACF;CACF;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as SetDefaultCall, S as RenameTypeCall, _ as DropIndexCall, a as AddUniqueCall, c as CreateExtensionCall, d as CreateTableCall, f as DataTransformCall, g as DropEnumTypeCall, h as DropDefaultCall, i as AddPrimaryKeyCall, l as CreateIndexCall, m as DropConstraintCall, n as AddEnumValuesCall, o as AlterColumnTypeCall, p as DropColumnCall, r as AddForeignKeyCall, s as CreateEnumTypeCall, t as AddColumnCall, u as CreateSchemaCall, v as DropNotNullCall, w as SetNotNullCall, x as RawSqlCall, y as DropTableCall } from "./op-factory-call-
|
|
1
|
+
import { C as SetDefaultCall, S as RenameTypeCall, _ as DropIndexCall, a as AddUniqueCall, c as CreateExtensionCall, d as CreateTableCall, f as DataTransformCall, g as DropEnumTypeCall, h as DropDefaultCall, i as AddPrimaryKeyCall, l as CreateIndexCall, m as DropConstraintCall, n as AddEnumValuesCall, o as AlterColumnTypeCall, p as DropColumnCall, r as AddForeignKeyCall, s as CreateEnumTypeCall, t as AddColumnCall, u as CreateSchemaCall, v as DropNotNullCall, w as SetNotNullCall, x as RawSqlCall, y as DropTableCall } from "./op-factory-call-B-HEOf41.mjs";
|
|
2
2
|
export { AddColumnCall, AddEnumValuesCall, AddForeignKeyCall, AddPrimaryKeyCall, AddUniqueCall, AlterColumnTypeCall, CreateEnumTypeCall, CreateExtensionCall, CreateIndexCall, CreateSchemaCall, CreateTableCall, DataTransformCall, DropColumnCall, DropConstraintCall, DropDefaultCall, DropEnumTypeCall, DropIndexCall, DropNotNullCall, DropTableCall, RawSqlCall, RenameTypeCall, SetDefaultCall, SetNotNullCall };
|
package/dist/op-factory-call.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as SetNotNullCall, S as SetDefaultCall, _ as DropIndexCall, a as AddUniqueCall, b as RawSqlCall, c as CreateExtensionCall, d as CreateTableCall, f as DataTransformCall, g as DropEnumTypeCall, h as DropDefaultCall, i as AddPrimaryKeyCall, l as CreateIndexCall, m as DropConstraintCall, n as AddEnumValuesCall, o as AlterColumnTypeCall, p as DropColumnCall, r as AddForeignKeyCall, s as CreateEnumTypeCall, t as AddColumnCall, u as CreateSchemaCall, v as DropNotNullCall, x as RenameTypeCall, y as DropTableCall } from "./op-factory-call-
|
|
1
|
+
import { C as SetNotNullCall, S as SetDefaultCall, _ as DropIndexCall, a as AddUniqueCall, b as RawSqlCall, c as CreateExtensionCall, d as CreateTableCall, f as DataTransformCall, g as DropEnumTypeCall, h as DropDefaultCall, i as AddPrimaryKeyCall, l as CreateIndexCall, m as DropConstraintCall, n as AddEnumValuesCall, o as AlterColumnTypeCall, p as DropColumnCall, r as AddForeignKeyCall, s as CreateEnumTypeCall, t as AddColumnCall, u as CreateSchemaCall, v as DropNotNullCall, x as RenameTypeCall, y as DropTableCall } from "./op-factory-call-ZqeS5JxZ.mjs";
|
|
2
2
|
export { AddColumnCall, AddEnumValuesCall, AddForeignKeyCall, AddPrimaryKeyCall, AddUniqueCall, AlterColumnTypeCall, CreateEnumTypeCall, CreateExtensionCall, CreateIndexCall, CreateSchemaCall, CreateTableCall, DataTransformCall, DropColumnCall, DropConstraintCall, DropDefaultCall, DropEnumTypeCall, DropIndexCall, DropNotNullCall, DropTableCall, RawSqlCall, RenameTypeCall, SetDefaultCall, SetNotNullCall };
|
package/dist/pack.d.mts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { r as CodecTypes } from "./codec-types-
|
|
2
|
-
import { n as PostgresEnumTypeInput } from "./postgres-enum-type-
|
|
1
|
+
import { r as CodecTypes } from "./codec-types-BoxMGJk-.mjs";
|
|
2
|
+
import { n as PostgresEnumTypeInput } from "./postgres-enum-type-CWwVGBNK.mjs";
|
|
3
3
|
import * as _$_prisma_next_sql_contract_types0 from "@prisma-next/sql-contract/types";
|
|
4
4
|
import * as _$arktype_internal_variants_object_ts0 from "arktype/internal/variants/object.ts";
|
|
5
5
|
|
|
6
6
|
//#region src/core/descriptor-meta.d.ts
|
|
7
7
|
declare const postgresTargetDescriptorMetaBase: {
|
|
8
|
+
readonly defaultNamespaceId: "public";
|
|
8
9
|
readonly authoring: {
|
|
9
10
|
readonly type: {};
|
|
10
11
|
readonly field: {
|
package/dist/pack.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack.d.mts","names":[],"sources":["../src/core/descriptor-meta.ts"],"mappings":";;;;;;cAQM,gCAAA;EAAA
|
|
1
|
+
{"version":3,"file":"pack.d.mts","names":[],"sources":["../src/core/descriptor-meta.ts"],"mappings":";;;;;;cAQM,gCAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAQI,sCAAA,CAAA,UAAA;;;;;;;;;;;;;;;;;;;;;cAEG,4BAAA,SAAqC,gCAAA;EAAA,SACvC,YAAA,GAAe,UAAU;AAAA"}
|
package/dist/pack.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-
|
|
1
|
+
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-BqATo5Dz.mjs";
|
|
2
2
|
export { postgresTargetDescriptorMeta as default };
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { t as postgresColumnsCompatible } from "./column-type-compatibility-Dzxz_CkP.mjs";
|
|
2
|
+
import { r as isPostgresSchema } from "./postgres-schema-BQG4laaB.mjs";
|
|
3
|
+
import { t as createResolveExistingEnumValues } from "./enum-planning-Cb-NjaH6.mjs";
|
|
4
|
+
import { t as parsePostgresDefault } from "./default-normalizer-DFHtpCPH.mjs";
|
|
5
|
+
import { t as normalizeSchemaNativeType } from "./native-type-normalizer-BUUe8USD.mjs";
|
|
6
|
+
import { n as postgresPlannerStrategies, t as planIssues } from "./issue-planner-NzRtXfjR.mjs";
|
|
7
|
+
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-D6KXC2DH.mjs";
|
|
8
|
+
import { extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure } from "@prisma-next/family-sql/control";
|
|
9
|
+
import { ifDefined } from "@prisma-next/utils/defined";
|
|
10
|
+
import { UNBOUND_NAMESPACE_ID } from "@prisma-next/framework-components/ir";
|
|
11
|
+
import { isPostgresEnumStorageEntry, storageTableAt } from "@prisma-next/sql-contract/types";
|
|
12
|
+
import { verifySqlSchema } from "@prisma-next/family-sql/schema-verify";
|
|
13
|
+
import { blindCast } from "@prisma-next/utils/casts";
|
|
14
|
+
//#region src/core/migrations/control-policy.ts
|
|
15
|
+
/**
|
|
16
|
+
* Factory calls that create a whole, previously-absent top-level storage
|
|
17
|
+
* object. Used to decide whether `tolerated` permits a call (it only allows
|
|
18
|
+
* creating absent objects, never modifying existing ones).
|
|
19
|
+
*
|
|
20
|
+
* Deliberately an explicit, closed set rather than a `factoryName`
|
|
21
|
+
* create/alter/drop classification: it answers exactly one yes/no question
|
|
22
|
+
* and is fail-closed. Any call not listed here — including future or
|
|
23
|
+
* extension-contributed factories — is treated as NOT object-creation, so it
|
|
24
|
+
* is suppressed under `tolerated` rather than permissively emitted.
|
|
25
|
+
*/
|
|
26
|
+
const OBJECT_CREATION_FACTORIES = new Set([
|
|
27
|
+
"createTable",
|
|
28
|
+
"createEnumType",
|
|
29
|
+
"createSchema"
|
|
30
|
+
]);
|
|
31
|
+
function createsNewTopLevelObject(call) {
|
|
32
|
+
return OBJECT_CREATION_FACTORIES.has(call.factoryName);
|
|
33
|
+
}
|
|
34
|
+
function ddlSchemaNameForNamespace(contract, namespaceId) {
|
|
35
|
+
const namespace = contract.storage.namespaces[namespaceId];
|
|
36
|
+
return isPostgresSchema(namespace) ? namespace.ddlSchemaName(contract.storage) : namespaceId;
|
|
37
|
+
}
|
|
38
|
+
function resolveNamespaceIdForTable(contract, tableName, ddlSchemaName) {
|
|
39
|
+
for (const namespaceId of Object.keys(contract.storage.namespaces)) {
|
|
40
|
+
if (!storageTableAt(contract.storage, namespaceId, tableName)) continue;
|
|
41
|
+
if (ddlSchemaName === void 0 || ddlSchemaNameForNamespace(contract, namespaceId) === ddlSchemaName) return namespaceId;
|
|
42
|
+
}
|
|
43
|
+
return UNBOUND_NAMESPACE_ID;
|
|
44
|
+
}
|
|
45
|
+
function resolveNamespaceIdForDdlSchema(contract, ddlSchemaName) {
|
|
46
|
+
for (const namespaceId of Object.keys(contract.storage.namespaces)) {
|
|
47
|
+
const ns = contract.storage.namespaces[namespaceId];
|
|
48
|
+
if (isPostgresSchema(ns) && ns.ddlSchemaName(contract.storage) === ddlSchemaName) return namespaceId;
|
|
49
|
+
if (namespaceId === ddlSchemaName) return namespaceId;
|
|
50
|
+
}
|
|
51
|
+
return UNBOUND_NAMESPACE_ID;
|
|
52
|
+
}
|
|
53
|
+
function postgresCallFields(call) {
|
|
54
|
+
return {
|
|
55
|
+
...ifDefined("schemaName", "schemaName" in call ? call.schemaName : void 0),
|
|
56
|
+
...ifDefined("tableName", "tableName" in call ? call.tableName : void 0),
|
|
57
|
+
...ifDefined("columnName", "columnName" in call ? call.columnName : void 0),
|
|
58
|
+
...ifDefined("typeName", "typeName" in call ? call.typeName : void 0)
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function formatPostgresControlPolicySubjectLabel(factoryName, subject, contract) {
|
|
62
|
+
if (subject?.table) return `${factoryName}(${ddlSchemaNameForNamespace(contract, subject.namespaceId)}.${subject.table})`;
|
|
63
|
+
if (subject?.typeName) return `${factoryName}(${ddlSchemaNameForNamespace(contract, subject.namespaceId)}.${subject.typeName})`;
|
|
64
|
+
return factoryName;
|
|
65
|
+
}
|
|
66
|
+
function resolvePostgresCallControlPolicySubject(call, contract) {
|
|
67
|
+
const callFields = postgresCallFields(call);
|
|
68
|
+
const createsNewObject = createsNewTopLevelObject(call);
|
|
69
|
+
if (call.factoryName === "createSchema" && callFields.schemaName) return {
|
|
70
|
+
namespaceId: resolveNamespaceIdForDdlSchema(contract, callFields.schemaName),
|
|
71
|
+
createsNewObject
|
|
72
|
+
};
|
|
73
|
+
if (callFields.typeName && call.factoryName !== "addColumn") {
|
|
74
|
+
const namespaceId = callFields.schemaName ? resolveNamespaceIdForDdlSchema(contract, callFields.schemaName) : UNBOUND_NAMESPACE_ID;
|
|
75
|
+
const ns = contract.storage.namespaces[namespaceId];
|
|
76
|
+
const rawEnum = isPostgresSchema(ns) ? ns.entries.type[callFields.typeName] : void 0;
|
|
77
|
+
return {
|
|
78
|
+
namespaceId,
|
|
79
|
+
...ifDefined("explicitNodeControlPolicy", isPostgresEnumStorageEntry(rawEnum) ? rawEnum.control : void 0),
|
|
80
|
+
typeName: callFields.typeName,
|
|
81
|
+
createsNewObject
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
if (callFields.tableName) {
|
|
85
|
+
const namespaceId = resolveNamespaceIdForTable(contract, callFields.tableName, callFields.schemaName);
|
|
86
|
+
const tableControlPolicy = storageTableAt(contract.storage, namespaceId, callFields.tableName)?.control;
|
|
87
|
+
return {
|
|
88
|
+
namespaceId,
|
|
89
|
+
...ifDefined("explicitNodeControlPolicy", tableControlPolicy),
|
|
90
|
+
table: callFields.tableName,
|
|
91
|
+
...ifDefined("column", callFields.columnName),
|
|
92
|
+
createsNewObject
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
if (callFields.schemaName) return {
|
|
96
|
+
namespaceId: resolveNamespaceIdForDdlSchema(contract, callFields.schemaName),
|
|
97
|
+
createsNewObject
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Issue kinds that describe the absence of a whole, top-level Postgres
|
|
102
|
+
* object — the same kinds `createsNewTopLevelObject` recognises for calls.
|
|
103
|
+
* Used by {@link resolvePostgresIssueCreationFactoryName} to decide whether
|
|
104
|
+
* a `tolerated` subject permits the issue to flow into the planner
|
|
105
|
+
* (create-if-absent) and to seed the suppressed-subject warning's
|
|
106
|
+
* `factoryName` when the planner is skipped.
|
|
107
|
+
*/
|
|
108
|
+
const POSTGRES_ISSUE_CREATION_FACTORY = Object.freeze({
|
|
109
|
+
missing_schema: "createSchema",
|
|
110
|
+
missing_table: "createTable",
|
|
111
|
+
type_missing: "createEnumType"
|
|
112
|
+
});
|
|
113
|
+
function resolvePostgresIssueCreationFactoryName(issue) {
|
|
114
|
+
return POSTGRES_ISSUE_CREATION_FACTORY[issue.kind];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Resolve the control-policy subject coordinate for a single
|
|
118
|
+
* {@link SchemaIssue}. Mirrors the resolution `resolvePostgresCallControlPolicySubject`
|
|
119
|
+
* performs for a generated DDL call, but works *off the issue* — so the
|
|
120
|
+
* planner can partition issues by effective policy before the diff engine
|
|
121
|
+
* runs. `createsNewObject` is derived from the issue's kind: schema/table/
|
|
122
|
+
* type-missing issues describe a brand-new top-level object; everything else
|
|
123
|
+
* touches an existing object.
|
|
124
|
+
*
|
|
125
|
+
* An `extra_table` issue carries no contract namespace coordinate (the table
|
|
126
|
+
* isn't in any contract namespace), so the subject's `namespaceId` falls
|
|
127
|
+
* back to {@link UNBOUND_NAMESPACE_ID}; the call-side resolver does the same
|
|
128
|
+
* for the `DropTableCall` it produces.
|
|
129
|
+
*/
|
|
130
|
+
function resolvePostgresIssueControlPolicySubject(issue, contract) {
|
|
131
|
+
const createsNewObject = POSTGRES_ISSUE_CREATION_FACTORY[issue.kind] !== void 0;
|
|
132
|
+
if (issue.kind === "missing_schema" && issue.namespaceId) return {
|
|
133
|
+
namespaceId: issue.namespaceId,
|
|
134
|
+
createsNewObject
|
|
135
|
+
};
|
|
136
|
+
if ("typeName" in issue && issue.typeName) {
|
|
137
|
+
const namespaceId = "namespaceId" in issue && issue.namespaceId ? issue.namespaceId : UNBOUND_NAMESPACE_ID;
|
|
138
|
+
const ns = contract.storage.namespaces[namespaceId];
|
|
139
|
+
const rawEnum = isPostgresSchema(ns) ? ns.entries.type[issue.typeName] : void 0;
|
|
140
|
+
return {
|
|
141
|
+
namespaceId,
|
|
142
|
+
...ifDefined("explicitNodeControlPolicy", isPostgresEnumStorageEntry(rawEnum) ? rawEnum.control : void 0),
|
|
143
|
+
typeName: issue.typeName,
|
|
144
|
+
createsNewObject
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
if ("table" in issue && issue.table) {
|
|
148
|
+
const namespaceId = "namespaceId" in issue && issue.namespaceId ? issue.namespaceId : resolveNamespaceIdForTable(contract, issue.table, void 0);
|
|
149
|
+
return {
|
|
150
|
+
namespaceId,
|
|
151
|
+
...ifDefined("explicitNodeControlPolicy", storageTableAt(contract.storage, namespaceId, issue.table)?.control),
|
|
152
|
+
table: issue.table,
|
|
153
|
+
...ifDefined("column", "column" in issue ? issue.column : void 0),
|
|
154
|
+
createsNewObject
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/core/migrations/verify-postgres-namespaces.ts
|
|
160
|
+
/**
|
|
161
|
+
* Resolves the live-database schema name for a given namespace
|
|
162
|
+
* coordinate. Mirrors `resolveDdlSchemaForNamespace` in
|
|
163
|
+
* `planner-strategies.ts` so the verifier's projection and the
|
|
164
|
+
* planner's projection always agree — Postgres-aware namespaces (the
|
|
165
|
+
* production path) dispatch to `ddlSchemaName(storage)`, and bare
|
|
166
|
+
* object payloads (used by some tests) fall back to the coordinate
|
|
167
|
+
* itself.
|
|
168
|
+
*/
|
|
169
|
+
function resolveDdlSchemaName(storage, namespaceId) {
|
|
170
|
+
const namespace = storage.namespaces[namespaceId];
|
|
171
|
+
if (isPostgresSchema(namespace)) return namespace.ddlSchemaName(storage);
|
|
172
|
+
return namespaceId;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Reads the introspected list of schema names from the Postgres-flavoured
|
|
176
|
+
* annotations slot on the schema IR. Defaults to the always-present
|
|
177
|
+
* `public` schema when introspection did not populate the slot — a fresh
|
|
178
|
+
* Postgres database always carries `public` (unless an operator dropped
|
|
179
|
+
* it manually), so any verifier path that runs without an enriched
|
|
180
|
+
* introspection still suppresses the redundant `CREATE SCHEMA "public"`.
|
|
181
|
+
*
|
|
182
|
+
* Production introspection (`PostgresControlAdapter.introspect`) is the
|
|
183
|
+
* authoritative source: it queries `pg_namespace` and writes every
|
|
184
|
+
* non-system schema into `annotations.pg.existingSchemas`. Tests that
|
|
185
|
+
* want to assert against a richer initial state pass the slot
|
|
186
|
+
* explicitly via the schema IR.
|
|
187
|
+
*/
|
|
188
|
+
function existingSchemasFromSchema(schema) {
|
|
189
|
+
const slot = schema.annotations?.pg?.existingSchemas;
|
|
190
|
+
if (Array.isArray(slot)) return slot.filter((s) => typeof s === "string");
|
|
191
|
+
return ["public"];
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Emits a `missing_schema` issue for every contract-declared Postgres
|
|
195
|
+
* namespace whose live container does not yet exist.
|
|
196
|
+
*
|
|
197
|
+
* A namespace's live container is the schema returned by its
|
|
198
|
+
* polymorphic `ddlSchemaName(storage)` method — named schemas resolve
|
|
199
|
+
* to their own id; the unbound singleton returns `UNBOUND_NAMESPACE_ID`
|
|
200
|
+
* and is skipped explicitly (late-bound namespaces have no fixed DDL
|
|
201
|
+
* schema). Issues are emitted only when the resolved name is a real,
|
|
202
|
+
* creatable schema (not the unbound sentinel) and is missing from the
|
|
203
|
+
* introspected list. `public` is suppressed implicitly because the
|
|
204
|
+
* introspection (or its sensible default) always carries it.
|
|
205
|
+
*
|
|
206
|
+
* Each emitted issue stamps `namespaceId` with the contract namespace
|
|
207
|
+
* coordinate so the downstream `mapIssueToCall` re-resolves the DDL
|
|
208
|
+
* schema name through the same polymorphic path — keeping the
|
|
209
|
+
* coordinate, not the resolved name, as the issue's stable identity.
|
|
210
|
+
*/
|
|
211
|
+
function verifyPostgresNamespacePresence(input) {
|
|
212
|
+
const { contract, schema } = input;
|
|
213
|
+
const existing = new Set(existingSchemasFromSchema(schema));
|
|
214
|
+
const issues = [];
|
|
215
|
+
const namespaceIds = Object.keys(contract.storage.namespaces).sort();
|
|
216
|
+
for (const namespaceId of namespaceIds) {
|
|
217
|
+
if (namespaceId === UNBOUND_NAMESPACE_ID) continue;
|
|
218
|
+
const ddlName = resolveDdlSchemaName(contract.storage, namespaceId);
|
|
219
|
+
if (ddlName === UNBOUND_NAMESPACE_ID) continue;
|
|
220
|
+
if (existing.has(ddlName)) continue;
|
|
221
|
+
issues.push({
|
|
222
|
+
kind: "missing_schema",
|
|
223
|
+
namespaceId,
|
|
224
|
+
message: `Schema "${ddlName}" is missing from database`
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
return issues;
|
|
228
|
+
}
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/core/migrations/planner.ts
|
|
231
|
+
function createPostgresMigrationPlanner() {
|
|
232
|
+
return new PostgresMigrationPlanner();
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Postgres migration planner — a thin wrapper over `planIssues`.
|
|
236
|
+
*
|
|
237
|
+
* `plan()` verifies the live schema against the target contract (producing
|
|
238
|
+
* `SchemaIssue[]`) and delegates to `planIssues` with the unified
|
|
239
|
+
* `postgresPlannerStrategies` list: enum-change, NOT-NULL backfill,
|
|
240
|
+
* type-change, nullable-tightening, codec-hook storage types,
|
|
241
|
+
* component-declared dependency installs, and shared-temp-default /
|
|
242
|
+
* empty-table-guarded NOT-NULL add-column. The same strategy list runs for
|
|
243
|
+
* `migration plan`, `db update`, and `db init`; behavior diverges purely on
|
|
244
|
+
* `policy.allowedOperationClasses` (the data-safe strategies short-circuit
|
|
245
|
+
* when `'data'` is excluded). The issue planner applies operation-class
|
|
246
|
+
* policy gates and emits a single `PostgresOpFactoryCall[]` that drives both
|
|
247
|
+
* the runtime-ops view (via `renderOps`) and the `renderTypeScript()`
|
|
248
|
+
* authoring surface.
|
|
249
|
+
*/
|
|
250
|
+
var PostgresMigrationPlanner = class {
|
|
251
|
+
plan(options) {
|
|
252
|
+
return this.planSql(options);
|
|
253
|
+
}
|
|
254
|
+
emptyMigration(context, spaceId) {
|
|
255
|
+
return new TypeScriptRenderablePostgresMigration([], {
|
|
256
|
+
from: context.fromHash,
|
|
257
|
+
to: context.toHash
|
|
258
|
+
}, spaceId);
|
|
259
|
+
}
|
|
260
|
+
planSql(options) {
|
|
261
|
+
const schemaName = options.schemaName ?? Object.keys(options.contract.storage.namespaces).find((id) => id !== UNBOUND_NAMESPACE_ID) ?? UNBOUND_NAMESPACE_ID;
|
|
262
|
+
const policyResult = this.ensureAdditivePolicy(options.policy);
|
|
263
|
+
if (policyResult) return policyResult;
|
|
264
|
+
const schemaIssues = this.collectSchemaIssues(options);
|
|
265
|
+
const codecHooks = extractCodecControlHooks(options.frameworkComponents);
|
|
266
|
+
const storageTypes = options.contract.storage.types ?? {};
|
|
267
|
+
const issuePartition = partitionIssuesByControlPolicy({
|
|
268
|
+
issues: schemaIssues,
|
|
269
|
+
contract: options.contract,
|
|
270
|
+
resolveControlPolicySubject: (issue) => resolvePostgresIssueControlPolicySubject(issue, options.contract),
|
|
271
|
+
resolveCreationFactoryName: resolvePostgresIssueCreationFactoryName,
|
|
272
|
+
formatSubjectLabel: (factoryName, subject) => formatPostgresControlPolicySubjectLabel(factoryName, subject, options.contract)
|
|
273
|
+
});
|
|
274
|
+
const result = planIssues({
|
|
275
|
+
issues: issuePartition.plannable,
|
|
276
|
+
toContract: options.contract,
|
|
277
|
+
fromContract: options.fromContract,
|
|
278
|
+
schemaName,
|
|
279
|
+
codecHooks,
|
|
280
|
+
storageTypes,
|
|
281
|
+
schema: options.schema,
|
|
282
|
+
policy: options.policy,
|
|
283
|
+
frameworkComponents: options.frameworkComponents,
|
|
284
|
+
strategies: postgresPlannerStrategies
|
|
285
|
+
});
|
|
286
|
+
if (!result.ok) return plannerFailure(result.failure);
|
|
287
|
+
const fieldEventPartition = partitionCallsByControlPolicy({
|
|
288
|
+
calls: blindCast(planFieldEventOperations({
|
|
289
|
+
priorContract: options.fromContract,
|
|
290
|
+
newContract: options.contract,
|
|
291
|
+
codecHooks
|
|
292
|
+
})),
|
|
293
|
+
contract: options.contract,
|
|
294
|
+
resolveControlPolicySubject: (call) => resolvePostgresCallControlPolicySubject(call, options.contract),
|
|
295
|
+
resolveFactoryName: (call) => call.factoryName,
|
|
296
|
+
formatSubjectLabel: (factoryName, subject) => formatPostgresControlPolicySubjectLabel(factoryName, subject, options.contract)
|
|
297
|
+
});
|
|
298
|
+
const calls = [...result.value.calls, ...fieldEventPartition.kept];
|
|
299
|
+
const warnings = [...issuePartition.warnings, ...fieldEventPartition.warnings];
|
|
300
|
+
return Object.freeze({
|
|
301
|
+
kind: "success",
|
|
302
|
+
plan: new TypeScriptRenderablePostgresMigration(calls, {
|
|
303
|
+
from: options.fromContract?.storage.storageHash ?? null,
|
|
304
|
+
to: options.contract.storage.storageHash
|
|
305
|
+
}, options.spaceId),
|
|
306
|
+
...warnings.length > 0 ? { warnings: Object.freeze(warnings) } : {}
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
ensureAdditivePolicy(policy) {
|
|
310
|
+
if (!policy.allowedOperationClasses.includes("additive")) return plannerFailure([{
|
|
311
|
+
kind: "unsupportedOperation",
|
|
312
|
+
summary: "Migration planner requires additive operations be allowed",
|
|
313
|
+
why: "The planner requires the \"additive\" operation class to be allowed in the policy."
|
|
314
|
+
}]);
|
|
315
|
+
return null;
|
|
316
|
+
}
|
|
317
|
+
collectSchemaIssues(options) {
|
|
318
|
+
const allowed = options.policy.allowedOperationClasses;
|
|
319
|
+
const strict = allowed.includes("widening") || allowed.includes("destructive");
|
|
320
|
+
const verifyResult = verifySqlSchema({
|
|
321
|
+
contract: options.contract,
|
|
322
|
+
schema: options.schema,
|
|
323
|
+
strict,
|
|
324
|
+
typeMetadataRegistry: /* @__PURE__ */ new Map(),
|
|
325
|
+
frameworkComponents: options.frameworkComponents,
|
|
326
|
+
normalizeDefault: parsePostgresDefault,
|
|
327
|
+
normalizeNativeType: normalizeSchemaNativeType,
|
|
328
|
+
columnsCompatible: postgresColumnsCompatible,
|
|
329
|
+
resolveExistingEnumValues: createResolveExistingEnumValues(options.contract.storage)
|
|
330
|
+
});
|
|
331
|
+
const namespaceIssues = verifyPostgresNamespacePresence({
|
|
332
|
+
contract: options.contract,
|
|
333
|
+
schema: options.schema
|
|
334
|
+
});
|
|
335
|
+
if (namespaceIssues.length === 0) return verifyResult.schema.issues;
|
|
336
|
+
return [...namespaceIssues, ...verifyResult.schema.issues];
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
//#endregion
|
|
340
|
+
export { createPostgresMigrationPlanner as t };
|
|
341
|
+
|
|
342
|
+
//# sourceMappingURL=planner-BRGVWfq4.mjs.map
|