@prisma/orm-target-postgres 8.0.0-rc.22-dev.8 → 8.0.0-rc.22-dev.10
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-Bp0horgW.d.mts → adapter-B52C9G6y.d.mts} +11 -11
- package/dist/{adapter-Bp0horgW.d.mts.map → adapter-B52C9G6y.d.mts.map} +1 -1
- package/dist/adapter.d.mts +1 -1
- package/dist/adapter__adapter.d.mts +1 -1
- package/dist/{aggregates-0EfVySBb.d.mts → aggregates-CCEULCRK.d.mts} +11 -11
- package/dist/{aggregates-0EfVySBb.d.mts.map → aggregates-CCEULCRK.d.mts.map} +1 -1
- package/dist/{control-policy-RIiGtzLL-dMGUsj7L.mjs → control-policy-K52VpMX0-CateWffI.mjs} +7 -3
- package/dist/control-policy-K52VpMX0-CateWffI.mjs.map +1 -0
- package/dist/{diff-database-schema-CvA43-eB-BVodpxgx.mjs → diff-database-schema-D_vOsC7_-CtLt0OwZ.mjs} +3 -3
- package/dist/{diff-database-schema-CvA43-eB-BVodpxgx.mjs.map → diff-database-schema-D_vOsC7_-CtLt0OwZ.mjs.map} +1 -1
- package/dist/{issue-planner-BUo9S9Ge.d.mts → issue-planner-CbixMGS1.d.mts} +2 -2
- package/dist/{issue-planner-BUo9S9Ge.d.mts.map → issue-planner-CbixMGS1.d.mts.map} +1 -1
- package/dist/migration-Be_iuIpn.mjs.map +1 -1
- package/dist/{migration-Drs_EeiM.d.mts → migration-XqRvlRWn.d.mts} +2 -2
- package/dist/{migration-Drs_EeiM.d.mts.map → migration-XqRvlRWn.d.mts.map} +1 -1
- package/dist/op-factory-call-DO-2Ul_8.d.mts +1 -0
- package/dist/{op-factory-call-Ek2u4dEh-CIUcdOdr.mjs → op-factory-call-DQW9c0ec-C3qv_STE.mjs} +478 -38
- package/dist/op-factory-call-DQW9c0ec-C3qv_STE.mjs.map +1 -0
- package/dist/{op-factory-call-L1gqYhhk-DMnspvjf.d.mts → op-factory-call-fPC4Yzy6-B6JHyh7J.d.mts} +80 -9
- package/dist/op-factory-call-fPC4Yzy6-B6JHyh7J.d.mts.map +1 -0
- package/dist/{pack-vCp-QG0L.d.mts → pack-ClOo5FU_.d.mts} +2 -2
- package/dist/{pack-vCp-QG0L.d.mts.map → pack-ClOo5FU_.d.mts.map} +1 -1
- package/dist/{planner-CXGxEHRs-DnblCRvf.mjs → planner-BsSEbzfm-BrBEb_M1.mjs} +87 -68
- package/dist/planner-BsSEbzfm-BrBEb_M1.mjs.map +1 -0
- package/dist/{planner-Bl3kIyMG.d.mts → planner-Cw5KV0_B.d.mts} +2 -2
- package/dist/{planner-Bl3kIyMG.d.mts.map → planner-Cw5KV0_B.d.mts.map} +1 -1
- package/dist/planner-produced-postgres-migration-CoX6OBqo.d.mts +1 -0
- package/dist/{planner-produced-postgres-migration-Cx9bERx3-DRNnR16E.d.mts → planner-produced-postgres-migration-DgUtdqVh-DEhVIDmO.d.mts} +3 -3
- package/dist/planner-produced-postgres-migration-DgUtdqVh-DEhVIDmO.d.mts.map +1 -0
- package/dist/{planner-produced-postgres-migration-rvb49AcU-Cg2CikBV.mjs → planner-produced-postgres-migration-bn60skNP-CKjpb3S_.mjs} +4 -4
- package/dist/{planner-produced-postgres-migration-rvb49AcU-Cg2CikBV.mjs.map → planner-produced-postgres-migration-bn60skNP-CKjpb3S_.mjs.map} +1 -1
- package/dist/{postgres-migration-D0tEWVZ9-tr0Nt3a2.mjs → postgres-migration-CVWCygKt-DEXT0FE_.mjs} +48 -8
- package/dist/postgres-migration-CVWCygKt-DEXT0FE_.mjs.map +1 -0
- package/dist/{postgres-migration-DNnmFBsR-BJU9865a.d.mts → postgres-migration-MVAsm-Co-CcN0UJd7.d.mts} +53 -3
- package/dist/postgres-migration-MVAsm-Co-CcN0UJd7.d.mts.map +1 -0
- package/dist/{prisma7-binding-bhu33wEo.d.mts → prisma7-binding-Bb8yzr_1.d.mts} +2 -2
- package/dist/{prisma7-binding-bhu33wEo.d.mts.map → prisma7-binding-Bb8yzr_1.d.mts.map} +1 -1
- package/dist/{render-ops-B0eNPFAw-BgUftmhY.mjs → render-ops-BKDfKgOJ-DmoHztdY.mjs} +3 -3
- package/dist/{render-ops-B0eNPFAw-BgUftmhY.mjs.map → render-ops-BKDfKgOJ-DmoHztdY.mjs.map} +1 -1
- package/dist/target.d.mts +12 -12
- package/dist/target.mjs +8 -8
- package/dist/target__aggregates.d.mts +1 -1
- package/dist/target__control.mjs +30 -32
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__issue-planner.d.mts +1 -1
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__migration.d.mts +2 -2
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.d.mts +3 -3
- package/dist/target__op-factory-call.mjs +2 -2
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__planner-produced-postgres-migration.d.mts +2 -2
- package/dist/target__planner-produced-postgres-migration.mjs +1 -1
- package/dist/target__planner.d.mts +1 -1
- package/dist/target__planner.mjs +2 -2
- package/dist/target__prisma7-binding.d.mts +1 -1
- package/dist/target__render-ops.mjs +1 -1
- package/package.json +10 -10
- package/dist/control-policy-RIiGtzLL-dMGUsj7L.mjs.map +0 -1
- package/dist/op-factory-call-D2HXLJQJ.d.mts +0 -1
- package/dist/op-factory-call-Ek2u4dEh-CIUcdOdr.mjs.map +0 -1
- package/dist/op-factory-call-L1gqYhhk-DMnspvjf.d.mts.map +0 -1
- package/dist/planner-CXGxEHRs-DnblCRvf.mjs.map +0 -1
- package/dist/planner-produced-postgres-migration-Cx9bERx3-DRNnR16E.d.mts.map +0 -1
- package/dist/planner-produced-postgres-migration-DRPVY4iL.d.mts +0 -1
- package/dist/postgres-migration-D0tEWVZ9-tr0Nt3a2.mjs.map +0 -1
- package/dist/postgres-migration-DNnmFBsR-BJU9865a.d.mts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as postgresAggregateDescriptors } from "./aggregates-
|
|
1
|
+
import { t as postgresAggregateDescriptors } from "./aggregates-CCEULCRK.mjs";
|
|
2
2
|
export { postgresAggregateDescriptors };
|
package/dist/target__control.mjs
CHANGED
|
@@ -14,11 +14,11 @@ import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-DDydgB82-Cv
|
|
|
14
14
|
import { a as postgresDiffSubjectEntityKind, o as postgresDiffSubjectGranularity } from "./postgres-table-schema-node-nY6II-Uv-Bj-lgmSi.mjs";
|
|
15
15
|
import { t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-DuljIQWp-D6Q5JyEs.mjs";
|
|
16
16
|
import { i as qualifyTableName } from "./planner-sql-checks-RKQqd_b5-CesTHuGH.mjs";
|
|
17
|
-
import {
|
|
18
|
-
import { r as diffPostgresSchema } from "./diff-database-schema-
|
|
17
|
+
import { Q as holdingStoredValue, U as SCHEMA_OBJECTS_SQL, Z as dropCheckConstraintId, at as schemaObjectsSummary, it as schemaContentsOf, rt as schemaBlockingObjects } from "./op-factory-call-DQW9c0ec-C3qv_STE.mjs";
|
|
18
|
+
import { r as diffPostgresSchema } from "./diff-database-schema-D_vOsC7_-CtLt0OwZ.mjs";
|
|
19
19
|
import { t as PostgresContractSerializer } from "./postgres-contract-view-pS-iTnm--BIKbQbBd.mjs";
|
|
20
|
-
import { o as postgresContractToSchema } from "./postgres-migration-
|
|
21
|
-
import { n as
|
|
20
|
+
import { o as postgresContractToSchema } from "./postgres-migration-CVWCygKt-DEXT0FE_.mjs";
|
|
21
|
+
import { n as postgresMarkedRemoval, r as postgresStoredValueCallClasses, t as createPostgresMigrationPlanner } from "./planner-BsSEbzfm-BrBEb_M1.mjs";
|
|
22
22
|
import { n as MARKER_LOCK_SQL, t as MARKER_LOCK_KEY } from "./marker-lock-DFc1Tfv5-BkBKBRE3.mjs";
|
|
23
23
|
import { _ as positionalArg, a as buildFullTextIndexAttribute, c as buildModelConstraintAttribute, f as inferPostgresPslContract, g as parseDefaultAttributeString, i as buildExtensionBlock, l as buildNativeEnumBlock, n as buildAttribute, o as buildIndexAttribute, p as namedArg, r as buildCheckAttribute, s as buildMapAttribute, t as SYNTHETIC_SPAN, v as typeArgument } from "./infer-psl-contract-Bn0Qzy4d-D9RlEL5y.mjs";
|
|
24
24
|
import { dataTypeParams, requiredParamKeys, validateCodecTypeParams } from "@prisma/orm-framework/components/codec";
|
|
@@ -36,7 +36,7 @@ import { authoringTypeConstructorArguments, findAuthoringTypeConstructorCall, ge
|
|
|
36
36
|
import { NAME_THE_PSL_SOURCE_LOSES, isPslIdentifier } from "@prisma/orm-framework/psl-parser";
|
|
37
37
|
import { printSqlExpressionLiteral, sqlTextsReadBack } from "@prisma/orm-family-sql/contract/sql-expression";
|
|
38
38
|
import { generatorCallsFor, inferredTypeConstructors, mapDefault, writtenTypeChoiceCall } from "@prisma/orm-family-sql/family/psl-build";
|
|
39
|
-
import { convertedColumnOf, requiredColumnOf, requiredColumnsOfMigration,
|
|
39
|
+
import { convertedColumnOf, keepRowsEdit, removalsOfMigration, requiredColumnOf, requiredColumnsOfMigration, rowsHoldingValueFailure, rowsHoldingValueOf, rowsWithoutValueFailure, runnerFailure, runnerSuccess, unconvertedFieldOf } from "@prisma/orm-family-sql/family/control";
|
|
40
40
|
import { notOk, ok, okVoid } from "@prisma/orm-framework/utils/result";
|
|
41
41
|
import { SqlSchemaVerifierBase } from "@prisma/orm-family-sql/family/ir";
|
|
42
42
|
import { effectiveControlPolicy } from "@prisma/orm-framework/contract/types";
|
|
@@ -387,12 +387,12 @@ var PostgresMigrationRunner = class {
|
|
|
387
387
|
description: step.description,
|
|
388
388
|
...ifDefined("expectation", step.expectation)
|
|
389
389
|
};
|
|
390
|
-
const holding = phase === "precheck" ? await this.rowsHoldingValue(driver, step, operation, plan
|
|
390
|
+
const holding = phase === "precheck" ? await this.rowsHoldingValue(driver, step, operation, plan) : void 0;
|
|
391
391
|
if (holding !== void 0) return runnerFailure(code, holding.summary, {
|
|
392
392
|
why: failed,
|
|
393
393
|
meta: {
|
|
394
394
|
failedCheck,
|
|
395
|
-
rowsHoldingValue: holding.
|
|
395
|
+
rowsHoldingValue: holding.reports
|
|
396
396
|
}
|
|
397
397
|
});
|
|
398
398
|
return runnerFailure(code, rowsWithoutValue?.summary ?? failed, {
|
|
@@ -408,34 +408,32 @@ var PostgresMigrationRunner = class {
|
|
|
408
408
|
}
|
|
409
409
|
/**
|
|
410
410
|
* Counts the rows that hold the stored value a removal check guards, as `rowsHoldingValueMeta`
|
|
411
|
-
* marks the check
|
|
411
|
+
* marks the check, then those of every other removal of its migration whose check fails. A count
|
|
412
|
+
* of the failed check that fails leaves the failure without it.
|
|
412
413
|
*/
|
|
413
|
-
|
|
414
|
+
rowsHoldingValue(driver, step, operation, plan) {
|
|
414
415
|
const mark = rowsHoldingValueOf(step);
|
|
415
|
-
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
let rows;
|
|
421
|
-
try {
|
|
422
|
-
rows = (await driver.query(`SELECT COUNT(*)::int AS rows FROM ${qualifyTableName(details.schema, table)} WHERE ${quoteIdentifier(details.name)} = $1`, [stored])).rows[0]?.rows ?? 0;
|
|
423
|
-
} catch {
|
|
424
|
-
return;
|
|
425
|
-
}
|
|
426
|
-
return {
|
|
427
|
-
summary: rowsHoldingValueSummary(table, details.name, stored, rows),
|
|
428
|
-
report: {
|
|
429
|
-
enumValue: mark.enumValue,
|
|
430
|
-
value: stored,
|
|
431
|
-
rows,
|
|
432
|
-
operationIndex,
|
|
433
|
-
keepDataEdit: keepRowsEdit({
|
|
434
|
-
...details,
|
|
435
|
-
table
|
|
436
|
-
}, mark)
|
|
437
|
-
}
|
|
416
|
+
if (mark === void 0) return Promise.resolve(void 0);
|
|
417
|
+
const schemaOf = (marked) => {
|
|
418
|
+
const schema = marked.target.details?.schema;
|
|
419
|
+
if (schema === void 0) throw new InternalError("A stored value removal names the schema of its table");
|
|
420
|
+
return schema;
|
|
438
421
|
};
|
|
422
|
+
return rowsHoldingValueFailure({
|
|
423
|
+
failed: {
|
|
424
|
+
operation,
|
|
425
|
+
operationIndex: plan.operationIndex,
|
|
426
|
+
check: step,
|
|
427
|
+
mark
|
|
428
|
+
},
|
|
429
|
+
others: removalsOfMigration(plan.operations, plan.edges, plan.operationIndex),
|
|
430
|
+
checkFails: async ({ check }) => !this.stepResultIsTrue((await driver.query(check.sql, check.params ?? [])).rows),
|
|
431
|
+
count: async ({ operation: counted, mark: { table, column, storedValue, path } }) => {
|
|
432
|
+
const holding = holdingStoredValue(column, storedValue, path);
|
|
433
|
+
return (await driver.query(`SELECT COUNT(*)::int AS rows FROM ${qualifyTableName(schemaOf(counted), table)} WHERE ${holding.condition}`, holding.params)).rows[0]?.rows ?? 0;
|
|
434
|
+
},
|
|
435
|
+
keepDataEdit: ({ operation: kept, mark: keptMark }) => keepRowsEdit(postgresMarkedRemoval(schemaOf(kept), keptMark), keptMark, postgresStoredValueCallClasses)
|
|
436
|
+
});
|
|
439
437
|
}
|
|
440
438
|
/**
|
|
441
439
|
* Counts the rows the failed step's column has no value in, then those of every other column the
|