@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
package/dist/{op-factory-call-DiwaNQVO-NSekrcmI.mjs → op-factory-call-ltgiEZ8g-CX6WX57X.mjs}
RENAMED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { i as quoteIdentifier, n as escapeLiteral, o as quoteQualifiedName, s as validateEnumValueLength, t as POSTGRES_QUOTING } from "./sql-utils-Df-nf6eM-Ov1KgjWm.mjs";
|
|
3
3
|
import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs";
|
|
4
|
-
import { A as tableIsEmptyAst, C as nativeEnumTypeExistsAst, D as rlsPolicyExistsAst, E as rlsEnabledAst, O as sequenceNameAvailableAst, S as indexExistsAst, T as noNullValuesAst, _ as dropDefaultAction, a as columnDefaultAst, b as dropType, c as columnNullabilityAst, d as createIndex$1, f as createPolicy, g as disableRowLevelSecurity$1, h as createType, i as alterTable, k as tableExistsAst, l as columnTypeAst, m as createTable, n as alterIndexRename, o as columnDefaultSequenceAst, p as createSchema, r as alterPolicyRename, s as columnExistsAst, t as addColumnAction, u as constraintExistsAst, v as dropIndex$1, w as nativeEnumValueExistsAst, x as extensionExistsAst, y as dropPolicy } from "./ddl-
|
|
5
|
-
import {
|
|
4
|
+
import { A as tableIsEmptyAst, C as nativeEnumTypeExistsAst, D as rlsPolicyExistsAst, E as rlsEnabledAst, O as sequenceNameAvailableAst, S as indexExistsAst, T as noNullValuesAst, _ as dropDefaultAction, a as columnDefaultAst, b as dropType, c as columnNullabilityAst, d as createIndex$1, f as createPolicy, g as disableRowLevelSecurity$1, h as createType, i as alterTable, k as tableExistsAst, l as columnTypeAst, m as createTable, n as alterIndexRename, o as columnDefaultSequenceAst, p as createSchema, r as alterPolicyRename, s as columnExistsAst, t as addColumnAction, u as constraintExistsAst, v as dropIndex$1, w as nativeEnumValueExistsAst, x as extensionExistsAst, y as dropPolicy } from "./ddl-BKqbtVN3-CPHiYaCY.mjs";
|
|
5
|
+
import { t as autoincrementWidth } from "./autoincrement-widths-DbyXRo5B-BUVCYb_V.mjs";
|
|
6
6
|
import { t as postgresObjectName } from "./postgres-object-name-FPikIvOw-BNs44hTu.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import { r as qualifyTableName, t as alterTypeCheckText } from "./planner-sql-checks-CX37qDix-Gkq38UQQ.mjs";
|
|
8
|
+
import { t as buildTargetDetails } from "./planner-target-details-CUEF0s90-COTks5yz.mjs";
|
|
8
9
|
import { DdlColumn, FunctionColumnDefault, LiteralColumnDefault, opaqueSql, renderOpaqueSql } from "@prisma/orm-family-sql/relational-core/ast";
|
|
9
10
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
10
11
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
11
12
|
import { namingOf } from "@prisma/orm-family-sql/schema-ir/naming";
|
|
12
13
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
13
14
|
import { col } from "@prisma/orm-family-sql/relational-core/contract-free";
|
|
14
|
-
import { createSqlTextSources } from "@prisma/orm-family-sql/family/control";
|
|
15
|
+
import { checkSqlDefaultText, checkSqlExpressionText, convertedColumnMeta, createSqlTextSources, isUnfilledSlot, requiredColumnMeta, slotSource, sqlOfSlot } from "@prisma/orm-family-sql/family/control";
|
|
15
16
|
import { InternalError, assertNever } from "@prisma/orm-framework/utils/internal-error";
|
|
16
17
|
import { unfilledPlaceholderOperation } from "@prisma/orm-framework/errors/migration";
|
|
17
18
|
import { TsExpression, jsonToTsSource, tsObjectSource } from "@prisma/orm-framework/ts-render";
|
|
18
19
|
import { REFERENTIAL_ACTION_SQL } from "@prisma/orm-family-sql/contract/referential-action-sql";
|
|
19
|
-
//#region ../../../3-targets/3-targets/postgres/dist/op-factory-call-
|
|
20
|
+
//#region ../../../3-targets/3-targets/postgres/dist/op-factory-call-ltgiEZ8g.mjs
|
|
20
21
|
/**
|
|
21
22
|
* Maps a planner schema name to the contract-free DDL builder's optional
|
|
22
23
|
* `schema` field: the unbound sentinel becomes `undefined` (the builder omits
|
|
@@ -101,16 +102,12 @@ async function renameColumn(schemaName, tableName, fromName, toName, lowerer) {
|
|
|
101
102
|
};
|
|
102
103
|
}
|
|
103
104
|
/**
|
|
104
|
-
* `
|
|
105
|
-
* `
|
|
106
|
-
* native name for built-ins). `formatTypeExpected` is the unqualified
|
|
107
|
-
* `format_type` form used in the postcheck. `rawTargetTypeForLabel` is the
|
|
108
|
-
* string appearing in the human-readable label (typically `toType` when
|
|
109
|
-
* explicit, else the column's native type).
|
|
105
|
+
* `type` is the new column type as a migration writes it, into the `ALTER COLUMN TYPE` clause.
|
|
106
|
+
* `checkType` is the type `format_type` prints for it, which the postcheck compares.
|
|
110
107
|
*/
|
|
111
108
|
async function alterColumnType(schemaName, tableName, columnName, options, lowerer, operationClass = "destructive") {
|
|
112
109
|
const qualified = qualifyTableName(schemaName, tableName);
|
|
113
|
-
const usingClause = options.using ? ` USING ${renderOpaqueSql(opaqueSql(options.using))}` : ` USING ${quoteIdentifier(columnName)}::${options.
|
|
110
|
+
const usingClause = options.using ? ` USING ${renderOpaqueSql(opaqueSql(options.using))}` : ` USING ${quoteIdentifier(columnName)}::${options.type}`;
|
|
114
111
|
const { present } = await columnExistsSteps(lowerer, {
|
|
115
112
|
schema: schemaName,
|
|
116
113
|
table: tableName,
|
|
@@ -120,16 +117,19 @@ async function alterColumnType(schemaName, tableName, columnName, options, lower
|
|
|
120
117
|
schema: schemaName,
|
|
121
118
|
table: tableName,
|
|
122
119
|
column: columnName,
|
|
123
|
-
expectedType: options.
|
|
120
|
+
expectedType: options.checkType
|
|
124
121
|
}));
|
|
125
122
|
return {
|
|
126
123
|
id: `alterType.${tableName}.${columnName}`,
|
|
127
|
-
label: `Alter type of "${tableName}"."${columnName}" to ${options.
|
|
124
|
+
label: `Alter type of "${tableName}"."${columnName}" to ${options.type}`,
|
|
128
125
|
operationClass,
|
|
129
126
|
target: targetDetails("column", columnName, schemaName, tableName),
|
|
130
127
|
precheck: [step(`ensure column "${columnName}" exists`, present.sql, present.params)],
|
|
131
|
-
execute: [
|
|
132
|
-
|
|
128
|
+
execute: [{
|
|
129
|
+
...step(`alter type of "${columnName}"`, `ALTER TABLE ${qualified} ALTER COLUMN ${quoteIdentifier(columnName)} TYPE ${options.type}${usingClause}`),
|
|
130
|
+
...options.using !== void 0 ? { meta: convertedColumnMeta(tableName, columnName, "conversion") } : operationClass === "destructive" ? { meta: convertedColumnMeta(tableName, columnName, "cast") } : {}
|
|
131
|
+
}],
|
|
132
|
+
postcheck: [step(`verify column "${columnName}" has type "${options.checkType}"`, typeCheck.sql, typeCheck.params)],
|
|
133
133
|
meta: { warning: "TABLE_REWRITE" }
|
|
134
134
|
};
|
|
135
135
|
}
|
|
@@ -156,7 +156,10 @@ async function setNotNull(schemaName, tableName, columnName, lowerer) {
|
|
|
156
156
|
label: `Set NOT NULL on "${tableName}"."${columnName}"`,
|
|
157
157
|
operationClass: "widening",
|
|
158
158
|
target: targetDetails("column", columnName, schemaName, tableName),
|
|
159
|
-
precheck: [step(`ensure column "${columnName}" exists`, present.sql, present.params),
|
|
159
|
+
precheck: [step(`ensure column "${columnName}" exists`, present.sql, present.params), {
|
|
160
|
+
...step(`ensure no NULL values in "${columnName}"`, noNulls.sql, noNulls.params),
|
|
161
|
+
meta: requiredColumnMeta(tableName, columnName, "nullValues")
|
|
162
|
+
}],
|
|
160
163
|
execute: [step(`set NOT NULL on "${columnName}"`, `ALTER TABLE ${qualified} ALTER COLUMN ${quoteIdentifier(columnName)} SET NOT NULL`)],
|
|
161
164
|
postcheck: [step(`verify column "${columnName}" is NOT NULL`, notNullable.sql, notNullable.params)]
|
|
162
165
|
};
|
|
@@ -312,7 +315,7 @@ async function dropDefault(schemaName, tableName, columnName, lowerer) {
|
|
|
312
315
|
* empty; the execute step lowers the typed `AddColumn` DDL node through the
|
|
313
316
|
* adapter; postchecks assert the column exists and is NOT NULL.
|
|
314
317
|
*/
|
|
315
|
-
async function
|
|
318
|
+
async function addRequiredColumnToEmptyTable(schemaName, tableName, column, lowerer) {
|
|
316
319
|
const columnName = column.name;
|
|
317
320
|
const addColumn = await lowerer.lowerToExecuteRequest(alterTable({
|
|
318
321
|
...ifDefined("schema", boundSchema(schemaName)),
|
|
@@ -342,7 +345,10 @@ async function addNotNullColumnDirect(schemaName, tableName, column, lowerer) {
|
|
|
342
345
|
summary: `Adds column ${columnName} to table ${tableName}`,
|
|
343
346
|
operationClass: "additive",
|
|
344
347
|
target: targetDetails("column", columnName, schemaName, tableName),
|
|
345
|
-
precheck: [step(`ensure column "${columnName}" is missing`, absent.sql, absent.params),
|
|
348
|
+
precheck: [step(`ensure column "${columnName}" is missing`, absent.sql, absent.params), {
|
|
349
|
+
...step(`ensure table "${tableName}" is empty before adding NOT NULL column without default`, tableEmpty.sql, tableEmpty.params),
|
|
350
|
+
meta: requiredColumnMeta(tableName, columnName, "newField")
|
|
351
|
+
}],
|
|
346
352
|
execute: [step(`add column "${columnName}"`, addColumn.sql)],
|
|
347
353
|
postcheck: [step(`verify column "${columnName}" exists`, present.sql, present.params), step(`verify column "${columnName}" is NOT NULL`, notNullable.sql, notNullable.params)]
|
|
348
354
|
};
|
|
@@ -847,14 +853,6 @@ async function renameTable(schemaName, fromName, toName, lowerer) {
|
|
|
847
853
|
postcheck: [step(`verify table "${toName}" exists`, toPresent.sql, toPresent.params), step(`verify table "${fromName}" no longer exists`, fromAbsent.sql, fromAbsent.params)]
|
|
848
854
|
};
|
|
849
855
|
}
|
|
850
|
-
function buildTargetDetails(objectType, name, schema, table) {
|
|
851
|
-
return {
|
|
852
|
-
schema,
|
|
853
|
-
objectType,
|
|
854
|
-
name,
|
|
855
|
-
...ifDefined("table", table)
|
|
856
|
-
};
|
|
857
|
-
}
|
|
858
856
|
function buildAddColumnOperationIdentity(schema, tableName, columnName) {
|
|
859
857
|
return {
|
|
860
858
|
id: `column.${tableName}.${columnName}`,
|
|
@@ -867,8 +865,8 @@ function buildAddColumnOperationIdentity(schema, tableName, columnName) {
|
|
|
867
865
|
};
|
|
868
866
|
}
|
|
869
867
|
async function buildAddNotNullColumnWithTemporaryDefaultOperation(options) {
|
|
870
|
-
const { schema, tableName, columnName,
|
|
871
|
-
const ddlColumn = col(columnName,
|
|
868
|
+
const { schema, tableName, columnName, type, temporaryDefault, lowerer } = options;
|
|
869
|
+
const ddlColumn = col(columnName, type, {
|
|
872
870
|
notNull: true,
|
|
873
871
|
default: new FunctionColumnDefault(opaqueSql(temporaryDefault))
|
|
874
872
|
});
|
|
@@ -1322,39 +1320,87 @@ var DropColumnCall = class extends PostgresOpFactoryCallNode {
|
|
|
1322
1320
|
return [];
|
|
1323
1321
|
}
|
|
1324
1322
|
};
|
|
1323
|
+
/** An `alterColumnType` call named by the column it alters, as its errors name it. */
|
|
1324
|
+
function alterColumnTypeCallText(schema, table, column) {
|
|
1325
|
+
return `alterColumnType({ ${columnCallLocation(schema, table, column).join(", ")} })`;
|
|
1326
|
+
}
|
|
1325
1327
|
var AlterColumnTypeCall = class extends PostgresOpFactoryCallNode {
|
|
1326
1328
|
factoryName = "alterColumnType";
|
|
1327
1329
|
operationClass;
|
|
1328
1330
|
schemaName;
|
|
1329
1331
|
tableName;
|
|
1330
1332
|
columnName;
|
|
1331
|
-
|
|
1333
|
+
/** The new type as a migration writes it. */
|
|
1334
|
+
type;
|
|
1335
|
+
using;
|
|
1336
|
+
/** The type `format_type` prints once the alter has run, which the postcheck compares. */
|
|
1337
|
+
checkType;
|
|
1332
1338
|
label;
|
|
1333
|
-
constructor(
|
|
1339
|
+
constructor(input) {
|
|
1334
1340
|
super();
|
|
1335
|
-
this.schemaName = schemaName;
|
|
1336
|
-
this.tableName = tableName;
|
|
1337
|
-
this.columnName = columnName;
|
|
1338
|
-
this.
|
|
1339
|
-
this.
|
|
1340
|
-
this.
|
|
1341
|
+
this.schemaName = input.schemaName;
|
|
1342
|
+
this.tableName = input.tableName;
|
|
1343
|
+
this.columnName = input.columnName;
|
|
1344
|
+
this.type = input.type;
|
|
1345
|
+
this.using = input.using;
|
|
1346
|
+
this.operationClass = input.operationClass ?? this.#defaultClass();
|
|
1347
|
+
this.#refuseUnsafeUsing();
|
|
1348
|
+
this.checkType = alterTypeCheckText(input.type, input.dataTypes, this.#callText());
|
|
1349
|
+
this.label = `Alter type of "${input.tableName}"."${input.columnName}" to ${input.type}`;
|
|
1341
1350
|
this.freeze();
|
|
1342
1351
|
}
|
|
1352
|
+
#refuseUnsafeUsing() {
|
|
1353
|
+
if (this.using?.kind !== "sql") return;
|
|
1354
|
+
const refused = checkSqlExpressionText(this.using.sql, POSTGRES_QUOTING);
|
|
1355
|
+
if (refused === void 0) return;
|
|
1356
|
+
const call = this.#callText();
|
|
1357
|
+
throw postgresError("MIGRATION.SQL_EXPRESSION_INVALID", `${call}: using ${JSON.stringify(this.using.sql)} holds ${refused}, which could end or extend the ALTER COLUMN … TYPE statement it is written into`, {
|
|
1358
|
+
why: "The conversion is written into the USING clause of ALTER COLUMN … TYPE. The check refuses a semicolon, a SQL comment, dollar quoting, and a comma or a statement keyword outside parentheses, since each could end or extend that statement; it does not check that the text is valid SQL.",
|
|
1359
|
+
fix: `Write using as one SQL expression over the column, such as "${this.columnName}"::${this.type}. If it holds a comma or a keyword such as FROM outside parentheses, wrap it in parentheses.`,
|
|
1360
|
+
meta: {
|
|
1361
|
+
call,
|
|
1362
|
+
field: "using",
|
|
1363
|
+
expression: this.using.sql,
|
|
1364
|
+
refused
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
#defaultClass() {
|
|
1369
|
+
return this.using === void 0 ? "destructive" : "data";
|
|
1370
|
+
}
|
|
1371
|
+
#callText() {
|
|
1372
|
+
return alterColumnTypeCallText(this.schemaName, this.tableName, this.columnName);
|
|
1373
|
+
}
|
|
1343
1374
|
async toOp(lowerer) {
|
|
1375
|
+
if (isUnfilledSlot(this.using)) return unfilledPlaceholderOperation(this.label);
|
|
1344
1376
|
if (lowerer === void 0) throw postgresError("MIGRATION.POSTGRES_CONTROL_STACK_MISSING", `AlterColumnTypeCall.toOp: a lowerer is required on the Postgres planner path (column "${this.columnName}" on table "${this.tableName}"). Pass the control adapter to createPostgresMigrationPlanner.`, { meta: { factory: "AlterColumnTypeCall" } });
|
|
1345
|
-
return alterColumnType(this.schemaName, this.tableName, this.columnName,
|
|
1377
|
+
return alterColumnType(this.schemaName, this.tableName, this.columnName, {
|
|
1378
|
+
type: this.type,
|
|
1379
|
+
checkType: this.checkType,
|
|
1380
|
+
...ifDefined("using", sqlOfSlot(this.using))
|
|
1381
|
+
}, lowerer, this.operationClass);
|
|
1346
1382
|
}
|
|
1347
1383
|
renderTypeScript() {
|
|
1348
|
-
|
|
1349
|
-
if (this.schemaName !== UNBOUND_NAMESPACE_ID) opts.push(`schema: ${jsonToTsSource(this.schemaName)}`);
|
|
1350
|
-
opts.push(`table: ${jsonToTsSource(this.tableName)}`);
|
|
1351
|
-
opts.push(`column: ${jsonToTsSource(this.columnName)}`);
|
|
1352
|
-
opts.push(`options: ${jsonToTsSource(this.options)}`);
|
|
1353
|
-
if (this.operationClass !== "destructive") opts.push(`operationClass: ${jsonToTsSource(this.operationClass)}`);
|
|
1354
|
-
return `this.alterColumnType({ ${opts.join(", ")} })`;
|
|
1384
|
+
return this.#written().source;
|
|
1355
1385
|
}
|
|
1356
1386
|
importRequirements() {
|
|
1357
|
-
return [
|
|
1387
|
+
return [...isUnfilledSlot(this.using) ? [{
|
|
1388
|
+
moduleSpecifier: POSTGRES_MIGRATION_FACADE,
|
|
1389
|
+
symbol: "placeholder"
|
|
1390
|
+
}] : [], ...this.#written().imports];
|
|
1391
|
+
}
|
|
1392
|
+
#written() {
|
|
1393
|
+
const sql = createSqlTextSources(POSTGRES_MIGRATION_FACADE);
|
|
1394
|
+
const using = this.using === void 0 ? [] : [`using: ${slotSource(this.using, sql)}`];
|
|
1395
|
+
return {
|
|
1396
|
+
source: `this.alterColumnType({ ${[
|
|
1397
|
+
...columnCallLocation(this.schemaName, this.tableName, this.columnName),
|
|
1398
|
+
`type: ${jsonToTsSource(this.type)}`,
|
|
1399
|
+
...using,
|
|
1400
|
+
...this.operationClass === this.#defaultClass() ? [] : [`operationClass: ${jsonToTsSource(this.operationClass)}`]
|
|
1401
|
+
].join(", ")} })`,
|
|
1402
|
+
imports: sql.imports()
|
|
1403
|
+
};
|
|
1358
1404
|
}
|
|
1359
1405
|
};
|
|
1360
1406
|
var SetNotNullCall = class extends PostgresOpFactoryCallNode {
|
|
@@ -1497,95 +1543,110 @@ var DropDefaultCall = class extends PostgresOpFactoryCallNode {
|
|
|
1497
1543
|
return [];
|
|
1498
1544
|
}
|
|
1499
1545
|
};
|
|
1546
|
+
function columnCallLocation(schemaName, tableName, columnName) {
|
|
1547
|
+
return [
|
|
1548
|
+
...schemaName === UNBOUND_NAMESPACE_ID ? [] : [`schema: ${jsonToTsSource(schemaName)}`],
|
|
1549
|
+
`table: ${jsonToTsSource(tableName)}`,
|
|
1550
|
+
`column: ${jsonToTsSource(columnName)}`
|
|
1551
|
+
];
|
|
1552
|
+
}
|
|
1500
1553
|
/**
|
|
1501
|
-
*
|
|
1502
|
-
* a
|
|
1503
|
-
*
|
|
1504
|
-
*
|
|
1505
|
-
* No authored `PostgresMigration` method: this call is only emitted by the
|
|
1506
|
-
* planner, never hand-written by migration authors.
|
|
1554
|
+
* Adds a required column with no default to a table that must be empty when the migration runs:
|
|
1555
|
+
* a column in a new primary key, unique constraint or foreign key, where one temporary value in
|
|
1556
|
+
* every row would break the constraint.
|
|
1507
1557
|
*/
|
|
1508
|
-
var
|
|
1509
|
-
factoryName = "
|
|
1558
|
+
var AddRequiredColumnToEmptyTableCall = class extends PostgresOpFactoryCallNode {
|
|
1559
|
+
factoryName = "addRequiredColumnToEmptyTable";
|
|
1510
1560
|
operationClass = "additive";
|
|
1511
1561
|
schemaName;
|
|
1512
1562
|
tableName;
|
|
1513
1563
|
columnName;
|
|
1514
|
-
column
|
|
1564
|
+
/** The column's type as a migration writes it. */
|
|
1565
|
+
type;
|
|
1515
1566
|
label;
|
|
1516
|
-
constructor(schemaName, tableName, columnName,
|
|
1567
|
+
constructor(schemaName, tableName, columnName, type) {
|
|
1517
1568
|
super();
|
|
1518
1569
|
this.schemaName = schemaName;
|
|
1519
1570
|
this.tableName = tableName;
|
|
1520
1571
|
this.columnName = columnName;
|
|
1521
|
-
this.
|
|
1572
|
+
this.type = type;
|
|
1522
1573
|
this.label = `Add column ${columnName} to ${tableName}`;
|
|
1523
1574
|
this.freeze();
|
|
1524
1575
|
}
|
|
1525
1576
|
async toOp(lowerer) {
|
|
1526
|
-
if (lowerer === void 0) throw postgresError("MIGRATION.POSTGRES_CONTROL_STACK_MISSING", `
|
|
1527
|
-
return
|
|
1577
|
+
if (lowerer === void 0) throw postgresError("MIGRATION.POSTGRES_CONTROL_STACK_MISSING", `AddRequiredColumnToEmptyTableCall.toOp: a lowerer is required on the Postgres planner path (column "${this.columnName}" on table "${this.tableName}"). Pass the control adapter to createPostgresMigrationPlanner.`, { meta: { factory: "AddRequiredColumnToEmptyTableCall" } });
|
|
1578
|
+
return addRequiredColumnToEmptyTable(this.schemaName, this.tableName, col(this.columnName, this.type, { notNull: true }), lowerer);
|
|
1528
1579
|
}
|
|
1529
1580
|
renderTypeScript() {
|
|
1530
|
-
return `
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
})})`;
|
|
1581
|
+
return `this.addRequiredColumnToEmptyTable({ ${[...columnCallLocation(this.schemaName, this.tableName, this.columnName), `type: ${jsonToTsSource(this.type)}`].join(", ")} })`;
|
|
1582
|
+
}
|
|
1583
|
+
importRequirements() {
|
|
1584
|
+
return [];
|
|
1535
1585
|
}
|
|
1536
1586
|
};
|
|
1537
1587
|
/**
|
|
1538
|
-
*
|
|
1539
|
-
*
|
|
1540
|
-
* needed for `buildAddNotNullColumnWithTemporaryDefaultOperation`; both the
|
|
1541
|
-
* typed ADD COLUMN execute step and the pre/postchecks are lowered via the
|
|
1542
|
-
* adapter at `toOp` time.
|
|
1543
|
-
*
|
|
1544
|
-
* No authored `PostgresMigration` method: this call is only emitted by the
|
|
1545
|
-
* planner, never hand-written by migration authors.
|
|
1588
|
+
* Adds a required column with no default to a table that may have rows: the column is added with
|
|
1589
|
+
* `temporaryDefault`, a SQL value every existing row takes, and the default is then dropped.
|
|
1546
1590
|
*/
|
|
1547
|
-
var
|
|
1548
|
-
factoryName = "
|
|
1591
|
+
var AddColumnWithTemporaryDefaultCall = class extends PostgresOpFactoryCallNode {
|
|
1592
|
+
factoryName = "addColumnWithTemporaryDefault";
|
|
1549
1593
|
operationClass = "additive";
|
|
1550
1594
|
schemaName;
|
|
1551
1595
|
tableName;
|
|
1552
1596
|
columnName;
|
|
1553
|
-
column
|
|
1554
|
-
|
|
1555
|
-
|
|
1597
|
+
/** The column's type as a migration writes it. */
|
|
1598
|
+
type;
|
|
1599
|
+
/** SQL for the value existing rows take, such as `''` or `0`. */
|
|
1556
1600
|
temporaryDefault;
|
|
1557
1601
|
label;
|
|
1558
|
-
constructor(
|
|
1602
|
+
constructor(schemaName, tableName, columnName, type, temporaryDefault) {
|
|
1559
1603
|
super();
|
|
1560
|
-
this.schemaName =
|
|
1561
|
-
this.tableName =
|
|
1562
|
-
this.columnName =
|
|
1563
|
-
this.
|
|
1564
|
-
this.
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1604
|
+
this.schemaName = schemaName;
|
|
1605
|
+
this.tableName = tableName;
|
|
1606
|
+
this.columnName = columnName;
|
|
1607
|
+
this.type = type;
|
|
1608
|
+
this.temporaryDefault = temporaryDefault;
|
|
1609
|
+
const refused = checkSqlDefaultText(temporaryDefault);
|
|
1610
|
+
if (refused !== void 0) {
|
|
1611
|
+
const call = `addColumnWithTemporaryDefault({ ${columnCallLocation(schemaName, tableName, columnName).join(", ")} })`;
|
|
1612
|
+
throw postgresError("CONTRACT.DEFAULT_INVALID", `${call}: temporaryDefault ${JSON.stringify(temporaryDefault)} is not a value: ${refused}`, {
|
|
1613
|
+
fix: "Write temporaryDefault as one SQL value, such as '' or 0.",
|
|
1614
|
+
meta: {
|
|
1615
|
+
expression: temporaryDefault,
|
|
1616
|
+
where: call
|
|
1617
|
+
}
|
|
1618
|
+
});
|
|
1619
|
+
}
|
|
1620
|
+
this.label = `Add column ${columnName} to ${tableName}`;
|
|
1568
1621
|
this.freeze();
|
|
1569
1622
|
}
|
|
1570
1623
|
async toOp(lowerer) {
|
|
1571
|
-
if (lowerer === void 0) throw postgresError("MIGRATION.POSTGRES_CONTROL_STACK_MISSING", `
|
|
1624
|
+
if (lowerer === void 0) throw postgresError("MIGRATION.POSTGRES_CONTROL_STACK_MISSING", `AddColumnWithTemporaryDefaultCall.toOp: a lowerer is required on the Postgres planner path (column "${this.columnName}" on table "${this.tableName}"). Pass the control adapter to createPostgresMigrationPlanner.`, { meta: { factory: "AddColumnWithTemporaryDefaultCall" } });
|
|
1572
1625
|
return buildAddNotNullColumnWithTemporaryDefaultOperation({
|
|
1573
1626
|
schema: this.schemaName,
|
|
1574
1627
|
tableName: this.tableName,
|
|
1575
1628
|
columnName: this.columnName,
|
|
1576
|
-
|
|
1577
|
-
types: this.types,
|
|
1578
|
-
storageTypes: this.storageTypes,
|
|
1629
|
+
type: this.type,
|
|
1579
1630
|
temporaryDefault: this.temporaryDefault,
|
|
1580
1631
|
lowerer
|
|
1581
1632
|
});
|
|
1582
1633
|
}
|
|
1583
1634
|
renderTypeScript() {
|
|
1584
|
-
return
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1635
|
+
return this.#written().source;
|
|
1636
|
+
}
|
|
1637
|
+
importRequirements() {
|
|
1638
|
+
return this.#written().imports;
|
|
1639
|
+
}
|
|
1640
|
+
#written() {
|
|
1641
|
+
const sql = createSqlTextSources(POSTGRES_MIGRATION_FACADE);
|
|
1642
|
+
return {
|
|
1643
|
+
source: `this.addColumnWithTemporaryDefault({ ${[
|
|
1644
|
+
...columnCallLocation(this.schemaName, this.tableName, this.columnName),
|
|
1645
|
+
`type: ${jsonToTsSource(this.type)}`,
|
|
1646
|
+
`temporaryDefault: ${sql.source(this.temporaryDefault)}`
|
|
1647
|
+
].join(", ")} })`,
|
|
1648
|
+
imports: sql.imports()
|
|
1649
|
+
};
|
|
1589
1650
|
}
|
|
1590
1651
|
};
|
|
1591
1652
|
function constraintCallOptions(schemaName, tableName, constraintName) {
|
|
@@ -2164,12 +2225,14 @@ var DataTransformCall = class extends PostgresOpFactoryCallNode {
|
|
|
2164
2225
|
label;
|
|
2165
2226
|
checkSlot;
|
|
2166
2227
|
runSlot;
|
|
2167
|
-
|
|
2228
|
+
backfillsColumn;
|
|
2229
|
+
constructor(label, checkSlot, runSlot, operationClass = "data", backfillsColumn) {
|
|
2168
2230
|
super();
|
|
2169
2231
|
this.label = label;
|
|
2170
2232
|
this.checkSlot = checkSlot;
|
|
2171
2233
|
this.runSlot = runSlot;
|
|
2172
2234
|
this.operationClass = operationClass;
|
|
2235
|
+
this.backfillsColumn = backfillsColumn;
|
|
2173
2236
|
this.freeze();
|
|
2174
2237
|
}
|
|
2175
2238
|
toOp() {
|
|
@@ -2178,6 +2241,7 @@ var DataTransformCall = class extends PostgresOpFactoryCallNode {
|
|
|
2178
2241
|
renderTypeScript() {
|
|
2179
2242
|
return [
|
|
2180
2243
|
`this.dataTransform(endContract, ${jsonToTsSource(this.label)}, {`,
|
|
2244
|
+
...this.backfillsColumn === void 0 ? [] : [` backfillsColumn: ${jsonToTsSource(this.backfillsColumn).replaceAll("\n", "\n ")},`],
|
|
2181
2245
|
` check: () => placeholder(${jsonToTsSource(this.checkSlot)}),`,
|
|
2182
2246
|
` run: () => placeholder(${jsonToTsSource(this.runSlot)}),`,
|
|
2183
2247
|
"})"
|
|
@@ -2353,6 +2417,6 @@ function columnNameOfCall(call) {
|
|
|
2353
2417
|
if ("column" in call && call.column instanceof DdlColumn) return call.column.name;
|
|
2354
2418
|
}
|
|
2355
2419
|
//#endregion
|
|
2356
|
-
export { RenameConstraintCall as A, isPostgresOpFactoryCall as B, DropNativeEnumTypeCall as C, EnableRowLevelSecurityCall as D, DropTableCall as E, SetNotNullCall as F, renameTableStatement as H,
|
|
2420
|
+
export { RenameConstraintCall as A, isPostgresOpFactoryCall as B, DropNativeEnumTypeCall as C, EnableRowLevelSecurityCall as D, DropTableCall as E, SetNotNullCall as F, renameTableStatement as H, alterColumnTypeCallText as I, columnNameOfCall as L, RenamePostgresRlsPolicyCall as M, RenameTableCall as N, RawSqlCall as O, SetDefaultCall as P, createExtension as R, DropIndexCall as S, DropPostgresRlsPolicyCall as T, postgresDefaultToDdlColumnDefault as V, DisableRowLevelSecurityCall as _, AddNativeEnumValueCall as a, DropConstraintCall as b, AddUniqueCall as c, CreateIndexCall as d, CreateNativeEnumTypeCall as f, DataTransformCall as g, CreateTableCall as h, AddForeignKeyCall as i, RenameIndexCall as j, RenameColumnCall as k, AlterColumnTypeCall as l, CreateSchemaCall as m, AddColumnCall as n, AddPrimaryKeyCall as o, CreatePostgresRlsPolicyCall as p, AddColumnWithTemporaryDefaultCall as r, AddRequiredColumnToEmptyTableCall as s, AddCheckConstraintCall as t, CreateExtensionCall as u, DropCheckConstraintCall as v, DropNotNullCall as w, DropDefaultCall as x, DropColumnCall as y, installExtension as z };
|
|
2357
2421
|
|
|
2358
|
-
//# sourceMappingURL=op-factory-call-
|
|
2422
|
+
//# sourceMappingURL=op-factory-call-ltgiEZ8g-CX6WX57X.mjs.map
|