@prisma/orm-target-sqlite 8.0.0-rc.22-dev.8 → 8.0.0-rc.22-dev.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-PfKs5Kya.d.mts → adapter-BLfNDWw-.d.mts} +5 -5
- package/dist/{adapter-PfKs5Kya.d.mts.map → adapter-BLfNDWw-.d.mts.map} +1 -1
- package/dist/{adapter-gpb0ICA2-DPjB1dMR.mjs → adapter-gpb0ICA2-Ddnczc5D.mjs} +3 -3
- package/dist/{adapter-gpb0ICA2-DPjB1dMR.mjs.map → adapter-gpb0ICA2-Ddnczc5D.mjs.map} +1 -1
- package/dist/{adapter-xFPDhkod-Cio6up_5.d.mts → adapter-xFPDhkod-DB6XDGgl.d.mts} +3 -3
- package/dist/{adapter-xFPDhkod-Cio6up_5.d.mts.map → adapter-xFPDhkod-DB6XDGgl.d.mts.map} +1 -1
- package/dist/adapter.d.mts +9 -9
- package/dist/adapter.mjs +2 -2
- package/dist/adapter__adapter.d.mts +2 -2
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__codec-types.d.mts +3 -3
- package/dist/adapter__control.d.mts +2 -2
- package/dist/adapter__control.mjs +3 -3
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +3 -3
- package/dist/adapter__sql-renderer.d.mts +2 -2
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/adapter__types.d.mts +2 -2
- package/dist/{aggregates--0FaH9Te.d.mts → aggregates-DNxUFwla.d.mts} +4 -4
- package/dist/{aggregates--0FaH9Te.d.mts.map → aggregates-DNxUFwla.d.mts.map} +1 -1
- package/dist/{codec-types-CG5ZkqDU-DCx8ZvBg.d.mts → codec-types-CGtSWeZ5-B5RH39BA.d.mts} +3 -3
- package/dist/{codec-types-CG5ZkqDU-DCx8ZvBg.d.mts.map → codec-types-CGtSWeZ5-B5RH39BA.d.mts.map} +1 -1
- package/dist/codec-types-Dx9dQe-Y.d.mts +1 -0
- package/dist/codec-types-IproBv-Q.d.mts +2 -0
- package/dist/{codecs-BqOj4EKm-BaGeNd2m.d.mts → codecs-A0DbaZRE-CMyLhO_K.d.mts} +10 -2
- package/dist/codecs-A0DbaZRE-CMyLhO_K.d.mts.map +1 -0
- package/dist/{codecs-My4bmOU6-D4-b5qLd.mjs → codecs-BSYEsc7M-C4nov_lo.mjs} +10 -2
- package/dist/{codecs-My4bmOU6-D4-b5qLd.mjs.map → codecs-BSYEsc7M-C4nov_lo.mjs.map} +1 -1
- package/dist/{codecs-R3kGRyq2.mjs → codecs-BhRFtE69.mjs} +2 -2
- package/dist/{codecs-R3kGRyq2.mjs.map → codecs-BhRFtE69.mjs.map} +1 -1
- package/dist/codecs-CX5BZUdO.d.mts +1 -0
- package/dist/{control-DXzV_IVS.d.mts → control-Bc3l_1mV.d.mts} +3 -3
- package/dist/{control-DXzV_IVS.d.mts.map → control-Bc3l_1mV.d.mts.map} +1 -1
- package/dist/{descriptor-meta-DrNwC4vO-B9xeeDp9.mjs → descriptor-meta-DrNwC4vO-C_RZ1Tmp.mjs} +2 -2
- package/dist/{descriptor-meta-DrNwC4vO-B9xeeDp9.mjs.map → descriptor-meta-DrNwC4vO-C_RZ1Tmp.mjs.map} +1 -1
- package/dist/{migration-DYyfcQB_.mjs → migration-DBqx2jWN.mjs} +2 -2
- package/dist/{migration-DYyfcQB_.mjs.map → migration-DBqx2jWN.mjs.map} +1 -1
- package/dist/{migration-BHhnGEA2.d.mts → migration-Dekon_QC.d.mts} +3 -3
- package/dist/{migration-BHhnGEA2.d.mts.map → migration-Dekon_QC.d.mts.map} +1 -1
- package/dist/{op-factory-call-BQYECylm-K7S_xgRS.mjs → op-factory-call-Dxsyn5gF-CvHmM-h_.mjs} +506 -21
- package/dist/op-factory-call-Dxsyn5gF-CvHmM-h_.mjs.map +1 -0
- package/dist/{op-factory-call-B8bJlvkP.d.mts → op-factory-call-gQ5ddSys.d.mts} +78 -9
- package/dist/op-factory-call-gQ5ddSys.d.mts.map +1 -0
- package/dist/{pack-CXW0_XyO.d.mts → pack-D3gC0XlT.d.mts} +3 -3
- package/dist/{pack-CXW0_XyO.d.mts.map → pack-D3gC0XlT.d.mts.map} +1 -1
- package/dist/{planner-DNwf8s8s-BoXZwpVs.mjs → planner-DgEGQuj9-Ca6jqWrd.mjs} +111 -64
- package/dist/planner-DgEGQuj9-Ca6jqWrd.mjs.map +1 -0
- package/dist/{planner-DcOz-1na.d.mts → planner-ccevdpwf.d.mts} +2 -2
- package/dist/{planner-DcOz-1na.d.mts.map → planner-ccevdpwf.d.mts.map} +1 -1
- package/dist/{planner-produced-sqlite-migration-DyUPHRKW-CFtZi2VG.d.mts → planner-produced-sqlite-migration-BHH_ftCV-CndNmTrH.d.mts} +3 -3
- package/dist/planner-produced-sqlite-migration-BHH_ftCV-CndNmTrH.d.mts.map +1 -0
- package/dist/{planner-produced-sqlite-migration-Z9OWyjQn-DGMHz6I1.mjs → planner-produced-sqlite-migration-BMogETJ0-COe4tate.mjs} +4 -4
- package/dist/{planner-produced-sqlite-migration-Z9OWyjQn-DGMHz6I1.mjs.map → planner-produced-sqlite-migration-BMogETJ0-COe4tate.mjs.map} +1 -1
- package/dist/planner-produced-sqlite-migration-_n61WaiD.d.mts +1 -0
- package/dist/{render-ops-CJXrOY63-1y0nLsb8.mjs → render-ops-BUk3wlAR-Awdho1_L.mjs} +3 -3
- package/dist/{render-ops-CJXrOY63-1y0nLsb8.mjs.map → render-ops-BUk3wlAR-Awdho1_L.mjs.map} +1 -1
- package/dist/{runtime-BQKQH94p.d.mts → runtime-H_OgXoaz.d.mts} +2 -2
- package/dist/{runtime-BQKQH94p.d.mts.map → runtime-H_OgXoaz.d.mts.map} +1 -1
- package/dist/sql-renderer-_NdIrQuX.d.mts +1 -0
- package/dist/{sqlite-migration-BxQ65pKq-C7siJGuR.mjs → sqlite-migration-B42dCAqX-DiSO-PeZ.mjs} +47 -7
- package/dist/sqlite-migration-B42dCAqX-DiSO-PeZ.mjs.map +1 -0
- package/dist/{sqlite-migration-CcXBptQr-DlKSNedI.d.mts → sqlite-migration-C_9TPlLD-DtKN8bi9.d.mts} +52 -4
- package/dist/sqlite-migration-C_9TPlLD-DtKN8bi9.d.mts.map +1 -0
- package/dist/{tables-C9afyQN9-CkIhVNYn.d.mts → tables-BY3u6rl_-Coqqy4JK.d.mts} +11 -3
- package/dist/tables-BY3u6rl_-Coqqy4JK.d.mts.map +1 -0
- package/dist/target.d.mts +13 -13
- package/dist/target.mjs +9 -9
- package/dist/target__aggregates.d.mts +1 -1
- package/dist/target__codec-types.d.mts +3 -3
- package/dist/target__codecs.d.mts +2 -2
- package/dist/target__codecs.mjs +2 -2
- package/dist/target__control.mjs +52 -32
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__migration.d.mts +2 -2
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.d.mts +2 -2
- package/dist/target__op-factory-call.mjs +2 -2
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__planner-produced-sqlite-migration.d.mts +2 -2
- package/dist/target__planner-produced-sqlite-migration.mjs +1 -1
- package/dist/target__planner.d.mts +1 -1
- package/dist/target__planner.mjs +1 -1
- package/dist/target__render-ops.mjs +1 -1
- package/dist/{types-DpDK9e9U.d.mts → types-28E593y9.d.mts} +1 -1
- package/package.json +10 -10
- package/dist/codec-types-BQCSRfvR.d.mts +0 -1
- package/dist/codec-types-YpVaNlY0.d.mts +0 -2
- package/dist/codecs-BqOj4EKm-BaGeNd2m.d.mts.map +0 -1
- package/dist/codecs-DzkRnjjE.d.mts +0 -1
- package/dist/op-factory-call-B8bJlvkP.d.mts.map +0 -1
- package/dist/op-factory-call-BQYECylm-K7S_xgRS.mjs.map +0 -1
- package/dist/planner-DNwf8s8s-BoXZwpVs.mjs.map +0 -1
- package/dist/planner-produced-sqlite-migration-DxyN096L.d.mts +0 -1
- package/dist/planner-produced-sqlite-migration-DyUPHRKW-CFtZi2VG.d.mts.map +0 -1
- package/dist/sql-renderer-CgY2Sghp.d.mts +0 -1
- package/dist/sqlite-migration-BxQ65pKq-C7siJGuR.mjs.map +0 -1
- package/dist/sqlite-migration-CcXBptQr-DlKSNedI.d.mts.map +0 -1
- package/dist/tables-C9afyQN9-CkIhVNYn.d.mts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"op-factory-call-BQYECylm-K7S_xgRS.mjs","names":["#written","#slotsSource"],"sources":["../../../../3-targets/sqlite/1-target/dist/op-factory-call-BQYECylm.mjs"],"sourcesContent":["import { c as sqliteError } from \"./errors-D9vZNPSI.mjs\";\nimport { n as escapeLiteral, r as quoteIdentifier, t as SQLITE_QUOTING } from \"./sql-utils-C9blmi9x.mjs\";\nimport { r as stripOuterParens } from \"./default-normalizer-CsMhUEOe.mjs\";\nimport { a as tableExistsAst, i as indexExistsAst, n as columnExistsAst, o as tableNameTakenAst, r as columnNameTakenAst, t as createTable } from \"./ddl-BvD-wVtg.mjs\";\nimport { t as buildTargetDetails } from \"./planner-target-details-Daaeo8s9.mjs\";\nimport { DdlColumn, FunctionColumnDefault, LiteralColumnDefault, opaqueSql } from \"@internal/sql-relational-core/ast\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport \"@internal/framework-components/codec\";\nimport \"@internal/sql-contract/data-type\";\nimport { type } from \"arktype\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { assertNever } from \"@internal/utils/internal-error\";\nimport { expectAbsent, expectPresent, issueOutcome } from \"@internal/framework-components/control\";\nimport { checkSqlExpressionText, convertedColumnMeta, createSqlTextSources, encodeStoredValue, isUnfilledSlot, requiredColumnMeta, rowsHoldingValueMeta, slotSource, sqlOfSlot } from \"@internal/family-sql/control\";\nimport { RelationalSchemaNodeKind, sqlColumnTypesEqual } from \"@internal/sql-schema-ir/types\";\nimport { errorMigrationOperationOptionRemoved, unfilledPlaceholderOperation } from \"@internal/errors/migration\";\nimport { REFERENTIAL_ACTION_SQL } from \"@internal/sql-contract/referential-action-sql\";\nimport { TsExpression, jsonToTsSource, tsArraySource, tsObjectSource, tsQuotedTextSource } from \"@internal/ts-render\";\n//#region src/core/migrations/identifier-case.ts\nfunction foldAsciiLetters(identifier) {\n\treturn identifier.replace(/[A-Z]/g, (letter) => letter.toLowerCase());\n}\n/**\n* Whether SQLite takes two identifiers for the same name. It compares table and index names without regard to the case of ASCII letters, and compares every other character exactly.\n*/\nfunction sqliteIdentifiersCollide(left, right) {\n\treturn foldAsciiLetters(left) === foldAsciiLetters(right);\n}\n//#endregion\n//#region src/core/migrations/operations/shared.ts\nfunction step(description, sql, params, expectation) {\n\treturn {\n\t\tdescription,\n\t\tsql,\n\t\t...ifDefined(\"params\", params),\n\t\t...ifDefined(\"expectation\", expectation)\n\t};\n}\n/** The text a `DdlColumn`'s type ends with when the column is SQLite's inline `INTEGER PRIMARY KEY AUTOINCREMENT`. */\nconst INLINE_AUTOINCREMENT_PRIMARY_KEY = \" PRIMARY KEY AUTOINCREMENT\";\n/** The DDL default of a contract default: `autoincrement()` is written as part of the column's type instead. */\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(opaqueSql(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* A column spec an earlier version wrote carries its default as SQL text in `defaultSql`, empty when it has none.\n*/\nfunction refuseEarlierColumnSpecs(operation, tableName, columns) {\n\tconst earlier = columns.find((column) => Object.hasOwn(column, \"defaultSql\"));\n\tif (earlier === void 0) return;\n\tthrow errorMigrationOperationOptionRemoved({\n\t\toperation,\n\t\toption: \"defaultSql\",\n\t\tsubject: `column ${JSON.stringify(earlier.name)} of table ${JSON.stringify(tableName)}`,\n\t\trewrite: \"Write the column's default as `default: { kind: 'literal', value }` or `default: { kind: 'function', expression }`, with the column's `codecRef`, in place of `defaultSql`, and delete an empty `defaultSql`.\",\n\t\tupgradeEntry: \"migration-ts-column-defaults\"\n\t});\n}\n/** The `DEFAULT …` clause the adapter writes for a column spec, `''` when it has none. */\nfunction renderSpecDefault$1(column, tableName, lowerer) {\n\tconst ddlDefault = column.inlineAutoincrementPrimaryKey ? void 0 : sqliteDefaultToDdlColumnDefault(column.default);\n\treturn lowerer.renderColumnDefault(new DdlColumn({\n\t\tname: column.name,\n\t\ttype: column.typeSql,\n\t\t...ifDefined(\"default\", ddlDefault),\n\t\t...ifDefined(\"codecRef\", column.codecRef)\n\t}), tableName);\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, defaultClause) {\n\tconst parts = [quoteIdentifier(column.name), column.typeSql];\n\tif (column.inlineAutoincrementPrimaryKey) parts.push(\"PRIMARY KEY AUTOINCREMENT\");\n\telse {\n\t\tif (defaultClause) parts.push(defaultClause);\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/structure-checks.ts\nfunction text(value) {\n\treturn `'${escapeLiteral(value)}'`;\n}\nfunction columnRow(column) {\n\treturn `(${text(column.name)}, ${text(column.typeSql.toLowerCase())}, ${column.notNull ? 1 : 0}, ${column.primaryKeyPosition})`;\n}\n/** Checks that the table has exactly these columns, each with its type, nullability and primary key position. */\nfunction tableColumnsCheck(tableName, columns) {\n\tconst info = `pragma_table_info(${text(tableName)})`;\n\treturn {\n\t\tdescription: `verify table \"${tableName}\" has exactly its columns`,\n\t\tsql: `SELECT (SELECT COUNT(*) FROM ${info}) = ${columns.length} AND (SELECT COUNT(*) FROM ${info} WHERE (name, LOWER(type), \"notnull\", pk) IN (VALUES ${columns.map(columnRow).join(\", \")})) = ${columns.length}`\n\t};\n}\n/** Checks the column's type and nullability. */\nfunction columnShapeCheck(tableName, column) {\n\treturn {\n\t\tdescription: `verify column \"${column.name}\" on \"${tableName}\" has type ${column.typeSql} and ${column.notNull ? \"is required\" : \"is optional\"}`,\n\t\tsql: `SELECT COUNT(*) > 0 FROM pragma_table_info(${text(tableName)}) WHERE name = ${text(column.name)} AND LOWER(type) = ${text(column.typeSql.toLowerCase())} AND \"notnull\" = ${column.notNull ? 1 : 0}`\n\t};\n}\n/** Checks that the column takes NULL, or that no row holds `value` in it. */\nfunction columnTakesNullOrValueAbsentCheck(tableName, columnName, value, description) {\n\treturn {\n\t\tdescription,\n\t\tsql: `SELECT (SELECT COUNT(*) > 0 FROM pragma_table_info(${text(tableName)}) WHERE name = ${text(columnName)} AND \"notnull\" = 0) OR NOT EXISTS (SELECT 1 FROM ${quoteIdentifier(tableName)} WHERE ${quoteIdentifier(columnName)} = ?1) AS result`,\n\t\tparams: [value]\n\t};\n}\n/** Checks that the index is on the table, covers exactly these columns in this order, and is unique or not. */\nfunction indexDefinitionCheck(tableName, indexName, columns, unique) {\n\tconst positions = columns.map((column, seqno) => `(${seqno}, ${text(column)})`).join(\", \");\n\tconst info = `pragma_index_info(${text(indexName)})`;\n\treturn {\n\t\tdescription: `verify index \"${indexName}\" on \"${tableName}\" covers (${columns.join(\", \")})`,\n\t\tsql: `SELECT EXISTS (SELECT 1 FROM pragma_index_list(${text(tableName)}) WHERE name = ${text(indexName)} AND \"unique\" = ${unique ? 1 : 0}) AND (SELECT COUNT(*) FROM ${info}) = ${columns.length} AND (SELECT COUNT(*) FROM ${info} WHERE (seqno, name) IN (VALUES ${positions})) = ${columns.length}`\n\t};\n}\n//#endregion\n//#region src/core/migrations/operations/columns.ts\nfunction addColumnExecuteSql(tableName, column, defaultClause) {\n\treturn [\n\t\t`ALTER TABLE ${quoteIdentifier(tableName)}`,\n\t\t`ADD COLUMN ${quoteIdentifier(column.name)} ${column.typeSql}`,\n\t\tdefaultClause,\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}\nasync function addColumn(tableName, column, lowerer) {\n\trefuseEarlierColumnSpecs(\"addColumn\", tableName, [column]);\n\tconst defaultClause = await renderSpecDefault$1(column, tableName, lowerer);\n\tconst checks = columnExistsAst(tableName, column.name);\n\tconst absent = await lowerer.lowerToExecuteRequest(checks.columnAbsent());\n\tconst present = await lowerer.lowerToExecuteRequest(checks.columnPresent());\n\treturn {\n\t\tid: `column.${tableName}.${column.name}`,\n\t\tlabel: `Add column ${column.name} on ${tableName}`,\n\t\tsummary: `Adds column ${column.name} on ${tableName}`,\n\t\toperationClass: \"additive\",\n\t\ttarget: {\n\t\t\tid: \"sqlite\",\n\t\t\tdetails: buildTargetDetails(\"column\", column.name, tableName)\n\t\t},\n\t\tprecheck: [step(`ensure column \"${column.name}\" is missing`, absent.sql, absent.params, expectAbsent(`column \"${column.name}\" on \"${tableName}\"`))],\n\t\texecute: [step(`add column \"${column.name}\"`, addColumnExecuteSql(tableName, column, defaultClause))],\n\t\tpostcheck: [step(`verify column \"${column.name}\" exists`, present.sql, present.params, expectPresent(`column \"${column.name}\" on \"${tableName}\"`)), columnShapeCheck(tableName, {\n\t\t\tname: column.name,\n\t\t\ttypeSql: column.typeSql,\n\t\t\tnotNull: !column.nullable\n\t\t})]\n\t};\n}\nfunction renameColumnExecuteSql(tableName, fromName, toName) {\n\treturn `ALTER TABLE ${quoteIdentifier(tableName)} RENAME COLUMN ${quoteIdentifier(fromName)} TO ${quoteIdentifier(toName)}`;\n}\n/**\n* Renames a column. SQLite updates the indexes, foreign keys and triggers that name it, and keeps\n* index names. SQLite takes names that differ only in case for the same name, so the new name\n* must be free whatever its case, except in a rename that only changes case, which SQLite performs\n* in one statement.\n*/\nfunction renameColumnOperationId(tableName, fromName) {\n\treturn `renameColumn.${tableName}.${fromName}`;\n}\nasync function renameColumn(tableName, fromName, toName, lowerer) {\n\tconst fromChecks = columnExistsAst(tableName, fromName);\n\tconst toChecks = columnExistsAst(tableName, toName);\n\tconst fromPresent = await lowerer.lowerToExecuteRequest(fromChecks.columnPresent());\n\tconst onlyCase = sqliteIdentifiersCollide(fromName, toName);\n\tconst toAbsent = await lowerer.lowerToExecuteRequest(onlyCase ? toChecks.columnAbsent() : columnNameTakenAst(tableName, toName).nameFree());\n\tconst toPresent = await lowerer.lowerToExecuteRequest(toChecks.columnPresent());\n\tconst fromAbsent = await lowerer.lowerToExecuteRequest(fromChecks.columnAbsent());\n\treturn {\n\t\tid: renameColumnOperationId(tableName, fromName),\n\t\tlabel: `Rename column ${fromName} on ${tableName} to ${toName}`,\n\t\tsummary: `Renames column ${fromName} on ${tableName} to ${toName}, keeping its values`,\n\t\toperationClass: \"widening\",\n\t\ttarget: {\n\t\t\tid: \"sqlite\",\n\t\t\tdetails: buildTargetDetails(\"column\", toName, tableName)\n\t\t},\n\t\tprecheck: [step(`ensure column \"${fromName}\" exists on \"${tableName}\"`, fromPresent.sql, fromPresent.params, expectPresent(`column \"${fromName}\" on \"${tableName}\"`)), step(`ensure column \"${toName}\" does not exist on \"${tableName}\"`, toAbsent.sql, toAbsent.params, expectAbsent(onlyCase ? `column \"${toName}\" on \"${tableName}\"` : `a column named \"${toName}\" on \"${tableName}\" in any case`))],\n\t\texecute: [step(`rename column \"${fromName}\" on \"${tableName}\" to \"${toName}\"`, renameColumnExecuteSql(tableName, fromName, toName))],\n\t\tpostcheck: [step(`verify column \"${toName}\" exists on \"${tableName}\"`, toPresent.sql, toPresent.params, expectPresent(`column \"${toName}\" on \"${tableName}\"`)), step(`verify column \"${fromName}\" no longer exists on \"${tableName}\"`, fromAbsent.sql, fromAbsent.params, expectAbsent(`column \"${fromName}\" on \"${tableName}\"`))]\n\t};\n}\n//#endregion\n//#region src/core/migrations/operations/stored-values.ts\n/** A stored value as operation ids, labels and step descriptions write it. */\nfunction storedValueText(value) {\n\treturn JSON.stringify(value);\n}\nfunction idText(value) {\n\treturn String(value);\n}\nfunction valueAbsentCheck(tableName, columnName, value) {\n\treturn step(`verify no row of \"${tableName}\" holds value ${storedValueText(value)} in column \"${columnName}\"`, `SELECT NOT EXISTS (SELECT 1 FROM ${quoteIdentifier(tableName)} WHERE ${quoteIdentifier(columnName)} = ?1) AS result`, [value]);\n}\nfunction replaceStoredValue(tableName, columnName, from, to) {\n\tconst column = quoteIdentifier(columnName);\n\treturn {\n\t\tid: `replaceStoredValue.${tableName}.${columnName}.${idText(from)}`,\n\t\tlabel: `Replace value ${storedValueText(from)} with ${storedValueText(to)} in column \"${columnName}\" of \"${tableName}\"`,\n\t\toperationClass: \"widening\",\n\t\ttarget: {\n\t\t\tid: \"sqlite\",\n\t\t\tdetails: buildTargetDetails(\"column\", columnName, tableName)\n\t\t},\n\t\tprecheck: [],\n\t\texecute: [step(`replace value ${storedValueText(from)} with ${storedValueText(to)} in column \"${columnName}\"`, `UPDATE ${quoteIdentifier(tableName)} SET ${column} = ?2 WHERE ${column} = ?1`, [from, to])],\n\t\tpostcheck: [valueAbsentCheck(tableName, columnName, from)]\n\t};\n}\nfunction removeStoredValue(tableName, columnName, value, mark) {\n\tconst column = quoteIdentifier(columnName);\n\tconst takesNull = `ensure column \"${columnName}\" of \"${tableName}\" takes NULL, or no row holds ${storedValueText(value)} in it`;\n\treturn {\n\t\tid: `removeStoredValue.${tableName}.${columnName}.${idText(value)}`,\n\t\tlabel: `Remove value ${storedValueText(value)} from column \"${columnName}\" of \"${tableName}\"`,\n\t\toperationClass: \"destructive\",\n\t\ttarget: {\n\t\t\tid: \"sqlite\",\n\t\t\tdetails: buildTargetDetails(\"column\", columnName, tableName)\n\t\t},\n\t\tprecheck: [{\n\t\t\t...columnTakesNullOrValueAbsentCheck(tableName, columnName, value, takesNull),\n\t\t\t...mark === void 0 ? {} : { meta: rowsHoldingValueMeta(mark) }\n\t\t}],\n\t\texecute: [step(`remove value ${storedValueText(value)} from column \"${columnName}\"`, `UPDATE ${quoteIdentifier(tableName)} SET ${column} = NULL WHERE ${column} = ?1`, [value])],\n\t\tpostcheck: [valueAbsentCheck(tableName, columnName, value)]\n\t};\n}\n//#endregion\n//#region src/core/migrations/planner-ddl-builders.ts\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}\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, defaultClauses) {\n\tconst columnDefs = spec.columns.map((column, index) => renderColumnDefinition(column, defaultClauses[index] ?? \"\"));\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}\nfunction renameTableViaName(toName) {\n\treturn `_prisma_rename_${toName}`;\n}\nfunction renameChangesOnlyCase(fromName, toName) {\n\treturn sqliteIdentifiersCollide(fromName, toName);\n}\n/**\n* SQLite takes names that differ only in the case of ASCII letters for the\n* same name, so such a rename (`userProfile` to `UserProfile`) is refused as\n* \"already exists\" when done in one statement. It goes through a temporary name.\n*/\nfunction renameTableSteps(fromName, toName) {\n\tconst from = quoteIdentifier(fromName);\n\tconst to = quoteIdentifier(toName);\n\tif (!renameChangesOnlyCase(fromName, toName)) return [step(`rename table \"${fromName}\" to \"${toName}\"`, `ALTER TABLE ${from} RENAME TO ${to}`)];\n\tconst viaName = renameTableViaName(toName);\n\tconst via = quoteIdentifier(viaName);\n\treturn [step(`rename table \"${fromName}\" to \"${viaName}\" (SQLite table names are case-insensitive)`, `ALTER TABLE ${from} RENAME TO ${via}`), step(`rename table \"${viaName}\" to \"${toName}\"`, `ALTER TABLE ${via} RENAME TO ${to}`)];\n}\n/** The table a rebuild of `tableName` creates, copies into, and renames to `tableName`. */\nfunction rebuiltTableName(tableName) {\n\treturn `_prisma_new_${tableName}`;\n}\nasync function recreateTable(args, lowerer) {\n\tconst { tableName, contractTable, schemaColumnNames, indexes, summary, postchecks, operationClass, copyExpressions = {}, temporaryValues = {}, retypedColumns = [] } = args;\n\trefuseEarlierColumnSpecs(\"recreateTable\", tableName, contractTable.columns);\n\tconst tempName = rebuiltTableName(tableName);\n\tconst liveSet = new Set(schemaColumnNames);\n\tconst convertedBy = (column) => Object.hasOwn(copyExpressions, column) ? copyExpressions[column] : void 0;\n\tconst copiedFrom = (column) => convertedBy(column) ?? (Object.hasOwn(temporaryValues, column) ? temporaryValues[column] : void 0);\n\tconst sharedColumns = contractTable.columns.filter((c) => liveSet.has(c.name) || copiedFrom(c.name) !== void 0).map((c) => c.name);\n\tconst columnList = sharedColumns.map(quoteIdentifier).join(\", \");\n\tconst selectList = sharedColumns.map((column) => copiedFrom(column) ?? quoteIdentifier(column)).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 conversions = Object.fromEntries(sharedColumns.flatMap((column) => {\n\t\tconst expression = convertedBy(column);\n\t\treturn expression === void 0 ? [] : [[column, expression]];\n\t}));\n\tconst copyStep = sharedColumns.length > 0 ? [{\n\t\t...step(`copy data from \"${tableName}\" to \"${tempName}\"`, `INSERT INTO ${quoteIdentifier(tempName)} (${columnList}) SELECT ${selectList} FROM ${quoteIdentifier(tableName)}`),\n\t\t...Object.keys(conversions).length === 0 ? {} : { meta: { conversionCopy: {\n\t\t\ttable: tableName,\n\t\t\texpressions: conversions\n\t\t} } }\n\t}] : [];\n\tconst defaultClauses = await renderSpecDefaults(contractTable, tableName, lowerer);\n\tconst clauseByColumn = new Map(contractTable.columns.map((column, index) => [column.name, defaultClauses[index] ?? \"\"]));\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: [\n\t\t\tstep(`ensure table \"${tableName}\" exists`, tableSteps.present.sql, tableSteps.present.params, expectPresent(`table \"${tableName}\"`)),\n\t\t\tstep(`ensure temp table \"${tempName}\" does not exist`, tempSteps.absent.sql, tempSteps.absent.params, expectAbsent(`temp table \"${tempName}\"`)),\n\t\t\tsourceColumnsCheck(tableName, schemaColumnNames)\n\t\t],\n\t\texecute: [\n\t\t\tstep(`create new table \"${tempName}\" with desired schema`, renderCreateTableSql(tempName, contractTable, defaultClauses)),\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, expectPresent(`table \"${tableName}\"`)),\n\t\t\tstep(`verify temp table \"${tempName}\" is gone`, tempSteps.absent.sql, tempSteps.absent.params, expectAbsent(`temp table \"${tempName}\"`)),\n\t\t\trebuiltTableCheck(tableName, renderCreateTableSql(tableName, contractTable, defaultClauses)),\n\t\t\t...postchecks.flatMap((check) => \"sql\" in check ? [markedStep(tableName, check)] : defaultPostcheck(tableName, check, clauseByColumn.get(check.columnDefault))),\n\t\t\t...contractTable.columns.flatMap((column) => {\n\t\t\t\tconst by = Object.hasOwn(conversions, column.name) ? \"conversion\" : retypedColumns.includes(column.name) ? \"cast\" : void 0;\n\t\t\t\treturn by === void 0 ? [] : [{\n\t\t\t\t\t...storageClassCheck(tableName, column),\n\t\t\t\t\tmeta: convertedColumnMeta(tableName, column.name, by)\n\t\t\t\t}];\n\t\t\t})\n\t\t]\n\t};\n}\n/**\n* Checks that the table has exactly the columns the rebuild reads, the ones it copies and the ones it\n* leaves out. The rebuild copies only the columns it knows, so on a table with another column, such\n* as one a later migration added, it would drop that column and its values.\n*/\nfunction sourceColumnsCheck(tableName, columns) {\n\tconst info = `pragma_table_info('${escapeLiteral(tableName)}')`;\n\tconst named = columns.length === 0 ? \"\" : ` AND (SELECT COUNT(*) FROM ${info} WHERE name IN (${quoteSqlList(columns)})) = ${columns.length}`;\n\treturn {\n\t\tdescription: `ensure table \"${tableName}\" has exactly the columns the rebuild copies or leaves out (${columns.join(\", \")})`,\n\t\tsql: `SELECT (SELECT COUNT(*) FROM ${info}) = ${columns.length}${named}`\n\t};\n}\n/**\n* Checks that the table is stored as the statement the rebuild writes. SQLite keeps a table's\n* `CREATE TABLE` text as written, and renaming the rebuilt table only replaces its name, so this holds\n* once the rebuild ran and not before, whatever text an earlier table had. It is the only check of\n* what SQLite keeps in that text alone, such as `AUTOINCREMENT`.\n*/\nfunction rebuiltTableCheck(tableName, statement) {\n\treturn {\n\t\tdescription: `verify \"${tableName}\" is stored as the rebuilt table`,\n\t\tsql: `SELECT (SELECT sql FROM sqlite_master WHERE type = 'table' AND name = '${escapeLiteral(tableName)}') = '${escapeLiteral(statement)}'`\n\t};\n}\nfunction markedStep(tableName, check) {\n\tconst { requiredColumn, ...step } = check;\n\tconst meta = { ...requiredColumn === void 0 ? {} : requiredColumnMeta(tableName, requiredColumn.column, requiredColumn.reason) };\n\treturn Object.keys(meta).length === 0 ? step : {\n\t\t...step,\n\t\tmeta\n\t};\n}\n/**\n* The storage classes SQLite keeps a value in once a column of `typeSql` has taken it: the column's\n* type affinity converts what it can, so a value of another class is one it could not convert.\n* See https://www.sqlite.org/datatype3.html#determination_of_column_affinity.\n*/\nfunction affinityStorageClasses(typeSql) {\n\tconst declared = typeSql.toUpperCase();\n\tif (declared.includes(\"INT\")) return [\"integer\"];\n\tif ([\n\t\t\"CHAR\",\n\t\t\"CLOB\",\n\t\t\"TEXT\"\n\t].some((part) => declared.includes(part))) return [\"text\"];\n\tif (declared === \"\" || declared.includes(\"BLOB\")) return [\"blob\"];\n\tif ([\n\t\t\"REAL\",\n\t\t\"FLOA\",\n\t\t\"DOUB\"\n\t].some((part) => declared.includes(part))) return [\"real\"];\n\treturn [\"integer\", \"real\"];\n}\n/**\n* The check that the copy into a rebuilt table converted every value of a retyped column to the\n* column's new type. SQLite keeps a value it cannot convert in its old storage class, so a value of\n* any other class than the column's affinity keeps fails the check.\n*/\nfunction storageClassCheck(tableName, column) {\n\tconst classes = [\"null\", ...affinityStorageClasses(column.typeSql)].map((storageClass) => `'${storageClass}'`).join(\", \");\n\treturn {\n\t\tdescription: `verify every value of \"${column.name}\" on \"${tableName}\" is stored as ${column.typeSql}`,\n\t\tsql: `SELECT NOT EXISTS (SELECT 1 FROM ${quoteIdentifier(tableName)} WHERE typeof(${quoteIdentifier(column.name)}) NOT IN (${classes}))`\n\t};\n}\nconst ConversionCopyMeta = type({ conversionCopy: {\n\ttable: \"string\",\n\texpressions: \"Record<string, string>\"\n} });\n/**\n* The table a rebuild's copy step reads and the copy expression of each column its conversions\n* convert, when the step converts any: an error of the step may be an error of one of them.\n*/\nfunction conversionCopyOf(step) {\n\tconst meta = ConversionCopyMeta(step.meta ?? {});\n\treturn meta instanceof type.errors ? void 0 : meta.conversionCopy;\n}\nfunction renderSpecDefaults(spec, tableName, lowerer) {\n\treturn Promise.all(spec.columns.map((column) => renderSpecDefault$1(column, tableName, lowerer)));\n}\n/**\n* Checks the column's default is the text of its `DEFAULT …` clause. SQLite's\n* `pragma_table_info.dflt_value` strips the outer parentheses of an expression\n* default, so `(strftime('%Y-%m-%dT%H:%M:%fZ','now'))` is stored as `strftime('%Y-%m-%dT%H:%M:%fZ','now')`; they are\n* stripped here too.\n*/\nfunction defaultPostcheck(tableName, check, clause) {\n\tif (clause === void 0 || !clause.startsWith(\"DEFAULT \")) return [];\n\tconst expectedRaw = stripOuterParens(clause.slice(8));\n\treturn [{\n\t\tdescription: check.description,\n\t\tsql: `SELECT COUNT(*) > 0 FROM pragma_table_info('${escapeLiteral(tableName)}') WHERE name = '${escapeLiteral(check.columnDefault)}' AND dflt_value = '${escapeLiteral(expectedRaw)}'`\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/**\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}\n/** The text `pragma_foreign_key_list` reports for a referential action; SQLite reads an absent action as `NO ACTION`. */\nfunction referentialActionText(action) {\n\treturn REFERENTIAL_ACTION_SQL[action ?? \"noAction\"];\n}\nfunction quoteSqlList(values) {\n\treturn values.map((v) => `'${escapeLiteral(v)}'`).join(\", \");\n}\n/**\n* A condition on the index aliased `l`: it covers exactly these columns. Order is not checked, because SQLite identifies a unique index by its column set.\n*/\nfunction indexCoversExactly(columns) {\n\treturn `(SELECT COUNT(*) FROM pragma_index_info(l.name)) = ${columns.length} AND (SELECT COUNT(*) FROM pragma_index_info(l.name) WHERE name IN (${quoteSqlList(columns)})) = ${columns.length}`;\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* Compares the declared type with `typeSql`: exactly for a data type named by its catalog text, as\n* verify compares it (ADR 273), and without case otherwise.\n*/\nfunction declaredTypeMatches(expected, typeSql) {\n\treturn expected.catalogText !== void 0 ? `type = '${escapeLiteral(typeSql)}'` : `LOWER(type) = '${escapeLiteral(typeSql.toLowerCase())}'`;\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, copiedColumns = /* @__PURE__ */ new Set(), backfilledColumns = /* @__PURE__ */ new Set()) {\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-found\") {\n\t\t\tconst columnName = columnNameFromNode(issue);\n\t\t\tconst column = columnName === void 0 ? void 0 : byName.get(columnName);\n\t\t\tif (columnName === void 0 || column === void 0) continue;\n\t\t\tconst takesNoValue = !column.nullable && column.default === void 0 && !copiedColumns.has(columnName);\n\t\t\tchecks.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 = '${escapeLiteral(columnName)}' AND \"notnull\" = ${column.nullable ? 0 : 1}`,\n\t\t\t\t...backfilledColumns.has(columnName) ? { requiredColumn: {\n\t\t\t\t\tcolumn: columnName,\n\t\t\t\t\treason: \"backfillMissedRows\"\n\t\t\t\t} } : takesNoValue ? { requiredColumn: {\n\t\t\t\t\tcolumn: columnName,\n\t\t\t\t\treason: \"newField\"\n\t\t\t\t} } : {}\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\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\t...expected.nullable ? {} : { requiredColumn: {\n\t\t\t\t\tcolumn: columnName,\n\t\t\t\t\treason: backfilledColumns.has(columnName) ? \"backfillMissedRows\" : \"nullValues\"\n\t\t\t\t} }\n\t\t\t});\n\t\t\tif (!sqlColumnTypesEqual(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 ${declaredTypeMatches(expected, colSpec.typeSql)}`\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\tif (byName.get(columnName)?.default !== void 0) checks.push({\n\t\t\t\tdescription: `verify \"${columnName}\" default on \"${tableName}\"`,\n\t\t\t\tcolumnDefault: columnName\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 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 ${indexCoversExactly(u.columns)})`\n\t\t});\n\t}\n\tif (hasUniqueIssue) {\n\t\tconst expected = (spec.uniques ?? []).map((u) => `(${indexCoversExactly(u.columns)})`);\n\t\tchecks.push({\n\t\t\tdescription: `verify \"${tableName}\" has no unique constraint besides the expected ones`,\n\t\t\tsql: `SELECT NOT EXISTS (SELECT 1 FROM pragma_index_list('${t}') l WHERE l.origin = 'u' AND NOT (${expected.length === 0 ? \"0\" : expected.join(\" OR \")}))`\n\t\t});\n\t}\n\tif (hasFkIssue) {\n\t\tfor (const fk of spec.foreignKeys ?? []) {\n\t\t\tconst refTable = escapeLiteral(fk.references.table);\n\t\t\tconst colCount = fk.columns.length;\n\t\t\tconst tuples = fk.columns.map((from, i) => {\n\t\t\t\tconst to = fk.references.columns[i] ?? from;\n\t\t\t\treturn `('${escapeLiteral(from)}', '${escapeLiteral(to)}')`;\n\t\t\t}).join(\", \");\n\t\t\tconst description = `verify foreign key (${fk.columns.join(\", \")}) → ${fk.references.table}(${fk.references.columns.join(\", \")}) on \"${tableName}\"`;\n\t\t\tchecks.push({\n\t\t\t\tdescription,\n\t\t\t\tsql: `SELECT EXISTS (SELECT 1 FROM pragma_foreign_key_list('${t}') f WHERE f.\"table\" = '${refTable}' AND f.on_delete = '${referentialActionText(fk.onDelete)}' AND f.on_update = '${referentialActionText(fk.onUpdate)}' 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\t});\n\t\t}\n\t\tconst expected = spec.foreignKeys?.length ?? 0;\n\t\tchecks.push({\n\t\t\tdescription: `verify \"${tableName}\" has exactly ${expected} foreign keys`,\n\t\t\tsql: `SELECT (SELECT COUNT(DISTINCT id) FROM pragma_foreign_key_list('${t}')) = ${expected}`\n\t\t});\n\t}\n\treturn checks;\n}\n//#endregion\n//#region src/core/migrations/op-factory-call.ts\nconst TARGET_MIGRATION_MODULE = \"@internal/sqlite/migration\";\nvar SqliteOpFactoryCallNode = class extends TsExpression {\n\t/** The operations this call lowers to, in order: one, unless the call carries companions. */\n\ttoOps(lowerer) {\n\t\treturn [this.toOp(lowerer)];\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}\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n};\n/** Whether `call` is one of this target's calls, which lower through {@link SqliteOpFactoryCallNode.toOps}. */\nfunction isSqliteOpFactoryCall(call) {\n\treturn call instanceof SqliteOpFactoryCallNode;\n}\nfunction renderDdlColumnDefault(def, sql) {\n\tif (!def) return \"\";\n\tif (def.kind === \"literal\") return `lit(${jsonToTsSource(def.value)})`;\n\treturn `fn(${sql.source(def.expression.text)})`;\n}\nfunction renderDdlColumnAsTsCall(column, sql) {\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, sql)}`);\n\tif (column.codecRef) opts.push(`codecRef: ${jsonToTsSource(column.codecRef)}`);\n\tconst optsStr = opts.length > 0 ? `, { ${opts.join(\", \")} }` : \"\";\n\treturn `col(${jsonToTsSource(column.name)}, ${jsonToTsSource(column.type)}${optsStr})`;\n}\nfunction renderDdlConstraintAsTsCall(constraint) {\n\tswitch (constraint.kind) {\n\t\tcase \"primary-key\": {\n\t\t\tconst nameOpt = constraint.name ? `, { name: ${jsonToTsSource(constraint.name)} }` : \"\";\n\t\t\treturn `primaryKey(${jsonToTsSource(constraint.columns)}${nameOpt})`;\n\t\t}\n\t\tcase \"foreign-key\": {\n\t\t\tconst opts = [];\n\t\t\tif (constraint.name) opts.push(`name: ${jsonToTsSource(constraint.name)}`);\n\t\t\tif (constraint.onDelete) opts.push(`onDelete: ${jsonToTsSource(constraint.onDelete)}`);\n\t\t\tif (constraint.onUpdate) opts.push(`onUpdate: ${jsonToTsSource(constraint.onUpdate)}`);\n\t\t\tconst optsStr = opts.length > 0 ? `, { ${opts.join(\", \")} }` : \"\";\n\t\t\treturn `foreignKey(${jsonToTsSource(constraint.columns)}, ${jsonToTsSource(constraint.refTable)}, ${jsonToTsSource(constraint.refColumns)}${optsStr})`;\n\t\t}\n\t\tcase \"unique\": {\n\t\t\tconst nameOpt = constraint.name ? `, { name: ${jsonToTsSource(constraint.name)} }` : \"\";\n\t\t\treturn `unique(${jsonToTsSource(constraint.columns)}${nameOpt})`;\n\t\t}\n\t\tcase \"check-expression\": throw sqliteError(\"CONTRACT.CONSTRAINT_INVALID\", `The SQLite target does not support CHECK constraints (constraint \"${constraint.name}\"). The \"checkConstraint\" capability is Postgres-only — remove the \"@@check\" / \"check()\" declaration, or target Postgres.`, { meta: { constraintName: constraint.name } });\n\t}\n}\nfunction constraintImportSymbols(constraints) {\n\tif (!constraints || constraints.length === 0) return [];\n\tconst symbols = /* @__PURE__ */ new Set();\n\tfor (const c of constraints) if (c.kind === \"primary-key\") symbols.add(\"primaryKey\");\n\telse if (c.kind === \"foreign-key\") symbols.add(\"foreignKey\");\n\telse if (c.kind === \"unique\") symbols.add(\"unique\");\n\treturn [...symbols];\n}\nfunction defaultImportSymbols(columns) {\n\tconst symbols = /* @__PURE__ */ new Set();\n\tfor (const col of columns) if (col.default?.kind === \"literal\") symbols.add(\"lit\");\n\telse if (col.default?.kind === \"function\") symbols.add(\"fn\");\n\treturn [...symbols];\n}\nfunction columnShapesOf(columns, constraints) {\n\tconst primaryKey = constraints?.find((constraint) => constraint.kind === \"primary-key\");\n\treturn columns.map((column) => {\n\t\tif (column.type.endsWith(\" PRIMARY KEY AUTOINCREMENT\")) return {\n\t\t\tname: column.name,\n\t\t\ttypeSql: column.type.slice(0, -26),\n\t\t\tnotNull: false,\n\t\t\tprimaryKeyPosition: 1\n\t\t};\n\t\treturn {\n\t\t\tname: column.name,\n\t\t\ttypeSql: column.type,\n\t\t\tnotNull: column.notNull === true,\n\t\t\tprimaryKeyPosition: column.primaryKey ? 1 : (primaryKey?.columns.indexOf(column.name) ?? -1) + 1\n\t\t};\n\t});\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, expectAbsent(`table \"${tableName}\"`))],\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, expectPresent(`table \"${tableName}\"`)), tableColumnsCheck(tableName, columnShapesOf(this.columns, this.constraints))]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn this.#written().source;\n\t}\n\t#written() {\n\t\tconst sql = createSqlTextSources(TARGET_MIGRATION_MODULE);\n\t\tconst columnsList = this.columns.map((column) => renderDdlColumnAsTsCall(column, sql)).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 {\n\t\t\tsource: `this.createTable({ ${opts.join(\", \")} })`,\n\t\t\timports: sql.imports()\n\t\t};\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\treq.push(...this.#written().imports);\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, expectPresent(`table \"${this.tableName}\"`))],\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, expectAbsent(`table \"${this.tableName}\"`))]\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};\n/** The replaced indexes' drops, then their creates, since a create may take a dropped name. */\nfunction indexReplacementCalls(replacements) {\n\treturn [...replacements.map(({ drop }) => drop), ...replacements.map(({ create }) => create)];\n}\nvar RenameTableCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"renameTable\";\n\toperationClass = \"widening\";\n\toldTableName;\n\t/** The new name: the table's contract-side identity after the rename. */\n\ttableName;\n\tlabel;\n\t/** The indexes named after the old table, which SQLite cannot rename, so it replaces them. */\n\tindexReplacements;\n\t/**\n\t* The replacements' drops, then their creates. They run after the table rename and are never\n\t* rendered on their own.\n\t*/\n\tcompanions;\n\tconstructor(oldTableName, tableName, indexReplacements) {\n\t\tsuper();\n\t\tthis.oldTableName = oldTableName;\n\t\tthis.tableName = tableName;\n\t\tthis.label = `Rename table ${oldTableName} to ${tableName}`;\n\t\tthis.indexReplacements = Object.freeze([...indexReplacements]);\n\t\tthis.companions = Object.freeze(indexReplacementCalls(indexReplacements));\n\t\tthis.freeze();\n\t}\n\t/** The id of the operation this call lowers to. */\n\tget operationId() {\n\t\treturn `renameTable.${this.oldTableName}`;\n\t}\n\ttoOps(lowerer) {\n\t\treturn [this.toOp(lowerer), ...this.companions.map((companion) => companion.toOp(lowerer))];\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `RenameTableCall.toOp: a lowerer is required on the SQLite planner path (table \"${this.oldTableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.oldTableName\n\t\t} });\n\t\tconst fromChecks = tableExistsAst(this.oldTableName);\n\t\tconst toChecks = tableExistsAst(this.tableName);\n\t\tconst fromPresent = await lowerer.lowerToExecuteRequest(fromChecks.tablePresent());\n\t\tconst onlyCase = renameChangesOnlyCase(this.oldTableName, this.tableName);\n\t\tconst toAbsent = await lowerer.lowerToExecuteRequest(onlyCase ? toChecks.tableAbsent() : tableNameTakenAst(this.tableName).nameFree());\n\t\tconst viaName = renameTableViaName(this.tableName);\n\t\tconst viaAbsent = onlyCase ? await lowerer.lowerToExecuteRequest(tableExistsAst(viaName).tableAbsent()) : void 0;\n\t\tconst toPresent = await lowerer.lowerToExecuteRequest(toChecks.tablePresent());\n\t\tconst fromAbsent = await lowerer.lowerToExecuteRequest(fromChecks.tableAbsent());\n\t\treturn {\n\t\t\tid: this.operationId,\n\t\t\tlabel: this.label,\n\t\t\tsummary: `Renames table ${this.oldTableName} to ${this.tableName}, keeping its rows`,\n\t\t\toperationClass: \"widening\",\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: [\n\t\t\t\tstep(`ensure table \"${this.oldTableName}\" exists`, fromPresent.sql, fromPresent.params, expectPresent(`table \"${this.oldTableName}\"`)),\n\t\t\t\tstep(onlyCase ? `ensure table \"${this.tableName}\" does not exist` : `ensure no table or index is named \"${this.tableName}\" in any case`, toAbsent.sql, toAbsent.params, expectAbsent(onlyCase ? `table \"${this.tableName}\"` : `a table or index named \"${this.tableName}\" in any case`)),\n\t\t\t\t...viaAbsent === void 0 ? [] : [step(`ensure table \"${viaName}\" does not exist (a rename that only changes case passes through this temporary name, because SQLite compares table names without case)`, viaAbsent.sql, viaAbsent.params, expectAbsent(`table \"${viaName}\"`))]\n\t\t\t],\n\t\t\texecute: renameTableSteps(this.oldTableName, this.tableName),\n\t\t\tpostcheck: [step(`verify table \"${this.tableName}\" exists`, toPresent.sql, toPresent.params, expectPresent(`table \"${this.tableName}\"`)), step(`verify table \"${this.oldTableName}\" no longer exists`, fromAbsent.sql, fromAbsent.params, expectAbsent(`table \"${this.oldTableName}\"`))]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `...this.renameTable({ table: ${jsonToTsSource(this.oldTableName)}, to: ${jsonToTsSource(this.tableName)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nvar RenameColumnCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"renameColumn\";\n\toperationClass = \"widening\";\n\ttableName;\n\toldColumnName;\n\t/** The new name: the column's contract-side identity after the rename. */\n\tcolumnName;\n\tlabel;\n\t/** The indexes on the column whose wire names change, which SQLite cannot rename. */\n\tindexReplacements;\n\t/**\n\t* The replacements' drops, then their creates. They run after the column rename and are never\n\t* rendered on their own.\n\t*/\n\tcompanions;\n\tconstructor(tableName, oldColumnName, columnName, indexReplacements) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.oldColumnName = oldColumnName;\n\t\tthis.columnName = columnName;\n\t\tthis.label = `Rename column ${oldColumnName} on ${tableName} to ${columnName}`;\n\t\tthis.indexReplacements = Object.freeze([...indexReplacements]);\n\t\tthis.companions = Object.freeze(indexReplacementCalls(indexReplacements));\n\t\tthis.freeze();\n\t}\n\ttoOps(lowerer) {\n\t\treturn [this.toOp(lowerer), ...this.companions.map((companion) => companion.toOp(lowerer))];\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `RenameColumnCall.toOp: a lowerer is required on the SQLite planner path (column \"${this.oldColumnName}\" 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} });\n\t\treturn renameColumn(this.tableName, this.oldColumnName, this.columnName, lowerer);\n\t}\n\trenderTypeScript() {\n\t\treturn `...this.renameColumn({ table: ${jsonToTsSource(this.tableName)}, column: ${jsonToTsSource(this.oldColumnName)}, to: ${jsonToTsSource(this.columnName)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nfunction refuseUnsafeCopyExpressions(tableName, option, expressions) {\n\tfor (const [column, expression] of Object.entries(expressions)) {\n\t\tif (expression.kind !== \"sql\") continue;\n\t\tconst refused = checkSqlExpressionText(expression.sql, SQLITE_QUOTING);\n\t\tif (refused === void 0) continue;\n\t\tconst call = `recreateTable({ tableName: ${jsonToTsSource(tableName)} })`;\n\t\tthrow sqliteError(\"MIGRATION.SQL_EXPRESSION_INVALID\", `${call}: ${option}.${column} ${JSON.stringify(expression.sql)} holds ${refused}, which could end or extend the INSERT … SELECT statement it is written into`, {\n\t\t\twhy: \"A copy expression or a temporary value is written into the SELECT that copies the rows into the rebuilt table. The check refuses a semicolon, a SQL comment, dollar quoting, and a comma or a statement keyword outside parentheses, since each could end or extend that statement; it does not check that the text is valid SQL.\",\n\t\t\tfix: `Write ${option}.${column} as one SQL expression over the old table's columns, such as CAST(\"${column}\" AS INTEGER). If it holds a comma or a keyword such as FROM outside parentheses, wrap it in parentheses.`,\n\t\t\tmeta: {\n\t\t\t\tcall,\n\t\t\t\tfield: `${option}.${column}`,\n\t\t\t\texpression: expression.sql,\n\t\t\t\trefused\n\t\t\t}\n\t\t});\n\t}\n}\nfunction refuseUnknownCopyExpressionColumns(tableName, contractTable, named) {\n\tconst columns = contractTable.columns.map((column) => column.name);\n\tconst unknown = [\n\t\t...Object.keys(named.copyExpressions).map((key) => ({\n\t\t\toption: `copyExpressions.${key}`,\n\t\t\tkey\n\t\t})),\n\t\t...Object.keys(named.temporaryValues).map((key) => ({\n\t\t\toption: `temporaryValues.${key}`,\n\t\t\tkey\n\t\t})),\n\t\t...named.retypedColumns.map((key) => ({\n\t\t\toption: `retypedColumns entry ${JSON.stringify(key)}`,\n\t\t\tkey\n\t\t}))\n\t].find(({ key }) => !columns.includes(key));\n\tif (unknown === void 0) return;\n\tconst call = `recreateTable({ tableName: ${jsonToTsSource(tableName)} })`;\n\tthrow sqliteError(\"MIGRATION.COPY_EXPRESSION_COLUMN_UNKNOWN\", `${call}: ${unknown.option} names no column of the new table. Its columns are ${columns.map((column) => JSON.stringify(column)).join(\", \")}.`, {\n\t\twhy: \"Each key of copyExpressions and temporaryValues, and each entry of retypedColumns, names a column of the new table. One that names no column applies to nothing, so the column meant would be copied unchanged or left without a value, or its values would go unchecked.\",\n\t\tfix: \"Name a column in contractTable.columns, with the same letters and case.\",\n\t\tmeta: {\n\t\t\tcall,\n\t\t\tkey: unknown.key,\n\t\t\tcolumns\n\t\t}\n\t});\n}\n/**\n* A temporary value fills a column the old table does not have, and only that: for a column the\n* old table has it would replace every existing value, and a column with a copy expression is\n* already filled by its conversion.\n*/\nfunction refuseMisplacedTemporaryValues(tableName, schemaColumnNames, copyExpressions, temporaryValues) {\n\tconst call = `recreateTable({ tableName: ${jsonToTsSource(tableName)} })`;\n\tfor (const column of Object.keys(temporaryValues)) {\n\t\tif (schemaColumnNames.includes(column)) throw sqliteError(\"MIGRATION.TEMPORARY_VALUE_INVALID\", `${call}: temporaryValues.${column} names a column the old table already has, so the copy would replace every value of it.`, {\n\t\t\twhy: \"A temporary value fills a new column in the existing rows. A column the old table has keeps its values through the copy, or is converted by a copy expression.\",\n\t\t\tfix: `Remove temporaryValues.${column}. To change the values of \"${column}\", write a conversion in copyExpressions.${column} instead.`,\n\t\t\tmeta: {\n\t\t\t\tcall,\n\t\t\t\tcolumn,\n\t\t\t\treason: \"existingColumn\"\n\t\t\t}\n\t\t});\n\t\tif (Object.hasOwn(copyExpressions, column)) throw sqliteError(\"MIGRATION.TEMPORARY_VALUE_INVALID\", `${call}: \"${column}\" is named in both copyExpressions and temporaryValues, so it would be filled twice.`, {\n\t\t\twhy: \"A column is filled either by the conversion in copyExpressions or by a temporary value, not both.\",\n\t\t\tfix: `Keep one of copyExpressions.${column} and temporaryValues.${column}.`,\n\t\t\tmeta: {\n\t\t\t\tcall,\n\t\t\t\tcolumn,\n\t\t\t\treason: \"alsoConverted\"\n\t\t\t}\n\t\t});\n\t}\n}\nfunction sqlOfSlots(slots) {\n\treturn Object.fromEntries(Object.entries(slots).flatMap(([column, slot]) => {\n\t\tconst sql = sqlOfSlot(slot);\n\t\treturn sql === void 0 ? [] : [[column, sql]];\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\t/** The conversion each named column of the new table is copied through, in place of the live column. */\n\tcopyExpressions;\n\t/** The value each named new column takes in the existing rows. */\n\ttemporaryValues;\n\t/** The columns whose type changes; the rebuild checks each after its copy, as a conversion when it has a copy expression and as SQLite's cast otherwise. */\n\tretypedColumns;\n\tconstructor(args) {\n\t\tsuper();\n\t\trefuseUnsafeCopyExpressions(args.tableName, \"copyExpressions\", args.copyExpressions ?? {});\n\t\trefuseUnsafeCopyExpressions(args.tableName, \"temporaryValues\", args.temporaryValues ?? {});\n\t\trefuseUnknownCopyExpressionColumns(args.tableName, args.contractTable, {\n\t\t\tcopyExpressions: args.copyExpressions ?? {},\n\t\t\ttemporaryValues: args.temporaryValues ?? {},\n\t\t\tretypedColumns: args.retypedColumns ?? []\n\t\t});\n\t\trefuseMisplacedTemporaryValues(args.tableName, args.schemaColumnNames, args.copyExpressions ?? {}, args.temporaryValues ?? {});\n\t\tthis.copyExpressions = Object.freeze({ ...args.copyExpressions });\n\t\tthis.temporaryValues = Object.freeze({ ...args.temporaryValues });\n\t\tthis.retypedColumns = Object.freeze([...args.retypedColumns ?? []]);\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\tconst copies = Object.entries(this.copyExpressions);\n\t\tif (copies.some(([, expression]) => isUnfilledSlot(expression))) return unfilledPlaceholderOperation(this.label);\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\tretypedColumns: this.retypedColumns,\n\t\t\t...copies.length === 0 ? {} : { copyExpressions: sqlOfSlots(this.copyExpressions) },\n\t\t\t...Object.keys(this.temporaryValues).length === 0 ? {} : { temporaryValues: sqlOfSlots(this.temporaryValues) }\n\t\t}, lowerer);\n\t}\n\t#slotsSource(slots, sql) {\n\t\treturn `{ ${Object.entries(slots).map(([column, expression]) => `${jsonToTsSource(column)}: ${slotSource(expression, sql)}`).join(\", \")} }`;\n\t}\n\trenderTypeScript() {\n\t\treturn this.#written().source;\n\t}\n\timportRequirements() {\n\t\treturn [...Object.values(this.copyExpressions).some(isUnfilledSlot) ? [{\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: \"placeholder\"\n\t\t}] : [], ...this.#written().imports];\n\t}\n\t#written() {\n\t\tconst sql = createSqlTextSources(TARGET_MIGRATION_MODULE);\n\t\treturn {\n\t\t\tsource: `this.recreateTable(${tsObjectSource([\n\t\t\t\t[\"tableName\", jsonToTsSource(this.tableName)],\n\t\t\t\t[\"contractTable\", renderTableSpec(this.contractTable, sql)],\n\t\t\t\t[\"schemaColumnNames\", jsonToTsSource(this.schemaColumnNames)],\n\t\t\t\t[\"indexes\", jsonToTsSource(this.indexes)],\n\t\t\t\t[\"summary\", jsonToTsSource(this.summary)],\n\t\t\t\t[\"postchecks\", tsArraySource(this.postchecks.map(renderPostcheck))],\n\t\t\t\t[\"operationClass\", jsonToTsSource(this.operationClass)],\n\t\t\t\t...Object.keys(this.copyExpressions).length === 0 ? [] : [[\"copyExpressions\", this.#slotsSource(this.copyExpressions, sql)]],\n\t\t\t\t...Object.keys(this.temporaryValues).length === 0 ? [] : [[\"temporaryValues\", this.#slotsSource(this.temporaryValues, sql)]],\n\t\t\t\t...this.retypedColumns.length === 0 ? [] : [[\"retypedColumns\", jsonToTsSource(this.retypedColumns)]]\n\t\t\t])})`,\n\t\t\timports: sql.imports()\n\t\t};\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\treturn addColumn(this.tableName, this.column, lowerer);\n\t}\n\trenderTypeScript() {\n\t\treturn this.#written().source;\n\t}\n\timportRequirements() {\n\t\treturn this.#written().imports;\n\t}\n\t#written() {\n\t\tconst sql = createSqlTextSources(TARGET_MIGRATION_MODULE);\n\t\treturn {\n\t\t\tsource: `this.addColumn({ table: ${jsonToTsSource(this.tableName)}, column: ${renderColumnSpec(this.column, sql)} })`,\n\t\t\timports: sql.imports()\n\t\t};\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, expectPresent(`column \"${this.columnName}\" on \"${this.tableName}\"`))],\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, expectAbsent(`column \"${this.columnName}\" on \"${this.tableName}\"`))]\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\t/** The id of the operation this call lowers to. */\n\tget operationId() {\n\t\treturn `index.${this.tableName}.${this.indexName}`;\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: this.operationId,\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, expectAbsent(`index \"${this.indexName}\"`))],\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, expectPresent(`index \"${this.indexName}\"`)), indexDefinitionCheck(this.tableName, this.indexName, this.columns, false)]\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 = \"widening\";\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\t/** The id of the operation this call lowers to. */\n\tget operationId() {\n\t\treturn `dropIndex.${this.tableName}.${this.indexName}`;\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: this.operationId,\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: \"widening\",\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, expectPresent(`index \"${this.indexName}\"`))],\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, expectAbsent(`index \"${this.indexName}\"`))]\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};\nfunction replaceStoredValueSource(tableName, columnName, from, to, codec) {\n\treturn `this.replaceStoredValue({ ${[\n\t\t`table: ${jsonToTsSource(tableName)}`,\n\t\t`column: ${jsonToTsSource(columnName)}`,\n\t\t`from: ${from}`,\n\t\t`to: ${to}`,\n\t\t...codecRefSource(codec)\n\t].join(\", \")} })`;\n}\nfunction codecRefSource(codec) {\n\treturn codec === void 0 ? [] : [`codecRef: ${jsonToTsSource(codec.codecRef)}`];\n}\nfunction requireStoredValue(value, factory, tableName, columnName, argument) {\n\tif (typeof value === \"string\" || typeof value === \"number\" && Number.isFinite(value)) return value;\n\tconst got = value;\n\tthrow sqliteError(\"CONTRACT.ARGUMENT_INVALID\", `${factory}({ table: ${jsonToTsSource(tableName)}, column: ${jsonToTsSource(columnName)} }): ${argument} must be a string or a number; got ${typeof got === \"number\" || got === void 0 ? String(got) : JSON.stringify(got)}`, { meta: { what: `${factory} ${argument}` } });\n}\n/** Changes one stored value of a column to another, in every row that holds it. */\nvar ReplaceStoredValueCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"replaceStoredValue\";\n\toperationClass = \"widening\";\n\ttableName;\n\tcolumnName;\n\tfrom;\n\tto;\n\t/** The column's codec, which writes `from` and `to` as the database stores them. */\n\tcodec;\n\tlabel;\n\tconstructor(tableName, columnName, from, to, codec) {\n\t\tsuper();\n\t\tthis.codec = codec;\n\t\tthis.tableName = tableName;\n\t\tthis.columnName = columnName;\n\t\tthis.from = requireStoredValue(from, this.factoryName, tableName, columnName, \"from\");\n\t\tthis.to = requireStoredValue(to, this.factoryName, tableName, columnName, \"to\");\n\t\tthis.label = `Replace value ${storedValueText(from)} with ${storedValueText(to)} in column \"${columnName}\" of \"${tableName}\"`;\n\t\tthis.freeze();\n\t}\n\tasync toOp() {\n\t\treturn replaceStoredValue(this.tableName, this.columnName, await encodeStoredValue(this.from, this.codec), await encodeStoredValue(this.to, this.codec));\n\t}\n\trenderTypeScript() {\n\t\treturn replaceStoredValueSource(this.tableName, this.columnName, jsonToTsSource(this.from), jsonToTsSource(this.to), this.codec);\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\n/** Removes one stored value of a column by setting it to NULL in every row that holds it. */\nvar RemoveStoredValueCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"removeStoredValue\";\n\toperationClass = \"destructive\";\n\ttableName;\n\tcolumnName;\n\tvalue;\n\t/** The column's codec, which writes `value` as the database stores it. */\n\tcodec;\n\t/** The enum value whose stored value is removed, which the check that fails while rows of a required column hold it names. */\n\tenumValue;\n\tlabel;\n\tconstructor(tableName, columnName, value, codec, enumValue) {\n\t\tsuper();\n\t\tthis.codec = codec;\n\t\tthis.enumValue = enumValue;\n\t\tthis.tableName = tableName;\n\t\tthis.columnName = columnName;\n\t\tthis.value = requireStoredValue(value, this.factoryName, tableName, columnName, \"value\");\n\t\tthis.label = `Remove value ${storedValueText(value)} from column \"${columnName}\" of \"${tableName}\"`;\n\t\tthis.freeze();\n\t}\n\tasync toOp() {\n\t\treturn removeStoredValue(this.tableName, this.columnName, await encodeStoredValue(this.value, this.codec), this.enumValue === void 0 ? void 0 : {\n\t\t\tenumValue: this.enumValue,\n\t\t\tvalue: this.value,\n\t\t\t...this.codec === void 0 ? {} : { codecRef: this.codec.codecRef }\n\t\t});\n\t}\n\trenderTypeScript() {\n\t\treturn `this.removeStoredValue({ ${[\n\t\t\t`table: ${jsonToTsSource(this.tableName)}`,\n\t\t\t`column: ${jsonToTsSource(this.columnName)}`,\n\t\t\t`value: ${jsonToTsSource(this.value)}`,\n\t\t\t...codecRefSource(this.codec),\n\t\t\t...this.enumValue === void 0 ? [] : [`enumValue: ${jsonToTsSource(this.enumValue)}`]\n\t\t].join(\", \")} })`;\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 rejects with `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\t/** The slot the user fills with the statement that fills the column: `<Model.field>:run`. */\n\tslot;\n\tconstructor(id, label, tableName, columnName, slot) {\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.slot = slot;\n\t\tthis.freeze();\n\t}\n\ttoOp(_lowerer) {\n\t\treturn unfilledPlaceholderOperation(this.label);\n\t}\n\trenderTypeScript() {\n\t\tconst slot = this.slot;\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};\nfunction definedSourceEntries(sources) {\n\treturn Object.entries(sources).flatMap(([key, source]) => source === void 0 ? [] : [[key, source]]);\n}\nfunction renderIfDefined(value) {\n\treturn value === void 0 ? void 0 : jsonToTsSource(value);\n}\nfunction renderColumnSpec(column, sql) {\n\treturn tsObjectSource(definedSourceEntries({\n\t\tname: jsonToTsSource(column.name),\n\t\ttypeSql: jsonToTsSource(column.typeSql),\n\t\tdefault: column.default === void 0 ? void 0 : renderSpecDefault(column.default, sql),\n\t\tcodecRef: renderIfDefined(column.codecRef),\n\t\tnullable: jsonToTsSource(column.nullable),\n\t\tinlineAutoincrementPrimaryKey: renderIfDefined(column.inlineAutoincrementPrimaryKey)\n\t}));\n}\nfunction renderTableSpec(table, sql) {\n\treturn tsObjectSource(definedSourceEntries({\n\t\tcolumns: tsArraySource(table.columns.map((column) => renderColumnSpec(column, sql))),\n\t\tprimaryKey: renderIfDefined(table.primaryKey),\n\t\tuniques: renderIfDefined(table.uniques),\n\t\tforeignKeys: renderIfDefined(table.foreignKeys)\n\t}));\n}\nfunction renderSpecDefault(columnDefault, sql) {\n\tif (columnDefault.kind === \"literal\") return jsonToTsSource(columnDefault);\n\treturn tsObjectSource(definedSourceEntries({\n\t\tkind: jsonToTsSource(columnDefault.kind),\n\t\texpression: sql.source(columnDefault.expression)\n\t}));\n}\nfunction renderPostcheck(postcheck) {\n\tif (\"sql\" in postcheck) return tsObjectSource(definedSourceEntries({\n\t\tdescription: jsonToTsSource(postcheck.description),\n\t\tsql: tsQuotedTextSource(postcheck.sql),\n\t\trequiredColumn: postcheck.requiredColumn === void 0 ? void 0 : jsonToTsSource(postcheck.requiredColumn)\n\t}));\n\treturn tsObjectSource(definedSourceEntries({\n\t\tdescription: jsonToTsSource(postcheck.description),\n\t\tcolumnDefault: jsonToTsSource(postcheck.columnDefault)\n\t}));\n}\n//#endregion\nexport { sqliteDefaultToDdlColumnDefault as C, INLINE_AUTOINCREMENT_PRIMARY_KEY as S, sqliteIdentifiersCollide as T, buildRecreatePostchecks as _, DropColumnCall as a, rebuiltTableName as b, RawSqlCall as c, RenameColumnCall as d, RenameTableCall as f, affinityStorageClasses as g, isSqliteOpFactoryCall as h, DataTransformCall as i, RecreateTableCall as l, indexReplacementCalls as m, CreateIndexCall as n, DropIndexCall as o, ReplaceStoredValueCall as p, CreateTableCall as r, DropTableCall as s, AddColumnCall as t, RemoveStoredValueCall as u, buildRecreateSummary as v, step as w, renameTableSteps as x, conversionCopyOf as y };\n\n//# sourceMappingURL=op-factory-call-BQYECylm.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,SAAS,iBAAiB,YAAY;CACrC,OAAO,WAAW,QAAQ,WAAW,WAAW,OAAO,YAAY,CAAC;AACrE;;;;AAIA,SAAS,yBAAyB,MAAM,OAAO;CAC9C,OAAO,iBAAiB,IAAI,MAAM,iBAAiB,KAAK;AACzD;AAGA,SAAS,KAAK,aAAa,KAAK,QAAQ,aAAa;CACpD,OAAO;EACN;EACA;EACA,GAAG,UAAU,UAAU,MAAM;EAC7B,GAAG,UAAU,eAAe,WAAW;CACxC;AACD;;AAEA,MAAM,mCAAmC;;AAEzC,SAAS,gCAAgC,eAAe;CACvD,IAAI,CAAC,eAAe,OAAO,KAAK;CAChC,QAAQ,cAAc,MAAtB;EACC,KAAK,WAAW,OAAO,IAAI,qBAAqB,cAAc,KAAK;EACnE,KAAK;GACJ,IAAI,cAAc,eAAe,mBAAmB,OAAO,KAAK;GAChE,OAAO,IAAI,sBAAsB,UAAU,cAAc,UAAU,CAAC;EACrE,SAAS;GACR,MAAM,aAAa;GACnB,OAAO,YAAY,YAAY,oDAAoD,UAAU,UAAU,CAAC,CAAC,KAAK,EAAE;EACjH;CACD;AACD;;;;AAIA,SAAS,yBAAyB,WAAW,WAAW,SAAS;CAChE,MAAM,UAAU,QAAQ,MAAM,WAAW,OAAO,OAAO,QAAQ,YAAY,CAAC;CAC5E,IAAI,YAAY,KAAK,GAAG;CACxB,MAAM,qCAAqC;EAC1C;EACA,QAAQ;EACR,SAAS,UAAU,KAAK,UAAU,QAAQ,IAAI,EAAE,YAAY,KAAK,UAAU,SAAS;EACpF,SAAS;EACT,cAAc;CACf,CAAC;AACF;;AAEA,SA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Aa,gBAAgB,MAAM,WAAW;CAC/C,CAAC,CAAC;AACH;AACA,SAAS,kBAAkB,eAAe,KAAK;CAC9C,IAAI,cAAc,SAAS,WAAW,OAAO,eAAe,aAAa;CACzE,OAAO,eAAe,qBAAqB;EAC1C,MAAM,eAAe,cAAc,IAAI;EACvC,YAAY,IAAI,OAAO,cAAc,UAAU;CAChD,CAAC,CAAC;AACH;AACA,SAAS,gBAAgB,WAAW;CACnC,IAAI,SAAS,WAAW,OAAO,eAAe,qBAAqB;EAClE,aAAa,eAAe,UAAU,WAAW;EACjD,KAAK,mBAAmB,UAAU,GAAG;EACrC,gBAAgB,UAAU,mBAAmB,KAAK,IAAI,KAAK,IAAI,eAAe,UAAU,cAAc;CACvG,CAAC,CAAC;CACF,OAAO,eAAe,qBAAqB;EAC1C,aAAa,eAAe,UAAU,WAAW;EACjD,eAAe,eAAe,UAAU,aAAa;CACtD,CAAC,CAAC;AACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"planner-DNwf8s8s-BoXZwpVs.mjs","names":["#lowerer"],"sources":["../../../../3-targets/sqlite/1-target/dist/planner-DNwf8s8s.mjs"],"sourcesContent":["import { a as sqliteTableRenameByHand, c as sqliteSchemaTables, d as coalesceSubtreeIssues, f as conflictForDisallowedCall, g as buildSqlitePlanDiff, h as sqlitePlannerStrategies, i as sqliteColumnRenameCall, l as indexNameCaseChange, m as planIssues, n as renameTableByHandStatements, o as sqliteTableRenameCall, p as issueNode, r as renderRenameTableCall, s as createWorkingSchema, u as pairIndexReplacements, v as sqliteActualSchema } from \"./sqlite-migration-BxQ65pKq.mjs\";\nimport { a as DropColumnCall, c as RawSqlCall, l as RecreateTableCall, p as ReplaceStoredValueCall, s as DropTableCall, u as RemoveStoredValueCall } from \"./op-factory-call-BQYECylm.mjs\";\nimport { t as TypeScriptRenderableSqliteMigration } from \"./planner-produced-sqlite-migration-Z9OWyjQn.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { enumValueCoordinateJson, isRenameStatement, issueOutcome } from \"@internal/framework-components/control\";\nimport { appliedStatementsInOrder, backfillOfDefaultedField, columnTakesTemporaryValue, detectTableNameCaseChanges, extractCodecControlHooks, fieldEventStorage, fieldStatementColumns, planEnumValueRewrites, planFieldEventCalls, planStatements, plannerFailure, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, unknownCallNames, withEnumValueOperations } from \"@internal/family-sql/control\";\nimport { RelationalSchemaNodeKind, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { ok } from \"@internal/utils/result\";\n//#region src/core/migrations/operation-subjects.ts\nfunction lost(target, loss = \"drop\") {\n\treturn {\n\t\t...target,\n\t\tloss\n\t};\n}\nfunction tableTarget(table) {\n\treturn {\n\t\tstorageName: table,\n\t\ttable: {\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\ttable,\n\t\t\tcolumn: void 0\n\t\t}\n\t};\n}\nfunction columnTarget(table, column) {\n\treturn {\n\t\tstorageName: `${table}.${column}`,\n\t\ttable: {\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\ttable,\n\t\t\tcolumn\n\t\t}\n\t};\n}\nfunction operationCountOf(call) {\n\treturn \"companions\" in call && Array.isArray(call.companions) ? 1 + call.companions.length : 1;\n}\n/**\n* The columns a recreate loses: those the new table leaves out, whose values the copy drops, and,\n* when the recreate is destructive, those whose type it changes with no copy expression to convert them.\n*/\nfunction recreateLosses(call) {\n\tconst kept = new Set(call.contractTable.columns.map((column) => column.name));\n\tconst dropped = call.schemaColumnNames.filter((column) => !kept.has(column));\n\tconst retyped = call.operationClass === \"destructive\" ? call.retypedColumns.filter((column) => !Object.hasOwn(call.copyExpressions, column)) : [];\n\treturn [...dropped.map((column) => ({\n\t\tcolumn,\n\t\tloss: \"drop\"\n\t})), ...retyped.map((column) => ({\n\t\tcolumn,\n\t\tloss: \"typeChange\"\n\t}))];\n}\n/** The columns a recreate adds with a value its copy writes into every existing row. */\nfunction temporaryValuesOf(call) {\n\tconst copied = new Set(call.schemaColumnNames);\n\treturn Object.entries(call.temporaryValues).flatMap(([column, expression]) => copied.has(column) || expression.kind !== \"sql\" ? [] : [{\n\t\ttable: call.tableName,\n\t\tcolumn,\n\t\tvalue: expression.sql\n\t}]);\n}\n/**\n* What each call of a SQLite plan loses. A recreate that leaves a column out loses its values\n* itself, so a later drop of that column is not listed again.\n*/\nfunction sqliteCallSubjects(calls, fieldEvents, storedValues = /* @__PURE__ */ new Map()) {\n\tconst lostColumns = /* @__PURE__ */ new Set();\n\tconst unknownNames = unknownCallNames(calls.filter((call) => call.operationClass === \"destructive\" && !(call instanceof RecreateTableCall) && !(call instanceof DropColumnCall) && !(call instanceof DropTableCall) && !(call instanceof RawSqlCall) && !(call instanceof RemoveStoredValueCall) && !fieldEvents.has(call)));\n\treturn calls.map((call) => {\n\t\tconst operationCount = operationCountOf(call);\n\t\tconst { label } = call;\n\t\tif (call instanceof RecreateTableCall) {\n\t\t\tconst columns = recreateLosses(call);\n\t\t\tfor (const { column } of columns) lostColumns.add(`${call.tableName}.${column}`);\n\t\t\treturn {\n\t\t\t\toperationCount,\n\t\t\t\tlabel,\n\t\t\t\tdataLoss: columns.length === 0 && call.operationClass === \"destructive\" ? [lost(tableTarget(call.tableName))] : columns.map(({ column, loss }) => lost(columnTarget(call.tableName, column), loss)),\n\t\t\t\taccessChanges: [],\n\t\t\t\ttemporaryValues: temporaryValuesOf(call)\n\t\t\t};\n\t\t}\n\t\tif (call instanceof DropColumnCall) return {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: lostColumns.has(`${call.tableName}.${call.columnName}`) ? [] : [lost(columnTarget(call.tableName, call.columnName))],\n\t\t\taccessChanges: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t\tif (call instanceof RemoveStoredValueCall) {\n\t\t\tconst subject = storedValues.get(call);\n\t\t\treturn {\n\t\t\t\toperationCount,\n\t\t\t\tlabel,\n\t\t\t\tdataLoss: [{\n\t\t\t\t\t...lost(columnTarget(call.tableName, call.columnName)),\n\t\t\t\t\t...ifDefined(\"enumValue\", subject?.enumValue),\n\t\t\t\t\t...ifDefined(\"keepDataEdit\", subject?.keepDataEdit)\n\t\t\t\t}],\n\t\t\t\taccessChanges: [],\n\t\t\t\ttemporaryValues: []\n\t\t\t};\n\t\t}\n\t\tif (call instanceof DropTableCall) return {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: [lost(tableTarget(call.tableName))],\n\t\t\taccessChanges: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t\tif (call.operationClass !== \"destructive\") return {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: [],\n\t\t\taccessChanges: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t\tconst fieldEvent = fieldEvents.get(call);\n\t\treturn {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: [lost(call instanceof RawSqlCall ? {\n\t\t\t\tstorageName: storageNameOfOperation(call.op),\n\t\t\t\ttable: void 0\n\t\t\t} : fieldEvent !== void 0 ? fieldEventStorage(fieldEvent) : {\n\t\t\t\tstorageName: unknownNames.get(call) ?? call.factoryName,\n\t\t\t\ttable: void 0\n\t\t\t})],\n\t\t\taccessChanges: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t});\n}\n//#endregion\n//#region src/core/migrations/stored-value-calls.ts\n/** The calls that carry out a plan's stored value rewrites, each with the rewrite it carries out. */\nfunction sqliteStoredValueCalls(rewrites, codecs) {\n\treturn new Map(rewrites.map((rewrite) => {\n\t\tconst codec = {\n\t\t\tcodecRef: rewrite.codecRef,\n\t\t\tcodecs\n\t\t};\n\t\treturn [rewrite.to === void 0 ? new RemoveStoredValueCall(rewrite.table, rewrite.column, rewrite.from, codec, enumValueCoordinateJson(rewrite.enumValue)) : new ReplaceStoredValueCall(rewrite.table, rewrite.column, rewrite.from, rewrite.to, codec), rewrite];\n\t}));\n}\n/** The edit that keeps the data a removal loses: the removal, replaced by the replacements, in order. */\nfunction keepDataEdit(call, replacements) {\n\treturn {\n\t\tremove: call.renderTypeScript(),\n\t\treplaceWith: replacements.map(({ from, to }) => new ReplaceStoredValueCall(call.tableName, call.columnName, from, to, call.codec).renderTypeScript()).join(\", \")\n\t};\n}\n/**\n* The enum value each removal is about, with the edit that keeps its data when the member keeps\n* its name and only its stored value changes.\n*/\nfunction storedValueSubjects(calls) {\n\tconst subjects = /* @__PURE__ */ new Map();\n\tfor (const [call, rewrite] of calls) {\n\t\tif (!(call instanceof RemoveStoredValueCall)) continue;\n\t\tsubjects.set(call, {\n\t\t\tenumValue: rewrite.enumValue,\n\t\t\t...ifDefined(\"keepDataEdit\", rewrite.keepData === void 0 ? void 0 : {\n\t\t\t\t...keepDataEdit(call, rewrite.keepData),\n\t\t\t\t...rewrite.swapsValues ? { swapsValues: true } : {}\n\t\t\t})\n\t\t});\n\t}\n\treturn subjects;\n}\nconst RENDER_ONLY_CODECS = { descriptorFor: () => void 0 };\n/**\n* The edit that keeps the data a failed removal check found, from the check's mark and its\n* operation's column: the removal as `migration.ts` writes it, replaced by a replacement whose new\n* value is the placeholder `\"<stored value>\"`.\n*/\nfunction keepRowsEdit(table, column, mark) {\n\tconst codec = mark.codecRef === void 0 ? void 0 : {\n\t\tcodecRef: mark.codecRef,\n\t\tcodecs: RENDER_ONLY_CODECS\n\t};\n\treturn keepDataEdit(new RemoveStoredValueCall(table, column, mark.value, codec, mark.enumValue), [{\n\t\tfrom: mark.value,\n\t\tto: \"<stored value>\"\n\t}]);\n}\n/** The positions, among the plan's operations, of the operations that carry out `statement`. */\nfunction storedValueOperationIndexes(planCalls, calls, statement) {\n\tconst indexes = [];\n\tlet position = 0;\n\tfor (const call of planCalls) {\n\t\tif ((call instanceof ReplaceStoredValueCall || call instanceof RemoveStoredValueCall ? calls.get(call) : void 0)?.statement === statement) indexes.push(position);\n\t\tposition += \"companions\" in call && Array.isArray(call.companions) ? 1 + call.companions.length : 1;\n\t}\n\treturn indexes;\n}\n//#endregion\n//#region src/core/migrations/planner.ts\nfunction createSqliteMigrationPlanner(lowerer) {\n\treturn new SqliteMigrationPlanner(lowerer);\n}\n/**\n* SQLite migration planner — a thin wrapper over `planIssues`.\n*\n* `plan()` diffs the live schema against the target contract via the one\n* differ (`buildSqlitePlanDiff`, producing node-typed `SchemaDiffIssue[]`)\n* and delegates to `planIssues` with the registered strategies. Strategies\n* absorb groups of related issues into composite recipes (e.g. recreating a\n* table to apply type/nullability/default/constraint changes at once);\n* anything not absorbed by a strategy flows through `mapNodeIssueToCall` in\n* the issue planner as a one-off call.\n*\n* FK-backing indexes are already merged into the expected table node's\n* `indexes` at derivation (`contractToSchemaIR`'s `convertTable`), so\n* `mapNodeIssueToCall` handles them uniformly alongside user-declared\n* indexes — no separate expansion step in the planner.\n*/\nvar SqliteMigrationPlanner = class {\n\t#lowerer;\n\tconstructor(lowerer) {\n\t\tthis.#lowerer = lowerer;\n\t}\n\tplan(options) {\n\t\treturn this.planSql(options);\n\t}\n\temptyMigration(context, spaceId) {\n\t\treturn new TypeScriptRenderableSqliteMigration([], {\n\t\t\tfrom: context.fromHash,\n\t\t\tto: context.toHash\n\t\t}, spaceId, context.snapshotsImportPath, void 0, this.#lowerer);\n\t}\n\tplanSql(options) {\n\t\tconst policyResult = this.ensureAdditivePolicy(options.policy);\n\t\tif (policyResult) return policyResult;\n\t\tconst statements = this.planStatements(options);\n\t\tif (!statements.ok) return plannerFailure([statements.failure]);\n\t\tconst { expected, actual, issues: diffIssues } = this.collectSchemaIssues(options, statements.value.schema);\n\t\tconst replacedIndexes = pairIndexReplacements(diffIssues, indexNameCaseChange);\n\t\tconst disallowedIndexCalls = replacedIndexes.calls.filter((call) => !options.policy.allowedOperationClasses.includes(call.operationClass));\n\t\tif (disallowedIndexCalls.length > 0) return plannerFailure(disallowedIndexCalls.map((call) => conflictForDisallowedCall(call, options.policy.allowedOperationClasses)));\n\t\tconst issues = diffIssues.filter((issue) => !replacedIndexes.consumed.has(issue));\n\t\tconst caseChangeConflicts = detectTableNameCaseChanges({\n\t\t\tissues,\n\t\t\ttableOf: (issue) => {\n\t\t\t\tconst node = issueNode(issue);\n\t\t\t\treturn node instanceof SqlTableIR ? node : void 0;\n\t\t\t},\n\t\t\tnamespaceIdOf: () => UNBOUND_NAMESPACE_ID,\n\t\t\trenameByHandStatements: renameTableByHandStatements,\n\t\t\trenameTableCall: renderRenameTableCall,\n\t\t\tcontract: options.contract,\n\t\t\tdefaultNamespaceId: UNBOUND_NAMESPACE_ID\n\t\t});\n\t\tif (caseChangeConflicts.length > 0) return plannerFailure(caseChangeConflicts);\n\t\tconst defaultedBackfill = backfillOfDefaultedField(options.statements, options.fromContract, options.contract);\n\t\tif (defaultedBackfill !== void 0) return plannerFailure([defaultedBackfill]);\n\t\tconst codecHooks = extractCodecControlHooks(options.frameworkComponents);\n\t\tconst { codecLookup } = sqlTypeLookupsOf(options.frameworkComponents);\n\t\tconst rewrites = planEnumValueRewrites({\n\t\t\tstatements: options.statements,\n\t\t\tfromContract: options.fromContract,\n\t\t\tcontract: options.contract,\n\t\t\ttables: sqliteSchemaTables(statements.value.schema),\n\t\t\tcodecs: codecLookup\n\t\t});\n\t\tif (!rewrites.ok) return plannerFailure([rewrites.failure]);\n\t\tconst storedValueCalls = sqliteStoredValueCalls(rewrites.value, codecLookup);\n\t\tconst disallowedStoredValueCalls = [...storedValueCalls.keys()].filter((call) => !options.policy.allowedOperationClasses.includes(call.operationClass));\n\t\tif (disallowedStoredValueCalls.length > 0) return plannerFailure(disallowedStoredValueCalls.map((call) => conflictForDisallowedCall(call, options.policy.allowedOperationClasses)));\n\t\tconst result = planIssues({\n\t\t\tissues,\n\t\t\texpected,\n\t\t\tactual,\n\t\t\tpolicy: options.policy,\n\t\t\tframeworkComponents: options.frameworkComponents,\n\t\t\tstatementColumns: fieldStatementColumns(options.statements, options.contract),\n\t\t\toriginCodecId: (table, column) => options.fromContract?.storage.namespaces[UNBOUND_NAMESPACE_ID]?.entries.table?.[table]?.columns[column]?.codecId,\n\t\t\ttakesTemporaryValue: (table, column) => {\n\t\t\t\tconst storageTable = options.contract.storage.namespaces[UNBOUND_NAMESPACE_ID]?.entries.table?.[table];\n\t\t\t\treturn storageTable !== void 0 && columnTakesTemporaryValue(storageTable, column);\n\t\t\t},\n\t\t\tstrategies: sqlitePlannerStrategies\n\t\t});\n\t\tif (!result.ok) return plannerFailure(result.failure);\n\t\tconst fieldEventCalls = planFieldEventCalls({\n\t\t\tpriorContract: options.origin === null ? null : options.fromContract,\n\t\t\tnewContract: options.contract,\n\t\t\tcodecHooks,\n\t\t\ttableRenames: statements.value.tableRenames,\n\t\t\tcolumnRenames: statements.value.columnRenames,\n\t\t\tdataTypes: sqlTypeLookupsOf(options.frameworkComponents).dataTypeLookup\n\t\t});\n\t\tconst fieldEventOps = fieldEventCalls.map(({ call }) => call);\n\t\tconst calls = [\n\t\t\t...statements.value.calls,\n\t\t\t...replacedIndexes.calls,\n\t\t\t...result.value.calls,\n\t\t\t...storedValueCalls.keys(),\n\t\t\t...fieldEventOps\n\t\t];\n\t\tconst destination = {\n\t\t\tstorageHash: options.contract.storage.storageHash,\n\t\t\t...options.contract.profileHash !== void 0 ? { profileHash: options.contract.profileHash } : {}\n\t\t};\n\t\treturn {\n\t\t\tkind: \"success\",\n\t\t\tplan: new TypeScriptRenderableSqliteMigration(calls, {\n\t\t\t\tfrom: options.origin?.storageHash ?? null,\n\t\t\t\tto: options.contract.storage.storageHash\n\t\t\t}, options.spaceId, options.snapshotsImportPath, destination, this.#lowerer),\n\t\t\tappliedStatements: withEnumValueOperations(appliedStatementsInOrder(options.statements, statements.value.appliedStatements), (statement) => storedValueOperationIndexes(calls, storedValueCalls, statement)),\n\t\t\t...subjectsOfCalls(sqliteCallSubjects(calls, new Map(fieldEventCalls.map((fieldEvent) => [fieldEvent.call, fieldEvent])), storedValueSubjects(storedValueCalls)), {\n\t\t\t\tfromContract: options.fromContract,\n\t\t\t\tcontract: options.contract,\n\t\t\t\torigins: statements.value.origins,\n\t\t\t\tbyHand: sqliteTableRenameByHand\n\t\t\t})\n\t\t};\n\t}\n\t/**\n\t* Plans the statements against a working copy of the schema the plan starts from, in order, so\n\t* each rename's index replacements are computed against the schema the earlier statements left.\n\t* The diff then runs on that schema.\n\t*/\n\tplanStatements(options) {\n\t\tconst working = createWorkingSchema(sqliteActualSchema(options.schema));\n\t\tconst planned = planStatements({\n\t\t\tstatements: options.statements.filter(isRenameStatement),\n\t\t\tfromContract: options.fromContract,\n\t\t\tcontract: options.contract,\n\t\t\tpolicy: options.policy,\n\t\t\ttarget: {\n\t\t\t\ttables: () => sqliteSchemaTables(working.current),\n\t\t\t\trenameTableCall: (rename) => sqliteTableRenameCall({\n\t\t\t\t\tprevious: working.current,\n\t\t\t\t\tcontract: options.contract,\n\t\t\t\t\trename,\n\t\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t\t}),\n\t\t\t\trenameColumnCall: (rename) => sqliteColumnRenameCall({\n\t\t\t\t\tprevious: working.current,\n\t\t\t\t\tcontract: options.contract,\n\t\t\t\t\trename,\n\t\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t\t}),\n\t\t\t\tapply: (call) => working.apply(call),\n\t\t\t\t...sqliteTableRenameByHand\n\t\t\t}\n\t\t});\n\t\tif (!planned.ok) return planned;\n\t\treturn ok({\n\t\t\t...planned.value,\n\t\t\tschema: working.current\n\t\t});\n\t}\n\tensureAdditivePolicy(policy) {\n\t\tif (!policy.allowedOperationClasses.includes(\"additive\")) return plannerFailure([{\n\t\t\tkind: \"unsupportedOperation\",\n\t\t\tsummary: \"Migration planner requires additive operations be allowed\",\n\t\t\twhy: \"The planner requires the \\\"additive\\\" operation class to be allowed in the policy.\"\n\t\t}]);\n\t\treturn null;\n\t}\n\t/**\n\t* Diffs the target contract against the live schema via the one differ\n\t* (the same tree-building `diffSqliteSchema` uses, plus the\n\t* op-render stamper) and prepares the issue list `planIssues` consumes.\n\t*\n\t* Three passes, in order:\n\t* 1. Subtree coalescing — the differ is total (a missing/extra table also\n\t* emits an issue for every column/constraint under it); those nested\n\t* issues are redundant once the table-level `CreateTable`/`DropTable`\n\t* call already accounts for the whole subtree. Runs FIRST, over the\n\t* complete diff: a sibling-owned extra table's column issues must\n\t* collapse into its one table-level issue before the ownership pass,\n\t* because a bare column node carries no table reference — if coalescing\n\t* ran after ownership dropped the table-level issue, the orphaned column\n\t* issues would survive and the planner would emit drops against a\n\t* sibling space's table.\n\t* 2. Ownership — a live extra is only this plan's to drop when no contract\n\t* space owns it. The differ ran against THIS space's contract, so a\n\t* table a sibling owns surfaces here as `not-expected`; the planner asks\n\t* the ownership oracle (the passive aggregate) whether any space declares\n\t* it and, if so, leaves it alone. A table no space owns stays a genuine\n\t* extra. Ownership lives in the aggregate; the planner only asks. No\n\t* oracle (single-space) keeps every extra.\n\t* 3. Strict-mode extras gating — `not-expected` (extra table/column/\n\t* constraint) issues are dropped entirely outside strict mode, mirroring\n\t* the retired coordinate walk's `if (strict) { ...extra_* } }` guards:\n\t* an additive-only plan must never even consider dropping an unclaimed\n\t* object, not just refuse to emit the drop.\n\t*/\n\tcollectSchemaIssues(options, schema) {\n\t\tconst allowed = options.policy.allowedOperationClasses;\n\t\tconst strict = allowed.includes(\"widening\") || allowed.includes(\"destructive\");\n\t\tconst { expected, actual, issues: rawIssues } = buildSqlitePlanDiff({\n\t\t\tcontract: options.contract,\n\t\t\tactualSchema: schema,\n\t\t\tframeworkComponents: options.frameworkComponents\n\t\t});\n\t\tconst owned = retainUnownedExtras(coalesceSubtreeIssues(rawIssues), options.ownership);\n\t\treturn {\n\t\t\texpected,\n\t\t\tactual,\n\t\t\tissues: strict ? owned : owned.filter((issue) => issueOutcome(issue) !== \"not-expected\")\n\t\t};\n\t}\n};\n/**\n* Drops a `not-expected` issue when it is a whole extra TABLE that some\n* contract space owns, asking the ownership oracle per node.\n*\n* The consultation applies ONLY to table-level extras — a live table this\n* space's contract lacks — identified by asking the issue's own node\n* (`nodeKind === table`), never by counting path segments. SQLite is a\n* single-namespace target, so every coordinate is qualified with the shared\n* `UNBOUND_NAMESPACE_ID` sentinel (the same one the aggregate's declared\n* entities carry for this target). `entityKind` is the literal `'table'`:\n* this function only ever asks about a node already confirmed to be\n* `RelationalSchemaNodeKind.table` (checked just above), and that's a\n* diff-tree `nodeKind` spelling (`'sql-table'`) distinct from the storage\n* `entries` vocabulary `elementCoordinates` walks (`'table'`) — the literal\n* is that storage-entries spelling. `declaresEntity` answers over the whole\n* composition (self included), so a positive answer on such a table means\n* another space owns it (a table this space owned would be in its expected\n* tree, never an extra): leave it. A negative answer means no space owns\n* it — a genuine orphan to drop.\n*\n* A DEEPER extra (an extra column/constraint on a table this space DOES own —\n* only the child drifted, so the table is in the expected tree) is this\n* space's own drift and is always kept for dropping; asking the oracle there\n* would wrongly suppress it, because the owned table answers `true`. No oracle\n* ⇒ every extra is kept (single-space plan).\n*/\nfunction retainUnownedExtras(issues, ownership) {\n\tif (ownership === void 0) return issues;\n\treturn issues.filter((issue) => {\n\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\tconst node = issueNode(issue);\n\t\tif (node === void 0 || node.nodeKind !== RelationalSchemaNodeKind.table) return true;\n\t\tconst tableName = issue.path[1];\n\t\treturn tableName === void 0 || !ownership.declaresEntity({\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: tableName\n\t\t});\n\t});\n}\n//#endregion\nexport { createSqliteMigrationPlanner as n, keepRowsEdit as r, SqliteMigrationPlanner as t };\n\n//# sourceMappingURL=planner-DNwf8s8s.mjs.map"],"mappings":";;;;;;;;;;AAUA,SAAS,KAAK,QAAQ,OAAO,QAAQ;CACpC,OAAO;EACN,GAAG;EACH;CACD;AACD;AACA,SAAS,YAAY,OAAO;CAC3B,OAAO;EACN,aAAa;EACb,OAAO;GACN,aAAa;GACb;GACA,QAAQ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
|
1
|
-
{"version":3,"file":"planner-produced-sqlite-migration-DyUPHRKW-CFtZi2VG.d.mts","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/planner-produced-sqlite-migration-DyUPHRKW.d.mts"],"mappings":";;;;;;;;;KAQK,KAAK,0BAA0B;UAC1B;WACC;WACA;;cAEG,4CAA4C,2BAA2B;;EAEnF,YAAY,gBAAgB,iBAAiB,MAAM,eAAe,iBAAiB,6BAA6B,cAAc,gCAAgC,UAAU;MACpK,wBAAwB,KAAK,QAAQ;EACzC,YAAY;MACR,eAAe;;;;;;MAMf;EACJ,iBAAiB,wBAAwB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./adapter-xFPDhkod-Cio6up_5.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite-migration-BxQ65pKq-C7siJGuR.mjs","names":["#current","#endView","#startView","#renames"],"sources":["../../../../3-targets/sqlite/1-target/dist/sqlite-migration-BxQ65pKq.mjs"],"sourcesContent":["import { p as SQLITE_TEXT_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID, u as SQLITE_INTEGER_CODEC_ID } from \"./codec-ids-BHBFCNsQ.mjs\";\nimport { _ as sqliteText, a as sqliteCharacterVarying, f as sqliteDuration, g as sqliteReal, h as sqliteJson, l as sqliteDatetime, m as sqliteInteger, r as sqliteCharacter, s as sqliteDate, t as sqliteBlob, y as sqliteTime } from \"./data-types-DXMZNR8j.mjs\";\nimport { c as sqliteError, r as errorSqliteMigrationStackMissing } from \"./errors-D9vZNPSI.mjs\";\nimport { n as encodeSqliteDatetime } from \"./codecs-My4bmOU6.mjs\";\nimport { n as escapeLiteral } from \"./sql-utils-C9blmi9x.mjs\";\nimport { t as SqliteContractView } from \"./sqlite-contract-view-DJhc7pI7.mjs\";\nimport { n as sqliteResolveDefault } from \"./default-normalizer-CsMhUEOe.mjs\";\nimport { C as sqliteDefaultToDdlColumnDefault, S as INLINE_AUTOINCREMENT_PRIMARY_KEY, T as sqliteIdentifiersCollide, _ as buildRecreatePostchecks, a as DropColumnCall, d as RenameColumnCall, f as RenameTableCall, i as DataTransformCall, l as RecreateTableCall, m as indexReplacementCalls, n as CreateIndexCall, o as DropIndexCall, p as ReplaceStoredValueCall, r as CreateTableCall, s as DropTableCall, t as AddColumnCall, u as RemoveStoredValueCall, v as buildRecreateSummary, x as renameTableSteps } from \"./op-factory-call-BQYECylm.mjs\";\nimport { t as CONTROL_TABLE_NAMES } from \"./control-tables-D_o8dKRB.mjs\";\nimport { DdlColumn, ForeignKeyConstraint, PrimaryKeyConstraint, UniqueConstraint } from \"@internal/sql-relational-core/ast\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { dataTypeParams } from \"@internal/framework-components/codec\";\nimport { isSqlDataType, nameIsCatalogText, renderSqlTypeName, sqlDataTypeOfCodec } from \"@internal/sql-contract/data-type\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { diffSchemas, issueOutcome, orderIssuesByDependencies } from \"@internal/framework-components/control\";\nimport { contractToSchemaIR, extractCodecControlHooks, resolveColumnRenameAgainst, resolveTableRenameAgainst, sqlTypeLookupsOf, unmatchedColumnRename, unmatchedTableRename } from \"@internal/family-sql/control\";\nimport { PrimaryKey, RelationalSchemaNodeKind, SqlCheckConstraintIR, SqlColumnIR, SqlForeignKeyIR, SqlIndexIR, SqlSchemaIR, SqlTableIR, SqlUniqueIR, relationalNodeGranularity, sqlColumnTypesEqual } from \"@internal/sql-schema-ir/types\";\nimport { UNBOUND_NAMESPACE_ID, entityAt } from \"@internal/framework-components/ir\";\nimport { verifySqlSchemaByDiff } from \"@internal/family-sql/diff\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { namingOf, namingOfLiveName, parseWireName } from \"@internal/sql-schema-ir/naming\";\nimport { isArrayEqual } from \"@internal/utils/array-equal\";\nimport { sqlTextOf } from \"@internal/sql-relational-core/contract-free\";\nimport { Migration } from \"@internal/family-sql/migration\";\nimport { MigrationContractViews } from \"@internal/migration-tools/migration\";\n//#region src/core/migrations/diff-database-schema.ts\n/**\n* The SQLite expected-side projection: contract → flat relational schema IR.\n*\n* Each column's type is written from the data type its codec represents.\n* 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, types) {\n\treturn contractToSchemaIR(contract, {\n\t\tannotationNamespace: \"sqlite\",\n\t\tresolveDefault: sqliteResolveDefault,\n\t\tdataTypeLookup: types.dataTypeLookup,\n\t\tcodecLookup: types.codecLookup\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 (parameterized types written\n* with their parameters; 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 types = sqlTypeLookupsOf(input.frameworkComponents);\n\tconst expected = sqliteContractToSchema(input.contract, types);\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 (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 types = sqlTypeLookupsOf(input.frameworkComponents);\n\tconst expected = sqliteContractToSchema(input.contract, types);\n\tconst actual = sqliteActualSchema(input.actualSchema);\n\treturn {\n\t\texpected,\n\t\tactual,\n\t\tissues: diffSchemas(expected, actual)\n\t};\n}\n/** The schema a plan starts from as a `SqlSchemaIR`, its table and column names taken from their keys. */\nfunction sqliteActualSchema(actualSchema) {\n\treturn new SqlSchemaIR(withRecordKeyNames(actualSchema));\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] = column instanceof SqlColumnIR ? column.name === columnName ? column : column.withName(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* The type DDL writes for a column node: the name of the type it is stored as, with the parameters as the contract writes them, in upper case, or as given for a data type whose name is its catalog text, since verify compares that text exactly (ADR 273).\n*/\nfunction columnTypeSql(column) {\n\tconst type = column.storedType;\n\tif (type === void 0 || !isSqlDataType(type)) throw new InternalError(`column \"${column.name}\" has no data type; the expected tree must be derived via contractToSchemaIR for planning`);\n\tconst written = renderSqlTypeName(type, dataTypeParams(type, column.codecRef?.typeParams));\n\treturn nameIsCatalogText(type) ? written : written.toUpperCase();\n}\n/** The default DDL writes: the one the contract authored; `resolvedDefault` exists for the diff comparison. */\nfunction ddlDefaultOf(column) {\n\treturn column.authoredDefault ?? column.resolvedDefault;\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, with the type the column is stored as.\n*/\nfunction columnSpecFromNode(column, inline) {\n\tconst typeSql = columnTypeSql(column);\n\treturn {\n\t\tname: column.name,\n\t\ttypeSql,\n\t\t...inline ? {} : {\n\t\t\t...ifDefined(\"default\", ddlDefaultOf(column)),\n\t\t\t...ifDefined(\"codecRef\", column.codecRef)\n\t\t},\n\t\tnullable: column.nullable,\n\t\t...inline ? { inlineAutoincrementPrimaryKey: true } : {}\n\t};\n}\n/**\n* Builds the `DdlColumn` the `CreateTableCall` path needs, with the type the\n* column is stored as.\n*/\nfunction ddlColumnFromNode(column, inline) {\n\tconst typeSql = columnTypeSql(column);\n\tif (inline) return new DdlColumn({\n\t\tname: column.name,\n\t\ttype: `${typeSql}${INLINE_AUTOINCREMENT_PRIMARY_KEY}`\n\t});\n\tconst colDefault = sqliteDefaultToDdlColumnDefault(ddlDefaultOf(column));\n\treturn new DdlColumn({\n\t\tname: column.name,\n\t\ttype: typeSql,\n\t\t...!column.nullable ? { notNull: true } : {},\n\t\t...colDefault !== void 0 ? { default: colDefault } : {},\n\t\t...column.codecRef !== void 0 ? { codecRef: column.codecRef } : {}\n\t});\n}\n/**\n* Builds the table-level constraints (PK / unique / FK) for a `CreateTable`\n* path from the table node — the node-sourced sibling of the retired\n* contract-based `tableToDdlParts`'s constraint half.\n*\n* A check constraint on the table node throws rather than being dropped.\n* `@@check` is refused earlier, by the `sql.checkConstraint` capability gate in\n* PSL interpretation. The TS `check()` builder is not gated there — capabilities\n* are adapter-reported and reach the contract only after it is built — so a\n* `check()` declared against SQLite arrives here, and this is where it is\n* refused. It is the primary enforcement point for that surface, and the safety\n* net for a contract that reached storage some other way.\n*/\nfunction tableConstraintsFromNode(table, hasInlinePk) {\n\tconst constraints = [];\n\tif (table.primaryKey && !hasInlinePk) constraints.push(new PrimaryKeyConstraint({ columns: table.primaryKey.columns }));\n\tfor (const check of table.checks ?? []) throw sqliteError(\"CONTRACT.CONSTRAINT_INVALID\", `The SQLite target does not support CHECK constraints (constraint \"${check.name}\" on table \"${table.name}\"). The \"checkConstraint\" capability is Postgres-only — remove the \"@@check\" / \"check()\" declaration, or target Postgres.`, { meta: {\n\t\tconstraintName: check.name,\n\t\ttableName: table.name\n\t} });\n\tfor (const u of table.uniques) constraints.push(new UniqueConstraint({\n\t\tcolumns: u.columns,\n\t\t...u.name !== void 0 ? { name: u.name } : {}\n\t}));\n\tfor (const fk of table.foreignKeys) constraints.push(new ForeignKeyConstraint({\n\t\tcolumns: fk.columns,\n\t\trefTable: fk.referencedTable,\n\t\trefColumns: fk.referencedColumns,\n\t\t...fk.name !== void 0 ? { name: fk.name } : {},\n\t\t...fk.onDelete !== void 0 ? { onDelete: fk.onDelete } : {},\n\t\t...fk.onUpdate !== void 0 ? { onUpdate: fk.onUpdate } : {}\n\t}));\n\treturn constraints;\n}\n//#endregion\n//#region src/core/migrations/planner-fill-values.ts\nconst DATA_TYPE_FILL_VALUES = /* @__PURE__ */ new Map([\n\t[sqliteDatetime.id, `'${escapeLiteral(encodeSqliteDatetime(/* @__PURE__ */ new Date(0)))}'`],\n\t[sqliteDate.id, \"'1970-01-01'\"],\n\t[sqliteTime.id, \"'00:00:00.000'\"],\n\t[sqliteDuration.id, \"'PT0S'\"],\n\t[sqliteJson.id, `'{}'`],\n\t[sqliteInteger.id, \"0\"],\n\t[sqliteReal.id, \"0\"],\n\t[sqliteText.id, \"''\"],\n\t[sqliteCharacter.id, \"''\"],\n\t[sqliteCharacterVarying.id, \"''\"],\n\t[sqliteBlob.id, \"X''\"]\n]);\nfunction isParamRecord(value) {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n/**\n* The SQL value a new required column takes in the rows a table already has, or `undefined` when\n* its type has none: the column's codec hook first, as on Postgres, then a value of its data type.\n*/\nfunction sqliteFillValue(column, codecHooks, types) {\n\tconst codecRef = column.codecRef;\n\tif (codecRef === void 0 || column.many === true) return void 0;\n\tconst dataType = sqlDataTypeOfCodec(codecRef.codecId, types).id;\n\tconst fromHook = codecHooks.get(codecRef.codecId)?.resolveIdentityValue?.({\n\t\tdataType,\n\t\tcodecId: codecRef.codecId,\n\t\t...isParamRecord(codecRef.typeParams) ? { typeParams: codecRef.typeParams } : {}\n\t});\n\tif (fromHook !== void 0) return fromHook ?? void 0;\n\treturn DATA_TYPE_FILL_VALUES.get(dataType);\n}\n//#endregion\n//#region src/core/migrations/planner-strategies.ts\n/**\n* SQLite migration strategies.\n*\n* Each strategy examines the node-typed issue list, consumes issues it\n* handles, and returns the `SqliteOpFactoryCall[]` to address them. The issue\n* planner runs each strategy in order and routes whatever's left through\n* `mapNodeIssueToCall`.\n*\n* SQLite has no enums and no component-declared database dependencies. The\n* recipe that needs strategy-level multi-issue consumption is `recreateTable`,\n* which absorbs type/nullability/default/constraint mismatches, and required\n* columns added to existing tables, for a given table into one rebuild.\n*/\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 (type and nullability compared\n* together by `SqlColumnIR.isEqualTo`): a type change is destructive, because\n* the copy can change values; a nullability change alone is widening, because\n* a tightening copy fails on a NULL rather than losing it.\n*/\n/** The column of a column issue, which `classifyNodeIssue` classes destructive only for a type change. */\nfunction columnNameOf(issue) {\n\treturn blindCast(issue.expected).name;\n}\n/**\n* The changes of codec a table rebuild's copy makes without losing a value: the column's type\n* affinity stores each old value as the same value of the new type. An integer becomes its decimal\n* text; a real is not listed, since SQLite writes it as text with fifteen significant digits. Keyed\n* by codec, not data type, because `Int` and `BigInt` differ only in their codec.\n*/\nconst LOSSLESS_COPIES = /* @__PURE__ */ new Set([\n\t`${SQLITE_INTEGER_CODEC_ID}→${SQLITE_TEXT_CODEC_ID}`,\n\t`${SQLITE_BIGINT_CODEC_ID}→${SQLITE_TEXT_CODEC_ID}`,\n\t`${SQLITE_INTEGER_CODEC_ID}→${SQLITE_BIGINT_CODEC_ID}`\n]);\nfunction copyKeepsEveryValue(fromCodec, to) {\n\tconst toCodec = to.codecRef?.codecId;\n\treturn fromCodec !== void 0 && toCodec !== void 0 && LOSSLESS_COPIES.has(`${fromCodec}→${toCodec}`);\n}\nfunction classifyNodeIssue(issue, ctx) {\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\tconst actual = blindCast(issue.actual);\n\t\t\tconst fromCodec = ctx.originCodecId(String(issue.path[1]), actual.name);\n\t\t\treturn !sqlColumnTypesEqual(expected, actual) && !copyKeepsEveryValue(fromCodec, expected) ? \"destructive\" : \"widening\";\n\t\t}\n\t\tcase RelationalSchemaNodeKind.columnDefault:\n\t\tcase RelationalSchemaNodeKind.primaryKey:\n\t\tcase RelationalSchemaNodeKind.foreignKey:\n\t\tcase RelationalSchemaNodeKind.unique: return \"widening\";\n\t\tdefault: return null;\n\t}\n}\nfunction columnNode(node) {\n\treturn blindCast(node);\n}\nfunction isColumnIssue(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\treturn node !== void 0 && blindCast(node).nodeKind === RelationalSchemaNodeKind.column;\n}\n/** The column a `--convert` or `--backfill` statement of `kind` names, if one names it. */\nfunction statementColumn(ctx, kind, tableName, columnName) {\n\tif (!ctx.policy.allowedOperationClasses.includes(\"data\")) return void 0;\n\treturn ctx.statementColumns[kind].find((column) => column.table === tableName && column.column === columnName);\n}\n/** A column the plan adds to a table the database already has. */\nfunction addedColumn(issue, ctx) {\n\tif (issueOutcome(issue) !== \"not-found\" || !isColumnIssue(issue)) return void 0;\n\tconst tableName = issue.path[1];\n\tif (tableName === void 0 || ctx.actual.tables[tableName] === void 0) return void 0;\n\treturn columnNode(issue.expected);\n}\n/**\n* A required column with no default that the plan adds to a table the database already has, so\n* existing rows need a value for it.\n*/\nfunction addedRequiredColumn(issue, ctx) {\n\tconst column = addedColumn(issue, ctx);\n\treturn column === void 0 || column.nullable || column.resolvedDefault !== void 0 ? void 0 : column;\n}\nconst CLASS_ORDER = [\n\t\"additive\",\n\t\"widening\",\n\t\"data\",\n\t\"destructive\"\n];\nfunction highestClass(classes) {\n\treturn classes.reduce((highest, next) => CLASS_ORDER.indexOf(next) > CLASS_ORDER.indexOf(highest) ? next : highest, \"additive\");\n}\n/**\n* Groups recreate-eligible issues by table and emits one `RecreateTableCall` per table, removing\n* the issues it consumed so `mapNodeIssueToCall` does not handle them again.\n*\n* - A type change is `destructive`, since the copy can change values, unless a `--convert`\n* statement names the column: the copy then goes through a slot the user fills, and the rebuild\n* is `data`. Either way the rebuild checks after its copy that every value took the new type.\n* - A nullability or constraint change alone is `widening`: a tightening copy fails on a NULL\n* rather than losing it.\n* - A required column with no default added to an existing table is copied from a temporary value\n* (`additive`). A column in a key or foreign key, whose values come from a value set, or whose\n* type has no such value is carried with nothing to copy from: the rebuild succeeds on an empty\n* table and fails on `NOT NULL` when the table has rows. A column a `--backfill` statement names\n* was added nullable and filled by earlier calls, so the rebuild copies it like a live column.\n* - A rebuild that leaves a live column out loses its values, so it is `destructive`.\n* - Any other column added to a table the plan rebuilds, optional or with a default, and an index\n* on it, are left to the rebuild, which creates them from the new table's spec. The plan has no\n* separate add, so the rebuild's source table is the live one (`additive`).\n*\n* The table shapes come from `ctx.expected` and `ctx.actual`, keyed by table name: SQLite is a\n* flat, single-namespace target, and one issue only carries its own node.\n*/\nconst recreateTableStrategy = (issues, ctx) => {\n\tconst byTable = /* @__PURE__ */ new Map();\n\tconst consumed = /* @__PURE__ */ new Set();\n\tconst codecHooks = extractCodecControlHooks(ctx.frameworkComponents);\n\tconst rebuildOf = (tableName) => {\n\t\tconst existing = byTable.get(tableName);\n\t\tif (existing !== void 0) return existing;\n\t\tconst created = {\n\t\t\tissues: [],\n\t\t\tclasses: [],\n\t\t\tretypedColumns: [],\n\t\t\tcopyExpressions: {},\n\t\t\ttemporaryValues: {},\n\t\t\taddedColumns: []\n\t\t};\n\t\tbyTable.set(tableName, created);\n\t\treturn created;\n\t};\n\tfor (const issue of issues) {\n\t\tconst tableName = issue.path[1];\n\t\tif (tableName === void 0) continue;\n\t\tconst added = addedRequiredColumn(issue, ctx);\n\t\tif (added !== void 0) {\n\t\t\tconst expectedTable = ctx.expected.tables[tableName];\n\t\t\tif (statementColumn(ctx, \"backfill\", tableName, added.name) !== void 0) {\n\t\t\t\tconst rebuild = rebuildOf(tableName);\n\t\t\t\trebuild.issues.push(issue);\n\t\t\t\trebuild.addedColumns.push(added.name);\n\t\t\t\trebuild.classes.push(\"widening\");\n\t\t\t\tconsumed.add(issue);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst fill = expectedTable === void 0 || !ctx.takesTemporaryValue(tableName, added.name) ? void 0 : sqliteFillValue(added, codecHooks, ctx.types);\n\t\t\tconst rebuild = rebuildOf(tableName);\n\t\t\trebuild.issues.push(issue);\n\t\t\tif (fill !== void 0) rebuild.temporaryValues[added.name] = {\n\t\t\t\tkind: \"sql\",\n\t\t\t\tsql: fill\n\t\t\t};\n\t\t\trebuild.classes.push(\"additive\");\n\t\t\tconsumed.add(issue);\n\t\t\tcontinue;\n\t\t}\n\t\tconst cls = classifyNodeIssue(issue, ctx);\n\t\tif (!cls) continue;\n\t\tconst rebuild = rebuildOf(tableName);\n\t\trebuild.issues.push(issue);\n\t\tconsumed.add(issue);\n\t\tif (cls === \"widening\") {\n\t\t\trebuild.classes.push(\"widening\");\n\t\t\tcontinue;\n\t\t}\n\t\tconst column = columnNameOf(issue);\n\t\tconst converted = statementColumn(ctx, \"convert\", tableName, column);\n\t\trebuild.retypedColumns.push(column);\n\t\tif (converted === void 0) {\n\t\t\trebuild.classes.push(\"destructive\");\n\t\t\tcontinue;\n\t\t}\n\t\trebuild.copyExpressions[column] = {\n\t\t\tkind: \"placeholder\",\n\t\t\tslot: `${converted.text}:convert`\n\t\t};\n\t\trebuild.classes.push(\"data\");\n\t}\n\tfor (const issue of issues) {\n\t\tconst rebuild = byTable.get(issue.path[1] ?? \"\");\n\t\tif (consumed.has(issue) || rebuild === void 0 || addedColumn(issue, ctx) === void 0) continue;\n\t\trebuild.issues.push(issue);\n\t\trebuild.classes.push(\"additive\");\n\t\tconsumed.add(issue);\n\t}\n\tif (byTable.size === 0) return { kind: \"no_match\" };\n\tconst calls = [];\n\tfor (const [tableName, rebuild] 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 leavesColumnsOut = Object.keys(actualTable.columns).some((column) => !Object.hasOwn(expectedTable.columns, column));\n\t\tconst operationClass = highestClass([...rebuild.classes, ...leavesColumnsOut ? [\"destructive\"] : []]);\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), ...rebuild.addedColumns],\n\t\t\tindexes,\n\t\t\tsummary: buildRecreateSummary(tableName, rebuild.issues),\n\t\t\tpostchecks: [...buildRecreatePostchecks(tableName, rebuild.issues, tableSpec, /* @__PURE__ */ new Set([...Object.keys(rebuild.copyExpressions), ...Object.keys(rebuild.temporaryValues)]), new Set(tableSpec.columns.filter(({ name }) => statementColumn(ctx, \"backfill\", tableName, name) !== void 0).map(({ name }) => name)))],\n\t\t\toperationClass,\n\t\t\tcopyExpressions: rebuild.copyExpressions,\n\t\t\ttemporaryValues: rebuild.temporaryValues,\n\t\t\tretypedColumns: rebuild.retypedColumns\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* Writes the calls that come before the rebuild of a column a `--backfill` statement names: for a\n* required column added to an existing table, the nullable add and a data transform whose slot the\n* user fills; for a column made required, the data transform. The rebuild that makes the column\n* NOT NULL comes from `recreateTableStrategy`, so this strategy consumes no issue. Without the\n* statement, a tightening rebuild fails on a NULL rather than guessing a value for it.\n*/\nconst nullabilityTighteningBackfillStrategy = (issues, ctx) => {\n\tconst calls = [];\n\tfor (const issue of issues) {\n\t\tconst tableName = issue.path[1];\n\t\tif (tableName === void 0 || !isColumnIssue(issue)) continue;\n\t\tconst added = addedRequiredColumn(issue, ctx);\n\t\tconst tightened = issueOutcome(issue) === \"not-equal\" && !columnNode(issue.expected).nullable && columnNode(issue.actual).nullable ? columnNode(issue.expected) : void 0;\n\t\tconst column = added ?? tightened;\n\t\tif (column === void 0) continue;\n\t\tconst named = statementColumn(ctx, \"backfill\", tableName, column.name);\n\t\tif (named === void 0) continue;\n\t\tif (added !== void 0) calls.push(new AddColumnCall(tableName, {\n\t\t\t...columnSpecFromNode(added, false),\n\t\t\tnullable: true\n\t\t}));\n\t\tcalls.push(new DataTransformCall(`data_migration.backfill-${tableName}-${column.name}`, `Backfill NULLs in \"${tableName}\".\"${column.name}\" before NOT NULL tightening`, tableName, column.name, `${named.text}:run`));\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/**\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(sqlColumnTypesEqual(expected, blindCast(issue.actual)) ? \"nullabilityConflict\" : \"typeMismatch\", issue.path.join(\"/\"), issueLocation(tableName, expected.name)));\n}\nfunction mapIndexIssue(issue) {\n\tconst tableName = issue.path[1];\n\tif (tableName === void 0) return notOk(issueConflict(\"unsupportedOperation\", `Index issue has no table in its path: ${issue.path.join(\"/\")}`));\n\tif (issueOutcome(issue) === \"not-found\") {\n\t\tconst index = blindCast(issue.expected);\n\t\tconst indexName = index.name;\n\t\treturn ok([new CreateIndexCall(tableName, indexName, index.columns ?? [])]);\n\t}\n\tif (issueOutcome(issue) === \"not-expected\") {\n\t\tconst indexName = blindCast(issue.actual).name;\n\t\treturn ok([new DropIndexCall(tableName, indexName)]);\n\t}\n\treturn notOk(issueConflict(\"indexIncompatible\", issue.path.join(\"/\"), issueLocation(tableName)));\n}\nfunction mapNodeIssueToCall(issue, ctx) {\n\tconst node = issueNode(issue);\n\tif (node === void 0) return notOk(issueConflict(\"unsupportedOperation\", `Issue carries neither an expected nor an actual node: ${issue.path.join(\"/\")}`));\n\tswitch (node.nodeKind) {\n\t\tcase RelationalSchemaNodeKind.table: return mapTableIssue(issue);\n\t\tcase RelationalSchemaNodeKind.column: return mapColumnIssue(issue, ctx);\n\t\tcase RelationalSchemaNodeKind.index: return mapIndexIssue(issue);\n\t\tcase RelationalSchemaNodeKind.columnDefault:\n\t\tcase RelationalSchemaNodeKind.primaryKey:\n\t\tcase RelationalSchemaNodeKind.foreignKey:\n\t\tcase RelationalSchemaNodeKind.unique: return notOk(issueConflict(absorbedConflictKind(node.nodeKind), issue.path.join(\"/\")));\n\t\tcase RelationalSchemaNodeKind.check: return notOk(issueConflict(\"unsupportedOperation\", `The SQLite target does not support CHECK constraint DDL: ${issue.path.join(\"/\")}`));\n\t\tdefault: return notOk(issueConflict(\"unsupportedOperation\", `Unhandled node kind: ${node.nodeKind}`));\n\t}\n}\nfunction classifyCall(call) {\n\tswitch (call.factoryName) {\n\t\tcase \"createTable\": return \"create-table\";\n\t\tcase \"addColumn\": return \"add-column\";\n\t\tcase \"createIndex\": return \"create-index\";\n\t\tcase \"dropColumn\": return \"drop-column\";\n\t\tcase \"dropIndex\": return \"drop-index\";\n\t\tcase \"dropTable\": return \"drop-table\";\n\t\tcase \"recreateTable\": return null;\n\t\tdefault: return null;\n\t}\n}\nconst DEFAULT_POLICY = { allowedOperationClasses: [\n\t\"additive\",\n\t\"widening\",\n\t\"destructive\",\n\t\"data\"\n] };\nfunction planIssues(options) {\n\tconst policyProvided = options.policy !== void 0;\n\tconst policy = options.policy ?? DEFAULT_POLICY;\n\tconst frameworkComponents = options.frameworkComponents ?? [];\n\tconst context = {\n\t\texpected: options.expected ?? emptySchemaIR(),\n\t\tactual: options.actual ?? emptySchemaIR(),\n\t\tpolicy,\n\t\tframeworkComponents,\n\t\ttypes: sqlTypeLookupsOf(frameworkComponents),\n\t\tstatementColumns: options.statementColumns ?? {\n\t\t\tconvert: [],\n\t\t\tbackfill: []\n\t\t},\n\t\ttakesTemporaryValue: options.takesTemporaryValue ?? (() => true),\n\t\toriginCodecId: options.originCodecId ?? (() => void 0)\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 rebuiltIndexes = new Set(gatedRecipe.flatMap((call) => call instanceof RecreateTableCall ? call.indexes.map((index) => indexKey(call.tableName, index.name)) : []));\n\tconst bucketed = [...gatedDefault, ...gatedBucketable];\n\tconst addedBeforeIndexes = new Set(bucketed.flatMap((call) => call instanceof AddColumnCall ? [indexKey(call.tableName, call.columnName)] : []));\n\tconst indexesANewColumn = (call) => {\n\t\tconst live = context.actual.tables[call.tableName];\n\t\treturn live !== void 0 && call.columns.some((column) => live.columns[column] === void 0 && !addedBeforeIndexes.has(indexKey(call.tableName, column)));\n\t};\n\tconst combined = bucketed.filter((call) => !(call instanceof CreateIndexCall) || !indexesANewColumn(call) || !rebuiltIndexes.has(indexKey(call.tableName, call.indexName)));\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 indexKey(tableName, indexName) {\n\treturn JSON.stringify([tableName, indexName]);\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\trefusedOperationClass: call.operationClass,\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/index-replacements.ts\nfunction indexFindings(issues, outcome) {\n\treturn issues.flatMap((issue) => {\n\t\tconst node = issueNode(issue);\n\t\tconst tableName = issue.path[1];\n\t\tif (node === void 0 || !SqlIndexIR.is(node) || tableName === void 0) return [];\n\t\treturn issueOutcome(issue) === outcome ? [{\n\t\t\tissue,\n\t\t\tindex: node,\n\t\t\ttableName\n\t\t}] : [];\n\t});\n}\n/**\n* An index on a renamed table whose wire name derives from the table name: the old and the new index share their content hash and differ in name.\n*/\nfunction renamedTableIndex(renamedTables) {\n\treturn (old, replacement) => {\n\t\tconst oldWire = parseWireName(old.index.name);\n\t\tconst replacementWire = parseWireName(replacement.index.name);\n\t\treturn renamedTables.has(old.tableName) && old.tableName === replacement.tableName && oldWire !== void 0 && oldWire.hash === replacementWire?.hash && old.index.name !== replacement.index.name;\n\t};\n}\n/**\n* An index on the renamed column whose wire name derives from the column name: after the rename\n* the old and the new index cover the same columns on the same table and differ in name.\n*/\nfunction renamedColumnIndex(table, column) {\n\treturn (old, replacement) => old.tableName === table && replacement.tableName === table && old.index.name !== replacement.index.name && old.index.expression === void 0 && old.index.where === void 0 && (old.index.columns ?? []).includes(column) && old.index.unique === replacement.index.unique && isArrayEqual(old.index.columns ?? [], replacement.index.columns ?? []);\n}\n/**\n* An index on the same table whose new name SQLite takes for the old one, as after a table renamed by hand. Its content is not compared: the old index must be dropped before the new one can be created whatever either defines, and the new one is created from its own definition.\n*/\nconst indexNameCaseChange = (old, replacement) => old.tableName === replacement.tableName && old.index.name !== replacement.index.name && sqliteIdentifiersCollide(old.index.name, replacement.index.name);\n/**\n* Pairs each index the plan drops with the index that replaces it, and plans every paired drop before every paired create. SQLite cannot rename an index, and it compares index names without regard to the case of ASCII letters, so a replacement whose name differs from the old one only in that case would otherwise collide with it. The paired issues are returned as consumed so the ordinary diff does not plan them again.\n*/\nfunction pairIndexReplacements(issues, matches) {\n\tconst missing = indexFindings(issues, \"not-found\");\n\tconst pairs = indexFindings(issues, \"not-expected\").flatMap((old) => {\n\t\tconst replacement = missing.find((candidate) => matches(old, candidate));\n\t\tif (replacement === void 0) return [];\n\t\tmissing.splice(missing.indexOf(replacement), 1);\n\t\treturn [{\n\t\t\told,\n\t\t\treplacement\n\t\t}];\n\t});\n\tconst replacements = pairs.map(({ old, replacement }) => ({\n\t\tdrop: new DropIndexCall(old.tableName, old.index.name),\n\t\tcreate: new CreateIndexCall(replacement.tableName, replacement.index.name, replacement.index.columns ?? [])\n\t}));\n\treturn {\n\t\treplacements,\n\t\tcalls: indexReplacementCalls(replacements),\n\t\tconsumed: new Set(pairs.flatMap(({ old, replacement }) => [old.issue, replacement.issue]))\n\t};\n}\n//#endregion\n//#region src/core/migrations/schema-tables.ts\n/**\n* The tables of a SQLite schema. SQLite has one namespace, so the namespace id is ignored, and it\n* compares table and column names without regard to the case of ASCII letters.\n*/\nfunction sqliteSchemaTables(schema) {\n\tconst hasTable = (_namespaceId, table) => Object.hasOwn(schema.tables, table);\n\treturn {\n\t\thasTable,\n\t\thasColumn: (_namespaceId, table, column) => Object.hasOwn(schema.tables[table]?.columns ?? {}, column),\n\t\ttablesNamed: (_namespaceId, table) => Object.keys(schema.tables).filter((existing) => sqliteIdentifiersCollide(existing, table)),\n\t\tcolumnsNamed: (_namespaceId, table, column) => Object.keys(schema.tables[table]?.columns ?? {}).filter((existing) => sqliteIdentifiersCollide(existing, column)),\n\t\tnamespacesWithTable: (table) => hasTable(UNBOUND_NAMESPACE_ID, table) ? [UNBOUND_NAMESPACE_ID] : [],\n\t\thasNamespace: (namespaceId) => namespaceId === UNBOUND_NAMESPACE_ID\n\t};\n}\n//#endregion\n//#region src/core/migrations/working-schema.ts\nfunction rewriteRefs(refs, rewrite) {\n\treturn refs?.map(rewrite);\n}\n/**\n* Rewrites the step of `kind` and `id` in a ref that runs through the given table, and the table\n* step itself when `kind` is the table kind.\n*/\nfunction stepRewrite(tableName, kind, fromId, toId) {\n\treturn (ref) => {\n\t\tconst tableStep = ref[1];\n\t\tif (tableStep?.nodeKind !== RelationalSchemaNodeKind.table || tableStep.id !== tableName) return ref;\n\t\treturn ref.map((step, index) => index >= 1 && step.nodeKind === kind && step.id === fromId ? {\n\t\t\tnodeKind: kind,\n\t\t\tid: toId\n\t\t} : step);\n\t};\n}\n/**\n* An index whose definition carries SQL text, an expression or a predicate, keeps its columns as\n* they are: a column named inside the text cannot be renamed here, so the diff plans the index.\n*/\nfunction withIndex(index, name, rewrite, columnName) {\n\tconst columnsFollow = index.expression === void 0 && index.where === void 0;\n\tconst base = {\n\t\tnaming: name === index.name ? namingOf(index.name, index.prefix) : namingOfLiveName(name),\n\t\twhere: index.where,\n\t\tunique: index.unique,\n\t\tpartial: index.partial,\n\t\ttype: index.type,\n\t\toptions: index.options,\n\t\tannotations: index.annotations,\n\t\tdependsOn: rewriteRefs(index.dependsOn, rewrite)\n\t};\n\treturn new SqlIndexIR(index.expression !== void 0 ? {\n\t\t...base,\n\t\texpression: index.expression\n\t} : {\n\t\t...base,\n\t\tcolumns: (index.columns ?? []).map(columnsFollow ? columnName : (c) => c)\n\t});\n}\nfunction rebuildTable(table, edit, rewrite) {\n\tconst { primaryKey } = table;\n\tconst { columnName } = edit;\n\treturn new SqlTableIR({\n\t\tname: edit.name,\n\t\tcolumns: Object.fromEntries(Object.values(table.columns).map((column) => {\n\t\t\tconst name = columnName(column.name);\n\t\t\treturn [name, name === column.name ? column : column.withName(name)];\n\t\t})),\n\t\t...ifDefined(\"primaryKey\", primaryKey === void 0 ? void 0 : new PrimaryKey({\n\t\t\tcolumns: primaryKey.columns.map(columnName),\n\t\t\t...ifDefined(\"name\", primaryKey.name),\n\t\t\t...ifDefined(\"dependsOn\", rewriteRefs(primaryKey.dependsOn, rewrite))\n\t\t})),\n\t\tuniques: table.uniques.map((unique) => new SqlUniqueIR({\n\t\t\tcolumns: unique.columns.map(columnName),\n\t\t\t...ifDefined(\"name\", unique.name),\n\t\t\t...ifDefined(\"annotations\", unique.annotations),\n\t\t\t...ifDefined(\"dependsOn\", rewriteRefs(unique.dependsOn, rewrite))\n\t\t})),\n\t\tforeignKeys: table.foreignKeys.map((fk) => new SqlForeignKeyIR({\n\t\t\tcolumns: fk.columns.map(columnName),\n\t\t\treferencedTable: edit.referencedTable(fk),\n\t\t\treferencedColumns: edit.referencedColumns(fk),\n\t\t\t...ifDefined(\"referencedSchema\", fk.referencedSchema),\n\t\t\t...ifDefined(\"name\", fk.name),\n\t\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t\t...ifDefined(\"onUpdate\", fk.onUpdate),\n\t\t\t...ifDefined(\"annotations\", fk.annotations),\n\t\t\t...ifDefined(\"resolvedReferencedNamespace\", fk.resolvedReferencedNamespace),\n\t\t\t...ifDefined(\"dependsOn\", rewriteRefs(fk.dependsOn, rewrite))\n\t\t})),\n\t\tindexes: table.indexes.map((index) => withIndex(index, edit.indexName(index), rewrite, columnName)),\n\t\t...ifDefined(\"checks\", table.checks?.map((check) => new SqlCheckConstraintIR({\n\t\t\tnaming: namingOf(check.name, check.prefix),\n\t\t\texpression: check.expression,\n\t\t\tdependsOn: rewriteRefs(check.dependsOn, rewrite)\n\t\t}))),\n\t\t...ifDefined(\"annotations\", table.annotations)\n\t});\n}\n/** Rebuilds every table: `editFor` returns the edit for a table, or `undefined` to keep it. */\nfunction mapTables(schema, rewrite, editFor) {\n\treturn new SqlSchemaIR({\n\t\ttables: Object.fromEntries(Object.values(schema.tables).map((table) => {\n\t\t\tconst rebuilt = rebuildTable(table, {\n\t\t\t\tname: table.name,\n\t\t\t\tcolumnName: (column) => column,\n\t\t\t\treferencedTable: (fk) => fk.referencedTable,\n\t\t\t\treferencedColumns: (fk) => fk.referencedColumns,\n\t\t\t\tindexName: (index) => index.name,\n\t\t\t\t...editFor(table)\n\t\t\t}, rewrite);\n\t\t\treturn [rebuilt.name, rebuilt];\n\t\t})),\n\t\t...ifDefined(\"annotations\", schema.annotations)\n\t});\n}\n/**\n* The schema with one table under its new name. Foreign keys anywhere that reference the table\n* follow it, and every dependency that names it moves with it. Object names do not change. An\n* unnamed primary key, unique constraint or foreign key stays unnamed: SQLite gives such a\n* constraint no name, so an introspected schema has none either, and the planner never renames\n* one.\n*/\nfunction renameTableInSqliteSchema(schema, rename) {\n\tconst { from, to } = rename;\n\treturn mapTables(schema, stepRewrite(from, RelationalSchemaNodeKind.table, from, to), (table) => ({\n\t\t...table.name === from ? { name: to } : {},\n\t\treferencedTable: (fk) => fk.referencedTable === from ? to : fk.referencedTable\n\t}));\n}\n/**\n* The schema with one column under its new name. The table's primary key, unique constraints,\n* foreign keys and plain column indexes name it under the new name, foreign keys anywhere that\n* reference it follow it, and every dependency that names it moves with it. An index with an\n* expression or a predicate keeps its SQL text, and index names do not change, as in SQLite.\n*/\nfunction renameColumnInSqliteSchema(schema, rename) {\n\tconst { table: tableName, from, to } = rename;\n\tconst rewrite = stepRewrite(tableName, RelationalSchemaNodeKind.column, `column:${from}`, `column:${to}`);\n\tconst renamed = (column) => column === from ? to : column;\n\treturn mapTables(schema, rewrite, (table) => ({\n\t\t...table.name === tableName ? { columnName: renamed } : {},\n\t\treferencedColumns: (fk) => fk.referencedTable === tableName ? fk.referencedColumns.map(renamed) : fk.referencedColumns\n\t}));\n}\nfunction replaceIndex(schema, replacement) {\n\tconst { tableName, indexName: oldIndexName } = replacement.drop;\n\tconst newIndexName = replacement.create.indexName;\n\treturn mapTables(schema, stepRewrite(tableName, RelationalSchemaNodeKind.index, `index:${oldIndexName}`, `index:${newIndexName}`), (table) => table.name === tableName ? { indexName: (index) => index.name === oldIndexName ? newIndexName : index.name } : void 0);\n}\n/** The working schema of a plan or a migration, starting from `initial`. */\nfunction createWorkingSchema(initial) {\n\treturn new WorkingSchemaImpl(initial);\n}\nvar WorkingSchemaImpl = class {\n\t#current;\n\tconstructor(initial) {\n\t\tthis.#current = initial;\n\t}\n\tget current() {\n\t\treturn this.#current;\n\t}\n\tapply(call) {\n\t\tconst renamed = call instanceof RenameColumnCall ? renameColumnInSqliteSchema(this.#current, {\n\t\t\ttable: call.tableName,\n\t\t\tfrom: call.oldColumnName,\n\t\t\tto: call.columnName\n\t\t}) : renameTableInSqliteSchema(this.#current, {\n\t\t\tfrom: call.oldTableName,\n\t\t\tto: call.tableName\n\t\t});\n\t\tthis.#current = call.indexReplacements.reduce(replaceIndex, renamed);\n\t}\n};\n//#endregion\n//#region src/core/migrations/table-rename-calls.ts\n/** The SQL a user runs against the database to rename the table by hand. */\nfunction renameTableByHandStatements(rename) {\n\treturn renameTableSteps(rename.from, rename.to).map((renameStep) => renameStep.sql);\n}\n/** The `renameTable` call a user writes in `migration.ts` for `rename`; SQLite has no namespaces. */\nfunction renderRenameTableCall(rename) {\n\treturn new RenameTableCall(rename.from, rename.to, []).renderTypeScript();\n}\n/** How a user renames a table by hand on SQLite. */\nconst sqliteTableRenameByHand = {\n\trenderTableRename: renderRenameTableCall,\n\ttableRenameByHand: renameTableByHandStatements\n};\n/**\n* The call that renames a table, carrying as companions a drop and a create under the new name of\n* each index whose wire name derives from the old table name, since SQLite cannot rename an index.\n* `previous` is the schema with the table under its old name; the renamed copy is diffed against\n* `contract`. SQLite names no primary key, unique constraint or foreign key the contract leaves\n* unnamed, so those need nothing.\n*/\nfunction sqliteTableRenameCall(input) {\n\tconst { from, to } = input.rename;\n\tconst { issues } = buildSqlitePlanDiff({\n\t\tcontract: input.contract,\n\t\tactualSchema: renameTableInSqliteSchema(input.previous, {\n\t\t\tfrom,\n\t\t\tto\n\t\t}),\n\t\tframeworkComponents: input.frameworkComponents\n\t});\n\tconst { replacements } = pairIndexReplacements(coalesceSubtreeIssues(issues), renamedTableIndex(/* @__PURE__ */ new Set([to])));\n\treturn new RenameTableCall(from, to, replacements);\n}\n/**\n* The call that renames a column, carrying as companions a drop and a create under the new name of\n* each index on the column whose wire name derives from the column name, since SQLite cannot rename\n* an index and keeps the old name when it renames the column. `previous` is the schema with the\n* column under its old name; the renamed copy is diffed against `contract`.\n*/\nfunction sqliteColumnRenameCall(input) {\n\tconst { table, from, to } = input.rename;\n\tconst { issues } = buildSqlitePlanDiff({\n\t\tcontract: input.contract,\n\t\tactualSchema: renameColumnInSqliteSchema(input.previous, {\n\t\t\ttable,\n\t\t\tfrom,\n\t\t\tto\n\t\t}),\n\t\tframeworkComponents: input.frameworkComponents\n\t});\n\tconst { replacements } = pairIndexReplacements(coalesceSubtreeIssues(issues), renamedColumnIndex(table, to));\n\treturn new RenameColumnCall(table, from, to, replacements);\n}\n//#endregion\n//#region src/core/migrations/sqlite-migration.ts\n/**\n* Target-owned base class for SQLite migrations. Fixes the `SqlMigration`\n* generic to `SqlitePlanTargetDetails` and the abstract `targetId` to the\n* SQLite literal, so both user-authored migrations and renderer-generated\n* scaffolds can extend `SqliteMigration` directly without redeclaring\n* target-local identity.\n*\n* The constructor materializes a single SQLite `SqlControlAdapter` from\n* `stack.adapter.create(stack)` and stores it; the protected instance methods\n* forward to the corresponding `*Call` with that stored adapter, so user\n* migrations can write `this.createTable({...})` without threading the adapter\n* through every call.\n*\n* Binds the framework base's `Start` / `End` contract generics so a subclass\n* that assigns its snapshot-store `contract.json` imports to\n* `startContractJson` / `endContractJson` gets fully-typed view accessors:\n* `this.endContract` is a `SqliteContractView<End>`\n* (sole namespace unwrapped to the root — `this.endContract.table.<name>`),\n* built lazily from the JSON fields via the shared `MigrationContractViews`\n* helper. Mirrors `MongoMigration`'s view getters; the framework base derives\n* `describe()` from the same JSON.\n*/\nvar SqliteMigration = class extends Migration {\n\ttargetId = \"sqlite\";\n\t/**\n\t* Materialized SQLite control adapter, created once per migration\n\t* instance from the injected stack. `undefined` only when the migration\n\t* was instantiated without a stack (test fixtures); `controlAdapterFor`\n\t* throws a MIGRATION.SQLITE_CONTROL_STACK_MISSING in that case to surface the misuse.\n\t*/\n\tcontrolAdapter;\n\t#endView = new MigrationContractViews(this, \"SqliteMigration\", (json) => SqliteContractView.fromJson(json));\n\t/** The rename calls this read of `operations` has made so far, in order. */\n\t#renames = [];\n\t#startView = new MigrationContractViews(this, \"SqliteMigration\", (json) => SqliteContractView.fromJson(json));\n\tconstructor(stack) {\n\t\tsuper(stack);\n\t\tthis.controlAdapter = stack?.adapter ? blindCast(stack.adapter.create(stack)) : void 0;\n\t}\n\tframeworkComponents() {\n\t\tconst stack = this.stack;\n\t\tif (stack === void 0) return [];\n\t\treturn [\n\t\t\tstack.target,\n\t\t\t...stack.adapter === void 0 ? [] : [stack.adapter],\n\t\t\t...stack.extensions\n\t\t];\n\t}\n\t/** The codec `codecRef` names, built from the stack's codecs; a codec needs a stack. */\n\tstoredValueCodec(operation, codecRef) {\n\t\tif (codecRef === void 0) return void 0;\n\t\tthis.controlAdapterFor(operation);\n\t\treturn {\n\t\t\tcodecRef,\n\t\t\tcodecs: sqlTypeLookupsOf(this.frameworkComponents()).codecLookup\n\t\t};\n\t}\n\t/**\n\t* Returns the materialized control adapter, or throws a MIGRATION.SQLITE_CONTROL_STACK_MISSING naming\n\t* `operation` when the migration was constructed without a `ControlStack`.\n\t* Single home for the null-check that every DDL/DML method shares.\n\t*/\n\tcontrolAdapterFor(operation) {\n\t\tif (!this.controlAdapter) throw errorSqliteMigrationStackMissing(operation);\n\t\treturn this.controlAdapter;\n\t}\n\t/**\n\t* The typed SQLite view over this migration's end-state contract — sole\n\t* namespace unwrapped to the root, so `this.endContract.table.<name>` etc.\n\t* Throws if no `endContractJson` was provided.\n\t*/\n\tget endContract() {\n\t\treturn this.#endView.endContract;\n\t}\n\t/**\n\t* The typed SQLite view over this migration's start-state contract, or\n\t* `null` for a baseline migration (no `startContractJson`).\n\t*/\n\tget startContract() {\n\t\treturn this.#startView.startContract;\n\t}\n\tcreateTable(options) {\n\t\treturn new CreateTableCall(options.table, options.columns, options.constraints).toOp(this.controlAdapterFor(\"createTable\"));\n\t}\n\tdropTable(options) {\n\t\treturn new DropTableCall(options.table).toOp(this.controlAdapterFor(\"dropTable\"));\n\t}\n\t/**\n\t* Emit the operations that rename a table: the table rename, then a drop and a create under the\n\t* new name of each index whose name was derived from the old table name. The old name is resolved\n\t* against the schema as this migration's earlier `renameTable` calls leave it, and the new name\n\t* against the end contract. Spread the result into `operations`:\n\t* `...this.renameTable({ table: 'userProfile', to: 'UserProfile' })`. Throws\n\t* `MIGRATION.TABLE_RENAME_UNMATCHED` when the table does not exist at that point of the migration\n\t* or the end contract lacks the new name.\n\t*/\n\trenameTable(options) {\n\t\tconst adapter = this.controlAdapterFor(\"renameTable\");\n\t\tconst rename = {\n\t\t\tnamespaceId: void 0,\n\t\t\tfrom: options.table,\n\t\t\tto: options.to\n\t\t};\n\t\tconst startContract = this.startContract;\n\t\tif (startContract === null) throw unmatchedTableRename(rename, \"the migration has no start contract\");\n\t\tconst current = this.schemaAfterRenames(startContract);\n\t\tconst endContract = this.endContract;\n\t\tconst resolved = resolveTableRenameAgainst(sqliteSchemaTables(current), endContract, rename);\n\t\tif (!resolved.ok) throw resolved.failure;\n\t\tconst call = sqliteTableRenameCall({\n\t\t\tprevious: current,\n\t\t\tcontract: endContract,\n\t\t\trename: resolved.value,\n\t\t\tframeworkComponents: this.frameworkComponents()\n\t\t});\n\t\tthis.#renames.push(call);\n\t\treturn call.toOps(adapter);\n\t}\n\t/**\n\t* Emit the operations that rename a column: the column rename, then a drop and a create under\n\t* the new name of each index on the column whose name was derived from the old column name. The\n\t* column is resolved against the schema as this migration's earlier rename calls leave it, so a\n\t* column of a table an earlier `renameTable` renamed is named on the table's new name. Spread the\n\t* result into `operations`: `...this.renameColumn({ table: 'User', column: 'name', to:\n\t* 'fullName' })`. Throws `MIGRATION.COLUMN_RENAME_UNMATCHED` when the table or column does not\n\t* exist at that point of the migration, the table already has the new column, or the end\n\t* contract lacks it.\n\t*/\n\trenameColumn(options) {\n\t\tconst adapter = this.controlAdapterFor(\"renameColumn\");\n\t\tconst rename = {\n\t\t\tnamespaceId: void 0,\n\t\t\ttable: options.table,\n\t\t\tfrom: options.column,\n\t\t\tto: options.to\n\t\t};\n\t\tconst startContract = this.startContract;\n\t\tif (startContract === null) throw unmatchedColumnRename(rename, \"the migration has no start contract\");\n\t\tconst current = this.schemaAfterRenames(startContract);\n\t\tconst resolved = resolveColumnRenameAgainst(sqliteSchemaTables(current), this.endContract, rename);\n\t\tif (!resolved.ok) throw resolved.failure;\n\t\tconst call = sqliteColumnRenameCall({\n\t\t\tprevious: current,\n\t\t\tcontract: this.endContract,\n\t\t\trename: resolved.value,\n\t\t\tframeworkComponents: this.frameworkComponents()\n\t\t});\n\t\tthis.#renames.push(call);\n\t\treturn call.toOps(adapter);\n\t}\n\t/** The start contract's schema with this read's rename calls applied in order. */\n\tschemaAfterRenames(startContract) {\n\t\tconst working = createWorkingSchema(sqliteContractToSchema(startContract, sqlTypeLookupsOf(this.frameworkComponents())));\n\t\tfor (const call of this.#renames) working.apply(call);\n\t\treturn working.current;\n\t}\n\tbeginOperationsRead() {\n\t\tthis.#renames = [];\n\t}\n\taddColumn(options) {\n\t\treturn new AddColumnCall(options.table, columnSpecOf(options.column, \"addColumn\", options.table)).toOp(this.controlAdapterFor(\"addColumn\"));\n\t}\n\tdropColumn(options) {\n\t\treturn new DropColumnCall(options.table, options.column).toOp(this.controlAdapterFor(\"dropColumn\"));\n\t}\n\t/**\n\t* Emit an `UPDATE` operation that changes the stored value `from` to `to` in `column`, in every row that holds it. Values are stored values, as the column's codec writes them, and are passed as parameters. Without `codecRef`, pass each value in the form the column stores it, or no row matches.\n\t*/\n\treplaceStoredValue(options) {\n\t\treturn new ReplaceStoredValueCall(options.table, options.column, options.from, options.to, this.storedValueCodec(\"replaceStoredValue\", options.codecRef)).toOp();\n\t}\n\t/**\n\t* Emit an `UPDATE` operation that sets `column` to NULL in every row that holds the stored value `value`. On a column that takes no NULL, its check fails while any row holds the value. The operation is destructive.\n\t*/\n\tremoveStoredValue(options) {\n\t\treturn new RemoveStoredValueCall(options.table, options.column, options.value, this.storedValueCodec(\"removeStoredValue\", options.codecRef), options.enumValue).toOp();\n\t}\n\tcreateIndex(options) {\n\t\treturn new CreateIndexCall(options.table, options.index, options.columns).toOp(this.controlAdapterFor(\"createIndex\"));\n\t}\n\tdropIndex(options) {\n\t\treturn new DropIndexCall(options.table, options.index).toOp(this.controlAdapterFor(\"dropIndex\"));\n\t}\n\trecreateTable(options) {\n\t\tconst { copyExpressions, temporaryValues, ...args } = options;\n\t\treturn new RecreateTableCall({\n\t\t\t...args,\n\t\t\tcontractTable: {\n\t\t\t\t...options.contractTable,\n\t\t\t\tcolumns: options.contractTable.columns.map((column) => columnSpecOf(column, \"recreateTable\", options.tableName))\n\t\t\t},\n\t\t\t...ifDefined(\"copyExpressions\", copyExpressions === void 0 ? void 0 : copyExpressionSlotsOf(copyExpressions, options.tableName)),\n\t\t\t...ifDefined(\"temporaryValues\", temporaryValues === void 0 ? void 0 : copyExpressionSlotsOf(temporaryValues, options.tableName, \"temporaryValues\"))\n\t\t}).toOp(this.controlAdapterFor(\"recreateTable\"));\n\t}\n};\nfunction columnDefaultOf(columnDefault, what) {\n\treturn columnDefault.kind === \"function\" ? {\n\t\tkind: \"function\",\n\t\texpression: sqlTextOf(columnDefault.expression, what)\n\t} : columnDefault;\n}\nfunction columnSpecOf(column, operation, table) {\n\tconst { default: columnDefault, ...rest } = column;\n\tconst what = `${operation} ${JSON.stringify(table)}.${JSON.stringify(column.name)} default`;\n\treturn {\n\t\t...rest,\n\t\t...ifDefined(\"default\", columnDefault === void 0 ? void 0 : columnDefaultOf(columnDefault, what))\n\t};\n}\nfunction copyExpressionSlotsOf(copyExpressions, table, option = \"copyExpressions\") {\n\treturn Object.fromEntries(Object.entries(copyExpressions).map(([column, expression]) => [column, {\n\t\tkind: \"sql\",\n\t\tsql: sqlTextOf(expression, `recreateTable ${JSON.stringify(table)} ${option}.${column}`)\n\t}]));\n}\n//#endregion\nexport { diffSqliteSchema as _, sqliteTableRenameByHand as a, verifySqliteDatabaseSchema as b, sqliteSchemaTables as c, coalesceSubtreeIssues as d, conflictForDisallowedCall as f, buildSqlitePlanDiff as g, sqlitePlannerStrategies as h, sqliteColumnRenameCall as i, indexNameCaseChange as l, planIssues as m, renameTableByHandStatements as n, sqliteTableRenameCall as o, issueNode as p, renderRenameTableCall as r, createWorkingSchema as s, SqliteMigration as t, pairIndexReplacements as u, sqliteActualSchema as v, sqliteContractToSchema as y };\n\n//# sourceMappingURL=sqlite-migration-BxQ65pKq.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAAS,uBAAuB,UAAU,OAAO;CAChD,OAAO,mBAAmB,UAAU;EACnC,qBAAqB;EACrB,gBAAgB;EAChB,gBAAgB,MAAM;EACtB,aAAa,MAAM;CACpB,CAAC;AACF;;;;;;AAMA,SAAS,2BAA2B,OAAO;CAC1C,OAAO,sBAAsB;EAC5B,UAAU,MAAM;EAChB,QAAQ,MAAM;EACd,QAAQ,MAAM;EACd,qBAAqB,MAAM;EAC3B,YAAY;EACZ,eAAe;CAChB,CAAC;AACF;;;;;;;;;AASA,SAAS,qBAAqB,OAAO,UAAU;CAC9C,MAAM,YAAY,MAAM,KAAK;CAC7B,IAAI,cAAc,KAAK,GAAG,OAAO,KAAK;CACtC,KAAK,MAAM,eAAe,OAAO,KAAK,SAAS,QAAQ,UAAU,GAAG;EACnE,MAAM,QAAQ,SAAS,SAAS,SAAS;GACxC;GACA,YAAY;GACZ,YAAY;EACb,CAAC;EACD,IAAI,UAAU,KAAK,GAAG,OAAO,MAAM;CACpC;AACD;;;;;;;;;;AAUA,SAAS,iBAAiB,OAAO;CAChC,MAAM,QAAQ,iBAAiB,MAAM,mBAAmB;CACxD,MAAM,WAAW,uBAAuB,MAAM,UAAU,KAAK;CAC7D,MAAM,SAAS,MAAM,kBAAkB,cAAc,MAAM,SAAS,UAAU,MAAM,MAAM;CAC1F,OAAO;EACN,QAAQ,YAAY,UAAU,MAAM;EACpC,uBAAuB,UAAU,qBAAqB,OAAO,MAAM,QAAQ;EAC3E,gBAAgB,OAAO,OAAO,MAAM,SAAS,QAAQ,UAAU,CAA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