@prisma-next/family-sql 0.3.0-dev.12 → 0.3.0-dev.122
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/LICENSE +201 -0
- package/README.md +34 -7
- package/dist/assembly-Dzumaba1.mjs +159 -0
- package/dist/assembly-Dzumaba1.mjs.map +1 -0
- package/dist/control-adapter.d.mts +60 -0
- package/dist/control-adapter.d.mts.map +1 -0
- package/dist/control-adapter.mjs +1 -0
- package/dist/control-instance-BKuHINR7.d.mts +411 -0
- package/dist/control-instance-BKuHINR7.d.mts.map +1 -0
- package/dist/control.d.mts +128 -0
- package/dist/control.d.mts.map +1 -0
- package/dist/control.mjs +683 -0
- package/dist/control.mjs.map +1 -0
- package/dist/runtime.d.mts +27 -0
- package/dist/runtime.d.mts.map +1 -0
- package/dist/runtime.mjs +38 -0
- package/dist/runtime.mjs.map +1 -0
- package/dist/schema-verify.d.mts +48 -0
- package/dist/schema-verify.d.mts.map +1 -0
- package/dist/schema-verify.mjs +4 -0
- package/dist/test-utils.d.mts +2 -0
- package/dist/test-utils.mjs +3 -0
- package/dist/verify-BfMETJcM.mjs +108 -0
- package/dist/verify-BfMETJcM.mjs.map +1 -0
- package/dist/verify-sql-schema-C3Pit9o4.mjs +1085 -0
- package/dist/verify-sql-schema-C3Pit9o4.mjs.map +1 -0
- package/dist/verify-sql-schema-DhHnkpPa.d.mts +67 -0
- package/dist/verify-sql-schema-DhHnkpPa.d.mts.map +1 -0
- package/dist/verify.d.mts +31 -0
- package/dist/verify.d.mts.map +1 -0
- package/dist/verify.mjs +3 -0
- package/package.json +35 -46
- package/src/core/assembly.ts +265 -59
- package/src/core/control-adapter.ts +15 -0
- package/src/core/{descriptor.ts → control-descriptor.ts} +15 -11
- package/src/core/{instance.ts → control-instance.ts} +106 -248
- package/src/core/migrations/contract-to-schema-ir.ts +265 -0
- package/src/core/migrations/types.ts +193 -168
- package/src/core/runtime-descriptor.ts +19 -41
- package/src/core/runtime-instance.ts +11 -133
- package/src/core/schema-verify/verify-helpers.ts +201 -105
- package/src/core/schema-verify/verify-sql-schema.ts +918 -413
- package/src/core/verify.ts +4 -13
- package/src/exports/control.ts +29 -6
- package/src/exports/runtime.ts +2 -6
- package/src/exports/schema-verify.ts +10 -2
- package/src/exports/test-utils.ts +1 -1
- package/dist/chunk-BHEGVBY7.js +0 -772
- package/dist/chunk-BHEGVBY7.js.map +0 -1
- package/dist/chunk-SQ2VWYDV.js +0 -589
- package/dist/chunk-SQ2VWYDV.js.map +0 -1
- package/dist/chunk-SU7LN2UH.js +0 -96
- package/dist/chunk-SU7LN2UH.js.map +0 -1
- package/dist/core/assembly.d.ts +0 -25
- package/dist/core/assembly.d.ts.map +0 -1
- package/dist/core/control-adapter.d.ts +0 -42
- package/dist/core/control-adapter.d.ts.map +0 -1
- package/dist/core/descriptor.d.ts +0 -24
- package/dist/core/descriptor.d.ts.map +0 -1
- package/dist/core/instance.d.ts +0 -140
- package/dist/core/instance.d.ts.map +0 -1
- package/dist/core/migrations/plan-helpers.d.ts +0 -20
- package/dist/core/migrations/plan-helpers.d.ts.map +0 -1
- package/dist/core/migrations/policies.d.ts +0 -6
- package/dist/core/migrations/policies.d.ts.map +0 -1
- package/dist/core/migrations/types.d.ts +0 -280
- package/dist/core/migrations/types.d.ts.map +0 -1
- package/dist/core/runtime-descriptor.d.ts +0 -19
- package/dist/core/runtime-descriptor.d.ts.map +0 -1
- package/dist/core/runtime-instance.d.ts +0 -54
- package/dist/core/runtime-instance.d.ts.map +0 -1
- package/dist/core/schema-verify/verify-helpers.d.ts +0 -50
- package/dist/core/schema-verify/verify-helpers.d.ts.map +0 -1
- package/dist/core/schema-verify/verify-sql-schema.d.ts +0 -45
- package/dist/core/schema-verify/verify-sql-schema.d.ts.map +0 -1
- package/dist/core/verify.d.ts +0 -39
- package/dist/core/verify.d.ts.map +0 -1
- package/dist/exports/control-adapter.d.ts +0 -2
- package/dist/exports/control-adapter.d.ts.map +0 -1
- package/dist/exports/control-adapter.js +0 -1
- package/dist/exports/control-adapter.js.map +0 -1
- package/dist/exports/control.d.ts +0 -13
- package/dist/exports/control.d.ts.map +0 -1
- package/dist/exports/control.js +0 -149
- package/dist/exports/control.js.map +0 -1
- package/dist/exports/runtime.d.ts +0 -8
- package/dist/exports/runtime.d.ts.map +0 -1
- package/dist/exports/runtime.js +0 -64
- package/dist/exports/runtime.js.map +0 -1
- package/dist/exports/schema-verify.d.ts +0 -11
- package/dist/exports/schema-verify.d.ts.map +0 -1
- package/dist/exports/schema-verify.js +0 -11
- package/dist/exports/schema-verify.js.map +0 -1
- package/dist/exports/test-utils.d.ts +0 -7
- package/dist/exports/test-utils.d.ts.map +0 -1
- package/dist/exports/test-utils.js +0 -17
- package/dist/exports/test-utils.js.map +0 -1
- package/dist/exports/verify.d.ts +0 -2
- package/dist/exports/verify.d.ts.map +0 -1
- package/dist/exports/verify.js +0 -11
- package/dist/exports/verify.js.map +0 -1
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import { TargetBoundComponentDescriptor, TypeRenderer } from "@prisma-next/contract/framework-components";
|
|
2
|
+
import { OperationRegistry } from "@prisma-next/operations";
|
|
3
|
+
import { ColumnDefault, ExecutionMutationDefaultValue, TypesImportSpec } from "@prisma-next/contract/types";
|
|
4
|
+
import { Result } from "@prisma-next/utils/result";
|
|
5
|
+
import { ControlAdapterDescriptor, ControlDriverInstance, ControlExtensionDescriptor, ControlFamilyInstance, ControlTargetDescriptor, ControlTargetInstance, EmitContractResult, MigrationOperationPolicy, MigrationPlan, MigrationPlanOperation, MigrationPlannerConflict, MigrationPlannerFailureResult, MigrationPlannerSuccessResult, MigrationRunnerExecutionChecks, MigrationRunnerFailure, MigrationRunnerSuccessValue, OperationContext, SchemaIssue, SignDatabaseResult, VerifyDatabaseResult, VerifyDatabaseSchemaResult } from "@prisma-next/core-control-plane/types";
|
|
6
|
+
import { SqlSchemaIR } from "@prisma-next/sql-schema-ir/types";
|
|
7
|
+
import { SqlContract, SqlStorage, StorageTypeInstance } from "@prisma-next/sql-contract/types";
|
|
8
|
+
import { ContractIR } from "@prisma-next/contract/ir";
|
|
9
|
+
import { CoreSchemaView } from "@prisma-next/core-control-plane/schema-view";
|
|
10
|
+
import { SqlOperationSignature } from "@prisma-next/sql-operations";
|
|
11
|
+
|
|
12
|
+
//#region src/core/migrations/types.d.ts
|
|
13
|
+
type AnyRecord = Readonly<Record<string, unknown>>;
|
|
14
|
+
type ControlMutationDefaultSpan = {
|
|
15
|
+
readonly start: {
|
|
16
|
+
readonly offset: number;
|
|
17
|
+
readonly line: number;
|
|
18
|
+
readonly column: number;
|
|
19
|
+
};
|
|
20
|
+
readonly end: {
|
|
21
|
+
readonly offset: number;
|
|
22
|
+
readonly line: number;
|
|
23
|
+
readonly column: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
type ControlMutationDefaultFunctionCall = {
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly raw: string;
|
|
29
|
+
readonly args: readonly {
|
|
30
|
+
readonly raw: string;
|
|
31
|
+
readonly span: ControlMutationDefaultSpan;
|
|
32
|
+
}[];
|
|
33
|
+
readonly span: ControlMutationDefaultSpan;
|
|
34
|
+
};
|
|
35
|
+
type ControlMutationDefaultLoweringContext = {
|
|
36
|
+
readonly sourceId: string;
|
|
37
|
+
readonly modelName: string;
|
|
38
|
+
readonly fieldName: string;
|
|
39
|
+
readonly columnCodecId?: string;
|
|
40
|
+
};
|
|
41
|
+
type ControlMutationDefaultFunctionResult = {
|
|
42
|
+
readonly ok: true;
|
|
43
|
+
readonly value: {
|
|
44
|
+
readonly kind: 'storage';
|
|
45
|
+
readonly defaultValue: ColumnDefault;
|
|
46
|
+
} | {
|
|
47
|
+
readonly kind: 'execution';
|
|
48
|
+
readonly generated: ExecutionMutationDefaultValue;
|
|
49
|
+
};
|
|
50
|
+
} | {
|
|
51
|
+
readonly ok: false;
|
|
52
|
+
readonly diagnostic: {
|
|
53
|
+
readonly code: string;
|
|
54
|
+
readonly message: string;
|
|
55
|
+
readonly sourceId?: string;
|
|
56
|
+
readonly span?: ControlMutationDefaultSpan;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
type ControlMutationDefaultFunctionHandler = (input: {
|
|
60
|
+
readonly call: ControlMutationDefaultFunctionCall;
|
|
61
|
+
readonly context: ControlMutationDefaultLoweringContext;
|
|
62
|
+
}) => ControlMutationDefaultFunctionResult;
|
|
63
|
+
interface ControlMutationDefaultFunctionEntry {
|
|
64
|
+
readonly lower: ControlMutationDefaultFunctionHandler;
|
|
65
|
+
readonly usageSignatures?: readonly string[];
|
|
66
|
+
}
|
|
67
|
+
interface ControlMutationDefaultGeneratorDescriptor {
|
|
68
|
+
readonly id: string;
|
|
69
|
+
readonly applicableCodecIds: readonly string[];
|
|
70
|
+
readonly resolveGeneratedColumnDescriptor?: (input: {
|
|
71
|
+
readonly generated: {
|
|
72
|
+
readonly kind: string;
|
|
73
|
+
readonly id: string;
|
|
74
|
+
readonly params?: Record<string, unknown>;
|
|
75
|
+
};
|
|
76
|
+
}) => {
|
|
77
|
+
readonly codecId: string;
|
|
78
|
+
readonly nativeType: string;
|
|
79
|
+
readonly typeRef?: string;
|
|
80
|
+
readonly typeParams?: Record<string, unknown>;
|
|
81
|
+
} | undefined;
|
|
82
|
+
}
|
|
83
|
+
interface PslScalarTypeDescriptor {
|
|
84
|
+
readonly codecId: string;
|
|
85
|
+
readonly nativeType: string;
|
|
86
|
+
readonly typeRef?: string;
|
|
87
|
+
readonly typeParams?: Record<string, unknown>;
|
|
88
|
+
}
|
|
89
|
+
interface SqlControlStaticContributions {
|
|
90
|
+
readonly operationSignatures: () => ReadonlyArray<SqlOperationSignature>;
|
|
91
|
+
readonly controlMutationDefaults?: () => {
|
|
92
|
+
readonly defaultFunctionRegistry: ReadonlyMap<string, ControlMutationDefaultFunctionEntry>;
|
|
93
|
+
readonly generatorDescriptors: ReadonlyArray<ControlMutationDefaultGeneratorDescriptor>;
|
|
94
|
+
};
|
|
95
|
+
readonly pslTypeDescriptors?: () => {
|
|
96
|
+
readonly scalarTypeDescriptors: ReadonlyMap<string, PslScalarTypeDescriptor>;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
interface ComponentDatabaseDependency<TTargetDetails> {
|
|
100
|
+
readonly id: string;
|
|
101
|
+
readonly label: string;
|
|
102
|
+
readonly install: readonly SqlMigrationPlanOperation<TTargetDetails>[];
|
|
103
|
+
}
|
|
104
|
+
interface ComponentDatabaseDependencies<TTargetDetails> {
|
|
105
|
+
readonly init?: readonly ComponentDatabaseDependency<TTargetDetails>[];
|
|
106
|
+
}
|
|
107
|
+
interface DatabaseDependencyProvider {
|
|
108
|
+
readonly databaseDependencies?: ComponentDatabaseDependencies<unknown>;
|
|
109
|
+
}
|
|
110
|
+
declare function isDatabaseDependencyProvider(value: unknown): value is DatabaseDependencyProvider;
|
|
111
|
+
declare function collectInitDependencies(components: ReadonlyArray<unknown>): readonly ComponentDatabaseDependency<unknown>[];
|
|
112
|
+
interface StorageTypePlanResult<TTargetDetails> {
|
|
113
|
+
readonly operations: readonly SqlMigrationPlanOperation<TTargetDetails>[];
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Input for expanding parameterized native types.
|
|
117
|
+
*/
|
|
118
|
+
interface ExpandNativeTypeInput {
|
|
119
|
+
readonly nativeType: string;
|
|
120
|
+
readonly codecId?: string;
|
|
121
|
+
readonly typeParams?: Record<string, unknown>;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Input for resolving an identity-value SQL literal used to backfill existing rows when
|
|
125
|
+
* adding a NOT NULL column without an explicit default.
|
|
126
|
+
*
|
|
127
|
+
* "Identity value" in the algebraic (monoid) sense: the neutral element for the type
|
|
128
|
+
* (0 for numbers, '' for strings, false for booleans, etc.).
|
|
129
|
+
*/
|
|
130
|
+
interface ResolveIdentityValueInput {
|
|
131
|
+
readonly nativeType: string;
|
|
132
|
+
readonly codecId?: string;
|
|
133
|
+
readonly typeParams?: Record<string, unknown>;
|
|
134
|
+
}
|
|
135
|
+
interface CodecControlHooks<TTargetDetails = unknown> {
|
|
136
|
+
planTypeOperations?: (options: {
|
|
137
|
+
readonly typeName: string;
|
|
138
|
+
readonly typeInstance: StorageTypeInstance;
|
|
139
|
+
readonly contract: SqlContract<SqlStorage>;
|
|
140
|
+
readonly schema: SqlSchemaIR;
|
|
141
|
+
readonly schemaName?: string;
|
|
142
|
+
readonly policy: MigrationOperationPolicy;
|
|
143
|
+
}) => StorageTypePlanResult<TTargetDetails>;
|
|
144
|
+
verifyType?: (options: {
|
|
145
|
+
readonly typeName: string;
|
|
146
|
+
readonly typeInstance: StorageTypeInstance;
|
|
147
|
+
readonly schema: SqlSchemaIR;
|
|
148
|
+
readonly schemaName?: string;
|
|
149
|
+
}) => readonly SchemaIssue[];
|
|
150
|
+
introspectTypes?: (options: {
|
|
151
|
+
readonly driver: ControlDriverInstance<'sql', string>;
|
|
152
|
+
readonly schemaName?: string;
|
|
153
|
+
}) => Promise<Record<string, StorageTypeInstance>>;
|
|
154
|
+
/**
|
|
155
|
+
* Expands a parameterized native type to its full SQL representation.
|
|
156
|
+
* Used by schema verification to compare contract types against database types.
|
|
157
|
+
*
|
|
158
|
+
* For example, expands:
|
|
159
|
+
* - { nativeType: 'character varying', typeParams: { length: 255 } } -> 'character varying(255)'
|
|
160
|
+
* - { nativeType: 'numeric', typeParams: { precision: 10, scale: 2 } } -> 'numeric(10,2)'
|
|
161
|
+
*
|
|
162
|
+
* Returns the expanded type string, or the original nativeType if no expansion is needed.
|
|
163
|
+
*/
|
|
164
|
+
expandNativeType?: (input: ExpandNativeTypeInput) => string;
|
|
165
|
+
/**
|
|
166
|
+
* Resolves the identity value (monoid neutral element) as a SQL literal for safely adding
|
|
167
|
+
* a NOT NULL column without an explicit default to a non-empty table.
|
|
168
|
+
*
|
|
169
|
+
* Return semantics:
|
|
170
|
+
* - string: use this literal
|
|
171
|
+
* - null: explicitly no safe identity value is known; fall back to another strategy
|
|
172
|
+
* - undefined: no opinion; planner may use built-in fallbacks
|
|
173
|
+
*/
|
|
174
|
+
resolveIdentityValue?: (input: ResolveIdentityValueInput) => string | null | undefined;
|
|
175
|
+
}
|
|
176
|
+
interface SqlControlExtensionDescriptor<TTargetId extends string> extends ControlExtensionDescriptor<'sql', TTargetId>, SqlControlStaticContributions {
|
|
177
|
+
readonly databaseDependencies?: ComponentDatabaseDependencies<unknown>;
|
|
178
|
+
}
|
|
179
|
+
interface SqlControlAdapterDescriptor<TTargetId extends string> extends ControlAdapterDescriptor<'sql', TTargetId>, SqlControlStaticContributions {}
|
|
180
|
+
interface SqlMigrationPlanOperationStep {
|
|
181
|
+
readonly description: string;
|
|
182
|
+
readonly sql: string;
|
|
183
|
+
readonly meta?: AnyRecord;
|
|
184
|
+
}
|
|
185
|
+
interface SqlMigrationPlanOperationTarget<TTargetDetails> {
|
|
186
|
+
readonly id: string;
|
|
187
|
+
readonly details?: TTargetDetails;
|
|
188
|
+
}
|
|
189
|
+
interface SqlMigrationPlanOperation<TTargetDetails> extends MigrationPlanOperation {
|
|
190
|
+
readonly summary?: string;
|
|
191
|
+
readonly target: SqlMigrationPlanOperationTarget<TTargetDetails>;
|
|
192
|
+
readonly precheck: readonly SqlMigrationPlanOperationStep[];
|
|
193
|
+
readonly execute: readonly SqlMigrationPlanOperationStep[];
|
|
194
|
+
readonly postcheck: readonly SqlMigrationPlanOperationStep[];
|
|
195
|
+
readonly meta?: AnyRecord;
|
|
196
|
+
}
|
|
197
|
+
interface SqlMigrationPlanContractInfo {
|
|
198
|
+
readonly storageHash: string;
|
|
199
|
+
readonly profileHash?: string;
|
|
200
|
+
}
|
|
201
|
+
interface SqlMigrationPlan<TTargetDetails> extends MigrationPlan {
|
|
202
|
+
/**
|
|
203
|
+
* Origin contract identity that the plan expects the database to currently be at.
|
|
204
|
+
* If omitted or null, the runner skips origin validation entirely.
|
|
205
|
+
*/
|
|
206
|
+
readonly origin?: SqlMigrationPlanContractInfo | null;
|
|
207
|
+
/**
|
|
208
|
+
* Destination contract identity that the plan intends to reach.
|
|
209
|
+
*/
|
|
210
|
+
readonly destination: SqlMigrationPlanContractInfo;
|
|
211
|
+
readonly operations: readonly SqlMigrationPlanOperation<TTargetDetails>[];
|
|
212
|
+
readonly meta?: AnyRecord;
|
|
213
|
+
}
|
|
214
|
+
type SqlPlannerConflictKind = 'typeMismatch' | 'nullabilityConflict' | 'indexIncompatible' | 'foreignKeyConflict' | 'missingButNonAdditive' | 'unsupportedOperation';
|
|
215
|
+
interface SqlPlannerConflictLocation {
|
|
216
|
+
readonly table?: string;
|
|
217
|
+
readonly column?: string;
|
|
218
|
+
readonly index?: string;
|
|
219
|
+
readonly constraint?: string;
|
|
220
|
+
readonly type?: string;
|
|
221
|
+
}
|
|
222
|
+
interface SqlPlannerConflict extends MigrationPlannerConflict {
|
|
223
|
+
readonly kind: SqlPlannerConflictKind;
|
|
224
|
+
readonly location?: SqlPlannerConflictLocation;
|
|
225
|
+
readonly meta?: AnyRecord;
|
|
226
|
+
}
|
|
227
|
+
interface SqlPlannerSuccessResult<TTargetDetails> extends Omit<MigrationPlannerSuccessResult, 'plan'> {
|
|
228
|
+
readonly kind: 'success';
|
|
229
|
+
readonly plan: SqlMigrationPlan<TTargetDetails>;
|
|
230
|
+
}
|
|
231
|
+
interface SqlPlannerFailureResult extends Omit<MigrationPlannerFailureResult, 'conflicts'> {
|
|
232
|
+
readonly kind: 'failure';
|
|
233
|
+
readonly conflicts: readonly SqlPlannerConflict[];
|
|
234
|
+
}
|
|
235
|
+
type SqlPlannerResult<TTargetDetails> = SqlPlannerSuccessResult<TTargetDetails> | SqlPlannerFailureResult;
|
|
236
|
+
interface SqlMigrationPlannerPlanOptions {
|
|
237
|
+
readonly contract: SqlContract<SqlStorage>;
|
|
238
|
+
readonly schema: SqlSchemaIR;
|
|
239
|
+
readonly policy: MigrationOperationPolicy;
|
|
240
|
+
readonly schemaName?: string;
|
|
241
|
+
/**
|
|
242
|
+
* Active framework components participating in this composition.
|
|
243
|
+
* SQL targets can interpret this list to derive database dependencies.
|
|
244
|
+
* All components must have matching familyId ('sql') and targetId.
|
|
245
|
+
*/
|
|
246
|
+
readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
|
|
247
|
+
}
|
|
248
|
+
interface SqlMigrationPlanner<TTargetDetails> {
|
|
249
|
+
plan(options: SqlMigrationPlannerPlanOptions): SqlPlannerResult<TTargetDetails>;
|
|
250
|
+
}
|
|
251
|
+
interface SqlMigrationRunnerExecuteCallbacks<TTargetDetails> {
|
|
252
|
+
onOperationStart?(operation: SqlMigrationPlanOperation<TTargetDetails>): void;
|
|
253
|
+
onOperationComplete?(operation: SqlMigrationPlanOperation<TTargetDetails>): void;
|
|
254
|
+
}
|
|
255
|
+
interface SqlMigrationRunnerExecuteOptions<TTargetDetails> {
|
|
256
|
+
readonly plan: SqlMigrationPlan<TTargetDetails>;
|
|
257
|
+
readonly driver: ControlDriverInstance<'sql', string>;
|
|
258
|
+
/**
|
|
259
|
+
* Destination contract IR.
|
|
260
|
+
* Must correspond to `plan.destination` and is used for schema verification and marker/ledger writes.
|
|
261
|
+
*/
|
|
262
|
+
readonly destinationContract: SqlContract<SqlStorage>;
|
|
263
|
+
/**
|
|
264
|
+
* Execution-time policy that defines which operation classes are allowed.
|
|
265
|
+
* The runner validates each operation against this policy before execution.
|
|
266
|
+
*/
|
|
267
|
+
readonly policy: MigrationOperationPolicy;
|
|
268
|
+
readonly schemaName?: string;
|
|
269
|
+
readonly strictVerification?: boolean;
|
|
270
|
+
readonly callbacks?: SqlMigrationRunnerExecuteCallbacks<TTargetDetails>;
|
|
271
|
+
readonly context?: OperationContext;
|
|
272
|
+
/**
|
|
273
|
+
* Execution-time checks configuration.
|
|
274
|
+
* All checks default to `true` (enabled) when omitted.
|
|
275
|
+
*/
|
|
276
|
+
readonly executionChecks?: MigrationRunnerExecutionChecks;
|
|
277
|
+
/**
|
|
278
|
+
* Active framework components participating in this composition.
|
|
279
|
+
* SQL targets can interpret this list to derive database dependencies.
|
|
280
|
+
* All components must have matching familyId ('sql') and targetId.
|
|
281
|
+
*/
|
|
282
|
+
readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
|
|
283
|
+
}
|
|
284
|
+
type SqlMigrationRunnerErrorCode = 'DESTINATION_CONTRACT_MISMATCH' | 'MARKER_ORIGIN_MISMATCH' | 'POLICY_VIOLATION' | 'PRECHECK_FAILED' | 'POSTCHECK_FAILED' | 'SCHEMA_VERIFY_FAILED' | 'EXECUTION_FAILED';
|
|
285
|
+
interface SqlMigrationRunnerFailure extends MigrationRunnerFailure {
|
|
286
|
+
readonly code: SqlMigrationRunnerErrorCode;
|
|
287
|
+
readonly meta?: AnyRecord;
|
|
288
|
+
}
|
|
289
|
+
interface SqlMigrationRunnerSuccessValue extends MigrationRunnerSuccessValue {}
|
|
290
|
+
type SqlMigrationRunnerResult = Result<SqlMigrationRunnerSuccessValue, SqlMigrationRunnerFailure>;
|
|
291
|
+
interface SqlMigrationRunner<TTargetDetails> {
|
|
292
|
+
execute(options: SqlMigrationRunnerExecuteOptions<TTargetDetails>): Promise<SqlMigrationRunnerResult>;
|
|
293
|
+
}
|
|
294
|
+
interface SqlControlTargetDescriptor<TTargetId extends string, TTargetDetails> extends ControlTargetDescriptor<'sql', TTargetId, ControlTargetInstance<'sql', TTargetId>, SqlControlFamilyInstance>, SqlControlStaticContributions {
|
|
295
|
+
createPlanner(family: SqlControlFamilyInstance): SqlMigrationPlanner<TTargetDetails>;
|
|
296
|
+
createRunner(family: SqlControlFamilyInstance): SqlMigrationRunner<TTargetDetails>;
|
|
297
|
+
}
|
|
298
|
+
interface CreateSqlMigrationPlanOptions<TTargetDetails> {
|
|
299
|
+
readonly targetId: string;
|
|
300
|
+
readonly origin?: SqlMigrationPlanContractInfo | null;
|
|
301
|
+
readonly destination: SqlMigrationPlanContractInfo;
|
|
302
|
+
readonly operations: readonly SqlMigrationPlanOperation<TTargetDetails>[];
|
|
303
|
+
readonly meta?: AnyRecord;
|
|
304
|
+
}
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region src/core/assembly.d.ts
|
|
307
|
+
interface SqlControlDescriptorWithContributions extends SqlControlStaticContributions {
|
|
308
|
+
readonly id: string;
|
|
309
|
+
readonly types?: {
|
|
310
|
+
readonly codecTypes?: {
|
|
311
|
+
readonly import?: TypesImportSpec;
|
|
312
|
+
readonly parameterized?: Record<string, TypeRenderer>;
|
|
313
|
+
readonly typeImports?: ReadonlyArray<TypesImportSpec>;
|
|
314
|
+
};
|
|
315
|
+
readonly operationTypes?: {
|
|
316
|
+
readonly import: TypesImportSpec;
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
interface AssembledControlMutationDefaultContributions {
|
|
321
|
+
readonly defaultFunctionRegistry: ReadonlyMap<string, ControlMutationDefaultFunctionEntry>;
|
|
322
|
+
readonly generatorDescriptors: readonly ControlMutationDefaultGeneratorDescriptor[];
|
|
323
|
+
}
|
|
324
|
+
interface AssembledPslInterpretationContributions extends AssembledControlMutationDefaultContributions {
|
|
325
|
+
readonly scalarTypeDescriptors: ReadonlyMap<string, PslScalarTypeDescriptor>;
|
|
326
|
+
}
|
|
327
|
+
declare function assembleOperationRegistry(descriptors: ReadonlyArray<SqlControlDescriptorWithContributions>): OperationRegistry;
|
|
328
|
+
interface DescriptorWithTypes {
|
|
329
|
+
readonly id: string;
|
|
330
|
+
readonly types?: {
|
|
331
|
+
readonly codecTypes?: {
|
|
332
|
+
readonly import?: TypesImportSpec;
|
|
333
|
+
readonly parameterized?: Record<string, TypeRenderer>;
|
|
334
|
+
readonly typeImports?: ReadonlyArray<TypesImportSpec>;
|
|
335
|
+
};
|
|
336
|
+
readonly operationTypes?: {
|
|
337
|
+
readonly import: TypesImportSpec;
|
|
338
|
+
};
|
|
339
|
+
readonly queryOperationTypes?: {
|
|
340
|
+
readonly import: TypesImportSpec;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
declare function extractCodecTypeImports(descriptors: ReadonlyArray<DescriptorWithTypes>): ReadonlyArray<TypesImportSpec>;
|
|
345
|
+
declare function extractOperationTypeImports(descriptors: ReadonlyArray<DescriptorWithTypes>): ReadonlyArray<TypesImportSpec>;
|
|
346
|
+
declare function extractQueryOperationTypeImports(descriptors: ReadonlyArray<DescriptorWithTypes>): ReadonlyArray<TypesImportSpec>;
|
|
347
|
+
declare function extractExtensionIds(adapter: {
|
|
348
|
+
readonly id: string;
|
|
349
|
+
}, target: {
|
|
350
|
+
readonly id: string;
|
|
351
|
+
}, extensions: ReadonlyArray<{
|
|
352
|
+
readonly id: string;
|
|
353
|
+
}>): ReadonlyArray<string>;
|
|
354
|
+
declare function extractCodecControlHooks(descriptors: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>): Map<string, CodecControlHooks>;
|
|
355
|
+
declare function assembleControlMutationDefaultContributions(descriptors: ReadonlyArray<SqlControlDescriptorWithContributions>): AssembledControlMutationDefaultContributions;
|
|
356
|
+
declare function assemblePslInterpretationContributions(descriptors: ReadonlyArray<SqlControlDescriptorWithContributions>): AssembledPslInterpretationContributions;
|
|
357
|
+
//#endregion
|
|
358
|
+
//#region src/core/control-instance.d.ts
|
|
359
|
+
interface SqlTypeMetadata {
|
|
360
|
+
readonly typeId: string;
|
|
361
|
+
readonly familyId: 'sql';
|
|
362
|
+
readonly targetId: string;
|
|
363
|
+
readonly nativeType?: string;
|
|
364
|
+
}
|
|
365
|
+
type SqlTypeMetadataRegistry = Map<string, SqlTypeMetadata>;
|
|
366
|
+
interface SqlFamilyInstanceState {
|
|
367
|
+
readonly operationRegistry: OperationRegistry;
|
|
368
|
+
readonly codecTypeImports: ReadonlyArray<TypesImportSpec>;
|
|
369
|
+
readonly operationTypeImports: ReadonlyArray<TypesImportSpec>;
|
|
370
|
+
readonly extensionIds: ReadonlyArray<string>;
|
|
371
|
+
readonly typeMetadataRegistry: SqlTypeMetadataRegistry;
|
|
372
|
+
}
|
|
373
|
+
interface SchemaVerifyOptions {
|
|
374
|
+
readonly driver: ControlDriverInstance<'sql', string>;
|
|
375
|
+
readonly contractIR: unknown;
|
|
376
|
+
readonly strict: boolean;
|
|
377
|
+
readonly context?: OperationContext;
|
|
378
|
+
/**
|
|
379
|
+
* Active framework components participating in this composition.
|
|
380
|
+
* All components must have matching familyId ('sql') and targetId.
|
|
381
|
+
*/
|
|
382
|
+
readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
|
|
383
|
+
}
|
|
384
|
+
interface SqlControlFamilyInstance extends ControlFamilyInstance<'sql'>, SqlFamilyInstanceState {
|
|
385
|
+
validateContractIR(contractJson: unknown): ContractIR;
|
|
386
|
+
verify(options: {
|
|
387
|
+
readonly driver: ControlDriverInstance<'sql', string>;
|
|
388
|
+
readonly contractIR: unknown;
|
|
389
|
+
readonly expectedTargetId: string;
|
|
390
|
+
readonly contractPath: string;
|
|
391
|
+
readonly configPath?: string;
|
|
392
|
+
}): Promise<VerifyDatabaseResult>;
|
|
393
|
+
schemaVerify(options: SchemaVerifyOptions): Promise<VerifyDatabaseSchemaResult>;
|
|
394
|
+
sign(options: {
|
|
395
|
+
readonly driver: ControlDriverInstance<'sql', string>;
|
|
396
|
+
readonly contractIR: unknown;
|
|
397
|
+
readonly contractPath: string;
|
|
398
|
+
readonly configPath?: string;
|
|
399
|
+
}): Promise<SignDatabaseResult>;
|
|
400
|
+
introspect(options: {
|
|
401
|
+
readonly driver: ControlDriverInstance<'sql', string>;
|
|
402
|
+
readonly contractIR?: unknown;
|
|
403
|
+
}): Promise<SqlSchemaIR>;
|
|
404
|
+
toSchemaView(schema: SqlSchemaIR): CoreSchemaView;
|
|
405
|
+
emitContract(options: {
|
|
406
|
+
readonly contractIR: ContractIR | unknown;
|
|
407
|
+
}): Promise<EmitContractResult>;
|
|
408
|
+
}
|
|
409
|
+
//#endregion
|
|
410
|
+
export { SqlMigrationPlanOperationStep as A, SqlMigrationRunnerSuccessValue as B, SqlControlAdapterDescriptor as C, SqlMigrationPlan as D, SqlControlTargetDescriptor as E, SqlMigrationRunnerErrorCode as F, SqlPlannerResult as G, SqlPlannerConflictKind as H, SqlMigrationRunnerExecuteCallbacks as I, collectInitDependencies as J, SqlPlannerSuccessResult as K, SqlMigrationRunnerExecuteOptions as L, SqlMigrationPlanner as M, SqlMigrationPlannerPlanOptions as N, SqlMigrationPlanContractInfo as O, SqlMigrationRunner as P, SqlMigrationRunnerFailure as R, ResolveIdentityValueInput as S, SqlControlStaticContributions as T, SqlPlannerConflictLocation as U, SqlPlannerConflict as V, SqlPlannerFailureResult as W, isDatabaseDependencyProvider as Y, ControlMutationDefaultFunctionHandler as _, assembleOperationRegistry as a, ExpandNativeTypeInput as b, extractCodecTypeImports as c, extractQueryOperationTypeImports as d, AnyRecord as f, ControlMutationDefaultFunctionEntry as g, ComponentDatabaseDependency as h, assembleControlMutationDefaultContributions as i, SqlMigrationPlanOperationTarget as j, SqlMigrationPlanOperation as k, extractExtensionIds as l, ComponentDatabaseDependencies as m, SqlControlFamilyInstance as n, assemblePslInterpretationContributions as o, CodecControlHooks as p, StorageTypePlanResult as q, SqlControlDescriptorWithContributions as r, extractCodecControlHooks as s, SchemaVerifyOptions as t, extractOperationTypeImports as u, ControlMutationDefaultGeneratorDescriptor as v, SqlControlExtensionDescriptor as w, PslScalarTypeDescriptor as x, CreateSqlMigrationPlanOptions as y, SqlMigrationRunnerResult as z };
|
|
411
|
+
//# sourceMappingURL=control-instance-BKuHINR7.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-instance-BKuHINR7.d.mts","names":[],"sources":["../src/core/migrations/types.ts","../src/core/assembly.ts","../src/core/control-instance.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;KA0BY,SAAA,GAAY,SAAS;KAE5B,0BAAA;;;IAFO,SAAS,IAAA,EAAA,MAAY;IAE5B,SAAA,MAAA,EAAA,MAAA;EAaA,CAAA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G,CAAM,KAAA,EAAA,MAAA,CAAA;IAUb,SAAA,UAAA,EAAA,OAAyB;IAMzB,SAAA,YAAiB,EAAA,MAAA;IAGP,SAAA,UAAA,CAAA,EAAA,MAAA;EACQ,CAAA,CAAA,EEwB7B,OFxB6B,CEwBrB,kBFxBqB,CAAA;EAAZ,UAAA,CAAA,OAAA,EAAA;IACF,SAAA,MAAA,EE0BA,qBF1BA,CAAA,KAAA,EAAA,MAAA,CAAA;IAEA,SAAA,UAAA,CAAA,EAAA,OAAA;EACS,CAAA,CAAA,EEyBxB,OFzBwB,CEyBhB,WFzBgB,CAAA;EAAtB,YAAA,CAAA,MAAA,EE2Be,WF3Bf,CAAA,EE2B6B,cF3B7B;EAGmB,YAAA,CAAA,OAAA,EAAA;IACN,SAAA,UAAA,EEyB0B,UFzB1B,GAAA,OAAA;EAEJ,CAAA,CAAA,EEuBuD,OFvBvD,CEuB+D,kBFvB/D,CAAA"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { A as SqlMigrationPlanOperationStep, B as SqlMigrationRunnerSuccessValue, C as SqlControlAdapterDescriptor, D as SqlMigrationPlan, E as SqlControlTargetDescriptor, F as SqlMigrationRunnerErrorCode, G as SqlPlannerResult, H as SqlPlannerConflictKind, I as SqlMigrationRunnerExecuteCallbacks, J as collectInitDependencies, K as SqlPlannerSuccessResult, L as SqlMigrationRunnerExecuteOptions, M as SqlMigrationPlanner, N as SqlMigrationPlannerPlanOptions, O as SqlMigrationPlanContractInfo, P as SqlMigrationRunner, R as SqlMigrationRunnerFailure, S as ResolveIdentityValueInput, T as SqlControlStaticContributions, U as SqlPlannerConflictLocation, V as SqlPlannerConflict, W as SqlPlannerFailureResult, Y as isDatabaseDependencyProvider, _ as ControlMutationDefaultFunctionHandler, b as ExpandNativeTypeInput, f as AnyRecord, g as ControlMutationDefaultFunctionEntry, h as ComponentDatabaseDependency, i as assembleControlMutationDefaultContributions, j as SqlMigrationPlanOperationTarget, k as SqlMigrationPlanOperation, m as ComponentDatabaseDependencies, n as SqlControlFamilyInstance, o as assemblePslInterpretationContributions, p as CodecControlHooks, q as StorageTypePlanResult, r as SqlControlDescriptorWithContributions, s as extractCodecControlHooks, t as SchemaVerifyOptions, v as ControlMutationDefaultGeneratorDescriptor, w as SqlControlExtensionDescriptor, x as PslScalarTypeDescriptor, y as CreateSqlMigrationPlanOptions, z as SqlMigrationRunnerResult } from "./control-instance-BKuHINR7.mjs";
|
|
2
|
+
import { TargetBoundComponentDescriptor } from "@prisma-next/contract/framework-components";
|
|
3
|
+
import * as _prisma_next_contract_types0 from "@prisma-next/contract/types";
|
|
4
|
+
import { ColumnDefault } from "@prisma-next/contract/types";
|
|
5
|
+
import { NotOk, Ok } from "@prisma-next/utils/result";
|
|
6
|
+
import { ControlFamilyDescriptor, ControlPlaneStack, MigrationOperationClass, MigrationOperationPolicy, MigrationOperationPolicy as MigrationOperationPolicy$1, MigrationPlan, MigrationPlanOperation, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerConflict as MigrationPlannerConflict$1, MigrationPlannerResult, TargetMigrationsCapability } from "@prisma-next/core-control-plane/types";
|
|
7
|
+
import { SqlSchemaIR } from "@prisma-next/sql-schema-ir/types";
|
|
8
|
+
import * as _prisma_next_sql_contract_types0 from "@prisma-next/sql-contract/types";
|
|
9
|
+
import { SqlContract, SqlStorage, StorageColumn } from "@prisma-next/sql-contract/types";
|
|
10
|
+
import * as _prisma_next_contract_ir0 from "@prisma-next/contract/ir";
|
|
11
|
+
|
|
12
|
+
//#region src/core/control-descriptor.d.ts
|
|
13
|
+
declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlControlFamilyInstance> {
|
|
14
|
+
readonly kind: "family";
|
|
15
|
+
readonly id = "sql";
|
|
16
|
+
readonly familyId: "sql";
|
|
17
|
+
readonly version = "0.0.1";
|
|
18
|
+
readonly hook: {
|
|
19
|
+
readonly id: "sql";
|
|
20
|
+
readonly validateTypes: (ir: _prisma_next_contract_ir0.ContractIR, _ctx: _prisma_next_contract_types0.ValidationContext) => void;
|
|
21
|
+
readonly validateStructure: (ir: _prisma_next_contract_ir0.ContractIR) => void;
|
|
22
|
+
readonly generateContractTypes: (ir: _prisma_next_contract_ir0.ContractIR, codecTypeImports: ReadonlyArray<_prisma_next_contract_types0.TypesImportSpec>, operationTypeImports: ReadonlyArray<_prisma_next_contract_types0.TypesImportSpec>, hashes: {
|
|
23
|
+
readonly storageHash: string;
|
|
24
|
+
readonly executionHash?: string;
|
|
25
|
+
readonly profileHash: string;
|
|
26
|
+
}, options?: _prisma_next_contract_types0.GenerateContractTypesOptions) => string;
|
|
27
|
+
readonly generateStorageType: (storage: _prisma_next_sql_contract_types0.SqlStorage) => string;
|
|
28
|
+
readonly generateStorageTypesType: (types: _prisma_next_sql_contract_types0.SqlStorage["types"]) => string;
|
|
29
|
+
readonly serializeTypeParamsLiteral: (params: Record<string, unknown>) => string;
|
|
30
|
+
readonly serializeValue: (value: unknown) => string;
|
|
31
|
+
readonly serializeObjectKey: (key: string) => string;
|
|
32
|
+
readonly generateModelsType: (models: Record<string, _prisma_next_sql_contract_types0.ModelDefinition> | undefined, storage: _prisma_next_sql_contract_types0.SqlStorage, parameterizedRenderers?: Map<string, _prisma_next_contract_types0.TypeRenderEntry>) => string;
|
|
33
|
+
readonly generateColumnType: (column: _prisma_next_sql_contract_types0.StorageColumn, storage: _prisma_next_sql_contract_types0.SqlStorage, parameterizedRenderers: Map<string, _prisma_next_contract_types0.TypeRenderEntry> | undefined, renderCtx: _prisma_next_contract_types0.TypeRenderContext) => string;
|
|
34
|
+
readonly generateRelationsType: (relations: Record<string, unknown> | undefined) => string;
|
|
35
|
+
readonly generateMappingsType: (models: Record<string, _prisma_next_sql_contract_types0.ModelDefinition> | undefined, storage: _prisma_next_sql_contract_types0.SqlStorage) => string;
|
|
36
|
+
};
|
|
37
|
+
create<TTargetId extends string>(stack: ControlPlaneStack<'sql', TTargetId>): SqlControlFamilyInstance;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/core/migrations/contract-to-schema-ir.d.ts
|
|
41
|
+
/**
|
|
42
|
+
* Target-specific callback that expands a column's base `nativeType` and optional
|
|
43
|
+
* `typeParams` into the fully-qualified type string used by the database
|
|
44
|
+
* (e.g. `character` + `{ length: 36 }` → `character(36)`).
|
|
45
|
+
*
|
|
46
|
+
* This lives in the family layer as a callback rather than importing a concrete
|
|
47
|
+
* implementation because each target (Postgres, MySQL, SQLite, …) has its own
|
|
48
|
+
* parameterization syntax. The target wires its expander when calling
|
|
49
|
+
* `contractToSchemaIR`, keeping the family layer target-agnostic.
|
|
50
|
+
*/
|
|
51
|
+
type NativeTypeExpander = (input: {
|
|
52
|
+
readonly nativeType: string;
|
|
53
|
+
readonly codecId?: string;
|
|
54
|
+
readonly typeParams?: Record<string, unknown>;
|
|
55
|
+
}) => string;
|
|
56
|
+
/**
|
|
57
|
+
* Target-specific callback that renders a `ColumnDefault` into the raw SQL literal
|
|
58
|
+
* string stored in `SqlColumnIR.default`.
|
|
59
|
+
*
|
|
60
|
+
* Default value serialization is target-specific (quoting, casting, type syntax vary
|
|
61
|
+
* between Postgres, MySQL, SQLite, …). This callback follows the same IoC pattern as
|
|
62
|
+
* `NativeTypeExpander`: the target provides its renderer when calling
|
|
63
|
+
* `contractToSchemaIR`, keeping the family layer target-agnostic.
|
|
64
|
+
*/
|
|
65
|
+
type DefaultRenderer = (def: ColumnDefault, column: StorageColumn) => string;
|
|
66
|
+
/**
|
|
67
|
+
* Detects destructive changes between two contract storages.
|
|
68
|
+
*
|
|
69
|
+
* The additive-only planner silently ignores removals (tables, columns).
|
|
70
|
+
* This function detects those removals so callers can report them as conflicts
|
|
71
|
+
* rather than silently producing an empty plan.
|
|
72
|
+
*
|
|
73
|
+
* Returns an empty array if no destructive changes are found.
|
|
74
|
+
*/
|
|
75
|
+
declare function detectDestructiveChanges(from: SqlStorage | null, to: SqlStorage): readonly MigrationPlannerConflict$1[];
|
|
76
|
+
interface ContractToSchemaIROptions {
|
|
77
|
+
readonly annotationNamespace: string;
|
|
78
|
+
readonly expandNativeType?: NativeTypeExpander;
|
|
79
|
+
readonly renderDefault?: DefaultRenderer;
|
|
80
|
+
readonly frameworkComponents?: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Converts an `SqlContract` to `SqlSchemaIR`.
|
|
84
|
+
*
|
|
85
|
+
* Reads `contract.storage` for tables, `contract.storage.types` for type
|
|
86
|
+
* annotations, and derives database dependencies from `frameworkComponents`
|
|
87
|
+
* (each component's `databaseDependencies.init[].id`).
|
|
88
|
+
* Storage-type annotations are written under `options.annotationNamespace`.
|
|
89
|
+
*
|
|
90
|
+
* Drops codec metadata (`codecId`, `typeRef`) since the schema IR only represents
|
|
91
|
+
* structural information. When `expandNativeType` is provided, parameterized types
|
|
92
|
+
* are expanded (e.g. `character` + `{ length: 36 }` → `character(36)`) so the
|
|
93
|
+
* resulting IR compares correctly against the "to" contract during planning.
|
|
94
|
+
*
|
|
95
|
+
* Returns an empty schema IR when `contract` is `null` (new project).
|
|
96
|
+
*/
|
|
97
|
+
declare function contractToSchemaIR(contract: SqlContract<SqlStorage> | null, options: ContractToSchemaIROptions): SqlSchemaIR;
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/core/migrations/plan-helpers.d.ts
|
|
100
|
+
declare function createMigrationPlan<TTargetDetails>(options: CreateSqlMigrationPlanOptions<TTargetDetails>): SqlMigrationPlan<TTargetDetails>;
|
|
101
|
+
declare function plannerSuccess<TTargetDetails>(plan: SqlMigrationPlan<TTargetDetails>): SqlPlannerSuccessResult<TTargetDetails>;
|
|
102
|
+
declare function plannerFailure(conflicts: readonly SqlPlannerConflict[]): SqlPlannerFailureResult;
|
|
103
|
+
/**
|
|
104
|
+
* Creates a successful migration runner result.
|
|
105
|
+
*/
|
|
106
|
+
declare function runnerSuccess(value: {
|
|
107
|
+
operationsPlanned: number;
|
|
108
|
+
operationsExecuted: number;
|
|
109
|
+
}): Ok<SqlMigrationRunnerSuccessValue>;
|
|
110
|
+
/**
|
|
111
|
+
* Creates a failed migration runner result.
|
|
112
|
+
*/
|
|
113
|
+
declare function runnerFailure(code: SqlMigrationRunnerErrorCode, summary: string, options?: {
|
|
114
|
+
why?: string;
|
|
115
|
+
meta?: AnyRecord;
|
|
116
|
+
}): NotOk<SqlMigrationRunnerFailure>;
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/core/migrations/policies.d.ts
|
|
119
|
+
/**
|
|
120
|
+
* Policy used by `db init`: additive-only operations, no widening/destructive steps.
|
|
121
|
+
*/
|
|
122
|
+
declare const INIT_ADDITIVE_POLICY: MigrationOperationPolicy$1;
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/exports/control.d.ts
|
|
125
|
+
declare const _default: SqlFamilyDescriptor;
|
|
126
|
+
//#endregion
|
|
127
|
+
export { type CodecControlHooks, type ComponentDatabaseDependencies, type ComponentDatabaseDependency, type ContractToSchemaIROptions, type ControlMutationDefaultFunctionEntry, type ControlMutationDefaultFunctionHandler, type ControlMutationDefaultGeneratorDescriptor, type CreateSqlMigrationPlanOptions, type DefaultRenderer, type ExpandNativeTypeInput, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type NativeTypeExpander, type PslScalarTypeDescriptor, type ResolveIdentityValueInput, type SchemaVerifyOptions, type SqlControlAdapterDescriptor, type SqlControlDescriptorWithContributions, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlStaticContributions, type SqlControlTargetDescriptor, 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 SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type StorageTypePlanResult, type TargetMigrationsCapability, assembleControlMutationDefaultContributions, assemblePslInterpretationContributions, collectInitDependencies, contractToSchemaIR, createMigrationPlan, _default as default, detectDestructiveChanges, extractCodecControlHooks, isDatabaseDependencyProvider, plannerFailure, plannerSuccess, runnerFailure, runnerSuccess };
|
|
128
|
+
//# sourceMappingURL=control.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-descriptor.ts","../src/core/migrations/contract-to-schema-ir.ts","../src/core/migrations/plan-helpers.ts","../src/core/migrations/policies.ts","../src/exports/control.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;cAaa,mBAAA,YACA,+BAA+B;;;;;;;iCAAwB,yBAAA,CAAA;;;MADvD,SAAA,WACX,EAAA,MAAA;MAA0C,SAAA,aAAA,CAAA,EAAA,MAAA;MAAwB,SAAA,WAAA,EAAA,MAAA;8CAM5C;4CAAA,gCAAA,CAAA;;;;;uMAiB+R,yCAAA,eAAA;+BAjB/R,EAAA,CAAA,MAAA,EAiB+R,gCAAA,CAAA,aAjB/R,EAAA,OAAA,6CAAA,EAAA,sBAAA,KAAA,CAAA,MAAA,+CAAA,GAAA,SAAA,EAAA,SAAA,gDAAA,EAAA,GAAA,MAAA;IAAA,SAAA,qBAAA,EAAA,CAAA,SAAA,QAAA,CAAA,MAAA,EAAA,OAAA,CAAA,GAAA,SAAA,EAAA,GAAA,MAAA;;;0CAGb,yBAAyB,aAC/B;;;;;;;;;;;AAXL;;;KCuBY,kBAAA;;;wBAGY;;;;;;;;;;;KAYZ,eAAA,GDd2S,CAAA,GAAA,ECcnR,aDdmR,EAAA,MAAA,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