@prisma/orm-family-sql 8.0.0-rc.24-dev.23 → 8.0.0-rc.24-dev.24
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/{control-DAy47VdX.d.mts → control-Cb6YoQ8j.d.mts} +15 -15
- package/dist/control-Cb6YoQ8j.d.mts.map +1 -0
- package/dist/{control-adapter-BfyLe7rh-evCd4Qt7.d.mts → control-adapter-0z3ce44U-CLj4kqLI.d.mts} +6 -18
- package/dist/control-adapter-0z3ce44U-CLj4kqLI.d.mts.map +1 -0
- package/dist/{control-adapter-B0UU7Mk7.d.mts → control-adapter-DIwBUSs6.d.mts} +2 -2
- package/dist/{control-adapter-B0UU7Mk7.d.mts.map → control-adapter-DIwBUSs6.d.mts.map} +1 -1
- package/dist/{control-C9mYI0zS.mjs → control-kHFMtE8A.mjs} +52 -8
- package/dist/control-kHFMtE8A.mjs.map +1 -0
- package/dist/{diff-BkF95ZnP.d.mts → diff-DbkXUf4C.d.mts} +2 -2
- package/dist/{diff-BkF95ZnP.d.mts.map → diff-DbkXUf4C.d.mts.map} +1 -1
- package/dist/{exports-BE9wmKAn-DI9rC9jC.mjs → exports-BR5ctYYI-C_-aedbr.mjs} +36 -31
- package/dist/exports-BR5ctYYI-C_-aedbr.mjs.map +1 -0
- package/dist/family.d.mts +7 -7
- package/dist/family.mjs +2 -2
- package/dist/family__control-adapter.d.mts +2 -2
- package/dist/family__control.d.mts +3 -3
- package/dist/family__control.mjs +2 -2
- package/dist/family__diff.d.mts +1 -1
- package/dist/family__migration.d.mts +1 -1
- package/dist/{index-BoxqxQ3G.d.mts → index-DA1EEz4y.d.mts} +6 -3
- package/dist/index-DA1EEz4y.d.mts.map +1 -0
- package/dist/{migration-QS2FXNb_.d.mts → migration-DctFInNJ.d.mts} +2 -2
- package/dist/{migration-QS2FXNb_.d.mts.map → migration-DctFInNJ.d.mts.map} +1 -1
- package/dist/orm-client.d.mts +1 -1
- package/dist/orm-client.mjs +1 -1
- package/dist/runtime.d.mts +1 -1
- package/dist/runtime.mjs +1 -1
- package/dist/{types-COXfSNOP-CWJkgMR8.d.mts → types-CWvmfrfd-DLQYhSUx.d.mts} +6 -5
- package/dist/{types-COXfSNOP-CWJkgMR8.d.mts.map → types-CWvmfrfd-DLQYhSUx.d.mts.map} +1 -1
- package/package.json +18 -18
- package/dist/control-C9mYI0zS.mjs.map +0 -1
- package/dist/control-DAy47VdX.d.mts.map +0 -1
- package/dist/control-adapter-BfyLe7rh-evCd4Qt7.d.mts.map +0 -1
- package/dist/exports-BE9wmKAn-DI9rC9jC.mjs.map +0 -1
- package/dist/index-BoxqxQ3G.d.mts.map +0 -1
|
@@ -11,9 +11,9 @@ import { a as EnumMemberListDefault, i as EnumMemberDefault, n as DefaultFunctio
|
|
|
11
11
|
import { S as SqlSchemaIRNode, b as SqlSchemaIR, p as SqlDefaultValue } from "./types-fmtEmvj3-B0fQaVes.mjs";
|
|
12
12
|
import "./types-B-dwfOwQ.mjs";
|
|
13
13
|
import "./validators-Dt-19ywK.mjs";
|
|
14
|
-
import { r as SqlControlAdapter } from "./control-adapter-
|
|
14
|
+
import { r as SqlControlAdapter } from "./control-adapter-0z3ce44U-CLj4kqLI.mjs";
|
|
15
15
|
import { t as sqlFamilyEnumSpec } from "./authoring-entity-types-CgKIgWq5-BqNs-56x.mjs";
|
|
16
|
-
import { C as SqlPlannerConflict, E as SqlPlannerFailureResult, O as SqlPlannerSuccessResult, c as SqlMigrationPlan, d as SqlMigrationPlanOperationStep, g as SqlMigrationRunnerErrorCode, h as SqlMigrationRunner, n as CreateSqlMigrationPlanOptions, p as SqlMigrationPlanner, t as CodecControlHooks, x as SqlMigrationRunnerSuccessValue, y as SqlMigrationRunnerFailure } from "./types-
|
|
16
|
+
import { C as SqlPlannerConflict, E as SqlPlannerFailureResult, O as SqlPlannerSuccessResult, c as SqlMigrationPlan, d as SqlMigrationPlanOperationStep, g as SqlMigrationRunnerErrorCode, h as SqlMigrationRunner, n as CreateSqlMigrationPlanOptions, p as SqlMigrationPlanner, t as CodecControlHooks, x as SqlMigrationRunnerSuccessValue, y as SqlMigrationRunnerFailure } from "./types-CWvmfrfd-DLQYhSUx.mjs";
|
|
17
17
|
import { t as SqlSchemaDiffFn } from "./schema-differ-DmP74bB8-BXkhxcPs.mjs";
|
|
18
18
|
import { StructuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
19
19
|
import { AuthoringTypeNamespace, DataTypeSupport } from "@prisma/orm-framework/components/authoring";
|
|
@@ -22,7 +22,7 @@ import { Codec, CodecLookupWithDescriptors, CodecRef, DataType, DataTypeLookup,
|
|
|
22
22
|
import { GeneratorFunctionRegistry, TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
|
|
23
23
|
import { PslDocumentAst } from "@prisma/orm-framework/components/psl-ast";
|
|
24
24
|
import { NotOk, Ok, Result } from "@prisma/orm-framework/utils/result";
|
|
25
|
-
import { AppliedMigrationStatement, AssembledAuthoringContributions, ContractSerializer, ControlFamilyDescriptor, ControlFamilyInstance, ControlMutationDefaultEntry, ControlStack, DiffSubjectGranularity, EnumValueCoordinate, EnumValueCoordinateJson, FieldCoordinate, ImportRequirement, KeepDataEdit, MigratableTargetDescriptor, MigrationDataLossKind, MigrationOperationClass, MigrationOperationClass as MigrationOperationClass$1, MigrationOperationPolicy, MigrationOperationPolicy as MigrationOperationPolicy$1, MigrationPlan as MigrationPlan$1, MigrationPlanOperation, MigrationPlanOperation as MigrationPlanOperation$1, MigrationPlanSubjects, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerConflict as MigrationPlannerConflict$1, MigrationPlannerResult, MigrationRunnerFailureMeta, MigrationSubject, ModelCoordinate, OpFactoryCall, OperationPreview, OperationPreviewCapable, PslContractBuildCapable, PslContractInferCapable, ResolvedEnumValueRenameStatement, ResolvedFieldRenameStatement, ResolvedMigrationStatement, ResolvedModelRenameStatement, ResolvedRenameStatement, ResolvedValueObjectFieldBackfillStatement, ResolvedValueObjectFieldRenameStatement, ResolvedVariantConvertStatement, RowsHoldingValue, RowsWithoutValue, SchemaDiffIssue, SchemaOwnership, SchemaVerifier, SchemaViewCapable, TargetMigrationsCapability, ValueObjectFieldCoordinate, VerifyDatabaseResult, VerifyDatabaseSchemaResult, assembleAuthoringContributions as assembleAuthoringContributions$1 } from "@prisma/orm-framework/components/control";
|
|
25
|
+
import { AppliedMigrationStatement, AssembledAuthoringContributions, ContractSerializer, ControlFamilyDescriptor, ControlFamilyInstance, ControlMutationDefaultEntry, ControlStack, DatabasePolicies, DiffSubjectGranularity, EnumValueCoordinate, EnumValueCoordinateJson, FieldCoordinate, ImportRequirement, KeepDataEdit, MarkerDestination, MigratableTargetDescriptor, MigrationDataLossKind, MigrationOperationClass, MigrationOperationClass as MigrationOperationClass$1, MigrationOperationPolicy, MigrationOperationPolicy as MigrationOperationPolicy$1, MigrationPlan as MigrationPlan$1, MigrationPlanOperation, MigrationPlanOperation as MigrationPlanOperation$1, MigrationPlanSubjects, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerConflict as MigrationPlannerConflict$1, MigrationPlannerResult, MigrationRunnerFailure, MigrationRunnerFailureMeta, MigrationSubject, ModelCoordinate, OpFactoryCall, OperationPreview, OperationPreviewCapable, PslContractBuildCapable, PslContractInferCapable, ResolvedEnumValueRenameStatement, ResolvedFieldRenameStatement, ResolvedMigrationStatement, ResolvedModelRenameStatement, ResolvedRenameStatement, ResolvedValueObjectFieldBackfillStatement, ResolvedValueObjectFieldRenameStatement, ResolvedVariantConvertStatement, RowsHoldingValue, RowsWithoutValue, SchemaDiffIssue, SchemaOwnership, SchemaVerifier, SchemaViewCapable, TargetMigrationsCapability, ValueObjectFieldCoordinate, VerifyDatabaseResult, VerifyDatabaseSchemaResult, assembleAuthoringContributions as assembleAuthoringContributions$1 } from "@prisma/orm-framework/components/control";
|
|
26
26
|
import { EmissionSpi, TypesImportSpec } from "@prisma/orm-framework/components/emission";
|
|
27
27
|
//#region ../../../2-sql-family/9-family/dist/control.d.mts
|
|
28
28
|
//#region src/core/control-instance.d.ts
|
|
@@ -94,11 +94,7 @@ interface SqlControlFamilyInstance extends ControlFamilyInstance<'sql', SqlSchem
|
|
|
94
94
|
initMarker(options: {
|
|
95
95
|
readonly driver: SqlControlDriverInstance<string>;
|
|
96
96
|
readonly space: string;
|
|
97
|
-
readonly destination:
|
|
98
|
-
readonly storageHash: string;
|
|
99
|
-
readonly profileHash: string;
|
|
100
|
-
readonly invariants?: readonly string[];
|
|
101
|
-
};
|
|
97
|
+
readonly destination: MarkerDestination;
|
|
102
98
|
}): Promise<void>;
|
|
103
99
|
/**
|
|
104
100
|
* Compare-and-swap advance of the marker row for `space`. Returns `true`
|
|
@@ -108,11 +104,7 @@ interface SqlControlFamilyInstance extends ControlFamilyInstance<'sql', SqlSchem
|
|
|
108
104
|
readonly driver: SqlControlDriverInstance<string>;
|
|
109
105
|
readonly space: string;
|
|
110
106
|
readonly expectedFrom: string;
|
|
111
|
-
readonly destination:
|
|
112
|
-
readonly storageHash: string;
|
|
113
|
-
readonly profileHash: string;
|
|
114
|
-
readonly invariants?: readonly string[];
|
|
115
|
-
};
|
|
107
|
+
readonly destination: MarkerDestination;
|
|
116
108
|
}): Promise<boolean>;
|
|
117
109
|
/**
|
|
118
110
|
* Appends a ledger entry for `space`; see
|
|
@@ -643,6 +635,14 @@ declare function partitionIssuesByControlPolicy<TIssue>(options: {
|
|
|
643
635
|
readonly suppressions: readonly SuppressionRecord[];
|
|
644
636
|
};
|
|
645
637
|
//#endregion
|
|
638
|
+
//#region src/core/migrations/database-policies-check.d.ts
|
|
639
|
+
/**
|
|
640
|
+
* Compares the policies a caller checked with the application space's marker. A runner calls it before
|
|
641
|
+
* its first space, under its lock or inside its transaction: a change fails the run as
|
|
642
|
+
* `MIGRATION.MARKER_CAS_FAILURE`, and policies that cannot be read throw `CONTRACT.MARKER_ROW_CORRUPT`.
|
|
643
|
+
*/
|
|
644
|
+
declare function checkDatabasePoliciesHeld(family: SqlControlFamilyInstance, driver: SqlControlDriverInstance<string>, checked: DatabasePolicies): Promise<Result<void, MigrationRunnerFailure>>;
|
|
645
|
+
//#endregion
|
|
646
646
|
//#region src/core/migrations/schema-tables.d.ts
|
|
647
647
|
/**
|
|
648
648
|
* The tables a schema has, addressed by the contract's namespace ids: the schema a plan starts
|
|
@@ -1727,5 +1727,5 @@ declare function contractColumns(contract: unknown): ContractColumns;
|
|
|
1727
1727
|
//#region src/exports/control.d.ts
|
|
1728
1728
|
declare const _default: SqlFamilyDescriptor;
|
|
1729
1729
|
//#endregion
|
|
1730
|
-
export { SqlDescribedContractSpace as $,
|
|
1731
|
-
//# sourceMappingURL=control-
|
|
1730
|
+
export { SqlDescribedContractSpace as $, fieldEventStorage as $t, MigrationPlannerResult as A, resolveColumnRenameAgainst as An, UnfilledValue as At, PlannedStoredRewrites as B, slotSource as Bn, checkSqlExpressionText as Bt, MarkedRemoval as C, plannerSuccess as Cn, TableMove as Ct, MigrationPlanOperation$1 as D, requiredColumnMeta as Dn, TableRenameRequest as Dt, MigrationPlan$1 as E, removalsOfMigration as En, TableRenameByHand as Et, NamespaceStatementTarget as F, rowsWithoutValueFailure as Fn, acceptedByDataType as Ft, RequiredColumn as G, storedValueOperationIndexes as Gn, convertedColumnMeta as Gt, ReadReportedDefault as H, sqlOfSlot as Hn, contractColumns as Ht, NoTable as I, rowsWithoutValueSummary as In, appliedStatementsInOrder as It, SchemaTables as J, unconvertedFieldOf as Jn, createSqlTextSources as Jt, RequiredColumnMark as K, storedValueSubjects as Kn, convertedColumnOf as Kt, PlanFieldEventOperationsOptions as L, runnerFailure as Ln, assembleAuthoringContributions$1 as Lt, ModelTable as M, rowsHoldingValueFailure as Mn, VariantRowRewrite as Mt, NO_RENAMED_ORIGINS as N, rowsHoldingValueMeta as Nn, WorkingSchemaOrigins as Nt, MigrationPlanner as O, requiredColumnOf as On, TargetMigrationsCapability as Ot, NamespaceRename as P, rowsHoldingValueOf as Pn, _default as Pt, SqlDefaultFunctionName as Q, unnamedFieldFillOf as Qn, extractCodecControlHooks as Qt, PlannedStatement as R, runnerSuccess as Rn, backfillOfDefaultedField as Rt, JsonPathStep as S, plannerFailure as Sn, TABLE_NAME_CASE_CHANGED_CODE as St, MigrationOperationPolicy$1 as T, readReportedDefault as Tn, TableRename as Tt, ReportedBody as U, sqlTypeLookupsOf as Un, contractNamespaceToSchemaIR as Ut, ReadColumnDefault as V, sqlDefaultFunctions as Vn, columnTakesTemporaryValue as Vt, ReportedLiteralDefault as W, storageNameOfOperation as Wn, contractToSchemaIR as Wt, SqlControlFamilyInstance as X, unmatchedColumnRename as Xn, detectTableNameCaseChanges as Xt, SingleOperationCall as Y, unknownCallNames as Yn, detectDestructiveChanges as Yt, SqlControlTargetDescriptor as Z, unmatchedTableRename as Zn, encodeStoredValue as Zt, FillValueCheck as _, planStatements as _n, StoredValueReplacement as _t, ColumnRename as a, isUnfilledSlot as an, StatementColumn as at, JsonKeyPath as b, planValueObjectFieldRewrites as bn, SubjectStorage as bt, ContractColumns as c, keyPathOf as cn, StatementPlanningTarget as ct, ConvertedColumn as d, parseJsonPath as dn, StoredKeyFillField as dt, fieldOfColumn as en, SqlPslBuildContext as et, DefaultResolver as f, partitionCallsByControlPolicy as fn, StoredKeyRewrite as ft, FieldStorageEffect as g, planFieldEventOperations as gn, StoredValueCodec as gt, FieldStatementColumns as h, planFieldEventCalls as hn, StoredValueCallClasses as ht, ColumnOnOneSide as i, fillValueProblem as in, SqlTextSources as it, ModelStorageEffect as j, resolveTableRenameAgainst as jn, UnnamedFieldFill as jt, MigrationPlannerConflict$1 as k, requiredColumnsOfMigration as kn, TargetRefusal as kt, ContractToSchemaIROptions as l, modelRenameStorageEffect as ln, StoredEnumValue as lt, FieldEventCall as m, planEnumValueRewrites as mn, StoredRewriteCalls as mt, CallSubjects as n, fieldStatementColumns as nn, SqlQuotingRules as nt, ColumnRenameRequest as o, jsonPathText as on, StatementOperations as ot, DefaultResolverColumn as p, partitionIssuesByControlPolicy as pn, StoredRewrite as pt, RowsHoldingValueMark as q, subjectsOfCalls as qn, createMigrationPlan as qt, CallWithCompanions as r, fillKeyProblem as rn, SqlSlot as rt, ContractColumn as s, keepRowsEdit as sn, StatementOwnership as st, COLUMN_RENAME_UNMATCHED_CODE as t, fieldRenameStorageEffect as tn, SqlQuote as tt, ControlPolicySubject as u, otherSpaceDeclaring as un, StoredKeyFill as ut, FillValueTypes as v, planStoredRewrites as vn, StoredValueRewrite as vt, MigrationOperationClass$1 as w, readColumnDefault as wn, TableNameCaseGuardTable as wt, JsonPath as x, planVariantRowRewrites as xn, SuppressionRecord as xt, INIT_ADDITIVE_POLICY as y, planValueObjectFieldFills as yn, StoredValueSubject as yt, PlannedStatements as z, scalarTypeNamesOf as zn, checkDatabasePoliciesHeld as zt };
|
|
1731
|
+
//# sourceMappingURL=control-Cb6YoQ8j.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-Cb6YoQ8j.d.mts","names":[],"sources":["../../../../2-sql-family/9-family/dist/control.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;UAmBU;WACC,kBAAkB,cAAc;WAChC,cAAc;;UAEf,iCAAiC,6BAA6B,kBAAkB,kBAAkB,kBAAkB,wBAAwB,kBAAkB,wBAAwB,SAAS,cAAc,yBAAyB;;;;;;;;;EAS9O,oBAAoB,wBAAwB;EAC5C,OAAO;aACI,QAAQ;aACR;aACA;aACA;aACA;MACP,QAAQ;;;;;;;;;;EAUZ,aAAa;aACF;aACA,QAAQ;aACR;aACA,qBAAqB,cAAc;MAC1C;;;;;;;;;;EAUJ,2BAA2B,OAAO,kBAAkB;;;;;;;;EAQpD,mBAAmB,OAAO;EAC1B,WAAW;aACA,QAAQ;aACR;MACP,QAAQ;EACZ,iBAAiB,UAAU,kBAAkB,QAAQ;EACrD,SAAS,KAAK,cAAc,SAAS,SAAS,0BAA0B,QAAQ;;;;;;EAMhF,WAAW;aACA,QAAQ;aACR;aACA,aAAa;MACpB;;;;;EAKJ,aAAa;aACF,QAAQ;aACR;aACA;aACA,aAAa;MACpB;;;;;EAKJ,iBAAiB;aACN,QAAQ;aACR;aACA;eACE;eACA;eACA;eACA;eACA;eACA;eACA;;MAET;EACJ,yCAAyC;EACzC,mBAAmB,qBAAqB,2BAA6B;EACrE,cAAc,WAAW;;;;cAIb,+BAA+B,+BAA+B;WACjE;WACA;WACA;WACA;WACA,UAAU;WACV,oBAAoB;WACpB;aACE;eACE;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;mBACE;mBACA;mBACA;qBACE;uBACE;uBACA;yBACE;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;uBACE;uBACA;yBACE;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;uBACE;uBACA;yBACE;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;uBACE;uBACA;yBACE;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;uBACE;uBACA;yBACE;;;;;;;aAOZ,gEAAgE;aAChE;eACE;QACP;QACA;QACA;QACA;QACA;UACE;;QAEF,aAAa;QACb;UACE,2CAA2C;YACzC;4CACgC;;;;aAI/B;eACE;iBACE,MAAM,qCAAqC,wDAAwD;UAC1G;0CACgC;iBACzB,KAAK,qCAAqC,wDAAwD;UACzG;mBACS;0CACuB;iBACzB,SAAS,qCAAqC,wDAAwD;UAC7G;mBACS;0CACuB;iBACzB,QAAQ,oCAAoC,wDAAwD;UAC3G;mBACS,4CAA4C;mBAC5C,uCAAuC;mBACvC;mBACA;mBACA;mBACA;mBACA,UAAU;0CACa;iBACzB,QAAQ,oCAAoC,wDAAwD;mBAClG,2CAA2C;mBAC3C;mBACA;0CACuB;iBACzB,UAAU,qCAAqC,wDAAwD;UAC9G;0CACgC;iBACzB,gBAAgB,qCAAqC,wDAAwD;UACpH;0CACgC;iBACzB,OAAO,qCAAqC,wDAAwD;UAC3G,qCAAqC,uDAAuD;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MnG;WACM;WACA,MAAM;;WAEN;WACA,oBAAoB;;;KAG1B,iCAAiC;;KAEjC;WACM,iBAAiB;WACjB,cAAc;;WAEd;;;iBAGM,oBAAoB,OAAO,OAAO,SAAS,wBAAwB,cAAc,QAAQ;;KAErG,oBAAoB;WACd,yBAAyB;;;;;iBAKnB,kBAAkB,OAAO,OAAO;WACtC,SAAS;WACT;GACR;WACQ,SAAS;WACT;gBACK,QAAQ;;UAEd;WACC,UAAU;WACV;;;UAGD;;EAER,SAAS,6CAA6C,eAAe,iBAAiB;;;;;iBAKvE,gBAAgB,oBAAoB;;;cAGvC,UAAU"}
|
package/dist/{control-adapter-BfyLe7rh-evCd4Qt7.d.mts → control-adapter-0z3ce44U-CLj4kqLI.d.mts}
RENAMED
|
@@ -7,8 +7,8 @@ import { p as LowererContext } from "./ast-D0yJ7Yf0.mjs";
|
|
|
7
7
|
import { S as SqlSchemaIRNode } from "./types-fmtEmvj3-B0fQaVes.mjs";
|
|
8
8
|
import "./types-B-dwfOwQ.mjs";
|
|
9
9
|
import { ContractMarkerRecord, LedgerEntryRecord } from "@prisma/orm-framework/contract/types";
|
|
10
|
-
import { ControlAdapterInstance, ControlStack } from "@prisma/orm-framework/components/control";
|
|
11
|
-
//#region ../../../2-sql-family/9-family/dist/control-adapter-
|
|
10
|
+
import { ControlAdapterInstance, ControlStack, MarkerDestination, MarkerInsert } from "@prisma/orm-framework/components/control";
|
|
11
|
+
//#region ../../../2-sql-family/9-family/dist/control-adapter-0z3ce44U.d.mts
|
|
12
12
|
//#region src/core/control-adapter.d.ts
|
|
13
13
|
/**
|
|
14
14
|
* Structural interface for anything that can lower a SQL/DDL AST node to a
|
|
@@ -77,22 +77,14 @@ interface SqlControlAdapter<TTarget extends string = string> extends ControlAdap
|
|
|
77
77
|
* stamps cannot silently overwrite each other. `updated_at` is DB-side
|
|
78
78
|
* (`now()` / `strftime('%Y-%m-%dT%H:%M:%fZ','now')`). Mirrors `MongoControlAdapter.initMarker`.
|
|
79
79
|
*/
|
|
80
|
-
insertMarker(driver: SqlControlDriverInstance<TTarget>, space: string, destination:
|
|
81
|
-
readonly storageHash: string;
|
|
82
|
-
readonly profileHash: string;
|
|
83
|
-
readonly invariants?: readonly string[];
|
|
84
|
-
}): Promise<void>;
|
|
80
|
+
insertMarker(driver: SqlControlDriverInstance<TTarget>, space: string, destination: MarkerInsert): Promise<void>;
|
|
85
81
|
/**
|
|
86
82
|
* Writes the initial marker row for `space` as an upsert (`INSERT … ON
|
|
87
83
|
* CONFLICT (space) DO UPDATE SET …`), so re-stamping a space overwrites the
|
|
88
84
|
* existing row rather than failing. `updated_at` is stamped with a DB-side
|
|
89
85
|
* time expression (`now()` / `strftime('%Y-%m-%dT%H:%M:%fZ','now')`), never an app-side clock.
|
|
90
86
|
*/
|
|
91
|
-
initMarker(driver: SqlControlDriverInstance<TTarget>, space: string, destination:
|
|
92
|
-
readonly storageHash: string;
|
|
93
|
-
readonly profileHash: string;
|
|
94
|
-
readonly invariants?: readonly string[];
|
|
95
|
-
}): Promise<void>;
|
|
87
|
+
initMarker(driver: SqlControlDriverInstance<TTarget>, space: string, destination: MarkerDestination): Promise<void>;
|
|
96
88
|
/**
|
|
97
89
|
* Atomically advances the marker row for `space` (compare-and-swap on
|
|
98
90
|
* `core_hash = expectedFrom`). Returns `true` when the swap matched a row,
|
|
@@ -100,11 +92,7 @@ interface SqlControlAdapter<TTarget extends string = string> extends ControlAdap
|
|
|
100
92
|
* is written verbatim when supplied (the union/dedupe policy lives upstream)
|
|
101
93
|
* and left untouched when omitted. Mirrors `MongoControlAdapter.updateMarker`.
|
|
102
94
|
*/
|
|
103
|
-
updateMarker(driver: SqlControlDriverInstance<TTarget>, space: string, expectedFrom: string, destination:
|
|
104
|
-
readonly storageHash: string;
|
|
105
|
-
readonly profileHash: string;
|
|
106
|
-
readonly invariants?: readonly string[];
|
|
107
|
-
}): Promise<boolean>;
|
|
95
|
+
updateMarker(driver: SqlControlDriverInstance<TTarget>, space: string, expectedFrom: string, destination: MarkerDestination): Promise<boolean>;
|
|
108
96
|
/**
|
|
109
97
|
* Appends a ledger entry for `space`. Mirrors `MongoControlAdapter.writeLedgerEntry`.
|
|
110
98
|
* The SQL ledger table keys rows by an autoincrement id and partitions reads
|
|
@@ -178,4 +166,4 @@ interface SqlControlAdapterDescriptor<TTarget extends string = string> {
|
|
|
178
166
|
}
|
|
179
167
|
//#endregion
|
|
180
168
|
export { SqlControlAdapterDescriptor as i, Lowerer as n, SqlControlAdapter as r, ExecuteRequestLowerer as t };
|
|
181
|
-
//# sourceMappingURL=control-adapter-
|
|
169
|
+
//# sourceMappingURL=control-adapter-0z3ce44U-CLj4kqLI.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-adapter-0z3ce44U-CLj4kqLI.d.mts","names":[],"sources":["../../../../2-sql-family/9-family/dist/control-adapter-0z3ce44U.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;UAaU;EACR,MAAM,KAAK,cAAc,SAAS,SAAS,0BAA0B;;;;;;;;UAQ7D,8BAA8B;EACtC,sBAAsB,KAAK,cAAc,SAAS,UAAU,0BAA0B,QAAQ;;;;EAI9F,oBAAoB,QAAQ,WAAW,gBAAgB;;;;;;;;UAQ/C,kBAAkB,yCAAyC,8BAA8B,UAAU;;WAElG;;;;;;;;;;;;;;;;EAgBT,WAAW,QAAQ,yBAAyB,UAAU,gBAAgB,QAAQ;;;;;;;;EAQ9E,eAAe,QAAQ,yBAAyB,WAAW,QAAQ,oBAAoB;;;;;EAKvF,WAAW,QAAQ,yBAAyB,UAAU,iBAAiB,iBAAiB;;;;;;;EAOxF,aAAa,QAAQ,yBAAyB,UAAU,eAAe,aAAa,eAAe;;;;;;;EAOnG,WAAW,QAAQ,yBAAyB,UAAU,eAAe,aAAa,oBAAoB;;;;;;;;EAQtG,aAAa,QAAQ,yBAAyB,UAAU,eAAe,sBAAsB,aAAa,oBAAoB;;;;;;;EAO9H,iBAAiB,QAAQ,yBAAyB,UAAU,eAAe;aAChE;aACA;aACA;aACA;aACA;aACA;aACA;MACP;;;;EAIJ,gBAAgB,GAAG,QAAQ,yBAAyB,UAAU,UAAU,QAAQ,KAAK,QAAQ;;;;EAI7F,WAAW,QAAQ,yBAAyB,WAAW;;;;EAIvD,gBAAgB,GAAG,QAAQ,yBAAyB,UAAU,YAAY,QAAQ,KAAK,QAAQ;;;;;;;;;;;;;;;;;;EAkB/F,WAAW,QAAQ,yBAAyB,UAAU,oBAAoB,kBAAkB,QAAQ;;;;;EAKpG,yCAAyC;;;;;EAKzC,uCAAuC;;;;;;;;UAQ/B,4BAA4B;;;;;;;EAOpC,OAAO,OAAO,oBAAoB,WAAW,kBAAkB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as SqlColumnIRInput, i as ReportedSqlType } from "./types-fmtEmvj3-B0fQaVes.mjs";
|
|
2
2
|
import "./types-B-dwfOwQ.mjs";
|
|
3
|
-
import "./control-adapter-
|
|
3
|
+
import "./control-adapter-0z3ce44U-CLj4kqLI.mjs";
|
|
4
4
|
import { DataType } from "@prisma/orm-framework/components/codec";
|
|
5
5
|
//#region ../../../2-sql-family/9-family/dist/control-adapter.d.mts
|
|
6
6
|
//#region src/core/resolve-introspected-types.d.ts
|
|
@@ -10,4 +10,4 @@ import { DataType } from "@prisma/orm-framework/components/codec";
|
|
|
10
10
|
declare function resolveIntrospectedColumnType(reported: ReportedSqlType, dataTypes: readonly DataType[]): Pick<SqlColumnIRInput, 'storedType' | 'storedTypeParams'>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { resolveIntrospectedColumnType as t };
|
|
13
|
-
//# sourceMappingURL=control-adapter-
|
|
13
|
+
//# sourceMappingURL=control-adapter-DIwBUSs6.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-adapter-
|
|
1
|
+
{"version":3,"file":"control-adapter-DIwBUSs6.d.mts","names":[],"sources":["../../../../2-sql-family/9-family/dist/control-adapter.d.mts"],"mappings":";;;;;;;;;iBAOiB,8BAA8B,UAAU,iBAAiB,oBAAoB,aAAa,KAAK"}
|
|
@@ -31,9 +31,10 @@ import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
|
31
31
|
import { InternalError, isInternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
32
32
|
import { type } from "arktype";
|
|
33
33
|
import { UNBOUND_PSL_NAMESPACE_NAME } from "@prisma/orm-framework/components/psl-ast";
|
|
34
|
-
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
35
|
-
import { APP_SPACE_ID, SchemaTreeNode, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH, assembleAuthoringContributions as assembleAuthoringContributions$1, describeMigrationStatement, enumValueStatementText, extractCodecLookup, fieldStatementText, issueOutcome, migrationRunnerFailure, modelDisplayName, modelStatementText, sameMarkerHashes, valueObjectFieldStatementText } from "@prisma/orm-framework/components/control";
|
|
34
|
+
import { notOk, ok, okVoid } from "@prisma/orm-framework/utils/result";
|
|
35
|
+
import { APP_SPACE_ID, SchemaTreeNode, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH, assembleAuthoringContributions as assembleAuthoringContributions$1, compareMarkerDatabasePolicies, databasePoliciesMovedFailure, describeMigrationStatement, enumValueStatementText, extractCodecLookup, fieldStatementText, issueOutcome, migrationRunnerFailure, modelDisplayName, modelStatementText, sameMarkerHashes, valueObjectFieldStatementText } from "@prisma/orm-framework/components/control";
|
|
36
36
|
import { assertDescriptorSelfConsistency } from "@prisma/orm-toolchain/migration-tools/spaces";
|
|
37
|
+
import { errorMarkerPoliciesCorrupt } from "@prisma/orm-framework/errors/execution";
|
|
37
38
|
import { jsonToTsSource } from "@prisma/orm-framework/ts-render";
|
|
38
39
|
//#region ../../../2-sql-family/9-family/dist/control.mjs
|
|
39
40
|
function tablesOf(storage) {
|
|
@@ -438,9 +439,15 @@ function createSqlFamilyInstance(stack) {
|
|
|
438
439
|
assertContractMatchesStack(contract, stack);
|
|
439
440
|
return contract;
|
|
440
441
|
};
|
|
441
|
-
const
|
|
442
|
+
const contractHashesOf = (contract) => {
|
|
442
443
|
const storageHash = contract.storage.storageHash;
|
|
443
|
-
|
|
444
|
+
return {
|
|
445
|
+
storageHash,
|
|
446
|
+
profileHash: "profileHash" in contract && typeof contract.profileHash === "string" ? contract.profileHash : storageHash
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
const signSpaceMarker = async (controlAdapter, driver, { space, contract, expected }) => {
|
|
450
|
+
const { storageHash, profileHash } = contractHashesOf(contract);
|
|
444
451
|
const signed = {
|
|
445
452
|
space,
|
|
446
453
|
contract: {
|
|
@@ -459,6 +466,7 @@ function createSqlFamilyInstance(stack) {
|
|
|
459
466
|
if (!sameMarkerHashes(existing, expected)) return {
|
|
460
467
|
...signed,
|
|
461
468
|
status: "conflict",
|
|
469
|
+
reason: "storageHash",
|
|
462
470
|
expected,
|
|
463
471
|
found: existing
|
|
464
472
|
};
|
|
@@ -482,6 +490,7 @@ function createSqlFamilyInstance(stack) {
|
|
|
482
490
|
})) return {
|
|
483
491
|
...signed,
|
|
484
492
|
status: "conflict",
|
|
493
|
+
reason: "storageHash",
|
|
485
494
|
expected,
|
|
486
495
|
found: await readHashes()
|
|
487
496
|
};
|
|
@@ -491,7 +500,18 @@ function createSqlFamilyInstance(stack) {
|
|
|
491
500
|
previous: existing
|
|
492
501
|
};
|
|
493
502
|
};
|
|
494
|
-
const
|
|
503
|
+
const databasePoliciesConflict = async (controlAdapter, driver, checked) => {
|
|
504
|
+
const comparison = compareMarkerDatabasePolicies(await controlAdapter.readMarker(driver, APP_SPACE_ID), checked);
|
|
505
|
+
if (comparison.kind === "held") return void 0;
|
|
506
|
+
return {
|
|
507
|
+
space: APP_SPACE_ID,
|
|
508
|
+
status: "conflict",
|
|
509
|
+
reason: "databasePolicies",
|
|
510
|
+
checked,
|
|
511
|
+
comparison
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
const signSpaces = async (driver, spaces, expectedDatabasePolicies) => {
|
|
495
515
|
const [first] = spaces;
|
|
496
516
|
if (first === void 0) return [];
|
|
497
517
|
const controlAdapter = getControlAdapter();
|
|
@@ -502,6 +522,10 @@ function createSqlFamilyInstance(stack) {
|
|
|
502
522
|
}
|
|
503
523
|
};
|
|
504
524
|
const writeMarkers = async () => {
|
|
525
|
+
if (expectedDatabasePolicies !== void 0) {
|
|
526
|
+
const conflict = await databasePoliciesConflict(controlAdapter, driver, expectedDatabasePolicies);
|
|
527
|
+
if (conflict !== void 0) return [conflict];
|
|
528
|
+
}
|
|
505
529
|
const signatures = [];
|
|
506
530
|
for (const space of spaces) signatures.push(await signSpaceMarker(controlAdapter, driver, space));
|
|
507
531
|
return signatures;
|
|
@@ -655,7 +679,7 @@ function createSqlFamilyInstance(stack) {
|
|
|
655
679
|
return classifyDiffEntityKind(issue, targetEntityKindOf);
|
|
656
680
|
},
|
|
657
681
|
async signSpaces(options) {
|
|
658
|
-
return signSpaces(options.driver, options.spaces);
|
|
682
|
+
return signSpaces(options.driver, options.spaces, options.expectedDatabasePolicies);
|
|
659
683
|
},
|
|
660
684
|
async readMarker(options) {
|
|
661
685
|
return getControlAdapter().readMarker(options.driver, options.space);
|
|
@@ -1378,6 +1402,26 @@ function subjectKey(subject) {
|
|
|
1378
1402
|
return `${subject.namespaceId}\u0000${subject.entityKind ?? ""}\u0000${subject.entityName ?? ""}\u0000${subject.rlsPolicy ?? ""}`;
|
|
1379
1403
|
}
|
|
1380
1404
|
/**
|
|
1405
|
+
* Compares the policies a caller checked with the application space's marker. A runner calls it before
|
|
1406
|
+
* its first space, under its lock or inside its transaction: a change fails the run as
|
|
1407
|
+
* `MIGRATION.MARKER_CAS_FAILURE`, and policies that cannot be read throw `CONTRACT.MARKER_ROW_CORRUPT`.
|
|
1408
|
+
*/
|
|
1409
|
+
async function checkDatabasePoliciesHeld(family, driver, checked) {
|
|
1410
|
+
const comparison = compareMarkerDatabasePolicies(await family.readMarker({
|
|
1411
|
+
driver,
|
|
1412
|
+
space: APP_SPACE_ID
|
|
1413
|
+
}), checked);
|
|
1414
|
+
switch (comparison.kind) {
|
|
1415
|
+
case "held": return okVoid();
|
|
1416
|
+
case "moved": return notOk(databasePoliciesMovedFailure(checked, comparison.found));
|
|
1417
|
+
case "unreadable": throw errorMarkerPoliciesCorrupt({
|
|
1418
|
+
why: comparison.why,
|
|
1419
|
+
space: APP_SPACE_ID,
|
|
1420
|
+
markerLocation: family.markerLocation
|
|
1421
|
+
});
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
/**
|
|
1381
1425
|
* The way out of a refusal that no statement or second plan can lift: a migration the user writes
|
|
1382
1426
|
* by hand, which rewrites `what` with the other operations of the change.
|
|
1383
1427
|
*/
|
|
@@ -4294,6 +4338,6 @@ function columnCodecRef(codecId, column) {
|
|
|
4294
4338
|
}
|
|
4295
4339
|
var control_default = new SqlFamilyDescriptor();
|
|
4296
4340
|
//#endregion
|
|
4297
|
-
export {
|
|
4341
|
+
export { requiredColumnOf as $, isUnfilledSlot as A, planFieldEventCalls as B, encodeStoredValue as C, unnamedFieldFillOf as Ct, fieldStatementColumns as D, fieldRenameStorageEffect as E, otherSpaceDeclaring as F, planValueObjectFieldRewrites as G, planStatements as H, parseJsonPath as I, plannerSuccess as J, planVariantRowRewrites as K, partitionCallsByControlPolicy as L, keepRowsEdit as M, keyPathOf as N, fillKeyProblem as O, modelRenameStorageEffect as P, requiredColumnMeta as Q, partitionIssuesByControlPolicy as R, detectTableNameCaseChanges as S, unmatchedTableRename as St, fieldOfColumn as T, planStoredRewrites as U, planFieldEventOperations as V, planValueObjectFieldFills as W, readReportedDefault as X, readColumnDefault as Y, removalsOfMigration as Z, convertedColumnMeta as _, storedValueSubjects as _t, UnfilledValue as a, rowsHoldingValueOf as at, createSqlTextSources as b, unknownCallNames as bt, assembleAuthoringContributions$1 as c, runnerFailure as ct, checkSqlExpressionText as d, slotSource as dt, requiredColumnsOfMigration as et, columnTakesTemporaryValue as f, sqlDefaultFunctions as ft, control_default as g, storedValueOperationIndexes as gt, contractToSchemaIR as h, storageNameOfOperation as ht, TABLE_NAME_CASE_CHANGED_CODE as i, rowsHoldingValueMeta as it, jsonPathText as j, fillValueProblem as k, backfillOfDefaultedField as l, runnerSuccess as lt, contractNamespaceToSchemaIR as m, sqlTypeLookupsOf as mt, INIT_ADDITIVE_POLICY as n, resolveTableRenameAgainst as nt, acceptedByDataType as o, rowsWithoutValueFailure as ot, contractColumns as p, sqlOfSlot as pt, plannerFailure as q, NO_RENAMED_ORIGINS as r, rowsHoldingValueFailure as rt, appliedStatementsInOrder as s, rowsWithoutValueSummary as st, COLUMN_RENAME_UNMATCHED_CODE as t, resolveColumnRenameAgainst as tt, checkDatabasePoliciesHeld as u, scalarTypeNamesOf as ut, convertedColumnOf as v, subjectsOfCalls as vt, fieldEventStorage as w, detectDestructiveChanges as x, unmatchedColumnRename as xt, createMigrationPlan as y, unconvertedFieldOf as yt, planEnumValueRewrites as z };
|
|
4298
4342
|
|
|
4299
|
-
//# sourceMappingURL=control-
|
|
4343
|
+
//# sourceMappingURL=control-kHFMtE8A.mjs.map
|