@prisma/orm-target-postgres 8.0.0-rc.17-dev.37 → 8.0.0-rc.17-dev.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-C0SKPLzt-D3_mXLaM.mjs → adapter-C0SKPLzt-flxKm2YQ.mjs} +5 -5
- package/dist/{adapter-C0SKPLzt-D3_mXLaM.mjs.map → adapter-C0SKPLzt-flxKm2YQ.mjs.map} +1 -1
- package/dist/adapter.mjs +5 -5
- package/dist/adapter__adapter.mjs +2 -2
- package/dist/adapter__control.mjs +6 -6
- package/dist/adapter__runtime.mjs +4 -4
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/{authoring-kZOSollq-DP0v31A_.mjs → authoring-CTn87jlt-VHX7hiNU.mjs} +5 -5
- package/dist/{authoring-kZOSollq-DP0v31A_.mjs.map → authoring-CTn87jlt-VHX7hiNU.mjs.map} +1 -1
- package/dist/autoincrement-widths-DbyXRo5B-BUVCYb_V.mjs +39 -0
- package/dist/autoincrement-widths-DbyXRo5B-BUVCYb_V.mjs.map +1 -0
- package/dist/{check-expressions-BaFrBceq-ChgvazEN.mjs → check-expressions-CVLs1Cgf-DaMRk-Q4.mjs} +3 -3
- package/dist/{check-expressions-BaFrBceq-ChgvazEN.mjs.map → check-expressions-CVLs1Cgf-DaMRk-Q4.mjs.map} +1 -1
- package/dist/{codec-registry-CKBDkxX7-Kw84Or3s.mjs → codec-registry-BWUY_QLt-CzrMkP9N.mjs} +4 -4
- package/dist/{codec-registry-CKBDkxX7-Kw84Or3s.mjs.map → codec-registry-BWUY_QLt-CzrMkP9N.mjs.map} +1 -1
- package/dist/{codecs-BK3J4C0n-B8EnUXZf.mjs → codecs-Cb5S70Lx-WRSQkpza.mjs} +3 -3
- package/dist/{codecs-BK3J4C0n-B8EnUXZf.mjs.map → codecs-Cb5S70Lx-WRSQkpza.mjs.map} +1 -1
- package/dist/{contract-free-DjI-gclO.mjs → contract-free-spGyVyoh.mjs} +3 -3
- package/dist/{contract-free-DjI-gclO.mjs.map → contract-free-spGyVyoh.mjs.map} +1 -1
- package/dist/{control-DJo3P3yL.mjs → control-C4-UbYOH.mjs} +6 -3
- package/dist/control-C4-UbYOH.mjs.map +1 -0
- package/dist/{control-C5pTVhtN.mjs → control-DnqvbRrL.mjs} +105 -23
- package/dist/control-DnqvbRrL.mjs.map +1 -0
- package/dist/{control-adapter-CEeF_Na4-CMRZNp7S.mjs → control-adapter-CEeF_Na4-Cp6Si4hD.mjs} +6 -6
- package/dist/{control-adapter-CEeF_Na4-CMRZNp7S.mjs.map → control-adapter-CEeF_Na4-Cp6Si4hD.mjs.map} +1 -1
- package/dist/{control-policy-C5VoaD11-lzAw5cjN.mjs → control-policy-DXaIsgUW-Btyo9Vs8.mjs} +172 -130
- package/dist/control-policy-DXaIsgUW-Btyo9Vs8.mjs.map +1 -0
- package/dist/data-transform-C-3UJ3hC.d.mts +1 -0
- package/dist/{data-transform-Bo32KRbq-BLn1_UG-.mjs → data-transform-CtHnNYhF-r19375h3.mjs} +11 -4
- package/dist/data-transform-CtHnNYhF-r19375h3.mjs.map +1 -0
- package/dist/{data-transform-Ck5FbyNO-BNE7QlAo.d.mts → data-transform-nGy9rz87-CEOXAj91.d.mts} +14 -3
- package/dist/data-transform-nGy9rz87-CEOXAj91.d.mts.map +1 -0
- package/dist/{data-type-entries-DoR61yeO-BB2cY7rI.mjs → data-type-entries-15a-vBdm-vIj5l1u5.mjs} +3 -3
- package/dist/{data-type-entries-DoR61yeO-BB2cY7rI.mjs.map → data-type-entries-15a-vBdm-vIj5l1u5.mjs.map} +1 -1
- package/dist/{data-types-DRkmmE9S-C5Q9oH4Q.mjs → data-types-K6tDhu1D-BN--9o1o.mjs} +3 -3
- package/dist/{data-types-DRkmmE9S-C5Q9oH4Q.mjs.map → data-types-K6tDhu1D-BN--9o1o.mjs.map} +1 -1
- package/dist/{ddl-CFWv3VOT-Ad-I5p22.mjs → ddl-BKqbtVN3-CPHiYaCY.mjs} +3 -3
- package/dist/{ddl-CFWv3VOT-Ad-I5p22.mjs.map → ddl-BKqbtVN3-CPHiYaCY.mjs.map} +1 -1
- package/dist/{descriptor-meta-Dekti3e8-DLSepvAq.mjs → descriptor-meta-D5OipARb-6znWwvjE.mjs} +8 -8
- package/dist/{descriptor-meta-Dekti3e8-DLSepvAq.mjs.map → descriptor-meta-D5OipARb-6znWwvjE.mjs.map} +1 -1
- package/dist/{descriptor-meta-DyjDJfnQ-5lgalclQ.mjs → descriptor-meta-DyjDJfnQ-CoD4Kmpz.mjs} +3 -3
- package/dist/{descriptor-meta-DyjDJfnQ-5lgalclQ.mjs.map → descriptor-meta-DyjDJfnQ-CoD4Kmpz.mjs.map} +1 -1
- package/dist/{descriptor-meta-runtime-iArZEoCE-GhLNDdg-.mjs → descriptor-meta-runtime-D4a-hsd_-B_YkwgHQ.mjs} +3 -3
- package/dist/{descriptor-meta-runtime-iArZEoCE-GhLNDdg-.mjs.map → descriptor-meta-runtime-D4a-hsd_-B_YkwgHQ.mjs.map} +1 -1
- package/dist/{diff-database-schema-CUSXh2y2-CWRGCPL7.mjs → diff-database-schema-BV6Px0Gg-DAC6TL3P.mjs} +6 -6
- package/dist/{diff-database-schema-CUSXh2y2-CWRGCPL7.mjs.map → diff-database-schema-BV6Px0Gg-DAC6TL3P.mjs.map} +1 -1
- package/dist/driver.mjs +1 -1
- package/dist/driver__control.mjs +1 -1
- package/dist/{errors-DZ3zQdpT.d.mts → errors-D5sJ0fgp.d.mts} +2 -2
- package/dist/{errors-DZ3zQdpT.d.mts.map → errors-D5sJ0fgp.d.mts.map} +1 -1
- package/dist/{full-text-search-document-DJd-9K-K-CuV_QLH3.mjs → full-text-search-document-DYNz29YC-CfVTPwIL.mjs} +3 -3
- package/dist/{full-text-search-document-DJd-9K-K-CuV_QLH3.mjs.map → full-text-search-document-DYNz29YC-CfVTPwIL.mjs.map} +1 -1
- package/dist/indexes-BWHRVhke-vqXUnRfT.d.mts +49 -0
- package/dist/indexes-BWHRVhke-vqXUnRfT.d.mts.map +1 -0
- package/dist/{infer-psl-contract-BCPaLzjl-ByBJpE6R.mjs → infer-psl-contract-B_Bl_RJC-BfJbvDUs.mjs} +6 -6
- package/dist/{infer-psl-contract-BCPaLzjl-ByBJpE6R.mjs.map → infer-psl-contract-B_Bl_RJC-BfJbvDUs.mjs.map} +1 -1
- package/dist/{issue-planner-BLOtwO3z.d.mts → issue-planner-BiJDKtW5.d.mts} +10 -3
- package/dist/issue-planner-BiJDKtW5.d.mts.map +1 -0
- package/dist/migration-C9ZH26Nj.mjs.map +1 -1
- package/dist/{migration-CQeS0oqg.d.mts → migration-NJo7cPpB.d.mts} +6 -6
- package/dist/{migration-CQeS0oqg.d.mts.map → migration-NJo7cPpB.d.mts.map} +1 -1
- package/dist/{op-factory-call-DF9ijUbg-CSF8ZhJM.d.mts → op-factory-call-DkaMatJ4-D_7fWo-v.d.mts} +46 -87
- package/dist/op-factory-call-DkaMatJ4-D_7fWo-v.d.mts.map +1 -0
- package/dist/op-factory-call-LGCmMtZM.d.mts +1 -0
- package/dist/{op-factory-call-DiwaNQVO-NSekrcmI.mjs → op-factory-call-ltgiEZ8g-CX6WX57X.mjs} +163 -99
- package/dist/op-factory-call-ltgiEZ8g-CX6WX57X.mjs.map +1 -0
- package/dist/{planner-DCYVwcYk-vGUsjG3x.mjs → planner-Ccn9yxL7-B6Pgoz6c.mjs} +95 -18
- package/dist/planner-Ccn9yxL7-B6Pgoz6c.mjs.map +1 -0
- package/dist/{planner-C6vpC6nq.d.mts → planner-Xei8enE-.d.mts} +5 -4
- package/dist/planner-Xei8enE-.d.mts.map +1 -0
- package/dist/{planner-ddl-builders-Y0_96xpe-BzugdEDO.mjs → planner-ddl-builders-BcJ353Wj-Dfaixf4X.mjs} +6 -38
- package/dist/planner-ddl-builders-BcJ353Wj-Dfaixf4X.mjs.map +1 -0
- package/dist/{planner-identity-values-CRS2cQ6v-DakZeIQj.mjs → planner-identity-values-BZdomjRU-G521DabU.mjs} +3 -3
- package/dist/{planner-identity-values-CRS2cQ6v-DakZeIQj.mjs.map → planner-identity-values-BZdomjRU-G521DabU.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-BPk0jQUi-BFV5JJn1.mjs → planner-produced-postgres-migration-Brgj59VY-DOOLRWyy.mjs} +4 -4
- package/dist/{planner-produced-postgres-migration-BPk0jQUi-BFV5JJn1.mjs.map → planner-produced-postgres-migration-Brgj59VY-DOOLRWyy.mjs.map} +1 -1
- package/dist/planner-produced-postgres-migration-DgyIhdpw.d.mts +1 -0
- package/dist/{planner-produced-postgres-migration-CoLy4THO-CkCRWsv_.d.mts → planner-produced-postgres-migration-MoopN05f-CfmsQNwj.d.mts} +3 -3
- package/dist/planner-produced-postgres-migration-MoopN05f-CfmsQNwj.d.mts.map +1 -0
- package/dist/{planner-schema-lookup-kMIVP2y--CdO4VlnF.mjs → planner-schema-lookup-CdgWer9s.mjs} +2 -2
- package/dist/planner-schema-lookup-CdgWer9s.mjs.map +1 -0
- package/dist/{planner-sql-checks-CXDdt_9m.d.mts → planner-sql-checks-C54jJ5qt.d.mts} +16 -2
- package/dist/planner-sql-checks-C54jJ5qt.d.mts.map +1 -0
- package/dist/planner-sql-checks-CX37qDix-Gkq38UQQ.mjs +108 -0
- package/dist/planner-sql-checks-CX37qDix-Gkq38UQQ.mjs.map +1 -0
- package/dist/planner-target-details-CUEF0s90-COTks5yz.mjs +14 -0
- package/dist/planner-target-details-CUEF0s90-COTks5yz.mjs.map +1 -0
- package/dist/{postgres-codec-traits-BUygtI9N-CB-uwvY1.mjs → postgres-codec-traits-BV62PF0L-NuMNArAx.mjs} +3 -3
- package/dist/{postgres-codec-traits-BUygtI9N-CB-uwvY1.mjs.map → postgres-codec-traits-BV62PF0L-NuMNArAx.mjs.map} +1 -1
- package/dist/{postgres-contract-view-6xGfZyGS-C58Bint3.mjs → postgres-contract-view-3yxlqPfK-CRFLsRHu.mjs} +7 -7
- package/dist/{postgres-contract-view-6xGfZyGS-C58Bint3.mjs.map → postgres-contract-view-3yxlqPfK-CRFLsRHu.mjs.map} +1 -1
- package/dist/{postgres-migration-BSvGOQze-WEc_3gN0.mjs → postgres-migration-CLIfS2iQ-BgnVMLRT.mjs} +63 -20
- package/dist/postgres-migration-CLIfS2iQ-BgnVMLRT.mjs.map +1 -0
- package/dist/{postgres-migration-Dajq9YrO-_sZwyRnK.d.mts → postgres-migration-D5OiThXV-CihIARAE.d.mts} +27 -8
- package/dist/{postgres-migration-Dajq9YrO-_sZwyRnK.d.mts.map → postgres-migration-D5OiThXV-CihIARAE.d.mts.map} +1 -1
- package/dist/{postgres-schema-DIaAgaL6-Dmqzjbu5.mjs → postgres-schema-Ysxbqkzr-hFRwS-zT.mjs} +3 -3
- package/dist/{postgres-schema-DIaAgaL6-Dmqzjbu5.mjs.map → postgres-schema-Ysxbqkzr-hFRwS-zT.mjs.map} +1 -1
- package/dist/{prisma7-binding-DQlvZyAM.mjs → prisma7-binding-nxvUgQTH.mjs} +6 -6
- package/dist/{prisma7-binding-DQlvZyAM.mjs.map → prisma7-binding-nxvUgQTH.mjs.map} +1 -1
- package/dist/{render-ops-D1lOuFbE-d95NrYqF.mjs → render-ops-Cw9B6aq6-CMzRGNUZ.mjs} +3 -3
- package/dist/{render-ops-D1lOuFbE-d95NrYqF.mjs.map → render-ops-Cw9B6aq6-CMzRGNUZ.mjs.map} +1 -1
- package/dist/{resolve-ddl-schema-b746rtzf-Dydnc_gK.mjs → resolve-ddl-schema-BvsUhPsJ-CY5uEwIr.mjs} +3 -3
- package/dist/{resolve-ddl-schema-b746rtzf-Dydnc_gK.mjs.map → resolve-ddl-schema-BvsUhPsJ-CY5uEwIr.mjs.map} +1 -1
- package/dist/{sql-renderer-DT4IEOVi-CBE8uTub.mjs → sql-renderer-DT4IEOVi-CGCgCiTV.mjs} +3 -3
- package/dist/{sql-renderer-DT4IEOVi-CBE8uTub.mjs.map → sql-renderer-DT4IEOVi-CGCgCiTV.mjs.map} +1 -1
- package/dist/{sql-utils-CVsvXiX4-C7xD0Bgv.mjs → sql-utils-Df-nf6eM-Ov1KgjWm.mjs} +24 -3
- package/dist/{sql-utils-CVsvXiX4-C7xD0Bgv.mjs.map → sql-utils-Df-nf6eM-Ov1KgjWm.mjs.map} +1 -1
- package/dist/target.d.mts +13 -13
- package/dist/target.mjs +29 -29
- package/dist/target__codecs.mjs +2 -2
- package/dist/target__contract-free.mjs +3 -3
- package/dist/target__control.mjs +3 -3
- package/dist/target__data-transform.d.mts +2 -2
- package/dist/target__data-transform.mjs +1 -1
- package/dist/target__data-types.mjs +2 -2
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__errors.d.mts +1 -1
- package/dist/target__full-text-index-authoring.mjs +1 -1
- package/dist/target__issue-planner.d.mts +1 -1
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__migration.d.mts +3 -3
- package/dist/target__migration.mjs +3 -3
- package/dist/target__op-factory-call.d.mts +3 -3
- package/dist/target__op-factory-call.mjs +2 -2
- package/dist/target__pack.mjs +1 -1
- package/dist/target__planner-ddl-builders.mjs +1 -1
- package/dist/target__planner-identity-values.mjs +1 -1
- package/dist/target__planner-produced-postgres-migration.d.mts +2 -2
- package/dist/target__planner-produced-postgres-migration.mjs +1 -1
- package/dist/target__planner-schema-lookup.mjs +1 -1
- package/dist/target__planner-sql-checks.d.mts +2 -2
- package/dist/target__planner-sql-checks.mjs +2 -2
- package/dist/target__planner.d.mts +1 -1
- package/dist/target__planner.mjs +2 -2
- package/dist/target__prisma7-binding.mjs +1 -1
- package/dist/target__render-ops.mjs +1 -1
- package/dist/target__runtime.mjs +4 -4
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/target__schema-ir-annotations.mjs +1 -1
- package/dist/target__sql-utils.mjs +2 -2
- package/dist/target__types.mjs +2 -2
- package/package.json +9 -9
- package/dist/control-C5pTVhtN.mjs.map +0 -1
- package/dist/control-DJo3P3yL.mjs.map +0 -1
- package/dist/control-policy-C5VoaD11-lzAw5cjN.mjs.map +0 -1
- package/dist/data-transform-BSM7TQpE.d.mts +0 -1
- package/dist/data-transform-Bo32KRbq-BLn1_UG-.mjs.map +0 -1
- package/dist/data-transform-Ck5FbyNO-BNE7QlAo.d.mts.map +0 -1
- package/dist/issue-planner-BLOtwO3z.d.mts.map +0 -1
- package/dist/op-factory-call-CBqqbXBb.d.mts +0 -1
- package/dist/op-factory-call-DF9ijUbg-CSF8ZhJM.d.mts.map +0 -1
- package/dist/op-factory-call-DiwaNQVO-NSekrcmI.mjs.map +0 -1
- package/dist/planner-C6vpC6nq.d.mts.map +0 -1
- package/dist/planner-DCYVwcYk-vGUsjG3x.mjs.map +0 -1
- package/dist/planner-ddl-builders-Y0_96xpe-BzugdEDO.mjs.map +0 -1
- package/dist/planner-produced-postgres-migration-CoLy4THO-CkCRWsv_.d.mts.map +0 -1
- package/dist/planner-produced-postgres-migration-D7zijd5s.d.mts +0 -1
- package/dist/planner-schema-lookup-kMIVP2y--CdO4VlnF.mjs.map +0 -1
- package/dist/planner-sql-checks-Bt_KuSiH-CdGZDp7M.mjs +0 -46
- package/dist/planner-sql-checks-Bt_KuSiH-CdGZDp7M.mjs.map +0 -1
- package/dist/planner-sql-checks-CXDdt_9m.d.mts.map +0 -1
- package/dist/postgres-migration-BSvGOQze-WEc_3gN0.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-Ccn9yxL7-B6Pgoz6c.mjs","names":["#lowerer"],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-Ccn9yxL7.mjs"],"sourcesContent":["import { i as quoteIdentifier } from \"./sql-utils-Df-nf6eM.mjs\";\nimport { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { _ as PostgresRlsPolicy, r as isPostgresSchema } from \"./postgres-schema-Ysxbqkzr.mjs\";\nimport { t as PostgresTableSchemaNode } from \"./postgres-table-schema-node-BBkitBQh.mjs\";\nimport { i as PostgresDatabaseSchemaNode, n as PostgresPolicySchemaNode, r as PostgresNamespaceSchemaNode } from \"./postgres-role-schema-node-B8Z5i5D-.mjs\";\nimport { t as resolveDdlSchemaForNamespaceStorage } from \"./resolve-ddl-schema-BvsUhPsJ.mjs\";\nimport { t as buildPostgresPlanDiff } from \"./diff-database-schema-BV6Px0Gg.mjs\";\nimport { a as resolvePostgresNodeIssueCreationFactoryName, c as issueNode, d as postgresPlannerStrategies, f as postgresNodeStorageCoordinate, i as resolvePostgresNodeIssueControlPolicySubject, l as issueSchemaName, n as resolveNamespaceIdForDdlSchema, o as coalesceSubtreeIssues, r as resolvePostgresCallControlPolicySubject, s as conflictForDisallowedCall, t as renderPostgresSuppression, u as planIssues } from \"./control-policy-DXaIsgUW.mjs\";\nimport { A as RenameConstraintCall, C as DropNativeEnumTypeCall, E as DropTableCall, M as RenamePostgresRlsPolicyCall, O as RawSqlCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, l as AlterColumnTypeCall, p as CreatePostgresRlsPolicyCall, r as AddColumnWithTemporaryDefaultCall, t as AddCheckConstraintCall, v as DropCheckConstraintCall, y as DropColumnCall } from \"./op-factory-call-ltgiEZ8g.mjs\";\nimport { n as defaultPrimaryKeyName, r as defaultUniqueName, t as defaultForeignKeyName } from \"./default-constraint-names-CtcRXhV8.mjs\";\nimport { a as renameTableByHandStatements, c as postgresSchemaTables, d as postgresContractToSchema, i as postgresTableRenameCall, l as pairCheckRenames, n as postgresColumnRenameCall, o as renderRenameTableCall, r as postgresTableRenameByHand, s as createWorkingSchema, u as pairIndexRenames } from \"./postgres-migration-CLIfS2iQ.mjs\";\nimport { t as TypeScriptRenderablePostgresMigration } from \"./planner-produced-postgres-migration-Brgj59VY.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { isRenameStatement, issueOutcome } from \"@internal/framework-components/control\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { appliedStatementsInOrder, backfillOfDefaultedField, controlPolicyForCall, detectTableNameCaseChanges, extractCodecControlHooks, fieldEventStorage, fieldStatementColumns, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventCalls, planStatements, plannerFailure, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, unknownCallNames } from \"@internal/family-sql/control\";\nimport { namingOf, parseWireName } from \"@internal/sql-schema-ir/naming\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { ok } from \"@internal/utils/result\";\n//#region src/core/migrations/constraint-name-renames.ts\n/** The constraint of `nextNodes` the diff pairs with `node` and finds unchanged. */\nfunction unchangedIn(node, nextNodes) {\n\treturn nextNodes.find((next) => next.id === node.id && next.isEqualTo(node));\n}\n/**\n* The renames of the primary key, unique constraints and foreign keys of one table that the end tree keeps otherwise unchanged but names differently. A constraint's name is its stated name, or the one the planner derives from its table; a start tree read from the database states every name. A constraint whose start and end names differ is renamed to the end name. The diff never compares constraint names, so without these the database keeps the old name. A database may already have the new name, as when Prisma 7 created it and the contract only now states it; the rename's postcheck then holds before it runs, and the runner skips it.\n*/\nfunction constraintNameRenames(input) {\n\tconst { schemaName, from, to, previous, next } = input;\n\tconst rename = (kind, oldName, unchanged, derivedName) => {\n\t\tif (unchanged === void 0) return [];\n\t\tconst newName = unchanged.name ?? derivedName;\n\t\treturn oldName === newName ? [] : [new RenameConstraintCall(schemaName, to, kind, oldName, newName)];\n\t};\n\tconst primaryKey = previous.primaryKey === void 0 ? [] : rename(\"primaryKey\", previous.primaryKey.name ?? defaultPrimaryKeyName(from), unchangedIn(previous.primaryKey, next.primaryKey === void 0 ? [] : [next.primaryKey]), defaultPrimaryKeyName(to));\n\tconst uniques = previous.uniques.flatMap((unique) => rename(\"unique\", unique.name ?? defaultUniqueName(from, unique.columns), unchangedIn(unique, next.uniques), defaultUniqueName(to, unique.columns)));\n\tconst foreignKeys = previous.foreignKeys.flatMap((fk) => rename(\"foreignKey\", fk.name ?? defaultForeignKeyName(from, fk.columns), unchangedIn(fk, next.foreignKeys), defaultForeignKeyName(to, fk.columns)));\n\treturn [\n\t\t...primaryKey,\n\t\t...uniques,\n\t\t...foreignKeys\n\t];\n}\n/**\n* The constraint renames of a plan: {@link constraintNameRenames} for every table the start tree and the end contract both have, with the start tree as the plan's rename statements left it. The start tree comes from the start contract for `migration plan` and from the database for `db update`, so a database Prisma 8 created under derived names is renamed too once the contract states other names.\n*/\nfunction plannedConstraintNameRenames(options) {\n\tif (!options.policy.allowedOperationClasses.includes(\"widening\")) return [];\n\tPostgresDatabaseSchemaNode.assert(options.schema);\n\tconst startTablesBySchema = new Map(Object.values(options.schema.namespaces).map((namespace) => [namespace.schemaName, namespace.tables]));\n\tconst contract = options.contract;\n\tconst end = postgresContractToSchema(contract, options.frameworkComponents);\n\treturn Object.values(end.namespaces).flatMap((namespace) => {\n\t\tconst startTables = startTablesBySchema.get(namespace.schemaName) ?? {};\n\t\tconst schemaName = resolveNamespaceIdForDdlSchema(contract, namespace.schemaName) === UNBOUND_NAMESPACE_ID ? UNBOUND_NAMESPACE_ID : namespace.schemaName;\n\t\treturn Object.entries(namespace.tables).flatMap(([tableName, next]) => {\n\t\t\tconst previous = startTables[tableName];\n\t\t\treturn previous === void 0 ? [] : constraintNameRenames({\n\t\t\t\tschemaName,\n\t\t\t\tfrom: tableName,\n\t\t\t\tto: tableName,\n\t\t\t\tprevious,\n\t\t\t\tnext\n\t\t\t});\n\t\t});\n\t});\n}\n//#endregion\n//#region src/core/migrations/operation-subjects.ts\nfunction storageNamespaceId(locator, schemaName) {\n\treturn schemaName === UNBOUND_NAMESPACE_ID ? UNBOUND_NAMESPACE_ID : resolveNamespaceIdForDdlSchema(locator.contract, schemaName);\n}\nfunction qualified(schemaName, name) {\n\treturn schemaName === UNBOUND_NAMESPACE_ID ? name : `${schemaName}.${name}`;\n}\nfunction target(locator, schemaName, table, column) {\n\treturn {\n\t\tstorageName: qualified(schemaName, column === void 0 ? table : `${table}.${column}`),\n\t\ttable: {\n\t\t\tnamespaceId: storageNamespaceId(locator, schemaName),\n\t\t\ttable,\n\t\t\tcolumn\n\t\t}\n\t};\n}\nfunction rawSqlTarget(locator, call) {\n\tconst details = call.op.target.details;\n\tif (details === void 0) return {\n\t\tstorageName: call.op.id,\n\t\ttable: void 0\n\t};\n\tif (details.objectType === \"table\") return target(locator, details.schema, details.name, void 0);\n\tif (details.objectType === \"column\" && details.table !== void 0) return target(locator, details.schema, details.table, details.name);\n\treturn {\n\t\tstorageName: storageNameOfOperation(call.op),\n\t\ttable: void 0\n\t};\n}\nfunction knownTarget(locator, call) {\n\tif (call instanceof DropTableCall) return target(locator, call.schemaName, call.tableName, void 0);\n\tif (call instanceof DropColumnCall || call instanceof AlterColumnTypeCall) return target(locator, call.schemaName, call.tableName, call.columnName);\n\tif (call instanceof RawSqlCall) return rawSqlTarget(locator, call);\n\tconst fieldEvent = locator.fieldEvents.get(call);\n\treturn fieldEvent === void 0 ? void 0 : fieldEventStorage(fieldEvent);\n}\n/**\n* A policy's identity across a replacement: its name, or the prefix of a generated (wire) name,\n* whose hash changes with the policy's body.\n*/\nfunction policyKey(schemaName, tableName, policyName) {\n\treturn JSON.stringify([\n\t\tschemaName,\n\t\ttableName,\n\t\tparseWireName(policyName)?.prefix ?? policyName\n\t]);\n}\n/**\n* The policies the plan creates. A drop of one of them, by name or by generated-name prefix, is\n* half of a replacement, which leaves a policy in place, so it widens no access.\n*/\nfunction createdPolicies(calls) {\n\treturn new Set(calls.flatMap((call) => call instanceof CreatePostgresRlsPolicyCall ? [policyKey(call.schemaName, call.tableName, call.policy.name)] : []));\n}\nfunction accessWideningOf(locator, call, replaced) {\n\tif (call instanceof DisableRowLevelSecurityCall) return [{\n\t\t...target(locator, call.schemaName, call.tableName, void 0),\n\t\twidens: true\n\t}];\n\tif (call instanceof DropPostgresRlsPolicyCall && !replaced.has(policyKey(call.schemaName, call.tableName, call.policyName))) return [{\n\t\t...target(locator, call.schemaName, call.tableName, void 0),\n\t\twidens: false\n\t}];\n\treturn [];\n}\nfunction operationCountOf(call) {\n\treturn \"companions\" in call && Array.isArray(call.companions) ? 1 + call.companions.length : 1;\n}\n/** What each call of a Postgres plan loses, and whose access it widens. */\nfunction postgresCallSubjects(calls, locator) {\n\tconst replaced = createdPolicies(calls);\n\tconst destructive = calls.filter((call) => call.operationClass === \"destructive\");\n\tconst known = new Map(destructive.map((call) => [call, knownTarget(locator, call)]));\n\tconst unknownNames = unknownCallNames(destructive.filter((call) => known.get(call) === void 0));\n\treturn calls.map((call) => {\n\t\tconst lossTarget = known.get(call);\n\t\tconst unknownName = unknownNames.get(call);\n\t\tconst loss = call instanceof AlterColumnTypeCall ? \"typeChange\" : \"drop\";\n\t\treturn {\n\t\t\toperationCount: operationCountOf(call),\n\t\t\tlabel: call.label,\n\t\t\tdataLoss: lossTarget !== void 0 ? [{\n\t\t\t\t...lossTarget,\n\t\t\t\tloss\n\t\t\t}] : unknownName !== void 0 ? [{\n\t\t\t\tstorageName: unknownName,\n\t\t\t\ttable: void 0,\n\t\t\t\tloss\n\t\t\t}] : [],\n\t\t\taccessWidening: accessWideningOf(locator, call, replaced),\n\t\t\ttemporaryValues: call instanceof AddColumnWithTemporaryDefaultCall ? [{\n\t\t\t\ttable: call.tableName,\n\t\t\t\tcolumn: call.columnName,\n\t\t\t\tvalue: call.temporaryDefault\n\t\t\t}] : []\n\t\t};\n\t});\n}\n//#endregion\n//#region src/core/migrations/type-change-checks.ts\nfunction tableIn(tree, ddlSchemaName, tableName) {\n\treturn Object.values(tree.namespaces).find((node) => node.schemaName === ddlSchemaName)?.tables[tableName];\n}\nfunction escapedForPattern(text) {\n\treturn text.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n/**\n* Whether a check's predicate names the column, quoted or bare. The predicate is opaque SQL, so this\n* reads its text, and may name a check that does not depend on the column: dropping and adding\n* such a check again changes nothing.\n*/\nfunction mentionsColumn(check, column) {\n\tconst quoted = escapedForPattern(quoteIdentifier(column));\n\tconst bare = escapedForPattern(column);\n\treturn new RegExp(`${quoted}|(?<![\\\\w$\"])${bare}(?![\\\\w$\"])`, \"i\").test(check.expression);\n}\n/**\n* Puts a drop of each check that names a column a type change alters before the first such type\n* change, and the check back after the last. Postgres stores a check bound to the column's old type,\n* such as `array_position(tags, NULL::integer)`, and re-checks it while it alters the type, so a\n* check left in place can fail the alter; a check that names two retyped columns can only be added\n* back once both have their new types. Only checks the plan keeps unchanged are moved: one the plan\n* drops or adds is already planned around the alter. The check is added back as the destination\n* contract writes it.\n*/\nfunction withChecksAroundTypeChanges(input) {\n\tconst moved = /* @__PURE__ */ new Map();\n\tinput.calls.forEach((call, index) => {\n\t\tif (!(call instanceof AlterColumnTypeCall)) return;\n\t\tconst ddlSchemaName = input.ddlSchemaOf(call.schemaName);\n\t\tconst kept = tableIn(input.actual, ddlSchemaName, call.tableName)?.checks ?? [];\n\t\tfor (const check of tableIn(input.expected, ddlSchemaName, call.tableName)?.checks ?? []) {\n\t\t\tif (!mentionsColumn(check, call.columnName)) continue;\n\t\t\tif (!kept.some(({ name }) => name === check.name)) continue;\n\t\t\tconst key = JSON.stringify([\n\t\t\t\tddlSchemaName,\n\t\t\t\tcall.tableName,\n\t\t\t\tcheck.name\n\t\t\t]);\n\t\t\tconst entry = moved.get(key);\n\t\t\tif (entry === void 0) moved.set(key, {\n\t\t\t\tschemaName: call.schemaName,\n\t\t\t\ttableName: call.tableName,\n\t\t\t\tcheck,\n\t\t\t\tfirst: index,\n\t\t\t\tlast: index\n\t\t\t});\n\t\t\telse entry.last = index;\n\t\t}\n\t});\n\tconst entries = [...moved.values()];\n\treturn input.calls.flatMap((call, index) => [\n\t\t...entries.filter(({ first }) => first === index).map(({ schemaName, tableName, check }) => new DropCheckConstraintCall(schemaName, tableName, check.name)),\n\t\tcall,\n\t\t...entries.filter(({ last }) => last === index).map(({ schemaName, tableName, check }) => new AddCheckConstraintCall(schemaName, tableName, check.name, check.expression))\n\t]);\n}\n//#endregion\n//#region src/core/migrations/verify-postgres-namespaces.ts\n/**\n* Resolves the live-database schema name for a given namespace\n* coordinate. Mirrors `resolveDdlSchemaForNamespace` in\n* `planner-strategies.ts` so the verifier's projection and the\n* planner's projection always agree — Postgres-aware namespaces (the\n* production path) dispatch to `ddlSchemaName(storage)`, and bare\n* object payloads (used by some tests) fall back to the coordinate\n* itself.\n*/\nfunction resolveDdlSchemaName(storage, namespaceId) {\n\tconst namespace = storage.namespaces[namespaceId];\n\tif (isPostgresSchema(namespace)) return namespace.ddlSchemaName(storage);\n\treturn namespaceId;\n}\n/**\n* Reads the introspected list of schema names from the database-root schema\n* node. `existingSchemas` is database-level, so it lives on the\n* `PostgresDatabaseSchemaNode` root — not on the per-schema namespace nodes.\n*\n* Defaults to the always-present `public` schema when the node is not the\n* database root — a fresh Postgres database always carries `public` (unless an\n* operator dropped it manually), so any verifier path that runs without an\n* enriched introspection still suppresses the redundant `CREATE SCHEMA\n* \"public\"`.\n*\n* Production introspection (`PostgresControlAdapter.introspect`) is the\n* authoritative source: it queries `pg_namespace` and sets `existingSchemas`\n* on the returned root. Tests that want to assert against a richer initial\n* state construct a `PostgresDatabaseSchemaNode` explicitly.\n*/\nfunction existingSchemasFromSchema(schema) {\n\tif (PostgresDatabaseSchemaNode.is(schema)) return schema.existingSchemas;\n\treturn [DEFAULT_NAMESPACE_ID];\n}\n/**\n* Emits a `postgres-namespace` `not-found` diff issue for every\n* contract-declared Postgres namespace whose live container does not yet\n* exist. The planner prepends these (node-typed, synthesized) to the\n* relational diff issues so a multi-schema plan emits `CREATE SCHEMA`\n* before the tables that need it — a planner-only concern (verify already\n* rejects via the `not-found` table issues a missing schema already\n* produces), so this is not part of the shared diff.\n*\n* A namespace's live container is the schema returned by its\n* polymorphic `ddlSchemaName(storage)` method — named schemas resolve\n* to their own id; the unbound singleton returns `UNBOUND_NAMESPACE_ID`\n* and is skipped explicitly (late-bound namespaces have no fixed DDL\n* schema). Issues are emitted only when the resolved name is a real,\n* creatable schema (not the unbound sentinel) and is missing from the\n* introspected list. `public` is suppressed implicitly because the\n* introspection (or its sensible default) always carries it.\n*\n* Each emitted issue's path is `['database', ddlName]` — an ancestor of\n* every table path under that schema, so it must never be run through\n* `coalesceSubtreeIssues` alongside the table diff (it would swallow the\n* table-level `not-found` issues that drive `CREATE TABLE`); the planner\n* adds these AFTER coalescing the relational issues, and they are not\n* subject to sibling-space ownership scoping (mirrors the retired\n* coordinate walk, which prepended namespace issues after that filter).\n*/\nfunction verifyPostgresNamespacePresence(input) {\n\tconst { contract, schema } = input;\n\tconst existing = new Set(existingSchemasFromSchema(schema));\n\tconst issues = [];\n\tconst namespaceIds = Object.keys(contract.storage.namespaces).sort();\n\tfor (const namespaceId of namespaceIds) {\n\t\tif (namespaceId === UNBOUND_NAMESPACE_ID) continue;\n\t\tconst ddlName = resolveDdlSchemaName(contract.storage, namespaceId);\n\t\tif (ddlName === UNBOUND_NAMESPACE_ID) continue;\n\t\tif (existing.has(ddlName)) continue;\n\t\tconst namespace = new PostgresNamespaceSchemaNode({\n\t\t\tschemaName: ddlName,\n\t\t\ttables: {}\n\t\t});\n\t\tissues.push({\n\t\t\tpath: [\"database\", ddlName],\n\t\t\texpected: namespace\n\t\t});\n\t}\n\treturn issues;\n}\n//#endregion\n//#region src/core/migrations/planner.ts\nfunction partitionPostgresCallsByControlPolicy(calls, contract) {\n\treturn partitionCallsByControlPolicy({\n\t\tcalls,\n\t\tcontract,\n\t\tresolveControlPolicySubject: (call) => resolvePostgresCallControlPolicySubject(call, contract),\n\t\tresolveFactoryName: (call) => call.factoryName\n\t});\n}\nfunction createPostgresMigrationPlanner(lowerer) {\n\treturn new PostgresMigrationPlanner(lowerer);\n}\n/**\n* Postgres migration planner — a thin wrapper over `planIssues`.\n*\n* `plan()` diffs the target contract against the live schema via the one\n* differ (`buildPostgresPlanDiff`, producing node-typed `SchemaDiffIssue[]`)\n* and delegates to `planIssues` with the unified `postgresPlannerStrategies`\n* list: NOT-NULL backfill, type-change, nullable-tightening, codec-hook\n* storage types, component-declared dependency installs, and\n* shared-temp-default / empty-table-guarded NOT-NULL add-column. The same\n* strategy list runs for `migration plan`, `db update`, and `db init`;\n* behavior diverges purely on `policy.allowedOperationClasses` (the\n* data-safe strategies short-circuit when `'data'` is excluded). The issue\n* planner applies operation-class policy gates and emits a single\n* `PostgresOpFactoryCall[]` that drives both the runtime-ops view (via\n* `renderOps`) and the `renderTypeScript()` authoring surface. RLS policy\n* drift (the structural half of the same one-differ tree) is handled\n* separately via `planPostgresSchemaDiff`.\n*/\nvar PostgresMigrationPlanner = class {\n\t#lowerer;\n\tconstructor(lowerer) {\n\t\tthis.#lowerer = lowerer;\n\t}\n\tplan(options) {\n\t\treturn this.planSql(blindCast(options));\n\t}\n\temptyMigration(context, spaceId) {\n\t\treturn new TypeScriptRenderablePostgresMigration([], {\n\t\t\tfrom: context.fromHash,\n\t\t\tto: context.toHash\n\t\t}, spaceId, context.snapshotsImportPath, this.#lowerer);\n\t}\n\tplanSql(options) {\n\t\tconst schemaName = options.schemaName ?? Object.keys(options.contract.storage.namespaces).find((id) => id !== UNBOUND_NAMESPACE_ID) ?? UNBOUND_NAMESPACE_ID;\n\t\tconst policyResult = this.ensureAdditivePolicy(options.policy);\n\t\tif (policyResult) return policyResult;\n\t\tPostgresDatabaseSchemaNode.assert(options.schema);\n\t\tconst statements = this.planStatements(options, options.schema);\n\t\tif (!statements.ok) return plannerFailure([statements.failure]);\n\t\tconst { schema } = statements.value;\n\t\tconst { issues: rawIssues, expected: expectedSchema } = buildPostgresPlanDiff({\n\t\t\tcontract: options.contract,\n\t\t\tactualSchema: schema,\n\t\t\tframeworkComponents: options.frameworkComponents\n\t\t});\n\t\tconst policyDiffIssues = rawIssues.filter((issue) => isPolicyDiffIssue(issue));\n\t\tconst relationalDiffIssues = rawIssues.filter((issue) => !isPolicyDiffIssue(issue));\n\t\tconst strict = options.policy.allowedOperationClasses.includes(\"widening\") || options.policy.allowedOperationClasses.includes(\"destructive\");\n\t\tconst owned = retainUnownedExtras(coalesceSubtreeIssues(relationalDiffIssues), options.ownership, options.contract);\n\t\tconst gated = strict ? owned : owned.filter((issue) => issueOutcome(issue) !== \"not-expected\");\n\t\tconst schemaIssues = [...verifyPostgresNamespacePresence({\n\t\t\tcontract: options.contract,\n\t\t\tschema\n\t\t}), ...gated];\n\t\tconst indexRenames = pairIndexRenames(options, schemaIssues);\n\t\tconst checkRenames = pairCheckRenames(options, schemaIssues);\n\t\tconst renameConsumed = /* @__PURE__ */ new Set([...indexRenames.consumed, ...checkRenames.consumed]);\n\t\tconst plannableIssues = renameConsumed.size === 0 ? schemaIssues : schemaIssues.filter((issue) => !renameConsumed.has(issue));\n\t\tconst codecHooks = extractCodecControlHooks(options.frameworkComponents);\n\t\tconst types = sqlTypeLookupsOf(options.frameworkComponents);\n\t\tconst storageTypes = options.contract.storage.types ?? {};\n\t\tconst relationalSchema = relationalNamespaceNode(schema, schemaName);\n\t\tconst issuePartition = partitionIssuesByControlPolicy({\n\t\t\tissues: plannableIssues,\n\t\t\tcontract: options.contract,\n\t\t\tresolveControlPolicySubject: (issue) => resolvePostgresNodeIssueControlPolicySubject(issue, options.contract),\n\t\t\tresolveCreationFactoryName: resolvePostgresNodeIssueCreationFactoryName\n\t\t});\n\t\tconst caseChangeConflicts = detectTableNameCaseChanges({\n\t\t\tissues: issuePartition.plannable,\n\t\t\ttableOf: (issue) => {\n\t\t\t\tconst node = issueNode(issue);\n\t\t\t\treturn node !== void 0 && PostgresTableSchemaNode.is(node) ? node : void 0;\n\t\t\t},\n\t\t\tnamespaceIdOf: (issue) => resolveNamespaceIdForDdlSchema(options.contract, issueSchemaName(issue) ?? schemaName),\n\t\t\trenameByHandStatements: (rename) => renameTableByHandStatements(options.contract, rename),\n\t\t\trenameTableCall: renderRenameTableCall,\n\t\t\tcontract: options.contract,\n\t\t\tdefaultNamespaceId: DEFAULT_NAMESPACE_ID\n\t\t});\n\t\tif (caseChangeConflicts.length > 0) return plannerFailure(caseChangeConflicts);\n\t\tconst defaultedBackfill = backfillOfDefaultedField(options.statements, options.fromContract, options.contract);\n\t\tif (defaultedBackfill !== void 0) return plannerFailure([defaultedBackfill]);\n\t\tconst result = planIssues({\n\t\t\tissues: issuePartition.plannable,\n\t\t\ttoContract: options.contract,\n\t\t\tfromContract: options.fromContract,\n\t\t\tschemaName,\n\t\t\tcodecHooks,\n\t\t\ttypes,\n\t\t\tstorageTypes,\n\t\t\t...ifDefined(\"schema\", relationalSchema),\n\t\t\tpolicy: options.policy,\n\t\t\tframeworkComponents: options.frameworkComponents,\n\t\t\tstatementColumns: fieldStatementColumns(options.statements, options.contract),\n\t\t\tstrategies: postgresPlannerStrategies\n\t\t});\n\t\tconst schemaDiff = this.planPostgresSchemaDiff(options, policyDiffIssues);\n\t\tif (!result.ok || schemaDiff.conflicts.length > 0) return plannerFailure([...result.ok ? [] : result.failure, ...schemaDiff.conflicts]);\n\t\tconst renamePartition = partitionPostgresCallsByControlPolicy([\n\t\t\t...indexRenames.calls,\n\t\t\t...checkRenames.calls,\n\t\t\t...plannedConstraintNameRenames({\n\t\t\t\t...options,\n\t\t\t\tschema\n\t\t\t})\n\t\t], options.contract);\n\t\tconst schemaDiffPartition = partitionPostgresCallsByControlPolicy(schemaDiff.calls, options.contract);\n\t\tconst fieldEventCalls = planFieldEventCalls({\n\t\t\tpriorContract: options.origin === null ? null : options.fromContract,\n\t\t\tnewContract: options.contract,\n\t\t\tcodecHooks,\n\t\t\ttableRenames: statements.value.tableRenames,\n\t\t\tcolumnRenames: statements.value.columnRenames\n\t\t});\n\t\tconst fieldEventPartition = partitionPostgresCallsByControlPolicy(blindCast(fieldEventCalls.map(({ call }) => call)), options.contract);\n\t\tconst ordered = movePolicyDropsBeforeBlockedDdl(withChecksAroundTypeChanges({\n\t\t\tcalls: result.value.calls,\n\t\t\texpected: expectedSchema,\n\t\t\tactual: schema,\n\t\t\tddlSchemaOf: (name) => name === UNBOUND_NAMESPACE_ID ? resolveDdlSchemaForNamespaceStorage(options.contract.storage, UNBOUND_NAMESPACE_ID) : name\n\t\t}), schemaDiffPartition.kept);\n\t\tconst calls = [\n\t\t\t...statements.value.calls,\n\t\t\t...ordered.structural,\n\t\t\t...renamePartition.kept,\n\t\t\t...ordered.policyCalls,\n\t\t\t...fieldEventPartition.kept\n\t\t];\n\t\tconst seenWarnings = /* @__PURE__ */ new Set();\n\t\tconst warnings = [\n\t\t\t...issuePartition.suppressions,\n\t\t\t...renamePartition.suppressions,\n\t\t\t...schemaDiff.suppressions,\n\t\t\t...schemaDiffPartition.suppressions,\n\t\t\t...fieldEventPartition.suppressions\n\t\t].map((record) => renderPostgresSuppression(record, options.contract)).filter((warning) => {\n\t\t\tconst key = JSON.stringify(warning);\n\t\t\tif (seenWarnings.has(key)) return false;\n\t\t\tseenWarnings.add(key);\n\t\t\treturn true;\n\t\t});\n\t\treturn Object.freeze({\n\t\t\tkind: \"success\",\n\t\t\tplan: new TypeScriptRenderablePostgresMigration(calls, {\n\t\t\t\tfrom: options.origin?.storageHash ?? null,\n\t\t\t\tto: options.contract.storage.storageHash\n\t\t\t}, options.spaceId, options.snapshotsImportPath, this.#lowerer),\n\t\t\tappliedStatements: appliedStatementsInOrder(options.statements, statements.value.appliedStatements),\n\t\t\t...subjectsOfCalls(postgresCallSubjects(calls, {\n\t\t\t\tcontract: options.fromContract ?? options.contract,\n\t\t\t\tfieldEvents: new Map(fieldEventCalls.map((fieldEvent) => [fieldEvent.call, fieldEvent]))\n\t\t\t}), {\n\t\t\t\tfromContract: options.fromContract,\n\t\t\t\tcontract: options.contract,\n\t\t\t\tstatements: options.statements,\n\t\t\t\tbyHand: postgresTableRenameByHand(options.contract)\n\t\t\t}),\n\t\t\t...warnings.length > 0 ? { warnings: Object.freeze(warnings) } : {}\n\t\t});\n\t}\n\t/**\n\t* Maps the RLS policy findings of the one combined tree diff\n\t* (`buildPostgresPlanDiff`, already ownership-filtered) into\n\t* `CREATE POLICY` / `DROP POLICY` / `ALTER POLICY … RENAME TO` ops — a\n\t* `not-equal` finding (an exact-named policy whose content drifted)\n\t* becomes drop + create, or a disallowed-call conflict when the policy\n\t* forbids the drop, which is `widening`. It\n\t* does not re-diff — it consumes exactly the policy-node subset of the\n\t* shared diff's issues. Enablement is NOT decided here: `ENABLE`/`DISABLE\n\t* ROW LEVEL SECURITY` derive from the table's marker-driven `rlsEnabled`\n\t* attribute diff on the relational side.\n\t*\n\t* Rename post-pass (the index pass's structure): hash pairing pairs a\n\t* `not-found` and a `not-expected` policy on the SAME table whose\n\t* wire-name content hashes match but prefixes differ (prefix-only rename);\n\t* content pairing then pairs remaining wire-named-missing policies against remaining\n\t* extras of any name shape by verbatim content (the node-owned `contentEquals` —\n\t* exact→wire adoption). Multi-candidate groups pair deterministically\n\t* by sorted name; leftovers proceed as create/drop; an exact-named\n\t* missing policy never content-pairs.\n\t*\n\t* The pairing runs only when the policy allows `widening` (rename's\n\t* class). Without it (db-init's additive-only set), pairing degrades\n\t* deliberately to the additive half: the new name is CREATEd and the old\n\t* policy survives live until a plan that allows `widening` runs —\n\t* emitting an ungated widening rename would only fail at the runner's\n\t* class re-enforcement.\n\t*/\n\tplanPostgresSchemaDiff(options, filteredDiffIssues) {\n\t\tconst allowsWidening = options.policy.allowedOperationClasses.includes(\"widening\");\n\t\tconst missing = [];\n\t\tconst extra = [];\n\t\tconst changed = [];\n\t\tfor (const issue of filteredDiffIssues) if (issueOutcome(issue) === \"not-equal\") {\n\t\t\tconst expected = issue.expected;\n\t\t\tPostgresPolicySchemaNode.assert(expected);\n\t\t\tchanged.push({\n\t\t\t\tnode: expected,\n\t\t\t\tschemaForTable: resolveDdlSchemaForNamespaceStorage(options.contract.storage, expected.namespaceId)\n\t\t\t});\n\t\t} else if (issueOutcome(issue) === \"not-found\") {\n\t\t\tconst expected = issue.expected;\n\t\t\tPostgresPolicySchemaNode.assert(expected);\n\t\t\tmissing.push({\n\t\t\t\tnode: expected,\n\t\t\t\tschemaForTable: resolveDdlSchemaForNamespaceStorage(options.contract.storage, expected.namespaceId)\n\t\t\t});\n\t\t} else if (issueOutcome(issue) === \"not-expected\") {\n\t\t\tconst actual = issue.actual;\n\t\t\tPostgresPolicySchemaNode.assert(actual);\n\t\t\textra.push({\n\t\t\t\tnode: actual,\n\t\t\t\tschemaForTable: resolveDdlSchemaForNamespaceStorage(options.contract.storage, actual.namespaceId)\n\t\t\t});\n\t\t}\n\t\tconst calls = [];\n\t\tconst conflicts = [];\n\t\tconst suppressions = [];\n\t\tconst renamedExtras = /* @__PURE__ */ new Set();\n\t\tconst renamedMissing = /* @__PURE__ */ new Set();\n\t\tconst pairingKey = (finding, hash) => JSON.stringify([\n\t\t\tfinding.schemaForTable,\n\t\t\tfinding.node.tableName,\n\t\t\thash\n\t\t]);\n\t\tif (allowsWidening) {\n\t\t\tconst extrasByGroup = /* @__PURE__ */ new Map();\n\t\t\tfor (const finding of extra) {\n\t\t\t\tconst parsed = parseWireName(finding.node.name);\n\t\t\t\tif (parsed === void 0) continue;\n\t\t\t\tconst key = pairingKey(finding, parsed.hash);\n\t\t\t\tconst group = extrasByGroup.get(key) ?? [];\n\t\t\t\tgroup.push(finding);\n\t\t\t\textrasByGroup.set(key, group);\n\t\t\t}\n\t\t\tfor (const group of extrasByGroup.values()) group.sort((a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0);\n\t\t\tconst sortedMissing = [...missing].sort((a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0);\n\t\t\tfor (const missingFinding of sortedMissing) {\n\t\t\t\tconst parsed = parseWireName(missingFinding.node.name);\n\t\t\t\tif (parsed === void 0) continue;\n\t\t\t\tconst candidate = extrasByGroup.get(pairingKey(missingFinding, parsed.hash))?.shift();\n\t\t\t\tif (candidate === void 0) continue;\n\t\t\t\trenamedExtras.add(candidate);\n\t\t\t\trenamedMissing.add(missingFinding);\n\t\t\t\tcalls.push(new RenamePostgresRlsPolicyCall(missingFinding.schemaForTable, missingFinding.node.tableName, candidate.node.name, missingFinding.node.name));\n\t\t\t}\n\t\t\tconst sortedExtras = [...extra].sort((a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0);\n\t\t\tfor (const missingFinding of sortedMissing) {\n\t\t\t\tif (renamedMissing.has(missingFinding)) continue;\n\t\t\t\tif (missingFinding.node.prefix === void 0) continue;\n\t\t\t\tconst candidate = sortedExtras.find((extraFinding) => !renamedExtras.has(extraFinding) && extraFinding.schemaForTable === missingFinding.schemaForTable && extraFinding.node.tableName === missingFinding.node.tableName && missingFinding.node.contentEquals(extraFinding.node));\n\t\t\t\tif (candidate === void 0) continue;\n\t\t\t\trenamedExtras.add(candidate);\n\t\t\t\trenamedMissing.add(missingFinding);\n\t\t\t\tcalls.push(new RenamePostgresRlsPolicyCall(missingFinding.schemaForTable, missingFinding.node.tableName, candidate.node.name, missingFinding.node.name));\n\t\t\t}\n\t\t}\n\t\tfor (const finding of changed) {\n\t\t\tconst replacement = {\n\t\t\t\tdrop: new DropPostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, finding.node.name),\n\t\t\t\tcreate: new CreatePostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, policyNodeToContractPolicy(finding.node))\n\t\t\t};\n\t\t\tconst graded = gradePolicyReplacement(replacement, options.contract, options.policy.allowedOperationClasses);\n\t\t\tif (graded.disposition === \"suppress\") {\n\t\t\t\tsuppressions.push(graded.record);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (graded.disposition === \"conflict\") {\n\t\t\t\tconflicts.push(graded.conflict);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tcalls.push(replacement.drop);\n\t\t\tcalls.push(replacement.create);\n\t\t}\n\t\tfor (const finding of missing) {\n\t\t\tif (renamedMissing.has(finding)) continue;\n\t\t\tcalls.push(new CreatePostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, policyNodeToContractPolicy(finding.node)));\n\t\t}\n\t\tif (allowsWidening) for (const finding of extra) {\n\t\t\tif (renamedExtras.has(finding)) continue;\n\t\t\tcalls.push(new DropPostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, finding.node.name));\n\t\t}\n\t\treturn {\n\t\t\tcalls,\n\t\t\tconflicts,\n\t\t\tsuppressions\n\t\t};\n\t}\n\t/**\n\t* Plans the statements against a working copy of `schema`, in order, so each rename's companions\n\t* are computed against the schema the earlier statements left. The diff then runs on that schema.\n\t*/\n\tplanStatements(options, schema) {\n\t\tconst working = createWorkingSchema(schema);\n\t\tconst planned = planStatements({\n\t\t\tstatements: options.statements.filter(isRenameStatement),\n\t\t\tfromContract: options.fromContract,\n\t\t\tcontract: options.contract,\n\t\t\tpolicy: options.policy,\n\t\t\ttarget: {\n\t\t\t\ttables: () => postgresSchemaTables(working.current, options.contract),\n\t\t\t\trenameTableCall: (rename) => postgresTableRenameCall({\n\t\t\t\t\tprevious: working.current,\n\t\t\t\t\tcontract: options.contract,\n\t\t\t\t\trename,\n\t\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t\t}),\n\t\t\t\trenameColumnCall: (rename) => postgresColumnRenameCall({\n\t\t\t\t\tprevious: working.current,\n\t\t\t\t\tcontract: options.contract,\n\t\t\t\t\trename,\n\t\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t\t}),\n\t\t\t\tapply: (call) => working.apply(call),\n\t\t\t\t...postgresTableRenameByHand(options.contract)\n\t\t\t}\n\t\t});\n\t\tif (!planned.ok) return planned;\n\t\treturn ok({\n\t\t\t...planned.value,\n\t\t\tschema: working.current\n\t\t});\n\t}\n\tensureAdditivePolicy(policy) {\n\t\tif (!policy.allowedOperationClasses.includes(\"additive\")) return plannerFailure([{\n\t\t\tkind: \"unsupportedOperation\",\n\t\t\tsummary: \"Migration planner requires additive operations be allowed\",\n\t\t\twhy: \"The planner requires the \\\"additive\\\" operation class to be allowed in the policy.\"\n\t\t}]);\n\t\treturn null;\n\t}\n};\n/**\n* A diff issue whose node is an RLS policy — the structural half of the one\n* combined tree diff, routed to `planPostgresSchemaDiff` instead of\n* `planIssues`.\n*/\nfunction isPolicyDiffIssue(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\treturn node !== void 0 && PostgresPolicySchemaNode.is(node);\n}\n/**\n* Postgres refuses these statements while a policy uses the object they touch:\n* - dropping a column (2BP01) or changing its type (0A000);\n* - dropping a table that a policy on another table uses (2BP01); a table's own policies go with it;\n* - dropping a native enum type (2BP01);\n* - a destructive codec type operation (a `RawSqlCall` on a type), such as dropping or rebuilding\n* the type (2BP01) or changing a composite type's attribute type (0A000). Additive and widening\n* type operations, such as adding an enum value or renaming the type, go through.\n*\n* So every policy drop moves to just before the first structural call that a policy can block.\n* Without such a call, the policy calls keep their place after the structural calls.\n*/\nfunction movePolicyDropsBeforeBlockedDdl(structural, policyCalls) {\n\tconst firstBlockable = structural.findIndex(policyCanBlock);\n\tif (firstBlockable === -1) return {\n\t\tstructural,\n\t\tpolicyCalls\n\t};\n\tconst isPolicyDrop = (call) => call instanceof DropPostgresRlsPolicyCall;\n\treturn {\n\t\tstructural: [\n\t\t\t...structural.slice(0, firstBlockable),\n\t\t\t...policyCalls.filter(isPolicyDrop),\n\t\t\t...structural.slice(firstBlockable)\n\t\t],\n\t\tpolicyCalls: policyCalls.filter((call) => !isPolicyDrop(call))\n\t};\n}\nfunction policyCanBlock(call) {\n\tif (call instanceof RawSqlCall) return call.operationClass === \"destructive\" && call.op.target.details?.objectType === \"type\";\n\treturn call instanceof DropColumnCall || call instanceof AlterColumnTypeCall || call instanceof DropTableCall || call instanceof DropNativeEnumTypeCall;\n}\n/**\n* Drops a `not-expected` issue when it is a whole extra storage entity (a table\n* or a native enum) that some space in the composition owns. Each such node\n* yields its own storage coordinate (see {@link postgresNodeStorageCoordinate}),\n* so `declaresEntity` answers over the whole composition on one uniform\n* coordinate: a positive answer means a sibling owns this entity here — leave\n* it; a negative answer means a genuine orphan — drop it. A node with no storage\n* coordinate (a namespace, or a deeper column/constraint drift on an owned\n* table) is this space's own and is always kept. No oracle ⇒ keep everything.\n*/\nfunction retainUnownedExtras(issues, ownership, contract) {\n\tif (ownership === void 0) return issues;\n\treturn issues.filter((issue) => {\n\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\tconst node = issueNode(issue);\n\t\tif (node === void 0) return true;\n\t\tconst coordinate = postgresNodeStorageCoordinate(node);\n\t\tif (coordinate === void 0) return true;\n\t\tconst ddlSchemaName = issueSchemaName(issue);\n\t\tif (ddlSchemaName === void 0) return true;\n\t\tconst namespaceId = resolveNamespaceIdForDdlSchema(contract, ddlSchemaName);\n\t\treturn !ownership.declaresEntity({\n\t\t\tnamespaceId,\n\t\t\t...coordinate\n\t\t});\n\t});\n}\n/**\n* Returns the one namespace node the relational strategy layer probes for\n* live-table existence and reads codec-hook context off — the namespace\n* matching the planner's resolved schema name, or the first namespace when\n* none matches. `undefined` when the tree has no namespaces, so the strategy\n* context uses its empty-schema default.\n*\n* The relational strategies key tables by bare name, so they can only probe one\n* namespace at a time; probing across every namespace at once is future work.\n*\n* Returns the real `PostgresNamespaceSchemaNode` reference rather than a\n* projection: `storageTypePlanCallStrategy` hands this same value to codec\n* `planTypeOperations` hooks as `schema`, and hooks read the Postgres-specific\n* `nativeEnums` field off it (via `PostgresNamespaceSchemaNode.is`) to decide\n* whether a native enum type already exists — a projection that only copies\n* `tables` would silently drop that signal. `StrategyContext.schema`'s\n* declared type (`SqlSchemaIR`, shared with SQLite's flat shape) doesn't\n* capture this, so the return is `blindCast` the same way `namespaceSchemaNodes`\n* in the family's relational walk already treats a namespace node as a\n* structurally-`SqlSchemaIR`-shaped value.\n*/\nfunction relationalNamespaceNode(schema, schemaName) {\n\tconst namespaceNodes = Object.values(schema.namespaces);\n\tconst namespaceNode = namespaceNodes.find((node) => node.schemaName === schemaName) ?? namespaceNodes[0];\n\tif (namespaceNode === void 0) return void 0;\n\treturn blindCast(namespaceNode);\n}\n/**\n* Grades a {@link PolicyReplacement} as one unit against the table's\n* control policy, BEFORE the pair becomes calls or a conflict. This runs\n* ahead of `partitionCallsByControlPolicy`, which later re-grades the\n* surviving calls per-call — a no-op here, since only managed units\n* survive this grading.\n*\n* A replacement is deliberately STRICTER than the shared\n* `callAllowedUnderControlPolicy` rule: `tolerated` permits whole-object\n* creation, but a replacement's create is the second half of a repair of\n* an existing object, not a new object — so ANY non-managed control\n* (external, observed, tolerated) suppresses the whole unit. Drift on an\n* object the plan does not manage is reported, never repaired; the\n* suppression subject names the drifted policy (`rlsPolicy`) so the\n* report says which policy drifted, matching the conflict path's\n* `location.rlsPolicy`.\n*/\nfunction gradePolicyReplacement(replacement, contract, allowedOperationClasses) {\n\tconst subject = resolvePostgresCallControlPolicySubject(replacement.drop, contract);\n\tconst controlPolicy = controlPolicyForCall(subject, contract.defaultControlPolicy);\n\tif (controlPolicy !== \"managed\") return {\n\t\tdisposition: \"suppress\",\n\t\trecord: {\n\t\t\tsubject: subject === void 0 ? void 0 : {\n\t\t\t\t...subject,\n\t\t\t\trlsPolicy: replacement.drop.policyName\n\t\t\t},\n\t\t\tpolicy: controlPolicy,\n\t\t\tfactoryName: void 0,\n\t\t\tcreatesNewObject: false\n\t\t}\n\t};\n\tif (!allowedOperationClasses.includes(\"widening\")) return {\n\t\tdisposition: \"conflict\",\n\t\tconflict: conflictForDisallowedCall(replacement.drop, allowedOperationClasses)\n\t};\n\treturn { disposition: \"plan\" };\n}\n/**\n* Rebuilds the `PostgresRlsPolicy` contract entity `CreatePostgresRlsPolicyCall`\n* carries (its `renderTypeScript`/`createRlsPolicy` paths serialize the whole\n* entity, `namespaceId` included). This reconstructs rather than looking the\n* original up in the contract on purpose: the diff node's `namespaceId` is the\n* *resolved DDL schema* (set when the expected tree was built), which is the\n* value the emitted op must carry; the contract-stored entity holds the raw,\n* pre-resolution coordinate, so a lookup would change the migration output.\n*/\nfunction policyNodeToContractPolicy(node) {\n\treturn new PostgresRlsPolicy({\n\t\tnaming: namingOf(node.name, node.prefix),\n\t\ttableName: node.tableName,\n\t\tnamespaceId: node.namespaceId,\n\t\toperation: node.operation,\n\t\troles: [...node.roles],\n\t\tusing: node.using,\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,WAAW,KAAK;EAChB,YAAY,KAAK;CAClB,CAAC;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as PostgresDatabaseSchemaNode } from "./postgres-database-schema-node-Cv8usVNX-BP4GzjSf.mjs";
|
|
2
2
|
import { t as PostgresContract } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
|
|
3
|
-
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-
|
|
4
|
-
import { AppliedMigrationStatement, MigrationAccessChange,
|
|
3
|
+
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-MoopN05f-CfmsQNwj.mjs";
|
|
4
|
+
import { AppliedMigrationStatement, MigrationAccessChange, MigrationDataLoss, MigrationPlanWithAuthoringSurface, MigrationPlanner, MigrationScaffoldContext, MigrationTemporaryValue, PlanOrigin, ResolvedMigrationStatement, SchemaOwnership } from "@prisma/orm-framework/components/control";
|
|
5
5
|
import { ContractToSchemaIROptions, MigrationOperationPolicy, SqlPlannerConflict, SqlPlannerFailureResult } from "@prisma/orm-family-sql/family/control";
|
|
6
6
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
7
7
|
import { TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
|
|
@@ -44,8 +44,9 @@ type PostgresPlanResult = {
|
|
|
44
44
|
readonly plan: TypeScriptRenderablePostgresMigration;
|
|
45
45
|
readonly warnings?: readonly SqlPlannerConflict[];
|
|
46
46
|
readonly appliedStatements: readonly AppliedMigrationStatement[];
|
|
47
|
-
readonly dataLoss: readonly
|
|
47
|
+
readonly dataLoss: readonly MigrationDataLoss[];
|
|
48
48
|
readonly accessWidening: readonly MigrationAccessChange[];
|
|
49
|
+
readonly temporaryValues: readonly MigrationTemporaryValue[];
|
|
49
50
|
} | SqlPlannerFailureResult;
|
|
50
51
|
/**
|
|
51
52
|
* Postgres migration planner — a thin wrapper over `planIssues`.
|
|
@@ -148,4 +149,4 @@ declare class PostgresMigrationPlanner implements MigrationPlanner<'sql', 'postg
|
|
|
148
149
|
}
|
|
149
150
|
//#endregion
|
|
150
151
|
export { createPostgresMigrationPlanner as n, contractToPostgresDatabaseSchemaNode as t };
|
|
151
|
-
//# sourceMappingURL=planner-
|
|
152
|
+
//# sourceMappingURL=planner-Xei8enE-.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-Xei8enE-.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BiB,qCAAqC,UAAU,yBAAyB,SAAS,4BAA4B;;;iBAG7G,+BAA+B,SAAS,wBAAwB;;;;;;;;KAQ5E;WACM;WACA,MAAM;WACN,oBAAoB;WACpB,4BAA4B;WAC5B,mBAAmB;WACnB,yBAAyB;WACzB,0BAA0B;IACjC;;;;;;;;;;;;;;;;;;;cAmBU,oCAAoC;;EAEhD,YAAY,UAAU;EACtB,KAAK;aACM;aACA;aACA,QAAQ;;;;;;;;;;;;;aAaR,cAAc;;aAEd,QAAQ;aACR,qBAAqB;aACrB;aACA,qBAAqB,cAAc;;;;;;aAMnC;;;;;aAKA,YAAY;;;;;;aAMZ;MACP;EACJ,eAAe,SAAS,0BAA0B,kBAAkB;UAC5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA6BA;;;;;UAKA;UACA"}
|
|
@@ -1,40 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as pgTimestamptz, E as pgTime, M as pgTimetz, O as pgTimestamp,
|
|
1
|
+
import { n as escapeLiteral } from "./sql-utils-Df-nf6eM-Ov1KgjWm.mjs";
|
|
2
|
+
import { A as pgTimestamptz, E as pgTime, M as pgTimetz, O as pgTimestamp, b as pgJsonb, c as pgDate, v as pgInterval, y as pgJson } from "./data-types-K6tDhu1D-BN--9o1o.mjs";
|
|
3
|
+
import { n as autoincrementWidthOfDataType } from "./autoincrement-widths-DbyXRo5B-BUVCYb_V.mjs";
|
|
3
4
|
import { dataTypeParams, renderSqlTypeName, sqlDataTypeOfCodec } from "@prisma/orm-family-sql/contract/data-type";
|
|
4
|
-
//#region ../../../3-targets/3-targets/postgres/dist/planner-ddl-builders-
|
|
5
|
-
const SMALL = {
|
|
6
|
-
serialType: "SMALLSERIAL",
|
|
7
|
-
sequenceType: "smallint"
|
|
8
|
-
};
|
|
9
|
-
const REGULAR = {
|
|
10
|
-
serialType: "SERIAL",
|
|
11
|
-
sequenceType: "integer"
|
|
12
|
-
};
|
|
13
|
-
const BIG = {
|
|
14
|
-
serialType: "BIGSERIAL",
|
|
15
|
-
sequenceType: "bigint"
|
|
16
|
-
};
|
|
17
|
-
const WIDTH_BY_COLUMN_TYPE = /* @__PURE__ */ new Map([
|
|
18
|
-
["int2", SMALL],
|
|
19
|
-
["smallint", SMALL],
|
|
20
|
-
["int4", REGULAR],
|
|
21
|
-
["integer", REGULAR],
|
|
22
|
-
["int8", BIG],
|
|
23
|
-
["bigint", BIG]
|
|
24
|
-
]);
|
|
25
|
-
/** The autoincrement width of a column of `columnType`; `undefined` for a column that is not a scalar smallint, integer or bigint. */
|
|
26
|
-
function autoincrementWidth(columnType) {
|
|
27
|
-
return WIDTH_BY_COLUMN_TYPE.get(columnType.toLowerCase());
|
|
28
|
-
}
|
|
29
|
-
const WIDTH_BY_DATA_TYPE = /* @__PURE__ */ new Map([
|
|
30
|
-
[pgInt2.id, SMALL],
|
|
31
|
-
[pgInt4.id, REGULAR],
|
|
32
|
-
[pgInt8.id, BIG]
|
|
33
|
-
]);
|
|
34
|
-
/** The autoincrement width of a column whose data type is `dataTypeId`; `undefined` unless it is `pg/int2`, `pg/int4` or `pg/int8`. */
|
|
35
|
-
function autoincrementWidthOfDataType(dataTypeId) {
|
|
36
|
-
return WIDTH_BY_DATA_TYPE.get(dataTypeId);
|
|
37
|
-
}
|
|
5
|
+
//#region ../../../3-targets/3-targets/postgres/dist/planner-ddl-builders-BcJ353Wj.mjs
|
|
38
6
|
const DATE_TIME_TYPES = /* @__PURE__ */ new Set([
|
|
39
7
|
pgDate.id,
|
|
40
8
|
pgTime.id,
|
|
@@ -118,6 +86,6 @@ function renderArrayLiteralDefault(elements, baseTypeName, dataType) {
|
|
|
118
86
|
return `${rendered}::${baseTypeName.endsWith("[]") ? baseTypeName : `${baseTypeName}[]`}`;
|
|
119
87
|
}
|
|
120
88
|
//#endregion
|
|
121
|
-
export { renderDefaultLiteral as
|
|
89
|
+
export { renderDefaultLiteral as i, isPostgresDateTimeDataType as n, postgresDateTimeDdlText as r, buildColumnTypeSql as t };
|
|
122
90
|
|
|
123
|
-
//# sourceMappingURL=planner-ddl-builders-
|
|
91
|
+
//# sourceMappingURL=planner-ddl-builders-BcJ353Wj-Dfaixf4X.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-ddl-builders-BcJ353Wj-Dfaixf4X.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-ddl-builders-BcJ353Wj.mjs"],"sourcesContent":["import { n as escapeLiteral } from \"./sql-utils-Df-nf6eM.mjs\";\nimport { A as pgTimestamptz, E as pgTime, M as pgTimetz, O as pgTimestamp, b as pgJsonb, c as pgDate, v as pgInterval, y as pgJson } from \"./data-types-K6tDhu1D.mjs\";\nimport { n as autoincrementWidthOfDataType } from \"./autoincrement-widths-DbyXRo5B.mjs\";\nimport { dataTypeParams, renderSqlTypeName, sqlDataTypeOfCodec } from \"@internal/sql-contract/data-type\";\n//#region src/core/date-time-ddl-text.ts\nconst DATE_TIME_TYPES = /* @__PURE__ */ new Set([\n\tpgDate.id,\n\tpgTime.id,\n\tpgTimetz.id,\n\tpgTimestamp.id,\n\tpgTimestamptz.id,\n\tpgInterval.id\n]);\nconst TYPES_WITH_A_YEAR = /* @__PURE__ */ new Set([\n\tpgDate.id,\n\tpgTimestamp.id,\n\tpgTimestamptz.id\n]);\n/** Whether a data type is one of this target's date and time types, whose defaults DDL writes as text. */\nfunction isPostgresDateTimeDataType(dataTypeId) {\n\treturn dataTypeId !== void 0 && DATE_TIME_TYPES.has(dataTypeId);\n}\n/**\n* The text DDL writes for a default of a date or time type, from its canonical form (ADR 254). A\n* year from 1 to 9999 stays as it is. PostgreSQL has no year 0 and reads no signed year, so a later\n* year loses its sign and leading zeros (`10000-01-01`) and a year at or before 0 is written as the\n* year before Christ (`0044-03-15 BC`). Every Postgres DDL path writes a date or time default\n* through this function.\n*/\nfunction postgresDateTimeDdlText(canonical, dataTypeId) {\n\tif (dataTypeId === void 0 || !TYPES_WITH_A_YEAR.has(dataTypeId)) return canonical;\n\tconst match = /^([+-]\\d{6}|\\d{4})(-.*)$/.exec(canonical);\n\tif (match === null) return canonical;\n\tconst [, yearDigits = \"\", rest = \"\"] = match;\n\tconst year = Number(yearDigits);\n\tif (year >= 1 && year <= 9999) return canonical;\n\tif (year > 9999) return `${year}${rest}`;\n\treturn `${String(1 - year).padStart(4, \"0\")}${rest} BC`;\n}\n//#endregion\n//#region src/core/migrations/planner-ddl-builders.ts\nconst JSON_DATA_TYPES = /* @__PURE__ */ new Set([pgJson.id, pgJsonb.id]);\n/**\n* Renders the SQL type for a column in DDL context: the name its codec's data type is written\n* with, and its parameters. A `typeRef` column is written as a column of the referenced type.\n*\n* @param allowPseudoTypes - When true (default), autoincrement integer columns\n* produce SERIAL/BIGSERIAL/SMALLSERIAL pseudo-types. Set to false for contexts\n* like ALTER COLUMN TYPE where pseudo-types are invalid.\n*/\nfunction buildColumnTypeSql(column, types, storageTypes = {}, allowPseudoTypes = true) {\n\tconst resolved = (column.typeRef === void 0 ? void 0 : storageTypes[column.typeRef]) ?? column;\n\tconst dataType = sqlDataTypeOfCodec(resolved.codecId, types);\n\tif (allowPseudoTypes && isAutoincrement(column.default)) {\n\t\tconst width = autoincrementWidthOfDataType(dataType.id);\n\t\tif (width !== void 0) return width.serialType;\n\t}\n\tconst typeSql = renderSqlTypeName(dataType, dataTypeParams(dataType, resolved.typeParams));\n\treturn column.many ? `${typeSql}[]` : typeSql;\n}\nfunction isAutoincrement(columnDefault) {\n\treturn columnDefault?.kind === \"function\" && columnDefault.expression === \"autoincrement()\";\n}\nfunction renderDefaultLiteral(value, column) {\n\tif (column?.many && Array.isArray(value)) return renderArrayLiteralDefault(value, column.baseTypeName, column.dataType);\n\tif (column !== void 0 && JSON_DATA_TYPES.has(column.dataType) && typeof value === \"object\" && value !== null && !(value instanceof Date)) return `'${escapeLiteral(JSON.stringify(value))}'::${column.baseTypeName}`;\n\treturn renderScalarLiteral(value, column?.dataType);\n}\n/** A date or time value is written through the one function every DDL path uses for it. */\nfunction renderScalarLiteral(value, dataType) {\n\tif (value instanceof Date) return `'${escapeLiteral(value.toISOString())}'`;\n\tif (typeof value === \"string\") return `'${escapeLiteral(postgresDateTimeDdlText(value, dataType))}'`;\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n\tif (value === null) return \"NULL\";\n\treturn `'${escapeLiteral(JSON.stringify(value))}'`;\n}\n/**\n* An `ARRAY[...]` of quoted elements has type `text[]`, which Postgres does not assign to a list of\n* numbers, decimals, timestamps or enums, so the constructor is cast to the list type. Each element\n* is the text Postgres reads for its type: an `int8` or `numeric` value as decimal text, a date or\n* time value in its type's canonical form. The cast is `baseTypeName` with `[]` appended unless it\n* already ends in `[]`; the name is not quoted here.\n*/\nfunction renderArrayLiteralDefault(elements, baseTypeName, dataType) {\n\tif (elements.length === 0) return \"'{}'\";\n\tconst rendered = `ARRAY[${elements.map((el) => renderScalarLiteral(el, dataType)).join(\", \")}]`;\n\tif (baseTypeName === \"\") return rendered;\n\treturn `${rendered}::${baseTypeName.endsWith(\"[]\") ? baseTypeName : `${baseTypeName}[]`}`;\n}\n//#endregion\nexport { postgresDateTimeDdlText as i, renderDefaultLiteral as n, isPostgresDateTimeDataType as r, buildColumnTypeSql as t };\n\n//# sourceMappingURL=planner-ddl-builders-BcJ353Wj.mjs.map"],"mappings":";;;;;AAKA,MAAM,kCAAkC,IAAI,IAAI;CAC/C,OAAO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AAC3E;AACA,SAAS,qBAAqB,OAAO,QAAQ;CAC5C,IAAI,QAAQ,QAAQ,MAAM,QAAQ,KAAK,GAAG,OAAO,0BAA0B,OAAO,OAAO,cAAc,OAAO,QAAQ;CACtH,IAAI,WAAW,KAAK,KAAK,gBAAgB,IAAI,OAAO,QAAQ,KAAK,OAAO,UAAU,YAAY,UAAU,QAAQ,EAAE,iBAAiB,OAAO,OAAO,IAAI,cAAc,KAAK,UAAU,KAAK,CAAC,EAAE,KAAK,OAAO;CACtM,OAAO,oBAAoB,OAAO,QAAQ,QAAQ;AACnD;;AAEA,SAAS,oBAAoB,OAAO,UAAU;CAC7C,IAAI,iBAAiB,MAAM,OAAO,IAAI,cAAc,MAAM,YAAY,CAAC,EAAE;CACzE,IAAI,OAAO,UAAU,UAAU,OAAO,IAAI,cAAc,wBAAwB,OAAO,QAAQ,CAAC,EAAE;CAClG,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,WAAW,OAAO,OAAO,KAAK;CAChF,IAAI,UAAU,MAAM,OAAO;CAC3B,OAAO,IAAI,cAAc,KAAK,UAAU,KAAK,CAAC,EAAE;AACjD;;;;;;;;AAQA,SAAS,0BAA0B,UAAU,cAAc,UAAU;CACpE,IAAI,SAAS,WAAW,GAAG,OAAO;CAClC,MAAM,WAAW,SAAS,SAAS,KAAK,OAAO,oBAAoB,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;CAC7F,IAAI,iBAAiB,IAAI,OAAO;CAChC,OAAO,GAAG,SAAS,IAAI,aAAa,SAAS,IAAI,IAAI,eAAe,GAAG,aAAa;AACrF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as pgTimestamptz, E as pgTime, F as pgUuid, I as pgVarbit, L as pgVarchar, M as pgTimetz, O as pgTimestamp, T as pgTextArray, _ as pgInt8, a as pgBytea, b as pgJsonb, c as pgDate, f as pgFloat4, g as pgInt4, h as pgInt2, i as pgBool, n as pgBit, o as pgChar, p as pgFloat8, v as pgInterval, w as pgText, x as pgNumeric, y as pgJson } from "./data-types-
|
|
1
|
+
import { A as pgTimestamptz, E as pgTime, F as pgUuid, I as pgVarbit, L as pgVarchar, M as pgTimetz, O as pgTimestamp, T as pgTextArray, _ as pgInt8, a as pgBytea, b as pgJsonb, c as pgDate, f as pgFloat4, g as pgInt4, h as pgInt2, i as pgBool, n as pgBit, o as pgChar, p as pgFloat8, v as pgInterval, w as pgText, x as pgNumeric, y as pgJson } from "./data-types-K6tDhu1D-BN--9o1o.mjs";
|
|
2
2
|
import { sqlDataTypeOfCodec } from "@prisma/orm-family-sql/contract/data-type";
|
|
3
3
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
4
|
-
//#region ../../../3-targets/3-targets/postgres/dist/planner-identity-values-
|
|
4
|
+
//#region ../../../3-targets/3-targets/postgres/dist/planner-identity-values-BZdomjRU.mjs
|
|
5
5
|
/**
|
|
6
6
|
* Resolves the identity value (monoid neutral element) as a SQL literal for a column's type.
|
|
7
7
|
* Checks codec hooks first (extensions can provide type-specific identity values),
|
|
@@ -69,4 +69,4 @@ function buildBitIdentityValue(typeParams) {
|
|
|
69
69
|
//#endregion
|
|
70
70
|
export { resolveIdentityValue as n, buildBuiltinIdentityValue as t };
|
|
71
71
|
|
|
72
|
-
//# sourceMappingURL=planner-identity-values-
|
|
72
|
+
//# sourceMappingURL=planner-identity-values-BZdomjRU-G521DabU.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner-identity-values-
|
|
1
|
+
{"version":3,"file":"planner-identity-values-BZdomjRU-G521DabU.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-identity-values-BZdomjRU.mjs"],"sourcesContent":["import { A as pgTimestamptz, E as pgTime, F as pgUuid, I as pgVarbit, L as pgVarchar, M as pgTimetz, O as pgTimestamp, T as pgTextArray, _ as pgInt8, a as pgBytea, b as pgJsonb, c as pgDate, f as pgFloat4, g as pgInt4, h as pgInt2, i as pgBool, n as pgBit, o as pgChar, p as pgFloat8, v as pgInterval, w as pgText, x as pgNumeric, y as pgJson } from \"./data-types-K6tDhu1D.mjs\";\nimport { sqlDataTypeOfCodec } from \"@internal/sql-contract/data-type\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/core/migrations/planner-identity-values.ts\n/**\n* Resolves the identity value (monoid neutral element) as a SQL literal for a column's type.\n* Checks codec hooks first (extensions can provide type-specific identity values),\n* then falls back to the built-in map, keyed by the data type the column's codec represents.\n*/\nfunction resolveIdentityValue(column, codecHooks, types, storageTypes = {}) {\n\tconst referencedType = column.typeRef ? storageTypes[column.typeRef] : void 0;\n\tconst codecId = referencedType?.codecId ?? column.codecId;\n\tconst typeParams = referencedType?.typeParams ?? column.typeParams;\n\tif (column.many) return \"'{}'\";\n\tconst dataType = sqlDataTypeOfCodec(codecId, types).id;\n\tconst hookDefault = codecHooks.get(codecId)?.resolveIdentityValue?.({\n\t\tdataType,\n\t\tcodecId,\n\t\t...ifDefined(\"typeParams\", typeParams)\n\t});\n\tif (hookDefault !== void 0) return hookDefault;\n\treturn buildBuiltinIdentityValue(dataType, typeParams);\n}\nconst IDENTITY_VALUES = /* @__PURE__ */ new Map([\n\t[pgText.id, \"''\"],\n\t[pgChar.id, \"''\"],\n\t[pgVarchar.id, \"''\"],\n\t[pgInt2.id, \"0\"],\n\t[pgInt4.id, \"0\"],\n\t[pgInt8.id, \"0\"],\n\t[pgFloat4.id, \"0\"],\n\t[pgFloat8.id, \"0\"],\n\t[pgNumeric.id, \"0\"],\n\t[pgBool.id, \"false\"],\n\t[pgUuid.id, \"'00000000-0000-0000-0000-000000000000'\"],\n\t[pgJson.id, \"'{}'::json\"],\n\t[pgJsonb.id, \"'{}'::jsonb\"],\n\t[pgDate.id, \"'epoch'\"],\n\t[pgTimestamp.id, \"'epoch'\"],\n\t[pgTimestamptz.id, \"'epoch'\"],\n\t[pgTime.id, \"'00:00:00'\"],\n\t[pgTimetz.id, \"'00:00:00+00'\"],\n\t[pgInterval.id, \"'0'\"],\n\t[pgBytea.id, \"''::bytea\"],\n\t[pgVarbit.id, \"B''\"],\n\t[pgTextArray.id, \"'{}'\"]\n]);\n/**\n* Returns the built-in identity value (monoid neutral element) as a SQL literal for the given\n* data type — e.g. 0 for integers, '' for text, false for booleans.\n*\n* This is the planner's fallback when no codec hook provides a type-specific identity value.\n*\n* Returns null for other types (for example enums and extension-owned types without a\n* hook), which causes the planner to fall back to the empty-table precheck.\n*\n* @internal Exported for testing only.\n*/\nfunction buildBuiltinIdentityValue(dataType, typeParams) {\n\tif (dataType === pgBit.id) return buildBitIdentityValue(typeParams);\n\treturn IDENTITY_VALUES.get(dataType) ?? null;\n}\nfunction buildBitIdentityValue(typeParams) {\n\tconst length = typeParams?.[\"length\"];\n\tif (length === void 0) return \"B'0'\";\n\tif (typeof length !== \"number\" || !Number.isInteger(length) || length <= 0) return null;\n\treturn `B'${\"0\".repeat(length)}'`;\n}\n//#endregion\nexport { resolveIdentityValue as n, buildBuiltinIdentityValue as t };\n\n//# sourceMappingURL=planner-identity-values-BZdomjRU.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,qBAAqB,QAAQ,YAAY,OAAO,eAAe,CAAC,GAAG;CAC3E,MAAM,iBAAiB,OAAO,UAAU,aAAa,OAAO,WAAW,KAAK;CAC5E,MAAM,UAAU,gBAAgB,WAAW,OAAO;CAClD,MAAM,aAAa,gBAAgB,cAAc,OAAO;CACxD,IAAI,OAAO,MAAM,OAAO;CACxB,MAAM,WAAW,mBAAmB,SAAS,KAAK,CAAC,CAAC;CACpD,MAAM,cAAc,WAAW,IAAI,OAAO,CAAC,EAAE,uBAAuB;EACnE;EACA;EACA,GAAG,UAAU,cAAc,UAAU;CACtC,CAAC;CACD,IAAI,gBAAgB,KAAK,GAAG,OAAO;CACnC,OAAO,0BAA0B,UAAU,UAAU;AACtD;AACA,MAAM,kCAAkC,IAAI,IAAI;CAC/C,CAAC,OAAO,IAAI,IAAI;CAChB,CAAC,OAAO,IAAI,IAAI;CAChB,CAAC,UAAU,IAAI,IAAI;CACnB,CAAC,OAAO,IAAI,GAAG;CACf,CAAC,OAAO,IAAI,GAAG;CACf,CAAC,OAAO,IAAI,GAAG;CACf,CAAC,SAAS,IAAI,GAAG;CACjB,CAAC,SAAS,IAAI,GAAG;CACjB,CAAC,UAAU,IAAI,GAAG;CAClB,CAAC,OAAO,IAAI,OAAO;CACnB,CAAC,OAAO,IAAI,wCAAwC;CACpD,CAAC,OAAO,IAAI,YAAY;CACxB,CAAC,QAAQ,IAAI,aAAa;CAC1B,CAAC,OAAO,IAAI,SAAS;CACrB,CAAC,YAAY,IAAI,SAAS;CAC1B,CAAC,cAAc,IAAI,SAAS;CAC5B,CAAC,OAAO,IAAI,YAAY;CACxB,CAAC,SAAS,IAAI,eAAe;CAC7B,CAAC,WAAW,IAAI,KAAK;CACrB,CAAC,QAAQ,IAAI,WAAW;CACxB,CAAC,SAAS,IAAI,KAAK;CACnB,CAAC,YAAY,IAAI,MAAM;AACxB,CAAC;;;;;;;;;;;;AAYD,SAAS,0BAA0B,UAAU,YAAY;CACxD,IAAI,aAAa,MAAM,IAAI,OAAO,sBAAsB,UAAU;CAClE,OAAO,gBAAgB,IAAI,QAAQ,KAAK;AACzC;AACA,SAAS,sBAAsB,YAAY;CAC1C,MAAM,SAAS,aAAa;CAC5B,IAAI,WAAW,KAAK,GAAG,OAAO;CAC9B,IAAI,OAAO,WAAW,YAAY,CAAC,OAAO,UAAU,MAAM,KAAK,UAAU,GAAG,OAAO;CACnF,OAAO,KAAK,IAAI,OAAO,MAAM,EAAE;AAChC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as PostgresMigration } from "./postgres-migration-
|
|
2
|
-
import { t as renderOps } from "./render-ops-
|
|
1
|
+
import { t as PostgresMigration } from "./postgres-migration-CLIfS2iQ-BgnVMLRT.mjs";
|
|
2
|
+
import { t as renderOps } from "./render-ops-Cw9B6aq6-CMzRGNUZ.mjs";
|
|
3
3
|
import { t as renderCallsToTypeScript } from "./render-typescript-Dqp1Spgn-B128r1qw.mjs";
|
|
4
|
-
//#region ../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-
|
|
4
|
+
//#region ../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-Brgj59VY.mjs
|
|
5
5
|
var TypeScriptRenderablePostgresMigration = class extends PostgresMigration {
|
|
6
6
|
#calls;
|
|
7
7
|
#meta;
|
|
@@ -44,4 +44,4 @@ var TypeScriptRenderablePostgresMigration = class extends PostgresMigration {
|
|
|
44
44
|
//#endregion
|
|
45
45
|
export { TypeScriptRenderablePostgresMigration as t };
|
|
46
46
|
|
|
47
|
-
//# sourceMappingURL=planner-produced-postgres-migration-
|
|
47
|
+
//# sourceMappingURL=planner-produced-postgres-migration-Brgj59VY-DOOLRWyy.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner-produced-postgres-migration-
|
|
1
|
+
{"version":3,"file":"planner-produced-postgres-migration-Brgj59VY-DOOLRWyy.mjs","names":["#calls","#meta","#spaceId","#snapshotsImportPath","#lowerer","#operationsCache"],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-Brgj59VY.mjs"],"sourcesContent":["import { t as PostgresMigration } from \"./postgres-migration-CLIfS2iQ.mjs\";\nimport { t as renderOps } from \"./render-ops-Cw9B6aq6.mjs\";\nimport { t as renderCallsToTypeScript } from \"./render-typescript-Dqp1Spgn.mjs\";\n//#region src/core/migrations/planner-produced-postgres-migration.ts\nvar TypeScriptRenderablePostgresMigration = class extends PostgresMigration {\n\t#calls;\n\t#meta;\n\t#spaceId;\n\t#snapshotsImportPath;\n\t#lowerer;\n\t#operationsCache;\n\tconstructor(calls, meta, spaceId, snapshotsImportPath, lowerer) {\n\t\tsuper();\n\t\tthis.#calls = calls;\n\t\tthis.#meta = meta;\n\t\tthis.#spaceId = spaceId;\n\t\tthis.#snapshotsImportPath = snapshotsImportPath;\n\t\tthis.#lowerer = lowerer;\n\t}\n\tget operations() {\n\t\tthis.#operationsCache ??= renderOps(this.#calls, this.#lowerer);\n\t\treturn this.#operationsCache;\n\t}\n\tdescribe() {\n\t\treturn this.#meta;\n\t}\n\t/**\n\t* Contract space this planner-produced plan applies to. Threaded\n\t* from the planner options so the runner keys the marker row by\n\t* the right space when executing the plan.\n\t*/\n\tget spaceId() {\n\t\treturn this.#spaceId;\n\t}\n\trenderTypeScript(resolveImportSpecifier) {\n\t\treturn renderCallsToTypeScript(this.#calls, {\n\t\t\tfrom: this.#meta.from,\n\t\t\tto: this.#meta.to,\n\t\t\tsnapshotsImportPath: this.#snapshotsImportPath,\n\t\t\tresolveImportSpecifier\n\t\t});\n\t}\n};\n//#endregion\nexport { TypeScriptRenderablePostgresMigration as t };\n\n//# sourceMappingURL=planner-produced-postgres-migration-Brgj59VY.mjs.map"],"mappings":";;;;AAIA,IAAI,wCAAwC,cAAc,kBAAkB;CAC3E;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,OAAO,MAAM,SAAS,qBAAqB,SAAS;EAC/D,MAAM;EACN,KAAKA,SAAS;EACd,KAAKC,QAAQ;EACb,KAAKC,WAAW;EAChB,KAAKC,uBAAuB;EAC5B,KAAKC,WAAW;CACjB;CACA,IAAI,aAAa;EAChB,KAAKC,qBAAqB,UAAU,KAAKL,QAAQ,KAAKI,QAAQ;EAC9D,OAAO,KAAKC;CACb;CACA,WAAW;EACV,OAAO,KAAKJ;CACb;;;;;;CAMA,IAAI,UAAU;EACb,OAAO,KAAKC;CACb;CACA,iBAAiB,wBAAwB;EACxC,OAAO,wBAAwB,KAAKF,QAAQ;GAC3C,MAAM,KAAKC,MAAM;GACjB,IAAI,KAAKA,MAAM;GACf,qBAAqB,KAAKE;GAC1B;EACD,CAAC;CACF;AACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./planner-produced-postgres-migration-MoopN05f-CfmsQNwj.mjs";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as PostgresPlanTargetDetails } from "./planner-target-details-HkP4RrRO-_xPQVPF0.mjs";
|
|
2
|
-
import { t as PostgresMigration } from "./postgres-migration-
|
|
2
|
+
import { t as PostgresMigration } from "./postgres-migration-D5OiThXV-CihIARAE.mjs";
|
|
3
3
|
import { MigrationPlanWithAuthoringSurface, OpFactoryCall } from "@prisma/orm-framework/components/control";
|
|
4
4
|
import { SqlMigrationPlanOperation } from "@prisma/orm-family-sql/family/control";
|
|
5
5
|
import { MigrationMeta } from "@prisma/orm-toolchain/migration-tools/migration";
|
|
6
6
|
import { ImportSpecifierResolver } from "@prisma/orm-framework/components/emission";
|
|
7
7
|
import { ExecuteRequestLowerer } from "@prisma/orm-family-sql/family/control-adapter";
|
|
8
|
-
//#region ../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-
|
|
8
|
+
//#region ../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-MoopN05f.d.mts
|
|
9
9
|
//#region src/core/migrations/planner-produced-postgres-migration.d.ts
|
|
10
10
|
declare class TypeScriptRenderablePostgresMigration extends PostgresMigration implements MigrationPlanWithAuthoringSurface {
|
|
11
11
|
#private;
|
|
@@ -22,4 +22,4 @@ declare class TypeScriptRenderablePostgresMigration extends PostgresMigration im
|
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
24
|
export { TypeScriptRenderablePostgresMigration as t };
|
|
25
|
-
//# sourceMappingURL=planner-produced-postgres-migration-
|
|
25
|
+
//# sourceMappingURL=planner-produced-postgres-migration-MoopN05f-CfmsQNwj.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-produced-postgres-migration-MoopN05f-CfmsQNwj.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-MoopN05f.d.mts"],"mappings":";;;;;;;;;cAQc,8CAA8C,6BAA6B;;EAEvF,YAAY,gBAAgB,iBAAiB,MAAM,eAAe,iBAAiB,6BAA6B,UAAU;MACtH,wBAAwB,0BAA0B,6BAA6B,QAAQ,0BAA0B;EACrH,YAAY;;;;;;MAMR;EACJ,iBAAiB,wBAAwB"}
|
package/dist/{planner-schema-lookup-kMIVP2y--CdO4VlnF.mjs → planner-schema-lookup-CdgWer9s.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
2
|
-
//#region ../../../3-targets/3-targets/postgres/dist/planner-schema-lookup
|
|
2
|
+
//#region ../../../3-targets/3-targets/postgres/dist/planner-schema-lookup.mjs
|
|
3
3
|
function buildSchemaLookupMap(schema) {
|
|
4
4
|
const map = /* @__PURE__ */ new Map();
|
|
5
5
|
for (const [tableName, table] of Object.entries(schema.tables)) map.set(tableName, buildSchemaTableLookup(table));
|
|
@@ -54,4 +54,4 @@ function hasForeignKey(lookup, fk) {
|
|
|
54
54
|
//#endregion
|
|
55
55
|
export { hasUniqueConstraint as i, hasForeignKey as n, hasIndex as r, buildSchemaLookupMap as t };
|
|
56
56
|
|
|
57
|
-
//# sourceMappingURL=planner-schema-lookup-
|
|
57
|
+
//# sourceMappingURL=planner-schema-lookup-CdgWer9s.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-schema-lookup-CdgWer9s.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-schema-lookup.mjs"],"sourcesContent":["import { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\n//#region src/core/migrations/planner-schema-lookup.ts\nfunction buildSchemaLookupMap(schema) {\n\tconst map = /* @__PURE__ */ new Map();\n\tfor (const [tableName, table] of Object.entries(schema.tables)) map.set(tableName, buildSchemaTableLookup(table));\n\treturn map;\n}\nfunction buildSchemaTableLookup(table) {\n\tconst uniqueKeys = new Set(table.uniques.map((u) => u.columns.join(\",\")));\n\tconst indexKeys = new Set(table.indexes.map((i) => (i.columns ?? []).join(\",\")));\n\tconst uniqueIndexKeys = new Set(table.indexes.filter((i) => i.unique).map((i) => (i.columns ?? []).join(\",\")));\n\tconst fkKeys = /* @__PURE__ */ new Set();\n\tfor (const fk of table.foreignKeys) {\n\t\tfkKeys.add(JSON.stringify([\n\t\t\tfk.columns,\n\t\t\tfk.referencedTable,\n\t\t\tfk.referencedColumns\n\t\t]));\n\t\tif (fk.referencedSchema !== void 0) fkKeys.add(JSON.stringify([\n\t\t\tfk.columns,\n\t\t\tfk.referencedSchema,\n\t\t\tfk.referencedTable,\n\t\t\tfk.referencedColumns\n\t\t]));\n\t}\n\treturn {\n\t\tuniqueKeys,\n\t\tindexKeys,\n\t\tuniqueIndexKeys,\n\t\tfkKeys\n\t};\n}\nfunction hasUniqueConstraint(lookup, columns) {\n\tconst key = columns.join(\",\");\n\treturn lookup.uniqueKeys.has(key) || lookup.uniqueIndexKeys.has(key);\n}\nfunction hasIndex(lookup, columns) {\n\tconst key = columns.join(\",\");\n\treturn lookup.indexKeys.has(key) || lookup.uniqueKeys.has(key);\n}\nfunction hasForeignKey(lookup, fk) {\n\tif (fk.target.namespaceId === UNBOUND_NAMESPACE_ID) return lookup.fkKeys.has(JSON.stringify([\n\t\tfk.source.columns,\n\t\tfk.target.tableName,\n\t\tfk.target.columns\n\t]));\n\treturn lookup.fkKeys.has(JSON.stringify([\n\t\tfk.source.columns,\n\t\tfk.target.namespaceId,\n\t\tfk.target.tableName,\n\t\tfk.target.columns\n\t]));\n}\n//#endregion\nexport { buildSchemaLookupMap, hasForeignKey, hasIndex, hasUniqueConstraint };\n\n//# sourceMappingURL=planner-schema-lookup.mjs.map"],"mappings":";;AAEA,SAAS,qBAAqB,QAAQ;CACrC,MAAM,sBAAsB,IAAI,IAAI;CACpC,KAAK,MAAM,CAAC,WAAW,UAAU,OAAO,QAAQ,OAAO,MAAM,GAAG,IAAI,IAAI,WAAW,uBAAuB,KAAK,CAAC;CAChH,OAAO;AACR;AACA,SAAS,uBAAuB,OAAO;CACtC,MAAM,aAAa,IAAI,IAAI,MAAM,QA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}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { DataType } from "@prisma/orm-framework/components/codec";
|
|
1
2
|
import { SqlTypeLookups } from "@prisma/orm-family-sql/contract/data-type";
|
|
2
3
|
import { StorageColumn, StorageTypeInstance } from "@prisma/orm-family-sql/contract/types";
|
|
4
|
+
import { TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
|
|
3
5
|
//#region ../../../3-targets/3-targets/postgres/dist/planner-sql-checks.d.mts
|
|
4
6
|
//#region src/core/migrations/planner-sql-checks.d.ts
|
|
5
7
|
/**
|
|
@@ -20,6 +22,18 @@ declare function qualifyTableName(schema: string, table: string): string;
|
|
|
20
22
|
* it.
|
|
21
23
|
*/
|
|
22
24
|
declare function buildExpectedFormatType(column: Pick<StorageColumn, 'codecId' | 'typeParams' | 'typeRef'>, types: SqlTypeLookups, storageTypes?: Record<string, StorageTypeInstance>): string;
|
|
25
|
+
/** The data types the components of a stack register. */
|
|
26
|
+
declare function stackDataTypes(frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>): readonly DataType[];
|
|
27
|
+
/**
|
|
28
|
+
* The type `format_type` prints for a column altered to `type`, written as a migration writes it:
|
|
29
|
+
* the catalog text of the one data type of `dataTypes` that reads it, or for an enum, named by its
|
|
30
|
+
* quoted name, that name quoted where Postgres quotes it, without the `public` schema, which
|
|
31
|
+
* `format_type` leaves out as the planner's own enum names do. A list type keeps one `[]`, as
|
|
32
|
+
* `format_type` prints it. The planner and the `alterColumnType` facade both check the alter with
|
|
33
|
+
* this text, so re-running a migration reproduces its operations. `where` names the call in the
|
|
34
|
+
* error a type no data type reads raises.
|
|
35
|
+
*/
|
|
36
|
+
declare function alterTypeCheckText(type: string, dataTypes: readonly DataType[], where: string): string;
|
|
23
37
|
//#endregion
|
|
24
|
-
export {
|
|
25
|
-
//# sourceMappingURL=planner-sql-checks-
|
|
38
|
+
export { stackDataTypes as i, buildExpectedFormatType as n, qualifyTableName as r, alterTypeCheckText as t };
|
|
39
|
+
//# sourceMappingURL=planner-sql-checks-C54jJ5qt.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-sql-checks-C54jJ5qt.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-sql-checks.d.mts"],"mappings":";;;;;;;;;;;;;;;;;iBAgBiB,iBAAiB,gBAAgB;;;;;;iBAMjC,wBAAwB,QAAQ,KAAK,sDAAsD,OAAO,gBAAgB,eAAe,eAAe;;iBAEhJ,eAAe,qBAAqB,cAAc,0DAA0D;;;;;;;;;;iBAU5G,mBAAmB,cAAc,oBAAoB,YAAY"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
|
|
2
|
+
import { a as quoteIdentifierWhereNeeded } from "./sql-utils-Df-nf6eM-Ov1KgjWm.mjs";
|
|
3
|
+
import { h as postgresCreateNamespace } from "./postgres-schema-Ysxbqkzr-hFRwS-zT.mjs";
|
|
4
|
+
import { assembleDataTypes } from "@prisma/orm-framework/components/codec";
|
|
5
|
+
import { dataTypeParams, isSqlDataType, renderSqlCatalogText, resolveWrittenSqlTypes, sqlDataTypeOfCodec, unquotedSqlBaseName } from "@prisma/orm-family-sql/contract/data-type";
|
|
6
|
+
//#region ../../../3-targets/3-targets/postgres/dist/planner-sql-checks-CX37qDix.mjs
|
|
7
|
+
function resolveColumnTypeMetadata(column, storageTypes) {
|
|
8
|
+
if (!column.typeRef) return column;
|
|
9
|
+
const referencedType = storageTypes[column.typeRef];
|
|
10
|
+
if (!referencedType) return column;
|
|
11
|
+
return {
|
|
12
|
+
codecId: referencedType.codecId,
|
|
13
|
+
typeParams: referencedType.typeParams
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* String-keyed entry points the migration ops use to render
|
|
18
|
+
* schema-qualified DDL and catalog checks. The `schema` argument is
|
|
19
|
+
* interpreted as a namespace coordinate: the framework `__unbound__`
|
|
20
|
+
* sentinel resolves to the late-bound `PostgresUnboundSchema` singleton
|
|
21
|
+
* (which elides the qualifier so `search_path` decides at runtime); any
|
|
22
|
+
* other id materialises a `PostgresSchema(id)` whose qualifier is the
|
|
23
|
+
* named schema. Helpers route through these `Namespace` concretions so
|
|
24
|
+
* the unbound branch lives in the polymorphic override, not the call
|
|
25
|
+
* site.
|
|
26
|
+
*/
|
|
27
|
+
function qualifyTableName(schema, table) {
|
|
28
|
+
return postgresCreateNamespace({
|
|
29
|
+
id: schema,
|
|
30
|
+
entries: { table: {} }
|
|
31
|
+
}).qualifyTable(table);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The type `format_type` prints, for the column's ALTER COLUMN TYPE postcheck: the catalog text of
|
|
35
|
+
* its data type with normalised parameters, or for an enum its name, quoted where Postgres quotes
|
|
36
|
+
* it.
|
|
37
|
+
*/
|
|
38
|
+
function buildExpectedFormatType(column, types, storageTypes = {}) {
|
|
39
|
+
const resolved = resolveColumnTypeMetadata(column, storageTypes);
|
|
40
|
+
const dataType = sqlDataTypeOfCodec(resolved.codecId, types);
|
|
41
|
+
const params = dataTypeParams(dataType, resolved.typeParams);
|
|
42
|
+
if (dataType.sql.claimsKind !== void 0) return unquotedSqlBaseName(dataType, params).split(".").map(quoteIdentifierWhereNeeded).join(".");
|
|
43
|
+
return renderSqlCatalogText(dataType, params);
|
|
44
|
+
}
|
|
45
|
+
/** The data types the components of a stack register. */
|
|
46
|
+
function stackDataTypes(frameworkComponents) {
|
|
47
|
+
return assembleDataTypes(frameworkComponents).declared.map(({ type }) => type);
|
|
48
|
+
}
|
|
49
|
+
const ARRAY_SUFFIX = /^(.*?)(?:\s*\[\s*\])+$/s;
|
|
50
|
+
const QUOTED_SEGMENT = /^"((?:[^"]|"")+)"/;
|
|
51
|
+
/** The segments of a name written as one or two double-quoted identifiers, `"Mood"` or `"app"."status"`. */
|
|
52
|
+
function quotedName(text) {
|
|
53
|
+
const segments = [];
|
|
54
|
+
let rest = text;
|
|
55
|
+
while (rest !== "") {
|
|
56
|
+
const match = QUOTED_SEGMENT.exec(rest);
|
|
57
|
+
if (match === null) return void 0;
|
|
58
|
+
segments.push((match[1] ?? "").replaceAll("\"\"", "\""));
|
|
59
|
+
rest = rest.slice(match[0].length);
|
|
60
|
+
if (rest.startsWith(".")) rest = rest.slice(1);
|
|
61
|
+
else if (rest !== "") return void 0;
|
|
62
|
+
}
|
|
63
|
+
return segments.length === 1 || segments.length === 2 ? segments : void 0;
|
|
64
|
+
}
|
|
65
|
+
function catalogTextOf(resolved, dataTypes) {
|
|
66
|
+
const type = dataTypes.filter(isSqlDataType).find(({ id }) => id === resolved.dataType);
|
|
67
|
+
return type === void 0 ? resolved.dataType : renderSqlCatalogText(type, resolved.typeParams);
|
|
68
|
+
}
|
|
69
|
+
function columnTypeUnreadable(type, where, reason) {
|
|
70
|
+
throw postgresError("MIGRATION.COLUMN_TYPE_UNREADABLE", `${where}: ${reason}`, {
|
|
71
|
+
why: "A column type change checks afterwards that the column has the new type as the database prints it, and finds that text through the data types the configured stack registers.",
|
|
72
|
+
fix: "Write the type as a migration writes it, for example int4 or varchar(20), or an enum by its quoted name, such as \"Mood\". If the type comes from an extension, add that extension to the configuration.",
|
|
73
|
+
meta: {
|
|
74
|
+
type,
|
|
75
|
+
where
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The type `format_type` prints for a column altered to `type`, written as a migration writes it:
|
|
81
|
+
* the catalog text of the one data type of `dataTypes` that reads it, or for an enum, named by its
|
|
82
|
+
* quoted name, that name quoted where Postgres quotes it, without the `public` schema, which
|
|
83
|
+
* `format_type` leaves out as the planner's own enum names do. A list type keeps one `[]`, as
|
|
84
|
+
* `format_type` prints it. The planner and the `alterColumnType` facade both check the alter with
|
|
85
|
+
* this text, so re-running a migration reproduces its operations. `where` names the call in the
|
|
86
|
+
* error a type no data type reads raises.
|
|
87
|
+
*/
|
|
88
|
+
function alterTypeCheckText(type, dataTypes, where) {
|
|
89
|
+
const trimmed = type.trim();
|
|
90
|
+
const array = ARRAY_SUFFIX.exec(trimmed);
|
|
91
|
+
const base = array?.[1] ?? trimmed;
|
|
92
|
+
const suffix = array === null ? "" : "[]";
|
|
93
|
+
const texts = [...new Set(resolveWrittenSqlTypes(base, dataTypes).map((resolved) => catalogTextOf(resolved, dataTypes)))];
|
|
94
|
+
const [only] = texts;
|
|
95
|
+
if (only !== void 0 && texts.length === 1) return `${only}${suffix}`;
|
|
96
|
+
if (texts.length > 1) return columnTypeUnreadable(type, where, `more than one data type of the configured stack reads the type "${type}", as ${texts.join(" and ")}`);
|
|
97
|
+
const name = quotedName(base);
|
|
98
|
+
const namesItself = dataTypes.some((dataType) => isSqlDataType(dataType) && dataType.sql.claimsKind !== void 0);
|
|
99
|
+
if (name !== void 0 && namesItself) {
|
|
100
|
+
const [schema, ...rest] = name;
|
|
101
|
+
return `${(rest.length > 0 && schema === "public" ? rest : name).map(quoteIdentifierWhereNeeded).join(".")}${suffix}`;
|
|
102
|
+
}
|
|
103
|
+
return columnTypeUnreadable(type, where, `no data type of the configured stack reads the type "${type}"`);
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { stackDataTypes as i, buildExpectedFormatType as n, qualifyTableName as r, alterTypeCheckText as t };
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=planner-sql-checks-CX37qDix-Gkq38UQQ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-sql-checks-CX37qDix-Gkq38UQQ.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-sql-checks-CX37qDix.mjs"],"sourcesContent":["import { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { a as quoteIdentifierWhereNeeded } from \"./sql-utils-Df-nf6eM.mjs\";\nimport \"./namespace-ids-xtp_ZY86.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-Ysxbqkzr.mjs\";\nimport { dataTypeParams, isSqlDataType, renderSqlCatalogText, resolveWrittenSqlTypes, sqlDataTypeOfCodec, unquotedSqlBaseName } from \"@internal/sql-contract/data-type\";\nimport { assembleDataTypes } from \"@internal/framework-components/codec\";\n//#region src/core/migrations/planner-type-resolution.ts\nfunction resolveColumnTypeMetadata(column, storageTypes) {\n\tif (!column.typeRef) return column;\n\tconst referencedType = storageTypes[column.typeRef];\n\tif (!referencedType) return column;\n\treturn {\n\t\tcodecId: referencedType.codecId,\n\t\ttypeParams: referencedType.typeParams\n\t};\n}\n//#endregion\n//#region src/core/migrations/planner-sql-checks.ts\n/**\n* String-keyed entry points the migration ops use to render\n* schema-qualified DDL and catalog checks. The `schema` argument is\n* interpreted as a namespace coordinate: the framework `__unbound__`\n* sentinel resolves to the late-bound `PostgresUnboundSchema` singleton\n* (which elides the qualifier so `search_path` decides at runtime); any\n* other id materialises a `PostgresSchema(id)` whose qualifier is the\n* named schema. Helpers route through these `Namespace` concretions so\n* the unbound branch lives in the polymorphic override, not the call\n* site.\n*/\nfunction qualifyTableName(schema, table) {\n\treturn postgresCreateNamespace({\n\t\tid: schema,\n\t\tentries: { table: {} }\n\t}).qualifyTable(table);\n}\n/**\n* The type `format_type` prints, for the column's ALTER COLUMN TYPE postcheck: the catalog text of\n* its data type with normalised parameters, or for an enum its name, quoted where Postgres quotes\n* it.\n*/\nfunction buildExpectedFormatType(column, types, storageTypes = {}) {\n\tconst resolved = resolveColumnTypeMetadata(column, storageTypes);\n\tconst dataType = sqlDataTypeOfCodec(resolved.codecId, types);\n\tconst params = dataTypeParams(dataType, resolved.typeParams);\n\tif (dataType.sql.claimsKind !== void 0) return unquotedSqlBaseName(dataType, params).split(\".\").map(quoteIdentifierWhereNeeded).join(\".\");\n\treturn renderSqlCatalogText(dataType, params);\n}\n/** The data types the components of a stack register. */\nfunction stackDataTypes(frameworkComponents) {\n\treturn assembleDataTypes(frameworkComponents).declared.map(({ type }) => type);\n}\nconst ARRAY_SUFFIX = /^(.*?)(?:\\s*\\[\\s*\\])+$/s;\nconst QUOTED_SEGMENT = /^\"((?:[^\"]|\"\")+)\"/;\n/** The segments of a name written as one or two double-quoted identifiers, `\"Mood\"` or `\"app\".\"status\"`. */\nfunction quotedName(text) {\n\tconst segments = [];\n\tlet rest = text;\n\twhile (rest !== \"\") {\n\t\tconst match = QUOTED_SEGMENT.exec(rest);\n\t\tif (match === null) return void 0;\n\t\tsegments.push((match[1] ?? \"\").replaceAll(\"\\\"\\\"\", \"\\\"\"));\n\t\trest = rest.slice(match[0].length);\n\t\tif (rest.startsWith(\".\")) rest = rest.slice(1);\n\t\telse if (rest !== \"\") return void 0;\n\t}\n\treturn segments.length === 1 || segments.length === 2 ? segments : void 0;\n}\nfunction catalogTextOf(resolved, dataTypes) {\n\tconst type = dataTypes.filter(isSqlDataType).find(({ id }) => id === resolved.dataType);\n\treturn type === void 0 ? resolved.dataType : renderSqlCatalogText(type, resolved.typeParams);\n}\nfunction columnTypeUnreadable(type, where, reason) {\n\tthrow postgresError(\"MIGRATION.COLUMN_TYPE_UNREADABLE\", `${where}: ${reason}`, {\n\t\twhy: \"A column type change checks afterwards that the column has the new type as the database prints it, and finds that text through the data types the configured stack registers.\",\n\t\tfix: \"Write the type as a migration writes it, for example int4 or varchar(20), or an enum by its quoted name, such as \\\"Mood\\\". If the type comes from an extension, add that extension to the configuration.\",\n\t\tmeta: {\n\t\t\ttype,\n\t\t\twhere\n\t\t}\n\t});\n}\n/**\n* The type `format_type` prints for a column altered to `type`, written as a migration writes it:\n* the catalog text of the one data type of `dataTypes` that reads it, or for an enum, named by its\n* quoted name, that name quoted where Postgres quotes it, without the `public` schema, which\n* `format_type` leaves out as the planner's own enum names do. A list type keeps one `[]`, as\n* `format_type` prints it. The planner and the `alterColumnType` facade both check the alter with\n* this text, so re-running a migration reproduces its operations. `where` names the call in the\n* error a type no data type reads raises.\n*/\nfunction alterTypeCheckText(type, dataTypes, where) {\n\tconst trimmed = type.trim();\n\tconst array = ARRAY_SUFFIX.exec(trimmed);\n\tconst base = array?.[1] ?? trimmed;\n\tconst suffix = array === null ? \"\" : \"[]\";\n\tconst texts = [...new Set(resolveWrittenSqlTypes(base, dataTypes).map((resolved) => catalogTextOf(resolved, dataTypes)))];\n\tconst [only] = texts;\n\tif (only !== void 0 && texts.length === 1) return `${only}${suffix}`;\n\tif (texts.length > 1) return columnTypeUnreadable(type, where, `more than one data type of the configured stack reads the type \"${type}\", as ${texts.join(\" and \")}`);\n\tconst name = quotedName(base);\n\tconst namesItself = dataTypes.some((dataType) => isSqlDataType(dataType) && dataType.sql.claimsKind !== void 0);\n\tif (name !== void 0 && namesItself) {\n\t\tconst [schema, ...rest] = name;\n\t\treturn `${(rest.length > 0 && schema === \"public\" ? rest : name).map(quoteIdentifierWhereNeeded).join(\".\")}${suffix}`;\n\t}\n\treturn columnTypeUnreadable(type, where, `no data type of the configured stack reads the type \"${type}\"`);\n}\n//#endregion\nexport { stackDataTypes as i, buildExpectedFormatType as n, qualifyTableName as r, alterTypeCheckText as t };\n\n//# sourceMappingURL=planner-sql-checks-CX37qDix.mjs.map"],"mappings":";;;;;;AAOA,SAAS,0BAA0B,QAAQ,cAAc;CACxD,IAAI,CAAC,OAAO,SAAS,OAAO;CAC5B,MAAM,iBAAiB,aAAa,OAAO;CAC3C,IAAI,CAAC,gBAAgB,OAAO;CAC5B,OAAO;EACN,SAAS,eAAe;EACxB,YAAY,eAAe;CAC5B;AACD;;;;;;;;;;;;AAcA,SAAS,iBAAiB,QAAQ,OAAO;CACxC,OAAO,wBAAwB;EAC9B,IAAI;EACJ,SAAS,EAAE,OAAO,CAAC,EAAE;CACtB,CAAC,CAAC,CAAC,aAAa,KAAK;AACtB;;;;;;AAMA,SAAS,wBAAwB,QAAQ,OAAO,eAAe,CAAC,GAAG;CAClE,MAAM,WAAW,0BAA0B,QAAQ,YAAY;CAC/D,MAAM,WAAW,mBAAmB,SAAS,SAAS,KAAK;CAC3D,MAAM,SAAS,eAAe,UAAU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,aAAa,KAAK,OAAO;CACvC,MAAM,OAAO,QAAQ,MAAM;CAC3B,MAAM,SAAS,UAAU,OAAO,KAAK;CACrC,MAAM,QAAQ,CAAC,GAAG,IAAI,IAAI,uBAAuB,MAAM,SAAS,CAAC,CAAC,KAAK,aAAa,cAAc,UAAU,SAAS,CAAC,CAAC,CAAC;CACxH,MAAM,CAAC,QAAQ;CACf,IAAI,SAAS,KAAK,KAAK,MAAM,WAAW,GAAG,OAAO,GAAG,OAAO;CAC5D,IAAI,MAAM,SAAS,GAAG,OAAO,qBAAqB,MAAM,OAAO,mEAAmE,KAAK,QAAQ,MAAM,KAAK,OAAO,GAAG;CACpK,MAAM,OAAO,WAAW,IAAI;CAC5B,MAAM,cAAc,UAAU,MAAM,aAAa,cAAc,QAAQ,KAAK,SAAS,IAAI,eAAe,KAAK,CAAC;CAC9G,IAAI,SAAS,KAAK,KAAK,aAAa;EACnC,MAAM,CAAC,QAAQ,GAAG,QAAQ;EAC1B,OAAO,IAAI,KAAK,SAAS,KAAK,WAAW,WAAW,OAAO,KAAA,CAAM,IAAI,0BAA0B,CAAC,CAAC,KAAK,GAAG,IAAI;CAC9G;CACA,OAAO,qBAAqB,MAAM,OAAO,wDAAwD,KAAK,EAAE;AACzG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
2
|
+
//#region ../../../3-targets/3-targets/postgres/dist/planner-target-details-CUEF0s90.mjs
|
|
3
|
+
function buildTargetDetails(objectType, name, schema, table) {
|
|
4
|
+
return {
|
|
5
|
+
schema,
|
|
6
|
+
objectType,
|
|
7
|
+
name,
|
|
8
|
+
...ifDefined("table", table)
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { buildTargetDetails as t };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=planner-target-details-CUEF0s90-COTks5yz.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-target-details-CUEF0s90-COTks5yz.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-target-details-CUEF0s90.mjs"],"sourcesContent":["import { ifDefined } from \"@internal/utils/defined\";\n//#region src/core/migrations/planner-target-details.ts\nfunction buildTargetDetails(objectType, name, schema, table) {\n\treturn {\n\t\tschema,\n\t\tobjectType,\n\t\tname,\n\t\t...ifDefined(\"table\", table)\n\t};\n}\n//#endregion\nexport { buildTargetDetails as t };\n\n//# sourceMappingURL=planner-target-details-CUEF0s90.mjs.map"],"mappings":";;AAEA,SAAS,mBAAmB,YAAY,MAAM,QAAQ,OAAO;CAC5D,OAAO;EACN;EACA;EACA;EACA,GAAG,UAAU,SAAS,KAAK;CAC5B;AACD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as codecDescriptors } from "./codecs-
|
|
2
|
-
//#region ../../../3-targets/3-targets/postgres/dist/postgres-codec-traits-
|
|
1
|
+
import { r as codecDescriptors } from "./codecs-Cb5S70Lx-WRSQkpza.mjs";
|
|
2
|
+
//#region ../../../3-targets/3-targets/postgres/dist/postgres-codec-traits-BV62PF0L.mjs
|
|
3
3
|
const TRAITS_BY_CODEC_ID = new Map(codecDescriptors.map((descriptor) => [descriptor.codecId, descriptor.traits]));
|
|
4
4
|
/** The traits of a Postgres codec, or `undefined` for a codec the target does not register. */
|
|
5
5
|
function postgresCodecTraitsOf(codecId) {
|
|
@@ -8,4 +8,4 @@ function postgresCodecTraitsOf(codecId) {
|
|
|
8
8
|
//#endregion
|
|
9
9
|
export { postgresCodecTraitsOf as t };
|
|
10
10
|
|
|
11
|
-
//# sourceMappingURL=postgres-codec-traits-
|
|
11
|
+
//# sourceMappingURL=postgres-codec-traits-BV62PF0L-NuMNArAx.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-codec-traits-
|
|
1
|
+
{"version":3,"file":"postgres-codec-traits-BV62PF0L-NuMNArAx.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/postgres-codec-traits-BV62PF0L.mjs"],"sourcesContent":["import { t as codecDescriptors } from \"./codecs-Cb5S70Lx.mjs\";\n//#region src/core/postgres-codec-traits.ts\nconst TRAITS_BY_CODEC_ID = new Map(codecDescriptors.map((descriptor) => [descriptor.codecId, descriptor.traits]));\n/** The traits of a Postgres codec, or `undefined` for a codec the target does not register. */\nfunction postgresCodecTraitsOf(codecId) {\n\treturn TRAITS_BY_CODEC_ID.get(codecId);\n}\n//#endregion\nexport { postgresCodecTraitsOf as t };\n\n//# sourceMappingURL=postgres-codec-traits-BV62PF0L.mjs.map"],"mappings":";;AAEA,MAAM,qBAAqB,IAAI,IAAI,iBAAiB,KAAK,eAAe,CAAC,WAAW,SAAS,WAAW,MAAM,CAAC,CAAC;;AAEhH,SAAS,sBAAsB,SAAS;CACvC,OAAO,mBAAmB,IAAI,OAAO;AACtC"}
|