@prisma/orm-target-sqlite 0.16.0-dev.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +23 -0
  3. package/dist/adapter-DizMsGCb-n4h4w8ms.d.mts +22 -0
  4. package/dist/adapter-DizMsGCb-n4h4w8ms.d.mts.map +1 -0
  5. package/dist/adapter-m_BtnNSn.d.mts +2 -0
  6. package/dist/adapter-wc9p_v2Z-y8pzqMfG.mjs +997 -0
  7. package/dist/adapter-wc9p_v2Z-y8pzqMfG.mjs.map +1 -0
  8. package/dist/adapter.d.mts +14 -0
  9. package/dist/adapter.mjs +6 -0
  10. package/dist/adapter__adapter.d.mts +4 -0
  11. package/dist/adapter__adapter.mjs +2 -0
  12. package/dist/adapter__codec-types.d.mts +4 -0
  13. package/dist/adapter__codec-types.mjs +1 -0
  14. package/dist/adapter__column-types.d.mts +2 -0
  15. package/dist/adapter__column-types.mjs +2 -0
  16. package/dist/adapter__control.d.mts +5 -0
  17. package/dist/adapter__control.mjs +261 -0
  18. package/dist/adapter__control.mjs.map +1 -0
  19. package/dist/adapter__runtime.d.mts +2 -0
  20. package/dist/adapter__runtime.mjs +32 -0
  21. package/dist/adapter__runtime.mjs.map +1 -0
  22. package/dist/adapter__types.d.mts +3 -0
  23. package/dist/adapter__types.mjs +1 -0
  24. package/dist/codec-descriptor-BcgD9f3L-BjEkn9Ob.d.mts +31 -0
  25. package/dist/codec-descriptor-BcgD9f3L-BjEkn9Ob.d.mts.map +1 -0
  26. package/dist/codec-descriptor-CyCQXvSl.d.mts +2 -0
  27. package/dist/codec-descriptor-kVCSW1OR-CPatZUPM.mjs +104 -0
  28. package/dist/codec-descriptor-kVCSW1OR-CPatZUPM.mjs.map +1 -0
  29. package/dist/codec-descriptor-rFuZ9DzY-DO0k8l6N.d.mts +1 -0
  30. package/dist/codec-ids-ChRBs2aB.d.mts +1 -0
  31. package/dist/codec-ids-DocGjhs--CHhP1jNZ.d.mts +13 -0
  32. package/dist/codec-ids-DocGjhs--CHhP1jNZ.d.mts.map +1 -0
  33. package/dist/codec-ids-xicqpuAa-DHnKqnIs.mjs +13 -0
  34. package/dist/codec-ids-xicqpuAa-DHnKqnIs.mjs.map +1 -0
  35. package/dist/codec-types-DKB--ltR-CIuvX0zx.d.mts +24 -0
  36. package/dist/codec-types-DKB--ltR-CIuvX0zx.d.mts.map +1 -0
  37. package/dist/codec-types-Tw3EFTjf.d.mts +1 -0
  38. package/dist/codec-types-wPDlPoD7.d.mts +2 -0
  39. package/dist/codecs-1-oOsTPG-Bv518Lbm.d.mts +155 -0
  40. package/dist/codecs-1-oOsTPG-Bv518Lbm.d.mts.map +1 -0
  41. package/dist/codecs-CM_2W3uA.mjs +345 -0
  42. package/dist/codecs-CM_2W3uA.mjs.map +1 -0
  43. package/dist/codecs-j-8RDkOt.d.mts +1 -0
  44. package/dist/column-types-StKUDF6A.mjs +34 -0
  45. package/dist/column-types-StKUDF6A.mjs.map +1 -0
  46. package/dist/column-types-iWGuW-0W.d.mts +33 -0
  47. package/dist/column-types-iWGuW-0W.d.mts.map +1 -0
  48. package/dist/contract-free-CCLAXZV2.d.mts +88 -0
  49. package/dist/contract-free-CCLAXZV2.d.mts.map +1 -0
  50. package/dist/contract-free-DElSXD0q.mjs +90 -0
  51. package/dist/contract-free-DElSXD0q.mjs.map +1 -0
  52. package/dist/control--wMueaTg.d.mts +61 -0
  53. package/dist/control--wMueaTg.d.mts.map +1 -0
  54. package/dist/control-8G9x72lw.mjs +42 -0
  55. package/dist/control-8G9x72lw.mjs.map +1 -0
  56. package/dist/control-DLO163u8.d.mts +19 -0
  57. package/dist/control-DLO163u8.d.mts.map +1 -0
  58. package/dist/control-cahq7u71.d.mts +117 -0
  59. package/dist/control-cahq7u71.d.mts.map +1 -0
  60. package/dist/control-tables-D_o8dKRB-BXi43noL.mjs +12 -0
  61. package/dist/control-tables-D_o8dKRB-BXi43noL.mjs.map +1 -0
  62. package/dist/control-tables-Dua-YcJL.d.mts +12 -0
  63. package/dist/control-tables-Dua-YcJL.d.mts.map +1 -0
  64. package/dist/ddl-CW34JvfE-rd1ZIxOn.mjs +66 -0
  65. package/dist/ddl-CW34JvfE-rd1ZIxOn.mjs.map +1 -0
  66. package/dist/ddl-CfSqNT0M.d.mts +1 -0
  67. package/dist/default-normalizer-B9V7TY5u.d.mts +7 -0
  68. package/dist/default-normalizer-B9V7TY5u.d.mts.map +1 -0
  69. package/dist/default-normalizer-DuoHj9-O-DsK7lJZn.mjs +69 -0
  70. package/dist/default-normalizer-DuoHj9-O-DsK7lJZn.mjs.map +1 -0
  71. package/dist/descriptor-meta-CbYkqTkO-DEJNrICG.mjs +30 -0
  72. package/dist/descriptor-meta-CbYkqTkO-DEJNrICG.mjs.map +1 -0
  73. package/dist/descriptor-meta-DnwDwnGg-D3f936hn.mjs +23 -0
  74. package/dist/descriptor-meta-DnwDwnGg-D3f936hn.mjs.map +1 -0
  75. package/dist/descriptor-meta-runtime-BkXK3OjD-CxZdKHCw.mjs +13 -0
  76. package/dist/descriptor-meta-runtime-BkXK3OjD-CxZdKHCw.mjs.map +1 -0
  77. package/dist/descriptor-meta-vjJkUDsn-Hz3rnAnk.mjs +70 -0
  78. package/dist/descriptor-meta-vjJkUDsn-Hz3rnAnk.mjs.map +1 -0
  79. package/dist/driver.d.mts +3 -0
  80. package/dist/driver.mjs +2 -0
  81. package/dist/driver__control.d.mts +2 -0
  82. package/dist/driver__control.mjs +2 -0
  83. package/dist/driver__runtime.d.mts +2 -0
  84. package/dist/driver__runtime.mjs +197 -0
  85. package/dist/driver__runtime.mjs.map +1 -0
  86. package/dist/errors-CKsaaSnD-BeB4JS8h.mjs +38 -0
  87. package/dist/errors-CKsaaSnD-BeB4JS8h.mjs.map +1 -0
  88. package/dist/migration-jsmNRI_8.mjs +47 -0
  89. package/dist/migration-jsmNRI_8.mjs.map +1 -0
  90. package/dist/migration-uylRe5MP.d.mts +43 -0
  91. package/dist/migration-uylRe5MP.d.mts.map +1 -0
  92. package/dist/native-type-normalizer-CO2wKGL6.d.mts +12 -0
  93. package/dist/native-type-normalizer-CO2wKGL6.d.mts.map +1 -0
  94. package/dist/native-type-normalizer-GpQMEyN5.mjs +14 -0
  95. package/dist/native-type-normalizer-GpQMEyN5.mjs.map +1 -0
  96. package/dist/nodes-D8EC1yCx-rpfpuJ4T.d.mts +29 -0
  97. package/dist/nodes-D8EC1yCx-rpfpuJ4T.d.mts.map +1 -0
  98. package/dist/nodes-DUZSdX86-BBEEaxXY.mjs +33 -0
  99. package/dist/nodes-DUZSdX86-BBEEaxXY.mjs.map +1 -0
  100. package/dist/op-factory-call-C_or6163-B_LDzC37.mjs +829 -0
  101. package/dist/op-factory-call-C_or6163-B_LDzC37.mjs.map +1 -0
  102. package/dist/op-factory-call-DoHN7Q7L.d.mts +161 -0
  103. package/dist/op-factory-call-DoHN7Q7L.d.mts.map +1 -0
  104. package/dist/pack-BfwyQ0b3.d.mts +93 -0
  105. package/dist/pack-BfwyQ0b3.d.mts.map +1 -0
  106. package/dist/planner-Bxdi7jZF.d.mts +104 -0
  107. package/dist/planner-Bxdi7jZF.d.mts.map +1 -0
  108. package/dist/planner-DiGcIjl1-QnNAhVmX.mjs +811 -0
  109. package/dist/planner-DiGcIjl1-QnNAhVmX.mjs.map +1 -0
  110. package/dist/planner-produced-sqlite-migration-BuJysRxx-CaDUbNVx.d.mts +31 -0
  111. package/dist/planner-produced-sqlite-migration-BuJysRxx-CaDUbNVx.d.mts.map +1 -0
  112. package/dist/planner-produced-sqlite-migration-C8nxPT0P-DdBqfmAD.mjs +150 -0
  113. package/dist/planner-produced-sqlite-migration-C8nxPT0P-DdBqfmAD.mjs.map +1 -0
  114. package/dist/planner-produced-sqlite-migration-uySoqJO-.d.mts +1 -0
  115. package/dist/planner-target-details-CIQ789Gc-C5U4yVY9.mjs +15 -0
  116. package/dist/planner-target-details-CIQ789Gc-C5U4yVY9.mjs.map +1 -0
  117. package/dist/planner-target-details-xR6UfIcz-CMahymzq.d.mts +13 -0
  118. package/dist/planner-target-details-xR6UfIcz-CMahymzq.d.mts.map +1 -0
  119. package/dist/render-ops-B10yqmdG.d.mts +11 -0
  120. package/dist/render-ops-B10yqmdG.d.mts.map +1 -0
  121. package/dist/render-ops-DIOn_wOx-D33LOy3b.mjs +27 -0
  122. package/dist/render-ops-DIOn_wOx-D33LOy3b.mjs.map +1 -0
  123. package/dist/runtime-B1coahKC.d.mts +15 -0
  124. package/dist/runtime-B1coahKC.d.mts.map +1 -0
  125. package/dist/runtime-B99c4n56.d.mts +28 -0
  126. package/dist/runtime-B99c4n56.d.mts.map +1 -0
  127. package/dist/runtime-tbBYTw7Z.d.mts +10 -0
  128. package/dist/runtime-tbBYTw7Z.d.mts.map +1 -0
  129. package/dist/shared-BYAX0FaQ--VvRXVRC.d.mts +68 -0
  130. package/dist/shared-BYAX0FaQ--VvRXVRC.d.mts.map +1 -0
  131. package/dist/sql-utils-0SJZOd7Q.d.mts +18 -0
  132. package/dist/sql-utils-0SJZOd7Q.d.mts.map +1 -0
  133. package/dist/sql-utils-DqPXZBMA-Mm27NNjs.mjs +35 -0
  134. package/dist/sql-utils-DqPXZBMA-Mm27NNjs.mjs.map +1 -0
  135. package/dist/sqlite-contract-view-BpNMaU2m-COMDaGaq.d.mts +31 -0
  136. package/dist/sqlite-contract-view-BpNMaU2m-COMDaGaq.d.mts.map +1 -0
  137. package/dist/sqlite-contract-view-CnDITHEE-BvjSbmzL.mjs +151 -0
  138. package/dist/sqlite-contract-view-CnDITHEE-BvjSbmzL.mjs.map +1 -0
  139. package/dist/sqlite-migration-CV6LIqhx-D5eMTAbH.mjs +94 -0
  140. package/dist/sqlite-migration-CV6LIqhx-D5eMTAbH.mjs.map +1 -0
  141. package/dist/sqlite-migration-o23JHwzY-CwNJcqwl.d.mts +105 -0
  142. package/dist/sqlite-migration-o23JHwzY-CwNJcqwl.d.mts.map +1 -0
  143. package/dist/target.d.mts +28 -0
  144. package/dist/target.mjs +19 -0
  145. package/dist/target__codec-descriptor.d.mts +3 -0
  146. package/dist/target__codec-descriptor.mjs +2 -0
  147. package/dist/target__codec-ids.d.mts +3 -0
  148. package/dist/target__codec-ids.mjs +2 -0
  149. package/dist/target__codec-types.d.mts +4 -0
  150. package/dist/target__codec-types.mjs +1 -0
  151. package/dist/target__codecs.d.mts +3 -0
  152. package/dist/target__codecs.mjs +2 -0
  153. package/dist/target__contract-free.d.mts +2 -0
  154. package/dist/target__contract-free.mjs +3 -0
  155. package/dist/target__control-tables.d.mts +2 -0
  156. package/dist/target__control-tables.mjs +2 -0
  157. package/dist/target__control.d.mts +3 -0
  158. package/dist/target__control.mjs +432 -0
  159. package/dist/target__control.mjs.map +1 -0
  160. package/dist/target__ddl.d.mts +3 -0
  161. package/dist/target__ddl.mjs +2 -0
  162. package/dist/target__default-normalizer.d.mts +2 -0
  163. package/dist/target__default-normalizer.mjs +2 -0
  164. package/dist/target__migration.d.mts +3 -0
  165. package/dist/target__migration.mjs +3 -0
  166. package/dist/target__native-type-normalizer.d.mts +2 -0
  167. package/dist/target__native-type-normalizer.mjs +2 -0
  168. package/dist/target__op-factory-call.d.mts +2 -0
  169. package/dist/target__op-factory-call.mjs +2 -0
  170. package/dist/target__pack.d.mts +2 -0
  171. package/dist/target__pack.mjs +2 -0
  172. package/dist/target__planner-produced-sqlite-migration.d.mts +3 -0
  173. package/dist/target__planner-produced-sqlite-migration.mjs +2 -0
  174. package/dist/target__planner-target-details.d.mts +2 -0
  175. package/dist/target__planner-target-details.mjs +2 -0
  176. package/dist/target__planner.d.mts +2 -0
  177. package/dist/target__planner.mjs +2 -0
  178. package/dist/target__render-ops.d.mts +2 -0
  179. package/dist/target__render-ops.mjs +2 -0
  180. package/dist/target__runtime.d.mts +3 -0
  181. package/dist/target__runtime.mjs +17 -0
  182. package/dist/target__runtime.mjs.map +1 -0
  183. package/dist/target__sql-utils.d.mts +2 -0
  184. package/dist/target__sql-utils.mjs +2 -0
  185. package/dist/types-C5FSREvo-Bm6N5Kog.d.mts +25 -0
  186. package/dist/types-C5FSREvo-Bm6N5Kog.d.mts.map +1 -0
  187. package/dist/types-DiH2oWUJ.d.mts +1 -0
  188. package/package.json +78 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"op-factory-call-C_or6163-B_LDzC37.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/op-factory-call-C_or6163.mjs"],"sourcesContent":["import { n as sqliteError } from \"./errors-CKsaaSnD.mjs\";\nimport { n as quoteIdentifier, t as escapeLiteral } from \"./sql-utils-DqPXZBMA.mjs\";\nimport { i as tableExistsAst, n as columnExistsAst, r as indexExistsAst, t as createTable } from \"./ddl-CW34JvfE.mjs\";\nimport { t as buildTargetDetails } from \"./planner-target-details-CIQ789Gc.mjs\";\nimport { n as stripOuterParens } from \"./default-normalizer-DuoHj9-O.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { RelationalSchemaNodeKind } from \"@internal/sql-schema-ir/types\";\nimport { issueOutcome } from \"@internal/framework-components/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { errorUnfilledPlaceholder } from \"@internal/errors/migration\";\nimport { TsExpression, jsonToTsSource } from \"@internal/ts-render\";\nimport { REFERENTIAL_ACTION_SQL } from \"@internal/sql-contract/referential-action-sql\";\n//#region src/core/migrations/planner-ddl-builders.ts\nconst SAFE_NATIVE_TYPE_PATTERN = /^[a-zA-Z][a-zA-Z0-9_ ]*$/;\nfunction assertSafeNativeType(nativeType) {\n\tif (!SAFE_NATIVE_TYPE_PATTERN.test(nativeType)) throw sqliteError(\"CONTRACT.NATIVE_TYPE_INVALID\", `Unsafe native type name in contract: \"${nativeType}\". Native type names must match /^[a-zA-Z][a-zA-Z0-9_ ]*\\$/`, { meta: { nativeType } });\n}\nfunction assertSafeDefaultExpression(expression) {\n\tif (expression.includes(\";\") || /--|\\/\\*|\\bSELECT\\b/i.test(expression)) throw sqliteError(\"CONTRACT.DEFAULT_INVALID\", `Unsafe default expression in contract: \"${expression}\". Default expressions must not contain semicolons, SQL comment tokens, or subqueries.`, { meta: { expression } });\n}\n/**\n* Renders the column's DDL type token (e.g. `\"INTEGER\"`, `\"TEXT\"`).\n* Resolves `typeRef` against `storageTypes` and validates the resulting\n* native type against a safe-identifier pattern.\n*/\nfunction buildColumnTypeSql(column, storageTypes = {}) {\n\tconst resolved = resolveColumnTypeMetadata(column, storageTypes);\n\tassertSafeNativeType(resolved.nativeType);\n\treturn resolved.nativeType.toUpperCase();\n}\n/**\n* Renders the column's `DEFAULT …` clause. Returns the empty string when\n* there is no default, and also when the default is `autoincrement()` —\n* SQLite encodes that as `INTEGER PRIMARY KEY AUTOINCREMENT` inline on the\n* column definition, not as a separate DEFAULT.\n*/\nfunction buildColumnDefaultSql(columnDefault) {\n\tif (!columnDefault) return \"\";\n\tswitch (columnDefault.kind) {\n\t\tcase \"literal\": return `DEFAULT ${renderDefaultLiteral(columnDefault.value)}`;\n\t\tcase \"function\":\n\t\t\tif (columnDefault.expression === \"autoincrement()\") return \"\";\n\t\t\tif (columnDefault.expression === \"now()\") return \"DEFAULT (datetime('now'))\";\n\t\t\tassertSafeDefaultExpression(columnDefault.expression);\n\t\t\treturn `DEFAULT (${columnDefault.expression})`;\n\t}\n}\nfunction renderDefaultLiteral(value) {\n\tif (value instanceof Date) return `'${escapeLiteral(value.toISOString())}'`;\n\tif (typeof value === \"string\") return `'${escapeLiteral(value)}'`;\n\tif (typeof value === \"number\" || typeof value === \"bigint\") return String(value);\n\tif (typeof value === \"boolean\") return value ? \"1\" : \"0\";\n\tif (value === null) return \"NULL\";\n\treturn `'${escapeLiteral(JSON.stringify(value))}'`;\n}\nfunction buildCreateIndexSql(tableName, indexName, columns, unique = false) {\n\treturn `CREATE ${unique ? \"UNIQUE \" : \"\"}INDEX ${quoteIdentifier(indexName)} ON ${quoteIdentifier(tableName)} (${columns.map(quoteIdentifier).join(\", \")})`;\n}\nfunction buildDropIndexSql(indexName) {\n\treturn `DROP INDEX IF EXISTS ${quoteIdentifier(indexName)}`;\n}\nfunction resolveColumnTypeMetadata(column, storageTypes) {\n\tif (!column.typeRef) return column;\n\tconst referencedType = storageTypes[column.typeRef];\n\tif (!referencedType) throw sqliteError(\"CONTRACT.TYPE_UNKNOWN\", `Storage type \"${column.typeRef}\" referenced by column is not defined in storage.types.`, { meta: { typeRef: column.typeRef } });\n\treturn {\n\t\tcodecId: referencedType.codecId,\n\t\tnativeType: referencedType.nativeType,\n\t\ttypeParams: referencedType.typeParams\n\t};\n}\n//#endregion\n//#region src/core/migrations/operations/shared.ts\nfunction step(description, sql, params) {\n\treturn {\n\t\tdescription,\n\t\tsql,\n\t\t...ifDefined(\"params\", params)\n\t};\n}\n/**\n* Renders a single column's inline DDL fragment within a `CREATE TABLE`\n* statement. Honours the `inlineAutoincrementPrimaryKey` flag — SQLite\n* treats `INTEGER PRIMARY KEY AUTOINCREMENT` as a special form that aliases\n* `rowid`, and the column must not carry a `DEFAULT` or repeat `NOT NULL`.\n*/\nfunction renderColumnDefinition(column) {\n\tconst parts = [quoteIdentifier(column.name), column.typeSql];\n\tif (column.inlineAutoincrementPrimaryKey) parts.push(\"PRIMARY KEY AUTOINCREMENT\");\n\telse {\n\t\tif (column.defaultSql) parts.push(column.defaultSql);\n\t\tif (!column.nullable) parts.push(\"NOT NULL\");\n\t}\n\treturn parts.join(\" \");\n}\n/**\n* Renders an inline FOREIGN KEY constraint clause for a `CREATE TABLE`\n* body. Every `SqliteForeignKeySpec` is constraint-bearing by construction\n* (`tableSpecFromNode` only ever builds specs from schema-IR FK nodes, which\n* are themselves constraint-only — a non-constraint FK contributes no node).\n*/\nfunction renderForeignKeyClause(fk) {\n\tlet sql = `${fk.name ? `CONSTRAINT ${quoteIdentifier(fk.name)} ` : \"\"}FOREIGN KEY (${fk.columns.map(quoteIdentifier).join(\", \")}) REFERENCES ${quoteIdentifier(fk.references.table)} (${fk.references.columns.map(quoteIdentifier).join(\", \")})`;\n\tif (fk.onDelete !== void 0) sql += ` ON DELETE ${REFERENTIAL_ACTION_SQL[fk.onDelete]}`;\n\tif (fk.onUpdate !== void 0) sql += ` ON UPDATE ${REFERENTIAL_ACTION_SQL[fk.onUpdate]}`;\n\treturn sql;\n}\n//#endregion\n//#region src/core/migrations/operations/columns.ts\nfunction addColumnExecuteSql(tableName, column) {\n\treturn [\n\t\t`ALTER TABLE ${quoteIdentifier(tableName)}`,\n\t\t`ADD COLUMN ${quoteIdentifier(column.name)} ${column.typeSql}`,\n\t\tcolumn.defaultSql,\n\t\tcolumn.nullable ? \"\" : \"NOT NULL\"\n\t].filter(Boolean).join(\" \");\n}\nfunction dropColumnExecuteSql(tableName, columnName) {\n\treturn `ALTER TABLE ${quoteIdentifier(tableName)} DROP COLUMN ${quoteIdentifier(columnName)}`;\n}\n//#endregion\n//#region src/core/migrations/operations/tables.ts\nasync function tableExistsSteps(lowerer, tableName) {\n\tconst checks = tableExistsAst(tableName);\n\treturn {\n\t\tpresent: await lowerer.lowerToExecuteRequest(checks.tablePresent()),\n\t\tabsent: await lowerer.lowerToExecuteRequest(checks.tableAbsent())\n\t};\n}\n/**\n* Renders the body of a `CREATE TABLE <name> ( … )` statement from a flat\n* `SqliteTableSpec`. SQLite's `INTEGER PRIMARY KEY AUTOINCREMENT` form is\n* inline on the column; the table-level PRIMARY KEY clause is emitted only\n* when no column carries `inlineAutoincrementPrimaryKey`.\n*/\nfunction renderCreateTableSql(tableName, spec) {\n\tconst columnDefs = spec.columns.map(renderColumnDefinition);\n\tconst constraintDefs = [];\n\tconst hasInlinePk = spec.columns.some((c) => c.inlineAutoincrementPrimaryKey);\n\tif (spec.primaryKey && !hasInlinePk) constraintDefs.push(`PRIMARY KEY (${spec.primaryKey.columns.map(quoteIdentifier).join(\", \")})`);\n\tfor (const u of spec.uniques ?? []) {\n\t\tconst name = u.name ? `CONSTRAINT ${quoteIdentifier(u.name)} ` : \"\";\n\t\tconstraintDefs.push(`${name}UNIQUE (${u.columns.map(quoteIdentifier).join(\", \")})`);\n\t}\n\tfor (const fk of spec.foreignKeys ?? []) {\n\t\tconst clause = renderForeignKeyClause(fk);\n\t\tif (clause) constraintDefs.push(clause);\n\t}\n\tconst allDefs = [...columnDefs, ...constraintDefs];\n\treturn `CREATE TABLE ${quoteIdentifier(tableName)} (\\n ${allDefs.join(\",\\n \")}\\n)`;\n}\nasync function recreateTable(args, lowerer) {\n\tconst { tableName, contractTable, schemaColumnNames, indexes, summary, postchecks, operationClass } = args;\n\tconst tempName = `_prisma_new_${tableName}`;\n\tconst liveSet = new Set(schemaColumnNames);\n\tconst sharedColumns = contractTable.columns.filter((c) => liveSet.has(c.name)).map((c) => c.name);\n\tconst columnList = sharedColumns.map(quoteIdentifier).join(\", \");\n\tconst indexStatements = indexes.map((idx) => ({\n\t\tdescription: `recreate index \"${idx.name}\" on \"${tableName}\"`,\n\t\tsql: buildCreateIndexSql(tableName, idx.name, idx.columns)\n\t}));\n\tconst copyStep = sharedColumns.length > 0 ? [step(`copy data from \"${tableName}\" to \"${tempName}\"`, `INSERT INTO ${quoteIdentifier(tempName)} (${columnList}) SELECT ${columnList} FROM ${quoteIdentifier(tableName)}`)] : [];\n\tconst tableSteps = await tableExistsSteps(lowerer, tableName);\n\tconst tempSteps = await tableExistsSteps(lowerer, tempName);\n\treturn {\n\t\tid: `recreateTable.${tableName}`,\n\t\tlabel: `Recreate table ${tableName}`,\n\t\tsummary,\n\t\toperationClass,\n\t\ttarget: {\n\t\t\tid: \"sqlite\",\n\t\t\tdetails: buildTargetDetails(\"table\", tableName)\n\t\t},\n\t\tprecheck: [step(`ensure table \"${tableName}\" exists`, tableSteps.present.sql, tableSteps.present.params), step(`ensure temp table \"${tempName}\" does not exist`, tempSteps.absent.sql, tempSteps.absent.params)],\n\t\texecute: [\n\t\t\tstep(`create new table \"${tempName}\" with desired schema`, renderCreateTableSql(tempName, contractTable)),\n\t\t\t...copyStep,\n\t\t\tstep(`drop old table \"${tableName}\"`, `DROP TABLE ${quoteIdentifier(tableName)}`),\n\t\t\tstep(`rename \"${tempName}\" to \"${tableName}\"`, `ALTER TABLE ${quoteIdentifier(tempName)} RENAME TO ${quoteIdentifier(tableName)}`),\n\t\t\t...indexStatements\n\t\t],\n\t\tpostcheck: [\n\t\t\tstep(`verify table \"${tableName}\" exists`, tableSteps.present.sql, tableSteps.present.params),\n\t\t\tstep(`verify temp table \"${tempName}\" is gone`, tempSteps.absent.sql, tempSteps.absent.params),\n\t\t\t...postchecks\n\t\t]\n\t};\n}\n/**\n* Build a one-line summary of a recreate-table operation from the schema-diff\n* issues that triggered it. Lives next to `recreateTable` so the planner\n* (which has the issues) can produce the same description the factory\n* used to build inline. Keeping the formatting target-side keeps\n* `RecreateTableCall` issue-free at the IR layer. `SchemaDiffIssue` carries\n* no rendered message, so this renders one from each issue's path.\n*/\nfunction buildRecreateSummary(tableName, issues) {\n\treturn `Recreates table ${tableName} to apply schema changes: ${issues.map((i) => i.path.join(\"/\")).join(\"; \")}`;\n}\nfunction nodeKindOf(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\treturn blindCast(node).nodeKind;\n}\n/** Mirrors `SqlColumnIR.isEqualTo`'s type comparison, isolated so a `not-equal` column issue's postcheck can target type drift and nullability drift independently. */\nfunction columnTypeChanged(expected, actual) {\n\tif (expected.resolvedNativeType !== void 0 && actual.resolvedNativeType !== void 0) return expected.resolvedNativeType !== actual.resolvedNativeType;\n\treturn expected.nativeType !== actual.nativeType || Boolean(expected.many) !== Boolean(actual.many);\n}\n/**\n* Returns the columns the contract expects as the table's primary key. Picks\n* up SQLite's inline `INTEGER PRIMARY KEY AUTOINCREMENT` form when no\n* explicit `primaryKey` clause is set on the spec.\n*/\nfunction expectedPrimaryKeyColumns(spec) {\n\tif (spec.primaryKey) return spec.primaryKey.columns;\n\tconst inlinePk = spec.columns.find((c) => c.inlineAutoincrementPrimaryKey);\n\treturn inlinePk ? [inlinePk.name] : [];\n}\nfunction quoteSqlList(values) {\n\treturn values.map((v) => `'${escapeLiteral(v)}'`).join(\", \");\n}\nfunction columnNameFromNode(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\treturn blindCast(node).name;\n}\n/**\n* A column-default issue's own node has no back-reference to its owning\n* column — it's a transient child built by `SqlColumnIR.children()`. The\n* column's id (`column:<name>`) is always the diff path's second-to-last\n* segment for a default issue (`[..., tableId, columnId, 'default']`), so\n* the name is recovered from the path rather than the node.\n*/\nfunction columnNameFromDefaultIssuePath(issue) {\n\tconst columnId = issue.path[issue.path.length - 2];\n\tif (columnId === void 0) return void 0;\n\treturn columnId.startsWith(\"column:\") ? columnId.slice(7) : columnId;\n}\n/**\n* Per-issue postchecks verifying the recreated table's shape against the\n* expected spec. Column-level issues (`sql-column` `not-equal`,\n* `sql-column-default` any reason) emit one targeted check each;\n* constraint-level issues (`sql-primary-key`, `sql-unique`, `sql-foreign-key`,\n* any reason) emit one `pragma_*`-driven check per declared constraint in the\n* expected spec, so a recreated table with the right columns but the wrong\n* PK / unique / FK shape fails the postcheck instead of passing silently.\n* Exported so the planner can pre-build the list at construction time and\n* `RecreateTableCall` doesn't have to carry `SchemaDiffIssue` objects through\n* to render time.\n*/\nfunction buildRecreatePostchecks(tableName, issues, spec) {\n\tconst checks = [];\n\tconst t = escapeLiteral(tableName);\n\tconst byName = new Map(spec.columns.map((c) => [c.name, c]));\n\tlet hasPkIssue = false;\n\tlet hasUniqueIssue = false;\n\tlet hasFkIssue = false;\n\tfor (const issue of issues) {\n\t\tconst nodeKind = nodeKindOf(issue);\n\t\tif (nodeKind === RelationalSchemaNodeKind.column && issueOutcome(issue) === \"not-equal\") {\n\t\t\tconst columnName = columnNameFromNode(issue);\n\t\t\tif (columnName === void 0) continue;\n\t\t\tconst c = escapeLiteral(columnName);\n\t\t\tconst expected = blindCast(issue.expected);\n\t\t\tconst actual = blindCast(issue.actual);\n\t\t\tif (expected.nullable !== actual.nullable) checks.push({\n\t\t\t\tdescription: `verify \"${columnName}\" nullability on \"${tableName}\"`,\n\t\t\t\tsql: `SELECT COUNT(*) > 0 FROM pragma_table_info('${t}') WHERE name = '${c}' AND \"notnull\" = ${expected.nullable ? 0 : 1}`\n\t\t\t});\n\t\t\tif (columnTypeChanged(expected, actual)) {\n\t\t\t\tconst colSpec = byName.get(columnName);\n\t\t\t\tif (colSpec) checks.push({\n\t\t\t\t\tdescription: `verify \"${columnName}\" type on \"${tableName}\"`,\n\t\t\t\t\tsql: `SELECT COUNT(*) > 0 FROM pragma_table_info('${t}') WHERE name = '${c}' AND LOWER(type) = '${escapeLiteral(colSpec.typeSql.toLowerCase())}'`\n\t\t\t\t});\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tif (nodeKind === RelationalSchemaNodeKind.columnDefault) {\n\t\t\tconst columnName = columnNameFromDefaultIssuePath(issue);\n\t\t\tif (columnName === void 0) continue;\n\t\t\tconst c = escapeLiteral(columnName);\n\t\t\tif (issueOutcome(issue) === \"not-expected\") {\n\t\t\t\tchecks.push({\n\t\t\t\t\tdescription: `verify \"${columnName}\" has no default on \"${tableName}\"`,\n\t\t\t\t\tsql: `SELECT COUNT(*) > 0 FROM pragma_table_info('${t}') WHERE name = '${c}' AND dflt_value IS NULL`\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst colSpec = byName.get(columnName);\n\t\t\tconst expectedRaw = colSpec?.defaultSql.startsWith(\"DEFAULT \") ? stripOuterParens(colSpec.defaultSql.slice(8)) : null;\n\t\t\tif (expectedRaw) checks.push({\n\t\t\t\tdescription: `verify \"${columnName}\" default on \"${tableName}\"`,\n\t\t\t\tsql: `SELECT COUNT(*) > 0 FROM pragma_table_info('${t}') WHERE name = '${c}' AND dflt_value = '${escapeLiteral(expectedRaw)}'`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (nodeKind === RelationalSchemaNodeKind.primaryKey) hasPkIssue = true;\n\t\tif (nodeKind === RelationalSchemaNodeKind.unique) hasUniqueIssue = true;\n\t\tif (nodeKind === RelationalSchemaNodeKind.foreignKey) hasFkIssue = true;\n\t}\n\tif (hasPkIssue) {\n\t\tconst pkColumns = expectedPrimaryKeyColumns(spec);\n\t\tconst colCount = pkColumns.length;\n\t\tif (colCount === 0) checks.push({\n\t\t\tdescription: `verify \"${tableName}\" has no primary key`,\n\t\t\tsql: `SELECT (SELECT COUNT(*) FROM pragma_table_info('${t}') WHERE pk > 0) = 0`\n\t\t});\n\t\telse checks.push({\n\t\t\tdescription: `verify primary key on \"${tableName}\"`,\n\t\t\tsql: `SELECT (SELECT COUNT(*) FROM pragma_table_info('${t}') WHERE pk > 0) = ${colCount} AND (SELECT COUNT(*) FROM pragma_table_info('${t}') WHERE pk > 0 AND name IN (${quoteSqlList(pkColumns)})) = ${colCount}`\n\t\t});\n\t}\n\tif (hasUniqueIssue) for (const u of spec.uniques ?? []) {\n\t\tconst colCount = u.columns.length;\n\t\tconst description = u.name ? `verify unique constraint \"${u.name}\" on \"${tableName}\"` : `verify unique constraint (${u.columns.join(\", \")}) on \"${tableName}\"`;\n\t\tchecks.push({\n\t\t\tdescription,\n\t\t\tsql: `SELECT EXISTS (SELECT 1 FROM pragma_index_list('${t}') l WHERE l.\"unique\" = 1 AND (SELECT COUNT(*) FROM pragma_index_info(l.name)) = ${colCount} AND (SELECT COUNT(*) FROM pragma_index_info(l.name) WHERE name IN (${quoteSqlList(u.columns)})) = ${colCount})`\n\t\t});\n\t}\n\tif (hasFkIssue) for (const fk of spec.foreignKeys ?? []) {\n\t\tconst refTable = escapeLiteral(fk.references.table);\n\t\tconst colCount = fk.columns.length;\n\t\tconst tuples = fk.columns.map((from, i) => {\n\t\t\tconst to = fk.references.columns[i] ?? from;\n\t\t\treturn `('${escapeLiteral(from)}', '${escapeLiteral(to)}')`;\n\t\t}).join(\", \");\n\t\tconst description = `verify foreign key (${fk.columns.join(\", \")}) → ${fk.references.table}(${fk.references.columns.join(\", \")}) on \"${tableName}\"`;\n\t\tchecks.push({\n\t\t\tdescription,\n\t\t\tsql: `SELECT EXISTS (SELECT 1 FROM pragma_foreign_key_list('${t}') f WHERE f.\"table\" = '${refTable}' GROUP BY f.id HAVING COUNT(*) = ${colCount} AND SUM(CASE WHEN (f.\"from\", f.\"to\") IN (${tuples}) THEN 1 ELSE 0 END) = ${colCount})`\n\t\t});\n\t}\n\treturn checks;\n}\n//#endregion\n//#region src/core/migrations/op-factory-call.ts\n/**\n* SQLite migration IR: one concrete `*Call` class per pure factory under\n* `operations/`, plus a shared `SqliteOpFactoryCallNode` abstract base.\n*\n* Each call class carries fully-resolved literal arguments. `CreateTableCall`\n* holds structured `DdlColumn[]` + `DdlTableConstraint[]` and lowers via the\n* adapter's DDL path; other call classes carry flat SQL fragments. Codec /\n* `typeRef` / default expansion happens upstream in the issue-planner /\n* strategies, mirroring the Postgres `ColumnSpec` pattern.\n*/\nconst TARGET_MIGRATION_MODULE = \"@internal/sqlite/migration\";\nvar SqliteOpFactoryCallNode = class extends TsExpression {\n\timportRequirements() {\n\t\treturn [{\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: this.factoryName\n\t\t}];\n\t}\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n};\nfunction renderDdlColumnDefault(def) {\n\tif (!def) return \"\";\n\tif (def.kind === \"literal\") return `lit(${jsonToTsSource(def.value)})`;\n\treturn `fn(${jsonToTsSource(def.expression)})`;\n}\nfunction renderDdlColumnAsTsCall(column) {\n\tconst opts = [];\n\tif (column.notNull) opts.push(\"notNull: true\");\n\tif (column.primaryKey) opts.push(\"primaryKey: true\");\n\tif (column.default) opts.push(`default: ${renderDdlColumnDefault(column.default)}`);\n\tconst optsStr = opts.length > 0 ? `, { ${opts.join(\", \")} }` : \"\";\n\treturn `col(${jsonToTsSource(column.name)}, ${jsonToTsSource(column.type)}${optsStr})`;\n}\nfunction renderDdlConstraintAsTsCall(constraint) {\n\tswitch (constraint.kind) {\n\t\tcase \"primary-key\": {\n\t\t\tconst nameOpt = constraint.name ? `, { name: ${jsonToTsSource(constraint.name)} }` : \"\";\n\t\t\treturn `primaryKey(${jsonToTsSource(constraint.columns)}${nameOpt})`;\n\t\t}\n\t\tcase \"foreign-key\": {\n\t\t\tconst opts = [];\n\t\t\tif (constraint.name) opts.push(`name: ${jsonToTsSource(constraint.name)}`);\n\t\t\tif (constraint.onDelete) opts.push(`onDelete: ${jsonToTsSource(constraint.onDelete)}`);\n\t\t\tif (constraint.onUpdate) opts.push(`onUpdate: ${jsonToTsSource(constraint.onUpdate)}`);\n\t\t\tconst optsStr = opts.length > 0 ? `, { ${opts.join(\", \")} }` : \"\";\n\t\t\treturn `foreignKey(${jsonToTsSource(constraint.columns)}, ${jsonToTsSource(constraint.refTable)}, ${jsonToTsSource(constraint.refColumns)}${optsStr})`;\n\t\t}\n\t\tcase \"unique\": {\n\t\t\tconst nameOpt = constraint.name ? `, { name: ${jsonToTsSource(constraint.name)} }` : \"\";\n\t\t\treturn `unique(${jsonToTsSource(constraint.columns)}${nameOpt})`;\n\t\t}\n\t\tcase \"check-expression\": throw sqliteError(\"CONTRACT.CONSTRAINT_INVALID\", `SQLite does not support expression CHECK constraints (constraint \"${constraint.name}\"). Scalar-array columns and their element-non-null checks are Postgres-only.`, { meta: { constraintName: constraint.name } });\n\t}\n}\nfunction constraintImportSymbols(constraints) {\n\tif (!constraints || constraints.length === 0) return [];\n\tconst symbols = /* @__PURE__ */ new Set();\n\tfor (const c of constraints) if (c.kind === \"primary-key\") symbols.add(\"primaryKey\");\n\telse if (c.kind === \"foreign-key\") symbols.add(\"foreignKey\");\n\telse if (c.kind === \"unique\") symbols.add(\"unique\");\n\treturn [...symbols];\n}\nfunction defaultImportSymbols(columns) {\n\tconst symbols = /* @__PURE__ */ new Set();\n\tfor (const col of columns) if (col.default?.kind === \"literal\") symbols.add(\"lit\");\n\telse if (col.default?.kind === \"function\") symbols.add(\"fn\");\n\treturn [...symbols];\n}\nvar CreateTableCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"createTable\";\n\toperationClass = \"additive\";\n\ttableName;\n\tcolumns;\n\tconstraints;\n\tlabel;\n\tconstructor(tableName, columns, constraints) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.columns = Object.freeze([...columns]);\n\t\tthis.constraints = constraints ? Object.freeze([...constraints]) : void 0;\n\t\tthis.label = `Create table ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `CreateTableCall.toOp: a DDL lowerer is required on the SQLite planner path (table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName\n\t\t} });\n\t\tconst ddlNode = createTable({\n\t\t\ttable: this.tableName,\n\t\t\tcolumns: this.columns,\n\t\t\t...ifDefined(\"constraints\", this.constraints)\n\t\t});\n\t\tconst statement = await lowerer.lowerToExecuteRequest(ddlNode);\n\t\tconst tableName = this.tableName;\n\t\tconst tableChecks = tableExistsAst(tableName);\n\t\tconst absent = await lowerer.lowerToExecuteRequest(tableChecks.tableAbsent());\n\t\tconst present = await lowerer.lowerToExecuteRequest(tableChecks.tablePresent());\n\t\treturn {\n\t\t\tid: `table.${tableName}`,\n\t\t\tlabel: `Create table ${tableName}`,\n\t\t\tsummary: `Creates table ${tableName} with required columns`,\n\t\t\toperationClass: \"additive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"table\", tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure table \"${tableName}\" does not exist`, absent.sql, absent.params)],\n\t\t\texecute: [{\n\t\t\t\tdescription: `create table \"${tableName}\"`,\n\t\t\t\tsql: statement.sql,\n\t\t\t\tparams: statement.params ?? []\n\t\t\t}],\n\t\t\tpostcheck: [step(`verify table \"${tableName}\" exists`, present.sql, present.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\tconst columnsList = this.columns.map(renderDdlColumnAsTsCall).join(\", \");\n\t\tconst constraintsList = this.constraints ? this.constraints.map(renderDdlConstraintAsTsCall).join(\", \") : void 0;\n\t\tconst opts = [];\n\t\topts.push(`table: ${jsonToTsSource(this.tableName)}`);\n\t\topts.push(`columns: [${columnsList}]`);\n\t\tif (constraintsList) opts.push(`constraints: [${constraintsList}]`);\n\t\treturn `this.createTable({ ${opts.join(\", \")} })`;\n\t}\n\timportRequirements() {\n\t\tconst req = [];\n\t\tif (this.columns.length > 0) {\n\t\t\treq.push({\n\t\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\t\tsymbol: \"col\"\n\t\t\t});\n\t\t\tfor (const sym of defaultImportSymbols(this.columns)) req.push({\n\t\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\t\tsymbol: sym\n\t\t\t});\n\t\t}\n\t\tfor (const sym of constraintImportSymbols(this.constraints)) req.push({\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: sym\n\t\t});\n\t\treturn req;\n\t}\n};\nvar DropTableCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"dropTable\";\n\toperationClass = \"destructive\";\n\ttableName;\n\tlabel;\n\tconstructor(tableName) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.label = `Drop table ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `DropTableCall.toOp: a lowerer is required on the SQLite planner path (table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName\n\t\t} });\n\t\tconst checks = tableExistsAst(this.tableName);\n\t\tconst present = await lowerer.lowerToExecuteRequest(checks.tablePresent());\n\t\tconst absent = await lowerer.lowerToExecuteRequest(checks.tableAbsent());\n\t\treturn {\n\t\t\tid: `dropTable.${this.tableName}`,\n\t\t\tlabel: `Drop table ${this.tableName}`,\n\t\t\tsummary: `Drops table ${this.tableName} which is not in the contract`,\n\t\t\toperationClass: \"destructive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"table\", this.tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure table \"${this.tableName}\" exists`, present.sql, present.params)],\n\t\t\texecute: [step(`drop table \"${this.tableName}\"`, `DROP TABLE ${quoteIdentifier(this.tableName)}`)],\n\t\t\tpostcheck: [step(`verify table \"${this.tableName}\" is gone`, absent.sql, absent.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.dropTable({ table: ${jsonToTsSource(this.tableName)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nvar RecreateTableCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"recreateTable\";\n\toperationClass;\n\ttableName;\n\tcontractTable;\n\tschemaColumnNames;\n\tindexes;\n\tsummary;\n\tpostchecks;\n\tlabel;\n\tconstructor(args) {\n\t\tsuper();\n\t\tthis.tableName = args.tableName;\n\t\tthis.contractTable = args.contractTable;\n\t\tthis.schemaColumnNames = args.schemaColumnNames;\n\t\tthis.indexes = args.indexes;\n\t\tthis.summary = args.summary;\n\t\tthis.postchecks = args.postchecks;\n\t\tthis.operationClass = args.operationClass;\n\t\tthis.label = `Recreate table ${args.tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `RecreateTableCall.toOp: a lowerer is required on the SQLite planner path (table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName\n\t\t} });\n\t\treturn recreateTable({\n\t\t\ttableName: this.tableName,\n\t\t\tcontractTable: this.contractTable,\n\t\t\tschemaColumnNames: this.schemaColumnNames,\n\t\t\tindexes: this.indexes,\n\t\t\tsummary: this.summary,\n\t\t\tpostchecks: this.postchecks,\n\t\t\toperationClass: this.operationClass\n\t\t}, lowerer);\n\t}\n\trenderTypeScript() {\n\t\treturn `this.recreateTable(${jsonToTsSource({\n\t\t\ttableName: this.tableName,\n\t\t\tcontractTable: this.contractTable,\n\t\t\tschemaColumnNames: this.schemaColumnNames,\n\t\t\tindexes: this.indexes,\n\t\t\tsummary: this.summary,\n\t\t\tpostchecks: this.postchecks,\n\t\t\toperationClass: this.operationClass\n\t\t})})`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nvar AddColumnCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"addColumn\";\n\toperationClass = \"additive\";\n\ttableName;\n\tcolumnName;\n\tcolumn;\n\tlabel;\n\tconstructor(tableName, column) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.columnName = column.name;\n\t\tthis.column = column;\n\t\tthis.label = `Add column ${column.name} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `AddColumnCall.toOp: a lowerer is required on the SQLite planner path (column \"${this.column.name}\" on table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName,\n\t\t\tcolumnName: this.column.name\n\t\t} });\n\t\tconst checks = columnExistsAst(this.tableName, this.column.name);\n\t\tconst absent = await lowerer.lowerToExecuteRequest(checks.columnAbsent());\n\t\tconst present = await lowerer.lowerToExecuteRequest(checks.columnPresent());\n\t\treturn {\n\t\t\tid: `column.${this.tableName}.${this.column.name}`,\n\t\t\tlabel: `Add column ${this.column.name} on ${this.tableName}`,\n\t\t\tsummary: `Adds column ${this.column.name} on ${this.tableName}`,\n\t\t\toperationClass: \"additive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"column\", this.column.name, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure column \"${this.column.name}\" is missing`, absent.sql, absent.params)],\n\t\t\texecute: [step(`add column \"${this.column.name}\"`, addColumnExecuteSql(this.tableName, this.column))],\n\t\t\tpostcheck: [step(`verify column \"${this.column.name}\" exists`, present.sql, present.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.addColumn({ table: ${jsonToTsSource(this.tableName)}, column: ${jsonToTsSource(this.column)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nvar DropColumnCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"dropColumn\";\n\toperationClass = \"destructive\";\n\ttableName;\n\tcolumnName;\n\tlabel;\n\tconstructor(tableName, columnName) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.columnName = columnName;\n\t\tthis.label = `Drop column ${columnName} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `DropColumnCall.toOp: a lowerer is required on the SQLite planner path (column \"${this.columnName}\" on table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName,\n\t\t\tcolumnName: this.columnName\n\t\t} });\n\t\tconst checks = columnExistsAst(this.tableName, this.columnName);\n\t\tconst present = await lowerer.lowerToExecuteRequest(checks.columnPresent());\n\t\tconst absent = await lowerer.lowerToExecuteRequest(checks.columnAbsent());\n\t\treturn {\n\t\t\tid: `dropColumn.${this.tableName}.${this.columnName}`,\n\t\t\tlabel: `Drop column ${this.columnName} on ${this.tableName}`,\n\t\t\tsummary: `Drops column ${this.columnName} on ${this.tableName} which is not in the contract`,\n\t\t\toperationClass: \"destructive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"column\", this.columnName, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure column \"${this.columnName}\" exists on \"${this.tableName}\"`, present.sql, present.params)],\n\t\t\texecute: [step(`drop column \"${this.columnName}\" from \"${this.tableName}\"`, dropColumnExecuteSql(this.tableName, this.columnName))],\n\t\t\tpostcheck: [step(`verify column \"${this.columnName}\" is gone from \"${this.tableName}\"`, absent.sql, absent.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.dropColumn({ table: ${jsonToTsSource(this.tableName)}, column: ${jsonToTsSource(this.columnName)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nvar CreateIndexCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"createIndex\";\n\toperationClass = \"additive\";\n\ttableName;\n\tindexName;\n\tcolumns;\n\tlabel;\n\tconstructor(tableName, indexName, columns) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.indexName = indexName;\n\t\tthis.columns = columns;\n\t\tthis.label = `Create index ${indexName} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `CreateIndexCall.toOp: a lowerer is required on the SQLite planner path (index \"${this.indexName}\" on table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName,\n\t\t\tindexName: this.indexName\n\t\t} });\n\t\tconst checks = indexExistsAst(this.indexName);\n\t\tconst absent = await lowerer.lowerToExecuteRequest(checks.indexAbsent());\n\t\tconst present = await lowerer.lowerToExecuteRequest(checks.indexPresent());\n\t\treturn {\n\t\t\tid: `index.${this.tableName}.${this.indexName}`,\n\t\t\tlabel: `Create index ${this.indexName} on ${this.tableName}`,\n\t\t\tsummary: `Creates index ${this.indexName} on ${this.tableName}`,\n\t\t\toperationClass: \"additive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"index\", this.indexName, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure index \"${this.indexName}\" is missing`, absent.sql, absent.params)],\n\t\t\texecute: [step(`create index \"${this.indexName}\"`, buildCreateIndexSql(this.tableName, this.indexName, this.columns))],\n\t\t\tpostcheck: [step(`verify index \"${this.indexName}\" exists`, present.sql, present.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.createIndex({ table: ${jsonToTsSource(this.tableName)}, index: ${jsonToTsSource(this.indexName)}, columns: ${jsonToTsSource(this.columns)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nvar DropIndexCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"dropIndex\";\n\toperationClass = \"destructive\";\n\ttableName;\n\tindexName;\n\tlabel;\n\tconstructor(tableName, indexName) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.indexName = indexName;\n\t\tthis.label = `Drop index ${indexName} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `DropIndexCall.toOp: a lowerer is required on the SQLite planner path (index \"${this.indexName}\" on table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName,\n\t\t\tindexName: this.indexName\n\t\t} });\n\t\tconst checks = indexExistsAst(this.indexName);\n\t\tconst present = await lowerer.lowerToExecuteRequest(checks.indexPresent());\n\t\tconst absent = await lowerer.lowerToExecuteRequest(checks.indexAbsent());\n\t\treturn {\n\t\t\tid: `dropIndex.${this.tableName}.${this.indexName}`,\n\t\t\tlabel: `Drop index ${this.indexName} on ${this.tableName}`,\n\t\t\tsummary: `Drops index ${this.indexName} on ${this.tableName} which is not in the contract`,\n\t\t\toperationClass: \"destructive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"index\", this.indexName, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure index \"${this.indexName}\" exists`, present.sql, present.params)],\n\t\t\texecute: [step(`drop index \"${this.indexName}\"`, buildDropIndexSql(this.indexName))],\n\t\t\tpostcheck: [step(`verify index \"${this.indexName}\" is gone`, absent.sql, absent.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.dropIndex({ table: ${jsonToTsSource(this.tableName)}, index: ${jsonToTsSource(this.indexName)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\n/**\n* A planner-generated data-transform stub. The current default strategy\n* (`nullabilityTighteningBackfillStrategy`) emits one of these with a\n* backfill-flavored `id`/`label` when the policy allows `'data'` and the\n* contract tightens a column's nullability, but the op itself is generic —\n* any future strategy that needs a placeholder data step can construct one\n* with its own id/label.\n*\n* `toOp()` always throws `MIGRATION.UNFILLED_PLACEHOLDER`: the planner cannot lower a stubbed\n* transform to a runtime op — the user must edit the rendered\n* `migration.ts` and re-emit.\n*/\nvar DataTransformCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"dataTransform\";\n\toperationClass = \"data\";\n\tid;\n\tlabel;\n\ttableName;\n\tcolumnName;\n\tconstructor(id, label, tableName, columnName) {\n\t\tsuper();\n\t\tthis.id = id;\n\t\tthis.label = label;\n\t\tthis.tableName = tableName;\n\t\tthis.columnName = columnName;\n\t\tthis.freeze();\n\t}\n\ttoOp(_lowerer) {\n\t\tthrow errorUnfilledPlaceholder(this.label);\n\t}\n\trenderTypeScript() {\n\t\tconst slot = `${this.tableName}-${this.columnName}-backfill-sql`;\n\t\treturn [\n\t\t\t\"dataTransform({\",\n\t\t\t` id: ${jsonToTsSource(this.id)},`,\n\t\t\t` label: ${jsonToTsSource(this.label)},`,\n\t\t\t` table: ${jsonToTsSource(this.tableName)},`,\n\t\t\t` description: ${jsonToTsSource(`Backfill NULL ${this.columnName} values in ${this.tableName}`)},`,\n\t\t\t` run: () => placeholder(${jsonToTsSource(slot)}),`,\n\t\t\t\"})\"\n\t\t].join(\"\\n\");\n\t}\n\timportRequirements() {\n\t\treturn [{\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: this.factoryName\n\t\t}, {\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: \"placeholder\"\n\t\t}];\n\t}\n};\n/**\n* Laundered pre-built operation. Mirrors Postgres's `RawSqlCall`: wraps an\n* already-materialized `SqlMigrationPlanOperation` (typically produced by a\n* SQL-family helper or a codec lifecycle hook) so the planner can carry it\n* alongside structured call IR. `toOp()` returns the stored op unchanged;\n* `renderTypeScript()` emits `rawSql({...})` with the op serialized as a\n* JSON literal — round-tripping requires every field on the op to be\n* JSON-serializable (no closures).\n*/\nvar RawSqlCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"rawSql\";\n\toperationClass;\n\tlabel;\n\top;\n\tconstructor(op) {\n\t\tsuper();\n\t\tthis.op = op;\n\t\tthis.label = op.label;\n\t\tthis.operationClass = op.operationClass;\n\t\tthis.freeze();\n\t}\n\ttoOp(_lowerer) {\n\t\treturn this.op;\n\t}\n\trenderTypeScript() {\n\t\treturn `rawSql(${jsonToTsSource(this.op)})`;\n\t}\n};\n//#endregion\nexport { DropColumnCall as a, RawSqlCall as c, buildRecreateSummary as d, step as f, renderDefaultLiteral as h, DataTransformCall as i, RecreateTableCall as l, buildColumnTypeSql as m, CreateIndexCall as n, DropIndexCall as o, buildColumnDefaultSql as p, CreateTableCall as r, DropTableCall as s, AddColumnCall as t, buildRecreatePostchecks as u };\n\n//# sourceMappingURL=op-factory-call-C_or6163.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,2BAA2B;AACjC,SA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EAAE;GACjC,YAAY,eAAe,KAAK,KAAK,EAAE;GACvC,YAAY,eAAe,KAAK,SAAS,EAAE;GAC3C,kBAAkB,eAAe,iBAAiB,KAAK,WAAW,aAAa,KAAK,WAAW,EAAE;GACjG,4BAA4B,eAAe,IAAI,EAAE;GACjD;EACD,CAAC,CAAC,KAAK,IAAI;CACZ;CACA,qBAAqB;EACpB,OAAO,CAAC;GACP,iBAAiB;GACjB,QAAQ,KAAK;EACd,GAAG;GACF,iBAAiB;GACjB,QAAQ;EACT,CAAC;CACF;AACD;;;;;;;;;;AAUA,IAAI,aAAa,cAAc,wBAAwB;CACtD,cAAc;CACd;CACA;CACA;CACA,YAAY,IAAI;EACf,MAAM;EACN,KAAK,KAAK;EACV,KAAK,QAAQ,GAAG;EAChB,KAAK,iBAAiB,GAAG;EACzB,KAAK,OAAO;CACb;CACA,KAAK,UAAU;EACd,OAAO,KAAK;CACb;CACA,mBAAmB;EAClB,OAAO,UAAU,eAAe,KAAK,EAAE,EAAE;CAC1C;AACD"}
