@prisma/orm-target-sqlite 8.0.0-rc.18-dev.7 → 8.0.0-rc.18-dev.8
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-Bp_4Bjff-CjV5K6YY.d.mts → adapter-Bp_4Bjff-Cuo0_i6q.d.mts} +6 -6
- package/dist/{adapter-Bp_4Bjff-CjV5K6YY.d.mts.map → adapter-Bp_4Bjff-Cuo0_i6q.d.mts.map} +1 -1
- package/dist/{adapter-DyfN7eok-DUjF95_9.mjs → adapter-DEhaeqzN-C0ZrfwQ-.mjs} +11 -5
- package/dist/adapter-DEhaeqzN-C0ZrfwQ-.mjs.map +1 -0
- package/dist/adapter-g66WhBm8.d.mts +197 -0
- package/dist/adapter-g66WhBm8.d.mts.map +1 -0
- package/dist/adapter.d.mts +11 -11
- package/dist/adapter.mjs +4 -3
- package/dist/adapter__adapter.d.mts +4 -4
- package/dist/adapter__adapter.mjs +3 -2
- package/dist/adapter__codec-types.d.mts +3 -3
- package/dist/adapter__control.d.mts +2 -2
- package/dist/adapter__control.mjs +4 -4
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +3 -3
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/adapter__sql-renderer.d.mts +2 -2
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/adapter__types.d.mts +3 -3
- package/dist/aggregates-CR6j7ac7.d.mts +164 -0
- package/dist/aggregates-CR6j7ac7.d.mts.map +1 -0
- package/dist/{aggregates-CATLYJxc.mjs → aggregates-PwypcEux.mjs} +29 -16
- package/dist/aggregates-PwypcEux.mjs.map +1 -0
- package/dist/codec-descriptor-BRAsa6-C-BgEz9r06.d.mts +1 -0
- package/dist/codec-descriptor-C_1o9b8y.d.mts +2 -0
- package/dist/{codec-descriptor-Bux_tjPl-DBQU4lFR.d.mts → codec-descriptor-DRF3mQZS-BfVwEGvo.d.mts} +2 -8
- package/dist/{codec-descriptor-Bux_tjPl-DBQU4lFR.d.mts.map → codec-descriptor-DRF3mQZS-BfVwEGvo.d.mts.map} +1 -1
- package/dist/{codec-descriptor-Bf6MlyeJ-C1PfQ9LO.mjs → codec-descriptor-gH7UB_pk-B_gmTZ17.mjs} +4 -4
- package/dist/codec-descriptor-gH7UB_pk-B_gmTZ17.mjs.map +1 -0
- package/dist/codec-types-Bq0ZnV7f.d.mts +2 -0
- package/dist/codec-types-Cm5wtfyY.d.mts +1 -0
- package/dist/{codec-types-nBSWEx87-B8Jiv6Mm.d.mts → codec-types-RGpo5mg_-DwdllfRp.d.mts} +5 -5
- package/dist/{codec-types-nBSWEx87-B8Jiv6Mm.d.mts.map → codec-types-RGpo5mg_-DwdllfRp.d.mts.map} +1 -1
- package/dist/{codecs-DeFZ_0jC-CgA8KUIS.d.mts → codecs-Bpnc9OO2-3poDEyWO.d.mts} +3 -3
- package/dist/{codecs-DeFZ_0jC-CgA8KUIS.d.mts.map → codecs-Bpnc9OO2-3poDEyWO.d.mts.map} +1 -1
- package/dist/{codecs-ZVRcQFS8.mjs → codecs-C2B4QuOX.mjs} +3 -3
- package/dist/{codecs-ZVRcQFS8.mjs.map → codecs-C2B4QuOX.mjs.map} +1 -1
- package/dist/codecs-DkmHzY5t.d.mts +1 -0
- package/dist/{codecs-BctEWIFt-DgMd3dUl.mjs → codecs-Ea350Hl_-Bgfsxc8G.mjs} +5 -11
- package/dist/codecs-Ea350Hl_-Bgfsxc8G.mjs.map +1 -0
- package/dist/contract-contributions-wweWdXMK-D6CBejlZ.mjs +24 -0
- package/dist/contract-contributions-wweWdXMK-D6CBejlZ.mjs.map +1 -0
- package/dist/{control-CVmnzYUI.mjs → control-CPwTTMNh.mjs} +4 -4
- package/dist/{control-CVmnzYUI.mjs.map → control-CPwTTMNh.mjs.map} +1 -1
- package/dist/{control-CzVFdxZ-.d.mts → control-FYHqV1AN.d.mts} +3 -3
- package/dist/{control-CzVFdxZ-.d.mts.map → control-FYHqV1AN.d.mts.map} +1 -1
- package/dist/descriptor-meta-DrNwC4vO-BHbHnBqu.mjs +26 -0
- package/dist/descriptor-meta-DrNwC4vO-BHbHnBqu.mjs.map +1 -0
- package/dist/{migration-DOkUBr8w.mjs → migration-9FS12QGo.mjs} +2 -2
- package/dist/{migration-DOkUBr8w.mjs.map → migration-9FS12QGo.mjs.map} +1 -1
- package/dist/{op-factory-call-hxIbAMSY-CinxsQHg.mjs → op-factory-call-BP8q3moB-BhWwqgfW.mjs} +3 -3
- package/dist/{op-factory-call-hxIbAMSY-CinxsQHg.mjs.map → op-factory-call-BP8q3moB-BhWwqgfW.mjs.map} +1 -1
- package/dist/{pack-D3pJo5Xh.d.mts → pack-DChRrSsM.d.mts} +2 -2
- package/dist/{pack-D3pJo5Xh.d.mts.map → pack-DChRrSsM.d.mts.map} +1 -1
- package/dist/{planner-BENMBCnG-CW6-1do-.mjs → planner-CHVsFdYX-BXkj8Yt8.mjs} +5 -5
- package/dist/{planner-BENMBCnG-CW6-1do-.mjs.map → planner-CHVsFdYX-BXkj8Yt8.mjs.map} +1 -1
- package/dist/{planner-produced-sqlite-migration-DjEZTiif-DpC6rk_q.mjs → planner-produced-sqlite-migration-DxKNqhIl-DrkwVEyy.mjs} +4 -4
- package/dist/{planner-produced-sqlite-migration-DjEZTiif-DpC6rk_q.mjs.map → planner-produced-sqlite-migration-DxKNqhIl-DrkwVEyy.mjs.map} +1 -1
- package/dist/{render-ops-B889CY71-JvEeW9B4.mjs → render-ops-BxptR4vb-CO94GBBd.mjs} +3 -3
- package/dist/{render-ops-B889CY71-JvEeW9B4.mjs.map → render-ops-BxptR4vb-CO94GBBd.mjs.map} +1 -1
- package/dist/{runtime-612DH-du.d.mts → runtime-zwgkZ8R0.d.mts} +2 -2
- package/dist/{runtime-612DH-du.d.mts.map → runtime-zwgkZ8R0.d.mts.map} +1 -1
- package/dist/sql-renderer-C9GzprOC.d.mts +1 -0
- package/dist/{sqlite-migration-CTNkjYJ1-eRdmsbpK.mjs → sqlite-migration-Dn0aIhV7-B1eALxxb.mjs} +4 -4
- package/dist/{sqlite-migration-CTNkjYJ1-eRdmsbpK.mjs.map → sqlite-migration-Dn0aIhV7-B1eALxxb.mjs.map} +1 -1
- package/dist/target.d.mts +8 -8
- package/dist/target.mjs +11 -11
- package/dist/target__aggregates.d.mts +1 -1
- package/dist/target__aggregates.mjs +1 -1
- package/dist/target__codec-descriptor.d.mts +2 -2
- package/dist/target__codec-descriptor.mjs +1 -1
- package/dist/target__codec-types.d.mts +3 -3
- package/dist/target__codecs.d.mts +2 -2
- package/dist/target__codecs.mjs +2 -2
- package/dist/target__control.mjs +1 -1
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__planner-produced-sqlite-migration.mjs +1 -1
- package/dist/target__planner.mjs +1 -1
- package/dist/target__render-ops.mjs +1 -1
- package/dist/types-DMDJ_d9M.d.mts +2 -0
- package/dist/{types-RJMd2PlL-CD7b6qkb.d.mts → types-RJMd2PlL-BpF9DGSQ.d.mts} +3 -3
- package/dist/{types-RJMd2PlL-CD7b6qkb.d.mts.map → types-RJMd2PlL-BpF9DGSQ.d.mts.map} +1 -1
- package/package.json +9 -9
- package/dist/adapter-C1WN74k-.d.mts +0 -2
- package/dist/adapter-DyfN7eok-DUjF95_9.mjs.map +0 -1
- package/dist/aggregates-BGuKJwfI.d.mts +0 -10
- package/dist/aggregates-BGuKJwfI.d.mts.map +0 -1
- package/dist/aggregates-CATLYJxc.mjs.map +0 -1
- package/dist/codec-descriptor-Bf6MlyeJ-C1PfQ9LO.mjs.map +0 -1
- package/dist/codec-descriptor-C-BCHOOC-BGr23_XM.d.mts +0 -1
- package/dist/codec-descriptor-OJw51BEj.d.mts +0 -2
- package/dist/codec-types-6UMpZZ70.d.mts +0 -1
- package/dist/codec-types-FAF08DkX.d.mts +0 -2
- package/dist/codecs-BctEWIFt-DgMd3dUl.mjs.map +0 -1
- package/dist/codecs-xDq4DNf8.d.mts +0 -1
- package/dist/descriptor-meta-CFPBLIHW-CUgnXvu7.mjs +0 -36
- package/dist/descriptor-meta-CFPBLIHW-CUgnXvu7.mjs.map +0 -1
- package/dist/sql-renderer-fyjZG1VX.d.mts +0 -1
- package/dist/types-BwhTlH8P.d.mts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner-BENMBCnG-CW6-1do-.mjs","names":["#lowerer"],"sources":["../../../../3-targets/3-targets/sqlite/dist/planner-BENMBCnG.mjs"],"sourcesContent":["import { a as DropColumnCall, c as RawSqlCall, l as RecreateTableCall, s as DropTableCall } from \"./op-factory-call-hxIbAMSY.mjs\";\nimport { a as sqliteTableRenameByHand, c as sqliteSchemaTables, d as coalesceSubtreeIssues, f as conflictForDisallowedCall, g as buildSqlitePlanDiff, h as sqlitePlannerStrategies, i as sqliteColumnRenameCall, l as indexNameCaseChange, m as planIssues, n as renameTableByHandStatements, o as sqliteTableRenameCall, p as issueNode, r as renderRenameTableCall, s as createWorkingSchema, u as pairIndexReplacements, v as sqliteActualSchema } from \"./sqlite-migration-CTNkjYJ1.mjs\";\nimport { t as TypeScriptRenderableSqliteMigration } from \"./planner-produced-sqlite-migration-DjEZTiif.mjs\";\nimport { isRenameStatement, issueOutcome } from \"@internal/framework-components/control\";\nimport { appliedStatementsInOrder, backfillOfDefaultedField, columnTakesTemporaryValue, detectTableNameCaseChanges, extractCodecControlHooks, fieldEventStorage, fieldStatementColumns, planFieldEventCalls, planStatements, plannerFailure, storageNameOfOperation, subjectsOfCalls, unknownCallNames } from \"@internal/family-sql/control\";\nimport { RelationalSchemaNodeKind, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { ok } from \"@internal/utils/result\";\n//#region src/core/migrations/operation-subjects.ts\nfunction lost(target, loss = \"drop\") {\n\treturn {\n\t\t...target,\n\t\tloss\n\t};\n}\nfunction tableTarget(table) {\n\treturn {\n\t\tstorageName: table,\n\t\ttable: {\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\ttable,\n\t\t\tcolumn: void 0\n\t\t}\n\t};\n}\nfunction columnTarget(table, column) {\n\treturn {\n\t\tstorageName: `${table}.${column}`,\n\t\ttable: {\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\ttable,\n\t\t\tcolumn\n\t\t}\n\t};\n}\nfunction operationCountOf(call) {\n\treturn \"companions\" in call && Array.isArray(call.companions) ? 1 + call.companions.length : 1;\n}\n/**\n* The columns a recreate loses: those the new table leaves out, whose values the copy drops, and,\n* when the recreate is destructive, those whose type it changes with no copy expression to convert them.\n*/\nfunction recreateLosses(call) {\n\tconst kept = new Set(call.contractTable.columns.map((column) => column.name));\n\tconst dropped = call.schemaColumnNames.filter((column) => !kept.has(column));\n\tconst retyped = call.operationClass === \"destructive\" ? call.retypedColumns.filter((column) => !Object.hasOwn(call.copyExpressions, column)) : [];\n\treturn [...dropped.map((column) => ({\n\t\tcolumn,\n\t\tloss: \"drop\"\n\t})), ...retyped.map((column) => ({\n\t\tcolumn,\n\t\tloss: \"typeChange\"\n\t}))];\n}\n/** The columns a recreate adds with a value its copy writes into every existing row. */\nfunction temporaryValuesOf(call) {\n\tconst copied = new Set(call.schemaColumnNames);\n\treturn Object.entries(call.temporaryValues).flatMap(([column, expression]) => copied.has(column) || expression.kind !== \"sql\" ? [] : [{\n\t\ttable: call.tableName,\n\t\tcolumn,\n\t\tvalue: expression.sql\n\t}]);\n}\n/**\n* What each call of a SQLite plan loses. A recreate that leaves a column out loses its values\n* itself, so a later drop of that column is not listed again.\n*/\nfunction sqliteCallSubjects(calls, fieldEvents) {\n\tconst lostColumns = /* @__PURE__ */ new Set();\n\tconst unknownNames = unknownCallNames(calls.filter((call) => call.operationClass === \"destructive\" && !(call instanceof RecreateTableCall) && !(call instanceof DropColumnCall) && !(call instanceof DropTableCall) && !(call instanceof RawSqlCall) && !fieldEvents.has(call)));\n\treturn calls.map((call) => {\n\t\tconst operationCount = operationCountOf(call);\n\t\tconst { label } = call;\n\t\tif (call instanceof RecreateTableCall) {\n\t\t\tconst columns = recreateLosses(call);\n\t\t\tfor (const { column } of columns) lostColumns.add(`${call.tableName}.${column}`);\n\t\t\treturn {\n\t\t\t\toperationCount,\n\t\t\t\tlabel,\n\t\t\t\tdataLoss: columns.length === 0 && call.operationClass === \"destructive\" ? [lost(tableTarget(call.tableName))] : columns.map(({ column, loss }) => lost(columnTarget(call.tableName, column), loss)),\n\t\t\t\taccessWidening: [],\n\t\t\t\ttemporaryValues: temporaryValuesOf(call)\n\t\t\t};\n\t\t}\n\t\tif (call instanceof DropColumnCall) return {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: lostColumns.has(`${call.tableName}.${call.columnName}`) ? [] : [lost(columnTarget(call.tableName, call.columnName))],\n\t\t\taccessWidening: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t\tif (call instanceof DropTableCall) return {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: [lost(tableTarget(call.tableName))],\n\t\t\taccessWidening: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t\tif (call.operationClass !== \"destructive\") return {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: [],\n\t\t\taccessWidening: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t\tconst fieldEvent = fieldEvents.get(call);\n\t\treturn {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: [lost(call instanceof RawSqlCall ? {\n\t\t\t\tstorageName: storageNameOfOperation(call.op),\n\t\t\t\ttable: void 0\n\t\t\t} : fieldEvent !== void 0 ? fieldEventStorage(fieldEvent) : {\n\t\t\t\tstorageName: unknownNames.get(call) ?? call.factoryName,\n\t\t\t\ttable: void 0\n\t\t\t})],\n\t\t\taccessWidening: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t});\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 statements = this.planStatements(options);\n\t\tif (!statements.ok) return plannerFailure([statements.failure]);\n\t\tconst { expected, actual, issues: diffIssues } = this.collectSchemaIssues(options, statements.value.schema);\n\t\tconst replacedIndexes = pairIndexReplacements(diffIssues, indexNameCaseChange);\n\t\tconst disallowedIndexCalls = replacedIndexes.calls.filter((call) => !options.policy.allowedOperationClasses.includes(call.operationClass));\n\t\tif (disallowedIndexCalls.length > 0) return plannerFailure(disallowedIndexCalls.map((call) => conflictForDisallowedCall(call, options.policy.allowedOperationClasses)));\n\t\tconst issues = diffIssues.filter((issue) => !replacedIndexes.consumed.has(issue));\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\trenameByHandStatements: renameTableByHandStatements,\n\t\t\trenameTableCall: renderRenameTableCall,\n\t\t\tcontract: options.contract,\n\t\t\tdefaultNamespaceId: UNBOUND_NAMESPACE_ID\n\t\t});\n\t\tif (caseChangeConflicts.length > 0) return plannerFailure(caseChangeConflicts);\n\t\tconst defaultedBackfill = backfillOfDefaultedField(options.statements, options.fromContract, options.contract);\n\t\tif (defaultedBackfill !== void 0) return plannerFailure([defaultedBackfill]);\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\tstatementColumns: fieldStatementColumns(options.statements, options.contract),\n\t\t\toriginCodecId: (table, column) => options.fromContract?.storage.namespaces[UNBOUND_NAMESPACE_ID]?.entries.table?.[table]?.columns[column]?.codecId,\n\t\t\ttakesTemporaryValue: (table, column) => {\n\t\t\t\tconst storageTable = options.contract.storage.namespaces[UNBOUND_NAMESPACE_ID]?.entries.table?.[table];\n\t\t\t\treturn storageTable !== void 0 && columnTakesTemporaryValue(storageTable, column);\n\t\t\t},\n\t\t\tstrategies: sqlitePlannerStrategies\n\t\t});\n\t\tif (!result.ok) return plannerFailure(result.failure);\n\t\tconst fieldEventCalls = planFieldEventCalls({\n\t\t\tpriorContract: options.origin === null ? null : options.fromContract,\n\t\t\tnewContract: options.contract,\n\t\t\tcodecHooks,\n\t\t\ttableRenames: statements.value.tableRenames,\n\t\t\tcolumnRenames: statements.value.columnRenames\n\t\t});\n\t\tconst fieldEventOps = fieldEventCalls.map(({ call }) => call);\n\t\tconst calls = [\n\t\t\t...statements.value.calls,\n\t\t\t...replacedIndexes.calls,\n\t\t\t...result.value.calls,\n\t\t\t...fieldEventOps\n\t\t];\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.origin?.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\tappliedStatements: appliedStatementsInOrder(options.statements, statements.value.appliedStatements),\n\t\t\t...subjectsOfCalls(sqliteCallSubjects(calls, new Map(fieldEventCalls.map((fieldEvent) => [fieldEvent.call, fieldEvent]))), {\n\t\t\t\tfromContract: options.fromContract,\n\t\t\t\tcontract: options.contract,\n\t\t\t\tstatements: options.statements,\n\t\t\t\tbyHand: sqliteTableRenameByHand\n\t\t\t})\n\t\t};\n\t}\n\t/**\n\t* Plans the statements against a working copy of the schema the plan starts from, in order, so\n\t* each rename's index replacements are computed against the schema the earlier statements left.\n\t* The diff then runs on that schema.\n\t*/\n\tplanStatements(options) {\n\t\tconst working = createWorkingSchema(sqliteActualSchema(options.schema));\n\t\tconst planned = planStatements({\n\t\t\tstatements: options.statements.filter(isRenameStatement),\n\t\t\tfromContract: options.fromContract,\n\t\t\tcontract: options.contract,\n\t\t\tpolicy: options.policy,\n\t\t\ttarget: {\n\t\t\t\ttables: () => sqliteSchemaTables(working.current),\n\t\t\t\trenameTableCall: (rename) => sqliteTableRenameCall({\n\t\t\t\t\tprevious: working.current,\n\t\t\t\t\tcontract: options.contract,\n\t\t\t\t\trename,\n\t\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t\t}),\n\t\t\t\trenameColumnCall: (rename) => sqliteColumnRenameCall({\n\t\t\t\t\tprevious: working.current,\n\t\t\t\t\tcontract: options.contract,\n\t\t\t\t\trename,\n\t\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t\t}),\n\t\t\t\tapply: (call) => working.apply(call),\n\t\t\t\t...sqliteTableRenameByHand\n\t\t\t}\n\t\t});\n\t\tif (!planned.ok) return planned;\n\t\treturn ok({\n\t\t\t...planned.value,\n\t\t\tschema: working.current\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, schema) {\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: 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 { createSqliteMigrationPlanner as n, SqliteMigrationPlanner as t };\n\n//# sourceMappingURL=planner-BENMBCnG.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,KAAK,QAAQ,OAAO,QAAQ;CACpC,OAAO;EACN,GAAG;EACH;CACD;AACD;AACA,SAAS,YAAY,OAAO;CAC3B,OAAO;EACN,aAAa;EACb,OAAO;GACN,aAAa;GACb;GACA,QAAQ,KAAK;EACd;CACD;AACD;AACA,SAAS,aAAa,OAAO,QAAQ;CACpC,OAAO;EACN,aAAa,GAAG,MAAM,GAAG;EACzB,OAAO;GACN,aAAa;GACb;GACA;EACD;CACD;AACD;AACA,SAAS,iBAAiB,MAAM;CAC/B,OAAO,gBAAgB,QAAQ,MAAM,QAAQ,KAAK,UAAU,IAAI,IAAI,KAAK,WAAW,SAAS;AAC9F;;;;;AAKA,SAAS,eAAe,MAAM;CAC7B,MAAM,OAAO,IAAI,IAAI,KAAK,cAAc,QAAQ,KAAK,WAAW,OAAO,IAAI,CAAC;CAC5E,MAAM,UAAU,KAAK,kBAAkB,QAAQ,WAAW,CAAC,KAAK,IAAI,MAAM,CAAC;CAC3E,MAAM,UAAU,KAAK,mBAAmB,gBAAgB,KAAK,eAAe,QAAQ,WAAW,CAAC,OAAO,OAAO,KAAK,iBAAiB,MAAM,CAAC,IAAI,CAAC;CAChJ,OAAO,CAAC,GAAG,QAAQ,KAAK,YAAY;EACnC;EACA,MAAM;CACP,EAAE,GAAG,GAAG,QAAQ,KAAK,YAAY;EAChC;EACA,MAAM;CACP,EAAE,CAAC;AACJ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AAK,KAAK,aAAa,yBAAyB,OAAO,OAAO;EAChF,MAAM,YAAY,MAAM,KAAK;EAC7B,OAAO,cAAc,KAAK,KAAK,CAAC,UAAU,eAAe;GACxD,aAAa;GACb,YAAY;GACZ,YAAY;EACb,CAAC;CACF,CAAC;AACF"}
|
|
1
|
+
{"version":3,"file":"planner-CHVsFdYX-BXkj8Yt8.mjs","names":["#lowerer"],"sources":["../../../../3-targets/3-targets/sqlite/dist/planner-CHVsFdYX.mjs"],"sourcesContent":["import { a as DropColumnCall, c as RawSqlCall, l as RecreateTableCall, s as DropTableCall } from \"./op-factory-call-BP8q3moB.mjs\";\nimport { a as sqliteTableRenameByHand, c as sqliteSchemaTables, d as coalesceSubtreeIssues, f as conflictForDisallowedCall, g as buildSqlitePlanDiff, h as sqlitePlannerStrategies, i as sqliteColumnRenameCall, l as indexNameCaseChange, m as planIssues, n as renameTableByHandStatements, o as sqliteTableRenameCall, p as issueNode, r as renderRenameTableCall, s as createWorkingSchema, u as pairIndexReplacements, v as sqliteActualSchema } from \"./sqlite-migration-Dn0aIhV7.mjs\";\nimport { t as TypeScriptRenderableSqliteMigration } from \"./planner-produced-sqlite-migration-DxKNqhIl.mjs\";\nimport { isRenameStatement, issueOutcome } from \"@internal/framework-components/control\";\nimport { appliedStatementsInOrder, backfillOfDefaultedField, columnTakesTemporaryValue, detectTableNameCaseChanges, extractCodecControlHooks, fieldEventStorage, fieldStatementColumns, planFieldEventCalls, planStatements, plannerFailure, storageNameOfOperation, subjectsOfCalls, unknownCallNames } from \"@internal/family-sql/control\";\nimport { RelationalSchemaNodeKind, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { ok } from \"@internal/utils/result\";\n//#region src/core/migrations/operation-subjects.ts\nfunction lost(target, loss = \"drop\") {\n\treturn {\n\t\t...target,\n\t\tloss\n\t};\n}\nfunction tableTarget(table) {\n\treturn {\n\t\tstorageName: table,\n\t\ttable: {\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\ttable,\n\t\t\tcolumn: void 0\n\t\t}\n\t};\n}\nfunction columnTarget(table, column) {\n\treturn {\n\t\tstorageName: `${table}.${column}`,\n\t\ttable: {\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\ttable,\n\t\t\tcolumn\n\t\t}\n\t};\n}\nfunction operationCountOf(call) {\n\treturn \"companions\" in call && Array.isArray(call.companions) ? 1 + call.companions.length : 1;\n}\n/**\n* The columns a recreate loses: those the new table leaves out, whose values the copy drops, and,\n* when the recreate is destructive, those whose type it changes with no copy expression to convert them.\n*/\nfunction recreateLosses(call) {\n\tconst kept = new Set(call.contractTable.columns.map((column) => column.name));\n\tconst dropped = call.schemaColumnNames.filter((column) => !kept.has(column));\n\tconst retyped = call.operationClass === \"destructive\" ? call.retypedColumns.filter((column) => !Object.hasOwn(call.copyExpressions, column)) : [];\n\treturn [...dropped.map((column) => ({\n\t\tcolumn,\n\t\tloss: \"drop\"\n\t})), ...retyped.map((column) => ({\n\t\tcolumn,\n\t\tloss: \"typeChange\"\n\t}))];\n}\n/** The columns a recreate adds with a value its copy writes into every existing row. */\nfunction temporaryValuesOf(call) {\n\tconst copied = new Set(call.schemaColumnNames);\n\treturn Object.entries(call.temporaryValues).flatMap(([column, expression]) => copied.has(column) || expression.kind !== \"sql\" ? [] : [{\n\t\ttable: call.tableName,\n\t\tcolumn,\n\t\tvalue: expression.sql\n\t}]);\n}\n/**\n* What each call of a SQLite plan loses. A recreate that leaves a column out loses its values\n* itself, so a later drop of that column is not listed again.\n*/\nfunction sqliteCallSubjects(calls, fieldEvents) {\n\tconst lostColumns = /* @__PURE__ */ new Set();\n\tconst unknownNames = unknownCallNames(calls.filter((call) => call.operationClass === \"destructive\" && !(call instanceof RecreateTableCall) && !(call instanceof DropColumnCall) && !(call instanceof DropTableCall) && !(call instanceof RawSqlCall) && !fieldEvents.has(call)));\n\treturn calls.map((call) => {\n\t\tconst operationCount = operationCountOf(call);\n\t\tconst { label } = call;\n\t\tif (call instanceof RecreateTableCall) {\n\t\t\tconst columns = recreateLosses(call);\n\t\t\tfor (const { column } of columns) lostColumns.add(`${call.tableName}.${column}`);\n\t\t\treturn {\n\t\t\t\toperationCount,\n\t\t\t\tlabel,\n\t\t\t\tdataLoss: columns.length === 0 && call.operationClass === \"destructive\" ? [lost(tableTarget(call.tableName))] : columns.map(({ column, loss }) => lost(columnTarget(call.tableName, column), loss)),\n\t\t\t\taccessWidening: [],\n\t\t\t\ttemporaryValues: temporaryValuesOf(call)\n\t\t\t};\n\t\t}\n\t\tif (call instanceof DropColumnCall) return {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: lostColumns.has(`${call.tableName}.${call.columnName}`) ? [] : [lost(columnTarget(call.tableName, call.columnName))],\n\t\t\taccessWidening: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t\tif (call instanceof DropTableCall) return {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: [lost(tableTarget(call.tableName))],\n\t\t\taccessWidening: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t\tif (call.operationClass !== \"destructive\") return {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: [],\n\t\t\taccessWidening: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t\tconst fieldEvent = fieldEvents.get(call);\n\t\treturn {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: [lost(call instanceof RawSqlCall ? {\n\t\t\t\tstorageName: storageNameOfOperation(call.op),\n\t\t\t\ttable: void 0\n\t\t\t} : fieldEvent !== void 0 ? fieldEventStorage(fieldEvent) : {\n\t\t\t\tstorageName: unknownNames.get(call) ?? call.factoryName,\n\t\t\t\ttable: void 0\n\t\t\t})],\n\t\t\taccessWidening: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t});\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 statements = this.planStatements(options);\n\t\tif (!statements.ok) return plannerFailure([statements.failure]);\n\t\tconst { expected, actual, issues: diffIssues } = this.collectSchemaIssues(options, statements.value.schema);\n\t\tconst replacedIndexes = pairIndexReplacements(diffIssues, indexNameCaseChange);\n\t\tconst disallowedIndexCalls = replacedIndexes.calls.filter((call) => !options.policy.allowedOperationClasses.includes(call.operationClass));\n\t\tif (disallowedIndexCalls.length > 0) return plannerFailure(disallowedIndexCalls.map((call) => conflictForDisallowedCall(call, options.policy.allowedOperationClasses)));\n\t\tconst issues = diffIssues.filter((issue) => !replacedIndexes.consumed.has(issue));\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\trenameByHandStatements: renameTableByHandStatements,\n\t\t\trenameTableCall: renderRenameTableCall,\n\t\t\tcontract: options.contract,\n\t\t\tdefaultNamespaceId: UNBOUND_NAMESPACE_ID\n\t\t});\n\t\tif (caseChangeConflicts.length > 0) return plannerFailure(caseChangeConflicts);\n\t\tconst defaultedBackfill = backfillOfDefaultedField(options.statements, options.fromContract, options.contract);\n\t\tif (defaultedBackfill !== void 0) return plannerFailure([defaultedBackfill]);\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\tstatementColumns: fieldStatementColumns(options.statements, options.contract),\n\t\t\toriginCodecId: (table, column) => options.fromContract?.storage.namespaces[UNBOUND_NAMESPACE_ID]?.entries.table?.[table]?.columns[column]?.codecId,\n\t\t\ttakesTemporaryValue: (table, column) => {\n\t\t\t\tconst storageTable = options.contract.storage.namespaces[UNBOUND_NAMESPACE_ID]?.entries.table?.[table];\n\t\t\t\treturn storageTable !== void 0 && columnTakesTemporaryValue(storageTable, column);\n\t\t\t},\n\t\t\tstrategies: sqlitePlannerStrategies\n\t\t});\n\t\tif (!result.ok) return plannerFailure(result.failure);\n\t\tconst fieldEventCalls = planFieldEventCalls({\n\t\t\tpriorContract: options.origin === null ? null : options.fromContract,\n\t\t\tnewContract: options.contract,\n\t\t\tcodecHooks,\n\t\t\ttableRenames: statements.value.tableRenames,\n\t\t\tcolumnRenames: statements.value.columnRenames\n\t\t});\n\t\tconst fieldEventOps = fieldEventCalls.map(({ call }) => call);\n\t\tconst calls = [\n\t\t\t...statements.value.calls,\n\t\t\t...replacedIndexes.calls,\n\t\t\t...result.value.calls,\n\t\t\t...fieldEventOps\n\t\t];\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.origin?.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\tappliedStatements: appliedStatementsInOrder(options.statements, statements.value.appliedStatements),\n\t\t\t...subjectsOfCalls(sqliteCallSubjects(calls, new Map(fieldEventCalls.map((fieldEvent) => [fieldEvent.call, fieldEvent]))), {\n\t\t\t\tfromContract: options.fromContract,\n\t\t\t\tcontract: options.contract,\n\t\t\t\tstatements: options.statements,\n\t\t\t\tbyHand: sqliteTableRenameByHand\n\t\t\t})\n\t\t};\n\t}\n\t/**\n\t* Plans the statements against a working copy of the schema the plan starts from, in order, so\n\t* each rename's index replacements are computed against the schema the earlier statements left.\n\t* The diff then runs on that schema.\n\t*/\n\tplanStatements(options) {\n\t\tconst working = createWorkingSchema(sqliteActualSchema(options.schema));\n\t\tconst planned = planStatements({\n\t\t\tstatements: options.statements.filter(isRenameStatement),\n\t\t\tfromContract: options.fromContract,\n\t\t\tcontract: options.contract,\n\t\t\tpolicy: options.policy,\n\t\t\ttarget: {\n\t\t\t\ttables: () => sqliteSchemaTables(working.current),\n\t\t\t\trenameTableCall: (rename) => sqliteTableRenameCall({\n\t\t\t\t\tprevious: working.current,\n\t\t\t\t\tcontract: options.contract,\n\t\t\t\t\trename,\n\t\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t\t}),\n\t\t\t\trenameColumnCall: (rename) => sqliteColumnRenameCall({\n\t\t\t\t\tprevious: working.current,\n\t\t\t\t\tcontract: options.contract,\n\t\t\t\t\trename,\n\t\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t\t}),\n\t\t\t\tapply: (call) => working.apply(call),\n\t\t\t\t...sqliteTableRenameByHand\n\t\t\t}\n\t\t});\n\t\tif (!planned.ok) return planned;\n\t\treturn ok({\n\t\t\t...planned.value,\n\t\t\tschema: working.current\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, schema) {\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: 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 { createSqliteMigrationPlanner as n, SqliteMigrationPlanner as t };\n\n//# sourceMappingURL=planner-CHVsFdYX.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,KAAK,QAAQ,OAAO,QAAQ;CACpC,OAAO;EACN,GAAG;EACH;CACD;AACD;AACA,SAAS,YAAY,OAAO;CAC3B,OAAO;EACN,aAAa;EACb,OAAO;GACN,aAAa;GACb;GACA,QAAQ,KAAK;EACd;CACD;AACD;AACA,SAAS,aAAa,OAAO,QAAQ;CACpC,OAAO;EACN,aAAa,GAAG,MAAM,GAAG;EACzB,OAAO;GACN,aAAa;GACb;GACA;EACD;CACD;AACD;AACA,SAAS,iBAAiB,MAAM;CAC/B,OAAO,gBAAgB,QAAQ,MAAM,QAAQ,KAAK,UAAU,IAAI,IAAI,KAAK,WAAW,SAAS;AAC9F;;;;;AAKA,SAAS,eAAe,MAAM;CAC7B,MAAM,OAAO,IAAI,IAAI,KAAK,cAAc,QAAQ,KAAK,WAAW,OAAO,IAAI,CAAC;CAC5E,MAAM,UAAU,KAAK,kBAAkB,QAAQ,WAAW,CAAC,KAAK,IAAI,MAAM,CAAC;CAC3E,MAAM,UAAU,KAAK,mBAAmB,gBAAgB,KAAK,eAAe,QAAQ,WAAW,CAAC,OAAO,OAAO,KAAK,iBAAiB,MAAM,CAAC,IAAI,CAAC;CAChJ,OAAO,CAAC,GAAG,QAAQ,KAAK,YAAY;EACnC;EACA,MAAM;CACP,EAAE,GAAG,GAAG,QAAQ,KAAK,YAAY;EAChC;EACA,MAAM;CACP,EAAE,CAAC;AACJ;;AAEA,SAAS,kBAAkB,MAAM;CAChC,MAAM,SAAS,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,YAAY,MAAM,KAAK;EAC7B,OAAO,cAAc,KAAK,KAAK,CAAC,UAAU,eAAe;GACxD,aAAa;GACb,YAAY;GACZ,YAAY;EACb,CAAC;CACF,CAAC;AACF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as SqliteMigration } from "./sqlite-migration-
|
|
2
|
-
import { t as renderOps } from "./render-ops-
|
|
1
|
+
import { t as SqliteMigration } from "./sqlite-migration-Dn0aIhV7-B1eALxxb.mjs";
|
|
2
|
+
import { t as renderOps } from "./render-ops-BxptR4vb-CO94GBBd.mjs";
|
|
3
3
|
import { contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier } from "@prisma/orm-framework/components/control";
|
|
4
4
|
import { renderImports } from "@prisma/orm-framework/ts-render";
|
|
5
5
|
import { resolveRequirementSpecifiers } from "@prisma/orm-framework/components/emission";
|
|
6
6
|
import { detectScaffoldRuntime, shebangLineFor } from "@prisma/orm-toolchain/migration-tools/migration-ts";
|
|
7
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/planner-produced-sqlite-migration-
|
|
7
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/planner-produced-sqlite-migration-DxKNqhIl.mjs
|
|
8
8
|
/**
|
|
9
9
|
* Polymorphic TypeScript emitter for the SQLite migration IR. Mirrors the
|
|
10
10
|
* Postgres `render-typescript.ts` — different base-class + factory module
|
|
@@ -147,4 +147,4 @@ var TypeScriptRenderableSqliteMigration = class extends SqliteMigration {
|
|
|
147
147
|
//#endregion
|
|
148
148
|
export { TypeScriptRenderableSqliteMigration as t };
|
|
149
149
|
|
|
150
|
-
//# sourceMappingURL=planner-produced-sqlite-migration-
|
|
150
|
+
//# sourceMappingURL=planner-produced-sqlite-migration-DxKNqhIl-DrkwVEyy.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner-produced-sqlite-migration-
|
|
1
|
+
{"version":3,"file":"planner-produced-sqlite-migration-DxKNqhIl-DrkwVEyy.mjs","names":["#calls","#meta","#spaceId","#snapshotsImportPath","#destination","#lowerer","#operationsCache"],"sources":["../../../../3-targets/3-targets/sqlite/dist/planner-produced-sqlite-migration-DxKNqhIl.mjs"],"sourcesContent":["import { t as SqliteMigration } from \"./sqlite-migration-Dn0aIhV7.mjs\";\nimport { t as renderOps } from \"./render-ops-BxptR4vb.mjs\";\nimport { contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier } from \"@internal/framework-components/control\";\nimport { renderImports } from \"@internal/ts-render\";\nimport { resolveRequirementSpecifiers } from \"@internal/framework-components/emission\";\nimport { detectScaffoldRuntime, shebangLineFor } from \"@internal/migration-tools/migration-ts\";\n//#region src/core/migrations/render-typescript.ts\n/**\n* Polymorphic TypeScript emitter for the SQLite migration IR. Mirrors the\n* Postgres `render-typescript.ts` — different base-class + factory module\n* specifier, same overall shape.\n*/\n/**\n* Always-present base imports for the rendered scaffold. Both come from\n* `@internal/sqlite/migration` so an authored SQLite\n* `migration.ts` only needs a single dependency for its base class and\n* its CLI entrypoint. Mirrors Postgres's `BASE_IMPORTS`.\n*\n* - `Migration` — the facade re-export fixes the `SqlMigration`\n* generic to `SqlitePlanTargetDetails` and the abstract `targetId` to\n* `'sqlite'`.\n* - `MigrationCLI` — the migration-file CLI entrypoint, re-exported from\n* `@internal/cli/migration-cli`. Loads `prisma.config.ts`,\n* assembles a `ControlStack`, and instantiates the migration class.\n*/\nconst BASE_IMPORTS = [{\n\tmoduleSpecifier: \"@internal/sqlite/migration\",\n\tsymbol: \"Migration\"\n}, {\n\tmoduleSpecifier: \"@internal/sqlite/migration\",\n\tsymbol: \"MigrationCLI\"\n}];\nfunction renderCallsToTypeScript(calls, meta) {\n\tconst imports = buildImports(calls, meta);\n\tconst operationsBody = calls.map((c) => c.renderTypeScript()).join(\",\\n\");\n\tconst hasStart = meta.from !== null;\n\tconst startField = hasStart ? [\" override readonly startContractJson = startContract;\"] : [];\n\treturn [\n\t\tshebangLineFor(detectScaffoldRuntime()),\n\t\timports,\n\t\t\"\",\n\t\t`export default class M extends Migration<${hasStart ? \"Start\" : \"never\"}, End> {`,\n\t\t...startField,\n\t\t\" override readonly endContractJson = endContract;\",\n\t\t\"\",\n\t\t\" override get operations() {\",\n\t\t\" return [\",\n\t\tindent(operationsBody, 6),\n\t\t\" ];\",\n\t\t\" }\",\n\t\t\"}\",\n\t\t\"\",\n\t\t\"MigrationCLI.run(import.meta.url, M);\",\n\t\t\"\"\n\t].join(\"\\n\");\n}\nfunction buildImports(calls, meta) {\n\tconst requirements = [...BASE_IMPORTS, ...contractImports(meta)];\n\tfor (const call of calls) for (const req of call.importRequirements()) requirements.push(req);\n\treturn renderImports(resolveRequirementSpecifiers(requirements, meta.resolveImportSpecifier));\n}\n/**\n* The committed contract-JSON imports the scaffold reads its from/to identity\n* from, resolved to the deduplicated snapshot store under\n* `meta.snapshotsImportPath`. The end snapshot is always present; the start\n* snapshot is added only for a non-baseline migration (`meta.from !== null`).\n* The matching `Contract` type imports (aliased `Start`/`End`) feed the\n* `Migration<Start, End>` generics. Baseline emits `Migration<never, End>` with\n* no start imports — `never` is the honest \"no prior contract\" Start.\n*/\nfunction contractImports(meta) {\n\tconst reqs = [{\n\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"endContract\",\n\t\tkind: \"default\",\n\t\tattributes: { type: \"json\" }\n\t}, {\n\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"Contract\",\n\t\talias: \"End\",\n\t\ttypeOnly: true\n\t}];\n\tif (meta.from !== null) {\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"startContract\",\n\t\t\tkind: \"default\",\n\t\t\tattributes: { type: \"json\" }\n\t\t});\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"Contract\",\n\t\t\talias: \"Start\",\n\t\t\ttypeOnly: true\n\t\t});\n\t}\n\treturn reqs;\n}\nfunction indent(text, spaces) {\n\tconst pad = \" \".repeat(spaces);\n\treturn text.split(\"\\n\").map((line) => line.trim() ? `${pad}${line}` : line).join(\"\\n\");\n}\n//#endregion\n//#region src/core/migrations/planner-produced-sqlite-migration.ts\nvar TypeScriptRenderableSqliteMigration = class extends SqliteMigration {\n\t#calls;\n\t#meta;\n\t#destination;\n\t#spaceId;\n\t#snapshotsImportPath;\n\t#lowerer;\n\t#operationsCache;\n\tconstructor(calls, meta, spaceId, snapshotsImportPath, destination, lowerer) {\n\t\tsuper();\n\t\tthis.#calls = calls;\n\t\tthis.#meta = meta;\n\t\tthis.#spaceId = spaceId;\n\t\tthis.#snapshotsImportPath = snapshotsImportPath;\n\t\tthis.#destination = destination ?? { storageHash: meta.to };\n\t\tthis.#lowerer = lowerer;\n\t}\n\tget operations() {\n\t\tthis.#operationsCache ??= renderOps(this.#calls, this.#lowerer);\n\t\treturn this.#operationsCache;\n\t}\n\tdescribe() {\n\t\treturn this.#meta;\n\t}\n\tget destination() {\n\t\treturn this.#destination;\n\t}\n\t/**\n\t* Contract space this planner-produced plan applies to. Threaded\n\t* from {@link SqlMigrationPlannerPlanOptions.spaceId} so the runner\n\t* keys the marker row by the right space when executing the plan.\n\t*/\n\tget spaceId() {\n\t\treturn this.#spaceId;\n\t}\n\trenderTypeScript(resolveImportSpecifier) {\n\t\treturn renderCallsToTypeScript(this.#calls, {\n\t\t\tfrom: this.#meta.from,\n\t\t\tto: this.#meta.to,\n\t\t\tsnapshotsImportPath: this.#snapshotsImportPath,\n\t\t\tresolveImportSpecifier\n\t\t});\n\t}\n};\n//#endregion\nexport { TypeScriptRenderableSqliteMigration as t };\n\n//# sourceMappingURL=planner-produced-sqlite-migration-DxKNqhIl.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,eAAe,CAAC;CACrB,iB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AAK,IAAI;GACnF,QAAQ;GACR,OAAO;GACP,UAAU;EACX,CAAC;CACF;CACA,OAAO;AACR;AACA,SAAS,OAAO,MAAM,QAAQ;CAC7B,MAAM,MAAM,IAAI,OAAO,MAAM;CAC7B,OAAO,KAAK,MAAM,IAAI,CAAC,CAAC,KAAK,SAAS,KAAK,KAAK,IAAI,GAAG,MAAM,SAAS,IAAI,CAAC,CAAC,KAAK,IAAI;AACtF;AAGA,IAAI,sCAAsC,cAAc,gBAAgB;CACvE;CACA;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,OAAO,MAAM,SAAS,qBAAqB,aAAa,SAAS;EAC5E,MAAM;EACN,KAAKA,SAAS;EACd,KAAKC,QAAQ;EACb,KAAKC,WAAW;EAChB,KAAKC,uBAAuB;EAC5B,KAAKC,eAAe,eAAe,EAAE,aAAa,KAAK,GAAG;EAC1D,KAAKC,WAAW;CACjB;CACA,IAAI,aAAa;EAChB,KAAKC,qBAAqB,UAAU,KAAKN,QAAQ,KAAKK,QAAQ;EAC9D,OAAO,KAAKC;CACb;CACA,WAAW;EACV,OAAO,KAAKL;CACb;CACA,IAAI,cAAc;EACjB,OAAO,KAAKG;CACb;;;;;;CAMA,IAAI,UAAU;EACb,OAAO,KAAKF;CACb;CACA,iBAAiB,wBAAwB;EACxC,OAAO,wBAAwB,KAAKF,QAAQ;GAC3C,MAAM,KAAKC,MAAM;GACjB,IAAI,KAAKA,MAAM;GACf,qBAAqB,KAAKE;GAC1B;EACD,CAAC;CACF;AACD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as sqliteError } from "./errors-DnR-sMHS-KkMLIP2U.mjs";
|
|
2
|
-
import { v as isSqliteOpFactoryCall } from "./op-factory-call-
|
|
2
|
+
import { v as isSqliteOpFactoryCall } from "./op-factory-call-BP8q3moB-BhWwqgfW.mjs";
|
|
3
3
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
4
4
|
import { isThenable } from "@prisma/orm-framework/utils/promise";
|
|
5
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/render-ops-
|
|
5
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/render-ops-BxptR4vb.mjs
|
|
6
6
|
function assertSqliteOp(op, callFactoryName) {
|
|
7
7
|
const targetId = blindCast(op).target?.id;
|
|
8
8
|
if (targetId !== "sqlite") throw sqliteError("MIGRATION.TARGET_MISMATCH", `renderOps: expected sqlite op but got target.id="${String(targetId)}" for op.id="${op.id}" (factoryName="${callFactoryName}"). An OpFactoryCall produced an op for a different target on the sqlite planner path; check the call's target binding.`, { meta: {
|
|
@@ -31,4 +31,4 @@ function renderOps(calls, lowerer) {
|
|
|
31
31
|
//#endregion
|
|
32
32
|
export { renderOps as t };
|
|
33
33
|
|
|
34
|
-
//# sourceMappingURL=render-ops-
|
|
34
|
+
//# sourceMappingURL=render-ops-BxptR4vb-CO94GBBd.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-ops-
|
|
1
|
+
{"version":3,"file":"render-ops-BxptR4vb-CO94GBBd.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/render-ops-BxptR4vb.mjs"],"sourcesContent":["import { n as sqliteError } from \"./errors-DnR-sMHS.mjs\";\nimport { p as isSqliteOpFactoryCall } from \"./op-factory-call-BP8q3moB.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { isThenable } from \"@internal/utils/promise\";\n//#region src/core/migrations/render-ops.ts\nfunction assertSqliteOp(op, callFactoryName) {\n\tconst targetId = blindCast(op).target?.id;\n\tif (targetId !== \"sqlite\") throw sqliteError(\"MIGRATION.TARGET_MISMATCH\", `renderOps: expected sqlite op but got target.id=\"${String(targetId)}\" for op.id=\"${op.id}\" (factoryName=\"${callFactoryName}\"). An OpFactoryCall produced an op for a different target on the sqlite planner path; check the call's target binding.`, { meta: {\n\t\topId: op.id,\n\t\ttargetId: String(targetId),\n\t\tfactoryName: callFactoryName\n\t} });\n}\nfunction checkedOp(opOrPromise, callFactoryName) {\n\tif (isThenable(opOrPromise)) {\n\t\tconst checked = opOrPromise.then((op) => {\n\t\t\tassertSqliteOp(op, callFactoryName);\n\t\t\treturn op;\n\t\t});\n\t\tchecked.catch(() => void 0);\n\t\treturn checked;\n\t}\n\tassertSqliteOp(opOrPromise, callFactoryName);\n\treturn opOrPromise;\n}\nfunction renderOps(calls, lowerer) {\n\treturn calls.flatMap((c) => {\n\t\treturn (isSqliteOpFactoryCall(c) ? c.toOps(lowerer) : [blindCast(c).toOp(lowerer)]).map((opOrPromise) => checkedOp(opOrPromise, c.factoryName));\n\t});\n}\n//#endregion\nexport { renderOps as t };\n\n//# sourceMappingURL=render-ops-BxptR4vb.mjs.map"],"mappings":";;;;;AAKA,SAAS,eAAe,IAAI,iBAAiB;CAC5C,MAAM,WAAW,UAAU,EAAE,CAAC,CAAC,QAAQ;CACvC,IAAI,aAAa,UAAU,MAAM,YAAY,6BAA6B,oDAAoD,OAAO,QAAQ,EAAE,eAAe,GAAG,GAAG,kBAAkB,gBAAgB,0HAA0H,EAAE,MAAM;EACvU,MAAM,GAAG;EACT,UAAU,OAAO,QAAQ;EACzB,aAAa;CACd,EAAE,CAAC;AACJ;AACA,SAAS,UAAU,aAAa,iBAAiB;CAChD,IAAI,WAAW,WAAW,GAAG;EAC5B,MAAM,UAAU,YAAY,MAAM,OAAO;GACxC,eAAe,IAAI,eAAe;GAClC,OAAO;EACR,CAAC;EACD,QAAQ,YAAY,KAAK,CAAC;EAC1B,OAAO;CACR;CACA,eAAe,aAAa,eAAe;CAC3C,OAAO;AACR;AACA,SAAS,UAAU,OAAO,SAAS;CAClC,OAAO,MAAM,SAAS,MAAM;EAC3B,QAAQ,sBAAsB,CAAC,IAAI,EAAE,MAAM,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,EAAA,CAAG,KAAK,gBAAgB,UAAU,aAAa,EAAE,WAAW,CAAC;CAC/I,CAAC;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createSqliteAdapterWithCodecRegistry } from "./adapter-Bp_4Bjff-
|
|
1
|
+
import { n as createSqliteAdapterWithCodecRegistry } from "./adapter-Bp_4Bjff-Cuo0_i6q.mjs";
|
|
2
2
|
import { SqlRuntimeAdapterDescriptor } from "@prisma/orm-family-sql/runtime";
|
|
3
3
|
import { RuntimeAdapterInstance } from "@prisma/orm-framework/components/execution";
|
|
4
4
|
//#region ../../../3-targets/6-adapters/sqlite/dist/runtime.d.mts
|
|
@@ -7,4 +7,4 @@ type SqliteRuntimeAdapterInstance = RuntimeAdapterInstance<'sql', 'sqlite'> & Re
|
|
|
7
7
|
declare const sqliteRuntimeAdapterDescriptor: SqlRuntimeAdapterDescriptor<'sqlite', SqliteRuntimeAdapterInstance>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { sqliteRuntimeAdapterDescriptor as n, SqliteRuntimeAdapterInstance as t };
|
|
10
|
-
//# sourceMappingURL=runtime-
|
|
10
|
+
//# sourceMappingURL=runtime-zwgkZ8R0.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-
|
|
1
|
+
{"version":3,"file":"runtime-zwgkZ8R0.d.mts","names":[],"sources":["../../../../3-targets/6-adapters/sqlite/dist/runtime.d.mts"],"mappings":";;;;;KAIK,+BAA+B,0CAA0C,kBAAkB;cAClF,gCAAgC,sCAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./adapter-Bp_4Bjff-Cuo0_i6q.mjs";
|
package/dist/{sqlite-migration-CTNkjYJ1-eRdmsbpK.mjs → sqlite-migration-Dn0aIhV7-B1eALxxb.mjs}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { a as SQLITE_INTEGER_CODEC_ID, c as SQLITE_TEXT_CODEC_ID, i as SQLITE_DATETIME_CODEC_ID, o as SQLITE_JSON_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from "./codec-ids-KMliSCRp-BhTbmbGr.mjs";
|
|
2
2
|
import { c as sqliteText, i as sqliteCharacterVarying, n as sqliteCharacter, o as sqliteInteger, s as sqliteReal, t as sqliteBlob } from "./data-types-pFQMl37_-B-3aK_wd.mjs";
|
|
3
3
|
import { n as sqliteError, t as errorSqliteMigrationStackMissing } from "./errors-DnR-sMHS-KkMLIP2U.mjs";
|
|
4
|
-
import { r as encodeSqliteDatetime } from "./codecs-
|
|
4
|
+
import { r as encodeSqliteDatetime } from "./codecs-Ea350Hl_-Bgfsxc8G.mjs";
|
|
5
5
|
import { n as SQLITE_NOW_EXPRESSION } from "./datetime-text-Bniwehv--Ddt3VS4z.mjs";
|
|
6
6
|
import { n as escapeLiteral } from "./sql-utils-XGT5Esi2-5k9pvJeF.mjs";
|
|
7
7
|
import { n as sqliteResolveDefault } from "./default-normalizer-Ch3VFnEH-C-h1XtlJ.mjs";
|
|
8
|
-
import { C as sqliteIdentifiersCollide, S as sqliteDefaultToDdlColumnDefault, _ as indexReplacementCalls, a as DropColumnCall, b as renameTableSteps, d as RenameTableCall, h as buildRecreateSummary, i as DataTransformCall, l as RecreateTableCall, m as buildRecreatePostchecks, n as CreateIndexCall, o as DropIndexCall, p as buildColumnTypeSql, r as CreateTableCall, s as DropTableCall, t as AddColumnCall, u as RenameColumnCall, x as renderDefaultLiteral } from "./op-factory-call-
|
|
8
|
+
import { C as sqliteIdentifiersCollide, S as sqliteDefaultToDdlColumnDefault, _ as indexReplacementCalls, a as DropColumnCall, b as renameTableSteps, d as RenameTableCall, h as buildRecreateSummary, i as DataTransformCall, l as RecreateTableCall, m as buildRecreatePostchecks, n as CreateIndexCall, o as DropIndexCall, p as buildColumnTypeSql, r as CreateTableCall, s as DropTableCall, t as AddColumnCall, u as RenameColumnCall, x as renderDefaultLiteral } from "./op-factory-call-BP8q3moB-BhWwqgfW.mjs";
|
|
9
9
|
import { t as CONTROL_TABLE_NAMES } from "./control-tables-D_o8dKRB-BXi43noL.mjs";
|
|
10
10
|
import { n as SqliteContractView } from "./sqlite-contract-view-TELBWEt4-CVsdZnpX.mjs";
|
|
11
11
|
import { DdlColumn, ForeignKeyConstraint, PrimaryKeyConstraint, UniqueConstraint } from "@prisma/orm-family-sql/relational-core/ast";
|
|
@@ -24,7 +24,7 @@ import { namingOf, namingOfLiveName, parseWireName } from "@prisma/orm-family-sq
|
|
|
24
24
|
import { isArrayEqual } from "@prisma/orm-framework/utils/array-equal";
|
|
25
25
|
import { Migration } from "@prisma/orm-family-sql/family/migration";
|
|
26
26
|
import { MigrationContractViews } from "@prisma/orm-toolchain/migration-tools/migration";
|
|
27
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/sqlite-migration-
|
|
27
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/sqlite-migration-Dn0aIhV7.mjs
|
|
28
28
|
/** Renders a column default for the SQLite dialect. */
|
|
29
29
|
function sqliteRenderDefault(def, column) {
|
|
30
30
|
if (def.kind === "function") {
|
|
@@ -1332,4 +1332,4 @@ function copyExpressionSlotsOf(copyExpressions, table, option = "copyExpressions
|
|
|
1332
1332
|
//#endregion
|
|
1333
1333
|
export { sqliteSchemaTables as _, createWorkingSchema as a, verifySqliteDatabaseSchema as b, issueNode as c, renameTableByHandStatements as d, renderRenameTableCall as f, sqlitePlannerStrategies as g, sqliteContractToSchema as h, conflictForDisallowedCall as i, pairIndexReplacements as l, sqliteColumnRenameCall as m, buildSqlitePlanDiff as n, diffSqliteSchema as o, sqliteActualSchema as p, coalesceSubtreeIssues as r, indexNameCaseChange as s, SqliteMigration as t, planIssues as u, sqliteTableRenameByHand as v, sqliteTableRenameCall as y };
|
|
1334
1334
|
|
|
1335
|
-
//# sourceMappingURL=sqlite-migration-
|
|
1335
|
+
//# sourceMappingURL=sqlite-migration-Dn0aIhV7-B1eALxxb.mjs.map
|