@prisma/orm-target-sqlite 8.0.0-rc.1-dev.3 → 8.0.0-rc.1-dev.4

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.
Files changed (78) hide show
  1. package/dist/{adapter-Dq0Gn7Uz-ChiMxJBJ.mjs → adapter-Dq0Gn7Uz-DMsm-8_y.mjs} +4 -4
  2. package/dist/{adapter-Dq0Gn7Uz-ChiMxJBJ.mjs.map → adapter-Dq0Gn7Uz-DMsm-8_y.mjs.map} +1 -1
  3. package/dist/adapter.d.mts +3 -3
  4. package/dist/adapter.mjs +2 -2
  5. package/dist/adapter__adapter.mjs +1 -1
  6. package/dist/adapter__codec-types.d.mts +3 -3
  7. package/dist/adapter__column-types.mjs +1 -1
  8. package/dist/adapter__control.mjs +3 -3
  9. package/dist/adapter__runtime.mjs +3 -3
  10. package/dist/adapter__sql-renderer.mjs +1 -1
  11. package/dist/{aggregates-CTDRDyvD.mjs → aggregates-Cy5ovVZD.mjs} +4 -3
  12. package/dist/aggregates-Cy5ovVZD.mjs.map +1 -0
  13. package/dist/codec-ids-7WqtUuda.d.mts +1 -0
  14. package/dist/{codec-ids-DocGjhs--CHhP1jNZ.d.mts → codec-ids-CzeDyMWW-BZAcI50I.d.mts} +4 -3
  15. package/dist/codec-ids-CzeDyMWW-BZAcI50I.d.mts.map +1 -0
  16. package/dist/codec-ids-KMliSCRp-BhTbmbGr.mjs +14 -0
  17. package/dist/codec-ids-KMliSCRp-BhTbmbGr.mjs.map +1 -0
  18. package/dist/codec-types-B-TDcvQc.d.mts +1 -0
  19. package/dist/codec-types-CS0bD1kX.d.mts +2 -0
  20. package/dist/{codec-types-DOyikA9Q-DVHiIZxI.d.mts → codec-types-D7uWRvQ1-DPnvquS8.d.mts} +4 -3
  21. package/dist/codec-types-D7uWRvQ1-DPnvquS8.d.mts.map +1 -0
  22. package/dist/{codecs-CEh66QoN-oCsdncEe.d.mts → codecs-BQWqLgCl-CdB8t7HI.d.mts} +37 -5
  23. package/dist/{codecs-CEh66QoN-oCsdncEe.d.mts.map → codecs-BQWqLgCl-CdB8t7HI.d.mts.map} +1 -1
  24. package/dist/codecs-BTv6fRXv.d.mts +1 -0
  25. package/dist/{codecs-BaoqGdxT.mjs → codecs-_uRxBgUK.mjs} +97 -6
  26. package/dist/codecs-_uRxBgUK.mjs.map +1 -0
  27. package/dist/{column-types-StKUDF6A.mjs → column-types-NVxgsjFA.mjs} +2 -2
  28. package/dist/{column-types-StKUDF6A.mjs.map → column-types-NVxgsjFA.mjs.map} +1 -1
  29. package/dist/{contract-free-DElSXD0q.mjs → contract-free-D5cZrgNl.mjs} +3 -3
  30. package/dist/{contract-free-DElSXD0q.mjs.map → contract-free-D5cZrgNl.mjs.map} +1 -1
  31. package/dist/{ddl-CW34JvfE-rd1ZIxOn.mjs → ddl-CXduXyOT-nlDP6DGx.mjs} +3 -3
  32. package/dist/{ddl-CW34JvfE-rd1ZIxOn.mjs.map → ddl-CXduXyOT-nlDP6DGx.mjs.map} +1 -1
  33. package/dist/{descriptor-meta-DjKgG4z5-CDdHwPoG.mjs → descriptor-meta-DjKgG4z5-Cblr1jL7.mjs} +3 -3
  34. package/dist/{descriptor-meta-DjKgG4z5-CDdHwPoG.mjs.map → descriptor-meta-DjKgG4z5-Cblr1jL7.mjs.map} +1 -1
  35. package/dist/{descriptor-meta-DnwDwnGg-D3f936hn.mjs → descriptor-meta-nORSZfmr-Cw-pzAJr.mjs} +13 -3
  36. package/dist/descriptor-meta-nORSZfmr-Cw-pzAJr.mjs.map +1 -0
  37. package/dist/{migration-jsmNRI_8.mjs → migration-DWP33-2M.mjs} +2 -2
  38. package/dist/{migration-jsmNRI_8.mjs.map → migration-DWP33-2M.mjs.map} +1 -1
  39. package/dist/{op-factory-call-C_or6163-B_LDzC37.mjs → op-factory-call-BCDGjXmK-D_Q47Yko.mjs} +3 -3
  40. package/dist/{op-factory-call-C_or6163-B_LDzC37.mjs.map → op-factory-call-BCDGjXmK-D_Q47Yko.mjs.map} +1 -1
  41. package/dist/{pack-Cnu6UOJx.d.mts → pack-DIbefoZF.d.mts} +11 -2
  42. package/dist/pack-DIbefoZF.d.mts.map +1 -0
  43. package/dist/{planner-DiGcIjl1-oFtDTY7-.mjs → planner-B9A1yTAH-NXeVipfr.mjs} +4 -4
  44. package/dist/{planner-DiGcIjl1-oFtDTY7-.mjs.map → planner-B9A1yTAH-NXeVipfr.mjs.map} +1 -1
  45. package/dist/{planner-produced-sqlite-migration-C8nxPT0P-DdBqfmAD.mjs → planner-produced-sqlite-migration-BRxGeP57-Ban7mFdH.mjs} +3 -3
  46. package/dist/{planner-produced-sqlite-migration-C8nxPT0P-DdBqfmAD.mjs.map → planner-produced-sqlite-migration-BRxGeP57-Ban7mFdH.mjs.map} +1 -1
  47. package/dist/{sqlite-migration-CV6LIqhx-D5eMTAbH.mjs → sqlite-migration-DWl9RerP-X0sf9N80.mjs} +3 -3
  48. package/dist/{sqlite-migration-CV6LIqhx-D5eMTAbH.mjs.map → sqlite-migration-DWl9RerP-X0sf9N80.mjs.map} +1 -1
  49. package/dist/target.d.mts +8 -8
  50. package/dist/target.mjs +11 -11
  51. package/dist/target__aggregates.mjs +1 -1
  52. package/dist/target__codec-ids.d.mts +3 -3
  53. package/dist/target__codec-ids.mjs +2 -2
  54. package/dist/target__codec-types.d.mts +3 -3
  55. package/dist/target__codecs.d.mts +3 -3
  56. package/dist/target__codecs.mjs +2 -2
  57. package/dist/target__contract-free.mjs +2 -2
  58. package/dist/target__control.mjs +2 -2
  59. package/dist/target__control.mjs.map +1 -1
  60. package/dist/target__migration.mjs +2 -2
  61. package/dist/target__op-factory-call.mjs +1 -1
  62. package/dist/target__pack.d.mts +1 -1
  63. package/dist/target__pack.mjs +1 -1
  64. package/dist/target__planner-produced-sqlite-migration.mjs +1 -1
  65. package/dist/target__planner.mjs +1 -1
  66. package/package.json +9 -9
  67. package/dist/aggregates-CTDRDyvD.mjs.map +0 -1
  68. package/dist/codec-ids-ChRBs2aB.d.mts +0 -1
  69. package/dist/codec-ids-DocGjhs--CHhP1jNZ.d.mts.map +0 -1
  70. package/dist/codec-ids-xicqpuAa-DHnKqnIs.mjs +0 -13
  71. package/dist/codec-ids-xicqpuAa-DHnKqnIs.mjs.map +0 -1
  72. package/dist/codec-types-BV3IjK44.d.mts +0 -2
  73. package/dist/codec-types-C29741cn.d.mts +0 -1
  74. package/dist/codec-types-DOyikA9Q-DVHiIZxI.d.mts.map +0 -1
  75. package/dist/codecs-BVBvwzGc.d.mts +0 -1
  76. package/dist/codecs-BaoqGdxT.mjs.map +0 -1
  77. package/dist/descriptor-meta-DnwDwnGg-D3f936hn.mjs.map +0 -1
  78. package/dist/pack-Cnu6UOJx.d.mts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"op-factory-call-C_or6163-B_LDzC37.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/op-factory-call-C_or6163.mjs"],"sourcesContent":["import { n as sqliteError } from \"./errors-CKsaaSnD.mjs\";\nimport { n as quoteIdentifier, t as escapeLiteral } from \"./sql-utils-DqPXZBMA.mjs\";\nimport { i as tableExistsAst, n as columnExistsAst, r as indexExistsAst, t as createTable } from \"./ddl-CW34JvfE.mjs\";\nimport { t as buildTargetDetails } from \"./planner-target-details-CIQ789Gc.mjs\";\nimport { n as stripOuterParens } from \"./default-normalizer-DuoHj9-O.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { RelationalSchemaNodeKind } from \"@internal/sql-schema-ir/types\";\nimport { issueOutcome } from \"@internal/framework-components/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\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\", `SQLite does not support expression CHECK constraints (constraint \"${constraint.name}\"). Scalar-array columns and their element-non-null checks are Postgres-only.`, { 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-C_or6163.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,EAAE,CAAC;AAC9R;;;;;;AAMA,SAAS,mBAAmB,QAAQ,eAAe,CAAC,GAAG;CACtD,MAAM,WAAW,0BAA0B,QAAQ,YAAY;CAC/D,qBAAqB,SAAS,UAAU;CACxC,OAAO,SAAS,WAAW,YAAY;AACxC;;;;;;;AAOA,SAAS,sBAAsB,eAAe;CAC7C,IAAI,CAAC,eAAe,OAAO;CAC3B,QAAQ,cAAc,MAAtB;EACC,KAAK,WAAW,OAAO,WAAW,qBAAqB,cAAc,KAAK;EAC1E,KAAK;GACJ,IAAI,cAAc,eAAe,mBAAmB,OAAO;GAC3D,IAAI,cAAc,eAAe,SAAS,OAAO;GACjD,4BAA4B,cAAc,UAAU;GACpD,OAAO,YAAY,cAAc,WAAW;CAC9C;AACD;AACA,SAAS,qBAAqB,OAAO;CACpC,IAAI,iBAAiB,MAAM,OAAO,IAAI,cAAc,MAAM,YAAY,CAAC,EAAE;CACzE,IAAI,OAAO,UAAU,UAAU,OAAO,IAAI,cAAc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ACA;CACA,YAAY,IAAI,OAAO,WAAW,YAAY;EAC7C,MAAM;EACN,KAAK,KAAK;EACV,KAAK,QAAQ;EACb,KAAK,YAAY;EACjB,KAAK,aAAa;EAClB,KAAK,OAAO;CACb;CACA,KAAK,UAAU;EACd,MAAM,yBAAyB,KAAK,KAAK;CAC1C;CACA,mBAAmB;EAClB,MAAM,OAAO,GAAG,KAAK,UAAU,GAAG,KAAK,WAAW;EAClD,OAAO;GACN;GACA,SAAS,eAAe,KAAK,EAAE,EAAE;GACjC,YAAY,eAAe,KAAK,KAAK,EAAE;GACvC,YAAY,eAAe,KAAK,SAAS,EAAE;GAC3C,kBAAkB,eAAe,iBAAiB,KAAK,WAAW,aAAa,KAAK,WAAW,EAAE;GACjG,4BAA4B,eAAe,IAAI,EAAE;GACjD;EACD,CAAC,CAAC,KAAK,IAAI;CACZ;CACA,qBAAqB;EACpB,OAAO,CAAC;GACP,iBAAiB;GACjB,QAAQ,KAAK;EACd,GAAG;GACF,iBAAiB;GACjB,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
+ {"version":3,"file":"op-factory-call-BCDGjXmK-D_Q47Yko.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/op-factory-call-BCDGjXmK.mjs"],"sourcesContent":["import { n as sqliteError } from \"./errors-CKsaaSnD.mjs\";\nimport { n as quoteIdentifier, t as escapeLiteral } from \"./sql-utils-DqPXZBMA.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 { blindCast } from \"@internal/utils/casts\";\nimport { RelationalSchemaNodeKind } from \"@internal/sql-schema-ir/types\";\nimport { issueOutcome } from \"@internal/framework-components/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\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\", `SQLite does not support expression CHECK constraints (constraint \"${constraint.name}\"). Scalar-array columns and their element-non-null checks are Postgres-only.`, { 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-BCDGjXmK.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,EAAE,CAAC;AAC9R;;;;;;AAMA,SAAS,mBAAmB,QAAQ,eAAe,CAAC,GAAG;CACtD,MAAM,WAAW,0BAA0B,QAAQ,YAAY;CAC/D,qBAAqB,SAA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M;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,9 +1,18 @@
1
- import { t as CodecTypes } from "./codec-types-DOyikA9Q-DVHiIZxI.mjs";
1
+ import { t as CodecTypes } from "./codec-types-D7uWRvQ1-DPnvquS8.mjs";
2
2
  //#region ../../../3-targets/3-targets/sqlite/dist/pack.d.mts
3
3
  //#region src/core/descriptor-meta.d.ts
4
4
  declare const sqliteTargetDescriptorMetaBase: {
5
5
  readonly defaultNamespaceId: "__unbound__";
6
6
  readonly authoring: {
7
+ readonly type: {
8
+ readonly BigIntNumber: {
9
+ readonly kind: "typeConstructor";
10
+ readonly output: {
11
+ readonly codecId: "sqlite/bigintnumber@1";
12
+ readonly nativeType: "integer";
13
+ };
14
+ };
15
+ };
7
16
  readonly field: {
8
17
  readonly temporal: {
9
18
  readonly datetime: {
@@ -90,4 +99,4 @@ declare const sqliteTargetDescriptorMeta: typeof sqliteTargetDescriptorMetaBase
90
99
  };
91
100
  //#endregion
92
101
  export { sqliteTargetDescriptorMeta as t };
93
- //# sourceMappingURL=pack-Cnu6UOJx.d.mts.map
102
+ //# sourceMappingURL=pack-DIbefoZF.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pack-DIbefoZF.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/pack.d.mts"],"mappings":";;;cAEc;WACH;WACA;aACE;eACE;iBACE;iBACA;mBACE;mBACA;;;;aAIN;eACE;iBACE;mBACE;mBACA;qBACE;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;yBACA;2BACE;6BACE;6BACA;;;;uBAIN;yBACE;yBACA;yBACA;2BACE;6BACE;6BACA;;;;;;;iBAOZ;mBACE;mBACA;qBACE;qBACA;qBACA;uBACE;uBACA;;;;iBAIN;mBACE;mBACA;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;;uBAEF;yBACE;yBACA;;;;;;;;WAQd;WACA;WACA;WACA;WACA;WACA;WACA,eAAe;;cAEZ,mCAAmC;WACtC,eAAe"}
@@ -1,6 +1,6 @@
1
- import { a as DropColumnCall, d as buildColumnTypeSql, f as buildRecreatePostchecks, i as DataTransformCall, l as RecreateTableCall, m as renderDefaultLiteral, n as CreateIndexCall, o as DropIndexCall, p as buildRecreateSummary, r as CreateTableCall, s as DropTableCall, t as AddColumnCall, u as buildColumnDefaultSql } from "./op-factory-call-C_or6163-B_LDzC37.mjs";
1
+ import { a as DropColumnCall, d as buildColumnTypeSql, f as buildRecreatePostchecks, i as DataTransformCall, l as RecreateTableCall, m as renderDefaultLiteral, n as CreateIndexCall, o as DropIndexCall, p as buildRecreateSummary, r as CreateTableCall, s as DropTableCall, t as AddColumnCall, u as buildColumnDefaultSql } from "./op-factory-call-BCDGjXmK-D_Q47Yko.mjs";
2
2
  import { t as CONTROL_TABLE_NAMES } from "./control-tables-D_o8dKRB-BXi43noL.mjs";
3
- import { t as TypeScriptRenderableSqliteMigration } from "./planner-produced-sqlite-migration-C8nxPT0P-DdBqfmAD.mjs";
3
+ import { t as TypeScriptRenderableSqliteMigration } from "./planner-produced-sqlite-migration-BRxGeP57-Ban7mFdH.mjs";
4
4
  import { DdlColumn, ForeignKeyConstraint, FunctionColumnDefault, LiteralColumnDefault, PrimaryKeyConstraint, UniqueConstraint } from "@prisma/orm-family-sql/relational-core/ast";
5
5
  import { blindCast } from "@prisma/orm-framework/utils/casts";
6
6
  import { diffSchemas, issueOutcome, orderIssuesByDependencies } from "@prisma/orm-framework/components/control";
@@ -11,7 +11,7 @@ import { RelationalSchemaNodeKind, SqlSchemaIR, relationalNodeGranularity } from
11
11
  import { verifySqlSchemaByDiff } from "@prisma/orm-family-sql/family/diff";
12
12
  import { notOk, ok } from "@prisma/orm-framework/utils/result";
13
13
  import { InternalError, assertNever } from "@prisma/orm-framework/utils/internal-error";
14
- //#region ../../../3-targets/3-targets/sqlite/dist/planner-DiGcIjl1.mjs
14
+ //#region ../../../3-targets/3-targets/sqlite/dist/planner-B9A1yTAH.mjs
15
15
  /** Renders a column default for the SQLite dialect. */
16
16
  function sqliteRenderDefault(def, _column) {
17
17
  if (def.kind === "function") {
@@ -808,4 +808,4 @@ function retainUnownedExtras(issues, ownership) {
808
808
  //#endregion
809
809
  export { verifySqliteDatabaseSchema as a, sqliteContractToSchema as i, createSqliteMigrationPlanner as n, diffSqliteSchema as r, SqliteMigrationPlanner as t };
810
810
 
811
- //# sourceMappingURL=planner-DiGcIjl1-oFtDTY7-.mjs.map
811
+ //# sourceMappingURL=planner-B9A1yTAH-NXeVipfr.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"planner-DiGcIjl1-oFtDTY7-.mjs","names":["#lowerer"],"sources":["../../../../3-targets/3-targets/sqlite/dist/planner-DiGcIjl1.mjs"],"sourcesContent":["import { 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-C_or6163.mjs\";\nimport { t as CONTROL_TABLE_NAMES } from \"./control-tables-D_o8dKRB.mjs\";\nimport { t as TypeScriptRenderableSqliteMigration } from \"./planner-produced-sqlite-migration-C8nxPT0P.mjs\";\nimport { DdlColumn, ForeignKeyConstraint, FunctionColumnDefault, LiteralColumnDefault, PrimaryKeyConstraint, UniqueConstraint } from \"@internal/sql-relational-core/ast\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { RelationalSchemaNodeKind, SqlSchemaIR, relationalNodeGranularity } from \"@internal/sql-schema-ir/types\";\nimport { UNBOUND_NAMESPACE_ID, entityAt } from \"@internal/framework-components/ir\";\nimport { buildNativeTypeExpander, contractToSchemaIR, 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 { ifDefined } from \"@internal/utils/defined\";\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*/\nfunction tableConstraintsFromNode(table, hasInlinePk) {\n\tconst constraints = [];\n\tif (table.primaryKey && !hasInlinePk) constraints.push(new PrimaryKeyConstraint({ columns: table.primaryKey.columns }));\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\", `SQLite 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 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-DiGcIjl1.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,oBAAoB,KAAK,SAAS;CAC1C,IAAI,IAAI,SAAS,YAAY;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planner-B9A1yTAH-NXeVipfr.mjs","names":["#lowerer"],"sources":["../../../../3-targets/3-targets/sqlite/dist/planner-B9A1yTAH.mjs"],"sourcesContent":["import { 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-BCDGjXmK.mjs\";\nimport { t as CONTROL_TABLE_NAMES } from \"./control-tables-D_o8dKRB.mjs\";\nimport { t as TypeScriptRenderableSqliteMigration } from \"./planner-produced-sqlite-migration-BRxGeP57.mjs\";\nimport { DdlColumn, ForeignKeyConstraint, FunctionColumnDefault, LiteralColumnDefault, PrimaryKeyConstraint, UniqueConstraint } from \"@internal/sql-relational-core/ast\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { RelationalSchemaNodeKind, SqlSchemaIR, relationalNodeGranularity } from \"@internal/sql-schema-ir/types\";\nimport { UNBOUND_NAMESPACE_ID, entityAt } from \"@internal/framework-components/ir\";\nimport { buildNativeTypeExpander, contractToSchemaIR, 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 { ifDefined } from \"@internal/utils/defined\";\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*/\nfunction tableConstraintsFromNode(table, hasInlinePk) {\n\tconst constraints = [];\n\tif (table.primaryKey && !hasInlinePk) constraints.push(new PrimaryKeyConstraint({ columns: table.primaryKey.columns }));\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\", `SQLite 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 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-B9A1yTAH.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,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,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