@@ -0,0 +1,161 @@
1
+ import { t as SqlitePlanTargetDetails } from "./planner-target-details-xR6UfIcz-CMahymzq.mjs";
2
+ import { i as SqliteTableSpec, n as SqliteColumnSpec, r as SqliteIndexSpec } from "./shared-BYAX0FaQ--VvRXVRC.mjs";
3
+ import { DdlColumn, DdlTableConstraint } from "@prisma/orm-family-sql/relational-core/ast";
4
+ import { OpFactoryCall } from "@prisma/orm-framework/components/control";
5
+ import { MigrationOperationClass, SqlMigrationPlanOperation } from "@prisma/orm-family-sql/family/control";
6
+ import { ImportRequirement, TsExpression } from "@prisma/orm-framework/ts-render";
7
+ import { ExecuteRequestLowerer, Lowerer } from "@prisma/orm-family-sql/family/control-adapter";
8
+ //#region ../../../3-targets/3-targets/sqlite/dist/op-factory-call.d.mts
9
+ //#region src/core/migrations/op-factory-call.d.ts
10
+ type Op = SqlMigrationPlanOperation<SqlitePlanTargetDetails>;
11
+ declare abstract class SqliteOpFactoryCallNode extends TsExpression implements OpFactoryCall {
12
+ abstract readonly factoryName: string;
13
+ abstract readonly operationClass: MigrationOperationClass;
14
+ abstract readonly label: string;
15
+ abstract toOp(lowerer?: Lowerer): Op | Promise<Op>;
16
+ importRequirements(): readonly ImportRequirement[];
17
+ protected freeze(): void;
18
+ }
19
+ declare class CreateTableCall extends SqliteOpFactoryCallNode {
20
+ readonly factoryName: "createTable";
21
+ readonly operationClass: "additive";
22
+ readonly tableName: string;
23
+ readonly columns: readonly DdlColumn[];
24
+ readonly constraints: readonly DdlTableConstraint[] | undefined;
25
+ readonly label: string;
26
+ constructor(tableName: string, columns: readonly DdlColumn[], constraints?: readonly DdlTableConstraint[]);
27
+ toOp(lowerer?: ExecuteRequestLowerer): Promise<Op>;
28
+ renderTypeScript(): string;
29
+ importRequirements(): readonly ImportRequirement[];
30
+ }
31
+ declare class DropTableCall extends SqliteOpFactoryCallNode {
32
+ readonly factoryName: "dropTable";
33
+ readonly operationClass: "destructive";
34
+ readonly tableName: string;
35
+ readonly label: string;
36
+ constructor(tableName: string);
37
+ toOp(lowerer?: ExecuteRequestLowerer): Promise<Op>;
38
+ renderTypeScript(): string;
39
+ importRequirements(): readonly ImportRequirement[];
40
+ }
41
+ declare class RecreateTableCall extends SqliteOpFactoryCallNode {
42
+ readonly factoryName: "recreateTable";
43
+ readonly operationClass: MigrationOperationClass;
44
+ readonly tableName: string;
45
+ readonly contractTable: SqliteTableSpec;
46
+ readonly schemaColumnNames: readonly string[];
47
+ readonly indexes: readonly SqliteIndexSpec[];
48
+ readonly summary: string;
49
+ readonly postchecks: readonly {
50
+ readonly description: string;
51
+ readonly sql: string;
52
+ }[];
53
+ readonly label: string;
54
+ constructor(args: {
55
+ tableName: string;
56
+ contractTable: SqliteTableSpec;
57
+ schemaColumnNames: readonly string[];
58
+ indexes: readonly SqliteIndexSpec[];
59
+ summary: string;
60
+ postchecks: readonly {
61
+ readonly description: string;
62
+ readonly sql: string;
63
+ }[];
64
+ operationClass: MigrationOperationClass;
65
+ });
66
+ toOp(lowerer?: ExecuteRequestLowerer): Promise<Op>;
67
+ renderTypeScript(): string;
68
+ importRequirements(): readonly ImportRequirement[];
69
+ }
70
+ declare class AddColumnCall extends SqliteOpFactoryCallNode {
71
+ readonly factoryName: "addColumn";
72
+ readonly operationClass: "additive";
73
+ readonly tableName: string;
74
+ readonly columnName: string;
75
+ readonly column: SqliteColumnSpec;
76
+ readonly label: string;
77
+ constructor(tableName: string, column: SqliteColumnSpec);
78
+ toOp(lowerer?: ExecuteRequestLowerer): Promise<Op>;
79
+ renderTypeScript(): string;
80
+ importRequirements(): readonly ImportRequirement[];
81
+ }
82
+ declare class DropColumnCall extends SqliteOpFactoryCallNode {
83
+ readonly factoryName: "dropColumn";
84
+ readonly operationClass: "destructive";
85
+ readonly tableName: string;
86
+ readonly columnName: string;
87
+ readonly label: string;
88
+ constructor(tableName: string, columnName: string);
89
+ toOp(lowerer?: ExecuteRequestLowerer): Promise<Op>;
90
+ renderTypeScript(): string;
91
+ importRequirements(): readonly ImportRequirement[];
92
+ }
93
+ declare class CreateIndexCall extends SqliteOpFactoryCallNode {
94
+ readonly factoryName: "createIndex";
95
+ readonly operationClass: "additive";
96
+ readonly tableName: string;
97
+ readonly indexName: string;
98
+ readonly columns: readonly string[];
99
+ readonly label: string;
100
+ constructor(tableName: string, indexName: string, columns: readonly string[]);
101
+ toOp(lowerer?: ExecuteRequestLowerer): Promise<Op>;
102
+ renderTypeScript(): string;
103
+ importRequirements(): readonly ImportRequirement[];
104
+ }
105
+ declare class DropIndexCall extends SqliteOpFactoryCallNode {
106
+ readonly factoryName: "dropIndex";
107
+ readonly operationClass: "destructive";
108
+ readonly tableName: string;
109
+ readonly indexName: string;
110
+ readonly label: string;
111
+ constructor(tableName: string, indexName: string);
112
+ toOp(lowerer?: ExecuteRequestLowerer): Promise<Op>;
113
+ renderTypeScript(): string;
114
+ importRequirements(): readonly ImportRequirement[];
115
+ }
116
+ /**
117
+ * A planner-generated data-transform stub. The current default strategy
118
+ * (`nullabilityTighteningBackfillStrategy`) emits one of these with a
119
+ * backfill-flavored `id`/`label` when the policy allows `'data'` and the
120
+ * contract tightens a column's nullability, but the op itself is generic —
121
+ * any future strategy that needs a placeholder data step can construct one
122
+ * with its own id/label.
123
+ *
124
+ * `toOp()` always throws `MIGRATION.UNFILLED_PLACEHOLDER`: the planner cannot lower a stubbed
125
+ * transform to a runtime op — the user must edit the rendered
126
+ * `migration.ts` and re-emit.
127
+ */
128
+ declare class DataTransformCall extends SqliteOpFactoryCallNode {
129
+ readonly factoryName: "dataTransform";
130
+ readonly operationClass: "data";
131
+ readonly id: string;
132
+ readonly label: string;
133
+ readonly tableName: string;
134
+ readonly columnName: string;
135
+ constructor(id: string, label: string, tableName: string, columnName: string);
136
+ toOp(_lowerer?: Lowerer): Op;
137
+ renderTypeScript(): string;
138
+ importRequirements(): readonly ImportRequirement[];
139
+ }
140
+ /**
141
+ * Laundered pre-built operation. Mirrors Postgres's `RawSqlCall`: wraps an
142
+ * already-materialized `SqlMigrationPlanOperation` (typically produced by a
143
+ * SQL-family helper or a codec lifecycle hook) so the planner can carry it
144
+ * alongside structured call IR. `toOp()` returns the stored op unchanged;
145
+ * `renderTypeScript()` emits `rawSql({...})` with the op serialized as a
146
+ * JSON literal — round-tripping requires every field on the op to be
147
+ * JSON-serializable (no closures).
148
+ */
149
+ declare class RawSqlCall extends SqliteOpFactoryCallNode {
150
+ readonly factoryName: "rawSql";
151
+ readonly operationClass: MigrationOperationClass;
152
+ readonly label: string;
153
+ readonly op: Op;
154
+ constructor(op: Op);
155
+ toOp(_lowerer?: Lowerer): Op;
156
+ renderTypeScript(): string;
157
+ }
158
+ type SqliteOpFactoryCall = CreateTableCall | DropTableCall | RecreateTableCall | AddColumnCall | DropColumnCall | CreateIndexCall | DropIndexCall | DataTransformCall | RawSqlCall;
159
+ //#endregion
160
+ export { DropColumnCall as a, RawSqlCall as c, DataTransformCall as i, RecreateTableCall as l, CreateIndexCall as n, DropIndexCall as o, CreateTableCall as r, DropTableCall as s, AddColumnCall as t, SqliteOpFactoryCall as u };
161
+ //# sourceMappingURL=op-factory-call-DoHN7Q7L.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"op-factory-call-DoHN7Q7L.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/op-factory-call.d.mts"],"mappings":";;;;;;;;;KAQK,KAAK,0BAA0B;uBACb,gCAAgC,wBAAwB;oBAC3D;oBACA,gBAAgB;oBAChB;WACT,KAAK,UAAU,UAAU,KAAK,QAAQ;EAC/C,+BAA+B;YACrB;;cAEE,wBAAwB;WAC3B;WACA;WACA;WACA,kBAAkB;WAClB,sBAAsB;WACtB;EACT,YAAY,mBAAmB,kBAAkB,aAAa,uBAAuB;EACrF,KAAK,UAAU,wBAAwB,QAAQ;EAC/C;EACA,+BAA+B;;cAEnB,sBAAsB;WACzB;WACA;WACA;WACA;EACT,YAAY;EACZ,KAAK,UAAU,wBAAwB,QAAQ;EAC/C;EACA,+BAA+B;;cAEnB,0BAA0B;WAC7B;WACA,gBAAgB;WAChB;WACA,eAAe;WACf;WACA,kBAAkB;WAClB;WACA;aACE;aACA;;WAEF;EACT,YAAY;IACV;IACA,eAAe;IACf;IACA,kBAAkB;IAClB;IACA;eACW;eACA;;IAEX,gBAAgB;;EAElB,KAAK,UAAU,wBAAwB,QAAQ;EAC/C;EACA,+BAA+B;;cAEnB,sBAAsB;WACzB;WACA;WACA;WACA;WACA,QAAQ;WACR;EACT,YAAY,mBAAmB,QAAQ;EACvC,KAAK,UAAU,wBAAwB,QAAQ;EAC/C;EACA,+BAA+B;;cAEnB,uBAAuB;WAC1B;WACA;WACA;WACA;WACA;EACT,YAAY,mBAAmB;EAC/B,KAAK,UAAU,wBAAwB,QAAQ;EAC/C;EACA,+BAA+B;;cAEnB,wBAAwB;WAC3B;WACA;WACA;WACA;WACA;WACA;EACT,YAAY,mBAAmB,mBAAmB;EAClD,KAAK,UAAU,wBAAwB,QAAQ;EAC/C;EACA,+BAA+B;;cAEnB,sBAAsB;WACzB;WACA;WACA;WACA;WACA;EACT,YAAY,mBAAmB;EAC/B,KAAK,UAAU,wBAAwB,QAAQ;EAC/C;EACA,+BAA+B;;;;;;;;;;;;;;cAcnB,0BAA0B;WAC7B;WACA;WACA;WACA;WACA;WACA;EACT,YAAY,YAAY,eAAe,mBAAmB;EAC1D,KAAK,WAAW,UAAU;EAC1B;EACA,+BAA+B;;;;;;;;;;;cAWnB,mBAAmB;WACtB;WACA,gBAAgB;WAChB;WACA,IAAI;EACb,YAAY,IAAI;EAChB,KAAK,WAAW,UAAU;EAC1B;;KAEG,sBAAsB,kBAAkB,gBAAgB,oBAAoB,gBAAgB,iBAAiB,kBAAkB,gBAAgB,oBAAoB"}
@@ -0,0 +1,93 @@
1
+ import { t as CodecTypes } from "./codec-types-DKB--ltR-CIuvX0zx.mjs";
2
+ //#region ../../../3-targets/3-targets/sqlite/dist/pack.d.mts
3
+ //#region src/core/descriptor-meta.d.ts
4
+ declare const sqliteTargetDescriptorMetaBase: {
5
+ readonly defaultNamespaceId: "__unbound__";
6
+ readonly authoring: {
7
+ readonly field: {
8
+ readonly temporal: {
9
+ readonly datetime: {
10
+ readonly kind: "fieldPreset";
11
+ readonly args: readonly [{
12
+ readonly name: "onCreate";
13
+ readonly kind: "option";
14
+ readonly values: readonly ["now"];
15
+ readonly optional: true;
16
+ }, {
17
+ readonly name: "onUpdate";
18
+ readonly kind: "option";
19
+ readonly values: readonly ["now"];
20
+ readonly optional: true;
21
+ }];
22
+ readonly output: {
23
+ readonly codecId: "sqlite/datetime@1";
24
+ readonly nativeType: "text";
25
+ readonly executionDefaults: {
26
+ readonly onCreate: {
27
+ readonly kind: "select";
28
+ readonly index: 0;
29
+ readonly cases: {
30
+ readonly now: {
31
+ readonly kind: "generator";
32
+ readonly id: "timestampNow";
33
+ };
34
+ };
35
+ };
36
+ readonly onUpdate: {
37
+ readonly kind: "select";
38
+ readonly index: 1;
39
+ readonly cases: {
40
+ readonly now: {
41
+ readonly kind: "generator";
42
+ readonly id: "timestampNow";
43
+ };
44
+ };
45
+ };
46
+ };
47
+ };
48
+ };
49
+ readonly createdAt: {
50
+ readonly kind: "fieldPreset";
51
+ readonly output: {
52
+ readonly codecId: "sqlite/datetime@1";
53
+ readonly nativeType: "text";
54
+ readonly default: {
55
+ readonly kind: "function";
56
+ readonly expression: "now()";
57
+ };
58
+ };
59
+ };
60
+ readonly updatedAt: {
61
+ readonly kind: "fieldPreset";
62
+ readonly output: {
63
+ readonly codecId: "sqlite/datetime@1";
64
+ readonly nativeType: "text";
65
+ readonly executionDefaults: {
66
+ readonly onCreate: {
67
+ readonly kind: "generator";
68
+ readonly id: "timestampNow";
69
+ };
70
+ readonly onUpdate: {
71
+ readonly kind: "generator";
72
+ readonly id: "timestampNow";
73
+ };
74
+ };
75
+ };
76
+ };
77
+ };
78
+ };
79
+ };
80
+ readonly kind: "target";
81
+ readonly familyId: "sql";
82
+ readonly targetId: "sqlite";
83
+ readonly id: "sqlite";
84
+ readonly version: "0.0.1";
85
+ readonly capabilities: {};
86
+ readonly __codecTypes?: CodecTypes;
87
+ };
88
+ declare const sqliteTargetDescriptorMeta: typeof sqliteTargetDescriptorMetaBase & {
89
+ readonly __codecTypes?: CodecTypes;
90
+ };
91
+ //#endregion
92
+ export { sqliteTargetDescriptorMeta as t };
93
+ //# sourceMappingURL=pack-BfwyQ0b3.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pack-BfwyQ0b3.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/pack.d.mts"],"mappings":";;;cAEc;WACH;WACA;aACE;eACE;iBACE;mBACE;mBACA;qBACE;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;yBACA;2BACE;6BACE;6BACA;;;;uBAIN;yBACE;yBACA;yBACA;2BACE;6BACE;6BACA;;;;;;;iBAOZ;mBACE;mBACA;qBACE;qBACA;qBACA;uBACE;uBACA;;;;iBAIN;mBACE;mBACA;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;;uBAEF;yBACE;yBACA;;;;;;;;WAQd;WACA;WACA;WACA;WACA;WACA;WACA,eAAe;;cAEZ,mCAAmC;WACtC,eAAe"}
@@ -0,0 +1,104 @@
1
+ import { t as SqlitePlanTargetDetails } from "./planner-target-details-xR6UfIcz-CMahymzq.mjs";
2
+ import { n as TypeScriptRenderableSqliteMigration } from "./planner-produced-sqlite-migration-BuJysRxx-CaDUbNVx.mjs";
3
+ import { MigrationPlanner, MigrationScaffoldContext, SchemaOwnership } from "@prisma/orm-framework/components/control";
4
+ import { MigrationOperationPolicy, SqlMigrationPlanner, SqlPlannerFailureResult } from "@prisma/orm-family-sql/family/control";
5
+ import { Contract } from "@prisma/orm-framework/contract/types";
6
+ import { TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
7
+ import { ExecuteRequestLowerer } from "@prisma/orm-family-sql/family/control-adapter";
8
+ //#region ../../../3-targets/3-targets/sqlite/dist/planner.d.mts
9
+ //#region src/core/migrations/planner.d.ts
10
+ declare function createSqliteMigrationPlanner(lowerer: ExecuteRequestLowerer): SqliteMigrationPlanner;
11
+ type SqlitePlanResult = {
12
+ readonly kind: 'success';
13
+ readonly plan: TypeScriptRenderableSqliteMigration;
14
+ } | SqlPlannerFailureResult;
15
+ /**
16
+ * SQLite migration planner — a thin wrapper over `planIssues`.
17
+ *
18
+ * `plan()` diffs the live schema against the target contract via the one
19
+ * differ (`buildSqlitePlanDiff`, producing node-typed `SchemaDiffIssue[]`)
20
+ * and delegates to `planIssues` with the registered strategies. Strategies
21
+ * absorb groups of related issues into composite recipes (e.g. recreating a
22
+ * table to apply type/nullability/default/constraint changes at once);
23
+ * anything not absorbed by a strategy flows through `mapNodeIssueToCall` in
24
+ * the issue planner as a one-off call.
25
+ *
26
+ * FK-backing indexes are already merged into the expected table node's
27
+ * `indexes` at derivation (`contractToSchemaIR`'s `convertTable`), so
28
+ * `mapNodeIssueToCall` handles them uniformly alongside user-declared
29
+ * indexes — no separate expansion step in the planner.
30
+ */
31
+ declare class SqliteMigrationPlanner implements SqlMigrationPlanner<SqlitePlanTargetDetails>, MigrationPlanner<'sql', 'sqlite'> {
32
+ #private;
33
+ constructor(lowerer: ExecuteRequestLowerer);
34
+ plan(options: {
35
+ readonly contract: unknown;
36
+ readonly schema: unknown;
37
+ readonly policy: MigrationOperationPolicy;
38
+ /**
39
+ * The "from" contract (state the planner assumes the database starts at),
40
+ * or `null` for reconciliation flows.
41
+ *
42
+ * Typed as the framework `Contract | null` to satisfy the
43
+ * `MigrationPlanner` interface contract; `planSql` narrows to the SQL
44
+ * shape via `SqlMigrationPlannerPlanOptions`. Used to populate
45
+ * `describe().from` on the produced plan as
46
+ * `fromContract?.storage.storageHash ?? null`.
47
+ */
48
+ readonly fromContract: Contract | null;
49
+ readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
50
+ /**
51
+ * Contract space this plan applies to. Stamped onto the produced
52
+ * {@link TypeScriptRenderableSqliteMigration.spaceId} so the runner keys
53
+ * the marker row by the right space.
54
+ */
55
+ readonly spaceId: string;
56
+ /**
57
+ * Ownership oracle over the contract-space composition — see
58
+ * {@link SqlMigrationPlannerPlanOptions.ownership}.
59
+ */
60
+ readonly ownership?: SchemaOwnership;
61
+ /**
62
+ * POSIX-relative path from the migration package dir to
63
+ * `migrations/snapshots` — see
64
+ * {@link SqlMigrationPlannerPlanOptions.snapshotsImportPath}.
65
+ */
66
+ readonly snapshotsImportPath: string;
67
+ }): SqlitePlanResult;
68
+ emptyMigration(context: MigrationScaffoldContext, spaceId: string): TypeScriptRenderableSqliteMigration;
69
+ private planSql;
70
+ private ensureAdditivePolicy;
71
+ /**
72
+ * Diffs the target contract against the live schema via the one differ
73
+ * (the same tree-building `diffSqliteSchema` uses, plus the
74
+ * op-render stamper) and prepares the issue list `planIssues` consumes.
75
+ *
76
+ * Three passes, in order:
77
+ * 1. Subtree coalescing — the differ is total (a missing/extra table also
78
+ * emits an issue for every column/constraint under it); those nested
79
+ * issues are redundant once the table-level `CreateTable`/`DropTable`
80
+ * call already accounts for the whole subtree. Runs FIRST, over the
81
+ * complete diff: a sibling-owned extra table's column issues must
82
+ * collapse into its one table-level issue before the ownership pass,
83
+ * because a bare column node carries no table reference — if coalescing
84
+ * ran after ownership dropped the table-level issue, the orphaned column
85
+ * issues would survive and the planner would emit drops against a
86
+ * sibling space's table.
87
+ * 2. Ownership — a live extra is only this plan's to drop when no contract
88
+ * space owns it. The differ ran against THIS space's contract, so a
89
+ * table a sibling owns surfaces here as `not-expected`; the planner asks
90
+ * the ownership oracle (the passive aggregate) whether any space declares
91
+ * it and, if so, leaves it alone. A table no space owns stays a genuine
92
+ * extra. Ownership lives in the aggregate; the planner only asks. No
93
+ * oracle (single-space) keeps every extra.
94
+ * 3. Strict-mode extras gating — `not-expected` (extra table/column/
95
+ * constraint) issues are dropped entirely outside strict mode, mirroring
96
+ * the retired coordinate walk's `if (strict) { ...extra_* } }` guards:
97
+ * an additive-only plan must never even consider dropping an unclaimed
98
+ * object, not just refuse to emit the drop.
99
+ */
100
+ private collectSchemaIssues;
101
+ }
102
+ //#endregion
103
+ export { SqlitePlanResult as n, createSqliteMigrationPlanner as r, SqliteMigrationPlanner as t };
104
+ //# sourceMappingURL=planner-Bxdi7jZF.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-Bxdi7jZF.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/planner.d.mts"],"mappings":";;;;;;;;;iBAQiB,6BAA6B,SAAS,wBAAwB;KAC1E;WACM;WACA,MAAM;IACb;;;;;;;;;;;;;;;;;cAiBU,kCAAkC,oBAAoB,0BAA0B;;EAE5F,YAAY,SAAS;EACrB,KAAK;aACM;aACA;aACA,QAAQ;;;;;;;;;;;aAWR,cAAc;aACd,qBAAqB,cAAc;;;;;;aAMnC;;;;;aAKA,YAAY;;;;;;aAMZ;MACP;EACJ,eAAe,SAAS,0BAA0B,kBAAkB;UAC5D;UACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BA"}