@prisma-next/family-sql 0.14.0-dev.49 → 0.14.0-dev.50
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-adapter-DHYFuOBy.d.mts → control-adapter-BVOj4gXI.d.mts} +34 -5
- package/dist/control-adapter-BVOj4gXI.d.mts.map +1 -0
- package/dist/control-adapter.d.mts +1 -1
- package/dist/control.d.mts +65 -50
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +308 -56
- package/dist/control.mjs.map +1 -1
- package/dist/diff.d.mts +141 -30
- package/dist/diff.d.mts.map +1 -1
- package/dist/diff.mjs +155 -1384
- package/dist/diff.mjs.map +1 -1
- package/dist/ir.d.mts +5 -5
- package/dist/ir.d.mts.map +1 -1
- package/dist/ir.mjs +2 -2
- package/dist/ir.mjs.map +1 -1
- package/dist/migration.d.mts +1 -1
- package/dist/schema-differ-DnoopSXm.d.mts +45 -0
- package/dist/schema-differ-DnoopSXm.d.mts.map +1 -0
- package/dist/schema-verify-W3r631Jh.mjs +226 -0
- package/dist/schema-verify-W3r631Jh.mjs.map +1 -0
- package/dist/{sql-contract-serializer-DwUSJ4PO.mjs → sql-contract-serializer-C75cfMSS.mjs} +2 -2
- package/dist/{sql-contract-serializer-DwUSJ4PO.mjs.map → sql-contract-serializer-C75cfMSS.mjs.map} +1 -1
- package/dist/{types-DBxrwN1d.d.mts → types-BW7pzb2j.d.mts} +24 -15
- package/dist/types-BW7pzb2j.d.mts.map +1 -0
- package/package.json +21 -21
- package/src/core/control-instance.ts +99 -80
- package/src/core/control-target-descriptor.ts +29 -14
- package/src/core/diff/diff-tree-normalization.ts +211 -0
- package/src/core/diff/schema-verify.ts +324 -0
- package/src/core/diff/sql-schema-diff.ts +40 -1466
- package/src/core/diff/verifier-disposition.ts +14 -42
- package/src/core/ir/sql-schema-verifier-base.ts +5 -5
- package/src/core/migrations/contract-to-schema-ir.ts +63 -20
- package/src/core/migrations/native-type-expander.ts +28 -0
- package/src/core/migrations/schema-differ.ts +30 -29
- package/src/core/migrations/types.ts +23 -14
- package/src/exports/control.ts +6 -0
- package/src/exports/diff.ts +28 -8
- package/dist/contract-to-schema-ir-S-evq8E6.mjs +0 -264
- package/dist/contract-to-schema-ir-S-evq8E6.mjs.map +0 -1
- package/dist/control-adapter-DHYFuOBy.d.mts.map +0 -1
- package/dist/sql-schema-diff-6z36dZt6.d.mts +0 -105
- package/dist/sql-schema-diff-6z36dZt6.d.mts.map +0 -1
- package/dist/types-DBxrwN1d.d.mts.map +0 -1
- package/src/core/diff/control-verify-emit.ts +0 -46
- package/src/core/diff/verify-helpers.ts +0 -832
|
@@ -1,10 +1,39 @@
|
|
|
1
|
-
import { n as NativeTypeNormalizer, t as DefaultNormalizer } from "./sql-schema-diff-6z36dZt6.mjs";
|
|
2
|
-
import { ContractMarkerRecord, LedgerEntryRecord } from "@prisma-next/contract/types";
|
|
3
1
|
import { ControlAdapterInstance, ControlStack } from "@prisma-next/framework-components/control";
|
|
2
|
+
import { ColumnDefault, ContractMarkerRecord, LedgerEntryRecord } from "@prisma-next/contract/types";
|
|
4
3
|
import { SqlControlDriverInstance } from "@prisma-next/sql-contract/types";
|
|
4
|
+
import { SqlIndexIR, SqlSchemaIRNode, SqlUniqueIR } from "@prisma-next/sql-schema-ir/types";
|
|
5
5
|
import { AnyQueryAst, DdlNode, LoweredStatement, LowererContext, SqlExecuteRequest } from "@prisma-next/sql-relational-core/ast";
|
|
6
|
-
import { SqlSchemaIRNode } from "@prisma-next/sql-schema-ir/types";
|
|
7
6
|
|
|
7
|
+
//#region src/core/diff/sql-schema-diff.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Function type for normalizing raw database default expressions into ColumnDefault.
|
|
10
|
+
* Target-specific implementations handle database dialect differences.
|
|
11
|
+
*/
|
|
12
|
+
type DefaultNormalizer = (rawDefault: string, nativeType: string) => ColumnDefault | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Function type for normalizing schema native types to canonical form for comparison.
|
|
15
|
+
* Target-specific implementations handle dialect-specific type name variations
|
|
16
|
+
* (e.g., Postgres 'varchar' → 'character varying', 'timestamptz' normalization).
|
|
17
|
+
*/
|
|
18
|
+
type NativeTypeNormalizer = (nativeType: string) => string;
|
|
19
|
+
/**
|
|
20
|
+
* Compares two arrays of strings for equality (order-sensitive).
|
|
21
|
+
*/
|
|
22
|
+
declare function arraysEqual(a: readonly string[], b: readonly string[]): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Checks if a unique constraint requirement is satisfied by the given columns:
|
|
25
|
+
* a unique constraint with the same columns, or a unique index with the same
|
|
26
|
+
* columns (semantic satisfaction). Used by the planners to keep the
|
|
27
|
+
* "stronger satisfies weaker" behavior consistent across the control plane.
|
|
28
|
+
*/
|
|
29
|
+
declare function isUniqueConstraintSatisfied(uniques: readonly SqlUniqueIR[], indexes: readonly SqlIndexIR[], columns: readonly string[]): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Checks if an index requirement is satisfied by the given columns: any index
|
|
32
|
+
* (unique or non-unique) with the same columns, or a unique constraint with
|
|
33
|
+
* the same columns (stronger satisfies weaker).
|
|
34
|
+
*/
|
|
35
|
+
declare function isIndexSatisfied(indexes: readonly SqlIndexIR[], uniques: readonly SqlUniqueIR[], columns: readonly string[]): boolean;
|
|
36
|
+
//#endregion
|
|
8
37
|
//#region src/core/control-adapter.d.ts
|
|
9
38
|
/**
|
|
10
39
|
* Structural interface for anything that can lower a SQL/DDL AST node to a
|
|
@@ -166,5 +195,5 @@ interface SqlControlAdapterDescriptor<TTarget extends string = string> {
|
|
|
166
195
|
create(stack: ControlStack<'sql', TTarget>): SqlControlAdapter<TTarget>;
|
|
167
196
|
}
|
|
168
197
|
//#endregion
|
|
169
|
-
export { SqlControlAdapterDescriptor as i, Lowerer as n, SqlControlAdapter as r, ExecuteRequestLowerer as t };
|
|
170
|
-
//# sourceMappingURL=control-adapter-
|
|
198
|
+
export { NativeTypeNormalizer as a, isUniqueConstraintSatisfied as c, SqlControlAdapterDescriptor as i, Lowerer as n, arraysEqual as o, SqlControlAdapter as r, isIndexSatisfied as s, ExecuteRequestLowerer as t };
|
|
199
|
+
//# sourceMappingURL=control-adapter-BVOj4gXI.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-adapter-BVOj4gXI.d.mts","names":[],"sources":["../src/core/diff/sql-schema-diff.ts","../src/core/control-adapter.ts"],"mappings":";;;;;;;;;;;KAgBY,iBAAA,IACV,UAAA,UACA,UAAA,aACG,aAAa;AAAA;AAOlB;;;;AAPkB,KAON,oBAAA,IAAwB,UAAkB;AAKtD;;;AAAA,iBAAgB,WAAA,CAAY,CAAA,qBAAsB,CAAoB;AAAA;AAkBtE;;;;;AAlBsE,iBAkBtD,2BAAA,CACd,OAAA,WAAkB,WAAA,IAClB,OAAA,WAAkB,UAAU,IAC5B,OAAA;;;;;AAA0B;iBAcZ,gBAAA,CACd,OAAA,WAAkB,UAAA,IAClB,OAAA,WAAkB,WAAW,IAC7B,OAAA;;;;AArDF;;;;;;UCOiB,OAAA;EACf,KAAA,CAAM,GAAA,EAAK,WAAA,GAAc,OAAA,EAAS,OAAA,EAAS,cAAA,YAA0B,gBAAA;AAAA;ADEvE;;;;AAAsD;AAKtD;AALA,UCOiB,qBAAA,SAA8B,OAAA;EAC7C,qBAAA,CACE,GAAA,EAAK,WAAA,GAAc,OAAA,EACnB,OAAA,GAAU,cAAA,YACT,OAAA,CAAQ,iBAAA;AAAA;ADNyD;AAkBtE;;;;;AAlBsE,UCerD,iBAAA,0CACP,sBAAA,QAA8B,OAAA,GACpC,qBAAA;EDGgB;;;;AACQ;AAc5B;;;;;;;;;;ECFE,UAAA,CACE,MAAA,EAAQ,wBAAA,CAAyB,OAAA,GACjC,KAAA,WACC,OAAA,CAAQ,oBAAA;;;;AA5Cb;;;;EAqDE,cAAA,CACE,MAAA,EAAQ,wBAAA,CAAyB,OAAA,IAChC,OAAA,CAAQ,WAAA,SAAoB,o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@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as SqlControlAdapterDescriptor, n as Lowerer, r as SqlControlAdapter, t as ExecuteRequestLowerer } from "./control-adapter-
|
|
1
|
+
import { i as SqlControlAdapterDescriptor, n as Lowerer, r as SqlControlAdapter, t as ExecuteRequestLowerer } from "./control-adapter-BVOj4gXI.mjs";
|
|
2
2
|
export type { ExecuteRequestLowerer, Lowerer, SqlControlAdapter, SqlControlAdapterDescriptor };
|
package/dist/control.d.mts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { r as SqlControlAdapter } from "./control-adapter-
|
|
2
|
-
import { A as SqlPlannerSuccessResult, C as SqlMigrationRunnerSuccessValue, D as SqlPlannerConflictLocation, E as SqlPlannerConflictKind, O as SqlPlannerFailureResult, S as SqlMigrationRunnerResult, T as SqlPlannerConflict, _ as SqlMigrationRunner, a as FieldEvent, b as SqlMigrationRunnerExecuteOptions, c as SqlControlAdapterDescriptor, d as SqlMigrationPlanContractInfo, f as SqlMigrationPlanOperation, g as SqlMigrationPlannerPlanOptions, h as SqlMigrationPlanner, i as ExpandNativeTypeInput, j as StorageTypePlanResult, k as SqlPlannerResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationTarget, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperationStep, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, t as AnyRecord, u as SqlMigrationPlan, v as SqlMigrationRunnerErrorCode, w as SqlPlanTargetDetails, x as SqlMigrationRunnerFailure, y as SqlMigrationRunnerExecuteCallbacks } from "./types-
|
|
1
|
+
import { r as SqlControlAdapter } from "./control-adapter-BVOj4gXI.mjs";
|
|
2
|
+
import { A as SqlPlannerSuccessResult, C as SqlMigrationRunnerSuccessValue, D as SqlPlannerConflictLocation, E as SqlPlannerConflictKind, O as SqlPlannerFailureResult, S as SqlMigrationRunnerResult, T as SqlPlannerConflict, _ as SqlMigrationRunner, a as FieldEvent, b as SqlMigrationRunnerExecuteOptions, c as SqlControlAdapterDescriptor, d as SqlMigrationPlanContractInfo, f as SqlMigrationPlanOperation, g as SqlMigrationPlannerPlanOptions, h as SqlMigrationPlanner, i as ExpandNativeTypeInput, j as StorageTypePlanResult, k as SqlPlannerResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationTarget, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperationStep, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, t as AnyRecord, u as SqlMigrationPlan, v as SqlMigrationRunnerErrorCode, w as SqlPlanTargetDetails, x as SqlMigrationRunnerFailure, y as SqlMigrationRunnerExecuteCallbacks } from "./types-BW7pzb2j.mjs";
|
|
3
|
+
import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DnoopSXm.mjs";
|
|
4
|
+
import { ContractSerializer, ControlFamilyDescriptor, ControlFamilyInstance, ControlStack, DiffSubjectGranularity, MigratableTargetDescriptor, MigrationOperationClass, MigrationOperationPolicy, MigrationOperationPolicy as MigrationOperationPolicy$1, MigrationPlan, MigrationPlanOperation, MigrationPlanOperation as MigrationPlanOperation$1, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerConflict as MigrationPlannerConflict$1, MigrationPlannerResult, MutationDefaultGeneratorDescriptor, OpFactoryCall, OperationPreview, OperationPreviewCapable, PslContractInferCapable, SchemaDiffIssue, SchemaVerifier, SchemaViewCapable, SignDatabaseResult, TargetMigrationsCapability, VerifyDatabaseResult, VerifyDatabaseSchemaResult, assembleAuthoringContributions } from "@prisma-next/framework-components/control";
|
|
3
5
|
import { ColumnDefault, Contract, ControlPolicy } from "@prisma-next/contract/types";
|
|
4
|
-
import { ContractSerializer, ControlFamilyDescriptor, ControlFamilyInstance, ControlStack, MigratableTargetDescriptor, MigrationOperationClass, MigrationOperationPolicy, MigrationOperationPolicy as MigrationOperationPolicy$1, MigrationPlan, MigrationPlanOperation, MigrationPlanOperation as MigrationPlanOperation$1, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerConflict as MigrationPlannerConflict$1, MigrationPlannerResult, MutationDefaultGeneratorDescriptor, OpFactoryCall, OperationPreview, OperationPreviewCapable, PslContractInferCapable, SchemaDiffer, SchemaVerifier, SchemaViewCapable, SignDatabaseResult, TargetMigrationsCapability, VerifyDatabaseResult, VerifyDatabaseSchemaResult, assembleAuthoringContributions } from "@prisma-next/framework-components/control";
|
|
5
6
|
import { SqlControlDriverInstance, SqlStorage, StorageColumn } from "@prisma-next/sql-contract/types";
|
|
7
|
+
import { SqlSchemaIR, SqlSchemaIRNode } from "@prisma-next/sql-schema-ir/types";
|
|
6
8
|
import { NotOk, Ok } from "@prisma-next/utils/result";
|
|
7
9
|
import { AnyQueryAst, DdlNode, LowererContext, SqlExecuteRequest } from "@prisma-next/sql-relational-core/ast";
|
|
8
|
-
import { SqlSchemaIR, SqlSchemaIRNode } from "@prisma-next/sql-schema-ir/types";
|
|
9
|
-
import { TargetBoundComponentDescriptor } from "@prisma-next/framework-components/components";
|
|
10
10
|
import { EmissionSpi, TypesImportSpec } from "@prisma-next/framework-components/emission";
|
|
11
|
+
import { TargetBoundComponentDescriptor } from "@prisma-next/framework-components/components";
|
|
11
12
|
import { PslDocumentAst } from "@prisma-next/framework-components/psl-ast";
|
|
12
13
|
import { SqlOperationDescriptors } from "@prisma-next/sql-operations";
|
|
13
14
|
|
|
@@ -56,6 +57,24 @@ interface SqlControlFamilyInstance extends ControlFamilyInstance<'sql', SqlSchem
|
|
|
56
57
|
readonly strict: boolean;
|
|
57
58
|
readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
|
|
58
59
|
}): VerifyDatabaseSchemaResult;
|
|
60
|
+
/**
|
|
61
|
+
* Classifies a diff issue's subject granularity on demand, resolved from
|
|
62
|
+
* its node's `nodeKind` via the target's classifier. Satisfies the
|
|
63
|
+
* {@link import('@prisma-next/framework-components/control').SchemaSubjectClassifierCapable}
|
|
64
|
+
* capability that framework consumers spanning contract spaces (the
|
|
65
|
+
* migration aggregate's unclaimed-elements sweep) detect via
|
|
66
|
+
* `hasSchemaSubjectClassifier` and call instead of reading family/target
|
|
67
|
+
* node vocabulary. Nothing is stamped on the issue or the node.
|
|
68
|
+
*/
|
|
69
|
+
classifySubjectGranularity(issue: SchemaDiffIssue): DiffSubjectGranularity | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Classifies a diff issue's subject storage `entityKind` on demand,
|
|
72
|
+
* resolved from its node's `nodeKind` via the target's classifier —
|
|
73
|
+
* sibling of `classifySubjectGranularity` above, part of the same
|
|
74
|
+
* {@link import('@prisma-next/framework-components/control').SchemaSubjectClassifierCapable}
|
|
75
|
+
* capability. Nothing is stamped on the issue or the node.
|
|
76
|
+
*/
|
|
77
|
+
classifyEntityKind(issue: SchemaDiffIssue): string | undefined;
|
|
59
78
|
sign(options: {
|
|
60
79
|
readonly driver: SqlControlDriverInstance<string>;
|
|
61
80
|
readonly contract: unknown;
|
|
@@ -367,37 +386,6 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
|
|
|
367
386
|
//#region src/core/assembly.d.ts
|
|
368
387
|
declare function extractCodecControlHooks(descriptors: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>): Map<string, CodecControlHooks>;
|
|
369
388
|
//#endregion
|
|
370
|
-
//#region src/core/migrations/schema-differ.d.ts
|
|
371
|
-
/**
|
|
372
|
-
* Inputs to a SQL target's schema-differ (`diffDatabaseSchema` /
|
|
373
|
-
* `verifyDatabaseSchema` on the descriptor): the contract (the expected side
|
|
374
|
-
* derives from it), the introspected actual schema node, and the resolution
|
|
375
|
-
* context the relational diff needs.
|
|
376
|
-
*/
|
|
377
|
-
interface DiffDatabaseSchemaInput {
|
|
378
|
-
readonly contract: Contract<SqlStorage>;
|
|
379
|
-
readonly schema: SqlSchemaIRNode;
|
|
380
|
-
readonly strict: boolean;
|
|
381
|
-
readonly typeMetadataRegistry: ReadonlyMap<string, {
|
|
382
|
-
readonly nativeType?: string;
|
|
383
|
-
}>;
|
|
384
|
-
readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
* The `SchemaDiffer` a SQL target implements: the black-box comparison of the
|
|
388
|
-
* contract's expected schema against the introspected actual schema, projected
|
|
389
|
-
* to the two issue lists. How it computes them is private to the target.
|
|
390
|
-
*/
|
|
391
|
-
type SqlDiffDatabaseSchema = SchemaDiffer<DiffDatabaseSchemaInput>['diff'];
|
|
392
|
-
/**
|
|
393
|
-
* The same combined comparison as {@link SqlDiffDatabaseSchema}, wrapped in the
|
|
394
|
-
* verify envelope (`ok`/`summary`/`code`/`target`/`timings`) plus the
|
|
395
|
-
* pass/warn/fail tree the CLI renders. Verify calls this instead of the diff so
|
|
396
|
-
* the relational walk that produces the tree runs once per verify, not once for
|
|
397
|
-
* the diff and again for the tree.
|
|
398
|
-
*/
|
|
399
|
-
type SqlVerifyDatabaseSchema = (input: DiffDatabaseSchemaInput) => VerifyDatabaseSchemaResult;
|
|
400
|
-
//#endregion
|
|
401
389
|
//#region src/core/control-target-descriptor.d.ts
|
|
402
390
|
/**
|
|
403
391
|
* One stack extension pack's already-assembled contract, paired with the
|
|
@@ -440,22 +428,36 @@ interface SqlControlTargetDescriptor<TTargetId extends string, TTargetDetails, T
|
|
|
440
428
|
*/
|
|
441
429
|
readonly inferPslContract?: (schema: SqlSchemaIRNode, describedContracts?: readonly SqlDescribedContractSpace[]) => PslDocumentAst;
|
|
442
430
|
/**
|
|
443
|
-
* The
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
*
|
|
447
|
-
*
|
|
448
|
-
|
|
431
|
+
* The full-tree node diff the family verify verdict derives from —
|
|
432
|
+
* expected-tree derivation, pre-diff normalization, the generic differ,
|
|
433
|
+
* and ownership scoping, all target-side. The family applies strict
|
|
434
|
+
* gating + control-policy disposition over the returned issues; verify
|
|
435
|
+
* rejects when a surviving issue is a failure.
|
|
436
|
+
*/
|
|
437
|
+
readonly diffSchema: SqlSchemaDiffFn;
|
|
438
|
+
/**
|
|
439
|
+
* Classifies a diff-tree node's `nodeKind` into its framework-neutral
|
|
440
|
+
* {@link DiffSubjectGranularity} — the target owns the full node vocabulary
|
|
441
|
+
* that appears in its diff tree (its own kinds plus the relational kinds it
|
|
442
|
+
* delegates to), so it is the one place that can resolve this. The family
|
|
443
|
+
* verdict calls it inline per issue (never stamping the result); the
|
|
444
|
+
* framework aggregate's unclaimed-elements sweep reaches the same
|
|
445
|
+
* classifier via the family instance's `classifySubjectGranularity`
|
|
446
|
+
* capability.
|
|
449
447
|
*/
|
|
450
|
-
readonly
|
|
448
|
+
readonly classifySubjectGranularity: (nodeKind: string) => DiffSubjectGranularity;
|
|
451
449
|
/**
|
|
452
|
-
*
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
*
|
|
456
|
-
*
|
|
450
|
+
* Classifies a diff-tree node's `nodeKind` into its storage `entityKind` —
|
|
451
|
+
* the same vocabulary the contract storage's `entries` dictionary keys use
|
|
452
|
+
* (e.g. `'table'`). Sibling of `classifySubjectGranularity`, resolved the
|
|
453
|
+
* same way: the target owns the full node vocabulary, so it is the one
|
|
454
|
+
* place that can resolve this. `undefined` for a node kind with no
|
|
455
|
+
* storage entity of its own (a column, an index, …). The framework
|
|
456
|
+
* aggregate's unclaimed-elements sweep reaches this via the family
|
|
457
|
+
* instance's `classifyEntityKind` capability, so it never hardcodes a
|
|
458
|
+
* family entity kind.
|
|
457
459
|
*/
|
|
458
|
-
readonly
|
|
460
|
+
readonly classifyEntityKind: (nodeKind: string) => string | undefined;
|
|
459
461
|
createPlanner(adapter: SqlControlAdapter<TTargetId>): SqlMigrationPlanner<TTargetDetails>;
|
|
460
462
|
createRunner(family: SqlControlFamilyInstance): SqlMigrationRunner<TTargetDetails>;
|
|
461
463
|
}
|
|
@@ -696,6 +698,19 @@ interface PlanFieldEventOperationsOptions {
|
|
|
696
698
|
}
|
|
697
699
|
declare function planFieldEventOperations(options: PlanFieldEventOperationsOptions): readonly OpFactoryCall[];
|
|
698
700
|
//#endregion
|
|
701
|
+
//#region src/core/migrations/native-type-expander.d.ts
|
|
702
|
+
/**
|
|
703
|
+
* Builds the codec-hook-composed `expandNativeType` callback the contract→IR
|
|
704
|
+
* derivation uses to expand parameterized native types (e.g. `character` +
|
|
705
|
+
* `{ length: 36 }` → `character(36)`). Returns `undefined` when no framework
|
|
706
|
+
* components are supplied, so callers can omit the option entirely.
|
|
707
|
+
*/
|
|
708
|
+
declare function buildNativeTypeExpander(frameworkComponents?: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>): ((input: {
|
|
709
|
+
readonly nativeType: string;
|
|
710
|
+
readonly codecId?: string;
|
|
711
|
+
readonly typeParams?: Record<string, unknown>;
|
|
712
|
+
}) => string) | undefined;
|
|
713
|
+
//#endregion
|
|
699
714
|
//#region src/core/migrations/plan-helpers.d.ts
|
|
700
715
|
declare function createMigrationPlan<TTargetDetails>(options: CreateSqlMigrationPlanOptions<TTargetDetails>): SqlMigrationPlan<TTargetDetails>;
|
|
701
716
|
declare function plannerSuccess<TTargetDetails>(plan: SqlMigrationPlan<TTargetDetails>, warnings?: readonly SqlPlannerConflict[]): SqlPlannerSuccessResult<TTargetDetails>;
|
|
@@ -781,5 +796,5 @@ declare function temporalAuthoringPresets<const CodecId extends string, const Na
|
|
|
781
796
|
//#region src/exports/control.d.ts
|
|
782
797
|
declare const _default: SqlFamilyDescriptor;
|
|
783
798
|
//#endregion
|
|
784
|
-
export { type CodecControlHooks, type ContractToSchemaIROptions, type ControlPolicySubject, type CreateSqlMigrationPlanOptions, type DefaultRenderer, type EnumNamespaceSchemaResolver, type ExpandNativeTypeInput, type FieldEvent, type FieldEventContext, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type NativeTypeExpander, type PlanFieldEventOperationsOptions, type ResolveIdentityValueInput, type SqlControlAdapterDescriptor, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDescribedContractSpace, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type StorageTypePlanResult, type TargetMigrationsCapability, assembleAuthoringContributions, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, _default as default, detectDestructiveChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, resolveValueSetValues, runnerFailure, runnerSuccess, temporalAuthoringPresets, timestampNowControlDescriptor };
|
|
799
|
+
export { type CodecControlHooks, type ContractToSchemaIROptions, type ControlPolicySubject, type CreateSqlMigrationPlanOptions, type DefaultRenderer, type EnumNamespaceSchemaResolver, type ExpandNativeTypeInput, type FieldEvent, type FieldEventContext, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type NativeTypeExpander, type PlanFieldEventOperationsOptions, type ResolveIdentityValueInput, type SqlControlAdapterDescriptor, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDescribedContractSpace, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, type StorageTypePlanResult, type TargetMigrationsCapability, assembleAuthoringContributions, buildNativeTypeExpander, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, _default as default, detectDestructiveChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, resolveValueSetValues, runnerFailure, runnerSuccess, temporalAuthoringPresets, timestampNowControlDescriptor };
|
|
785
800
|
//# sourceMappingURL=control.d.mts.map
|
package/dist/control.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-instance.ts","../src/core/control-descriptor.ts","../src/core/assembly.ts","../src/core/
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-instance.ts","../src/core/control-descriptor.ts","../src/core/assembly.ts","../src/core/control-target-descriptor.ts","../src/core/migrations/contract-to-schema-ir.ts","../src/core/migrations/control-policy.ts","../src/core/migrations/field-event-planner.ts","../src/core/migrations/native-type-expander.ts","../src/core/migrations/plan-helpers.ts","../src/core/migrations/policies.ts","../src/core/timestamp-now-generator.ts","../src/exports/control.ts"],"mappings":";;;;;;;;;;;;;;;UAwLU,eAAA;EAAA,SACC,MAAA;EAAA,SACA,QAAA;EAAA,SACA,QAAA;EAAA,SACA,UAAA;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