@prisma-next/family-sql 0.1.0-dev.16 → 0.1.0-dev.17
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/exports/control.d.ts +135 -75
- package/dist/exports/control.js.map +1 -1
- package/package.json +16 -16
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OperationRegistry } from '@prisma-next/operations';
|
|
2
2
|
import { ExtensionPackManifest } from '@prisma-next/contract/pack-manifest-types';
|
|
3
|
-
import { ControlTargetDescriptor, ControlDriverInstance, OperationContext, ControlFamilyInstance, VerifyDatabaseResult, VerifyDatabaseSchemaResult, SignDatabaseResult, EmitContractResult, ControlFamilyDescriptor, ControlAdapterDescriptor, ControlDriverDescriptor, ControlExtensionDescriptor } from '@prisma-next/core-control-plane/types';
|
|
3
|
+
import { ControlTargetDescriptor, ControlTargetInstance, MigrationOperationPolicy, MigrationPlannerSuccessResult, MigrationPlan, MigrationPlanOperation, MigrationPlannerFailureResult, MigrationPlannerConflict, ControlDriverInstance, OperationContext, MigrationRunnerSuccessValue, MigrationRunnerFailure, ControlFamilyInstance, VerifyDatabaseResult, VerifyDatabaseSchemaResult, SignDatabaseResult, EmitContractResult, ControlFamilyDescriptor, ControlAdapterDescriptor, ControlDriverDescriptor, ControlExtensionDescriptor } from '@prisma-next/core-control-plane/types';
|
|
4
|
+
export { MigrationOperationClass, MigrationOperationPolicy, MigrationPlan, MigrationPlanOperation, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerResult, TargetMigrationsCapability } from '@prisma-next/core-control-plane/types';
|
|
4
5
|
import { ContractIR as ContractIR$1 } from '@prisma-next/contract/ir';
|
|
5
6
|
import { TypesImportSpec as TypesImportSpec$1 } from '@prisma-next/contract/types';
|
|
6
7
|
import { CoreSchemaView } from '@prisma-next/core-control-plane/schema-view';
|
|
@@ -98,92 +99,136 @@ interface ValidationContext {
|
|
|
98
99
|
readonly extensionIds?: ReadonlyArray<string>;
|
|
99
100
|
}
|
|
100
101
|
|
|
102
|
+
/**
|
|
103
|
+
* SQL-specific migration types.
|
|
104
|
+
*
|
|
105
|
+
* These types extend the canonical migration types from the framework control plane
|
|
106
|
+
* with SQL-specific fields for execution (precheck SQL, execute SQL, etc.).
|
|
107
|
+
*/
|
|
108
|
+
|
|
101
109
|
type AnyRecord = Readonly<Record<string, unknown>>;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
interface MigrationPlanOperationStep {
|
|
110
|
+
/**
|
|
111
|
+
* A single step in a SQL migration operation (precheck, execute, or postcheck).
|
|
112
|
+
*/
|
|
113
|
+
interface SqlMigrationPlanOperationStep {
|
|
107
114
|
readonly description: string;
|
|
108
115
|
readonly sql: string;
|
|
109
116
|
readonly meta?: AnyRecord;
|
|
110
117
|
}
|
|
111
|
-
|
|
118
|
+
/**
|
|
119
|
+
* Target details for a SQL migration operation (table, column, index, etc.).
|
|
120
|
+
*/
|
|
121
|
+
interface SqlMigrationPlanOperationTarget<TTargetDetails> {
|
|
112
122
|
readonly id: string;
|
|
113
123
|
readonly details?: TTargetDetails;
|
|
114
124
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
125
|
+
/**
|
|
126
|
+
* A single SQL migration operation with SQL-specific fields.
|
|
127
|
+
* Extends the core MigrationPlanOperation with SQL execution details.
|
|
128
|
+
*/
|
|
129
|
+
interface SqlMigrationPlanOperation<TTargetDetails = Record<string, never>> extends MigrationPlanOperation {
|
|
120
130
|
/** Optional detailed explanation of what this operation does and why. */
|
|
121
131
|
readonly summary?: string;
|
|
122
|
-
readonly
|
|
123
|
-
readonly
|
|
124
|
-
readonly
|
|
125
|
-
readonly
|
|
126
|
-
readonly postcheck: readonly MigrationPlanOperationStep[];
|
|
132
|
+
readonly target: SqlMigrationPlanOperationTarget<TTargetDetails>;
|
|
133
|
+
readonly precheck: readonly SqlMigrationPlanOperationStep[];
|
|
134
|
+
readonly execute: readonly SqlMigrationPlanOperationStep[];
|
|
135
|
+
readonly postcheck: readonly SqlMigrationPlanOperationStep[];
|
|
127
136
|
readonly meta?: AnyRecord;
|
|
128
137
|
}
|
|
129
|
-
|
|
138
|
+
/**
|
|
139
|
+
* Contract identity information for SQL migrations.
|
|
140
|
+
*/
|
|
141
|
+
interface SqlMigrationPlanContractInfo {
|
|
130
142
|
readonly coreHash: string;
|
|
131
143
|
readonly profileHash?: string;
|
|
132
144
|
}
|
|
133
|
-
|
|
134
|
-
|
|
145
|
+
/**
|
|
146
|
+
* A SQL migration plan with SQL-specific fields.
|
|
147
|
+
* Extends the core MigrationPlan with origin tracking and metadata.
|
|
148
|
+
*/
|
|
149
|
+
interface SqlMigrationPlan<TTargetDetails = Record<string, never>> extends MigrationPlan {
|
|
135
150
|
/**
|
|
136
151
|
* Origin contract identity that the plan expects the database to currently be at.
|
|
137
152
|
* If omitted, the runner treats the origin as "no marker present" (empty database),
|
|
138
153
|
* and will only proceed if no marker exists (or if the marker already matches destination).
|
|
139
154
|
*/
|
|
140
|
-
readonly origin?:
|
|
155
|
+
readonly origin?: SqlMigrationPlanContractInfo | null;
|
|
141
156
|
/**
|
|
142
157
|
* Destination contract identity that the plan intends to reach.
|
|
143
158
|
*/
|
|
144
|
-
readonly destination:
|
|
145
|
-
readonly operations: readonly
|
|
159
|
+
readonly destination: SqlMigrationPlanContractInfo;
|
|
160
|
+
readonly operations: readonly SqlMigrationPlanOperation<TTargetDetails>[];
|
|
146
161
|
readonly meta?: AnyRecord;
|
|
147
162
|
}
|
|
148
|
-
|
|
149
|
-
|
|
163
|
+
/**
|
|
164
|
+
* Specific conflict kinds for SQL migrations.
|
|
165
|
+
*/
|
|
166
|
+
type SqlPlannerConflictKind = 'typeMismatch' | 'nullabilityConflict' | 'indexIncompatible' | 'foreignKeyConflict' | 'missingButNonAdditive' | 'unsupportedExtension' | 'extensionMissing' | 'unsupportedOperation';
|
|
167
|
+
/**
|
|
168
|
+
* Location information for SQL planner conflicts.
|
|
169
|
+
*/
|
|
170
|
+
interface SqlPlannerConflictLocation {
|
|
150
171
|
readonly table?: string;
|
|
151
172
|
readonly column?: string;
|
|
152
173
|
readonly index?: string;
|
|
153
174
|
readonly constraint?: string;
|
|
154
175
|
readonly extension?: string;
|
|
155
176
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
177
|
+
/**
|
|
178
|
+
* A SQL-specific planner conflict with additional location information.
|
|
179
|
+
* Extends the core MigrationPlannerConflict.
|
|
180
|
+
*/
|
|
181
|
+
interface SqlPlannerConflict extends MigrationPlannerConflict {
|
|
182
|
+
readonly kind: SqlPlannerConflictKind;
|
|
183
|
+
readonly location?: SqlPlannerConflictLocation;
|
|
161
184
|
readonly meta?: AnyRecord;
|
|
162
185
|
}
|
|
163
|
-
|
|
186
|
+
/**
|
|
187
|
+
* Successful SQL planner result with the migration plan.
|
|
188
|
+
*/
|
|
189
|
+
interface SqlPlannerSuccessResult<TTargetDetails> extends Omit<MigrationPlannerSuccessResult, 'plan'> {
|
|
164
190
|
readonly kind: 'success';
|
|
165
|
-
readonly plan:
|
|
191
|
+
readonly plan: SqlMigrationPlan<TTargetDetails>;
|
|
166
192
|
}
|
|
167
|
-
|
|
193
|
+
/**
|
|
194
|
+
* Failed SQL planner result with the list of conflicts.
|
|
195
|
+
*/
|
|
196
|
+
interface SqlPlannerFailureResult extends Omit<MigrationPlannerFailureResult, 'conflicts'> {
|
|
168
197
|
readonly kind: 'failure';
|
|
169
|
-
readonly conflicts: readonly
|
|
198
|
+
readonly conflicts: readonly SqlPlannerConflict[];
|
|
170
199
|
}
|
|
171
|
-
|
|
172
|
-
|
|
200
|
+
/**
|
|
201
|
+
* Union type for SQL planner results.
|
|
202
|
+
*/
|
|
203
|
+
type SqlPlannerResult<TTargetDetails = Record<string, never>> = SqlPlannerSuccessResult<TTargetDetails> | SqlPlannerFailureResult;
|
|
204
|
+
/**
|
|
205
|
+
* Options for SQL migration planner.
|
|
206
|
+
*/
|
|
207
|
+
interface SqlMigrationPlannerPlanOptions {
|
|
173
208
|
readonly contract: SqlContract<SqlStorage$1>;
|
|
174
209
|
readonly schema: SqlSchemaIR;
|
|
175
210
|
readonly policy: MigrationOperationPolicy;
|
|
176
211
|
readonly schemaName?: string;
|
|
177
212
|
}
|
|
178
|
-
|
|
179
|
-
|
|
213
|
+
/**
|
|
214
|
+
* SQL migration planner interface.
|
|
215
|
+
* Extends the core MigrationPlanner with SQL-specific types.
|
|
216
|
+
*/
|
|
217
|
+
interface SqlMigrationPlanner<TTargetDetails = Record<string, never>> {
|
|
218
|
+
plan(options: SqlMigrationPlannerPlanOptions): SqlPlannerResult<TTargetDetails>;
|
|
180
219
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
220
|
+
/**
|
|
221
|
+
* Callbacks for SQL migration runner execution.
|
|
222
|
+
*/
|
|
223
|
+
interface SqlMigrationRunnerExecuteCallbacks<TTargetDetails = Record<string, never>> {
|
|
224
|
+
onOperationStart?(operation: SqlMigrationPlanOperation<TTargetDetails>): void;
|
|
225
|
+
onOperationComplete?(operation: SqlMigrationPlanOperation<TTargetDetails>): void;
|
|
184
226
|
}
|
|
185
|
-
|
|
186
|
-
|
|
227
|
+
/**
|
|
228
|
+
* Options for SQL migration runner execution.
|
|
229
|
+
*/
|
|
230
|
+
interface SqlMigrationRunnerExecuteOptions<TTargetDetails = Record<string, never>> {
|
|
231
|
+
readonly plan: SqlMigrationPlan<TTargetDetails>;
|
|
187
232
|
readonly driver: ControlDriverInstance;
|
|
188
233
|
/**
|
|
189
234
|
* Destination contract IR.
|
|
@@ -197,47 +242,62 @@ interface MigrationRunnerExecuteOptions<TTargetDetails = Record<string, never>>
|
|
|
197
242
|
readonly policy: MigrationOperationPolicy;
|
|
198
243
|
readonly schemaName?: string;
|
|
199
244
|
readonly strictVerification?: boolean;
|
|
200
|
-
readonly callbacks?:
|
|
245
|
+
readonly callbacks?: SqlMigrationRunnerExecuteCallbacks<TTargetDetails>;
|
|
201
246
|
readonly context?: OperationContext;
|
|
202
247
|
}
|
|
203
248
|
/**
|
|
204
|
-
* Error codes for migration runner failures.
|
|
249
|
+
* Error codes for SQL migration runner failures.
|
|
205
250
|
*/
|
|
206
|
-
type
|
|
251
|
+
type SqlMigrationRunnerErrorCode = 'DESTINATION_CONTRACT_MISMATCH' | 'MARKER_ORIGIN_MISMATCH' | 'POLICY_VIOLATION' | 'PRECHECK_FAILED' | 'POSTCHECK_FAILED' | 'SCHEMA_VERIFY_FAILED' | 'EXECUTION_FAILED';
|
|
207
252
|
/**
|
|
208
|
-
* Detailed information about a migration runner failure.
|
|
209
|
-
*
|
|
253
|
+
* Detailed information about a SQL migration runner failure.
|
|
254
|
+
* Extends the core MigrationRunnerFailure with SQL-specific error codes.
|
|
210
255
|
*/
|
|
211
|
-
interface MigrationRunnerFailure {
|
|
212
|
-
readonly code:
|
|
213
|
-
readonly summary: string;
|
|
214
|
-
readonly why?: string;
|
|
256
|
+
interface SqlMigrationRunnerFailure extends MigrationRunnerFailure {
|
|
257
|
+
readonly code: SqlMigrationRunnerErrorCode;
|
|
215
258
|
readonly meta?: AnyRecord;
|
|
216
259
|
}
|
|
217
260
|
/**
|
|
218
|
-
* Success value for migration runner execution.
|
|
261
|
+
* Success value for SQL migration runner execution.
|
|
262
|
+
* Extends core type for type branding and potential SQL-specific extensions.
|
|
219
263
|
*/
|
|
220
|
-
interface MigrationRunnerSuccessValue {
|
|
221
|
-
readonly operationsPlanned: number;
|
|
222
|
-
readonly operationsExecuted: number;
|
|
264
|
+
interface SqlMigrationRunnerSuccessValue extends MigrationRunnerSuccessValue {
|
|
223
265
|
}
|
|
224
266
|
/**
|
|
225
|
-
* Result
|
|
226
|
-
|
|
267
|
+
* Result type for SQL migration runner execution.
|
|
268
|
+
*/
|
|
269
|
+
type SqlMigrationRunnerResult = Result<SqlMigrationRunnerSuccessValue, SqlMigrationRunnerFailure>;
|
|
270
|
+
/**
|
|
271
|
+
* SQL migration runner interface.
|
|
272
|
+
* Extends the core MigrationRunner with SQL-specific types.
|
|
227
273
|
*/
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
execute(options: MigrationRunnerExecuteOptions<TTargetDetails>): Promise<MigrationRunnerResult>;
|
|
274
|
+
interface SqlMigrationRunner<TTargetDetails = Record<string, never>> {
|
|
275
|
+
execute(options: SqlMigrationRunnerExecuteOptions<TTargetDetails>): Promise<SqlMigrationRunnerResult>;
|
|
231
276
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
277
|
+
/**
|
|
278
|
+
* SQL control target descriptor with migration support.
|
|
279
|
+
* Extends the core ControlTargetDescriptor with SQL-specific migration methods.
|
|
280
|
+
*/
|
|
281
|
+
interface SqlControlTargetDescriptor<TTargetId extends string, TTargetDetails = Record<string, never>> extends ControlTargetDescriptor<'sql', TTargetId, ControlTargetInstance<'sql', TTargetId>, SqlControlFamilyInstance> {
|
|
282
|
+
/**
|
|
283
|
+
* Creates a SQL migration planner for this target.
|
|
284
|
+
* Direct method for SQL-specific usage.
|
|
285
|
+
*/
|
|
286
|
+
createPlanner(family: SqlControlFamilyInstance): SqlMigrationPlanner<TTargetDetails>;
|
|
287
|
+
/**
|
|
288
|
+
* Creates a SQL migration runner for this target.
|
|
289
|
+
* Direct method for SQL-specific usage.
|
|
290
|
+
*/
|
|
291
|
+
createRunner(family: SqlControlFamilyInstance): SqlMigrationRunner<TTargetDetails>;
|
|
235
292
|
}
|
|
236
|
-
|
|
293
|
+
/**
|
|
294
|
+
* Options for creating a SQL migration plan.
|
|
295
|
+
*/
|
|
296
|
+
interface CreateSqlMigrationPlanOptions<TTargetDetails> {
|
|
237
297
|
readonly targetId: string;
|
|
238
|
-
readonly origin?:
|
|
239
|
-
readonly destination:
|
|
240
|
-
readonly operations: readonly
|
|
298
|
+
readonly origin?: SqlMigrationPlanContractInfo | null;
|
|
299
|
+
readonly destination: SqlMigrationPlanContractInfo;
|
|
300
|
+
readonly operations: readonly SqlMigrationPlanOperation<TTargetDetails>[];
|
|
241
301
|
readonly meta?: AnyRecord;
|
|
242
302
|
}
|
|
243
303
|
|
|
@@ -374,23 +434,23 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
|
|
|
374
434
|
}): SqlControlFamilyInstance;
|
|
375
435
|
}
|
|
376
436
|
|
|
377
|
-
declare function createMigrationPlan<TTargetDetails = Record<string, never>>(options:
|
|
378
|
-
declare function plannerSuccess<TTargetDetails>(plan:
|
|
379
|
-
declare function plannerFailure(conflicts: readonly
|
|
437
|
+
declare function createMigrationPlan<TTargetDetails = Record<string, never>>(options: CreateSqlMigrationPlanOptions<TTargetDetails>): SqlMigrationPlan<TTargetDetails>;
|
|
438
|
+
declare function plannerSuccess<TTargetDetails>(plan: SqlMigrationPlan<TTargetDetails>): SqlPlannerSuccessResult<TTargetDetails>;
|
|
439
|
+
declare function plannerFailure(conflicts: readonly SqlPlannerConflict[]): SqlPlannerFailureResult;
|
|
380
440
|
/**
|
|
381
441
|
* Creates a successful migration runner result.
|
|
382
442
|
*/
|
|
383
443
|
declare function runnerSuccess(value: {
|
|
384
444
|
operationsPlanned: number;
|
|
385
445
|
operationsExecuted: number;
|
|
386
|
-
}): Ok<
|
|
446
|
+
}): Ok<SqlMigrationRunnerSuccessValue>;
|
|
387
447
|
/**
|
|
388
448
|
* Creates a failed migration runner result.
|
|
389
449
|
*/
|
|
390
|
-
declare function runnerFailure(code:
|
|
450
|
+
declare function runnerFailure(code: SqlMigrationRunnerErrorCode, summary: string, options?: {
|
|
391
451
|
why?: string;
|
|
392
452
|
meta?: AnyRecord;
|
|
393
|
-
}): NotOk<
|
|
453
|
+
}): NotOk<SqlMigrationRunnerFailure>;
|
|
394
454
|
|
|
395
455
|
/**
|
|
396
456
|
* Policy used by `db init`: additive-only operations, no widening/destructive steps.
|
|
@@ -403,4 +463,4 @@ declare const INIT_ADDITIVE_POLICY: MigrationOperationPolicy;
|
|
|
403
463
|
*/
|
|
404
464
|
declare const _default: SqlFamilyDescriptor;
|
|
405
465
|
|
|
406
|
-
export { type
|
|
466
|
+
export { type CreateSqlMigrationPlanOptions, INIT_ADDITIVE_POLICY, type SchemaVerifyOptions, type SqlControlFamilyInstance, 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, createMigrationPlan, _default as default, plannerFailure, plannerSuccess, runnerFailure, runnerSuccess };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/descriptor.ts","../../src/core/migrations/plan-helpers.ts","../../src/core/migrations/policies.ts","../../src/exports/control.ts"],"sourcesContent":["import type { ExtensionPackManifest } from '@prisma-next/contract/pack-manifest-types';\nimport type {\n ControlAdapterDescriptor,\n ControlDriverDescriptor,\n ControlExtensionDescriptor,\n ControlFamilyDescriptor,\n} from '@prisma-next/core-control-plane/types';\nimport { sqlTargetFamilyHook } from '@prisma-next/sql-contract-emitter';\nimport { createSqlFamilyInstance, type SqlControlFamilyInstance } from './instance';\nimport type { SqlControlTargetDescriptor } from './migrations/types';\n\n/**\n * SQL family manifest.\n */\nconst sqlFamilyManifest: ExtensionPackManifest = {\n id: 'sql',\n version: '0.0.1',\n};\n\n/**\n * SQL family descriptor implementation.\n * Provides the SQL family hook and factory method.\n */\nexport class SqlFamilyDescriptor\n implements ControlFamilyDescriptor<'sql', SqlControlFamilyInstance>\n{\n readonly kind = 'family' as const;\n readonly id = 'sql';\n readonly familyId = 'sql' as const;\n readonly manifest = sqlFamilyManifest;\n readonly hook = sqlTargetFamilyHook;\n\n create<TTargetId extends string, TTargetDetails = Record<string, never>>(options: {\n readonly target: SqlControlTargetDescriptor<TTargetId, TTargetDetails>;\n readonly adapter: ControlAdapterDescriptor<'sql', TTargetId>;\n readonly driver: ControlDriverDescriptor<'sql', TTargetId>;\n readonly extensions: readonly ControlExtensionDescriptor<'sql', TTargetId>[];\n }): SqlControlFamilyInstance {\n return createSqlFamilyInstance({\n target: options.target,\n adapter: options.adapter,\n extensions: options.extensions,\n });\n }\n}\n","import type { NotOk, Ok } from '@prisma-next/utils/result';\nimport { notOk, ok } from '@prisma-next/utils/result';\nimport type {\n AnyRecord,\n CreateMigrationPlanOptions,\n MigrationPlan,\n MigrationPlanOperation,\n MigrationPlanOperationStep,\n MigrationPlanOperationTarget,\n MigrationRunnerErrorCode,\n MigrationRunnerFailure,\n MigrationRunnerSuccessValue,\n PlannerConflict,\n PlannerFailureResult,\n PlannerSuccessResult,\n} from './types';\n\nconst readOnlyEmptyObject: Record<string, never> = Object.freeze({});\n\nfunction cloneRecord<T extends AnyRecord>(value: T): T {\n if (value === readOnlyEmptyObject) {\n return value;\n }\n return Object.freeze({ ...value }) as T;\n}\n\nfunction freezeSteps(\n steps: readonly MigrationPlanOperationStep[],\n): readonly MigrationPlanOperationStep[] {\n if (steps.length === 0) {\n return Object.freeze([]);\n }\n return Object.freeze(\n steps.map((step) =>\n Object.freeze({\n description: step.description,\n sql: step.sql,\n ...(step.meta ? { meta: cloneRecord(step.meta) } : {}),\n }),\n ),\n );\n}\n\nfunction freezeDetailsValue<T>(value: T): T {\n // Primitives and null/undefined are already immutable, return as-is\n if (value === null || value === undefined) {\n return value;\n }\n if (typeof value !== 'object') {\n return value;\n }\n // Arrays: shallow clone and freeze\n if (Array.isArray(value)) {\n return Object.freeze([...value]) as T;\n }\n // Objects: shallow clone and freeze (matching cloneRecord pattern)\n return Object.freeze({ ...value }) as T;\n}\n\nfunction freezeTargetDetails<TTargetDetails>(\n target: MigrationPlanOperationTarget<TTargetDetails>,\n): MigrationPlanOperationTarget<TTargetDetails> {\n return Object.freeze({\n id: target.id,\n ...(target.details !== undefined ? { details: freezeDetailsValue(target.details) } : {}),\n });\n}\n\nfunction freezeOperation<TTargetDetails>(\n operation: MigrationPlanOperation<TTargetDetails>,\n): MigrationPlanOperation<TTargetDetails> {\n return Object.freeze({\n id: operation.id,\n label: operation.label,\n ...(operation.summary ? { summary: operation.summary } : {}),\n operationClass: operation.operationClass,\n target: freezeTargetDetails(operation.target),\n precheck: freezeSteps(operation.precheck),\n execute: freezeSteps(operation.execute),\n postcheck: freezeSteps(operation.postcheck),\n ...(operation.meta ? { meta: cloneRecord(operation.meta) } : {}),\n });\n}\n\nfunction freezeOperations<TTargetDetails>(\n operations: readonly MigrationPlanOperation<TTargetDetails>[],\n): readonly MigrationPlanOperation<TTargetDetails>[] {\n if (operations.length === 0) {\n return Object.freeze([]);\n }\n return Object.freeze(operations.map((operation) => freezeOperation(operation)));\n}\n\nexport function createMigrationPlan<TTargetDetails = Record<string, never>>(\n options: CreateMigrationPlanOptions<TTargetDetails>,\n): MigrationPlan<TTargetDetails> {\n return Object.freeze({\n targetId: options.targetId,\n ...(options.origin !== undefined\n ? { origin: options.origin ? Object.freeze({ ...options.origin }) : null }\n : {}),\n destination: Object.freeze({ ...options.destination }),\n operations: freezeOperations(options.operations),\n ...(options.meta ? { meta: cloneRecord(options.meta) } : {}),\n });\n}\n\nexport function plannerSuccess<TTargetDetails>(\n plan: MigrationPlan<TTargetDetails>,\n): PlannerSuccessResult<TTargetDetails> {\n return Object.freeze({\n kind: 'success',\n plan,\n });\n}\n\nexport function plannerFailure(conflicts: readonly PlannerConflict[]): PlannerFailureResult {\n return Object.freeze({\n kind: 'failure' as const,\n conflicts: Object.freeze(\n conflicts.map((conflict) =>\n Object.freeze({\n kind: conflict.kind,\n summary: conflict.summary,\n ...(conflict.why ? { why: conflict.why } : {}),\n ...(conflict.location ? { location: Object.freeze({ ...conflict.location }) } : {}),\n ...(conflict.meta ? { meta: cloneRecord(conflict.meta) } : {}),\n }),\n ),\n ),\n });\n}\n\n/**\n * Creates a successful migration runner result.\n */\nexport function runnerSuccess(value: {\n operationsPlanned: number;\n operationsExecuted: number;\n}): Ok<MigrationRunnerSuccessValue> {\n return ok(\n Object.freeze({\n operationsPlanned: value.operationsPlanned,\n operationsExecuted: value.operationsExecuted,\n }),\n );\n}\n\n/**\n * Creates a failed migration runner result.\n */\nexport function runnerFailure(\n code: MigrationRunnerErrorCode,\n summary: string,\n options?: { why?: string; meta?: AnyRecord },\n): NotOk<MigrationRunnerFailure> {\n const failure: MigrationRunnerFailure = Object.freeze({\n code,\n summary,\n ...(options?.why ? { why: options.why } : {}),\n ...(options?.meta ? { meta: cloneRecord(options.meta) } : {}),\n });\n return notOk(failure);\n}\n","import type { MigrationOperationPolicy } from './types';\n\n/**\n * Policy used by `db init`: additive-only operations, no widening/destructive steps.\n */\nexport const INIT_ADDITIVE_POLICY: MigrationOperationPolicy = Object.freeze({\n allowedOperationClasses: Object.freeze(['additive'] as const),\n});\n","import { SqlFamilyDescriptor } from '../core/descriptor';\n\nexport type { SchemaVerifyOptions, SqlControlFamilyInstance } from '../core/instance';\nexport {\n createMigrationPlan,\n plannerFailure,\n plannerSuccess,\n runnerFailure,\n runnerSuccess,\n} from '../core/migrations/plan-helpers';\nexport { INIT_ADDITIVE_POLICY } from '../core/migrations/policies';\nexport type {\n CreateMigrationPlanOptions,\n MigrationOperationClass,\n MigrationOperationPolicy,\n MigrationPlan,\n MigrationPlanContractInfo,\n MigrationPlanner,\n MigrationPlannerPlanOptions,\n MigrationPlanOperation,\n MigrationPlanOperationStep,\n MigrationPlanOperationTarget,\n MigrationRunner,\n MigrationRunnerErrorCode,\n MigrationRunnerExecuteCallbacks,\n MigrationRunnerExecuteOptions,\n MigrationRunnerFailure,\n MigrationRunnerResult,\n MigrationRunnerSuccessValue,\n PlannerConflict,\n PlannerConflictKind,\n PlannerConflictLocation,\n PlannerFailureResult,\n PlannerResult,\n PlannerSuccessResult,\n SqlControlTargetDescriptor,\n} from '../core/migrations/types';\n\n/**\n * SQL family descriptor for control plane (CLI/config).\n * Provides the SQL family hook and conversion helpers.\n */\nexport default new SqlFamilyDescriptor();\n"],"mappings":";;;;;;;AAOA,SAAS,2BAA2B;AAOpC,IAAM,oBAA2C;AAAA,EAC/C,IAAI;AAAA,EACJ,SAAS;AACX;AAMO,IAAM,sBAAN,MAEP;AAAA,EACW,OAAO;AAAA,EACP,KAAK;AAAA,EACL,WAAW;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EAEhB,OAAyE,SAK5C;AAC3B,WAAO,wBAAwB;AAAA,MAC7B,QAAQ,QAAQ;AAAA,MAChB,SAAS,QAAQ;AAAA,MACjB,YAAY,QAAQ;AAAA,IACtB,CAAC;AAAA,EACH;AACF;;;AC3CA,SAAS,OAAO,UAAU;AAgB1B,IAAM,sBAA6C,OAAO,OAAO,CAAC,CAAC;AAEnE,SAAS,YAAiC,OAAa;AACrD,MAAI,UAAU,qBAAqB;AACjC,WAAO;AAAA,EACT;AACA,SAAO,OAAO,OAAO,EAAE,GAAG,MAAM,CAAC;AACnC;AAEA,SAAS,YACP,OACuC;AACvC,MAAI,MAAM,WAAW,GAAG;AACtB,WAAO,OAAO,OAAO,CAAC,CAAC;AAAA,EACzB;AACA,SAAO,OAAO;AAAA,IACZ,MAAM;AAAA,MAAI,CAAC,SACT,OAAO,OAAO;AAAA,QACZ,aAAa,KAAK;AAAA,QAClB,KAAK,KAAK;AAAA,QACV,GAAI,KAAK,OAAO,EAAE,MAAM,YAAY,KAAK,IAAI,EAAE,IAAI,CAAC;AAAA,MACtD,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEA,SAAS,mBAAsB,OAAa;AAE1C,MAAI,UAAU,QAAQ,UAAU,QAAW;AACzC,WAAO;AAAA,EACT;AACA,MAAI,OAAO,UAAU,UAAU;AAC7B,WAA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E,yBAAyB,OAAO,OAAO,CAAC,UAAU,CAAU;AAC9D,CAAC;;;ACmCD,IAAO,kBAAQ,IAAI,oBAAoB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/core/descriptor.ts","../../src/core/migrations/plan-helpers.ts","../../src/core/migrations/policies.ts","../../src/exports/control.ts"],"sourcesContent":["import type { ExtensionPackManifest } from '@prisma-next/contract/pack-manifest-types';\nimport type {\n ControlAdapterDescriptor,\n ControlDriverDescriptor,\n ControlExtensionDescriptor,\n ControlFamilyDescriptor,\n} from '@prisma-next/core-control-plane/types';\nimport { sqlTargetFamilyHook } from '@prisma-next/sql-contract-emitter';\nimport { createSqlFamilyInstance, type SqlControlFamilyInstance } from './instance';\nimport type { SqlControlTargetDescriptor } from './migrations/types';\n\n/**\n * SQL family manifest.\n */\nconst sqlFamilyManifest: ExtensionPackManifest = {\n id: 'sql',\n version: '0.0.1',\n};\n\n/**\n * SQL family descriptor implementation.\n * Provides the SQL family hook and factory method.\n */\nexport class SqlFamilyDescriptor\n implements ControlFamilyDescriptor<'sql', SqlControlFamilyInstance>\n{\n readonly kind = 'family' as const;\n readonly id = 'sql';\n readonly familyId = 'sql' as const;\n readonly manifest = sqlFamilyManifest;\n readonly hook = sqlTargetFamilyHook;\n\n create<TTargetId extends string, TTargetDetails = Record<string, never>>(options: {\n readonly target: SqlControlTargetDescriptor<TTargetId, TTargetDetails>;\n readonly adapter: ControlAdapterDescriptor<'sql', TTargetId>;\n readonly driver: ControlDriverDescriptor<'sql', TTargetId>;\n readonly extensions: readonly ControlExtensionDescriptor<'sql', TTargetId>[];\n }): SqlControlFamilyInstance {\n return createSqlFamilyInstance({\n target: options.target,\n adapter: options.adapter,\n extensions: options.extensions,\n });\n }\n}\n","import type { NotOk, Ok } from '@prisma-next/utils/result';\nimport { notOk, ok } from '@prisma-next/utils/result';\nimport type {\n AnyRecord,\n CreateSqlMigrationPlanOptions,\n SqlMigrationPlan,\n SqlMigrationPlanOperation,\n SqlMigrationPlanOperationStep,\n SqlMigrationPlanOperationTarget,\n SqlMigrationRunnerErrorCode,\n SqlMigrationRunnerFailure,\n SqlMigrationRunnerSuccessValue,\n SqlPlannerConflict,\n SqlPlannerFailureResult,\n SqlPlannerSuccessResult,\n} from './types';\n\nconst readOnlyEmptyObject: Record<string, never> = Object.freeze({});\n\nfunction cloneRecord<T extends AnyRecord>(value: T): T {\n if (value === readOnlyEmptyObject) {\n return value;\n }\n return Object.freeze({ ...value }) as T;\n}\n\nfunction freezeSteps(\n steps: readonly SqlMigrationPlanOperationStep[],\n): readonly SqlMigrationPlanOperationStep[] {\n if (steps.length === 0) {\n return Object.freeze([]);\n }\n return Object.freeze(\n steps.map((step) =>\n Object.freeze({\n description: step.description,\n sql: step.sql,\n ...(step.meta ? { meta: cloneRecord(step.meta) } : {}),\n }),\n ),\n );\n}\n\nfunction freezeDetailsValue<T>(value: T): T {\n // Primitives and null/undefined are already immutable, return as-is\n if (value === null || value === undefined) {\n return value;\n }\n if (typeof value !== 'object') {\n return value;\n }\n // Arrays: shallow clone and freeze\n if (Array.isArray(value)) {\n return Object.freeze([...value]) as T;\n }\n // Objects: shallow clone and freeze (matching cloneRecord pattern)\n return Object.freeze({ ...value }) as T;\n}\n\nfunction freezeTargetDetails<TTargetDetails>(\n target: SqlMigrationPlanOperationTarget<TTargetDetails>,\n): SqlMigrationPlanOperationTarget<TTargetDetails> {\n return Object.freeze({\n id: target.id,\n ...(target.details !== undefined ? { details: freezeDetailsValue(target.details) } : {}),\n });\n}\n\nfunction freezeOperation<TTargetDetails>(\n operation: SqlMigrationPlanOperation<TTargetDetails>,\n): SqlMigrationPlanOperation<TTargetDetails> {\n return Object.freeze({\n id: operation.id,\n label: operation.label,\n ...(operation.summary ? { summary: operation.summary } : {}),\n operationClass: operation.operationClass,\n target: freezeTargetDetails(operation.target),\n precheck: freezeSteps(operation.precheck),\n execute: freezeSteps(operation.execute),\n postcheck: freezeSteps(operation.postcheck),\n ...(operation.meta ? { meta: cloneRecord(operation.meta) } : {}),\n });\n}\n\nfunction freezeOperations<TTargetDetails>(\n operations: readonly SqlMigrationPlanOperation<TTargetDetails>[],\n): readonly SqlMigrationPlanOperation<TTargetDetails>[] {\n if (operations.length === 0) {\n return Object.freeze([]);\n }\n return Object.freeze(operations.map((operation) => freezeOperation(operation)));\n}\n\nexport function createMigrationPlan<TTargetDetails = Record<string, never>>(\n options: CreateSqlMigrationPlanOptions<TTargetDetails>,\n): SqlMigrationPlan<TTargetDetails> {\n return Object.freeze({\n targetId: options.targetId,\n ...(options.origin !== undefined\n ? { origin: options.origin ? Object.freeze({ ...options.origin }) : null }\n : {}),\n destination: Object.freeze({ ...options.destination }),\n operations: freezeOperations(options.operations),\n ...(options.meta ? { meta: cloneRecord(options.meta) } : {}),\n });\n}\n\nexport function plannerSuccess<TTargetDetails>(\n plan: SqlMigrationPlan<TTargetDetails>,\n): SqlPlannerSuccessResult<TTargetDetails> {\n return Object.freeze({\n kind: 'success',\n plan,\n });\n}\n\nexport function plannerFailure(conflicts: readonly SqlPlannerConflict[]): SqlPlannerFailureResult {\n return Object.freeze({\n kind: 'failure' as const,\n conflicts: Object.freeze(\n conflicts.map((conflict) =>\n Object.freeze({\n kind: conflict.kind,\n summary: conflict.summary,\n ...(conflict.why ? { why: conflict.why } : {}),\n ...(conflict.location ? { location: Object.freeze({ ...conflict.location }) } : {}),\n ...(conflict.meta ? { meta: cloneRecord(conflict.meta) } : {}),\n }),\n ),\n ),\n });\n}\n\n/**\n * Creates a successful migration runner result.\n */\nexport function runnerSuccess(value: {\n operationsPlanned: number;\n operationsExecuted: number;\n}): Ok<SqlMigrationRunnerSuccessValue> {\n return ok(\n Object.freeze({\n operationsPlanned: value.operationsPlanned,\n operationsExecuted: value.operationsExecuted,\n }),\n );\n}\n\n/**\n * Creates a failed migration runner result.\n */\nexport function runnerFailure(\n code: SqlMigrationRunnerErrorCode,\n summary: string,\n options?: { why?: string; meta?: AnyRecord },\n): NotOk<SqlMigrationRunnerFailure> {\n const failure: SqlMigrationRunnerFailure = Object.freeze({\n code,\n summary,\n ...(options?.why ? { why: options.why } : {}),\n ...(options?.meta ? { meta: cloneRecord(options.meta) } : {}),\n });\n return notOk(failure);\n}\n","import type { MigrationOperationPolicy } from '@prisma-next/core-control-plane/types';\n\n/**\n * Policy used by `db init`: additive-only operations, no widening/destructive steps.\n */\nexport const INIT_ADDITIVE_POLICY: MigrationOperationPolicy = Object.freeze({\n allowedOperationClasses: Object.freeze(['additive'] as const),\n});\n","import { SqlFamilyDescriptor } from '../core/descriptor';\n\n// Re-export core types from canonical source\nexport type {\n MigrationOperationClass,\n MigrationOperationPolicy,\n MigrationPlan,\n MigrationPlanner,\n MigrationPlannerConflict,\n MigrationPlannerResult,\n MigrationPlanOperation,\n TargetMigrationsCapability,\n} from '@prisma-next/core-control-plane/types';\nexport type { SchemaVerifyOptions, SqlControlFamilyInstance } from '../core/instance';\nexport {\n createMigrationPlan,\n plannerFailure,\n plannerSuccess,\n runnerFailure,\n runnerSuccess,\n} from '../core/migrations/plan-helpers';\nexport { INIT_ADDITIVE_POLICY } from '../core/migrations/policies';\n// SQL-specific types\nexport type {\n CreateSqlMigrationPlanOptions,\n SqlControlTargetDescriptor,\n SqlMigrationPlan,\n SqlMigrationPlanContractInfo,\n SqlMigrationPlanner,\n SqlMigrationPlannerPlanOptions,\n SqlMigrationPlanOperation,\n SqlMigrationPlanOperationStep,\n SqlMigrationPlanOperationTarget,\n SqlMigrationRunner,\n SqlMigrationRunnerErrorCode,\n SqlMigrationRunnerExecuteCallbacks,\n SqlMigrationRunnerExecuteOptions,\n SqlMigrationRunnerFailure,\n SqlMigrationRunnerResult,\n SqlMigrationRunnerSuccessValue,\n SqlPlannerConflict,\n SqlPlannerConflictKind,\n SqlPlannerConflictLocation,\n SqlPlannerFailureResult,\n SqlPlannerResult,\n SqlPlannerSuccessResult,\n} from '../core/migrations/types';\n\n/**\n * SQL family descriptor for control plane (CLI/config).\n * Provides the SQL family hook and conversion helpers.\n */\nexport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"@prisma-next/family-sql",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "SQL family descriptor for Prisma Next",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"arktype": "^2.0.0",
|
|
9
|
-
"@prisma-next/cli": "0.1.0-dev.
|
|
10
|
-
"@prisma-next/contract": "0.1.0-dev.
|
|
11
|
-
"@prisma-next/core-control-plane": "0.1.0-dev.
|
|
12
|
-
"@prisma-next/core-execution-plane": "0.1.0-dev.
|
|
13
|
-
"@prisma-next/operations": "0.1.0-dev.
|
|
14
|
-
"@prisma-next/
|
|
15
|
-
"@prisma-next/
|
|
16
|
-
"@prisma-next/sql-contract-ts": "0.1.0-dev.
|
|
17
|
-
"@prisma-next/sql-contract": "0.1.0-dev.
|
|
18
|
-
"@prisma-next/sql-operations": "0.1.0-dev.
|
|
19
|
-
"@prisma-next/sql-relational-core": "0.1.0-dev.
|
|
20
|
-
"@prisma-next/sql-
|
|
21
|
-
"@prisma-next/
|
|
22
|
-
"@prisma-next/
|
|
9
|
+
"@prisma-next/cli": "0.1.0-dev.17",
|
|
10
|
+
"@prisma-next/contract": "0.1.0-dev.17",
|
|
11
|
+
"@prisma-next/core-control-plane": "0.1.0-dev.17",
|
|
12
|
+
"@prisma-next/core-execution-plane": "0.1.0-dev.17",
|
|
13
|
+
"@prisma-next/operations": "0.1.0-dev.17",
|
|
14
|
+
"@prisma-next/sql-contract-emitter": "0.1.0-dev.17",
|
|
15
|
+
"@prisma-next/runtime-executor": "0.1.0-dev.17",
|
|
16
|
+
"@prisma-next/sql-contract-ts": "0.1.0-dev.17",
|
|
17
|
+
"@prisma-next/sql-contract": "0.1.0-dev.17",
|
|
18
|
+
"@prisma-next/sql-operations": "0.1.0-dev.17",
|
|
19
|
+
"@prisma-next/sql-relational-core": "0.1.0-dev.17",
|
|
20
|
+
"@prisma-next/sql-runtime": "0.1.0-dev.17",
|
|
21
|
+
"@prisma-next/sql-schema-ir": "0.1.0-dev.17",
|
|
22
|
+
"@prisma-next/utils": "0.1.0-dev.17"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"tsup": "^8.3.0",
|
|
26
26
|
"typescript": "^5.9.3",
|
|
27
27
|
"vite-tsconfig-paths": "^5.1.4",
|
|
28
28
|
"vitest": "^2.1.1",
|
|
29
|
-
"@prisma-next/driver-postgres": "0.1.0-dev.
|
|
29
|
+
"@prisma-next/driver-postgres": "0.1.0-dev.17",
|
|
30
30
|
"@prisma-next/test-utils": "0.0.1"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|