@prisma-next/family-sql 0.5.0-dev.75 → 0.5.0-dev.77
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.d.mts +3 -3
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +7 -7
- package/dist/control.mjs.map +1 -1
- package/dist/migration.d.mts +1 -1
- package/dist/schema-verify.d.mts +1 -1
- package/dist/{types-CIdiS2QK.d.mts → types-BzkmvbH0.d.mts} +3 -3
- package/dist/types-BzkmvbH0.d.mts.map +1 -0
- package/dist/verify-sql-schema-C84vejAP.mjs.map +1 -1
- package/package.json +20 -20
- package/src/core/migrations/field-event-planner.ts +11 -15
- package/src/core/migrations/types.ts +2 -4
- package/dist/types-CIdiS2QK.d.mts.map +0 -1
package/dist/control.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as SqlPlanTargetDetails, B as SchemaVerifyOptions, C as SqlMigrationRunner, D as SqlMigrationRunnerFailure, E as SqlMigrationRunnerExecuteOptions, F as SqlPlannerResult, I as SqlPlannerSuccessResult, L as StorageTypePlanResult, M as SqlPlannerConflictKind, N as SqlPlannerConflictLocation, O as SqlMigrationRunnerResult, P as SqlPlannerFailureResult, R as collectInitDependencies, S as SqlMigrationPlannerPlanOptions, T as SqlMigrationRunnerExecuteCallbacks, V as SqlControlFamilyInstance, _ as SqlMigrationPlanContractInfo, a as CreateSqlMigrationPlanOptions, b as SqlMigrationPlanOperationTarget, c as FieldEventContext, d as MultiSpaceRunnerSuccessValue, f as ResolveIdentityValueInput, g as SqlMigrationPlan, h as SqlControlTargetDescriptor, i as ComponentDatabaseDependency, j as SqlPlannerConflict, k as SqlMigrationRunnerSuccessValue, l as MultiSpaceRunnerFailure, m as SqlControlExtensionDescriptor, n as CodecControlHooks, o as ExpandNativeTypeInput, p as SqlControlAdapterDescriptor, r as ComponentDatabaseDependencies, s as FieldEvent, t as AnyRecord, u as MultiSpaceRunnerResult, v as SqlMigrationPlanOperation, w as SqlMigrationRunnerErrorCode, x as SqlMigrationPlanner, y as SqlMigrationPlanOperationStep, z as isDatabaseDependencyProvider } from "./types-
|
|
2
|
-
import { ControlFamilyDescriptor, ControlStack, MigrationOperationClass, MigrationOperationPolicy, MigrationOperationPolicy as MigrationOperationPolicy$1, MigrationPlan, MigrationPlanOperation, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerConflict as MigrationPlannerConflict$1, MigrationPlannerResult, MutationDefaultGeneratorDescriptor, TargetMigrationsCapability, assembleAuthoringContributions } from "@prisma-next/framework-components/control";
|
|
1
|
+
import { A as SqlPlanTargetDetails, B as SchemaVerifyOptions, C as SqlMigrationRunner, D as SqlMigrationRunnerFailure, E as SqlMigrationRunnerExecuteOptions, F as SqlPlannerResult, I as SqlPlannerSuccessResult, L as StorageTypePlanResult, M as SqlPlannerConflictKind, N as SqlPlannerConflictLocation, O as SqlMigrationRunnerResult, P as SqlPlannerFailureResult, R as collectInitDependencies, S as SqlMigrationPlannerPlanOptions, T as SqlMigrationRunnerExecuteCallbacks, V as SqlControlFamilyInstance, _ as SqlMigrationPlanContractInfo, a as CreateSqlMigrationPlanOptions, b as SqlMigrationPlanOperationTarget, c as FieldEventContext, d as MultiSpaceRunnerSuccessValue, f as ResolveIdentityValueInput, g as SqlMigrationPlan, h as SqlControlTargetDescriptor, i as ComponentDatabaseDependency, j as SqlPlannerConflict, k as SqlMigrationRunnerSuccessValue, l as MultiSpaceRunnerFailure, m as SqlControlExtensionDescriptor, n as CodecControlHooks, o as ExpandNativeTypeInput, p as SqlControlAdapterDescriptor, r as ComponentDatabaseDependencies, s as FieldEvent, t as AnyRecord, u as MultiSpaceRunnerResult, v as SqlMigrationPlanOperation, w as SqlMigrationRunnerErrorCode, x as SqlMigrationPlanner, y as SqlMigrationPlanOperationStep, z as isDatabaseDependencyProvider } from "./types-BzkmvbH0.mjs";
|
|
2
|
+
import { ControlFamilyDescriptor, ControlStack, MigrationOperationClass, MigrationOperationPolicy, MigrationOperationPolicy as MigrationOperationPolicy$1, MigrationPlan, MigrationPlanOperation, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerConflict as MigrationPlannerConflict$1, MigrationPlannerResult, MutationDefaultGeneratorDescriptor, OpFactoryCall, TargetMigrationsCapability, assembleAuthoringContributions } from "@prisma-next/framework-components/control";
|
|
3
3
|
import { NotOk, Ok } from "@prisma-next/utils/result";
|
|
4
4
|
import { ColumnDefault, Contract } from "@prisma-next/contract/types";
|
|
5
5
|
import { SqlSchemaIR } from "@prisma-next/sql-schema-ir/types";
|
|
@@ -326,7 +326,7 @@ interface PlanFieldEventOperationsOptions {
|
|
|
326
326
|
*/
|
|
327
327
|
readonly codecHooks: ReadonlyMap<string, CodecControlHooks>;
|
|
328
328
|
}
|
|
329
|
-
declare function planFieldEventOperations(options: PlanFieldEventOperationsOptions): readonly
|
|
329
|
+
declare function planFieldEventOperations(options: PlanFieldEventOperationsOptions): readonly OpFactoryCall[];
|
|
330
330
|
//#endregion
|
|
331
331
|
//#region src/core/migrations/plan-helpers.d.ts
|
|
332
332
|
declare function createMigrationPlan<TTargetDetails>(options: CreateSqlMigrationPlanOptions<TTargetDetails>): SqlMigrationPlan<TTargetDetails>;
|
package/dist/control.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-descriptor.ts","../src/core/assembly.ts","../src/core/migrations/contract-to-schema-ir.ts","../src/core/migrations/field-event-planner.ts","../src/core/migrations/plan-helpers.ts","../src/core/migrations/policies.ts","../src/core/timestamp-now-generator.ts","../src/exports/control.ts"],"mappings":";;;;;;;;;;cAUa,mBAAA,YACA,uBAAA,QAA+B,wBAAA;EAAA,SAEjC,IAAA;EAAA,SACA,EAAA;EAAA,SACA,QAAA;EAAA,SACA,OAAA;EAAA,SACA,QAAA,EAAU,WAAA;EAAA,SACV,SAAA;IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKT,MAAA,0BAAA,CACE,KAAA,EAAO,YAAA,QAAoB,SAAA,IAC1B,wBAAA;AAAA;;;iBCHW,wBAAA,CACd,WAAA,EAAa,aAAA,CAAc,8BAAA,mBAC1B,GAAA,SAAY,iBAAA;;;;;;;;ADdf;;;;;KE0BY,kBAAA,IAAsB,KAAA;EAAA,SACvB,UAAA;EAAA,SACA,OAAA;EAAA,SACA,UAAA,GAAa,MAAA;AAAA;;;;;;;;;;KAYZ,eAAA,IAAmB,GAAA,EAAK,aAAA,EAAe,MAAA,EAAQ,aAAA;;;;;;;;;;iBAuI3C,wBAAA,CACd,IAAA,EAAM,UAAA,SACN,EAAA,EAAI,UAAA,YACM,0BAAA;AAAA,UAiCK,yBAAA;EAAA,SACN,mBAAA;EAAA,SACA,gBAAA,GAAmB,kBAAA;EAAA,SACnB,aAAA,GAAgB,eAAA;EAAA,SAChB,mBAAA,GAAsB,aAAA,CAAc,8BAAA;AAAA;;;;;;;;;;;;;;;;iBAkB/B,kBAAA,CACd,QAAA,EAAU,QAAA,CAAS,UAAA,UACnB,OAAA,EAAS,yBAAA,GACR,WAAA;;;
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-descriptor.ts","../src/core/assembly.ts","../src/core/migrations/contract-to-schema-ir.ts","../src/core/migrations/field-event-planner.ts","../src/core/migrations/plan-helpers.ts","../src/core/migrations/policies.ts","../src/core/timestamp-now-generator.ts","../src/exports/control.ts"],"mappings":";;;;;;;;;;cAUa,mBAAA,YACA,uBAAA,QAA+B,wBAAA;EAAA,SAEjC,IAAA;EAAA,SACA,EAAA;EAAA,SACA,QAAA;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AAS,+BAAA,YACC,aAAA;;;iBCmCI,mBAAA,gBAAA,CACd,OAAA,EAAS,6BAAA,CAA8B,cAAA,IACtC,gBAAA,CAAiB,cAAA;AAAA,iBAcJ,cAAA,gBAAA,CACd,IAAA,EAAM,gBAAA,CAAiB,cAAA,IACtB,uBAAA,CAAwB,cAAA;AAAA,iBAOX,cAAA,CAAe,SAAA,WAAoB,kBAAA,KAAuB,uBAAA;;;;iBAoB1D,aAAA,CAAc,KAAA;EAC5B,iBAAA;EACA,kBAAA;AAAA,IACE,EAAA,CAAG,8BAAA;;;;iBAYS,aAAA,CACd,IAAA,EAAM,2BAAA,EACN,OAAA,UACA,OAAA;EAAY,GAAA;EAAc,IAAA,GAAO,SAAA;AAAA,IAChC,KAAA,CAAM,yBAAA;;;;;;cC1JI,oBAAA,EAAsB,0BAAA;;;;;;;;;;;;;;iBCsBnB,6BAAA,CAAA,GAAiC,kCAAA;;;;;;;;;;;iBAoBjC,wBAAA,+DAAA,CAGd,KAAA;EAAA,SAAkB,OAAA,EAAS,OAAA;EAAA,SAAkB,UAAA,EAAY,UAAA;AAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cC4BlB,QAAA"}
|
package/dist/control.mjs
CHANGED
|
@@ -1609,13 +1609,13 @@ function planFieldEventOperations(options) {
|
|
|
1609
1609
|
}
|
|
1610
1610
|
}
|
|
1611
1611
|
}
|
|
1612
|
-
const
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
return
|
|
1612
|
+
const calls = [];
|
|
1613
|
+
appendCalls("added", added, options.codecHooks, calls, (e) => e.newField?.codecId);
|
|
1614
|
+
appendCalls("dropped", dropped, options.codecHooks, calls, (e) => e.priorField?.codecId);
|
|
1615
|
+
appendCalls("altered", altered, options.codecHooks, calls, (e) => e.newField?.codecId);
|
|
1616
|
+
return calls;
|
|
1617
1617
|
}
|
|
1618
|
-
function
|
|
1618
|
+
function appendCalls(event, entries, codecHooks, calls, pickCodecId) {
|
|
1619
1619
|
for (const entry of entries) {
|
|
1620
1620
|
const codecId = pickCodecId(entry);
|
|
1621
1621
|
if (codecId === void 0) continue;
|
|
@@ -1623,7 +1623,7 @@ function appendOps(event, entries, codecHooks, ops, pickCodecId) {
|
|
|
1623
1623
|
if (!hook?.onFieldEvent) continue;
|
|
1624
1624
|
const ctx = buildContext(event, entry);
|
|
1625
1625
|
const emitted = hook.onFieldEvent(event, ctx);
|
|
1626
|
-
for (const
|
|
1626
|
+
for (const call of emitted) calls.push(call);
|
|
1627
1627
|
}
|
|
1628
1628
|
}
|
|
1629
1629
|
/**
|