@prisma/orm-target-sqlite 8.0.0-rc.11-dev.28 → 8.0.0-rc.11-dev.30
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/{adapter-C_hZO37s-IihLbE6L.mjs → adapter-C_hZO37s-DFw7F2DZ.mjs} +2 -2
- package/dist/{adapter-C_hZO37s-IihLbE6L.mjs.map → adapter-C_hZO37s-DFw7F2DZ.mjs.map} +1 -1
- package/dist/adapter.mjs +2 -2
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__control.mjs +7 -3
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.mjs +1 -1
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/{default-normalizer-DuoHj9-O-DsK7lJZn.mjs → default-normalizer-D_kHnqz7-SRi-lBH0.mjs} +13 -3
- package/dist/{default-normalizer-DuoHj9-O-DsK7lJZn.mjs.map → default-normalizer-D_kHnqz7-SRi-lBH0.mjs.map} +1 -1
- package/dist/{migration-DOKPHtxn.mjs → migration-CPXuprRF.mjs} +2 -2
- package/dist/{migration-DOKPHtxn.mjs.map → migration-CPXuprRF.mjs.map} +1 -1
- package/dist/{op-factory-call-gc26GqyA-Db5Fasef.mjs → op-factory-call-C7xkDM68-DKdYNph6.mjs} +14 -4
- package/dist/op-factory-call-C7xkDM68-DKdYNph6.mjs.map +1 -0
- package/dist/{planner-CuewJa-j-B7nPsjLN.mjs → planner-Btyty0VZ-CwoZV9Kx.mjs} +7 -5
- package/dist/planner-Btyty0VZ-CwoZV9Kx.mjs.map +1 -0
- package/dist/{planner-produced-sqlite-migration-C9uVDKrJ-CWbxSANn.mjs → planner-produced-sqlite-migration-rE9Hfch8-DPGrVAy9.mjs} +3 -3
- package/dist/{planner-produced-sqlite-migration-C9uVDKrJ-CWbxSANn.mjs.map → planner-produced-sqlite-migration-rE9Hfch8-DPGrVAy9.mjs.map} +1 -1
- package/dist/{sqlite-migration-CjMkH4Id-c6dM9w61.mjs → sqlite-migration-6k1ntnGk-B5TeEP_r.mjs} +3 -3
- package/dist/{sqlite-migration-CjMkH4Id-c6dM9w61.mjs.map → sqlite-migration-6k1ntnGk-B5TeEP_r.mjs.map} +1 -1
- package/dist/target.mjs +6 -6
- package/dist/target__control.mjs +1 -1
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__default-normalizer.mjs +1 -1
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__planner-produced-sqlite-migration.mjs +1 -1
- package/dist/target__planner.mjs +1 -1
- package/package.json +9 -9
- package/dist/op-factory-call-gc26GqyA-Db5Fasef.mjs.map +0 -1
- package/dist/planner-CuewJa-j-B7nPsjLN.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"target__control.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/control.mjs"],"sourcesContent":["import { n as sqliteError } from \"./errors-DnR-sMHS.mjs\";\nimport { t as sqliteTargetDescriptorMeta } from \"./descriptor-meta-BK9x2ZiD.mjs\";\nimport { a as verifySqliteDatabaseSchema, i as sqliteContractToSchema, n as createSqliteMigrationPlanner, r as diffSqliteSchema } from \"./planner-CuewJa-j.mjs\";\nimport { r as MARKER_TABLE_NAME } from \"./control-tables-D_o8dKRB.mjs\";\nimport { i as sqliteCreateNamespace, n as SqliteContractSerializer, r as SqliteUnboundDatabase } from \"./sqlite-contract-view-BYR10usg.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { SqlStorage } from \"@internal/sql-contract/types\";\nimport { relationalNodeEntityKind, relationalNodeGranularity } from \"@internal/sql-schema-ir/types\";\nimport { runnerFailure, runnerSuccess } from \"@internal/family-sql/control\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { notOk, ok, okVoid } from \"@internal/utils/result\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { SqlSchemaVerifierBase } from \"@internal/family-sql/ir\";\n//#region src/core/migrations/runner.ts\nfunction createSqliteMigrationRunner(family) {\n\treturn new SqliteMigrationRunner(family);\n}\nvar SqliteMigrationRunner = class {\n\tfamily;\n\tconstructor(family) {\n\t\tthis.family = family;\n\t}\n\t/**\n\t* Apply the plan against an already-open connection without managing\n\t* the transaction lifecycle. The caller ({@link SqliteMigrationRunner.execute})\n\t* owns BEGIN/COMMIT/ROLLBACK and any connection-level setup (FK pragma\n\t* toggle, FK integrity check).\n\t*/\n\tasync executeOnConnection(options) {\n\t\tconst driver = options.driver;\n\t\tif (options.space !== void 0 && options.space !== options.plan.spaceId) throw sqliteError(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", `SqlMigrationRunner: options.space (${options.space}) does not match plan.spaceId (${options.plan.spaceId})`, { meta: {\n\t\t\tspace: options.space,\n\t\t\tplanSpaceId: options.plan.spaceId\n\t\t} });\n\t\tconst space = options.plan.spaceId;\n\t\tconst planOps = blindCast(await Promise.all(options.plan.operations));\n\t\tconst destinationCheck = this.ensurePlanMatchesDestinationContract(options.plan.destination, options.destinationContract);\n\t\tif (!destinationCheck.ok) return destinationCheck;\n\t\tconst policyCheck = this.enforcePolicyCompatibility(options.policy, planOps);\n\t\tif (!policyCheck.ok) return policyCheck;\n\t\tconst ensureResult = await this.ensureControlTables(driver, options.destinationContract);\n\t\tif (!ensureResult.ok) return ensureResult;\n\t\tconst existingMarker = await this.family.readMarker({\n\t\t\tdriver,\n\t\t\tspace\n\t\t});\n\t\tconst markerCheck = this.ensureMarkerCompatibility(existingMarker, options.plan);\n\t\tif (!markerCheck.ok) return markerCheck;\n\t\tconst markerAtDestination = this.markerMatchesDestination(existingMarker, options.plan);\n\t\tconst isSelfEdge = options.plan.origin?.storageHash === options.plan.destination.storageHash;\n\t\tconst skipOperations = markerAtDestination && options.plan.origin != null && !isSelfEdge;\n\t\tlet operationsExecuted;\n\t\tlet executedOperations;\n\t\tif (skipOperations) {\n\t\t\toperationsExecuted = 0;\n\t\t\texecutedOperations = [];\n\t\t} else {\n\t\t\tconst applyResult = await this.applyPlan(driver, options, planOps);\n\t\t\tif (!applyResult.ok) return applyResult;\n\t\t\toperationsExecuted = applyResult.value.operationsExecuted;\n\t\t\texecutedOperations = applyResult.value.executedOperations;\n\t\t}\n\t\tif (space === APP_SPACE_ID) {\n\t\t\tconst schemaNode = await this.family.introspect({\n\t\t\t\tdriver,\n\t\t\t\tcontract: options.destinationContract\n\t\t\t});\n\t\t\tconst schemaVerifyResult = verifySqliteDatabaseSchema({\n\t\t\t\tcontract: options.destinationContract,\n\t\t\t\tactualSchema: schemaNode,\n\t\t\t\tstrict: options.strictVerification ?? true,\n\t\t\t\ttypeMetadataRegistry: this.family.typeMetadataRegistry,\n\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t});\n\t\t\tif (!schemaVerifyResult.ok) return runnerFailure(\"MIGRATION.SCHEMA_VERIFY_FAILED\", schemaVerifyResult.summary, {\n\t\t\t\twhy: \"The resulting database schema does not satisfy the destination contract.\",\n\t\t\t\tmeta: { issues: schemaVerifyResult.schema.issues }\n\t\t\t});\n\t\t}\n\t\tconst incomingInvariants = options.plan.providedInvariants;\n\t\tconst existingInvariants = new Set(existingMarker?.invariants ?? []);\n\t\tconst incomingIsSubsetOfExisting = incomingInvariants.every((id) => existingInvariants.has(id));\n\t\tif (!(isSelfEdge && operationsExecuted === 0 && incomingIsSubsetOfExisting)) {\n\t\t\tconst markerResult = await this.upsertMarker(driver, options, existingMarker, space);\n\t\t\tif (!markerResult.ok) return markerResult;\n\t\t\tawait this.recordLedgerEntries(driver, options, executedOperations);\n\t\t}\n\t\treturn runnerSuccess({\n\t\t\toperationsPlanned: planOps.length,\n\t\t\toperationsExecuted\n\t\t});\n\t}\n\tasync execute(options) {\n\t\tconst driver = options.driver;\n\t\tconst perSpaceOptions = options.perSpaceOptions;\n\t\tif (perSpaceOptions.length === 0) return ok({ perSpaceResults: [] });\n\t\tconst fkWasEnabled = await this.readForeignKeysEnabled(driver);\n\t\tif (fkWasEnabled) await driver.query(\"PRAGMA foreign_keys = OFF\");\n\t\ttry {\n\t\t\tawait this.beginExclusiveTransaction(driver);\n\t\t\tlet committed = false;\n\t\t\ttry {\n\t\t\t\tconst perSpaceResults = [];\n\t\t\t\tlet lastProcessedSpace;\n\t\t\t\tfor (const spaceOptions of perSpaceOptions) {\n\t\t\t\t\tconst space = spaceOptions.space ?? spaceOptions.plan.spaceId;\n\t\t\t\t\tconst result = await this.executeOnConnection({\n\t\t\t\t\t\t...spaceOptions,\n\t\t\t\t\t\tdriver,\n\t\t\t\t\t\tspace\n\t\t\t\t\t});\n\t\t\t\t\tif (!result.ok) return notOk({\n\t\t\t\t\t\t...result.failure,\n\t\t\t\t\t\tfailingSpace: space\n\t\t\t\t\t});\n\t\t\t\t\tperSpaceResults.push({\n\t\t\t\t\t\tspace,\n\t\t\t\t\t\tvalue: result.value\n\t\t\t\t\t});\n\t\t\t\t\tlastProcessedSpace = space;\n\t\t\t\t}\n\t\t\t\tif (fkWasEnabled) {\n\t\t\t\t\tconst fkIntegrityCheck = await this.verifyForeignKeyIntegrity(driver);\n\t\t\t\t\tif (!fkIntegrityCheck.ok) return notOk({\n\t\t\t\t\t\t...fkIntegrityCheck.failure,\n\t\t\t\t\t\tfailingSpace: lastProcessedSpace ?? APP_SPACE_ID\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tawait this.commitTransaction(driver);\n\t\t\t\tcommitted = true;\n\t\t\t\treturn ok({ perSpaceResults });\n\t\t\t} finally {\n\t\t\t\tif (!committed) await this.rollbackTransaction(driver);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (fkWasEnabled) await driver.query(\"PRAGMA foreign_keys = ON\");\n\t\t}\n\t}\n\tasync readForeignKeysEnabled(driver) {\n\t\treturn (await driver.query(\"PRAGMA foreign_keys\")).rows[0]?.foreign_keys === 1;\n\t}\n\tasync verifyForeignKeyIntegrity(driver) {\n\t\tconst result = await driver.query(\"PRAGMA foreign_key_check\");\n\t\tif (result.rows.length === 0) return okVoid();\n\t\treturn runnerFailure(\"MIGRATION.FOREIGN_KEY_VIOLATION\", `Foreign key integrity check failed after migration: ${result.rows.length} violation(s).`, {\n\t\t\twhy: \"PRAGMA foreign_key_check reported violations after applying recreate-table operations.\",\n\t\t\tmeta: { violations: result.rows }\n\t\t});\n\t}\n\tasync applyPlan(driver, options, ops) {\n\t\tconst checks = options.executionChecks;\n\t\tconst runPrechecks = checks?.prechecks !== false;\n\t\tconst runPostchecks = checks?.postchecks !== false;\n\t\tconst runIdempotency = checks?.idempotencyChecks !== false;\n\t\tlet operationsExecuted = 0;\n\t\tconst executedOperations = [];\n\t\tfor (const operation of ops) {\n\t\t\toptions.callbacks?.onOperationStart?.(operation);\n\t\t\ttry {\n\t\t\t\tif (runPostchecks && runIdempotency) {\n\t\t\t\t\tif (await this.expectationsAreSatisfied(driver, operation.postcheck)) {\n\t\t\t\t\t\texecutedOperations.push(this.createSkipRecord(operation));\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (runPrechecks) {\n\t\t\t\t\tconst precheckResult = await this.runExpectationSteps(driver, operation.precheck, operation, \"precheck\");\n\t\t\t\t\tif (!precheckResult.ok) return precheckResult;\n\t\t\t\t}\n\t\t\t\tconst executeResult = await this.runExecuteSteps(driver, operation.execute, operation);\n\t\t\t\tif (!executeResult.ok) return executeResult;\n\t\t\t\tif (runPostchecks) {\n\t\t\t\t\tconst postcheckResult = await this.runExpectationSteps(driver, operation.postcheck, operation, \"postcheck\");\n\t\t\t\t\tif (!postcheckResult.ok) return postcheckResult;\n\t\t\t\t}\n\t\t\t\texecutedOperations.push(operation);\n\t\t\t\toperationsExecuted += 1;\n\t\t\t} finally {\n\t\t\t\toptions.callbacks?.onOperationComplete?.(operation);\n\t\t\t}\n\t\t}\n\t\treturn ok({\n\t\t\toperationsExecuted,\n\t\t\texecutedOperations\n\t\t});\n\t}\n\tasync ensureControlTables(driver, contract) {\n\t\tconst legacyDetection = await this.detectLegacyMarkerShape(driver);\n\t\tif (!legacyDetection.ok) return legacyDetection;\n\t\tconst lowererContext = { contract };\n\t\tfor (const query of this.family.bootstrapControlTableQueries()) await this.executeStatement(driver, await this.family.lowerAst(query, lowererContext));\n\t\treturn okVoid();\n\t}\n\tasync detectLegacyMarkerShape(driver) {\n\t\tconst tableInfo = await driver.query(`PRAGMA table_info(\"${MARKER_TABLE_NAME}\")`);\n\t\tif (tableInfo.rows.length === 0) return okVoid();\n\t\tconst columns = new Set(tableInfo.rows.map((row) => row.name));\n\t\tif (columns.has(\"space\")) return okVoid();\n\t\treturn runnerFailure(\"MIGRATION.LEGACY_MARKER_SHAPE\", `Legacy marker-table shape detected on ${MARKER_TABLE_NAME} (no \\`space\\` column). Prisma 8 is in pre-1.0; the previous transitional auto-migration to the per-space-row schema has been removed. Drop \\`${MARKER_TABLE_NAME}\\` and re-run \\`dbInit\\` to reinitialise from a clean baseline.`, { meta: {\n\t\t\ttable: MARKER_TABLE_NAME,\n\t\t\tcolumns: [...columns].sort()\n\t\t} });\n\t}\n\tasync runExpectationSteps(driver, steps, operation, phase) {\n\t\tfor (const step of steps) {\n\t\t\tconst result = await driver.query(step.sql, step.params ?? []);\n\t\t\tif (!this.stepResultIsTrue(result.rows)) return runnerFailure(phase === \"precheck\" ? \"MIGRATION.PRECHECK_FAILED\" : \"MIGRATION.POSTCHECK_FAILED\", `Operation ${operation.id} failed during ${phase}: ${step.description}`, { meta: {\n\t\t\t\toperationId: operation.id,\n\t\t\t\tphase,\n\t\t\t\tstepDescription: step.description\n\t\t\t} });\n\t\t}\n\t\treturn okVoid();\n\t}\n\tasync runExecuteSteps(driver, steps, operation) {\n\t\tfor (const step of steps) try {\n\t\t\tawait driver.query(step.sql, step.params ?? []);\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\treturn runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${operation.id} failed during execution: ${step.description}`, {\n\t\t\t\twhy: message,\n\t\t\t\tmeta: {\n\t\t\t\t\toperationId: operation.id,\n\t\t\t\t\tstepDescription: step.description,\n\t\t\t\t\tsql: step.sql\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn okVoid();\n\t}\n\tstepResultIsTrue(rows) {\n\t\tif (!rows || rows.length === 0) return false;\n\t\tconst firstRow = rows[0];\n\t\tconst firstValue = firstRow ? Object.values(firstRow)[0] : void 0;\n\t\tif (typeof firstValue === \"number\") return firstValue !== 0;\n\t\tif (typeof firstValue === \"boolean\") return firstValue;\n\t\tif (typeof firstValue === \"string\") {\n\t\t\tconst lower = firstValue.toLowerCase();\n\t\t\tif (lower === \"true\" || lower === \"1\") return true;\n\t\t\tif (lower === \"false\" || lower === \"0\") return false;\n\t\t\treturn firstValue.length > 0;\n\t\t}\n\t\treturn Boolean(firstValue);\n\t}\n\tasync expectationsAreSatisfied(driver, steps) {\n\t\tif (steps.length === 0) return false;\n\t\tfor (const step of steps) {\n\t\t\tconst result = await driver.query(step.sql, step.params ?? []);\n\t\t\tif (!this.stepResultIsTrue(result.rows)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tcreateSkipRecord(operation) {\n\t\treturn Object.freeze({\n\t\t\tid: operation.id,\n\t\t\tlabel: operation.label,\n\t\t\t...ifDefined(\"summary\", operation.summary),\n\t\t\toperationClass: operation.operationClass,\n\t\t\ttarget: operation.target,\n\t\t\tprecheck: Object.freeze([]),\n\t\t\texecute: Object.freeze([]),\n\t\t\tpostcheck: Object.freeze([...operation.postcheck]),\n\t\t\tmeta: Object.freeze({\n\t\t\t\t...operation.meta ?? {},\n\t\t\t\trunner: Object.freeze({\n\t\t\t\t\tskipped: true,\n\t\t\t\t\treason: \"postcheck_pre_satisfied\"\n\t\t\t\t})\n\t\t\t})\n\t\t});\n\t}\n\tmarkerMatchesDestination(marker, plan) {\n\t\tif (!marker) return false;\n\t\tif (marker.storageHash !== plan.destination.storageHash) return false;\n\t\tif (plan.destination.profileHash && marker.profileHash !== plan.destination.profileHash) return false;\n\t\treturn true;\n\t}\n\tenforcePolicyCompatibility(policy, operations) {\n\t\tconst allowedClasses = new Set(policy.allowedOperationClasses);\n\t\tfor (const operation of operations) if (!allowedClasses.has(operation.operationClass)) return runnerFailure(\"MIGRATION.POLICY_VIOLATION\", `Operation ${operation.id} has class \"${operation.operationClass}\" which is not allowed by policy.`, {\n\t\t\twhy: `Policy only allows: ${policy.allowedOperationClasses.join(\", \")}.`,\n\t\t\tmeta: {\n\t\t\t\toperationId: operation.id,\n\t\t\t\toperationClass: operation.operationClass,\n\t\t\t\tallowedClasses: policy.allowedOperationClasses\n\t\t\t}\n\t\t});\n\t\treturn okVoid();\n\t}\n\tensureMarkerCompatibility(marker, plan) {\n\t\tconst origin = plan.origin ?? null;\n\t\tif (!origin) return okVoid();\n\t\tif (!marker) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Missing contract marker: expected origin storage hash ${origin.storageHash}.`, { meta: { expectedOriginStorageHash: origin.storageHash } });\n\t\tif (marker.storageHash !== origin.storageHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker (${marker.storageHash}) does not match plan origin (${origin.storageHash}).`, { meta: {\n\t\t\tmarkerStorageHash: marker.storageHash,\n\t\t\texpectedOriginStorageHash: origin.storageHash\n\t\t} });\n\t\tif (origin.profileHash && marker.profileHash !== origin.profileHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker profile hash (${marker.profileHash}) does not match plan origin profile hash (${origin.profileHash}).`, { meta: {\n\t\t\tmarkerProfileHash: marker.profileHash,\n\t\t\texpectedOriginProfileHash: origin.profileHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tensurePlanMatchesDestinationContract(destination, contract) {\n\t\tif (destination.storageHash !== contract.storage.storageHash) return runnerFailure(\"MIGRATION.DESTINATION_CONTRACT_MISMATCH\", `Plan destination storage hash (${destination.storageHash}) does not match provided contract storage hash (${contract.storage.storageHash}).`, { meta: {\n\t\t\tplanStorageHash: destination.storageHash,\n\t\t\tcontractStorageHash: contract.storage.storageHash\n\t\t} });\n\t\tif (destination.profileHash && contract.profileHash && destination.profileHash !== contract.profileHash) return runnerFailure(\"MIGRATION.DESTINATION_CONTRACT_MISMATCH\", `Plan destination profile hash (${destination.profileHash}) does not match provided contract profile hash (${contract.profileHash}).`, { meta: {\n\t\t\tplanProfileHash: destination.profileHash,\n\t\t\tcontractProfileHash: contract.profileHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tasync upsertMarker(driver, options, existingMarker, space) {\n\t\tconst destination = {\n\t\t\tstorageHash: options.plan.destination.storageHash,\n\t\t\tprofileHash: options.plan.destination.profileHash ?? options.destinationContract.profileHash ?? options.plan.destination.storageHash,\n\t\t\tinvariants: options.plan.providedInvariants ?? []\n\t\t};\n\t\tif (!existingMarker) {\n\t\t\tawait this.family.initMarker({\n\t\t\t\tdriver,\n\t\t\t\tspace,\n\t\t\t\tdestination\n\t\t\t});\n\t\t\treturn okVoid();\n\t\t}\n\t\tif (!await this.family.updateMarker({\n\t\t\tdriver,\n\t\t\tspace,\n\t\t\texpectedFrom: existingMarker.storageHash,\n\t\t\tdestination\n\t\t})) return runnerFailure(\"MIGRATION.MARKER_CAS_FAILURE\", \"Marker was modified by another process during migration execution.\", { meta: {\n\t\t\tspace,\n\t\t\texpectedStorageHash: existingMarker.storageHash,\n\t\t\tdestinationStorageHash: options.plan.destination.storageHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tasync recordLedgerEntries(driver, options, executedOperations) {\n\t\tconst plan = options.plan;\n\t\tconst space = plan.spaceId;\n\t\tconst edges = options.migrationEdges;\n\t\tconst totalEdgeOps = edges.reduce((sum, edge) => sum + edge.operationCount, 0);\n\t\tif (totalEdgeOps !== plan.operations.length) throw new InternalError(`Ledger write: plan.operations length (${plan.operations.length}) does not match sum of migrationEdges operationCount (${totalEdgeOps})`);\n\t\tlet offset = 0;\n\t\tfor (const edge of edges) {\n\t\t\tconst edgeOps = executedOperations.slice(offset, offset + edge.operationCount);\n\t\t\toffset += edge.operationCount;\n\t\t\tawait this.family.writeLedgerEntry({\n\t\t\t\tdriver,\n\t\t\t\tspace,\n\t\t\t\tentry: {\n\t\t\t\t\tedgeId: `${edge.from}->${edge.to}`,\n\t\t\t\t\tfrom: edge.from,\n\t\t\t\t\tto: edge.to,\n\t\t\t\t\tmigrationName: edge.dirName,\n\t\t\t\t\tmigrationHash: edge.migrationHash,\n\t\t\t\t\toperations: edgeOps\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tasync beginExclusiveTransaction(driver) {\n\t\tawait driver.query(\"BEGIN EXCLUSIVE\");\n\t}\n\tasync commitTransaction(driver) {\n\t\tawait driver.query(\"COMMIT\");\n\t}\n\tasync rollbackTransaction(driver) {\n\t\tawait driver.query(\"ROLLBACK\");\n\t}\n\tasync executeStatement(driver, statement) {\n\t\tawait driver.query(statement.sql, statement.params);\n\t}\n};\n//#endregion\n//#region src/core/sqlite-schema-verifier.ts\n/**\n* SQLite target `SchemaVerifier` concretion. Mirrors the Postgres\n* shape: hooks return the empty list pending the call-site migration\n* that routes the existing verifier behaviour through the SPI.\n*/\nvar SqliteSchemaVerifier = class extends SqlSchemaVerifierBase {\n\tverifyCommonSqlSchema(_options) {\n\t\treturn [];\n\t}\n\tverifyTargetExtensions(_options) {\n\t\treturn [];\n\t}\n};\n//#endregion\n//#region src/core/control-target.ts\nfunction isSqlContract(contract) {\n\treturn contract === null || contract.storage instanceof SqlStorage;\n}\nconst sqliteControlTargetDescriptor = {\n\t...sqliteTargetDescriptorMeta,\n\tcontractSerializer: new SqliteContractSerializer(),\n\tschemaVerifier: new SqliteSchemaVerifier(),\n\tdiffSchema(input) {\n\t\treturn diffSqliteSchema(input);\n\t},\n\tclassifySubjectGranularity: relationalNodeGranularity,\n\tclassifyEntityKind: relationalNodeEntityKind,\n\tmigrations: {\n\t\tcreatePlanner(adapter) {\n\t\t\treturn createSqliteMigrationPlanner(adapter);\n\t\t},\n\t\tcreateRunner(family) {\n\t\t\treturn createSqliteMigrationRunner(family);\n\t\t},\n\t\tcontractToSchema(contract, _frameworkComponents) {\n\t\t\tif (!isSqlContract(contract)) throw sqliteError(\"CONTRACT.TARGET_MISMATCH\", \"sqliteControlTargetDescriptor.contractToSchema received a non-SQL contract; expected Contract<SqlStorage>\");\n\t\t\treturn sqliteContractToSchema(contract);\n\t\t}\n\t},\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"sqlite\"\n\t\t};\n\t},\n\tcreatePlanner(adapter) {\n\t\treturn createSqliteMigrationPlanner(adapter);\n\t},\n\tcreateRunner(family) {\n\t\treturn createSqliteMigrationRunner(family);\n\t}\n};\n//#endregion\nexport { SqliteUnboundDatabase, sqliteControlTargetDescriptor as default, sqliteCreateNamespace };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,4BAA4B,QAAQ;CAC5C,OAAO,IAAI,sBAAsB,MAAM;AACxC;AACA,IAAI,wBAAwB,MAAM;CACjC;CACA,YAAY,QAAQ;EACnB,KAAK,SAAS;CACf;;;;;;;CAOA,MAAM,oBAAoB,SAAS;EAClC,MAAM,SAAS,QAAQ;EACvB,IAAI,QAAQ,UAAU,KAAK,KAAK,QAAQ,UAAU,QAAQ,KAAK,SAAS,MAAM,YAAY,sCAAsC,sCAAsC,QAAQ,MAAM,iCAAiC,QAAQ,KAAK,QAAQ,IAAI,EAAE,MAAM;GACrP,OAAO,QAAQ;GACf,aAAa,QAAQ,KAAK;EAC3B,EAAE,CAAC;EACH,MAAM,QAAQ,QAAQ,KAAK;EAC3B,MAAM,UAAU,UAAU,MAAM,QAAQ,IAAI,QAAQ,KAAK,UAAU,CAAC;EACpE,MAAM,mBAAmB,KAAK,qCAAqC,QAAQ,KAAK,aAAa,QAAQ,mBAAmB;EACxH,IAAI,CAAC,iBAAiB,IAAI,O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Q,SAAS,mBAAmB;AACzD;AACA,MAAM,gCAAgC;CACrC,GAAG;CACH,oBAAoB,IAAI,yBAAyB;CACjD,gBAAgB,IAAI,qBAAqB;CACzC,WAAW,OAAO;EACjB,OAAO,iBAAiB,KAAK;CAC9B;CACA,4BAA4B;CAC5B,oBAAoB;CACpB,YAAY;EACX,cAAc,SAAS;GACtB,OAAO,6BAA6B,OAAO;EAC5C;EACA,aAAa,QAAQ;GACpB,OAAO,4BAA4B,MAAM;EAC1C;EACA,iBAAiB,UAAU,sBAAsB;GAChD,IAAI,CAAC,cAAc,QAAQ,GAAG,MAAM,YAAY,4BAA4B,2GAA2G;GACvL,OAAO,uBAAuB,QAAQ;EACvC;CACD;CACA,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;CACA,cAAc,SAAS;EACtB,OAAO,6BAA6B,OAAO;CAC5C;CACA,aAAa,QAAQ;EACpB,OAAO,4BAA4B,MAAM;CAC1C;AACD"}
|
|
1
|
+
{"version":3,"file":"target__control.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/control.mjs"],"sourcesContent":["import { n as sqliteError } from \"./errors-DnR-sMHS.mjs\";\nimport { t as sqliteTargetDescriptorMeta } from \"./descriptor-meta-BK9x2ZiD.mjs\";\nimport { a as verifySqliteDatabaseSchema, i as sqliteContractToSchema, n as createSqliteMigrationPlanner, r as diffSqliteSchema } from \"./planner-Btyty0VZ.mjs\";\nimport { r as MARKER_TABLE_NAME } from \"./control-tables-D_o8dKRB.mjs\";\nimport { i as sqliteCreateNamespace, n as SqliteContractSerializer, r as SqliteUnboundDatabase } from \"./sqlite-contract-view-BYR10usg.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { SqlStorage } from \"@internal/sql-contract/types\";\nimport { relationalNodeEntityKind, relationalNodeGranularity } from \"@internal/sql-schema-ir/types\";\nimport { runnerFailure, runnerSuccess } from \"@internal/family-sql/control\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { notOk, ok, okVoid } from \"@internal/utils/result\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { SqlSchemaVerifierBase } from \"@internal/family-sql/ir\";\n//#region src/core/migrations/runner.ts\nfunction createSqliteMigrationRunner(family) {\n\treturn new SqliteMigrationRunner(family);\n}\nvar SqliteMigrationRunner = class {\n\tfamily;\n\tconstructor(family) {\n\t\tthis.family = family;\n\t}\n\t/**\n\t* Apply the plan against an already-open connection without managing\n\t* the transaction lifecycle. The caller ({@link SqliteMigrationRunner.execute})\n\t* owns BEGIN/COMMIT/ROLLBACK and any connection-level setup (FK pragma\n\t* toggle, FK integrity check).\n\t*/\n\tasync executeOnConnection(options) {\n\t\tconst driver = options.driver;\n\t\tif (options.space !== void 0 && options.space !== options.plan.spaceId) throw sqliteError(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", `SqlMigrationRunner: options.space (${options.space}) does not match plan.spaceId (${options.plan.spaceId})`, { meta: {\n\t\t\tspace: options.space,\n\t\t\tplanSpaceId: options.plan.spaceId\n\t\t} });\n\t\tconst space = options.plan.spaceId;\n\t\tconst planOps = blindCast(await Promise.all(options.plan.operations));\n\t\tconst destinationCheck = this.ensurePlanMatchesDestinationContract(options.plan.destination, options.destinationContract);\n\t\tif (!destinationCheck.ok) return destinationCheck;\n\t\tconst policyCheck = this.enforcePolicyCompatibility(options.policy, planOps);\n\t\tif (!policyCheck.ok) return policyCheck;\n\t\tconst ensureResult = await this.ensureControlTables(driver, options.destinationContract);\n\t\tif (!ensureResult.ok) return ensureResult;\n\t\tconst existingMarker = await this.family.readMarker({\n\t\t\tdriver,\n\t\t\tspace\n\t\t});\n\t\tconst markerCheck = this.ensureMarkerCompatibility(existingMarker, options.plan);\n\t\tif (!markerCheck.ok) return markerCheck;\n\t\tconst markerAtDestination = this.markerMatchesDestination(existingMarker, options.plan);\n\t\tconst isSelfEdge = options.plan.origin?.storageHash === options.plan.destination.storageHash;\n\t\tconst skipOperations = markerAtDestination && options.plan.origin != null && !isSelfEdge;\n\t\tlet operationsExecuted;\n\t\tlet executedOperations;\n\t\tif (skipOperations) {\n\t\t\toperationsExecuted = 0;\n\t\t\texecutedOperations = [];\n\t\t} else {\n\t\t\tconst applyResult = await this.applyPlan(driver, options, planOps);\n\t\t\tif (!applyResult.ok) return applyResult;\n\t\t\toperationsExecuted = applyResult.value.operationsExecuted;\n\t\t\texecutedOperations = applyResult.value.executedOperations;\n\t\t}\n\t\tif (space === APP_SPACE_ID) {\n\t\t\tconst schemaNode = await this.family.introspect({\n\t\t\t\tdriver,\n\t\t\t\tcontract: options.destinationContract\n\t\t\t});\n\t\t\tconst schemaVerifyResult = verifySqliteDatabaseSchema({\n\t\t\t\tcontract: options.destinationContract,\n\t\t\t\tactualSchema: schemaNode,\n\t\t\t\tstrict: options.strictVerification ?? true,\n\t\t\t\ttypeMetadataRegistry: this.family.typeMetadataRegistry,\n\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t});\n\t\t\tif (!schemaVerifyResult.ok) return runnerFailure(\"MIGRATION.SCHEMA_VERIFY_FAILED\", schemaVerifyResult.summary, {\n\t\t\t\twhy: \"The resulting database schema does not satisfy the destination contract.\",\n\t\t\t\tmeta: { issues: schemaVerifyResult.schema.issues }\n\t\t\t});\n\t\t}\n\t\tconst incomingInvariants = options.plan.providedInvariants;\n\t\tconst existingInvariants = new Set(existingMarker?.invariants ?? []);\n\t\tconst incomingIsSubsetOfExisting = incomingInvariants.every((id) => existingInvariants.has(id));\n\t\tif (!(isSelfEdge && operationsExecuted === 0 && incomingIsSubsetOfExisting)) {\n\t\t\tconst markerResult = await this.upsertMarker(driver, options, existingMarker, space);\n\t\t\tif (!markerResult.ok) return markerResult;\n\t\t\tawait this.recordLedgerEntries(driver, options, executedOperations);\n\t\t}\n\t\treturn runnerSuccess({\n\t\t\toperationsPlanned: planOps.length,\n\t\t\toperationsExecuted\n\t\t});\n\t}\n\tasync execute(options) {\n\t\tconst driver = options.driver;\n\t\tconst perSpaceOptions = options.perSpaceOptions;\n\t\tif (perSpaceOptions.length === 0) return ok({ perSpaceResults: [] });\n\t\tconst fkWasEnabled = await this.readForeignKeysEnabled(driver);\n\t\tif (fkWasEnabled) await driver.query(\"PRAGMA foreign_keys = OFF\");\n\t\ttry {\n\t\t\tawait this.beginExclusiveTransaction(driver);\n\t\t\tlet committed = false;\n\t\t\ttry {\n\t\t\t\tconst perSpaceResults = [];\n\t\t\t\tlet lastProcessedSpace;\n\t\t\t\tfor (const spaceOptions of perSpaceOptions) {\n\t\t\t\t\tconst space = spaceOptions.space ?? spaceOptions.plan.spaceId;\n\t\t\t\t\tconst result = await this.executeOnConnection({\n\t\t\t\t\t\t...spaceOptions,\n\t\t\t\t\t\tdriver,\n\t\t\t\t\t\tspace\n\t\t\t\t\t});\n\t\t\t\t\tif (!result.ok) return notOk({\n\t\t\t\t\t\t...result.failure,\n\t\t\t\t\t\tfailingSpace: space\n\t\t\t\t\t});\n\t\t\t\t\tperSpaceResults.push({\n\t\t\t\t\t\tspace,\n\t\t\t\t\t\tvalue: result.value\n\t\t\t\t\t});\n\t\t\t\t\tlastProcessedSpace = space;\n\t\t\t\t}\n\t\t\t\tif (fkWasEnabled) {\n\t\t\t\t\tconst fkIntegrityCheck = await this.verifyForeignKeyIntegrity(driver);\n\t\t\t\t\tif (!fkIntegrityCheck.ok) return notOk({\n\t\t\t\t\t\t...fkIntegrityCheck.failure,\n\t\t\t\t\t\tfailingSpace: lastProcessedSpace ?? APP_SPACE_ID\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tawait this.commitTransaction(driver);\n\t\t\t\tcommitted = true;\n\t\t\t\treturn ok({ perSpaceResults });\n\t\t\t} finally {\n\t\t\t\tif (!committed) await this.rollbackTransaction(driver);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (fkWasEnabled) await driver.query(\"PRAGMA foreign_keys = ON\");\n\t\t}\n\t}\n\tasync readForeignKeysEnabled(driver) {\n\t\treturn (await driver.query(\"PRAGMA foreign_keys\")).rows[0]?.foreign_keys === 1;\n\t}\n\tasync verifyForeignKeyIntegrity(driver) {\n\t\tconst result = await driver.query(\"PRAGMA foreign_key_check\");\n\t\tif (result.rows.length === 0) return okVoid();\n\t\treturn runnerFailure(\"MIGRATION.FOREIGN_KEY_VIOLATION\", `Foreign key integrity check failed after migration: ${result.rows.length} violation(s).`, {\n\t\t\twhy: \"PRAGMA foreign_key_check reported violations after applying recreate-table operations.\",\n\t\t\tmeta: { violations: result.rows }\n\t\t});\n\t}\n\tasync applyPlan(driver, options, ops) {\n\t\tconst checks = options.executionChecks;\n\t\tconst runPrechecks = checks?.prechecks !== false;\n\t\tconst runPostchecks = checks?.postchecks !== false;\n\t\tconst runIdempotency = checks?.idempotencyChecks !== false;\n\t\tlet operationsExecuted = 0;\n\t\tconst executedOperations = [];\n\t\tfor (const operation of ops) {\n\t\t\toptions.callbacks?.onOperationStart?.(operation);\n\t\t\ttry {\n\t\t\t\tif (runPostchecks && runIdempotency) {\n\t\t\t\t\tif (await this.expectationsAreSatisfied(driver, operation.postcheck)) {\n\t\t\t\t\t\texecutedOperations.push(this.createSkipRecord(operation));\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (runPrechecks) {\n\t\t\t\t\tconst precheckResult = await this.runExpectationSteps(driver, operation.precheck, operation, \"precheck\");\n\t\t\t\t\tif (!precheckResult.ok) return precheckResult;\n\t\t\t\t}\n\t\t\t\tconst executeResult = await this.runExecuteSteps(driver, operation.execute, operation);\n\t\t\t\tif (!executeResult.ok) return executeResult;\n\t\t\t\tif (runPostchecks) {\n\t\t\t\t\tconst postcheckResult = await this.runExpectationSteps(driver, operation.postcheck, operation, \"postcheck\");\n\t\t\t\t\tif (!postcheckResult.ok) return postcheckResult;\n\t\t\t\t}\n\t\t\t\texecutedOperations.push(operation);\n\t\t\t\toperationsExecuted += 1;\n\t\t\t} finally {\n\t\t\t\toptions.callbacks?.onOperationComplete?.(operation);\n\t\t\t}\n\t\t}\n\t\treturn ok({\n\t\t\toperationsExecuted,\n\t\t\texecutedOperations\n\t\t});\n\t}\n\tasync ensureControlTables(driver, contract) {\n\t\tconst legacyDetection = await this.detectLegacyMarkerShape(driver);\n\t\tif (!legacyDetection.ok) return legacyDetection;\n\t\tconst lowererContext = { contract };\n\t\tfor (const query of this.family.bootstrapControlTableQueries()) await this.executeStatement(driver, await this.family.lowerAst(query, lowererContext));\n\t\treturn okVoid();\n\t}\n\tasync detectLegacyMarkerShape(driver) {\n\t\tconst tableInfo = await driver.query(`PRAGMA table_info(\"${MARKER_TABLE_NAME}\")`);\n\t\tif (tableInfo.rows.length === 0) return okVoid();\n\t\tconst columns = new Set(tableInfo.rows.map((row) => row.name));\n\t\tif (columns.has(\"space\")) return okVoid();\n\t\treturn runnerFailure(\"MIGRATION.LEGACY_MARKER_SHAPE\", `Legacy marker-table shape detected on ${MARKER_TABLE_NAME} (no \\`space\\` column). Prisma 8 is in pre-1.0; the previous transitional auto-migration to the per-space-row schema has been removed. Drop \\`${MARKER_TABLE_NAME}\\` and re-run \\`dbInit\\` to reinitialise from a clean baseline.`, { meta: {\n\t\t\ttable: MARKER_TABLE_NAME,\n\t\t\tcolumns: [...columns].sort()\n\t\t} });\n\t}\n\tasync runExpectationSteps(driver, steps, operation, phase) {\n\t\tfor (const step of steps) {\n\t\t\tconst result = await driver.query(step.sql, step.params ?? []);\n\t\t\tif (!this.stepResultIsTrue(result.rows)) return runnerFailure(phase === \"precheck\" ? \"MIGRATION.PRECHECK_FAILED\" : \"MIGRATION.POSTCHECK_FAILED\", `Operation ${operation.id} failed during ${phase}: ${step.description}`, { meta: {\n\t\t\t\toperationId: operation.id,\n\t\t\t\tphase,\n\t\t\t\tstepDescription: step.description\n\t\t\t} });\n\t\t}\n\t\treturn okVoid();\n\t}\n\tasync runExecuteSteps(driver, steps, operation) {\n\t\tfor (const step of steps) try {\n\t\t\tawait driver.query(step.sql, step.params ?? []);\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\treturn runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${operation.id} failed during execution: ${step.description}`, {\n\t\t\t\twhy: message,\n\t\t\t\tmeta: {\n\t\t\t\t\toperationId: operation.id,\n\t\t\t\t\tstepDescription: step.description,\n\t\t\t\t\tsql: step.sql\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn okVoid();\n\t}\n\tstepResultIsTrue(rows) {\n\t\tif (!rows || rows.length === 0) return false;\n\t\tconst firstRow = rows[0];\n\t\tconst firstValue = firstRow ? Object.values(firstRow)[0] : void 0;\n\t\tif (typeof firstValue === \"number\") return firstValue !== 0;\n\t\tif (typeof firstValue === \"boolean\") return firstValue;\n\t\tif (typeof firstValue === \"string\") {\n\t\t\tconst lower = firstValue.toLowerCase();\n\t\t\tif (lower === \"true\" || lower === \"1\") return true;\n\t\t\tif (lower === \"false\" || lower === \"0\") return false;\n\t\t\treturn firstValue.length > 0;\n\t\t}\n\t\treturn Boolean(firstValue);\n\t}\n\tasync expectationsAreSatisfied(driver, steps) {\n\t\tif (steps.length === 0) return false;\n\t\tfor (const step of steps) {\n\t\t\tconst result = await driver.query(step.sql, step.params ?? []);\n\t\t\tif (!this.stepResultIsTrue(result.rows)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tcreateSkipRecord(operation) {\n\t\treturn Object.freeze({\n\t\t\tid: operation.id,\n\t\t\tlabel: operation.label,\n\t\t\t...ifDefined(\"summary\", operation.summary),\n\t\t\toperationClass: operation.operationClass,\n\t\t\ttarget: operation.target,\n\t\t\tprecheck: Object.freeze([]),\n\t\t\texecute: Object.freeze([]),\n\t\t\tpostcheck: Object.freeze([...operation.postcheck]),\n\t\t\tmeta: Object.freeze({\n\t\t\t\t...operation.meta ?? {},\n\t\t\t\trunner: Object.freeze({\n\t\t\t\t\tskipped: true,\n\t\t\t\t\treason: \"postcheck_pre_satisfied\"\n\t\t\t\t})\n\t\t\t})\n\t\t});\n\t}\n\tmarkerMatchesDestination(marker, plan) {\n\t\tif (!marker) return false;\n\t\tif (marker.storageHash !== plan.destination.storageHash) return false;\n\t\tif (plan.destination.profileHash && marker.profileHash !== plan.destination.profileHash) return false;\n\t\treturn true;\n\t}\n\tenforcePolicyCompatibility(policy, operations) {\n\t\tconst allowedClasses = new Set(policy.allowedOperationClasses);\n\t\tfor (const operation of operations) if (!allowedClasses.has(operation.operationClass)) return runnerFailure(\"MIGRATION.POLICY_VIOLATION\", `Operation ${operation.id} has class \"${operation.operationClass}\" which is not allowed by policy.`, {\n\t\t\twhy: `Policy only allows: ${policy.allowedOperationClasses.join(\", \")}.`,\n\t\t\tmeta: {\n\t\t\t\toperationId: operation.id,\n\t\t\t\toperationClass: operation.operationClass,\n\t\t\t\tallowedClasses: policy.allowedOperationClasses\n\t\t\t}\n\t\t});\n\t\treturn okVoid();\n\t}\n\tensureMarkerCompatibility(marker, plan) {\n\t\tconst origin = plan.origin ?? null;\n\t\tif (!origin) return okVoid();\n\t\tif (!marker) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Missing contract marker: expected origin storage hash ${origin.storageHash}.`, { meta: { expectedOriginStorageHash: origin.storageHash } });\n\t\tif (marker.storageHash !== origin.storageHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker (${marker.storageHash}) does not match plan origin (${origin.storageHash}).`, { meta: {\n\t\t\tmarkerStorageHash: marker.storageHash,\n\t\t\texpectedOriginStorageHash: origin.storageHash\n\t\t} });\n\t\tif (origin.profileHash && marker.profileHash !== origin.profileHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker profile hash (${marker.profileHash}) does not match plan origin profile hash (${origin.profileHash}).`, { meta: {\n\t\t\tmarkerProfileHash: marker.profileHash,\n\t\t\texpectedOriginProfileHash: origin.profileHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tensurePlanMatchesDestinationContract(destination, contract) {\n\t\tif (destination.storageHash !== contract.storage.storageHash) return runnerFailure(\"MIGRATION.DESTINATION_CONTRACT_MISMATCH\", `Plan destination storage hash (${destination.storageHash}) does not match provided contract storage hash (${contract.storage.storageHash}).`, { meta: {\n\t\t\tplanStorageHash: destination.storageHash,\n\t\t\tcontractStorageHash: contract.storage.storageHash\n\t\t} });\n\t\tif (destination.profileHash && contract.profileHash && destination.profileHash !== contract.profileHash) return runnerFailure(\"MIGRATION.DESTINATION_CONTRACT_MISMATCH\", `Plan destination profile hash (${destination.profileHash}) does not match provided contract profile hash (${contract.profileHash}).`, { meta: {\n\t\t\tplanProfileHash: destination.profileHash,\n\t\t\tcontractProfileHash: contract.profileHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tasync upsertMarker(driver, options, existingMarker, space) {\n\t\tconst destination = {\n\t\t\tstorageHash: options.plan.destination.storageHash,\n\t\t\tprofileHash: options.plan.destination.profileHash ?? options.destinationContract.profileHash ?? options.plan.destination.storageHash,\n\t\t\tinvariants: options.plan.providedInvariants ?? []\n\t\t};\n\t\tif (!existingMarker) {\n\t\t\tawait this.family.initMarker({\n\t\t\t\tdriver,\n\t\t\t\tspace,\n\t\t\t\tdestination\n\t\t\t});\n\t\t\treturn okVoid();\n\t\t}\n\t\tif (!await this.family.updateMarker({\n\t\t\tdriver,\n\t\t\tspace,\n\t\t\texpectedFrom: existingMarker.storageHash,\n\t\t\tdestination\n\t\t})) return runnerFailure(\"MIGRATION.MARKER_CAS_FAILURE\", \"Marker was modified by another process during migration execution.\", { meta: {\n\t\t\tspace,\n\t\t\texpectedStorageHash: existingMarker.storageHash,\n\t\t\tdestinationStorageHash: options.plan.destination.storageHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tasync recordLedgerEntries(driver, options, executedOperations) {\n\t\tconst plan = options.plan;\n\t\tconst space = plan.spaceId;\n\t\tconst edges = options.migrationEdges;\n\t\tconst totalEdgeOps = edges.reduce((sum, edge) => sum + edge.operationCount, 0);\n\t\tif (totalEdgeOps !== plan.operations.length) throw new InternalError(`Ledger write: plan.operations length (${plan.operations.length}) does not match sum of migrationEdges operationCount (${totalEdgeOps})`);\n\t\tlet offset = 0;\n\t\tfor (const edge of edges) {\n\t\t\tconst edgeOps = executedOperations.slice(offset, offset + edge.operationCount);\n\t\t\toffset += edge.operationCount;\n\t\t\tawait this.family.writeLedgerEntry({\n\t\t\t\tdriver,\n\t\t\t\tspace,\n\t\t\t\tentry: {\n\t\t\t\t\tedgeId: `${edge.from}->${edge.to}`,\n\t\t\t\t\tfrom: edge.from,\n\t\t\t\t\tto: edge.to,\n\t\t\t\t\tmigrationName: edge.dirName,\n\t\t\t\t\tmigrationHash: edge.migrationHash,\n\t\t\t\t\toperations: edgeOps\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tasync beginExclusiveTransaction(driver) {\n\t\tawait driver.query(\"BEGIN EXCLUSIVE\");\n\t}\n\tasync commitTransaction(driver) {\n\t\tawait driver.query(\"COMMIT\");\n\t}\n\tasync rollbackTransaction(driver) {\n\t\tawait driver.query(\"ROLLBACK\");\n\t}\n\tasync executeStatement(driver, statement) {\n\t\tawait driver.query(statement.sql, statement.params);\n\t}\n};\n//#endregion\n//#region src/core/sqlite-schema-verifier.ts\n/**\n* SQLite target `SchemaVerifier` concretion. Mirrors the Postgres\n* shape: hooks return the empty list pending the call-site migration\n* that routes the existing verifier behaviour through the SPI.\n*/\nvar SqliteSchemaVerifier = class extends SqlSchemaVerifierBase {\n\tverifyCommonSqlSchema(_options) {\n\t\treturn [];\n\t}\n\tverifyTargetExtensions(_options) {\n\t\treturn [];\n\t}\n};\n//#endregion\n//#region src/core/control-target.ts\nfunction isSqlContract(contract) {\n\treturn contract === null || contract.storage instanceof SqlStorage;\n}\nconst sqliteControlTargetDescriptor = {\n\t...sqliteTargetDescriptorMeta,\n\tcontractSerializer: new SqliteContractSerializer(),\n\tschemaVerifier: new SqliteSchemaVerifier(),\n\tdiffSchema(input) {\n\t\treturn diffSqliteSchema(input);\n\t},\n\tclassifySubjectGranularity: relationalNodeGranularity,\n\tclassifyEntityKind: relationalNodeEntityKind,\n\tmigrations: {\n\t\tcreatePlanner(adapter) {\n\t\t\treturn createSqliteMigrationPlanner(adapter);\n\t\t},\n\t\tcreateRunner(family) {\n\t\t\treturn createSqliteMigrationRunner(family);\n\t\t},\n\t\tcontractToSchema(contract, _frameworkComponents) {\n\t\t\tif (!isSqlContract(contract)) throw sqliteError(\"CONTRACT.TARGET_MISMATCH\", \"sqliteControlTargetDescriptor.contractToSchema received a non-SQL contract; expected Contract<SqlStorage>\");\n\t\t\treturn sqliteContractToSchema(contract);\n\t\t}\n\t},\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"sqlite\"\n\t\t};\n\t},\n\tcreatePlanner(adapter) {\n\t\treturn createSqliteMigrationPlanner(adapter);\n\t},\n\tcreateRunner(family) {\n\t\treturn createSqliteMigrationRunner(family);\n\t}\n};\n//#endregion\nexport { SqliteUnboundDatabase, sqliteControlTargetDescriptor as default, sqliteCreateNamespace };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,4BAA4B,QAAQ;CAC5C,OAAO,IAAI,sBAAsB,MAAM;AACxC;AACA,IAAI,wBAAwB,MAAM;CACjC;CACA,YAAY,QAAQ;EACnB,KAAK,SAAS;CACf;;;;;;;CAOA,MAAM,oBAAoB,SAAS;EAClC,MAAM,SAAS,QAAQ;EACvB,IAAI,QAAQ,UAAU,KAAK,KAAK,QAAQ,UAAU,QAAQ,KAAK,SAAS,MAAM,YAAY,sCAAsC,sCAAsC,QAAQ,MAAM,iCAAiC,QAAQ,KAAK,QAAQ,IAAI,EAAE,MAAM;GACrP,OAAO,QAAQ;GACf,aAAa,QAAQ,KAAK;EAC3B,EAAE,CAAC;EACH,MAAM,QAAQ,QAAQ,KAAK;EAC3B,MAAM,UAAU,UAAU,MAAM,QAAQ,IAAI,QAAQ,KAAK,UAAU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,OAAO,CAAC;CACT;CACA,uBAAuB,UAAU;EAChC,OAAO,CAAC;CACT;AACD;AAGA,SAAS,cAAc,UAAU;CAChC,OAAO,aAAa,QAAQ,SAAS,mBAAmB;AACzD;AACA,MAAM,gCAAgC;CACrC,GAAG;CACH,oBAAoB,IAAI,yBAAyB;CACjD,gBAAgB,IAAI,qBAAqB;CACzC,WAAW,OAAO;EACjB,OAAO,iBAAiB,KAAK;CAC9B;CACA,4BAA4B;CAC5B,oBAAoB;CACpB,YAAY;EACX,cAAc,SAAS;GACtB,OAAO,6BAA6B,OAAO;EAC5C;EACA,aAAa,QAAQ;GACpB,OAAO,4BAA4B,MAAM;EAC1C;EACA,iBAAiB,UAAU,sBAAsB;GAChD,IAAI,CAAC,cAAc,QAAQ,GAAG,MAAM,YAAY,4BAA4B,2GAA2G;GACvL,OAAO,uBAAuB,QAAQ;EACvC;CACD;CACA,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;CACA,cAAc,SAAS;EACtB,OAAO,6BAA6B,OAAO;CAC5C;CACA,aAAa,QAAQ;EACpB,OAAO,4BAA4B,MAAM;CAC1C;AACD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as parseSqliteDefault } from "./default-normalizer-
|
|
1
|
+
import { t as parseSqliteDefault } from "./default-normalizer-D_kHnqz7-SRi-lBH0.mjs";
|
|
2
2
|
export { parseSqliteDefault };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as SqliteMigration } from "./sqlite-migration-
|
|
2
|
-
import { a as foreignKey, c as primaryKey, i as fn, l as rawSql, n as col, o as lit, r as dataTransform, s as placeholder, t as MigrationCLI, u as unique } from "./migration-
|
|
1
|
+
import { t as SqliteMigration } from "./sqlite-migration-6k1ntnGk-B5TeEP_r.mjs";
|
|
2
|
+
import { a as foreignKey, c as primaryKey, i as fn, l as rawSql, n as col, o as lit, r as dataTransform, s as placeholder, t as MigrationCLI, u as unique } from "./migration-CPXuprRF.mjs";
|
|
3
3
|
export { SqliteMigration as Migration, MigrationCLI, col, dataTransform, fn, foreignKey, lit, placeholder, primaryKey, rawSql, unique };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as DropColumnCall, c as RawSqlCall, i as DataTransformCall, l as RecreateTableCall, n as CreateIndexCall, o as DropIndexCall, r as CreateTableCall, s as DropTableCall, t as AddColumnCall } from "./op-factory-call-
|
|
1
|
+
import { a as DropColumnCall, c as RawSqlCall, i as DataTransformCall, l as RecreateTableCall, n as CreateIndexCall, o as DropIndexCall, r as CreateTableCall, s as DropTableCall, t as AddColumnCall } from "./op-factory-call-C7xkDM68-DKdYNph6.mjs";
|
|
2
2
|
export { AddColumnCall, CreateIndexCall, CreateTableCall, DataTransformCall, DropColumnCall, DropIndexCall, DropTableCall, RawSqlCall, RecreateTableCall };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as TypeScriptRenderableSqliteMigration } from "./planner-produced-sqlite-migration-
|
|
1
|
+
import { t as TypeScriptRenderableSqliteMigration } from "./planner-produced-sqlite-migration-rE9Hfch8-DPGrVAy9.mjs";
|
|
2
2
|
export { TypeScriptRenderableSqliteMigration };
|
package/dist/target__planner.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createSqliteMigrationPlanner, t as SqliteMigrationPlanner } from "./planner-
|
|
1
|
+
import { n as createSqliteMigrationPlanner, t as SqliteMigrationPlanner } from "./planner-Btyty0VZ-CwoZV9Kx.mjs";
|
|
2
2
|
export { SqliteMigrationPlanner, createSqliteMigrationPlanner };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-target-sqlite",
|
|
3
|
-
"version": "8.0.0-rc.11-dev.
|
|
3
|
+
"version": "8.0.0-rc.11-dev.30",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@prisma/orm-family-sql": "8.0.0-rc.11-dev.
|
|
13
|
-
"@prisma/orm-framework": "8.0.0-rc.11-dev.
|
|
14
|
-
"@prisma/orm-toolchain": "8.0.0-rc.11-dev.
|
|
12
|
+
"@prisma/orm-family-sql": "8.0.0-rc.11-dev.30",
|
|
13
|
+
"@prisma/orm-framework": "8.0.0-rc.11-dev.30",
|
|
14
|
+
"@prisma/orm-toolchain": "8.0.0-rc.11-dev.30",
|
|
15
15
|
"@standard-schema/spec": "1.1.0",
|
|
16
16
|
"arktype": "^2.2.2",
|
|
17
17
|
"pathe": "^2.0.3"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@internal/adapter-sqlite": "8.0.0-rc.11-dev.
|
|
21
|
-
"@internal/driver-sqlite": "8.0.0-rc.11-dev.
|
|
22
|
-
"@internal/target-sqlite": "8.0.0-rc.11-dev.
|
|
23
|
-
"@repo/tsconfig": "8.0.0-rc.11-dev.
|
|
24
|
-
"@repo/tsdown": "8.0.0-rc.11-dev.
|
|
20
|
+
"@internal/adapter-sqlite": "8.0.0-rc.11-dev.30",
|
|
21
|
+
"@internal/driver-sqlite": "8.0.0-rc.11-dev.30",
|
|
22
|
+
"@internal/target-sqlite": "8.0.0-rc.11-dev.30",
|
|
23
|
+
"@repo/tsconfig": "8.0.0-rc.11-dev.30",
|
|
24
|
+
"@repo/tsdown": "8.0.0-rc.11-dev.30",
|
|
25
25
|
"tsdown": "0.22.14",
|
|
26
26
|
"typescript": "5.9.3"
|
|
27
27
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"op-factory-call-gc26GqyA-Db5Fasef.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/op-factory-call-gc26GqyA.mjs"],"sourcesContent":["import { n as sqliteError } from \"./errors-DnR-sMHS.mjs\";\nimport { n as quoteIdentifier, t as escapeLiteral } from \"./sql-utils-C2O4zVkP.mjs\";\nimport { i as tableExistsAst, n as columnExistsAst, r as indexExistsAst, t as createTable } from \"./ddl-CXduXyOT.mjs\";\nimport { t as buildTargetDetails } from \"./planner-target-details-CIQ789Gc.mjs\";\nimport { n as stripOuterParens } from \"./default-normalizer-DuoHj9-O.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { RelationalSchemaNodeKind } from \"@internal/sql-schema-ir/types\";\nimport { issueOutcome } from \"@internal/framework-components/control\";\nimport { errorUnfilledPlaceholder } from \"@internal/errors/migration\";\nimport { TsExpression, jsonToTsSource } from \"@internal/ts-render\";\nimport { REFERENTIAL_ACTION_SQL } from \"@internal/sql-contract/referential-action-sql\";\n//#region src/core/migrations/planner-ddl-builders.ts\nconst SAFE_NATIVE_TYPE_PATTERN = /^[a-zA-Z][a-zA-Z0-9_ ]*$/;\nfunction assertSafeNativeType(nativeType) {\n\tif (!SAFE_NATIVE_TYPE_PATTERN.test(nativeType)) throw sqliteError(\"CONTRACT.NATIVE_TYPE_INVALID\", `Unsafe native type name in contract: \"${nativeType}\". Native type names must match /^[a-zA-Z][a-zA-Z0-9_ ]*\\$/`, { meta: { nativeType } });\n}\nfunction assertSafeDefaultExpression(expression) {\n\tif (expression.includes(\";\") || /--|\\/\\*|\\bSELECT\\b/i.test(expression)) throw sqliteError(\"CONTRACT.DEFAULT_INVALID\", `Unsafe default expression in contract: \"${expression}\". Default expressions must not contain semicolons, SQL comment tokens, or subqueries.`, { meta: { expression } });\n}\n/**\n* Renders the column's DDL type token (e.g. `\"INTEGER\"`, `\"TEXT\"`).\n* Resolves `typeRef` against `storageTypes` and validates the resulting\n* native type against a safe-identifier pattern.\n*/\nfunction buildColumnTypeSql(column, storageTypes = {}) {\n\tconst resolved = resolveColumnTypeMetadata(column, storageTypes);\n\tassertSafeNativeType(resolved.nativeType);\n\treturn resolved.nativeType.toUpperCase();\n}\n/**\n* Renders the column's `DEFAULT …` clause. Returns the empty string when\n* there is no default, and also when the default is `autoincrement()` —\n* SQLite encodes that as `INTEGER PRIMARY KEY AUTOINCREMENT` inline on the\n* column definition, not as a separate DEFAULT.\n*/\nfunction buildColumnDefaultSql(columnDefault) {\n\tif (!columnDefault) return \"\";\n\tswitch (columnDefault.kind) {\n\t\tcase \"literal\": return `DEFAULT ${renderDefaultLiteral(columnDefault.value)}`;\n\t\tcase \"function\":\n\t\t\tif (columnDefault.expression === \"autoincrement()\") return \"\";\n\t\t\tif (columnDefault.expression === \"now()\") return \"DEFAULT (datetime('now'))\";\n\t\t\tassertSafeDefaultExpression(columnDefault.expression);\n\t\t\treturn `DEFAULT (${columnDefault.expression})`;\n\t}\n}\nfunction renderDefaultLiteral(value) {\n\tif (value instanceof Date) return `'${escapeLiteral(value.toISOString())}'`;\n\tif (typeof value === \"string\") return `'${escapeLiteral(value)}'`;\n\tif (typeof value === \"number\" || typeof value === \"bigint\") return String(value);\n\tif (typeof value === \"boolean\") return value ? \"1\" : \"0\";\n\tif (value === null) return \"NULL\";\n\treturn `'${escapeLiteral(JSON.stringify(value))}'`;\n}\nfunction buildCreateIndexSql(tableName, indexName, columns, unique = false) {\n\treturn `CREATE ${unique ? \"UNIQUE \" : \"\"}INDEX ${quoteIdentifier(indexName)} ON ${quoteIdentifier(tableName)} (${columns.map(quoteIdentifier).join(\", \")})`;\n}\nfunction buildDropIndexSql(indexName) {\n\treturn `DROP INDEX IF EXISTS ${quoteIdentifier(indexName)}`;\n}\nfunction resolveColumnTypeMetadata(column, storageTypes) {\n\tif (!column.typeRef) return column;\n\tconst referencedType = storageTypes[column.typeRef];\n\tif (!referencedType) throw sqliteError(\"CONTRACT.TYPE_UNKNOWN\", `Storage type \"${column.typeRef}\" referenced by column is not defined in storage.types.`, { meta: { typeRef: column.typeRef } });\n\treturn {\n\t\tcodecId: referencedType.codecId,\n\t\tnativeType: referencedType.nativeType,\n\t\ttypeParams: referencedType.typeParams\n\t};\n}\n//#endregion\n//#region src/core/migrations/operations/shared.ts\nfunction step(description, sql, params) {\n\treturn {\n\t\tdescription,\n\t\tsql,\n\t\t...ifDefined(\"params\", params)\n\t};\n}\n/**\n* Renders a single column's inline DDL fragment within a `CREATE TABLE`\n* statement. Honours the `inlineAutoincrementPrimaryKey` flag — SQLite\n* treats `INTEGER PRIMARY KEY AUTOINCREMENT` as a special form that aliases\n* `rowid`, and the column must not carry a `DEFAULT` or repeat `NOT NULL`.\n*/\nfunction renderColumnDefinition(column) {\n\tconst parts = [quoteIdentifier(column.name), column.typeSql];\n\tif (column.inlineAutoincrementPrimaryKey) parts.push(\"PRIMARY KEY AUTOINCREMENT\");\n\telse {\n\t\tif (column.defaultSql) parts.push(column.defaultSql);\n\t\tif (!column.nullable) parts.push(\"NOT NULL\");\n\t}\n\treturn parts.join(\" \");\n}\n/**\n* Renders an inline FOREIGN KEY constraint clause for a `CREATE TABLE`\n* body. Every `SqliteForeignKeySpec` is constraint-bearing by construction\n* (`tableSpecFromNode` only ever builds specs from schema-IR FK nodes, which\n* are themselves constraint-only — a non-constraint FK contributes no node).\n*/\nfunction renderForeignKeyClause(fk) {\n\tlet sql = `${fk.name ? `CONSTRAINT ${quoteIdentifier(fk.name)} ` : \"\"}FOREIGN KEY (${fk.columns.map(quoteIdentifier).join(\", \")}) REFERENCES ${quoteIdentifier(fk.references.table)} (${fk.references.columns.map(quoteIdentifier).join(\", \")})`;\n\tif (fk.onDelete !== void 0) sql += ` ON DELETE ${REFERENTIAL_ACTION_SQL[fk.onDelete]}`;\n\tif (fk.onUpdate !== void 0) sql += ` ON UPDATE ${REFERENTIAL_ACTION_SQL[fk.onUpdate]}`;\n\treturn sql;\n}\n//#endregion\n//#region src/core/migrations/operations/columns.ts\nfunction addColumnExecuteSql(tableName, column) {\n\treturn [\n\t\t`ALTER TABLE ${quoteIdentifier(tableName)}`,\n\t\t`ADD COLUMN ${quoteIdentifier(column.name)} ${column.typeSql}`,\n\t\tcolumn.defaultSql,\n\t\tcolumn.nullable ? \"\" : \"NOT NULL\"\n\t].filter(Boolean).join(\" \");\n}\nfunction dropColumnExecuteSql(tableName, columnName) {\n\treturn `ALTER TABLE ${quoteIdentifier(tableName)} DROP COLUMN ${quoteIdentifier(columnName)}`;\n}\n//#endregion\n//#region src/core/migrations/operations/tables.ts\nasync function tableExistsSteps(lowerer, tableName) {\n\tconst checks = tableExistsAst(tableName);\n\treturn {\n\t\tpresent: await lowerer.lowerToExecuteRequest(checks.tablePresent()),\n\t\tabsent: await lowerer.lowerToExecuteRequest(checks.tableAbsent())\n\t};\n}\n/**\n* Renders the body of a `CREATE TABLE <name> ( … )` statement from a flat\n* `SqliteTableSpec`. SQLite's `INTEGER PRIMARY KEY AUTOINCREMENT` form is\n* inline on the column; the table-level PRIMARY KEY clause is emitted only\n* when no column carries `inlineAutoincrementPrimaryKey`.\n*/\nfunction renderCreateTableSql(tableName, spec) {\n\tconst columnDefs = spec.columns.map(renderColumnDefinition);\n\tconst constraintDefs = [];\n\tconst hasInlinePk = spec.columns.some((c) => c.inlineAutoincrementPrimaryKey);\n\tif (spec.primaryKey && !hasInlinePk) constraintDefs.push(`PRIMARY KEY (${spec.primaryKey.columns.map(quoteIdentifier).join(\", \")})`);\n\tfor (const u of spec.uniques ?? []) {\n\t\tconst name = u.name ? `CONSTRAINT ${quoteIdentifier(u.name)} ` : \"\";\n\t\tconstraintDefs.push(`${name}UNIQUE (${u.columns.map(quoteIdentifier).join(\", \")})`);\n\t}\n\tfor (const fk of spec.foreignKeys ?? []) {\n\t\tconst clause = renderForeignKeyClause(fk);\n\t\tif (clause) constraintDefs.push(clause);\n\t}\n\tconst allDefs = [...columnDefs, ...constraintDefs];\n\treturn `CREATE TABLE ${quoteIdentifier(tableName)} (\\n ${allDefs.join(\",\\n \")}\\n)`;\n}\nasync function recreateTable(args, lowerer) {\n\tconst { tableName, contractTable, schemaColumnNames, indexes, summary, postchecks, operationClass } = args;\n\tconst tempName = `_prisma_new_${tableName}`;\n\tconst liveSet = new Set(schemaColumnNames);\n\tconst sharedColumns = contractTable.columns.filter((c) => liveSet.has(c.name)).map((c) => c.name);\n\tconst columnList = sharedColumns.map(quoteIdentifier).join(\", \");\n\tconst indexStatements = indexes.map((idx) => ({\n\t\tdescription: `recreate index \"${idx.name}\" on \"${tableName}\"`,\n\t\tsql: buildCreateIndexSql(tableName, idx.name, idx.columns)\n\t}));\n\tconst copyStep = sharedColumns.length > 0 ? [step(`copy data from \"${tableName}\" to \"${tempName}\"`, `INSERT INTO ${quoteIdentifier(tempName)} (${columnList}) SELECT ${columnList} FROM ${quoteIdentifier(tableName)}`)] : [];\n\tconst tableSteps = await tableExistsSteps(lowerer, tableName);\n\tconst tempSteps = await tableExistsSteps(lowerer, tempName);\n\treturn {\n\t\tid: `recreateTable.${tableName}`,\n\t\tlabel: `Recreate table ${tableName}`,\n\t\tsummary,\n\t\toperationClass,\n\t\ttarget: {\n\t\t\tid: \"sqlite\",\n\t\t\tdetails: buildTargetDetails(\"table\", tableName)\n\t\t},\n\t\tprecheck: [step(`ensure table \"${tableName}\" exists`, tableSteps.present.sql, tableSteps.present.params), step(`ensure temp table \"${tempName}\" does not exist`, tempSteps.absent.sql, tempSteps.absent.params)],\n\t\texecute: [\n\t\t\tstep(`create new table \"${tempName}\" with desired schema`, renderCreateTableSql(tempName, contractTable)),\n\t\t\t...copyStep,\n\t\t\tstep(`drop old table \"${tableName}\"`, `DROP TABLE ${quoteIdentifier(tableName)}`),\n\t\t\tstep(`rename \"${tempName}\" to \"${tableName}\"`, `ALTER TABLE ${quoteIdentifier(tempName)} RENAME TO ${quoteIdentifier(tableName)}`),\n\t\t\t...indexStatements\n\t\t],\n\t\tpostcheck: [\n\t\t\tstep(`verify table \"${tableName}\" exists`, tableSteps.present.sql, tableSteps.present.params),\n\t\t\tstep(`verify temp table \"${tempName}\" is gone`, tempSteps.absent.sql, tempSteps.absent.params),\n\t\t\t...postchecks\n\t\t]\n\t};\n}\n/**\n* Build a one-line summary of a recreate-table operation from the schema-diff\n* issues that triggered it. Lives next to `recreateTable` so the planner\n* (which has the issues) can produce the same description the factory\n* used to build inline. Keeping the formatting target-side keeps\n* `RecreateTableCall` issue-free at the IR layer. `SchemaDiffIssue` carries\n* no rendered message, so this renders one from each issue's path.\n*/\nfunction buildRecreateSummary(tableName, issues) {\n\treturn `Recreates table ${tableName} to apply schema changes: ${issues.map((i) => i.path.join(\"/\")).join(\"; \")}`;\n}\nfunction nodeKindOf(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\treturn blindCast(node).nodeKind;\n}\n/** Mirrors `SqlColumnIR.isEqualTo`'s type comparison, isolated so a `not-equal` column issue's postcheck can target type drift and nullability drift independently. */\nfunction columnTypeChanged(expected, actual) {\n\tif (expected.resolvedNativeType !== void 0 && actual.resolvedNativeType !== void 0) return expected.resolvedNativeType !== actual.resolvedNativeType;\n\treturn expected.nativeType !== actual.nativeType || Boolean(expected.many) !== Boolean(actual.many);\n}\n/**\n* Returns the columns the contract expects as the table's primary key. Picks\n* up SQLite's inline `INTEGER PRIMARY KEY AUTOINCREMENT` form when no\n* explicit `primaryKey` clause is set on the spec.\n*/\nfunction expectedPrimaryKeyColumns(spec) {\n\tif (spec.primaryKey) return spec.primaryKey.columns;\n\tconst inlinePk = spec.columns.find((c) => c.inlineAutoincrementPrimaryKey);\n\treturn inlinePk ? [inlinePk.name] : [];\n}\nfunction quoteSqlList(values) {\n\treturn values.map((v) => `'${escapeLiteral(v)}'`).join(\", \");\n}\nfunction columnNameFromNode(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\treturn blindCast(node).name;\n}\n/**\n* A column-default issue's own node has no back-reference to its owning\n* column — it's a transient child built by `SqlColumnIR.children()`. The\n* column's id (`column:<name>`) is always the diff path's second-to-last\n* segment for a default issue (`[..., tableId, columnId, 'default']`), so\n* the name is recovered from the path rather than the node.\n*/\nfunction columnNameFromDefaultIssuePath(issue) {\n\tconst columnId = issue.path[issue.path.length - 2];\n\tif (columnId === void 0) return void 0;\n\treturn columnId.startsWith(\"column:\") ? columnId.slice(7) : columnId;\n}\n/**\n* Per-issue postchecks verifying the recreated table's shape against the\n* expected spec. Column-level issues (`sql-column` `not-equal`,\n* `sql-column-default` any reason) emit one targeted check each;\n* constraint-level issues (`sql-primary-key`, `sql-unique`, `sql-foreign-key`,\n* any reason) emit one `pragma_*`-driven check per declared constraint in the\n* expected spec, so a recreated table with the right columns but the wrong\n* PK / unique / FK shape fails the postcheck instead of passing silently.\n* Exported so the planner can pre-build the list at construction time and\n* `RecreateTableCall` doesn't have to carry `SchemaDiffIssue` objects through\n* to render time.\n*/\nfunction buildRecreatePostchecks(tableName, issues, spec) {\n\tconst checks = [];\n\tconst t = escapeLiteral(tableName);\n\tconst byName = new Map(spec.columns.map((c) => [c.name, c]));\n\tlet hasPkIssue = false;\n\tlet hasUniqueIssue = false;\n\tlet hasFkIssue = false;\n\tfor (const issue of issues) {\n\t\tconst nodeKind = nodeKindOf(issue);\n\t\tif (nodeKind === RelationalSchemaNodeKind.column && issueOutcome(issue) === \"not-equal\") {\n\t\t\tconst columnName = columnNameFromNode(issue);\n\t\t\tif (columnName === void 0) continue;\n\t\t\tconst c = escapeLiteral(columnName);\n\t\t\tconst expected = blindCast(issue.expected);\n\t\t\tconst actual = blindCast(issue.actual);\n\t\t\tif (expected.nullable !== actual.nullable) checks.push({\n\t\t\t\tdescription: `verify \"${columnName}\" nullability on \"${tableName}\"`,\n\t\t\t\tsql: `SELECT COUNT(*) > 0 FROM pragma_table_info('${t}') WHERE name = '${c}' AND \"notnull\" = ${expected.nullable ? 0 : 1}`\n\t\t\t});\n\t\t\tif (columnTypeChanged(expected, actual)) {\n\t\t\t\tconst colSpec = byName.get(columnName);\n\t\t\t\tif (colSpec) checks.push({\n\t\t\t\t\tdescription: `verify \"${columnName}\" type on \"${tableName}\"`,\n\t\t\t\t\tsql: `SELECT COUNT(*) > 0 FROM pragma_table_info('${t}') WHERE name = '${c}' AND LOWER(type) = '${escapeLiteral(colSpec.typeSql.toLowerCase())}'`\n\t\t\t\t});\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tif (nodeKind === RelationalSchemaNodeKind.columnDefault) {\n\t\t\tconst columnName = columnNameFromDefaultIssuePath(issue);\n\t\t\tif (columnName === void 0) continue;\n\t\t\tconst c = escapeLiteral(columnName);\n\t\t\tif (issueOutcome(issue) === \"not-expected\") {\n\t\t\t\tchecks.push({\n\t\t\t\t\tdescription: `verify \"${columnName}\" has no default on \"${tableName}\"`,\n\t\t\t\t\tsql: `SELECT COUNT(*) > 0 FROM pragma_table_info('${t}') WHERE name = '${c}' AND dflt_value IS NULL`\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst colSpec = byName.get(columnName);\n\t\t\tconst expectedRaw = colSpec?.defaultSql.startsWith(\"DEFAULT \") ? stripOuterParens(colSpec.defaultSql.slice(8)) : null;\n\t\t\tif (expectedRaw) checks.push({\n\t\t\t\tdescription: `verify \"${columnName}\" default on \"${tableName}\"`,\n\t\t\t\tsql: `SELECT COUNT(*) > 0 FROM pragma_table_info('${t}') WHERE name = '${c}' AND dflt_value = '${escapeLiteral(expectedRaw)}'`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (nodeKind === RelationalSchemaNodeKind.primaryKey) hasPkIssue = true;\n\t\tif (nodeKind === RelationalSchemaNodeKind.unique) hasUniqueIssue = true;\n\t\tif (nodeKind === RelationalSchemaNodeKind.foreignKey) hasFkIssue = true;\n\t}\n\tif (hasPkIssue) {\n\t\tconst pkColumns = expectedPrimaryKeyColumns(spec);\n\t\tconst colCount = pkColumns.length;\n\t\tif (colCount === 0) checks.push({\n\t\t\tdescription: `verify \"${tableName}\" has no primary key`,\n\t\t\tsql: `SELECT (SELECT COUNT(*) FROM pragma_table_info('${t}') WHERE pk > 0) = 0`\n\t\t});\n\t\telse checks.push({\n\t\t\tdescription: `verify primary key on \"${tableName}\"`,\n\t\t\tsql: `SELECT (SELECT COUNT(*) FROM pragma_table_info('${t}') WHERE pk > 0) = ${colCount} AND (SELECT COUNT(*) FROM pragma_table_info('${t}') WHERE pk > 0 AND name IN (${quoteSqlList(pkColumns)})) = ${colCount}`\n\t\t});\n\t}\n\tif (hasUniqueIssue) for (const u of spec.uniques ?? []) {\n\t\tconst colCount = u.columns.length;\n\t\tconst description = u.name ? `verify unique constraint \"${u.name}\" on \"${tableName}\"` : `verify unique constraint (${u.columns.join(\", \")}) on \"${tableName}\"`;\n\t\tchecks.push({\n\t\t\tdescription,\n\t\t\tsql: `SELECT EXISTS (SELECT 1 FROM pragma_index_list('${t}') l WHERE l.\"unique\" = 1 AND (SELECT COUNT(*) FROM pragma_index_info(l.name)) = ${colCount} AND (SELECT COUNT(*) FROM pragma_index_info(l.name) WHERE name IN (${quoteSqlList(u.columns)})) = ${colCount})`\n\t\t});\n\t}\n\tif (hasFkIssue) for (const fk of spec.foreignKeys ?? []) {\n\t\tconst refTable = escapeLiteral(fk.references.table);\n\t\tconst colCount = fk.columns.length;\n\t\tconst tuples = fk.columns.map((from, i) => {\n\t\t\tconst to = fk.references.columns[i] ?? from;\n\t\t\treturn `('${escapeLiteral(from)}', '${escapeLiteral(to)}')`;\n\t\t}).join(\", \");\n\t\tconst description = `verify foreign key (${fk.columns.join(\", \")}) → ${fk.references.table}(${fk.references.columns.join(\", \")}) on \"${tableName}\"`;\n\t\tchecks.push({\n\t\t\tdescription,\n\t\t\tsql: `SELECT EXISTS (SELECT 1 FROM pragma_foreign_key_list('${t}') f WHERE f.\"table\" = '${refTable}' GROUP BY f.id HAVING COUNT(*) = ${colCount} AND SUM(CASE WHEN (f.\"from\", f.\"to\") IN (${tuples}) THEN 1 ELSE 0 END) = ${colCount})`\n\t\t});\n\t}\n\treturn checks;\n}\n//#endregion\n//#region src/core/migrations/op-factory-call.ts\n/**\n* SQLite migration IR: one concrete `*Call` class per pure factory under\n* `operations/`, plus a shared `SqliteOpFactoryCallNode` abstract base.\n*\n* Each call class carries fully-resolved literal arguments. `CreateTableCall`\n* holds structured `DdlColumn[]` + `DdlTableConstraint[]` and lowers via the\n* adapter's DDL path; other call classes carry flat SQL fragments. Codec /\n* `typeRef` / default expansion happens upstream in the issue-planner /\n* strategies, mirroring the Postgres `ColumnSpec` pattern.\n*/\nconst TARGET_MIGRATION_MODULE = \"@internal/sqlite/migration\";\nvar SqliteOpFactoryCallNode = class extends TsExpression {\n\timportRequirements() {\n\t\treturn [{\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: this.factoryName\n\t\t}];\n\t}\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n};\nfunction renderDdlColumnDefault(def) {\n\tif (!def) return \"\";\n\tif (def.kind === \"literal\") return `lit(${jsonToTsSource(def.value)})`;\n\treturn `fn(${jsonToTsSource(def.expression)})`;\n}\nfunction renderDdlColumnAsTsCall(column) {\n\tconst opts = [];\n\tif (column.notNull) opts.push(\"notNull: true\");\n\tif (column.primaryKey) opts.push(\"primaryKey: true\");\n\tif (column.default) opts.push(`default: ${renderDdlColumnDefault(column.default)}`);\n\tconst optsStr = opts.length > 0 ? `, { ${opts.join(\", \")} }` : \"\";\n\treturn `col(${jsonToTsSource(column.name)}, ${jsonToTsSource(column.type)}${optsStr})`;\n}\nfunction renderDdlConstraintAsTsCall(constraint) {\n\tswitch (constraint.kind) {\n\t\tcase \"primary-key\": {\n\t\t\tconst nameOpt = constraint.name ? `, { name: ${jsonToTsSource(constraint.name)} }` : \"\";\n\t\t\treturn `primaryKey(${jsonToTsSource(constraint.columns)}${nameOpt})`;\n\t\t}\n\t\tcase \"foreign-key\": {\n\t\t\tconst opts = [];\n\t\t\tif (constraint.name) opts.push(`name: ${jsonToTsSource(constraint.name)}`);\n\t\t\tif (constraint.onDelete) opts.push(`onDelete: ${jsonToTsSource(constraint.onDelete)}`);\n\t\t\tif (constraint.onUpdate) opts.push(`onUpdate: ${jsonToTsSource(constraint.onUpdate)}`);\n\t\t\tconst optsStr = opts.length > 0 ? `, { ${opts.join(\", \")} }` : \"\";\n\t\t\treturn `foreignKey(${jsonToTsSource(constraint.columns)}, ${jsonToTsSource(constraint.refTable)}, ${jsonToTsSource(constraint.refColumns)}${optsStr})`;\n\t\t}\n\t\tcase \"unique\": {\n\t\t\tconst nameOpt = constraint.name ? `, { name: ${jsonToTsSource(constraint.name)} }` : \"\";\n\t\t\treturn `unique(${jsonToTsSource(constraint.columns)}${nameOpt})`;\n\t\t}\n\t\tcase \"check-expression\": throw sqliteError(\"CONTRACT.CONSTRAINT_INVALID\", `The SQLite target does not support CHECK constraints (constraint \"${constraint.name}\"). The \"checkConstraint\" capability is Postgres-only — remove the \"@@check\" / \"check()\" declaration, or target Postgres.`, { meta: { constraintName: constraint.name } });\n\t}\n}\nfunction constraintImportSymbols(constraints) {\n\tif (!constraints || constraints.length === 0) return [];\n\tconst symbols = /* @__PURE__ */ new Set();\n\tfor (const c of constraints) if (c.kind === \"primary-key\") symbols.add(\"primaryKey\");\n\telse if (c.kind === \"foreign-key\") symbols.add(\"foreignKey\");\n\telse if (c.kind === \"unique\") symbols.add(\"unique\");\n\treturn [...symbols];\n}\nfunction defaultImportSymbols(columns) {\n\tconst symbols = /* @__PURE__ */ new Set();\n\tfor (const col of columns) if (col.default?.kind === \"literal\") symbols.add(\"lit\");\n\telse if (col.default?.kind === \"function\") symbols.add(\"fn\");\n\treturn [...symbols];\n}\nvar CreateTableCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"createTable\";\n\toperationClass = \"additive\";\n\ttableName;\n\tcolumns;\n\tconstraints;\n\tlabel;\n\tconstructor(tableName, columns, constraints) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.columns = Object.freeze([...columns]);\n\t\tthis.constraints = constraints ? Object.freeze([...constraints]) : void 0;\n\t\tthis.label = `Create table ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `CreateTableCall.toOp: a DDL lowerer is required on the SQLite planner path (table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName\n\t\t} });\n\t\tconst ddlNode = createTable({\n\t\t\ttable: this.tableName,\n\t\t\tcolumns: this.columns,\n\t\t\t...ifDefined(\"constraints\", this.constraints)\n\t\t});\n\t\tconst statement = await lowerer.lowerToExecuteRequest(ddlNode);\n\t\tconst tableName = this.tableName;\n\t\tconst tableChecks = tableExistsAst(tableName);\n\t\tconst absent = await lowerer.lowerToExecuteRequest(tableChecks.tableAbsent());\n\t\tconst present = await lowerer.lowerToExecuteRequest(tableChecks.tablePresent());\n\t\treturn {\n\t\t\tid: `table.${tableName}`,\n\t\t\tlabel: `Create table ${tableName}`,\n\t\t\tsummary: `Creates table ${tableName} with required columns`,\n\t\t\toperationClass: \"additive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"table\", tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure table \"${tableName}\" does not exist`, absent.sql, absent.params)],\n\t\t\texecute: [{\n\t\t\t\tdescription: `create table \"${tableName}\"`,\n\t\t\t\tsql: statement.sql,\n\t\t\t\tparams: statement.params ?? []\n\t\t\t}],\n\t\t\tpostcheck: [step(`verify table \"${tableName}\" exists`, present.sql, present.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\tconst columnsList = this.columns.map(renderDdlColumnAsTsCall).join(\", \");\n\t\tconst constraintsList = this.constraints ? this.constraints.map(renderDdlConstraintAsTsCall).join(\", \") : void 0;\n\t\tconst opts = [];\n\t\topts.push(`table: ${jsonToTsSource(this.tableName)}`);\n\t\topts.push(`columns: [${columnsList}]`);\n\t\tif (constraintsList) opts.push(`constraints: [${constraintsList}]`);\n\t\treturn `this.createTable({ ${opts.join(\", \")} })`;\n\t}\n\timportRequirements() {\n\t\tconst req = [];\n\t\tif (this.columns.length > 0) {\n\t\t\treq.push({\n\t\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\t\tsymbol: \"col\"\n\t\t\t});\n\t\t\tfor (const sym of defaultImportSymbols(this.columns)) req.push({\n\t\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\t\tsymbol: sym\n\t\t\t});\n\t\t}\n\t\tfor (const sym of constraintImportSymbols(this.constraints)) req.push({\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: sym\n\t\t});\n\t\treturn req;\n\t}\n};\nvar DropTableCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"dropTable\";\n\toperationClass = \"destructive\";\n\ttableName;\n\tlabel;\n\tconstructor(tableName) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.label = `Drop table ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `DropTableCall.toOp: a lowerer is required on the SQLite planner path (table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName\n\t\t} });\n\t\tconst checks = tableExistsAst(this.tableName);\n\t\tconst present = await lowerer.lowerToExecuteRequest(checks.tablePresent());\n\t\tconst absent = await lowerer.lowerToExecuteRequest(checks.tableAbsent());\n\t\treturn {\n\t\t\tid: `dropTable.${this.tableName}`,\n\t\t\tlabel: `Drop table ${this.tableName}`,\n\t\t\tsummary: `Drops table ${this.tableName} which is not in the contract`,\n\t\t\toperationClass: \"destructive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"table\", this.tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure table \"${this.tableName}\" exists`, present.sql, present.params)],\n\t\t\texecute: [step(`drop table \"${this.tableName}\"`, `DROP TABLE ${quoteIdentifier(this.tableName)}`)],\n\t\t\tpostcheck: [step(`verify table \"${this.tableName}\" is gone`, absent.sql, absent.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.dropTable({ table: ${jsonToTsSource(this.tableName)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nvar RecreateTableCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"recreateTable\";\n\toperationClass;\n\ttableName;\n\tcontractTable;\n\tschemaColumnNames;\n\tindexes;\n\tsummary;\n\tpostchecks;\n\tlabel;\n\tconstructor(args) {\n\t\tsuper();\n\t\tthis.tableName = args.tableName;\n\t\tthis.contractTable = args.contractTable;\n\t\tthis.schemaColumnNames = args.schemaColumnNames;\n\t\tthis.indexes = args.indexes;\n\t\tthis.summary = args.summary;\n\t\tthis.postchecks = args.postchecks;\n\t\tthis.operationClass = args.operationClass;\n\t\tthis.label = `Recreate table ${args.tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `RecreateTableCall.toOp: a lowerer is required on the SQLite planner path (table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName\n\t\t} });\n\t\treturn recreateTable({\n\t\t\ttableName: this.tableName,\n\t\t\tcontractTable: this.contractTable,\n\t\t\tschemaColumnNames: this.schemaColumnNames,\n\t\t\tindexes: this.indexes,\n\t\t\tsummary: this.summary,\n\t\t\tpostchecks: this.postchecks,\n\t\t\toperationClass: this.operationClass\n\t\t}, lowerer);\n\t}\n\trenderTypeScript() {\n\t\treturn `this.recreateTable(${jsonToTsSource({\n\t\t\ttableName: this.tableName,\n\t\t\tcontractTable: this.contractTable,\n\t\t\tschemaColumnNames: this.schemaColumnNames,\n\t\t\tindexes: this.indexes,\n\t\t\tsummary: this.summary,\n\t\t\tpostchecks: this.postchecks,\n\t\t\toperationClass: this.operationClass\n\t\t})})`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nvar AddColumnCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"addColumn\";\n\toperationClass = \"additive\";\n\ttableName;\n\tcolumnName;\n\tcolumn;\n\tlabel;\n\tconstructor(tableName, column) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.columnName = column.name;\n\t\tthis.column = column;\n\t\tthis.label = `Add column ${column.name} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `AddColumnCall.toOp: a lowerer is required on the SQLite planner path (column \"${this.column.name}\" on table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName,\n\t\t\tcolumnName: this.column.name\n\t\t} });\n\t\tconst checks = columnExistsAst(this.tableName, this.column.name);\n\t\tconst absent = await lowerer.lowerToExecuteRequest(checks.columnAbsent());\n\t\tconst present = await lowerer.lowerToExecuteRequest(checks.columnPresent());\n\t\treturn {\n\t\t\tid: `column.${this.tableName}.${this.column.name}`,\n\t\t\tlabel: `Add column ${this.column.name} on ${this.tableName}`,\n\t\t\tsummary: `Adds column ${this.column.name} on ${this.tableName}`,\n\t\t\toperationClass: \"additive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"column\", this.column.name, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure column \"${this.column.name}\" is missing`, absent.sql, absent.params)],\n\t\t\texecute: [step(`add column \"${this.column.name}\"`, addColumnExecuteSql(this.tableName, this.column))],\n\t\t\tpostcheck: [step(`verify column \"${this.column.name}\" exists`, present.sql, present.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.addColumn({ table: ${jsonToTsSource(this.tableName)}, column: ${jsonToTsSource(this.column)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nvar DropColumnCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"dropColumn\";\n\toperationClass = \"destructive\";\n\ttableName;\n\tcolumnName;\n\tlabel;\n\tconstructor(tableName, columnName) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.columnName = columnName;\n\t\tthis.label = `Drop column ${columnName} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `DropColumnCall.toOp: a lowerer is required on the SQLite planner path (column \"${this.columnName}\" on table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName,\n\t\t\tcolumnName: this.columnName\n\t\t} });\n\t\tconst checks = columnExistsAst(this.tableName, this.columnName);\n\t\tconst present = await lowerer.lowerToExecuteRequest(checks.columnPresent());\n\t\tconst absent = await lowerer.lowerToExecuteRequest(checks.columnAbsent());\n\t\treturn {\n\t\t\tid: `dropColumn.${this.tableName}.${this.columnName}`,\n\t\t\tlabel: `Drop column ${this.columnName} on ${this.tableName}`,\n\t\t\tsummary: `Drops column ${this.columnName} on ${this.tableName} which is not in the contract`,\n\t\t\toperationClass: \"destructive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"column\", this.columnName, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure column \"${this.columnName}\" exists on \"${this.tableName}\"`, present.sql, present.params)],\n\t\t\texecute: [step(`drop column \"${this.columnName}\" from \"${this.tableName}\"`, dropColumnExecuteSql(this.tableName, this.columnName))],\n\t\t\tpostcheck: [step(`verify column \"${this.columnName}\" is gone from \"${this.tableName}\"`, absent.sql, absent.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.dropColumn({ table: ${jsonToTsSource(this.tableName)}, column: ${jsonToTsSource(this.columnName)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nvar CreateIndexCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"createIndex\";\n\toperationClass = \"additive\";\n\ttableName;\n\tindexName;\n\tcolumns;\n\tlabel;\n\tconstructor(tableName, indexName, columns) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.indexName = indexName;\n\t\tthis.columns = columns;\n\t\tthis.label = `Create index ${indexName} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `CreateIndexCall.toOp: a lowerer is required on the SQLite planner path (index \"${this.indexName}\" on table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName,\n\t\t\tindexName: this.indexName\n\t\t} });\n\t\tconst checks = indexExistsAst(this.indexName);\n\t\tconst absent = await lowerer.lowerToExecuteRequest(checks.indexAbsent());\n\t\tconst present = await lowerer.lowerToExecuteRequest(checks.indexPresent());\n\t\treturn {\n\t\t\tid: `index.${this.tableName}.${this.indexName}`,\n\t\t\tlabel: `Create index ${this.indexName} on ${this.tableName}`,\n\t\t\tsummary: `Creates index ${this.indexName} on ${this.tableName}`,\n\t\t\toperationClass: \"additive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"index\", this.indexName, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure index \"${this.indexName}\" is missing`, absent.sql, absent.params)],\n\t\t\texecute: [step(`create index \"${this.indexName}\"`, buildCreateIndexSql(this.tableName, this.indexName, this.columns))],\n\t\t\tpostcheck: [step(`verify index \"${this.indexName}\" exists`, present.sql, present.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.createIndex({ table: ${jsonToTsSource(this.tableName)}, index: ${jsonToTsSource(this.indexName)}, columns: ${jsonToTsSource(this.columns)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nvar DropIndexCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"dropIndex\";\n\toperationClass = \"destructive\";\n\ttableName;\n\tindexName;\n\tlabel;\n\tconstructor(tableName, indexName) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.indexName = indexName;\n\t\tthis.label = `Drop index ${indexName} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `DropIndexCall.toOp: a lowerer is required on the SQLite planner path (index \"${this.indexName}\" on table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName,\n\t\t\tindexName: this.indexName\n\t\t} });\n\t\tconst checks = indexExistsAst(this.indexName);\n\t\tconst present = await lowerer.lowerToExecuteRequest(checks.indexPresent());\n\t\tconst absent = await lowerer.lowerToExecuteRequest(checks.indexAbsent());\n\t\treturn {\n\t\t\tid: `dropIndex.${this.tableName}.${this.indexName}`,\n\t\t\tlabel: `Drop index ${this.indexName} on ${this.tableName}`,\n\t\t\tsummary: `Drops index ${this.indexName} on ${this.tableName} which is not in the contract`,\n\t\t\toperationClass: \"destructive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"index\", this.indexName, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure index \"${this.indexName}\" exists`, present.sql, present.params)],\n\t\t\texecute: [step(`drop index \"${this.indexName}\"`, buildDropIndexSql(this.indexName))],\n\t\t\tpostcheck: [step(`verify index \"${this.indexName}\" is gone`, absent.sql, absent.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.dropIndex({ table: ${jsonToTsSource(this.tableName)}, index: ${jsonToTsSource(this.indexName)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\n/**\n* A planner-generated data-transform stub. The current default strategy\n* (`nullabilityTighteningBackfillStrategy`) emits one of these with a\n* backfill-flavored `id`/`label` when the policy allows `'data'` and the\n* contract tightens a column's nullability, but the op itself is generic —\n* any future strategy that needs a placeholder data step can construct one\n* with its own id/label.\n*\n* `toOp()` always throws `MIGRATION.UNFILLED_PLACEHOLDER`: the planner cannot lower a stubbed\n* transform to a runtime op — the user must edit the rendered\n* `migration.ts` and re-emit.\n*/\nvar DataTransformCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"dataTransform\";\n\toperationClass = \"data\";\n\tid;\n\tlabel;\n\ttableName;\n\tcolumnName;\n\tconstructor(id, label, tableName, columnName) {\n\t\tsuper();\n\t\tthis.id = id;\n\t\tthis.label = label;\n\t\tthis.tableName = tableName;\n\t\tthis.columnName = columnName;\n\t\tthis.freeze();\n\t}\n\ttoOp(_lowerer) {\n\t\tthrow errorUnfilledPlaceholder(this.label);\n\t}\n\trenderTypeScript() {\n\t\tconst slot = `${this.tableName}-${this.columnName}-backfill-sql`;\n\t\treturn [\n\t\t\t\"dataTransform({\",\n\t\t\t` id: ${jsonToTsSource(this.id)},`,\n\t\t\t` label: ${jsonToTsSource(this.label)},`,\n\t\t\t` table: ${jsonToTsSource(this.tableName)},`,\n\t\t\t` description: ${jsonToTsSource(`Backfill NULL ${this.columnName} values in ${this.tableName}`)},`,\n\t\t\t` run: () => placeholder(${jsonToTsSource(slot)}),`,\n\t\t\t\"})\"\n\t\t].join(\"\\n\");\n\t}\n\timportRequirements() {\n\t\treturn [{\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: this.factoryName\n\t\t}, {\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: \"placeholder\"\n\t\t}];\n\t}\n};\n/**\n* Laundered pre-built operation. Mirrors Postgres's `RawSqlCall`: wraps an\n* already-materialized `SqlMigrationPlanOperation` (typically produced by a\n* SQL-family helper or a codec lifecycle hook) so the planner can carry it\n* alongside structured call IR. `toOp()` returns the stored op unchanged;\n* `renderTypeScript()` emits `rawSql({...})` with the op serialized as a\n* JSON literal — round-tripping requires every field on the op to be\n* JSON-serializable (no closures).\n*/\nvar RawSqlCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"rawSql\";\n\toperationClass;\n\tlabel;\n\top;\n\tconstructor(op) {\n\t\tsuper();\n\t\tthis.op = op;\n\t\tthis.label = op.label;\n\t\tthis.operationClass = op.operationClass;\n\t\tthis.freeze();\n\t}\n\ttoOp(_lowerer) {\n\t\treturn this.op;\n\t}\n\trenderTypeScript() {\n\t\treturn `rawSql(${jsonToTsSource(this.op)})`;\n\t}\n};\n//#endregion\nexport { DropColumnCall as a, RawSqlCall as c, buildRecreateSummary as d, step as f, renderDefaultLiteral as h, DataTransformCall as i, RecreateTableCall as l, buildColumnTypeSql as m, CreateIndexCall as n, DropIndexCall as o, buildColumnDefaultSql as p, CreateTableCall as r, DropTableCall as s, AddColumnCall as t, buildRecreatePostchecks as u };\n\n//# sourceMappingURL=op-factory-call-gc26GqyA.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,2BAA2B;AACjC,SAAS,qBAAqB,YAAY;CACzC,IAAI,CAAC,yBAAyB,KAAK,UAAU,GAAG,MAAM,YAAY,gCAAgC,yCAAyC,WAAW,8DAA8D,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AAC7O;AACA,SAAS,4BAA4B,YAAY;CAChD,IAAI,WAAW,SAAS,GAAG,KAAK,sBAAsB,KAAK,UAAU,GAAG,MAAM,YAAY,4BAA4B,2CAA2C,WAAW,yFAAyF,EAAE,MAAM,EAAE,WAAW,EAA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B,QAAQ;EACT,CAAC;CACF;AACD;;;;;;;;;;AAUA,IAAI,aAAa,cAAc,wBAAwB;CACtD,cAAc;CACd;CACA;CACA;CACA,YAAY,IAAI;EACf,MAAM;EACN,KAAK,KAAK;EACV,KAAK,QAAQ,GAAG;EAChB,KAAK,iBAAiB,GAAG;EACzB,KAAK,OAAO;CACb;CACA,KAAK,UAAU;EACd,OAAO,KAAK;CACb;CACA,mBAAmB;EAClB,OAAO,UAAU,eAAe,KAAK,EAAE,EAAE;CAC1C;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"planner-CuewJa-j-B7nPsjLN.mjs","names":["#lowerer"],"sources":["../../../../3-targets/3-targets/sqlite/dist/planner-CuewJa-j.mjs"],"sourcesContent":["import { n as sqliteError } from \"./errors-DnR-sMHS.mjs\";\nimport { a as DropColumnCall, d as buildRecreateSummary, h as renderDefaultLiteral, i as DataTransformCall, l as RecreateTableCall, m as buildColumnTypeSql, n as CreateIndexCall, o as DropIndexCall, p as buildColumnDefaultSql, r as CreateTableCall, s as DropTableCall, t as AddColumnCall, u as buildRecreatePostchecks } from \"./op-factory-call-gc26GqyA.mjs\";\nimport { t as CONTROL_TABLE_NAMES } from \"./control-tables-D_o8dKRB.mjs\";\nimport { t as TypeScriptRenderableSqliteMigration } from \"./planner-produced-sqlite-migration-C9uVDKrJ.mjs\";\nimport { DdlColumn, ForeignKeyConstraint, FunctionColumnDefault, LiteralColumnDefault, PrimaryKeyConstraint, UniqueConstraint } from \"@internal/sql-relational-core/ast\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { RelationalSchemaNodeKind, SqlSchemaIR, SqlTableIR, relationalNodeGranularity } from \"@internal/sql-schema-ir/types\";\nimport { UNBOUND_NAMESPACE_ID, entityAt } from \"@internal/framework-components/ir\";\nimport { buildNativeTypeExpander, contractToSchemaIR, detectTableNameCaseChanges, extractCodecControlHooks, planFieldEventOperations, plannerFailure } from \"@internal/family-sql/control\";\nimport { verifySqlSchemaByDiff } from \"@internal/family-sql/diff\";\nimport { diffSchemas, issueOutcome, orderIssuesByDependencies } from \"@internal/framework-components/control\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { InternalError, assertNever } from \"@internal/utils/internal-error\";\n//#region src/core/migrations/diff-database-schema.ts\n/** Renders a column default for the SQLite dialect. */\nfunction sqliteRenderDefault(def, _column) {\n\tif (def.kind === \"function\") {\n\t\tif (def.expression === \"now()\") return \"datetime('now')\";\n\t\treturn def.expression;\n\t}\n\treturn renderDefaultLiteral(def.value);\n}\n/**\n* The SQLite expected-side projection: contract → flat relational schema IR.\n*\n* `extras` thread the plan-time derivation input: the native-type expander,\n* so the expected side carries resolved native types (like the verify\n* side). Every expected column also carries its `codecRef` unconditionally\n* (Decision 5) — the planner's op-builders resolve DDL rendering from it at\n* plan time, so no separate render stamper is threaded here.\n*/\nfunction sqliteContractToSchema(contract, extras) {\n\treturn contractToSchemaIR(contract, {\n\t\tannotationNamespace: \"sqlite\",\n\t\trenderDefault: sqliteRenderDefault,\n\t\t...ifDefined(\"expandNativeType\", extras?.expandNativeType)\n\t});\n}\n/**\n* The SQLite schema verify: the full-tree node-diff verdict wrapped in the\n* issue-based result envelope. Used by the runner's post-apply check; the\n* family `verifySchema` runs the same composition via the descriptor hook.\n*/\nfunction verifySqliteDatabaseSchema(input) {\n\treturn verifySqlSchemaByDiff({\n\t\tcontract: input.contract,\n\t\tschema: input.actualSchema,\n\t\tstrict: input.strict,\n\t\tframeworkComponents: input.frameworkComponents,\n\t\tdiffSchema: diffSqliteSchema,\n\t\tgranularityOf: relationalNodeGranularity\n\t});\n}\n/**\n* Resolves a verdict-diff issue's subject table's declared control policy\n* directly from the contract. SQLite's expected tree is flat, so the issue\n* path carries no namespace segment — `path[1]` is the table name (`path[0]`\n* is the tree root's own id); every contract namespace is searched for that\n* table name (table names are globally unique in the flat tree — duplicates\n* across namespaces are rejected earlier, at `contractToSchemaIR`).\n*/\nfunction resolveControlPolicy(issue, contract) {\n\tconst tableName = issue.path[1];\n\tif (tableName === void 0) return void 0;\n\tfor (const namespaceId of Object.keys(contract.storage.namespaces)) {\n\t\tconst table = entityAt(contract.storage, {\n\t\t\tnamespaceId,\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: tableName\n\t\t});\n\t\tif (table !== void 0) return table.control;\n\t}\n}\n/**\n* The SQLite full-tree node diff for the family verify verdict: derive the\n* expected flat tree with resolved leaf values (expander threaded so\n* parameterized types compare expanded; FK nodes born with the flat empty\n* `resolvedReferencedNamespace`), and run the generic differ over the trees\n* as derived. Flat targets need no ownership scoping. The codec `verifyType`\n* hooks run once per contract namespace with tables, each against the sole\n* flat actual root — exactly the legacy per-namespace pairing.\n*/\nfunction diffSqliteSchema(input) {\n\tconst expandNativeType = buildNativeTypeExpander(input.frameworkComponents);\n\tconst expected = sqliteContractToSchema(input.contract, { ...ifDefined(\"expandNativeType\", expandNativeType) });\n\tconst actual = input.schema instanceof SqlSchemaIR ? input.schema : blindCast(input.schema);\n\treturn {\n\t\tissues: diffSchemas(expected, actual),\n\t\tresolveControlPolicy: (issue) => resolveControlPolicy(issue, input.contract),\n\t\tnamespacePairs: Object.values(input.contract.storage.namespaces).filter((ns) => Object.keys(ns.entries.table ?? {}).length > 0).map(() => ({ actual }))\n\t};\n}\n/**\n* The SQLite planner's diff input: the same tree-building\n* `diffSqliteSchema` uses (expander threaded, FK nodes born flat). One differ\n* drives both verify and plan over the trees as derived; this is the plan-side\n* derivation — column DDL resolves from each expected column's `codecRef` at\n* plan time (`column-ddl-rendering.ts`), so no separate render stamping happens here.\n*/\nfunction buildSqlitePlanDiff(input) {\n\tconst expandNativeType = buildNativeTypeExpander(input.frameworkComponents);\n\tconst expected = sqliteContractToSchema(input.contract, { ...ifDefined(\"expandNativeType\", expandNativeType) });\n\tconst actual = new SqlSchemaIR(withRecordKeyNames(input.actualSchema));\n\treturn {\n\t\texpected,\n\t\tactual,\n\t\tissues: diffSchemas(expected, actual)\n\t};\n}\n/**\n* Every schema-tree builder in this codebase derives a table's / column's\n* `name` from the record key it's stored under (`contractToSchemaIR`,\n* the SQLite introspection adapter) rather than trusting a redundant\n* embedded field — the record key IS the identity. Mirrors that discipline\n* for the actual/live tree before construction, so `SqlTableIR.id` /\n* `SqlColumnIR.id` (both derived from `.name`) are always correct without\n* requiring every caller to duplicate the key onto the value. A no-op for a\n* tree that already carries matching names (the real introspection adapter\n* always does).\n*/\nfunction withRecordKeyNames(actualSchema) {\n\tconst raw = blindCast(actualSchema);\n\tconst tables = {};\n\tfor (const [tableName, table] of Object.entries(raw.tables ?? {})) {\n\t\tconst rawTable = blindCast(table);\n\t\tconst columns = {};\n\t\tfor (const [columnName, column] of Object.entries(blindCast(table).columns ?? {})) columns[columnName] = {\n\t\t\t...blindCast(column),\n\t\t\tname: columnName\n\t\t};\n\t\ttables[tableName] = {\n\t\t\t...rawTable,\n\t\t\tname: tableName,\n\t\t\tcolumns,\n\t\t\tforeignKeys: rawTable.foreignKeys ?? [],\n\t\t\tuniques: rawTable.uniques ?? [],\n\t\t\tindexes: rawTable.indexes ?? []\n\t\t};\n\t}\n\treturn { tables };\n}\n//#endregion\n//#region src/core/migrations/column-ddl-rendering.ts\n/**\n* Reconstructs the `StorageColumn`-shaped fields `buildColumnTypeSql` /\n* `buildColumnDefaultSql` expect, from a column node's own stamped codec\n* identity (`codecRef` / `codecBaseNativeType`, Decision 5) — never the\n* contract. SQLite's type renderer only uppercases the resolved base type\n* (no parameterized expansion, no named-type quoting), so `typeRef` is\n* deliberately left unset here: setting it would send `buildColumnTypeSql`\n* back through a live `storageTypes` lookup the node's fields have already\n* resolved past, which throws for an unrecognized reference (unlike\n* Postgres's lenient fallback).\n*/\nfunction columnLike(column) {\n\tif (column.codecRef === void 0 || column.codecBaseNativeType === void 0) throw new InternalError(`columnLike: expected column \"${column.name}\" carries no codec identity — the expected tree must be derived via contractToSchemaIR for planning`);\n\treturn {\n\t\tnativeType: column.codecBaseNativeType,\n\t\tcodecId: column.codecRef.codecId,\n\t\tnullable: column.nullable,\n\t\t...(column.many ?? column.codecRef.many) !== void 0 ? { many: column.many ?? column.codecRef.many } : {},\n\t\t...column.codecRef.typeParams !== void 0 ? { typeParams: blindCast(column.codecRef.typeParams) } : {},\n\t\t...column.resolvedDefault !== void 0 ? { default: column.resolvedDefault } : {}\n\t};\n}\nfunction sqliteDefaultToDdlColumnDefault(columnDefault) {\n\tif (!columnDefault) return void 0;\n\tswitch (columnDefault.kind) {\n\t\tcase \"literal\": return new LiteralColumnDefault(columnDefault.value);\n\t\tcase \"function\":\n\t\t\tif (columnDefault.expression === \"autoincrement()\") return void 0;\n\t\t\treturn new FunctionColumnDefault(columnDefault.expression);\n\t\tdefault: {\n\t\t\tconst exhaustive = columnDefault;\n\t\t\treturn assertNever(exhaustive, `sqliteDefaultToDdlColumnDefault: unhandled kind \"${blindCast(exhaustive).kind}\"`);\n\t\t}\n\t}\n}\n/**\n* True when the column is rendered inline as `INTEGER PRIMARY KEY\n* AUTOINCREMENT` — the sole member of the table's primary key with an\n* `autoincrement()` default. Node-based sibling of the retired\n* `isInlineAutoincrementPrimaryKey` (which read the raw `StorageTable`);\n* reads the table/column nodes instead.\n*/\nfunction isInlineAutoincrementPrimaryKeyNode(table, column) {\n\tif (table.primaryKey?.columns.length !== 1) return false;\n\tif (table.primaryKey.columns[0] !== column.name) return false;\n\treturn column.resolvedDefault?.kind === \"function\" && column.resolvedDefault.expression === \"autoincrement()\";\n}\n/**\n* Builds the flat `SqliteColumnSpec` `AddColumnCall` / `RecreateTableCall`\n* need, resolved from the column node's codec identity — the same builders\n* the pre-`plan(start, end)` op-path called, so the output is\n* byte-identical.\n*/\nfunction columnSpecFromNode(column, inline) {\n\tconst like = columnLike(column);\n\tconst typeSql = buildColumnTypeSql(like, {});\n\tconst defaultSql = buildColumnDefaultSql(like.default);\n\treturn {\n\t\tname: column.name,\n\t\ttypeSql,\n\t\tdefaultSql,\n\t\tnullable: column.nullable,\n\t\t...inline ? { inlineAutoincrementPrimaryKey: true } : {}\n\t};\n}\n/**\n* Builds the `DdlColumn` the `CreateTableCall` path needs, resolved from the\n* column node's codec identity.\n*/\nfunction ddlColumnFromNode(column, inline) {\n\tconst like = columnLike(column);\n\tconst typeSql = buildColumnTypeSql(like, {});\n\tif (inline) return new DdlColumn({\n\t\tname: column.name,\n\t\ttype: `${typeSql} PRIMARY KEY AUTOINCREMENT`\n\t});\n\tconst colDefault = sqliteDefaultToDdlColumnDefault(like.default);\n\treturn new DdlColumn({\n\t\tname: column.name,\n\t\ttype: typeSql,\n\t\t...!column.nullable ? { notNull: true } : {},\n\t\t...colDefault !== void 0 ? { default: colDefault } : {},\n\t\t...column.codecRef !== void 0 ? { codecRef: column.codecRef } : {}\n\t});\n}\n/**\n* Builds the table-level constraints (PK / unique / FK) for a `CreateTable`\n* path from the table node — the node-sourced sibling of the retired\n* contract-based `tableToDdlParts`'s constraint half.\n*\n* A check constraint on the table node throws rather than being dropped.\n* `@@check` is refused earlier, by the `sql.checkConstraint` capability gate in\n* PSL interpretation. The TS `check()` builder is not gated there — capabilities\n* are adapter-reported and reach the contract only after it is built — so a\n* `check()` declared against SQLite arrives here, and this is where it is\n* refused. It is the primary enforcement point for that surface, and the safety\n* net for a contract that reached storage some other way.\n*/\nfunction tableConstraintsFromNode(table, hasInlinePk) {\n\tconst constraints = [];\n\tif (table.primaryKey && !hasInlinePk) constraints.push(new PrimaryKeyConstraint({ columns: table.primaryKey.columns }));\n\tfor (const check of table.checks ?? []) throw sqliteError(\"CONTRACT.CONSTRAINT_INVALID\", `The SQLite target does not support CHECK constraints (constraint \"${check.name}\" on table \"${table.name}\"). The \"checkConstraint\" capability is Postgres-only — remove the \"@@check\" / \"check()\" declaration, or target Postgres.`, { meta: {\n\t\tconstraintName: check.name,\n\t\ttableName: table.name\n\t} });\n\tfor (const u of table.uniques) constraints.push(new UniqueConstraint({\n\t\tcolumns: u.columns,\n\t\t...u.name !== void 0 ? { name: u.name } : {}\n\t}));\n\tfor (const fk of table.foreignKeys) constraints.push(new ForeignKeyConstraint({\n\t\tcolumns: fk.columns,\n\t\trefTable: fk.referencedTable,\n\t\trefColumns: fk.referencedColumns,\n\t\t...fk.name !== void 0 ? { name: fk.name } : {},\n\t\t...fk.onDelete !== void 0 ? { onDelete: fk.onDelete } : {},\n\t\t...fk.onUpdate !== void 0 ? { onUpdate: fk.onUpdate } : {}\n\t}));\n\treturn constraints;\n}\n//#endregion\n//#region src/core/migrations/planner-strategies.ts\n/**\n* Classifies a node issue into the operation class a recreate absorbing it\n* would need, or `null` when the strategy doesn't handle this node/reason at\n* all (table/column not-found-or-not-expected, and index issues — those are\n* standalone ops, never folded into a recreate).\n*\n* Column drift is a single `not-equal` issue now (type AND nullability\n* compared together by `SqlColumnIR.isEqualTo`), so this reads both fields\n* off the node pair directly rather than trusting a separate issue kind per\n* attribute: a type change is always destructive; a pure nullability change\n* is destructive when tightening (NOT NULL required) and widening when\n* relaxing.\n*/\nfunction classifyNodeIssue(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return null;\n\tswitch (blindCast(node).nodeKind) {\n\t\tcase RelationalSchemaNodeKind.column: {\n\t\t\tif (issueOutcome(issue) !== \"not-equal\") return null;\n\t\t\tconst expected = blindCast(issue.expected);\n\t\t\tif (columnTypeChanged(expected, blindCast(issue.actual))) return \"destructive\";\n\t\t\treturn expected.nullable ? \"widening\" : \"destructive\";\n\t\t}\n\t\tcase RelationalSchemaNodeKind.columnDefault: return issueOutcome(issue) === \"not-expected\" ? \"destructive\" : \"widening\";\n\t\tcase RelationalSchemaNodeKind.primaryKey:\n\t\tcase RelationalSchemaNodeKind.foreignKey:\n\t\tcase RelationalSchemaNodeKind.unique: return \"destructive\";\n\t\tdefault: return null;\n\t}\n}\n/**\n* Groups recreate-eligible issues by table, decides per-table operation class\n* (destructive wins over widening), and emits one `RecreateTableCall` per\n* table. Returns unchanged-or-smaller issue list — issues the strategy\n* consumed are removed so `mapNodeIssueToCall` doesn't double-handle them.\n*\n* The full desired/live table shapes come from `ctx.expected`/`ctx.actual`\n* directly (keyed by table name — SQLite is a flat, single-namespace target)\n* rather than from any individual issue, since a single drifted attribute's\n* issue only carries that attribute's own node, never the whole table.\n*/\nconst recreateTableStrategy = (issues, ctx) => {\n\tconst byTable = /* @__PURE__ */ new Map();\n\tconst consumed = /* @__PURE__ */ new Set();\n\tfor (const issue of issues) {\n\t\tconst cls = classifyNodeIssue(issue);\n\t\tif (!cls) continue;\n\t\tconst tableName = issue.path[1];\n\t\tif (tableName === void 0) continue;\n\t\tconst entry = byTable.get(tableName);\n\t\tif (entry) {\n\t\t\tentry.issues.push(issue);\n\t\t\tif (cls === \"destructive\") entry.hasDestructive = true;\n\t\t} else byTable.set(tableName, {\n\t\t\tissues: [issue],\n\t\t\thasDestructive: cls === \"destructive\"\n\t\t});\n\t\tconsumed.add(issue);\n\t}\n\tif (byTable.size === 0) return { kind: \"no_match\" };\n\tconst calls = [];\n\tfor (const [tableName, entry] of byTable) {\n\t\tconst expectedTable = ctx.expected.tables[tableName];\n\t\tconst actualTable = ctx.actual.tables[tableName];\n\t\tif (!expectedTable || !actualTable) continue;\n\t\tconst operationClass = entry.hasDestructive ? \"destructive\" : \"widening\";\n\t\tconst tableSpec = tableSpecFromNode(expectedTable);\n\t\tconst indexes = expectedTable.indexes.map((idx) => ({\n\t\t\tname: idx.name,\n\t\t\tcolumns: idx.columns ?? []\n\t\t}));\n\t\tcalls.push(new RecreateTableCall({\n\t\t\ttableName,\n\t\t\tcontractTable: tableSpec,\n\t\t\tschemaColumnNames: Object.keys(actualTable.columns),\n\t\t\tindexes,\n\t\t\tsummary: buildRecreateSummary(tableName, entry.issues),\n\t\t\tpostchecks: buildRecreatePostchecks(tableName, entry.issues, tableSpec),\n\t\t\toperationClass\n\t\t}));\n\t}\n\treturn {\n\t\tkind: \"match\",\n\t\tissues: issues.filter((i) => !consumed.has(i)),\n\t\tcalls,\n\t\trecipe: true\n\t};\n};\n/**\n* When the policy allows `'data'` and the expected tree tightens one or more\n* columns from nullable to NOT NULL, emit a `DataTransformCall` stub per\n* tightened column. The user fills the backfill `UPDATE` in the rendered\n* `migration.ts` before the subsequent `RecreateTableCall` copies data into\n* the tightened schema (whose `INSERT INTO temp SELECT … FROM old` would\n* otherwise fail at runtime if any `NULL`s remain).\n*\n* Does NOT consume the tightening issue — `recreateTableStrategy` still\n* needs it to produce the actual recreate that enforces the NOT NULL at\n* the schema level. The backfill op and the recreate op end up in the\n* recipe slot in strategy order (backfill first, recreate second), which\n* matches the required execution order.\n*\n* Mirrors Postgres's `nullableTighteningCallStrategy` / `'data'`-class\n* gating. When `'data'` is not in the policy (the default `db update` /\n* `db init` path), the strategy short-circuits and the recreate alone\n* runs with its current destructive-class gating — preserving today's\n* behavior where a tightening blows up at runtime if NULLs are present.\n*/\nconst nullabilityTighteningBackfillStrategy = (issues, ctx) => {\n\tif (!ctx.policy.allowedOperationClasses.includes(\"data\")) return { kind: \"no_match\" };\n\tconst calls = [];\n\tfor (const issue of issues) {\n\t\tif (issueOutcome(issue) !== \"not-equal\" || issue.expected === void 0 || issue.actual === void 0) continue;\n\t\tif (blindCast(issue.expected).nodeKind !== RelationalSchemaNodeKind.column) continue;\n\t\tconst expectedColumn = blindCast(issue.expected);\n\t\tconst actualColumn = blindCast(issue.actual);\n\t\tif (expectedColumn.nullable === actualColumn.nullable) continue;\n\t\tif (expectedColumn.nullable) continue;\n\t\tconst tableName = issue.path[1];\n\t\tif (tableName === void 0) continue;\n\t\tcalls.push(new DataTransformCall(`data_migration.backfill-${tableName}-${expectedColumn.name}`, `Backfill NULLs in \"${tableName}\".\"${expectedColumn.name}\" before NOT NULL tightening`, tableName, expectedColumn.name));\n\t}\n\tif (calls.length === 0) return { kind: \"no_match\" };\n\treturn {\n\t\tkind: \"match\",\n\t\tissues,\n\t\tcalls,\n\t\trecipe: true\n\t};\n};\nconst sqlitePlannerStrategies = [nullabilityTighteningBackfillStrategy, recreateTableStrategy];\n//#endregion\n//#region src/core/migrations/issue-planner.ts\n/**\n* The generic differ is total: a missing/extra table (or column) emits an\n* issue for itself AND for every node in its subtree (columns, defaults,\n* constraints, indexes). `CreateTableCall`/`DropTableCall` and\n* `AddColumnCall`/`DropColumnCall` already account for the whole subtree\n* (reading it directly off the table/column node), so the nested issues are\n* redundant — coalescing them is \"the planner's responsibility\" the differ's\n* own contract assigns (`schema-diff.ts`). Drops any issue whose path is a\n* strict descendant of a `not-found`/`not-expected` issue's path.\n*/\nfunction coalesceSubtreeIssues(issues) {\n\tconst collapsingPaths = issues.filter((issue) => issueOutcome(issue) === \"not-found\" || issueOutcome(issue) === \"not-expected\").map((issue) => issue.path);\n\tif (collapsingPaths.length === 0) return issues;\n\treturn issues.filter((issue) => !collapsingPaths.some((ancestor) => isStrictDescendantPath(issue.path, ancestor)));\n}\nfunction isStrictDescendantPath(path, ancestor) {\n\tif (path.length <= ancestor.length) return false;\n\tfor (let i = 0; i < ancestor.length; i += 1) if (path[i] !== ancestor[i]) return false;\n\treturn true;\n}\nfunction issueNode(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\treturn blindCast(node);\n}\n/** Whether the expected/actual native type (resolved, or raw+many fallback) differs — mirrors `SqlColumnIR.isEqualTo`'s type comparison. */\nfunction columnTypeChanged(expected, actual) {\n\tif (expected.resolvedNativeType !== void 0 && actual.resolvedNativeType !== void 0) return expected.resolvedNativeType !== actual.resolvedNativeType;\n\treturn expected.nativeType !== actual.nativeType || Boolean(expected.many) !== Boolean(actual.many);\n}\n/**\n* Builds the flat `SqliteTableSpec` `RecreateTableCall` needs from the\n* expected table node — the node-sourced equivalent of the retired\n* `toTableSpec` (which read a raw contract `StorageTable`). Every column's\n* spec is resolved from its `codecRef` via `columnSpecFromNode`.\n*/\nfunction tableSpecFromNode(table) {\n\tconst columns = Object.values(table.columns).map((c) => columnSpecFromNode(c, isInlineAutoincrementPrimaryKeyNode(table, c)));\n\tconst uniques = table.uniques.map((u) => ({\n\t\tcolumns: u.columns,\n\t\t...u.name !== void 0 ? { name: u.name } : {}\n\t}));\n\tconst foreignKeys = table.foreignKeys.map((fk) => ({\n\t\tcolumns: fk.columns,\n\t\treferences: {\n\t\t\ttable: fk.referencedTable,\n\t\t\tcolumns: fk.referencedColumns\n\t\t},\n\t\t...fk.name !== void 0 ? { name: fk.name } : {},\n\t\t...fk.onDelete !== void 0 ? { onDelete: fk.onDelete } : {},\n\t\t...fk.onUpdate !== void 0 ? { onUpdate: fk.onUpdate } : {}\n\t}));\n\treturn {\n\t\tcolumns,\n\t\t...table.primaryKey ? { primaryKey: { columns: table.primaryKey.columns } } : {},\n\t\tuniques,\n\t\tforeignKeys\n\t};\n}\nfunction issueConflict(kind, summary, location) {\n\treturn {\n\t\tkind,\n\t\tsummary,\n\t\twhy: \"Use `migration new` to author a custom migration for this change.\",\n\t\t...location ? { location } : {}\n\t};\n}\nfunction issueLocation(tableName, columnName) {\n\treturn columnName !== void 0 ? {\n\t\tentityKind: \"table\",\n\t\tentityName: tableName,\n\t\tcolumn: columnName\n\t} : {\n\t\tentityKind: \"table\",\n\t\tentityName: tableName\n\t};\n}\n/**\n* Conflict kind for a node kind that `recreateTableStrategy` absorbs for\n* every reachable production issue. Reaching `mapNodeIssueToCall` for one of\n* these means the recreate strategy didn't run — mirrors the legacy\n* `conflictKindForIssue` per-kind categorization.\n*/\nfunction absorbedConflictKind(nodeKind) {\n\tswitch (nodeKind) {\n\t\tcase RelationalSchemaNodeKind.primaryKey:\n\t\tcase RelationalSchemaNodeKind.unique: return \"indexIncompatible\";\n\t\tcase RelationalSchemaNodeKind.foreignKey: return \"foreignKeyConflict\";\n\t\tdefault: return \"missingButNonAdditive\";\n\t}\n}\n/**\n* Builds the `CreateTableCall` + per-index `CreateIndexCall`s for a\n* newly-expected table. Reads only the table node's own children — indexes\n* (declared + FK-backing, deduped) are already merged and ordered at\n* derivation (`contractToSchemaIR`'s `convertTable`).\n*/\nfunction buildCreateTableCalls(table) {\n\tconst columns = Object.values(table.columns).map((c) => ddlColumnFromNode(c, isInlineAutoincrementPrimaryKeyNode(table, c)));\n\tconst constraints = tableConstraintsFromNode(table, Object.values(table.columns).some((c) => isInlineAutoincrementPrimaryKeyNode(table, c)));\n\tconst calls = [new CreateTableCall(table.name, columns, constraints.length > 0 ? constraints : void 0)];\n\tfor (const index of table.indexes) {\n\t\tconst indexName = index.name;\n\t\tcalls.push(new CreateIndexCall(table.name, indexName, index.columns ?? []));\n\t}\n\treturn calls;\n}\nfunction mapTableIssue(issue) {\n\tif (issueOutcome(issue) === \"not-found\") return ok(buildCreateTableCalls(blindCast(issue.expected)));\n\tif (issueOutcome(issue) === \"not-expected\") {\n\t\tconst table = blindCast(issue.actual);\n\t\tif (CONTROL_TABLE_NAMES.has(table.name)) return ok([]);\n\t\treturn ok([new DropTableCall(table.name)]);\n\t}\n\treturn notOk(issueConflict(\"unsupportedOperation\", `Unexpected table drift: ${issue.path.join(\"/\")}`));\n}\nfunction mapColumnIssue(issue, ctx) {\n\tconst tableName = issue.path[1];\n\tif (tableName === void 0) return notOk(issueConflict(\"unsupportedOperation\", `Column issue has no table in its path: ${issue.path.join(\"/\")}`));\n\tif (issueOutcome(issue) === \"not-found\") {\n\t\tconst column = blindCast(issue.expected);\n\t\tconst table = ctx.expected.tables[tableName];\n\t\treturn ok([new AddColumnCall(tableName, columnSpecFromNode(column, table !== void 0 && isInlineAutoincrementPrimaryKeyNode(table, column)))]);\n\t}\n\tif (issueOutcome(issue) === \"not-expected\") return ok([new DropColumnCall(tableName, blindCast(issue.actual).name)]);\n\tconst expected = blindCast(issue.expected);\n\treturn notOk(issueConflict(columnTypeChanged(expected, blindCast(issue.actual)) ? \"typeMismatch\" : \"nullabilityConflict\", issue.path.join(\"/\"), issueLocation(tableName, expected.name)));\n}\nfunction mapIndexIssue(issue) {\n\tconst tableName = issue.path[1];\n\tif (tableName === void 0) return notOk(issueConflict(\"unsupportedOperation\", `Index issue has no table in its path: ${issue.path.join(\"/\")}`));\n\tif (issueOutcome(issue) === \"not-found\") {\n\t\tconst index = blindCast(issue.expected);\n\t\tconst indexName = index.name;\n\t\treturn ok([new CreateIndexCall(tableName, indexName, index.columns ?? [])]);\n\t}\n\tif (issueOutcome(issue) === \"not-expected\") {\n\t\tconst indexName = blindCast(issue.actual).name;\n\t\treturn ok([new DropIndexCall(tableName, indexName)]);\n\t}\n\treturn notOk(issueConflict(\"indexIncompatible\", issue.path.join(\"/\"), issueLocation(tableName)));\n}\nfunction mapNodeIssueToCall(issue, ctx) {\n\tconst node = issueNode(issue);\n\tif (node === void 0) return notOk(issueConflict(\"unsupportedOperation\", `Issue carries neither an expected nor an actual node: ${issue.path.join(\"/\")}`));\n\tswitch (node.nodeKind) {\n\t\tcase RelationalSchemaNodeKind.table: return mapTableIssue(issue);\n\t\tcase RelationalSchemaNodeKind.column: return mapColumnIssue(issue, ctx);\n\t\tcase RelationalSchemaNodeKind.index: return mapIndexIssue(issue);\n\t\tcase RelationalSchemaNodeKind.columnDefault:\n\t\tcase RelationalSchemaNodeKind.primaryKey:\n\t\tcase RelationalSchemaNodeKind.foreignKey:\n\t\tcase RelationalSchemaNodeKind.unique: return notOk(issueConflict(absorbedConflictKind(node.nodeKind), issue.path.join(\"/\")));\n\t\tcase RelationalSchemaNodeKind.check: return notOk(issueConflict(\"unsupportedOperation\", `The SQLite target does not support CHECK constraint DDL: ${issue.path.join(\"/\")}`));\n\t\tdefault: return notOk(issueConflict(\"unsupportedOperation\", `Unhandled node kind: ${node.nodeKind}`));\n\t}\n}\nfunction classifyCall(call) {\n\tswitch (call.factoryName) {\n\t\tcase \"createTable\": return \"create-table\";\n\t\tcase \"addColumn\": return \"add-column\";\n\t\tcase \"createIndex\": return \"create-index\";\n\t\tcase \"dropColumn\": return \"drop-column\";\n\t\tcase \"dropIndex\": return \"drop-index\";\n\t\tcase \"dropTable\": return \"drop-table\";\n\t\tcase \"recreateTable\": return null;\n\t\tdefault: return null;\n\t}\n}\nconst DEFAULT_POLICY = { allowedOperationClasses: [\n\t\"additive\",\n\t\"widening\",\n\t\"destructive\",\n\t\"data\"\n] };\nfunction planIssues(options) {\n\tconst policyProvided = options.policy !== void 0;\n\tconst policy = options.policy ?? DEFAULT_POLICY;\n\tconst frameworkComponents = options.frameworkComponents ?? [];\n\tconst context = {\n\t\texpected: options.expected ?? emptySchemaIR(),\n\t\tactual: options.actual ?? emptySchemaIR(),\n\t\tpolicy,\n\t\tframeworkComponents\n\t};\n\tconst strategies = options.strategies ?? sqlitePlannerStrategies;\n\tlet remaining = options.issues;\n\tconst recipeCalls = [];\n\tconst bucketableCalls = [];\n\tfor (const strategy of strategies) {\n\t\tconst result = strategy(remaining, context);\n\t\tif (result.kind === \"match\") {\n\t\t\tremaining = result.issues;\n\t\t\tif (result.recipe) recipeCalls.push(...result.calls);\n\t\t\telse bucketableCalls.push(...result.calls);\n\t\t}\n\t}\n\tconst sorted = orderIssuesByDependencies(remaining);\n\tconst defaultCalls = [];\n\tconst conflicts = [];\n\tfor (const issue of sorted) {\n\t\tconst result = mapNodeIssueToCall(issue, context);\n\t\tif (result.ok) defaultCalls.push(...result.value);\n\t\telse conflicts.push(result.failure);\n\t}\n\tconst allowed = policy.allowedOperationClasses;\n\tlet gatedRecipe = recipeCalls;\n\tlet gatedBucketable = bucketableCalls;\n\tlet gatedDefault = defaultCalls;\n\tif (policyProvided) {\n\t\tconst sink = (acc) => (call) => {\n\t\t\tif (allowed.includes(call.operationClass)) {\n\t\t\t\tacc.push(call);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconflicts.push(conflictForDisallowedCall(call, allowed));\n\t\t};\n\t\tconst gatedRecipeBucket = [];\n\t\tconst gatedBucketableBucket = [];\n\t\tconst gatedDefaultBucket = [];\n\t\trecipeCalls.forEach(sink(gatedRecipeBucket));\n\t\tbucketableCalls.forEach(sink(gatedBucketableBucket));\n\t\tdefaultCalls.forEach(sink(gatedDefaultBucket));\n\t\tgatedRecipe = gatedRecipeBucket;\n\t\tgatedBucketable = gatedBucketableBucket;\n\t\tgatedDefault = gatedDefaultBucket;\n\t}\n\tif (conflicts.length > 0) return notOk(conflicts);\n\tconst combined = [...gatedDefault, ...gatedBucketable];\n\tconst byCategory = (cat) => combined.filter((c) => classifyCall(c) === cat);\n\treturn ok({ calls: [\n\t\t...byCategory(\"create-table\"),\n\t\t...byCategory(\"add-column\"),\n\t\t...byCategory(\"create-index\"),\n\t\t...gatedRecipe,\n\t\t...byCategory(\"drop-column\"),\n\t\t...byCategory(\"drop-index\"),\n\t\t...byCategory(\"drop-table\")\n\t] });\n}\nfunction emptySchemaIR() {\n\treturn new SqlSchemaIR({ tables: {} });\n}\nfunction conflictForDisallowedCall(call, allowed) {\n\tconst summary = `Operation \"${call.label}\" requires class \"${call.operationClass}\", but policy allows only: ${allowed.join(\", \")}`;\n\tconst location = locationForCall(call);\n\treturn {\n\t\tkind: conflictKindForCall(call),\n\t\tsummary,\n\t\twhy: \"Use `migration new` to author a custom migration for this change.\",\n\t\t...location ? { location } : {}\n\t};\n}\nfunction conflictKindForCall(call) {\n\tswitch (call.factoryName) {\n\t\tcase \"createIndex\":\n\t\tcase \"dropIndex\": return \"indexIncompatible\";\n\t\tdefault: return \"missingButNonAdditive\";\n\t}\n}\nfunction locationForCall(call) {\n\tconst location = {};\n\tif (\"tableName\" in call) {\n\t\tlocation.entityKind = \"table\";\n\t\tlocation.entityName = call.tableName;\n\t}\n\tif (\"columnName\" in call) location.column = call.columnName;\n\tif (\"indexName\" in call) location.index = call.indexName;\n\treturn Object.keys(location).length > 0 ? location : void 0;\n}\n//#endregion\n//#region src/core/migrations/planner.ts\nfunction createSqliteMigrationPlanner(lowerer) {\n\treturn new SqliteMigrationPlanner(lowerer);\n}\n/**\n* SQLite migration planner — a thin wrapper over `planIssues`.\n*\n* `plan()` diffs the live schema against the target contract via the one\n* differ (`buildSqlitePlanDiff`, producing node-typed `SchemaDiffIssue[]`)\n* and delegates to `planIssues` with the registered strategies. Strategies\n* absorb groups of related issues into composite recipes (e.g. recreating a\n* table to apply type/nullability/default/constraint changes at once);\n* anything not absorbed by a strategy flows through `mapNodeIssueToCall` in\n* the issue planner as a one-off call.\n*\n* FK-backing indexes are already merged into the expected table node's\n* `indexes` at derivation (`contractToSchemaIR`'s `convertTable`), so\n* `mapNodeIssueToCall` handles them uniformly alongside user-declared\n* indexes — no separate expansion step in the planner.\n*/\nvar SqliteMigrationPlanner = class {\n\t#lowerer;\n\tconstructor(lowerer) {\n\t\tthis.#lowerer = lowerer;\n\t}\n\tplan(options) {\n\t\treturn this.planSql(options);\n\t}\n\temptyMigration(context, spaceId) {\n\t\treturn new TypeScriptRenderableSqliteMigration([], {\n\t\t\tfrom: context.fromHash,\n\t\t\tto: context.toHash\n\t\t}, spaceId, context.snapshotsImportPath, void 0, this.#lowerer);\n\t}\n\tplanSql(options) {\n\t\tconst policyResult = this.ensureAdditivePolicy(options.policy);\n\t\tif (policyResult) return policyResult;\n\t\tconst { expected, actual, issues } = this.collectSchemaIssues(options);\n\t\tconst caseChangeConflicts = detectTableNameCaseChanges({\n\t\t\tissues,\n\t\t\ttableOf: (issue) => {\n\t\t\t\tconst node = issueNode(issue);\n\t\t\t\treturn node instanceof SqlTableIR ? node : void 0;\n\t\t\t},\n\t\t\tnamespaceIdOf: () => UNBOUND_NAMESPACE_ID\n\t\t});\n\t\tif (caseChangeConflicts.length > 0) return plannerFailure(caseChangeConflicts);\n\t\tconst codecHooks = extractCodecControlHooks(options.frameworkComponents);\n\t\tconst result = planIssues({\n\t\t\tissues,\n\t\t\texpected,\n\t\t\tactual,\n\t\t\tpolicy: options.policy,\n\t\t\tframeworkComponents: options.frameworkComponents,\n\t\t\tstrategies: sqlitePlannerStrategies\n\t\t});\n\t\tif (!result.ok) return plannerFailure(result.failure);\n\t\tconst fieldEventOps = planFieldEventOperations({\n\t\t\tpriorContract: options.fromContract,\n\t\t\tnewContract: options.contract,\n\t\t\tcodecHooks\n\t\t});\n\t\tconst calls = [...result.value.calls, ...fieldEventOps];\n\t\tconst destination = {\n\t\t\tstorageHash: options.contract.storage.storageHash,\n\t\t\t...options.contract.profileHash !== void 0 ? { profileHash: options.contract.profileHash } : {}\n\t\t};\n\t\treturn {\n\t\t\tkind: \"success\",\n\t\t\tplan: new TypeScriptRenderableSqliteMigration(calls, {\n\t\t\t\tfrom: options.fromContract?.storage.storageHash ?? null,\n\t\t\t\tto: options.contract.storage.storageHash\n\t\t\t}, options.spaceId, options.snapshotsImportPath, destination, this.#lowerer)\n\t\t};\n\t}\n\tensureAdditivePolicy(policy) {\n\t\tif (!policy.allowedOperationClasses.includes(\"additive\")) return plannerFailure([{\n\t\t\tkind: \"unsupportedOperation\",\n\t\t\tsummary: \"Migration planner requires additive operations be allowed\",\n\t\t\twhy: \"The planner requires the \\\"additive\\\" operation class to be allowed in the policy.\"\n\t\t}]);\n\t\treturn null;\n\t}\n\t/**\n\t* Diffs the target contract against the live schema via the one differ\n\t* (the same tree-building `diffSqliteSchema` uses, plus the\n\t* op-render stamper) and prepares the issue list `planIssues` consumes.\n\t*\n\t* Three passes, in order:\n\t* 1. Subtree coalescing — the differ is total (a missing/extra table also\n\t* emits an issue for every column/constraint under it); those nested\n\t* issues are redundant once the table-level `CreateTable`/`DropTable`\n\t* call already accounts for the whole subtree. Runs FIRST, over the\n\t* complete diff: a sibling-owned extra table's column issues must\n\t* collapse into its one table-level issue before the ownership pass,\n\t* because a bare column node carries no table reference — if coalescing\n\t* ran after ownership dropped the table-level issue, the orphaned column\n\t* issues would survive and the planner would emit drops against a\n\t* sibling space's table.\n\t* 2. Ownership — a live extra is only this plan's to drop when no contract\n\t* space owns it. The differ ran against THIS space's contract, so a\n\t* table a sibling owns surfaces here as `not-expected`; the planner asks\n\t* the ownership oracle (the passive aggregate) whether any space declares\n\t* it and, if so, leaves it alone. A table no space owns stays a genuine\n\t* extra. Ownership lives in the aggregate; the planner only asks. No\n\t* oracle (single-space) keeps every extra.\n\t* 3. Strict-mode extras gating — `not-expected` (extra table/column/\n\t* constraint) issues are dropped entirely outside strict mode, mirroring\n\t* the retired coordinate walk's `if (strict) { ...extra_* } }` guards:\n\t* an additive-only plan must never even consider dropping an unclaimed\n\t* object, not just refuse to emit the drop.\n\t*/\n\tcollectSchemaIssues(options) {\n\t\tconst allowed = options.policy.allowedOperationClasses;\n\t\tconst strict = allowed.includes(\"widening\") || allowed.includes(\"destructive\");\n\t\tconst { expected, actual, issues: rawIssues } = buildSqlitePlanDiff({\n\t\t\tcontract: options.contract,\n\t\t\tactualSchema: options.schema,\n\t\t\tframeworkComponents: options.frameworkComponents\n\t\t});\n\t\tconst owned = retainUnownedExtras(coalesceSubtreeIssues(rawIssues), options.ownership);\n\t\treturn {\n\t\t\texpected,\n\t\t\tactual,\n\t\t\tissues: strict ? owned : owned.filter((issue) => issueOutcome(issue) !== \"not-expected\")\n\t\t};\n\t}\n};\n/**\n* Drops a `not-expected` issue when it is a whole extra TABLE that some\n* contract space owns, asking the ownership oracle per node.\n*\n* The consultation applies ONLY to table-level extras — a live table this\n* space's contract lacks — identified by asking the issue's own node\n* (`nodeKind === table`), never by counting path segments. SQLite is a\n* single-namespace target, so every coordinate is qualified with the shared\n* `UNBOUND_NAMESPACE_ID` sentinel (the same one the aggregate's declared\n* entities carry for this target). `entityKind` is the literal `'table'`:\n* this function only ever asks about a node already confirmed to be\n* `RelationalSchemaNodeKind.table` (checked just above), and that's a\n* diff-tree `nodeKind` spelling (`'sql-table'`) distinct from the storage\n* `entries` vocabulary `elementCoordinates` walks (`'table'`) — the literal\n* is that storage-entries spelling. `declaresEntity` answers over the whole\n* composition (self included), so a positive answer on such a table means\n* another space owns it (a table this space owned would be in its expected\n* tree, never an extra): leave it. A negative answer means no space owns\n* it — a genuine orphan to drop.\n*\n* A DEEPER extra (an extra column/constraint on a table this space DOES own —\n* only the child drifted, so the table is in the expected tree) is this\n* space's own drift and is always kept for dropping; asking the oracle there\n* would wrongly suppress it, because the owned table answers `true`. No oracle\n* ⇒ every extra is kept (single-space plan).\n*/\nfunction retainUnownedExtras(issues, ownership) {\n\tif (ownership === void 0) return issues;\n\treturn issues.filter((issue) => {\n\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\tconst node = issueNode(issue);\n\t\tif (node === void 0 || node.nodeKind !== RelationalSchemaNodeKind.table) return true;\n\t\tconst tableName = issue.path[1];\n\t\treturn tableName === void 0 || !ownership.declaresEntity({\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: tableName\n\t\t});\n\t});\n}\n//#endregion\nexport { verifySqliteDatabaseSchema as a, sqliteContractToSchema as i, createSqliteMigrationPlanner as n, diffSqliteSchema as r, SqliteMigrationPlanner as t };\n\n//# sourceMappingURL=planner-CuewJa-j.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAS,oBAAoB,KAAK,SAAS;CAC1C,IAAI,IAAI,SAAS,YAAY;EAC5B,IAAI,IAAI,eAAe,SAAS,OAAO;EACvC,OAAO,IAAI;CACZ;CACA,OAAO,qBAAqB,IAAI,KAAK;AACtC;;;;;;;;;;AAUA,SAAS,uBAAuB,UAAU,QAAQ;CACjD,OAAO,mBAAmB,UAAU;EACnC,qBAAqB;EACrB,eAAe;EACf,GAAG,UAAU,oBAAoB,QAAQ,gBAAgB;CAC1D,CAAC;AACF;;;;;;AAMA,SAAS,2BAA2B,OAAO;CAC1C,OAAO,sBAAsB;EAC5B,UAAU,MAAM;EAChB,QAAQ,MAAM;EACd,QAAQ,MAAM;EACd,qBAAqB,MAAM;EAC3B,YAAY;EACZ,eAAe;CAChB,CAAC;AACF;;;;;;;;;AASA,SAAS,qBAAqB,OAAO,UAAU;CAC9C,MAAM,YAAY,MAAM,KAAK;CAC7B,IAAI,cAAc,KAAK,GAAG,OAAO,KAAK;CACtC,KAAK,MAAM,eAAe,OAAO,KAAK,SAAS,QAAQ,UAAU,GAAG;EACnE,MAAM,QAAQ,SAAS,SAAS,SAAS;GACxC;GACA,YAAY;GACZ,YA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