@prisma/orm-target-mysql 0.0.0-stage → 8.0.0-rc.21-dev.23

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 (159) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +20 -2
  3. package/dist/adapter-_WBomuTw.d.mts +27 -0
  4. package/dist/adapter-_WBomuTw.d.mts.map +1 -0
  5. package/dist/adapter.d.mts +6 -0
  6. package/dist/adapter.mjs +3 -0
  7. package/dist/adapter__adapter.d.mts +2 -0
  8. package/dist/adapter__adapter.mjs +2 -0
  9. package/dist/adapter__codec-types.d.mts +3 -0
  10. package/dist/adapter__codec-types.mjs +1 -0
  11. package/dist/adapter__control.d.mts +2 -0
  12. package/dist/adapter__control.mjs +2 -0
  13. package/dist/adapter__runtime.d.mts +2 -0
  14. package/dist/adapter__runtime.mjs +417 -0
  15. package/dist/adapter__runtime.mjs.map +1 -0
  16. package/dist/codec-descriptor-DXyubAS6-siA0R8Ow.d.mts +43 -0
  17. package/dist/codec-descriptor-DXyubAS6-siA0R8Ow.d.mts.map +1 -0
  18. package/dist/codec-descriptor-Du6DSz-3-ytBCu_mq.mjs +93 -0
  19. package/dist/codec-descriptor-Du6DSz-3-ytBCu_mq.mjs.map +1 -0
  20. package/dist/codec-descriptor-J3TP08l8-ekLvUVxW.d.mts +1 -0
  21. package/dist/codec-descriptor-oLRh9E29.d.mts +2 -0
  22. package/dist/codec-ids-BHUwoNOM.d.mts +2 -0
  23. package/dist/codec-ids-C00hAFkc.mjs +2 -0
  24. package/dist/codec-ids-cjxtOcLM-vFeQhgPm.mjs +10 -0
  25. package/dist/codec-ids-cjxtOcLM-vFeQhgPm.mjs.map +1 -0
  26. package/dist/codec-ids-sMOU8F-B-BQbCq2dr.d.mts +10 -0
  27. package/dist/codec-ids-sMOU8F-B-BQbCq2dr.d.mts.map +1 -0
  28. package/dist/codec-types-Bd7DL1Mr-CZWNfnp9.d.mts +21 -0
  29. package/dist/codec-types-Bd7DL1Mr-CZWNfnp9.d.mts.map +1 -0
  30. package/dist/codec-types-Bo3Jfilx.d.mts +1 -0
  31. package/dist/codec-types-Ja2kLzLS.d.mts +1 -0
  32. package/dist/codecs-C00kjHgh.mjs +282 -0
  33. package/dist/codecs-C00kjHgh.mjs.map +1 -0
  34. package/dist/codecs-CO_VNEYU-CwAnKzRs.d.mts +102 -0
  35. package/dist/codecs-CO_VNEYU-CwAnKzRs.d.mts.map +1 -0
  36. package/dist/codecs-DM61agRr.d.mts +21 -0
  37. package/dist/codecs-DM61agRr.d.mts.map +1 -0
  38. package/dist/contract-contributions-B9njRJbt-ClEtrK2L.mjs +14 -0
  39. package/dist/contract-contributions-B9njRJbt-ClEtrK2L.mjs.map +1 -0
  40. package/dist/contract-free-BvCdx_Ee.mjs +71 -0
  41. package/dist/contract-free-BvCdx_Ee.mjs.map +1 -0
  42. package/dist/contract-free-Cw9Mjcro.d.mts +22 -0
  43. package/dist/contract-free-Cw9Mjcro.d.mts.map +1 -0
  44. package/dist/control-C9zxRXNN.mjs +74 -0
  45. package/dist/control-C9zxRXNN.mjs.map +1 -0
  46. package/dist/control-DHkZbo58.d.mts +25 -0
  47. package/dist/control-DHkZbo58.d.mts.map +1 -0
  48. package/dist/control-Ez_PtlFI.d.mts +121 -0
  49. package/dist/control-Ez_PtlFI.d.mts.map +1 -0
  50. package/dist/control-WTY7Jpxk.mjs +577 -0
  51. package/dist/control-WTY7Jpxk.mjs.map +1 -0
  52. package/dist/control-_4epnrIW.d.mts +27 -0
  53. package/dist/control-_4epnrIW.d.mts.map +1 -0
  54. package/dist/control-tables-CHw2F-rg.d.mts +9 -0
  55. package/dist/control-tables-CHw2F-rg.d.mts.map +1 -0
  56. package/dist/control-tables-CcQ77JE7-CxTQYoQJ.mjs +9 -0
  57. package/dist/control-tables-CcQ77JE7-CxTQYoQJ.mjs.map +1 -0
  58. package/dist/data-type-entries-B0AoBozh-f9AEUIUQ.mjs +42 -0
  59. package/dist/data-type-entries-B0AoBozh-f9AEUIUQ.mjs.map +1 -0
  60. package/dist/data-types-BpihGKoK-BMW-m4EN.d.mts +52 -0
  61. package/dist/data-types-BpihGKoK-BMW-m4EN.d.mts.map +1 -0
  62. package/dist/data-types-Dv9gwVRV-BZPzCWZk.mjs +181 -0
  63. package/dist/data-types-Dv9gwVRV-BZPzCWZk.mjs.map +1 -0
  64. package/dist/data-types-SXrh0Lou.d.mts +8 -0
  65. package/dist/data-types-SXrh0Lou.d.mts.map +1 -0
  66. package/dist/ddl-CT6DPEqg.d.mts +1 -0
  67. package/dist/ddl-DDmMHyA_-Bb8sXoS0.mjs +12 -0
  68. package/dist/ddl-DDmMHyA_-Bb8sXoS0.mjs.map +1 -0
  69. package/dist/default-normalizer-BBhGpw7r.d.mts +27 -0
  70. package/dist/default-normalizer-BBhGpw7r.d.mts.map +1 -0
  71. package/dist/default-normalizer-BDUgHXUn-Xk7HQJuI.mjs +90 -0
  72. package/dist/default-normalizer-BDUgHXUn-Xk7HQJuI.mjs.map +1 -0
  73. package/dist/descriptor-meta-BurjcSiU-Cbk2L1jf.mjs +82 -0
  74. package/dist/descriptor-meta-BurjcSiU-Cbk2L1jf.mjs.map +1 -0
  75. package/dist/descriptor-meta-runtime-Bk_00UrX-BLN4Ahpj.mjs +17 -0
  76. package/dist/descriptor-meta-runtime-Bk_00UrX-BLN4Ahpj.mjs.map +1 -0
  77. package/dist/driver.d.mts +3 -0
  78. package/dist/driver.mjs +2 -0
  79. package/dist/driver__control.d.mts +2 -0
  80. package/dist/driver__control.mjs +2 -0
  81. package/dist/driver__runtime.d.mts +2 -0
  82. package/dist/driver__runtime.mjs +325 -0
  83. package/dist/driver__runtime.mjs.map +1 -0
  84. package/dist/errors-BYhjQT7y.d.mts +10 -0
  85. package/dist/errors-BYhjQT7y.d.mts.map +1 -0
  86. package/dist/errors-rvH_F2Yj-BQrO_--u.mjs +20 -0
  87. package/dist/errors-rvH_F2Yj-BQrO_--u.mjs.map +1 -0
  88. package/dist/marker-lock-CmGvN4hw-Com29AtQ.mjs +51 -0
  89. package/dist/marker-lock-CmGvN4hw-Com29AtQ.mjs.map +1 -0
  90. package/dist/marker-lock-su6IxinO.d.mts +18 -0
  91. package/dist/marker-lock-su6IxinO.d.mts.map +1 -0
  92. package/dist/marker-read-aEaHihYj-Cyg16yn1.mjs +78 -0
  93. package/dist/marker-read-aEaHihYj-Cyg16yn1.mjs.map +1 -0
  94. package/dist/migration-DmlblTTw.d.mts +284 -0
  95. package/dist/migration-DmlblTTw.d.mts.map +1 -0
  96. package/dist/migration-tFuoN9GB.mjs +5 -0
  97. package/dist/mysql-contract-serializer-DLv0uW_f-Cg4A43Ry.mjs +160 -0
  98. package/dist/mysql-contract-serializer-DLv0uW_f-Cg4A43Ry.mjs.map +1 -0
  99. package/dist/nodes-CvcX47ot-B-ZaUYRj.mjs +25 -0
  100. package/dist/nodes-CvcX47ot-B-ZaUYRj.mjs.map +1 -0
  101. package/dist/nodes-xc0cR0_c-2YbhgEjb.d.mts +27 -0
  102. package/dist/nodes-xc0cR0_c-2YbhgEjb.d.mts.map +1 -0
  103. package/dist/pack-YVG-iBMQ.d.mts +1073 -0
  104. package/dist/pack-YVG-iBMQ.d.mts.map +1 -0
  105. package/dist/planner-target-details-D6g2uSp--C5NKHmCc.d.mts +12 -0
  106. package/dist/planner-target-details-D6g2uSp--C5NKHmCc.d.mts.map +1 -0
  107. package/dist/runner-C4r6yEd1-BWQrxW9q.mjs +1644 -0
  108. package/dist/runner-C4r6yEd1-BWQrxW9q.mjs.map +1 -0
  109. package/dist/runtime-BGyTXcQH.d.mts +36 -0
  110. package/dist/runtime-BGyTXcQH.d.mts.map +1 -0
  111. package/dist/runtime-CeuRr9nE.d.mts +29 -0
  112. package/dist/runtime-CeuRr9nE.d.mts.map +1 -0
  113. package/dist/runtime-Cl0BbTZq.d.mts +22 -0
  114. package/dist/runtime-Cl0BbTZq.d.mts.map +1 -0
  115. package/dist/sql-utils-BOS1c2QT.d.mts +30 -0
  116. package/dist/sql-utils-BOS1c2QT.d.mts.map +1 -0
  117. package/dist/sql-utils-Db0IQO_B-PaULnfrE.mjs +30 -0
  118. package/dist/sql-utils-Db0IQO_B-PaULnfrE.mjs.map +1 -0
  119. package/dist/sql-utils-RW0vJvDl.mjs +94 -0
  120. package/dist/sql-utils-RW0vJvDl.mjs.map +1 -0
  121. package/dist/statement-A6bbPBf1-q61iHQLb.mjs +483 -0
  122. package/dist/statement-A6bbPBf1-q61iHQLb.mjs.map +1 -0
  123. package/dist/target.d.mts +24 -0
  124. package/dist/target.mjs +19 -0
  125. package/dist/target__codec-descriptor.d.mts +3 -0
  126. package/dist/target__codec-descriptor.mjs +2 -0
  127. package/dist/target__codec-ids.d.mts +3 -0
  128. package/dist/target__codec-ids.mjs +3 -0
  129. package/dist/target__codec-types.d.mts +3 -0
  130. package/dist/target__codec-types.mjs +1 -0
  131. package/dist/target__codecs.d.mts +3 -0
  132. package/dist/target__codecs.mjs +2 -0
  133. package/dist/target__contract-free.d.mts +2 -0
  134. package/dist/target__contract-free.mjs +3 -0
  135. package/dist/target__control-tables.d.mts +2 -0
  136. package/dist/target__control-tables.mjs +2 -0
  137. package/dist/target__control.d.mts +3 -0
  138. package/dist/target__control.mjs +58 -0
  139. package/dist/target__control.mjs.map +1 -0
  140. package/dist/target__data-types.d.mts +3 -0
  141. package/dist/target__data-types.mjs +3 -0
  142. package/dist/target__ddl.d.mts +3 -0
  143. package/dist/target__ddl.mjs +2 -0
  144. package/dist/target__default-normalizer.d.mts +2 -0
  145. package/dist/target__default-normalizer.mjs +2 -0
  146. package/dist/target__errors.d.mts +2 -0
  147. package/dist/target__errors.mjs +2 -0
  148. package/dist/target__marker-lock.d.mts +2 -0
  149. package/dist/target__marker-lock.mjs +2 -0
  150. package/dist/target__migration.d.mts +2 -0
  151. package/dist/target__migration.mjs +3 -0
  152. package/dist/target__pack.d.mts +2 -0
  153. package/dist/target__pack.mjs +2 -0
  154. package/dist/target__runtime.d.mts +2 -0
  155. package/dist/target__runtime.mjs +17 -0
  156. package/dist/target__runtime.mjs.map +1 -0
  157. package/dist/target__sql-utils.d.mts +2 -0
  158. package/dist/target__sql-utils.mjs +3 -0
  159. package/package.json +71 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner-C4r6yEd1-BWQrxW9q.mjs","names":["#written","#calls","#meta","#spaceId","#snapshotsImportPath","#destination","#lowerer","#operationsCache","#planSql","#applySpaces","#applySpace","#checkDestination","#checkPolicy","#ensureControlTables","#checkOrigin","#applyOperations","#writeMarkerAndLedger","#allHold","#runChecks","#runSteps","#writeLedger"],"sources":["../../../../3-targets/mysql/1-target/dist/runner-C4r6yEd1.mjs"],"sourcesContent":["import { t as mysqlError } from \"./errors-rvH_F2Yj.mjs\";\nimport { n as quoteIdentifier } from \"./sql-utils-Db0IQO_B.mjs\";\nimport { t as CONTROL_TABLE_NAMES } from \"./control-tables-CcQ77JE7.mjs\";\nimport { t as createTable } from \"./ddl-DDmMHyA_.mjs\";\nimport { t as mysqlResolveDefault } from \"./default-normalizer-BDUgHXUn.mjs\";\nimport { i as withMarkerLock } from \"./marker-lock-CmGvN4hw.mjs\";\nimport { dataTypeParams } from \"@internal/framework-components/codec\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { DdlColumn, FunctionColumnDefault, LiteralColumnDefault, PrimaryKeyConstraint, UniqueConstraint, opaqueSql } from \"@internal/sql-relational-core/ast\";\nimport { isSqlDataType, renderSqlTypeName } from \"@internal/sql-contract/data-type\";\nimport { contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, diffSchemas, expectAbsent, expectPresent, failedPostcheckWhy, failedPrecheckWhy, issueOutcome, migrationRunnerFailure, orderIssuesByDependencies, schemaCheckWhy, withDatabaseUnchanged, withFailingSpace } from \"@internal/framework-components/control\";\nimport { NO_RENAMED_ORIGINS, contractToSchemaIR, createSqlTextSources, plannerFailure, runnerFailure, runnerSuccess, sqlTypeLookupsOf, subjectsOfCalls } from \"@internal/family-sql/control\";\nimport { RelationalSchemaNodeKind, SqlSchemaIR, sqlColumnTypesEqual } from \"@internal/sql-schema-ir/types\";\nimport { UNBOUND_NAMESPACE_ID, entityAt } from \"@internal/framework-components/ir\";\nimport { notOk, ok, okVoid } from \"@internal/utils/result\";\nimport { TsExpression, jsonToTsSource, renderImports } from \"@internal/ts-render\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { REFERENTIAL_ACTION_SQL } from \"@internal/sql-contract/referential-action-sql\";\nimport { Migration } from \"@internal/family-sql/migration\";\nimport { isThenable } from \"@internal/utils/promise\";\nimport { resolveRequirementSpecifiers } from \"@internal/framework-components/emission\";\nimport { detectScaffoldRuntime, shebangLineFor } from \"@internal/migration-tools/migration-ts\";\n//#region src/core/migrations/diff-database-schema.ts\n/**\n* The schema IR a contract describes on MySQL: one flat tree of tables, each column typed by the data type its codec represents. A MySQL database holds no schemas, so foreign keys name no referenced schema, as introspection reports them.\n*/\nfunction mysqlContractToSchema(contract, types) {\n\treturn contractToSchemaIR(contract, {\n\t\tannotationNamespace: \"mysql\",\n\t\tresolveDefault: mysqlResolveDefault,\n\t\tdataTypeLookup: types.dataTypeLookup,\n\t\tcodecLookup: types.codecLookup\n\t});\n}\n/** The control policy of the table an issue is about. The tree is flat, so the table's name is the second segment of the issue's path. */\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/** The full-tree diff `db verify` derives its verdict from: the contract's tree against the one introspection built. */\nfunction diffMysqlSchema(input) {\n\tif (!(input.schema instanceof SqlSchemaIR)) throw mysqlError(\"CONTRACT.TARGET_MISMATCH\", \"The MySQL schema diff received a schema tree that MySQL introspection did not build.\");\n\tconst expected = mysqlContractToSchema(input.contract, sqlTypeLookupsOf(input.frameworkComponents));\n\tconst actual = input.schema;\n\tconst namespacesWithTables = Object.values(input.contract.storage.namespaces).filter((ns) => Object.keys(ns.entries.table ?? {}).length > 0);\n\treturn {\n\t\tissues: diffSchemas(expected, actual),\n\t\tresolveControlPolicy: (issue) => resolveControlPolicy(issue, input.contract),\n\t\tnamespacePairs: namespacesWithTables.map(() => ({ actual }))\n\t};\n}\n//#endregion\n//#region src/core/migrations/column-ddl.ts\n/** The type DDL writes for a column node: the type it is stored as, with the parameters the contract writes, as MySQL reports it in `COLUMN_TYPE`. */\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\treturn renderSqlTypeName(type, dataTypeParams(type, column.codecRef?.typeParams));\n}\nfunction ddlDefaultOf(columnDefault) {\n\tif (columnDefault === void 0) return void 0;\n\treturn columnDefault.kind === \"literal\" ? new LiteralColumnDefault(columnDefault.value) : new FunctionColumnDefault(opaqueSql(columnDefault.expression));\n}\n/** The default a column node's DDL writes: the one the contract authored, which `resolvedDefault` normalises for the diff. */\nfunction columnDefaultOf(column) {\n\treturn column.authoredDefault ?? column.resolvedDefault;\n}\n/** The `DdlColumn` of a column node. An `autoincrement()` default stays a function default, which the adapter writes as `AUTO_INCREMENT`. */\nfunction ddlColumnFromNode(column) {\n\tconst columnDefault = ddlDefaultOf(columnDefaultOf(column));\n\treturn new DdlColumn({\n\t\tname: column.name,\n\t\ttype: columnTypeSql(column),\n\t\t...column.nullable ? {} : { notNull: true },\n\t\t...columnDefault === void 0 ? {} : { default: columnDefault },\n\t\t...column.codecRef === void 0 ? {} : { codecRef: column.codecRef }\n\t});\n}\n/** The name a unique constraint is created and dropped by; MySQL names an unnamed one after its first column, which the contract never leaves to it. */\nfunction uniqueName(table, unique) {\n\treturn unique.name ?? `${table}_${unique.columns.join(\"_\")}_key`;\n}\n/** The constraints `CREATE TABLE` writes for a table node: its primary key and unique constraints. Foreign keys are added after every table exists, so tables can reference each other. */\nfunction tableConstraintsFromNode(table) {\n\treturn [...table.primaryKey === void 0 ? [] : [new PrimaryKeyConstraint({ columns: table.primaryKey.columns })], ...table.uniques.map((unique) => new UniqueConstraint({\n\t\tcolumns: unique.columns,\n\t\tname: uniqueName(table.name, unique)\n\t}))];\n}\n//#endregion\n//#region src/core/migrations/operations.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}\nconst IN_DATABASE = \"TABLE_SCHEMA = DATABASE()\";\nfunction count(from, where, params) {\n\treturn {\n\t\tsql: `SELECT COUNT(*) FROM information_schema.${from} WHERE ${IN_DATABASE} AND ${where}`,\n\t\tparams\n\t};\n}\nfunction present(query) {\n\treturn {\n\t\tsql: `SELECT (${query.sql}) > 0 AS result`,\n\t\tparams: query.params\n\t};\n}\nfunction absent(query) {\n\treturn {\n\t\tsql: `SELECT (${query.sql}) = 0 AS result`,\n\t\tparams: query.params\n\t};\n}\nconst tableQuery = (table) => count(\"TABLES\", \"TABLE_NAME = ?\", [table]);\nconst columnQuery = (table, column) => count(\"COLUMNS\", \"TABLE_NAME = ? AND COLUMN_NAME = ?\", [table, column]);\nconst indexQuery = (table, index) => count(\"STATISTICS\", \"TABLE_NAME = ? AND INDEX_NAME = ?\", [table, index]);\nconst constraintQuery = (table, name, type) => count(\"TABLE_CONSTRAINTS\", \"TABLE_NAME = ? AND CONSTRAINT_NAME = ? AND CONSTRAINT_TYPE = ?\", [\n\ttable,\n\tname,\n\ttype\n]);\n/** A step that holds when `query` finds the object, or finds none, as `holds` says. */\nfunction check(description, query, holds, object) {\n\tconst { sql, params } = holds === \"present\" ? present(query) : absent(query);\n\treturn step(description, sql, params, holds === \"present\" ? expectPresent(object) : expectAbsent(object));\n}\nconst tableChecks = (table) => ({\n\tpresent: (description) => check(description, tableQuery(table), \"present\", `table \"${table}\"`),\n\tabsent: (description) => check(description, tableQuery(table), \"absent\", `table \"${table}\"`)\n});\nconst columnChecks = (table, column) => ({\n\tpresent: (description) => check(description, columnQuery(table, column), \"present\", `column \"${column}\" on \"${table}\"`),\n\tabsent: (description) => check(description, columnQuery(table, column), \"absent\", `column \"${column}\" on \"${table}\"`)\n});\nconst indexChecks = (table, index) => ({\n\tpresent: (description) => check(description, indexQuery(table, index), \"present\", `index \"${index}\" on \"${table}\"`),\n\tabsent: (description) => check(description, indexQuery(table, index), \"absent\", `index \"${index}\" on \"${table}\"`)\n});\nconst constraintChecks = (table, name, type) => {\n\tconst object = `${type === \"UNIQUE\" ? \"unique constraint\" : \"foreign key\"} \"${name}\" on \"${table}\"`;\n\treturn {\n\t\tpresent: (description) => check(description, constraintQuery(table, name, type), \"present\", object),\n\t\tabsent: (description) => check(description, constraintQuery(table, name, type), \"absent\", object)\n\t};\n};\nfunction columnList(columns) {\n\treturn columns.map(quoteIdentifier).join(\", \");\n}\n/** The column definition `ALTER TABLE … ADD COLUMN` writes, with the default the adapter renders through the column's codec. */\nasync function columnDefinitionSql(column, table, lowerer) {\n\tconst defaultClause = await lowerer.renderColumnDefault(column, table);\n\treturn [\n\t\tquoteIdentifier(column.name),\n\t\tcolumn.type,\n\t\t...column.notNull ? [\"NOT NULL\"] : [],\n\t\t...defaultClause.length > 0 ? [defaultClause] : []\n\t].join(\" \");\n}\nfunction foreignKeyActionsSql(actions) {\n\treturn [...actions.onDelete === void 0 ? [] : [` ON DELETE ${REFERENTIAL_ACTION_SQL[actions.onDelete]}`], ...actions.onUpdate === void 0 ? [] : [` ON UPDATE ${REFERENTIAL_ACTION_SQL[actions.onUpdate]}`]].join(\"\");\n}\n/** An operation written out in full in `migration.ts`, such as a table rename made by hand. */\nfunction rawSql(op) {\n\treturn op;\n}\n//#endregion\n//#region src/core/migrations/planner-target-details.ts\nfunction buildTargetDetails(objectType, name, table) {\n\treturn {\n\t\tobjectType,\n\t\tname,\n\t\t...ifDefined(\"table\", table)\n\t};\n}\n//#endregion\n//#region src/core/migrations/op-factory-call.ts\nconst TARGET_MIGRATION_MODULE = \"@internal/mysql/migration\";\n/** The refusal of a `MysqlMigration` operation that needs the control adapter, on an instance built without a control stack. */\nfunction mysqlMigrationStackMissing(operation) {\n\treturn mysqlError(\"MIGRATION.MYSQL_CONTROL_STACK_MISSING\", `MysqlMigration.${operation} requires a control adapter`, {\n\t\twhy: `MysqlMigration.${operation} was invoked on an instance constructed without a ControlStack, so it cannot render its DDL.`,\n\t\tfix: \"Construct the migration via the migration CLI entrypoint, which assembles a ControlStack from prisma.config.ts, or pass a ControlStack with a MySQL adapter to the migration constructor in test fixtures.\",\n\t\tmeta: { operation }\n\t});\n}\nvar MysqlOpFactoryCallNode = class extends TsExpression {\n\timportRequirements() {\n\t\treturn [];\n\t}\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n\tlowererFor(lowerer) {\n\t\tif (lowerer === void 0) throw mysqlMigrationStackMissing(this.factoryName);\n\t\treturn lowerer;\n\t}\n};\n/** Whether `call` is one of this target's calls. */\nfunction isMysqlOpFactoryCall(call) {\n\treturn call instanceof MysqlOpFactoryCallNode;\n}\nfunction renderColumnDefault(def, sql) {\n\treturn def.kind === \"literal\" ? `lit(${jsonToTsSource(def.value)})` : `fn(${sql.source(def.expression.text)})`;\n}\nfunction renderColumn(column, sql) {\n\tconst options = [\n\t\t...column.notNull ? [\"notNull: true\"] : [],\n\t\t...column.default === void 0 ? [] : [`default: ${renderColumnDefault(column.default, sql)}`],\n\t\t...column.codecRef === void 0 ? [] : [`codecRef: ${jsonToTsSource(column.codecRef)}`]\n\t];\n\tconst optionsSource = options.length > 0 ? `, { ${options.join(\", \")} }` : \"\";\n\treturn `col(${jsonToTsSource(column.name)}, ${jsonToTsSource(column.type)}${optionsSource})`;\n}\nfunction renderConstraint(constraint) {\n\tconst named = constraint.name === void 0 ? \"\" : `, { name: ${jsonToTsSource(constraint.name)} }`;\n\tswitch (constraint.kind) {\n\t\tcase \"primary-key\": return `primaryKey(${jsonToTsSource(constraint.columns)}${named})`;\n\t\tcase \"unique\": return `unique(${jsonToTsSource(constraint.columns)}${named})`;\n\t\tcase \"foreign-key\":\n\t\tcase \"check-expression\": throw mysqlError(\"CONTRACT.CONSTRAINT_INVALID\", `The MySQL createTable call writes primary keys and unique constraints only; add ${constraint.kind === \"foreign-key\" ? \"a foreign key with addForeignKey\" : \"no CHECK constraint\"} (constraint \"${constraint.name ?? \"\"}\").`, { meta: { constraintKind: constraint.kind } });\n\t}\n}\nfunction columnImports(columns) {\n\tconst symbols = new Set(columns.length > 0 ? [\"col\"] : []);\n\tfor (const column of columns) {\n\t\tif (column.default?.kind === \"literal\") symbols.add(\"lit\");\n\t\tif (column.default?.kind === \"function\") symbols.add(\"fn\");\n\t}\n\treturn [...symbols].map((symbol) => ({\n\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\tsymbol\n\t}));\n}\nvar CreateTableCall = class extends MysqlOpFactoryCallNode {\n\ttableName;\n\tfactoryName = \"createTable\";\n\toperationClass = \"additive\";\n\tlabel;\n\tcolumns;\n\tconstraints;\n\tconstructor(tableName, columns, constraints) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.columns = Object.freeze([...columns]);\n\t\tthis.constraints = Object.freeze([...constraints]);\n\t\tthis.label = `Create table ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tconst statement = await this.lowererFor(lowerer).lowerToExecuteRequest(createTable({\n\t\t\ttable: this.tableName,\n\t\t\tcolumns: this.columns,\n\t\t\tconstraints: this.constraints\n\t\t}));\n\t\tconst table = tableChecks(this.tableName);\n\t\treturn {\n\t\t\tid: `table.${this.tableName}`,\n\t\t\tlabel: this.label,\n\t\t\tsummary: `Creates table ${this.tableName} with its columns, primary key and unique constraints`,\n\t\t\toperationClass: \"additive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"mysql\",\n\t\t\t\tdetails: buildTargetDetails(\"table\", this.tableName)\n\t\t\t},\n\t\t\tprecheck: [table.absent(`ensure table \"${this.tableName}\" does not exist`)],\n\t\t\texecute: [step(`create table \"${this.tableName}\"`, statement.sql, statement.params)],\n\t\t\tpostcheck: [table.present(`verify table \"${this.tableName}\" exists`)]\n\t\t};\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\tconst columns = this.columns.map((column) => renderColumn(column, sql)).join(\", \");\n\t\tconst constraints = this.constraints.map(renderConstraint);\n\t\tconst source = `this.createTable({ table: ${jsonToTsSource(this.tableName)}, columns: [${columns}]${constraints.length > 0 ? `, constraints: [${constraints.join(\", \")}]` : \"\"} })`;\n\t\tconst constraintImports = [...new Set(this.constraints.map((c) => c.kind === \"primary-key\" ? \"primaryKey\" : \"unique\"))].map((symbol) => ({\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol\n\t\t}));\n\t\treturn {\n\t\t\tsource,\n\t\t\timports: [\n\t\t\t\t...columnImports(this.columns),\n\t\t\t\t...constraintImports,\n\t\t\t\t...sql.imports()\n\t\t\t]\n\t\t};\n\t}\n};\nvar DropTableCall = class extends MysqlOpFactoryCallNode {\n\ttableName;\n\tfactoryName = \"dropTable\";\n\toperationClass = \"destructive\";\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\ttoOp() {\n\t\tconst table = tableChecks(this.tableName);\n\t\treturn {\n\t\t\tid: `dropTable.${this.tableName}`,\n\t\t\tlabel: this.label,\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: \"mysql\",\n\t\t\t\tdetails: buildTargetDetails(\"table\", this.tableName)\n\t\t\t},\n\t\t\tprecheck: [table.present(`ensure table \"${this.tableName}\" exists`)],\n\t\t\texecute: [step(`drop table \"${this.tableName}\"`, `DROP TABLE ${quoteIdentifier(this.tableName)}`)],\n\t\t\tpostcheck: [table.absent(`verify table \"${this.tableName}\" is gone`)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.dropTable({ table: ${jsonToTsSource(this.tableName)} })`;\n\t}\n};\nvar AddColumnCall = class extends MysqlOpFactoryCallNode {\n\ttableName;\n\tcolumn;\n\tfactoryName = \"addColumn\";\n\toperationClass = \"additive\";\n\tlabel;\n\tcolumnName;\n\tconstructor(tableName, column) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.column = column;\n\t\tthis.columnName = column.name;\n\t\tthis.label = `Add column ${column.name} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tconst definition = await columnDefinitionSql(this.column, this.tableName, this.lowererFor(lowerer));\n\t\tconst column = columnChecks(this.tableName, this.columnName);\n\t\treturn {\n\t\t\tid: `column.${this.tableName}.${this.columnName}`,\n\t\t\tlabel: this.label,\n\t\t\tsummary: `Adds column ${this.columnName} to ${this.tableName}`,\n\t\t\toperationClass: \"additive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"mysql\",\n\t\t\t\tdetails: buildTargetDetails(\"column\", this.columnName, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [tableChecks(this.tableName).present(`ensure table \"${this.tableName}\" exists`), column.absent(`ensure column \"${this.columnName}\" is missing on \"${this.tableName}\"`)],\n\t\t\texecute: [step(`add column \"${this.columnName}\" to \"${this.tableName}\"`, `ALTER TABLE ${quoteIdentifier(this.tableName)} ADD COLUMN ${definition}`)],\n\t\t\tpostcheck: [column.present(`verify column \"${this.columnName}\" exists on \"${this.tableName}\"`)]\n\t\t};\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: ${renderColumn(this.column, sql)} })`,\n\t\t\timports: [...columnImports([this.column]), ...sql.imports()]\n\t\t};\n\t}\n};\nvar DropColumnCall = class extends MysqlOpFactoryCallNode {\n\ttableName;\n\tcolumnName;\n\tfactoryName = \"dropColumn\";\n\toperationClass = \"destructive\";\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\ttoOp() {\n\t\tconst column = columnChecks(this.tableName, this.columnName);\n\t\treturn {\n\t\t\tid: `dropColumn.${this.tableName}.${this.columnName}`,\n\t\t\tlabel: this.label,\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: \"mysql\",\n\t\t\t\tdetails: buildTargetDetails(\"column\", this.columnName, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [column.present(`ensure column \"${this.columnName}\" exists on \"${this.tableName}\"`)],\n\t\t\texecute: [step(`drop column \"${this.columnName}\" from \"${this.tableName}\"`, `ALTER TABLE ${quoteIdentifier(this.tableName)} DROP COLUMN ${quoteIdentifier(this.columnName)}`)],\n\t\t\tpostcheck: [column.absent(`verify column \"${this.columnName}\" is gone from \"${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};\nvar CreateIndexCall = class extends MysqlOpFactoryCallNode {\n\ttableName;\n\tindexName;\n\tcolumns;\n\tunique;\n\tfactoryName = \"createIndex\";\n\toperationClass = \"additive\";\n\tlabel;\n\tconstructor(tableName, indexName, columns, unique) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.indexName = indexName;\n\t\tthis.columns = columns;\n\t\tthis.unique = unique;\n\t\tthis.label = `Create ${unique ? \"unique \" : \"\"}index ${indexName} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\tconst index = indexChecks(this.tableName, this.indexName);\n\t\treturn {\n\t\t\tid: `index.${this.tableName}.${this.indexName}`,\n\t\t\tlabel: this.label,\n\t\t\tsummary: `Creates ${this.unique ? \"unique \" : \"\"}index ${this.indexName} on ${this.tableName}`,\n\t\t\toperationClass: \"additive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"mysql\",\n\t\t\t\tdetails: buildTargetDetails(\"index\", this.indexName, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [index.absent(`ensure index \"${this.indexName}\" is missing`)],\n\t\t\texecute: [step(`create index \"${this.indexName}\"`, `CREATE ${this.unique ? \"UNIQUE \" : \"\"}INDEX ${quoteIdentifier(this.indexName)} ON ${quoteIdentifier(this.tableName)} (${columnList(this.columns)})`)],\n\t\t\tpostcheck: [index.present(`verify index \"${this.indexName}\" exists`)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.createIndex({ table: ${jsonToTsSource(this.tableName)}, index: ${jsonToTsSource(this.indexName)}, columns: ${jsonToTsSource(this.columns)}${this.unique ? \", unique: true\" : \"\"} })`;\n\t}\n};\nvar DropIndexCall = class extends MysqlOpFactoryCallNode {\n\ttableName;\n\tindexName;\n\tfactoryName = \"dropIndex\";\n\toperationClass = \"widening\";\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\ttoOp() {\n\t\tconst index = indexChecks(this.tableName, this.indexName);\n\t\treturn {\n\t\t\tid: `dropIndex.${this.tableName}.${this.indexName}`,\n\t\t\tlabel: this.label,\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: \"mysql\",\n\t\t\t\tdetails: buildTargetDetails(\"index\", this.indexName, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [index.present(`ensure index \"${this.indexName}\" exists`)],\n\t\t\texecute: [step(`drop index \"${this.indexName}\"`, `DROP INDEX ${quoteIdentifier(this.indexName)} ON ${quoteIdentifier(this.tableName)}`)],\n\t\t\tpostcheck: [index.absent(`verify index \"${this.indexName}\" is gone`)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.dropIndex({ table: ${jsonToTsSource(this.tableName)}, index: ${jsonToTsSource(this.indexName)} })`;\n\t}\n};\nvar AddUniqueCall = class extends MysqlOpFactoryCallNode {\n\ttableName;\n\tconstraintName;\n\tcolumns;\n\tfactoryName = \"addUnique\";\n\toperationClass = \"additive\";\n\tlabel;\n\tconstructor(tableName, constraintName, columns) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.constraintName = constraintName;\n\t\tthis.columns = columns;\n\t\tthis.label = `Add unique constraint ${constraintName} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\tconst constraint = constraintChecks(this.tableName, this.constraintName, \"UNIQUE\");\n\t\treturn {\n\t\t\tid: `unique.${this.tableName}.${this.constraintName}`,\n\t\t\tlabel: this.label,\n\t\t\tsummary: `Adds unique constraint ${this.constraintName} on ${this.tableName}`,\n\t\t\toperationClass: \"additive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"mysql\",\n\t\t\t\tdetails: buildTargetDetails(\"unique\", this.constraintName, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [constraint.absent(`ensure unique constraint \"${this.constraintName}\" is missing`)],\n\t\t\texecute: [step(`add unique constraint \"${this.constraintName}\"`, `ALTER TABLE ${quoteIdentifier(this.tableName)} ADD CONSTRAINT ${quoteIdentifier(this.constraintName)} UNIQUE (${columnList(this.columns)})`)],\n\t\t\tpostcheck: [constraint.present(`verify unique constraint \"${this.constraintName}\" exists`)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.addUnique({ table: ${jsonToTsSource(this.tableName)}, name: ${jsonToTsSource(this.constraintName)}, columns: ${jsonToTsSource(this.columns)} })`;\n\t}\n};\nvar DropUniqueCall = class extends MysqlOpFactoryCallNode {\n\ttableName;\n\tconstraintName;\n\tfactoryName = \"dropUnique\";\n\toperationClass = \"widening\";\n\tlabel;\n\tconstructor(tableName, constraintName) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.constraintName = constraintName;\n\t\tthis.label = `Drop unique constraint ${constraintName} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\tconst constraint = constraintChecks(this.tableName, this.constraintName, \"UNIQUE\");\n\t\treturn {\n\t\t\tid: `dropUnique.${this.tableName}.${this.constraintName}`,\n\t\t\tlabel: this.label,\n\t\t\tsummary: `Drops unique constraint ${this.constraintName} on ${this.tableName} which is not in the contract`,\n\t\t\toperationClass: \"widening\",\n\t\t\ttarget: {\n\t\t\t\tid: \"mysql\",\n\t\t\t\tdetails: buildTargetDetails(\"unique\", this.constraintName, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [constraint.present(`ensure unique constraint \"${this.constraintName}\" exists`)],\n\t\t\texecute: [step(`drop unique constraint \"${this.constraintName}\"`, `ALTER TABLE ${quoteIdentifier(this.tableName)} DROP INDEX ${quoteIdentifier(this.constraintName)}`)],\n\t\t\tpostcheck: [constraint.absent(`verify unique constraint \"${this.constraintName}\" is gone`)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.dropUnique({ table: ${jsonToTsSource(this.tableName)}, name: ${jsonToTsSource(this.constraintName)} })`;\n\t}\n};\nvar AddForeignKeyCall = class extends MysqlOpFactoryCallNode {\n\ttableName;\n\tforeignKey;\n\tfactoryName = \"addForeignKey\";\n\toperationClass = \"additive\";\n\tlabel;\n\tconstructor(tableName, foreignKey) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.foreignKey = foreignKey;\n\t\tthis.label = `Add foreign key ${foreignKey.name} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\tconst { name, columns, references } = this.foreignKey;\n\t\tconst constraint = constraintChecks(this.tableName, name, \"FOREIGN KEY\");\n\t\treturn {\n\t\t\tid: `foreignKey.${this.tableName}.${name}`,\n\t\t\tlabel: this.label,\n\t\t\tsummary: `Adds foreign key ${name} on ${this.tableName} referencing ${references.table}`,\n\t\t\toperationClass: \"additive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"mysql\",\n\t\t\t\tdetails: buildTargetDetails(\"foreignKey\", name, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [constraint.absent(`ensure foreign key \"${name}\" is missing`)],\n\t\t\texecute: [step(`add foreign key \"${name}\"`, `ALTER TABLE ${quoteIdentifier(this.tableName)} ADD CONSTRAINT ${quoteIdentifier(name)} FOREIGN KEY (${columnList(columns)}) REFERENCES ${quoteIdentifier(references.table)} (${columnList(references.columns)})${foreignKeyActionsSql(this.foreignKey)}`)],\n\t\t\tpostcheck: [constraint.present(`verify foreign key \"${name}\" exists`)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\tconst { name, columns, references, onDelete, onUpdate } = this.foreignKey;\n\t\treturn `this.addForeignKey({ ${[\n\t\t\t`table: ${jsonToTsSource(this.tableName)}`,\n\t\t\t`name: ${jsonToTsSource(name)}`,\n\t\t\t`columns: ${jsonToTsSource(columns)}`,\n\t\t\t`references: ${jsonToTsSource(references)}`,\n\t\t\t...onDelete === void 0 ? [] : [`onDelete: ${jsonToTsSource(onDelete)}`],\n\t\t\t...onUpdate === void 0 ? [] : [`onUpdate: ${jsonToTsSource(onUpdate)}`]\n\t\t].join(\", \")} })`;\n\t}\n};\nvar DropForeignKeyCall = class extends MysqlOpFactoryCallNode {\n\ttableName;\n\tconstraintName;\n\tfactoryName = \"dropForeignKey\";\n\toperationClass = \"widening\";\n\tlabel;\n\tconstructor(tableName, constraintName) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.constraintName = constraintName;\n\t\tthis.label = `Drop foreign key ${constraintName} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\tconst constraint = constraintChecks(this.tableName, this.constraintName, \"FOREIGN KEY\");\n\t\treturn {\n\t\t\tid: `dropForeignKey.${this.tableName}.${this.constraintName}`,\n\t\t\tlabel: this.label,\n\t\t\tsummary: `Drops foreign key ${this.constraintName} on ${this.tableName} which is not in the contract`,\n\t\t\toperationClass: \"widening\",\n\t\t\ttarget: {\n\t\t\t\tid: \"mysql\",\n\t\t\t\tdetails: buildTargetDetails(\"foreignKey\", this.constraintName, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [constraint.present(`ensure foreign key \"${this.constraintName}\" exists`)],\n\t\t\texecute: [step(`drop foreign key \"${this.constraintName}\"`, `ALTER TABLE ${quoteIdentifier(this.tableName)} DROP FOREIGN KEY ${quoteIdentifier(this.constraintName)}`)],\n\t\t\tpostcheck: [constraint.absent(`verify foreign key \"${this.constraintName}\" is gone`)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.dropForeignKey({ table: ${jsonToTsSource(this.tableName)}, name: ${jsonToTsSource(this.constraintName)} })`;\n\t}\n};\n/** An operation built elsewhere, such as the table rename a user writes by hand, carried as it is and written as `rawSql({...})`. */\nvar RawSqlCall = class extends MysqlOpFactoryCallNode {\n\top;\n\tfactoryName = \"rawSql\";\n\toperationClass;\n\tlabel;\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() {\n\t\treturn this.op;\n\t}\n\trenderTypeScript() {\n\t\treturn `rawSql(${jsonToTsSource(this.op)})`;\n\t}\n\timportRequirements() {\n\t\treturn [{\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: \"rawSql\"\n\t\t}];\n\t}\n};\n/** The table rename a user writes by hand on MySQL, which the planner does not plan yet. */\nfunction renameTableByHandOp(from, to) {\n\tconst fromTable = tableChecks(from);\n\tconst toTable = tableChecks(to);\n\treturn {\n\t\tid: `renameTable.${from}`,\n\t\tlabel: `Rename table ${from} to ${to}`,\n\t\toperationClass: \"widening\",\n\t\ttarget: {\n\t\t\tid: \"mysql\",\n\t\t\tdetails: buildTargetDetails(\"table\", to)\n\t\t},\n\t\tprecheck: [fromTable.present(`ensure table \"${from}\" exists`), toTable.absent(`ensure table \"${to}\" does not exist`)],\n\t\texecute: [step(`rename table \"${from}\" to \"${to}\"`, `RENAME TABLE ${quoteIdentifier(from)} TO ${quoteIdentifier(to)}`)],\n\t\tpostcheck: [toTable.present(`verify table \"${to}\" exists`), fromTable.absent(`verify table \"${from}\" no longer exists`)]\n\t};\n}\nfunction foreignKeySpecOf(fk, table) {\n\treturn {\n\t\tname: fk.name ?? `${table}_${fk.columns.join(\"_\")}_fkey`,\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...ifDefined(\"onDelete\", fk.onDelete),\n\t\t...ifDefined(\"onUpdate\", fk.onUpdate)\n\t};\n}\n//#endregion\n//#region src/core/migrations/issue-planner.ts\n/**\n* Drops each issue under a missing or extra node: the call for a table or column accounts for everything beneath it.\n*/\nfunction coalesceSubtreeIssues(issues) {\n\tconst collapsing = issues.filter((issue) => {\n\t\tconst outcome = issueOutcome(issue);\n\t\treturn outcome === \"not-found\" || outcome === \"not-expected\";\n\t}).map((issue) => issue.path);\n\treturn issues.filter((issue) => !collapsing.some((ancestor) => issue.path.length > ancestor.length && ancestor.every((segment, index) => issue.path[index] === segment)));\n}\nfunction issueNode(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\treturn node === void 0 ? void 0 : blindCast(node);\n}\nfunction expectedNode(issue) {\n\treturn blindCast(issue.expected);\n}\nfunction actualNode(issue) {\n\treturn blindCast(issue.actual);\n}\nfunction location(table, column) {\n\treturn {\n\t\tentityKind: \"table\",\n\t\t...table === void 0 ? {} : { entityName: table },\n\t\t...column === void 0 ? {} : { column }\n\t};\n}\nfunction placeOf(issue, at) {\n\tif (at?.entityName === void 0) return issue.path.slice(1).join(\".\");\n\treturn at.column === void 0 ? at.entityName : `${at.entityName}.${at.column}`;\n}\n/** The conflict for a change the MySQL planner does not plan yet. */\nfunction notYetSupported(kind, change, issue, conflictLocation) {\n\treturn {\n\t\tkind,\n\t\tsummary: `${change} is not yet supported on MySQL (${placeOf(issue, conflictLocation)})`,\n\t\twhy: \"The MySQL planner creates and drops tables, columns, indexes, unique constraints and foreign keys; it does not change a column, a default, a primary key or a CHECK constraint yet. Use `migration new` to write this change by hand.\",\n\t\t...conflictLocation === void 0 ? {} : { location: conflictLocation }\n\t};\n}\nfunction createTableCalls(table) {\n\treturn [\n\t\tnew CreateTableCall(table.name, Object.values(table.columns).map(ddlColumnFromNode), tableConstraintsFromNode(table)),\n\t\t...table.indexes.flatMap((index) => index.columns === void 0 ? [] : [new CreateIndexCall(table.name, index.name, index.columns, index.unique)]),\n\t\t...table.foreignKeys.map((fk) => new AddForeignKeyCall(table.name, foreignKeySpecOf(fk, table.name)))\n\t];\n}\nfunction mapTableIssue(issue) {\n\tswitch (issueOutcome(issue)) {\n\t\tcase \"not-found\": {\n\t\t\tconst table = expectedNode(issue);\n\t\t\treturn table.indexes.find((index) => index.columns === void 0) === void 0 ? ok(createTableCalls(table)) : notOk(notYetSupported(\"indexIncompatible\", \"An expression index\", issue, location(table.name)));\n\t\t}\n\t\tcase \"not-expected\": {\n\t\t\tconst table = actualNode(issue);\n\t\t\treturn ok(CONTROL_TABLE_NAMES.has(table.name) ? [] : [new DropTableCall(table.name)]);\n\t\t}\n\t\tdefault: return notOk(notYetSupported(\"unsupportedOperation\", \"Changing a table\", issue));\n\t}\n}\nfunction mapColumnIssue(issue, table) {\n\tswitch (issueOutcome(issue)) {\n\t\tcase \"not-found\": {\n\t\t\tconst column = expectedNode(issue);\n\t\t\tconst columnDefault = columnDefaultOf(column);\n\t\t\treturn column.nullable || columnDefault !== void 0 && !(columnDefault.kind === \"function\" && columnDefault.expression === \"autoincrement()\") ? ok([new AddColumnCall(table, ddlColumnFromNode(column))]) : notOk(notYetSupported(\"nullabilityConflict\", \"Adding a required column without a default\", issue, location(table, column.name)));\n\t\t}\n\t\tcase \"not-expected\": return ok([new DropColumnCall(table, actualNode(issue).name)]);\n\t\tdefault: {\n\t\t\tconst expected = expectedNode(issue);\n\t\t\tconst typesEqual = sqlColumnTypesEqual(expected, actualNode(issue));\n\t\t\treturn notOk(notYetSupported(typesEqual ? \"nullabilityConflict\" : \"typeMismatch\", typesEqual ? \"Changing a column's nullability\" : \"Changing a column's type\", issue, location(table, expected.name)));\n\t\t}\n\t}\n}\nfunction mapIndexIssue(issue, table) {\n\tswitch (issueOutcome(issue)) {\n\t\tcase \"not-found\": {\n\t\t\tconst index = expectedNode(issue);\n\t\t\treturn index.columns === void 0 ? notOk(notYetSupported(\"indexIncompatible\", \"An expression index\", issue, location(table))) : ok([new CreateIndexCall(table, index.name, index.columns, index.unique)]);\n\t\t}\n\t\tcase \"not-expected\": return ok([new DropIndexCall(table, actualNode(issue).name)]);\n\t\tdefault: return notOk(notYetSupported(\"indexIncompatible\", \"Changing an index\", issue, location(table)));\n\t}\n}\nfunction mapUniqueIssue(issue, table) {\n\tswitch (issueOutcome(issue)) {\n\t\tcase \"not-found\": {\n\t\t\tconst unique = expectedNode(issue);\n\t\t\treturn ok([new AddUniqueCall(table, uniqueName(table, unique), unique.columns)]);\n\t\t}\n\t\tcase \"not-expected\": return ok([new DropUniqueCall(table, uniqueName(table, actualNode(issue)))]);\n\t\tdefault: return notOk(notYetSupported(\"indexIncompatible\", \"Changing a unique constraint\", issue, location(table)));\n\t}\n}\nfunction mapForeignKeyIssue(issue, table) {\n\tswitch (issueOutcome(issue)) {\n\t\tcase \"not-found\": return ok([new AddForeignKeyCall(table, foreignKeySpecOf(expectedNode(issue), table))]);\n\t\tcase \"not-expected\": return ok([new DropForeignKeyCall(table, foreignKeySpecOf(actualNode(issue), table).name)]);\n\t\tdefault: return notOk(notYetSupported(\"foreignKeyConflict\", \"Changing a foreign key\", issue, location(table)));\n\t}\n}\nfunction mapIssueToCalls(issue) {\n\tconst node = issueNode(issue);\n\tconst table = issue.path[1];\n\tif (node === void 0) return notOk(notYetSupported(\"unsupportedOperation\", \"A change with no node\", issue));\n\tif (node.nodeKind === RelationalSchemaNodeKind.table) return mapTableIssue(issue);\n\tif (table === void 0) return notOk(notYetSupported(\"unsupportedOperation\", `A ${node.nodeKind} change`, issue));\n\tswitch (node.nodeKind) {\n\t\tcase RelationalSchemaNodeKind.column: return mapColumnIssue(issue, table);\n\t\tcase RelationalSchemaNodeKind.index: return mapIndexIssue(issue, table);\n\t\tcase RelationalSchemaNodeKind.unique: return mapUniqueIssue(issue, table);\n\t\tcase RelationalSchemaNodeKind.foreignKey: return mapForeignKeyIssue(issue, table);\n\t\tcase RelationalSchemaNodeKind.columnDefault: return notOk(notYetSupported(\"unsupportedOperation\", \"Changing a column's default\", issue, location(table)));\n\t\tcase RelationalSchemaNodeKind.primaryKey: return notOk(notYetSupported(\"indexIncompatible\", \"Changing a primary key\", issue, location(table)));\n\t\tcase RelationalSchemaNodeKind.check: return notOk(notYetSupported(\"unsupportedOperation\", \"A CHECK constraint\", issue, location(table)));\n\t\tdefault: return notOk(notYetSupported(\"unsupportedOperation\", `A ${node.nodeKind} change`, issue));\n\t}\n}\n/**\n* The order calls run in: foreign keys are dropped before the tables, columns and indexes they use, and added after every table, column and index they need exists. The index InnoDB made for a dropped key is dropped right after the key, before any key is added, so a new key on the same columns makes its own.\n*/\nconst CALL_ORDER = [\n\t\"dropForeignKey\",\n\t\"createTable\",\n\t\"addColumn\",\n\t\"addUnique\",\n\t\"createIndex\",\n\t\"addForeignKey\",\n\t\"dropUnique\",\n\t\"dropIndex\",\n\t\"dropColumn\",\n\t\"dropTable\",\n\t\"rawSql\"\n];\nfunction locationOfCall(call) {\n\treturn \"tableName\" in call ? {\n\t\tentityKind: \"table\",\n\t\tentityName: call.tableName,\n\t\t...\"columnName\" in call ? { column: call.columnName } : {},\n\t\t...\"indexName\" in call ? { index: call.indexName } : {}\n\t} : void 0;\n}\nfunction conflictForDisallowedCall(call, allowed) {\n\tconst callLocation = locationOfCall(call);\n\treturn {\n\t\tkind: call instanceof CreateIndexCall || call instanceof DropIndexCall ? \"indexIncompatible\" : \"missingButNonAdditive\",\n\t\tsummary: `Operation \"${call.label}\" requires class \"${call.operationClass}\", but policy allows only: ${allowed.join(\", \")}`,\n\t\twhy: \"Use `migration new` to author a custom migration for this change.\",\n\t\trefusedOperationClass: call.operationClass,\n\t\t...callLocation === void 0 ? {} : { location: callLocation }\n\t};\n}\nconst MAX_IDENTIFIER_CHARACTERS = 64;\n/** The names a call gives new objects, each with where the conflict that refuses it points. */\nfunction namesGiven(call) {\n\tif (call instanceof CreateTableCall) return [\n\t\t{\n\t\t\tname: call.tableName,\n\t\t\tat: location(call.tableName)\n\t\t},\n\t\t...call.columns.map((column) => ({\n\t\t\tname: column.name,\n\t\t\tat: location(call.tableName, column.name)\n\t\t})),\n\t\t...call.constraints.flatMap((constraint) => constraint.name === void 0 ? [] : [{\n\t\t\tname: constraint.name,\n\t\t\tat: {\n\t\t\t\t...location(call.tableName),\n\t\t\t\tconstraint: constraint.name\n\t\t\t}\n\t\t}])\n\t];\n\tif (call instanceof AddColumnCall) return [{\n\t\tname: call.column.name,\n\t\tat: location(call.tableName, call.column.name)\n\t}];\n\tif (call instanceof CreateIndexCall) return [{\n\t\tname: call.indexName,\n\t\tat: {\n\t\t\t...location(call.tableName),\n\t\t\tindex: call.indexName\n\t\t}\n\t}];\n\tif (call instanceof AddUniqueCall) return [{\n\t\tname: call.constraintName,\n\t\tat: {\n\t\t\t...location(call.tableName),\n\t\t\tconstraint: call.constraintName\n\t\t}\n\t}];\n\tif (call instanceof AddForeignKeyCall) return [{\n\t\tname: call.foreignKey.name,\n\t\tat: {\n\t\t\t...location(call.tableName),\n\t\t\tconstraint: call.foreignKey.name\n\t\t}\n\t}];\n\treturn [];\n}\nfunction placeText(at) {\n\treturn at.column === void 0 ? `${at.entityName}` : `${at.entityName}.${at.column}`;\n}\n/** MySQL refuses a name longer than 64 characters only when the statement runs, after the statements before it committed, so the planner refuses it first. */\nfunction longNameConflicts(call) {\n\treturn namesGiven(call).filter(({ name }) => Array.from(name).length > MAX_IDENTIFIER_CHARACTERS).map(({ name, at }) => ({\n\t\tkind: \"unsupportedOperation\",\n\t\tsummary: `The name ${name} is longer than the ${MAX_IDENTIFIER_CHARACTERS} characters MySQL allows (${placeText(at)})`,\n\t\twhy: `MySQL refuses a table, column, index or constraint name longer than ${MAX_IDENTIFIER_CHARACTERS} characters. Give it a shorter name in the contract.`,\n\t\tlocation: at\n\t}));\n}\nfunction isAutoincrement(column) {\n\treturn column.default?.kind === \"function\" && column.default.expression.text === \"autoincrement()\";\n}\n/** MySQL refuses a table whose `AUTO_INCREMENT` column does not lead a key, so the planner refuses it first. */\nfunction autoincrementKeyConflicts(call) {\n\tif (!(call instanceof CreateTableCall)) return [];\n\tconst keyLeaders = new Set(call.constraints.flatMap((constraint) => constraint.kind === \"primary-key\" || constraint.kind === \"unique\" ? constraint.columns.slice(0, 1) : []));\n\treturn call.columns.filter((column) => isAutoincrement(column) && !column.primaryKey && !keyLeaders.has(column.name)).map((column) => ({\n\t\tkind: \"unsupportedOperation\",\n\t\tsummary: `An autoincrement column that is not the first column of the primary key or a unique constraint is not supported on MySQL (${call.tableName}.${column.name})`,\n\t\twhy: \"MySQL requires an AUTO_INCREMENT column to be the first column of a key, and refuses the table otherwise.\",\n\t\tlocation: location(call.tableName, column.name)\n\t}));\n}\n/** Whether an index on `indexColumns` can serve a foreign key on `keyColumns`: InnoDB needs the key's columns first, in order. */\nfunction servesKey(indexColumns, keyColumns) {\n\treturn keyColumns.length <= indexColumns.length && keyColumns.every((column, position) => indexColumns[position] === column);\n}\nfunction indexColumnLists(table, leaving) {\n\treturn [\n\t\t...table.primaryKey === void 0 ? [] : [table.primaryKey.columns],\n\t\t...table.uniques.flatMap((unique) => uniqueName(table.name, unique) === leaving ? [] : [unique.columns]),\n\t\t...table.indexes.flatMap((index) => index.name === leaving || index.columns === void 0 ? [] : [index.columns])\n\t];\n}\nfunction isKeyServed(table, keyColumns, leaving) {\n\treturn indexColumnLists(table, leaving).some((columns) => servesKey(columns, keyColumns));\n}\n/**\n* When a foreign key is dropped and no other index served it, InnoDB made an index of its own, with the key's name, and keeps it after the key is gone. Introspection leaves that index out while the key exists, so it is dropped with the key unless the destination keeps an index of that name.\n*/\nfunction innoDbIndexDrops(calls, expected, actual) {\n\treturn calls.flatMap((call) => {\n\t\tif (!(call instanceof DropForeignKeyCall)) return [];\n\t\tconst before = actual.tables[call.tableName];\n\t\tconst after = expected.tables[call.tableName];\n\t\tconst key = before?.foreignKeys.find((fk) => foreignKeySpecOf(fk, call.tableName).name === call.constraintName);\n\t\tif (before === void 0 || after === void 0 || key === void 0) return [];\n\t\tif (isKeyServed(before, key.columns)) return [];\n\t\tif (after.indexes.some((index) => index.name === call.constraintName)) return [];\n\t\treturn [{\n\t\t\tcall: new DropIndexCall(call.tableName, call.constraintName),\n\t\t\tindexName: call.constraintName,\n\t\t\tcolumns: key.columns\n\t\t}];\n\t});\n}\nfunction droppedIndexes(calls, actual) {\n\treturn calls.flatMap((call) => {\n\t\tconst table = \"tableName\" in call ? actual.tables[call.tableName] : void 0;\n\t\tif (table === void 0) return [];\n\t\tif (call instanceof DropIndexCall) {\n\t\t\tconst index = table.indexes.find(({ name }) => name === call.indexName);\n\t\t\treturn index?.columns === void 0 ? [] : [{\n\t\t\t\tcall,\n\t\t\t\tindexName: call.indexName,\n\t\t\t\tcolumns: index.columns\n\t\t\t}];\n\t\t}\n\t\tif (call instanceof DropUniqueCall) {\n\t\t\tconst unique = table.uniques.find((candidate) => uniqueName(table.name, candidate) === call.constraintName);\n\t\t\treturn unique === void 0 ? [] : [{\n\t\t\t\tcall,\n\t\t\t\tindexName: call.constraintName,\n\t\t\t\tcolumns: unique.columns\n\t\t\t}];\n\t\t}\n\t\treturn [];\n\t});\n}\n/**\n* A dropped index that one of `protectedKeys` uses, when no index the destination keeps can take over: MySQL refuses that drop.\n*/\nfunction conflictForIndexAKeyUses(dropped, expected, protectedKeys) {\n\tconst tableName = dropped.call.tableName;\n\tconst table = expected.tables[tableName];\n\tconst key = table?.foreignKeys.find((fk) => protectedKeys(tableName, fk) && servesKey(dropped.columns, fk.columns) && !isKeyServed(table, fk.columns, dropped.indexName));\n\tif (key === void 0) return void 0;\n\treturn {\n\t\tkind: \"indexIncompatible\",\n\t\tsummary: `Dropping index ${dropped.indexName}, which foreign key ${foreignKeySpecOf(key, tableName).name} uses, is not yet supported on MySQL (${tableName})`,\n\t\twhy: \"MySQL refuses to drop an index a foreign key uses. Keep an index whose first columns are the foreign key's columns, or use `migration new` to drop the foreign key, drop the index and add the foreign key again.\",\n\t\tlocation: {\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: tableName,\n\t\t\tindex: dropped.indexName\n\t\t}\n\t};\n}\n/** The calls that turn `actual` into `expected` for `issues`, in the order they run, or the conflicts that stop the plan. */\nfunction planIssues(input) {\n\tconst calls = [];\n\tconst conflicts = [];\n\tconst allowed = input.policy.allowedOperationClasses;\n\tfor (const issue of orderIssuesByDependencies(input.issues)) {\n\t\tconst mapped = mapIssueToCalls(issue);\n\t\tif (!mapped.ok) {\n\t\t\tconflicts.push(mapped.failure);\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const call of mapped.value) {\n\t\t\tconflicts.push(...longNameConflicts(call), ...autoincrementKeyConflicts(call));\n\t\t\tif (allowed.includes(call.operationClass)) calls.push(call);\n\t\t\telse conflicts.push(conflictForDisallowedCall(call, allowed));\n\t\t}\n\t}\n\tconst droppedKeys = new Set(calls.flatMap((call) => call instanceof DropForeignKeyCall ? [`${call.tableName}.${call.constraintName}`] : []));\n\tconst isKeptKey = (tableName, fk) => !droppedKeys.has(`${tableName}.${foreignKeySpecOf(fk, tableName).name}`);\n\tfor (const dropped of droppedIndexes(calls, input.actual)) {\n\t\tconst conflict = conflictForIndexAKeyUses(dropped, input.expected, () => true);\n\t\tif (conflict !== void 0) conflicts.push(conflict);\n\t}\n\tconst innoDbIndexes = innoDbIndexDrops(calls, input.expected, input.actual);\n\tfor (const dropped of innoDbIndexes) {\n\t\tconst conflict = conflictForIndexAKeyUses(dropped, input.expected, isKeptKey);\n\t\tif (conflict !== void 0) conflicts.push(conflict);\n\t\tif (!allowed.includes(dropped.call.operationClass)) conflicts.push(conflictForDisallowedCall(dropped.call, allowed));\n\t}\n\tif (conflicts.length > 0) return notOk(conflicts);\n\tconst inOrder = (factoryName) => calls.filter((call) => call.factoryName === factoryName);\n\treturn ok([\n\t\t...inOrder(\"dropForeignKey\"),\n\t\t...innoDbIndexes.map(({ call }) => call),\n\t\t...CALL_ORDER.filter((factoryName) => factoryName !== \"dropForeignKey\").flatMap(inOrder)\n\t]);\n}\n//#endregion\n//#region src/core/migrations/mysql-migration.ts\n/**\n* The base class of a MySQL `migration.ts`. Each protected method returns the operation its name says, rendered through the MySQL control adapter the migration CLI builds from `prisma.config.ts`.\n*/\nvar MysqlMigration = class extends Migration {\n\ttargetId = \"mysql\";\n\tcontrolAdapter;\n\tconstructor(stack) {\n\t\tsuper(stack);\n\t\tthis.controlAdapter = stack?.adapter === void 0 ? void 0 : blindCast(stack.adapter.create(stack));\n\t}\n\tadapterFor(operation) {\n\t\tif (this.controlAdapter === void 0) throw mysqlMigrationStackMissing(operation);\n\t\treturn this.controlAdapter;\n\t}\n\tcreateTable(options) {\n\t\treturn new CreateTableCall(options.table, options.columns, options.constraints ?? []).toOp(this.adapterFor(\"createTable\"));\n\t}\n\tdropTable(options) {\n\t\treturn new DropTableCall(options.table).toOp();\n\t}\n\taddColumn(options) {\n\t\treturn new AddColumnCall(options.table, options.column).toOp(this.adapterFor(\"addColumn\"));\n\t}\n\tdropColumn(options) {\n\t\treturn new DropColumnCall(options.table, options.column).toOp();\n\t}\n\tcreateIndex(options) {\n\t\treturn new CreateIndexCall(options.table, options.index, options.columns, options.unique === true).toOp();\n\t}\n\tdropIndex(options) {\n\t\treturn new DropIndexCall(options.table, options.index).toOp();\n\t}\n\taddUnique(options) {\n\t\treturn new AddUniqueCall(options.table, options.name, options.columns).toOp();\n\t}\n\tdropUnique(options) {\n\t\treturn new DropUniqueCall(options.table, options.name).toOp();\n\t}\n\taddForeignKey(options) {\n\t\treturn new AddForeignKeyCall(options.table, {\n\t\t\tname: options.name,\n\t\t\tcolumns: options.columns,\n\t\t\treferences: options.references,\n\t\t\t...ifDefined(\"onDelete\", options.onDelete),\n\t\t\t...ifDefined(\"onUpdate\", options.onUpdate)\n\t\t}).toOp();\n\t}\n\tdropForeignKey(options) {\n\t\treturn new DropForeignKeyCall(options.table, options.name).toOp();\n\t}\n};\n//#endregion\n//#region src/core/migrations/render-ops.ts\nfunction assertMysqlOp(op, factoryName) {\n\tconst targetId = blindCast(op).target?.id;\n\tif (targetId !== \"mysql\") throw new InternalError(`renderOps: expected a mysql operation but got target.id=\"${String(targetId)}\" for op.id=\"${op.id}\" (factoryName=\"${factoryName}\").`);\n}\nfunction checkedOp(opOrPromise, factoryName) {\n\tif (isThenable(opOrPromise)) {\n\t\tconst checked = opOrPromise.then((op) => {\n\t\t\tassertMysqlOp(op, factoryName);\n\t\t\treturn op;\n\t\t});\n\t\tchecked.catch(() => void 0);\n\t\treturn checked;\n\t}\n\tassertMysqlOp(opOrPromise, factoryName);\n\treturn opOrPromise;\n}\n/** The operations `calls` lower to, in order, each checked to be a MySQL operation. */\nfunction renderOps(calls, lowerer) {\n\treturn calls.map((call) => checkedOp(isMysqlOpFactoryCall(call) ? call.toOp(lowerer) : blindCast(call).toOp(lowerer), call.factoryName));\n}\n//#endregion\n//#region src/core/migrations/render-typescript.ts\n/** The base class and the CLI entrypoint every scaffold imports, both from the MySQL facade's `migration` module. */\nconst BASE_IMPORTS = [{\n\tmoduleSpecifier: \"@internal/mysql/migration\",\n\tsymbol: \"Migration\"\n}, {\n\tmoduleSpecifier: \"@internal/mysql/migration\",\n\tsymbol: \"MigrationCLI\"\n}];\nfunction renderCallsToTypeScript(calls, meta) {\n\tconst imports = buildImports(calls, meta);\n\tconst operationsBody = calls.map((c) => c.renderTypeScript()).join(\",\\n\");\n\tconst hasStart = meta.from !== null;\n\tconst startField = hasStart ? [\" override readonly startContractJson = startContract;\"] : [];\n\treturn [\n\t\tshebangLineFor(detectScaffoldRuntime()),\n\t\timports,\n\t\t\"\",\n\t\t`export default class M extends Migration<${hasStart ? \"Start\" : \"never\"}, End> {`,\n\t\t...startField,\n\t\t\" override readonly endContractJson = endContract;\",\n\t\t\"\",\n\t\t\" override get operations() {\",\n\t\t\" return [\",\n\t\tindent(operationsBody, 6),\n\t\t\" ];\",\n\t\t\" }\",\n\t\t\"}\",\n\t\t\"\",\n\t\t\"MigrationCLI.run(import.meta.url, M);\",\n\t\t\"\"\n\t].join(\"\\n\");\n}\nfunction buildImports(calls, meta) {\n\tconst requirements = [...BASE_IMPORTS, ...contractImports(meta)];\n\tfor (const call of calls) for (const req of call.importRequirements()) requirements.push(req);\n\treturn renderImports(resolveRequirementSpecifiers(requirements, meta.resolveImportSpecifier));\n}\nfunction contractImports(meta) {\n\tconst reqs = [{\n\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"endContract\",\n\t\tkind: \"default\",\n\t\tattributes: { type: \"json\" }\n\t}, {\n\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"Contract\",\n\t\talias: \"End\",\n\t\ttypeOnly: true\n\t}];\n\tif (meta.from !== null) {\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"startContract\",\n\t\t\tkind: \"default\",\n\t\t\tattributes: { type: \"json\" }\n\t\t});\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"Contract\",\n\t\t\talias: \"Start\",\n\t\t\ttypeOnly: true\n\t\t});\n\t}\n\treturn reqs;\n}\nfunction indent(text, spaces) {\n\tconst pad = \" \".repeat(spaces);\n\treturn text.split(\"\\n\").map((line) => line.trim() ? `${pad}${line}` : line).join(\"\\n\");\n}\n//#endregion\n//#region src/core/migrations/planner-produced-mysql-migration.ts\n/** The plan the MySQL planner produces: its operations, and the `migration.ts` that writes them. */\nvar TypeScriptRenderableMysqlMigration = class extends MysqlMigration {\n\t#calls;\n\t#meta;\n\t#destination;\n\t#spaceId;\n\t#snapshotsImportPath;\n\t#lowerer;\n\t#operationsCache;\n\tconstructor(options) {\n\t\tsuper();\n\t\tthis.#calls = options.calls;\n\t\tthis.#meta = options.meta;\n\t\tthis.#spaceId = options.spaceId;\n\t\tthis.#snapshotsImportPath = options.snapshotsImportPath;\n\t\tthis.#destination = options.destination ?? { storageHash: options.meta.to };\n\t\tthis.#lowerer = options.lowerer;\n\t}\n\tget operations() {\n\t\tthis.#operationsCache ??= renderOps(this.#calls, this.#lowerer);\n\t\treturn this.#operationsCache;\n\t}\n\tdescribe() {\n\t\treturn this.#meta;\n\t}\n\tget destination() {\n\t\treturn this.#destination;\n\t}\n\tget spaceId() {\n\t\treturn this.#spaceId;\n\t}\n\trenderTypeScript(resolveImportSpecifier) {\n\t\treturn renderCallsToTypeScript(this.#calls, {\n\t\t\tfrom: this.#meta.from,\n\t\t\tto: this.#meta.to,\n\t\t\tsnapshotsImportPath: this.#snapshotsImportPath,\n\t\t\tresolveImportSpecifier\n\t\t});\n\t}\n};\n//#endregion\n//#region src/core/migrations/planner.ts\nconst mysqlTableRenameByHand = {\n\trenderTableRename: (rename) => new RawSqlCall(renameTableByHandOp(rename.from, rename.to)).renderTypeScript(),\n\ttableRenameByHand: (rename) => [`RENAME TABLE ${quoteIdentifier(rename.from)} TO ${quoteIdentifier(rename.to)}`]\n};\nfunction tableTarget(table, column) {\n\treturn {\n\t\tstorageName: column === void 0 ? table : `${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 callSubjects(call) {\n\tconst dataLoss = call instanceof DropTableCall ? [{\n\t\t...tableTarget(call.tableName),\n\t\tloss: \"drop\"\n\t}] : call instanceof DropColumnCall ? [{\n\t\t...tableTarget(call.tableName, call.columnName),\n\t\tloss: \"drop\"\n\t}] : [];\n\treturn {\n\t\toperationCount: 1,\n\t\tlabel: call.label,\n\t\tdataLoss,\n\t\taccessChanges: [],\n\t\ttemporaryValues: []\n\t};\n}\n/** Whether `issue` is an extra table some contract space owns, which this space must leave alone. */\nfunction isTableOwnedElsewhere(issue, ownership) {\n\tif (issueOutcome(issue) !== \"not-expected\") return false;\n\tif (issueNode(issue)?.nodeKind !== RelationalSchemaNodeKind.table) return false;\n\tconst table = issue.path[1];\n\treturn table !== void 0 && ownership.declaresEntity({\n\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\tentityKind: \"table\",\n\t\tentityName: table\n\t});\n}\n/**\n* The MySQL migration planner. It diffs the contract's schema against the live one and plans creating and dropping tables, columns, indexes, unique constraints and foreign keys. Every other change, and every statement such as a rename, is refused with a conflict that says it is not yet supported on MySQL.\n*/\nvar MysqlMigrationPlanner = class {\n\t#lowerer;\n\tconstructor(lowerer) {\n\t\tthis.#lowerer = lowerer;\n\t}\n\tplan(options) {\n\t\treturn this.#planSql(blindCast(options));\n\t}\n\temptyMigration(context, spaceId) {\n\t\treturn new TypeScriptRenderableMysqlMigration({\n\t\t\tcalls: [],\n\t\t\tmeta: {\n\t\t\t\tfrom: context.fromHash,\n\t\t\t\tto: context.toHash\n\t\t\t},\n\t\t\tspaceId,\n\t\t\tsnapshotsImportPath: context.snapshotsImportPath,\n\t\t\tlowerer: this.#lowerer\n\t\t});\n\t}\n\t#planSql(options) {\n\t\tif (!options.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\tconst [statement] = options.statements;\n\t\tif (statement !== void 0) return plannerFailure([statementNotYetSupported(statement)]);\n\t\tif (!(options.schema instanceof SqlSchemaIR)) throw mysqlError(\"CONTRACT.TARGET_MISMATCH\", \"The MySQL planner received a schema tree that neither MySQL introspection nor contractToSchema built.\");\n\t\tconst expected = mysqlContractToSchema(options.contract, sqlTypeLookupsOf(options.frameworkComponents));\n\t\tconst actual = options.schema;\n\t\tconst allowed = options.policy.allowedOperationClasses;\n\t\tconst strict = allowed.includes(\"widening\") || allowed.includes(\"destructive\");\n\t\tconst { ownership } = options;\n\t\tconst planned = planIssues({\n\t\t\tissues: coalesceSubtreeIssues(diffSchemas(expected, actual)).filter((issue) => (strict || issueOutcome(issue) !== \"not-expected\") && (ownership === void 0 || !isTableOwnedElsewhere(issue, ownership))),\n\t\t\texpected,\n\t\t\tactual,\n\t\t\tpolicy: options.policy\n\t\t});\n\t\tif (!planned.ok) return plannerFailure(planned.failure);\n\t\tconst calls = planned.value;\n\t\treturn {\n\t\t\tkind: \"success\",\n\t\t\tplan: new TypeScriptRenderableMysqlMigration({\n\t\t\t\tcalls,\n\t\t\t\tmeta: {\n\t\t\t\t\tfrom: options.origin?.storageHash ?? null,\n\t\t\t\t\tto: options.contract.storage.storageHash\n\t\t\t\t},\n\t\t\t\tspaceId: options.spaceId,\n\t\t\t\tsnapshotsImportPath: options.snapshotsImportPath,\n\t\t\t\tdestination: {\n\t\t\t\t\tstorageHash: options.contract.storage.storageHash,\n\t\t\t\t\t...options.contract.profileHash === void 0 ? {} : { profileHash: options.contract.profileHash }\n\t\t\t\t},\n\t\t\t\tlowerer: this.#lowerer\n\t\t\t}),\n\t\t\tappliedStatements: [],\n\t\t\t...subjectsOfCalls(calls.map(callSubjects), {\n\t\t\t\tfromContract: options.fromContract,\n\t\t\t\tcontract: options.contract,\n\t\t\t\torigins: NO_RENAMED_ORIGINS,\n\t\t\t\tbyHand: mysqlTableRenameByHand\n\t\t\t})\n\t\t};\n\t}\n};\nfunction statementNotYetSupported(statement) {\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `A ${statement.kind} statement is not yet supported on MySQL`,\n\t\twhy: \"The MySQL planner plans no rename, conversion or backfill yet. Plan the change without the statement, or write it by hand in a migration of its own with `migration new`.\",\n\t\trefusedStatement: statement\n\t};\n}\nfunction createMysqlMigrationPlanner(lowerer) {\n\treturn new MysqlMigrationPlanner(lowerer);\n}\n//#endregion\n//#region src/core/migrations/runner.ts\n/** An error without a structured code, such as a driver's socket error, thrown while a space applied: reported as `MIGRATION.EXECUTION_FAILED`, with its own code, when it has one, in `errorCode`. */\nfunction failureFromThrown(error) {\n\tconst errorCode = typeof error === \"object\" && error !== null ? Reflect.get(error, \"code\") : void 0;\n\treturn migrationRunnerFailure(\"MIGRATION.EXECUTION_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\tmeta: typeof errorCode === \"string\" ? { errorCode } : {},\n\t\tcause: error\n\t});\n}\n/** The structured error thrown while a space applied, keeping its code, advice and docs link, with the space and whether the database changed added to its facts. */\nfunction withSpaceFacts(error, failingSpace, databaseUnchanged) {\n\treturn Object.assign(error, { meta: {\n\t\t...error.meta ?? {},\n\t\tfailingSpace,\n\t\tdatabaseUnchanged\n\t} });\n}\nfunction stepHolds(rows) {\n\tconst value = rows[0] === void 0 ? void 0 : Object.values(rows[0])[0];\n\tif (typeof value === \"string\") return value !== \"0\" && value.length > 0;\n\treturn Boolean(value);\n}\nfunction skipRecord(operation) {\n\treturn Object.freeze({\n\t\tid: operation.id,\n\t\tlabel: operation.label,\n\t\t...ifDefined(\"summary\", operation.summary),\n\t\toperationClass: operation.operationClass,\n\t\ttarget: operation.target,\n\t\tprecheck: Object.freeze([]),\n\t\texecute: Object.freeze([]),\n\t\tpostcheck: Object.freeze([...operation.postcheck]),\n\t\tmeta: Object.freeze({\n\t\t\t...operation.meta ?? {},\n\t\t\trunner: Object.freeze({\n\t\t\t\tskipped: true,\n\t\t\t\treason: \"postcheck_pre_satisfied\"\n\t\t\t})\n\t\t})\n\t});\n}\n/**\n* The MySQL migration runner. MySQL commits every DDL statement as it runs, so no transaction can undo an apply: the runner applies one space at a time, checks each operation before and after it runs, verifies the space's schema with the caller's strictness (every space, not only the app space), and only then writes the space's marker and ledger entries, in one transaction. A failure leaves the spaces before it applied, and running the apply again skips what already holds. The whole apply holds the marker lock, which MySQL keeps for the session, so it is released on the same connection when the apply ends.\n*/\nvar MysqlMigrationRunner = class {\n\tfamily;\n\tconstructor(family) {\n\t\tthis.family = family;\n\t}\n\tasync execute(options) {\n\t\tconst { driver, perSpaceOptions } = options;\n\t\tif (perSpaceOptions.length === 0) return ok({ perSpaceResults: [] });\n\t\treturn withMarkerLock(driver, () => this.#applySpaces(driver, perSpaceOptions), (result) => result.ok);\n\t}\n\tasync executeOnConnection(options) {\n\t\treturn this.#applySpace(options, { changedDatabase: false });\n\t}\n\tasync #applySpaces(driver, perSpaceOptions) {\n\t\tconst perSpaceResults = [];\n\t\tlet changedBefore = false;\n\t\tfor (const spaceOptions of perSpaceOptions) {\n\t\t\tconst space = spaceOptions.space ?? spaceOptions.plan.spaceId;\n\t\t\tconst progress = { changedDatabase: false };\n\t\t\tlet result;\n\t\t\ttry {\n\t\t\t\tresult = await this.#applySpace({\n\t\t\t\t\t...spaceOptions,\n\t\t\t\t\tdriver,\n\t\t\t\t\tspace\n\t\t\t\t}, progress);\n\t\t\t} catch (error) {\n\t\t\t\tif (isInternalError(error)) throw error;\n\t\t\t\tconst databaseUnchanged = !changedBefore && !progress.changedDatabase;\n\t\t\t\tif (isStructuredError(error)) throw withSpaceFacts(error, space, databaseUnchanged);\n\t\t\t\tresult = notOk(failureFromThrown(error));\n\t\t\t}\n\t\t\tif (!result.ok) return notOk(withFailingSpace(withDatabaseUnchanged(result.failure, !changedBefore && !progress.changedDatabase), space));\n\t\t\tchangedBefore ||= progress.changedDatabase;\n\t\t\tperSpaceResults.push({\n\t\t\t\tspace,\n\t\t\t\tvalue: result.value\n\t\t\t});\n\t\t}\n\t\treturn ok({ perSpaceResults });\n\t}\n\tasync #applySpace(options, progress) {\n\t\tconst { driver } = options;\n\t\tif (options.space !== void 0 && options.space !== options.plan.spaceId) throw mysqlError(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", `SqlMigrationRunner: options.space (${options.space}) does not match plan.spaceId (${options.plan.spaceId})`, { meta: {\n\t\t\tspace: options.space,\n\t\t\tplanSpaceId: options.plan.spaceId\n\t\t} });\n\t\tconst space = options.plan.spaceId;\n\t\tconst operations = blindCast(await Promise.all(options.plan.operations));\n\t\tconst destinationCheck = this.#checkDestination(options.plan.destination, options.destinationContract);\n\t\tif (!destinationCheck.ok) return destinationCheck;\n\t\tconst policyCheck = this.#checkPolicy(options.policy, operations);\n\t\tif (!policyCheck.ok) return policyCheck;\n\t\tawait this.#ensureControlTables(driver, options);\n\t\tconst existingMarker = await this.family.readMarker({\n\t\t\tdriver,\n\t\t\tspace\n\t\t});\n\t\tconst originCheck = this.#checkOrigin(existingMarker, options.plan.origin ?? null);\n\t\tif (!originCheck.ok) return originCheck;\n\t\tconst isSelfEdge = options.plan.origin?.storageHash === options.plan.destination.storageHash;\n\t\tconst applied = existingMarker !== null && existingMarker.storageHash === options.plan.destination.storageHash && (options.plan.destination.profileHash === void 0 || existingMarker.profileHash === options.plan.destination.profileHash) && options.plan.origin != null && !isSelfEdge ? {\n\t\t\tresult: okVoid(),\n\t\t\texecuted: [],\n\t\t\texecutedCount: 0\n\t\t} : await this.#applyOperations(driver, options, operations, progress);\n\t\tif (!applied.result.ok) return applied.result;\n\t\tconst schema = await this.family.introspect({\n\t\t\tdriver,\n\t\t\tcontract: options.destinationContract\n\t\t});\n\t\tconst verified = this.family.verifySchema({\n\t\t\tcontract: options.destinationContract,\n\t\t\tschema,\n\t\t\tstrict: options.strictVerification ?? true,\n\t\t\tframeworkComponents: options.frameworkComponents\n\t\t});\n\t\tif (!verified.ok) return runnerFailure(\"MIGRATION.SCHEMA_VERIFY_FAILED\", verified.summary, {\n\t\t\twhy: schemaCheckWhy(verified.schema.issues),\n\t\t\tmeta: { schemaIssues: verified.schema.issues }\n\t\t});\n\t\tconst existingInvariants = new Set(existingMarker?.invariants ?? []);\n\t\tif (!(isSelfEdge && applied.executedCount === 0 && options.plan.providedInvariants.every((id) => existingInvariants.has(id)))) {\n\t\t\tconst written = await this.#writeMarkerAndLedger(driver, options, existingMarker, applied.executed, progress);\n\t\t\tif (!written.ok) return written;\n\t\t}\n\t\treturn runnerSuccess({\n\t\t\toperationsPlanned: operations.length,\n\t\t\toperationsExecuted: applied.executedCount\n\t\t});\n\t}\n\tasync #ensureControlTables(driver, options) {\n\t\tfor (const query of this.family.bootstrapControlTableQueries()) {\n\t\t\tconst statement = await this.family.lowerAst(query, { contract: options.destinationContract });\n\t\t\tawait driver.query(statement.sql, statement.params);\n\t\t}\n\t}\n\tasync #applyOperations(driver, options, operations, progress) {\n\t\tconst checks = options.executionChecks;\n\t\tconst runPrechecks = checks?.prechecks !== false;\n\t\tconst runPostchecks = checks?.postchecks !== false;\n\t\tconst runIdempotency = checks?.idempotencyChecks !== false;\n\t\tconst executed = [];\n\t\tlet executedCount = 0;\n\t\tconst stop = (result) => ({\n\t\t\tresult,\n\t\t\texecuted,\n\t\t\texecutedCount\n\t\t});\n\t\tfor (const operation of operations) {\n\t\t\toptions.callbacks?.onOperationStart?.(operation);\n\t\t\ttry {\n\t\t\t\tif (runPostchecks && runIdempotency && await this.#allHold(driver, operation.postcheck)) {\n\t\t\t\t\texecuted.push(skipRecord(operation));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (runPrechecks) {\n\t\t\t\t\tconst precheck = await this.#runChecks(driver, operation, \"precheck\");\n\t\t\t\t\tif (!precheck.ok) return stop(precheck);\n\t\t\t\t}\n\t\t\t\tconst execution = await this.#runSteps(driver, operation, progress);\n\t\t\t\tif (!execution.ok) return stop(execution);\n\t\t\t\texecutedCount += 1;\n\t\t\t\tif (runPostchecks) {\n\t\t\t\t\tconst postcheck = await this.#runChecks(driver, operation, \"postcheck\");\n\t\t\t\t\tif (!postcheck.ok) return stop(postcheck);\n\t\t\t\t}\n\t\t\t\texecuted.push(operation);\n\t\t\t} finally {\n\t\t\t\toptions.callbacks?.onOperationComplete?.(operation);\n\t\t\t}\n\t\t}\n\t\treturn stop(okVoid());\n\t}\n\tasync #allHold(driver, steps) {\n\t\tif (steps.length === 0) return false;\n\t\tfor (const step of steps) if (!stepHolds((await driver.query(step.sql, step.params ?? [])).rows)) return false;\n\t\treturn true;\n\t}\n\tasync #runChecks(driver, operation, phase) {\n\t\tfor (const step of operation[phase]) {\n\t\t\tif (stepHolds((await driver.query(step.sql, step.params ?? [])).rows)) continue;\n\t\t\tconst failedCheck = {\n\t\t\t\toperationId: operation.id,\n\t\t\t\tphase,\n\t\t\t\tdescription: step.description,\n\t\t\t\t...ifDefined(\"expectation\", step.expectation)\n\t\t\t};\n\t\t\treturn runnerFailure(phase === \"precheck\" ? \"MIGRATION.PRECHECK_FAILED\" : \"MIGRATION.POSTCHECK_FAILED\", `Operation ${operation.id} failed during ${phase}: ${step.description}`, {\n\t\t\t\twhy: phase === \"precheck\" ? failedPrecheckWhy(failedCheck) : failedPostcheckWhy(failedCheck),\n\t\t\t\tmeta: { failedCheck }\n\t\t\t});\n\t\t}\n\t\treturn okVoid();\n\t}\n\t/** Runs an operation's steps, and records in `progress` each one that reached the database, which a DDL statement changes for good. */\n\tasync #runSteps(driver, operation, progress) {\n\t\tfor (const step of operation.execute) try {\n\t\t\tawait driver.query(step.sql, step.params ?? []);\n\t\t\tprogress.changedDatabase = true;\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\treturn runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${operation.id} failed during execution: ${step.description}`, {\n\t\t\t\twhy: message,\n\t\t\t\tmeta: {\n\t\t\t\t\toperationId: operation.id,\n\t\t\t\t\tstepDescription: step.description,\n\t\t\t\t\tsql: step.sql\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn okVoid();\n\t}\n\tasync #writeMarkerAndLedger(driver, options, existingMarker, executed, progress) {\n\t\tconst { plan } = options;\n\t\tconst destination = {\n\t\t\tstorageHash: plan.destination.storageHash,\n\t\t\tprofileHash: plan.destination.profileHash ?? options.destinationContract.profileHash ?? plan.destination.storageHash,\n\t\t\tinvariants: plan.providedInvariants\n\t\t};\n\t\tawait driver.query(\"START TRANSACTION\");\n\t\ttry {\n\t\t\tif (existingMarker === null) await this.family.initMarker({\n\t\t\t\tdriver,\n\t\t\t\tspace: plan.spaceId,\n\t\t\t\tdestination\n\t\t\t});\n\t\t\telse if (!await this.family.updateMarker({\n\t\t\t\tdriver,\n\t\t\t\tspace: plan.spaceId,\n\t\t\t\texpectedFrom: existingMarker.storageHash,\n\t\t\t\tdestination\n\t\t\t})) {\n\t\t\t\tawait driver.query(\"ROLLBACK\");\n\t\t\t\tconst found = await this.family.readMarker({\n\t\t\t\t\tdriver,\n\t\t\t\t\tspace: plan.spaceId\n\t\t\t\t});\n\t\t\t\treturn runnerFailure(\"MIGRATION.MARKER_CAS_FAILURE\", \"Marker was modified by another process during migration execution.\", { meta: {\n\t\t\t\t\tspace: plan.spaceId,\n\t\t\t\t\texpectedStorageHash: existingMarker.storageHash,\n\t\t\t\t\tfoundStorageHash: found?.storageHash ?? null,\n\t\t\t\t\tdestinationStorageHash: plan.destination.storageHash\n\t\t\t\t} });\n\t\t\t}\n\t\t\tawait this.#writeLedger(driver, options, executed);\n\t\t} catch (error) {\n\t\t\tawait driver.query(\"ROLLBACK\").catch(() => void 0);\n\t\t\tthrow error;\n\t\t}\n\t\tprogress.changedDatabase = true;\n\t\tawait driver.query(\"COMMIT\");\n\t\treturn okVoid();\n\t}\n\tasync #writeLedger(driver, options, executed) {\n\t\tconst { plan, migrationEdges } = options;\n\t\tconst edgeOperations = migrationEdges.reduce((sum, edge) => sum + edge.operationCount, 0);\n\t\tif (edgeOperations !== plan.operations.length) throw new InternalError(`Ledger write: plan.operations length (${plan.operations.length}) does not match sum of migrationEdges operationCount (${edgeOperations})`);\n\t\tlet offset = 0;\n\t\tfor (const edge of migrationEdges) {\n\t\t\tconst operations = executed.slice(offset, offset + edge.operationCount);\n\t\t\toffset += edge.operationCount;\n\t\t\tawait this.family.writeLedgerEntry({\n\t\t\t\tdriver,\n\t\t\t\tspace: plan.spaceId,\n\t\t\t\tentry: {\n\t\t\t\t\tedgeId: `${edge.from}->${edge.to}`,\n\t\t\t\t\tfrom: edge.from,\n\t\t\t\t\tto: edge.to,\n\t\t\t\t\tmigrationName: edge.dirName,\n\t\t\t\t\tmigrationHash: edge.migrationHash,\n\t\t\t\t\toperations\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\t#checkDestination(destination, contract) {\n\t\tif (destination.storageHash !== contract.storage.storageHash) return runnerFailure(\"MIGRATION.DESTINATION_CONTRACT_MISMATCH\", `Plan destination storage hash (${destination.storageHash}) does not match provided contract storage hash (${contract.storage.storageHash}).`, { meta: {\n\t\t\tplanStorageHash: destination.storageHash,\n\t\t\tcontractStorageHash: contract.storage.storageHash\n\t\t} });\n\t\tif (destination.profileHash !== void 0 && contract.profileHash !== void 0 && destination.profileHash !== contract.profileHash) return runnerFailure(\"MIGRATION.DESTINATION_CONTRACT_MISMATCH\", `Plan destination profile hash (${destination.profileHash}) does not match provided contract profile hash (${contract.profileHash}).`, { meta: {\n\t\t\tplanProfileHash: destination.profileHash,\n\t\t\tcontractProfileHash: contract.profileHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\t#checkPolicy(policy, operations) {\n\t\tconst allowed = new Set(policy.allowedOperationClasses);\n\t\tconst refused = operations.find((operation) => !allowed.has(operation.operationClass));\n\t\tif (refused === void 0) return okVoid();\n\t\treturn runnerFailure(\"MIGRATION.POLICY_VIOLATION\", `Operation ${refused.id} has class \"${refused.operationClass}\" which is not allowed by policy.`, {\n\t\t\twhy: `Policy only allows: ${policy.allowedOperationClasses.join(\", \")}.`,\n\t\t\tmeta: {\n\t\t\t\toperationId: refused.id,\n\t\t\t\toperationClass: refused.operationClass,\n\t\t\t\tallowedClasses: policy.allowedOperationClasses\n\t\t\t}\n\t\t});\n\t}\n\t#checkOrigin(marker, origin) {\n\t\tif (origin === null) return okVoid();\n\t\tif (marker === null) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Missing contract marker: expected origin storage hash ${origin.storageHash}.`, { meta: { expectedOriginStorageHash: origin.storageHash } });\n\t\tif (marker.storageHash !== origin.storageHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker (${marker.storageHash}) does not match plan origin (${origin.storageHash}).`, { meta: {\n\t\t\tmarkerStorageHash: marker.storageHash,\n\t\t\texpectedOriginStorageHash: origin.storageHash\n\t\t} });\n\t\tif (origin.profileHash !== void 0 && marker.profileHash !== origin.profileHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker profile hash (${marker.profileHash}) does not match plan origin profile hash (${origin.profileHash}).`, { meta: {\n\t\t\tmarkerProfileHash: marker.profileHash,\n\t\t\texpectedOriginProfileHash: origin.profileHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n};\nfunction createMysqlMigrationRunner(family) {\n\treturn new MysqlMigrationRunner(family);\n}\n//#endregion\nexport { rawSql as _, MysqlMigration as a, AddUniqueCall as c, DropColumnCall as d, DropForeignKeyCall as f, RawSqlCall as g, DropUniqueCall as h, TypeScriptRenderableMysqlMigration as i, CreateIndexCall as l, DropTableCall as m, MysqlMigrationPlanner as n, AddColumnCall as o, DropIndexCall as p, createMysqlMigrationPlanner as r, AddForeignKeyCall as s, createMysqlMigrationRunner as t, CreateTableCall as u, diffMysqlSchema as v, mysqlContractToSchema as y };\n\n//# sourceMappingURL=runner-C4r6yEd1.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAS,sBAAsB,UAAU,OAAO;CAC/C,OAAO,mBAAmB,UAAU;EACnC,qBAAqB;EACrB,gBAAgB;EAChB,gBAAgB,MAAM;EACtB,aAAa,MAAM;CACpB,CAAC;AACF;;AAEA,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;;AAEA,SAAS,gBAAgB,OAAO;CAC/B,IAAI,EAAE,MAAM,kBAAkB,cAAc,MAAM,WAAW,4BAA4B,sFAAsF;CAC/K,MAAM,WAAW,sBAAsB,MAAM,UAAU,iBAAiB,MAAM,mBAAmB,CAAC;CAClG,MAAM,SAAS,MAAM;CACrB,MAAM,uBAAuB,OAAO,OAAO,MAAM,SAAS,QAAQ,UAAU,CAAC,CAAC,QAAQ,OAAO,OAAO,KAAK,GAAG,QAAQ,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;CAC3I,OAAO;EACN,QAAQ,YAAY,UAAU,MAAM;EACpC,uBAAuB,UAAU,qBAAqB,OAAO,MAAM,QAAQ;EA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AI,YAAY,KAAK,GAAG,OAAO,OAAO;EACtC,OAAO,cAAc,8BAA8B,aAAa,QAAQ,GAAG,cAAc,QAAQ,eAAe,oCAAoC;GACnJ,KAAK,uBAAuB,OAAO,wBAAwB,KAAK,IAAI,EAAE;GACtE,MAAM;IACL,aAAa,QAAQ;IACrB,gBAAgB,QAAQ;IACxB,gBAAgB,OAAO;GACxB;EACD,CAAC;CACF;CACA,aAAa,QAAQ,QAAQ;EAC5B,IAAI,WAAW,MAAM,OAAO,OAAO;EACnC,IAAI,WAAW,MAAM,OAAO,cAAc,oCAAoC,yDAAyD,OAAO,YAAY,IAAI,EAAE,MAAM,EAAE,2BAA2B,OAAO,YAAY,EAAE,CAAC;EACzN,IAAI,OAAO,gBAAgB,OAAO,aAAa,OAAO,cAAc,oCAAoC,6BAA6B,OAAO,YAAY,gCAAgC,OAAO,YAAY,KAAK,EAAE,MAAM;GACvN,mBAAmB,OAAO;GAC1B,2BAA2B,OAAO;EACnC,EAAE,CAAC;EACH,IAAI,OAAO,gBAAgB,KAAK,KAAK,OAAO,gBAAgB,OAAO,aAAa,OAAO,cAAc,oCAAoC,0CAA0C,OAAO,YAAY,6CAA6C,OAAO,YAAY,KAAK,EAAE,MAAM;GAClR,mBAAmB,OAAO;GAC1B,2BAA2B,OAAO;EACnC,EAAE,CAAC;EACH,OAAO,OAAO;CACf;AACD;AACA,SAAS,2BAA2B,QAAQ;CAC3C,OAAO,IAAI,qBAAqB,MAAM;AACvC"}
@@ -0,0 +1,36 @@
1
+ import { SqlDriver } from "@prisma/orm-family-sql/relational-core/ast";
2
+ import { SessionSettings } from "@prisma/orm-framework/components/components";
3
+ import "mariadb";
4
+ import { RuntimeDriverDescriptor, RuntimeDriverInstance } from "@prisma/orm-framework/components/execution";
5
+ //#region ../../../3-targets/mysql/3-driver/dist/runtime.d.mts
6
+ //#region src/core/connection-options.d.ts
7
+ /** The pool settings `mysql()` takes, named and defaulted as the Postgres facade's `poolOptions` and `pg.Pool`. */
8
+ interface MysqlPoolOptions {
9
+ /** How long to wait for a new connection to open, and for a pooled one to come free, in milliseconds. 20 seconds by default. */
10
+ readonly connectionTimeoutMillis?: number;
11
+ /** How long a pooled connection may stay idle before the pool closes it, in milliseconds. 30 seconds by default; 0 keeps idle connections open. */
12
+ readonly idleTimeoutMillis?: number;
13
+ /** The most connections the pool opens. 10 by default. */
14
+ readonly max?: number;
15
+ }
16
+ //#endregion
17
+ //#region src/core/runtime/mysql-driver.d.ts
18
+ /** Where the runtime driver connects: a `mysql://` URL. */
19
+ type MysqlBinding = {
20
+ readonly kind: 'url';
21
+ readonly url: string;
22
+ };
23
+ type MysqlRuntimeDriver = RuntimeDriverInstance<'sql', 'mysql'> & SqlDriver<MysqlBinding>;
24
+ interface MysqlDriverCreateOptions {
25
+ /** Stream each query's rows as they arrive, instead of reading the whole result before the first row, which is the default, as on Postgres without a cursor. */
26
+ readonly stream?: boolean | undefined;
27
+ readonly poolOptions?: MysqlPoolOptions | undefined;
28
+ /** The session settings the stack's target declares, which every connection starts with. */
29
+ readonly sessionSettings?: SessionSettings | undefined;
30
+ }
31
+ //#endregion
32
+ //#region src/core/runtime/runtime-driver.d.ts
33
+ declare const mysqlRuntimeDriverDescriptor: RuntimeDriverDescriptor<'sql', 'mysql', MysqlDriverCreateOptions, MysqlRuntimeDriver>;
34
+ //#endregion
35
+ export { mysqlRuntimeDriverDescriptor as a, MysqlRuntimeDriver as i, MysqlDriverCreateOptions as n, MysqlPoolOptions as r, MysqlBinding as t };
36
+ //# sourceMappingURL=runtime-BGyTXcQH.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-BGyTXcQH.d.mts","names":[],"sources":["../../../../3-targets/mysql/3-driver/dist/runtime.d.mts"],"mappings":";;;;;;;UAMU;;WAEC;;WAEA;;WAEA;;;;;KAKN;WACM;WACA;;KAEN,qBAAqB,wCAAwC,UAAU;UAClE;;WAEC;WACA,cAAc;;WAEd,kBAAkB;;;;cAIf,8BAA8B,wCAAwC,0BAA0B"}
@@ -0,0 +1,29 @@
1
+ import { t as MysqlCodecRegistry } from "./codecs-DM61agRr.mjs";
2
+ import "./codec-descriptor-oLRh9E29.mjs";
3
+ import { Adapter, AdapterProfile, AnyQueryAst, LoweredStatement, LowererContext } from "@prisma/orm-family-sql/relational-core/ast";
4
+ import { SqlStorage } from "@prisma/orm-family-sql/contract/types";
5
+ import { Contract } from "@prisma/orm-framework/contract/types";
6
+ import { RuntimeAdapterInstance } from "@prisma/orm-framework/components/execution";
7
+ import { SqlRuntimeAdapterDescriptor } from "@prisma/orm-family-sql/runtime";
8
+ //#region ../../../3-targets/mysql/2-adapter/dist/runtime.d.mts
9
+ //#region src/core/sql-renderer.d.ts
10
+ type MysqlContract = Contract<SqlStorage>;
11
+ //#endregion
12
+ //#region src/core/runtime/mysql-adapter.d.ts
13
+ declare class MysqlAdapterImpl implements Adapter<AnyQueryAst, MysqlContract, LoweredStatement> {
14
+ #private;
15
+ readonly familyId: "sql";
16
+ readonly targetId: "mysql";
17
+ readonly profile: AdapterProfile<'mysql'>;
18
+ constructor(codecs: MysqlCodecRegistry);
19
+ lower(ast: AnyQueryAst, context: LowererContext<MysqlContract>): LoweredStatement;
20
+ }
21
+ /** The MySQL runtime adapter: it lowers queries with the MySQL renderer and reads the marker 2b's control tables hold. */
22
+ declare function createMysqlAdapter(codecs: MysqlCodecRegistry): Readonly<MysqlAdapterImpl>;
23
+ //#endregion
24
+ //#region src/core/runtime/runtime-adapter.d.ts
25
+ type MysqlRuntimeAdapterInstance = RuntimeAdapterInstance<'sql', 'mysql'> & ReturnType<typeof createMysqlAdapter>;
26
+ declare const mysqlRuntimeAdapterDescriptor: SqlRuntimeAdapterDescriptor<'mysql', MysqlRuntimeAdapterInstance>;
27
+ //#endregion
28
+ export { mysqlRuntimeAdapterDescriptor as n, MysqlRuntimeAdapterInstance as t };
29
+ //# sourceMappingURL=runtime-CeuRr9nE.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-CeuRr9nE.d.mts","names":[],"sources":["../../../../3-targets/mysql/2-adapter/dist/runtime.d.mts"],"mappings":";;;;;;;;;KAQK,gBAAgB,SAAS;;;cAGhB,4BAA4B,QAAQ,aAAa,eAAe;;WAEnE;WACA;WACA,SAAS;EAClB,YAAY,QAAQ;EACpB,MAAM,KAAK,aAAa,SAAS,eAAe,iBAAiB;;;iBAGlD,mBAAmB,QAAQ,qBAAqB,SAAS;;;KAGrE,8BAA8B,yCAAyC,kBAAkB;cAChF,+BAA+B,qCAAqC"}
@@ -0,0 +1,22 @@
1
+ import { Namespace } from "@prisma/orm-framework/components/ir";
2
+ import { SqlNamespaceInput, SqlStorage } from "@prisma/orm-family-sql/contract/types";
3
+ import { SqlContractSerializerBase } from "@prisma/orm-family-sql/family/ir";
4
+ import { Contract } from "@prisma/orm-framework/contract/types";
5
+ import { RuntimeTargetInstance } from "@prisma/orm-framework/components/execution";
6
+ import { SqlRuntimeTargetDescriptor } from "@prisma/orm-family-sql/runtime";
7
+ import { JsonObject } from "@prisma/orm-framework/utils/json";
8
+ //#region ../../../3-targets/mysql/1-target/dist/runtime.d.mts
9
+ //#region src/core/mysql-contract-serializer.d.ts
10
+ /** The MySQL target's contract serializer: the SQL family's, with each namespace built as a `MysqlDatabase`. */
11
+ declare class MysqlContractSerializer extends SqlContractSerializerBase<Contract<SqlStorage>> {
12
+ constructor();
13
+ protected hydrateSqlNamespaceEntry(nsId: string, raw: Record<string, unknown>): Namespace | SqlNamespaceInput;
14
+ serializeContract(contract: Contract<SqlStorage>): JsonObject;
15
+ }
16
+ //#endregion
17
+ //#region src/core/runtime/runtime-target.d.ts
18
+ interface MysqlRuntimeTargetInstance extends RuntimeTargetInstance<'sql', 'mysql'> {}
19
+ declare const mysqlRuntimeTargetDescriptor: SqlRuntimeTargetDescriptor<'mysql', MysqlRuntimeTargetInstance>;
20
+ //#endregion
21
+ export { MysqlRuntimeTargetInstance as n, mysqlRuntimeTargetDescriptor as r, MysqlContractSerializer as t };
22
+ //# sourceMappingURL=runtime-Cl0BbTZq.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-Cl0BbTZq.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/runtime.d.mts"],"mappings":";;;;;;;;;;cASc,gCAAgC,0BAA0B,SAAS;EAC/E;YACU,yBAAyB,cAAc,KAAK,0BAA0B,YAAY;EAC5F,kBAAkB,UAAU,SAAS,cAAc;;;;UAI3C,mCAAmC;cAC/B,8BAA8B,oCAAoC"}
@@ -0,0 +1,30 @@
1
+ //#region ../../../3-targets/mysql/1-target/dist/sql-utils.d.mts
2
+ //#region src/core/sql-lexer.d.ts
3
+ /** A `?` placeholder with the digits that follow it. `number` is N for a `?N`, and `undefined` for a bare `?` or one with a leading zero. */
4
+ interface MysqlPlaceholderToken {
5
+ readonly kind: 'placeholder';
6
+ readonly text: string;
7
+ readonly number: number | undefined;
8
+ }
9
+ /**
10
+ * One token of MySQL SQL: a word (a keyword, an unquoted identifier or the digits of a number), a run of whitespace, quoted text (a string or a backtick identifier, quotes included), a comment, a placeholder, or any other single character.
11
+ */
12
+ type MysqlSqlToken = {
13
+ readonly kind: 'word' | 'whitespace' | 'quoted' | 'comment' | 'symbol';
14
+ readonly text: string;
15
+ } | MysqlPlaceholderToken;
16
+ /**
17
+ * Splits MySQL SQL into tokens as MySQL's lexer reads it: a `?` inside a quoted string, a backtick identifier or a `#`, `--` or block comment is not a placeholder, and a keyword inside one is not a word. Joining the tokens' text gives the SQL back. Refuses an executable `/*!` comment, whose content MySQL runs as SQL and whose strings the comment's closing marker does not end.
18
+ */
19
+ declare function tokenizeMysqlSql(sql: string): MysqlSqlToken[];
20
+ //#endregion
21
+ //#region src/core/sql-utils.d.ts
22
+ /** A MySQL identifier in backticks, with each backtick doubled. */
23
+ declare function quoteIdentifier(identifier: string): string;
24
+ /** The body of a MySQL string literal: quotes doubled and backslashes escaped, as MySQL reads them under its default SQL mode. */
25
+ declare function escapeLiteral(value: string): string;
26
+ /** A MySQL string literal. */
27
+ declare function quoteLiteral(value: string): string;
28
+ //#endregion
29
+ export { quoteLiteral as a, quoteIdentifier as i, MysqlSqlToken as n, tokenizeMysqlSql as o, escapeLiteral as r, MysqlPlaceholderToken as t };
30
+ //# sourceMappingURL=sql-utils-BOS1c2QT.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-utils-BOS1c2QT.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/sql-utils.d.mts"],"mappings":";;;UAEU;WACC;WACA;WACA;;;;;KAKN;WACM;WACA;IACP;;;;iBAIa,iBAAiB,cAAc;;;;iBAI/B,gBAAgB;;iBAEhB,cAAc;;iBAEd,aAAa"}
@@ -0,0 +1,30 @@
1
+ import { t as mysqlError } from "./errors-rvH_F2Yj-BQrO_--u.mjs";
2
+ //#region ../../../3-targets/mysql/1-target/dist/sql-utils-Db0IQO_B.mjs
3
+ /** A MySQL identifier in backticks, with each backtick doubled. */
4
+ function quoteIdentifier(identifier) {
5
+ if (identifier.length === 0) throw mysqlError("CONTRACT.IDENTIFIER_INVALID", "Identifier cannot be empty", { meta: {
6
+ value: identifier,
7
+ context: "identifier"
8
+ } });
9
+ if (identifier.includes("\0")) throw mysqlError("CONTRACT.IDENTIFIER_INVALID", "Identifier cannot contain null bytes", { meta: {
10
+ value: identifier.replace(/\0/g, "\\0"),
11
+ context: "identifier"
12
+ } });
13
+ return `\`${identifier.replace(/`/g, "``")}\``;
14
+ }
15
+ /** The body of a MySQL string literal: quotes doubled and backslashes escaped, as MySQL reads them under its default SQL mode. */
16
+ function escapeLiteral(value) {
17
+ if (value.includes("\0")) throw mysqlError("CONTRACT.IDENTIFIER_INVALID", "Literal value cannot contain null bytes", { meta: {
18
+ value: value.replace(/\0/g, "\\0"),
19
+ context: "literal"
20
+ } });
21
+ return value.replace(/\\/g, "\\\\").replace(/'/g, "''");
22
+ }
23
+ /** A MySQL string literal. */
24
+ function quoteLiteral(value) {
25
+ return `'${escapeLiteral(value)}'`;
26
+ }
27
+ //#endregion
28
+ export { quoteIdentifier as n, quoteLiteral as r, escapeLiteral as t };
29
+
30
+ //# sourceMappingURL=sql-utils-Db0IQO_B-PaULnfrE.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-utils-Db0IQO_B-PaULnfrE.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/sql-utils-Db0IQO_B.mjs"],"sourcesContent":["import { t as mysqlError } from \"./errors-rvH_F2Yj.mjs\";\n//#region src/core/sql-utils.ts\n/** A MySQL identifier in backticks, with each backtick doubled. */\nfunction quoteIdentifier(identifier) {\n\tif (identifier.length === 0) throw mysqlError(\"CONTRACT.IDENTIFIER_INVALID\", \"Identifier cannot be empty\", { meta: {\n\t\tvalue: identifier,\n\t\tcontext: \"identifier\"\n\t} });\n\tif (identifier.includes(\"\\0\")) throw mysqlError(\"CONTRACT.IDENTIFIER_INVALID\", \"Identifier cannot contain null bytes\", { meta: {\n\t\tvalue: identifier.replace(/\\0/g, \"\\\\0\"),\n\t\tcontext: \"identifier\"\n\t} });\n\treturn `\\`${identifier.replace(/`/g, \"``\")}\\``;\n}\n/** The body of a MySQL string literal: quotes doubled and backslashes escaped, as MySQL reads them under its default SQL mode. */\nfunction escapeLiteral(value) {\n\tif (value.includes(\"\\0\")) throw mysqlError(\"CONTRACT.IDENTIFIER_INVALID\", \"Literal value cannot contain null bytes\", { meta: {\n\t\tvalue: value.replace(/\\0/g, \"\\\\0\"),\n\t\tcontext: \"literal\"\n\t} });\n\treturn value.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"''\");\n}\n/** A MySQL string literal. */\nfunction quoteLiteral(value) {\n\treturn `'${escapeLiteral(value)}'`;\n}\n//#endregion\nexport { quoteIdentifier as n, quoteLiteral as r, escapeLiteral as t };\n\n//# sourceMappingURL=sql-utils-Db0IQO_B.mjs.map"],"mappings":";;;AAGA,SAAS,gBAAgB,YAAY;CACpC,IAAI,WAAW,WAAW,GAAG,MAAM,WAAW,+BAA+B,8BAA8B,EAAE,MAAM;EAClH,OAAO;EACP,SAAS;CACV,EAAE,CAAC;CACH,IAAI,WAAW,SAAS,IAAI,GAAG,MAAM,WAAW,+BAA+B,wCAAwC,EAAE,MAAM;EAC9H,OAAO,WAAW,QAAQ,OAAO,KAAK;EACtC,SAAS;CACV,EAAE,CAAC;CACH,OAAO,KAAK,WAAW,QAAQ,MAAM,IAAI,EAAE;AAC5C;;AAEA,SAAS,cAAc,OAAO;CAC7B,IAAI,MAAM,SAAS,IAAI,GAAG,MAAM,WAAW,+BAA+B,2CAA2C,EAAE,MAAM;EAC5H,OAAO,MAAM,QAAQ,OAAO,KAAK;EACjC,SAAS;CACV,EAAE,CAAC;CACH,OAAO,MAAM,QAAQ,OAAO,MAAM,CAAC,CAAC,QAAQ,MAAM,IAAI;AACvD;;AAEA,SAAS,aAAa,OAAO;CAC5B,OAAO,IAAI,cAAc,KAAK,EAAE;AACjC"}
@@ -0,0 +1,94 @@
1
+ import { t as mysqlError } from "./errors-rvH_F2Yj-BQrO_--u.mjs";
2
+ //#region ../../../3-targets/mysql/1-target/dist/sql-utils.mjs
3
+ const NUMBERED_PLACEHOLDER = /^\?([1-9]\d*)$/;
4
+ function placeholderToken(text) {
5
+ const digits = NUMBERED_PLACEHOLDER.exec(text)?.[1];
6
+ return {
7
+ kind: "placeholder",
8
+ text,
9
+ number: digits === void 0 ? void 0 : Number(digits)
10
+ };
11
+ }
12
+ /** The index just past the quoted text that opens at `start`, where a doubled quote stays inside and, outside a backtick identifier, a backslash escapes the next character. The session clears `NO_BACKSLASH_ESCAPES` and `ANSI_QUOTES`, so MySQL reads quotes the same way. */
13
+ function endOfQuoted(sql, start, quote) {
14
+ let index = start + 1;
15
+ while (index < sql.length) {
16
+ const char = sql[index];
17
+ if (char === "\\" && quote !== "`") index += 2;
18
+ else if (char === quote) {
19
+ if (sql[index + 1] !== quote) return index + 1;
20
+ index += 2;
21
+ } else index += 1;
22
+ }
23
+ return sql.length;
24
+ }
25
+ function endOf(sql, start, terminator) {
26
+ const end = sql.indexOf(terminator, start);
27
+ return end === -1 ? sql.length : end + terminator.length;
28
+ }
29
+ /** MySQL opens a `--` comment when the next character is whitespace or a control character, or the text ends: `my_isspace` or `my_iscntrl` in its lexer. */
30
+ function opensDashComment(sql, index) {
31
+ if (!sql.startsWith("--", index)) return false;
32
+ const next = sql.charCodeAt(index + 2);
33
+ return Number.isNaN(next) || next <= 32 || next === 127;
34
+ }
35
+ function isDigit(char) {
36
+ return char !== void 0 && char >= "0" && char <= "9";
37
+ }
38
+ /** A character of an unquoted identifier, keyword or number, as MySQL reads one: a letter, a digit, `$`, `_`, or any character past ASCII. */
39
+ function isWordChar(char) {
40
+ if (char === void 0) return false;
41
+ const lower = char.toLowerCase();
42
+ return isDigit(char) || lower >= "a" && lower <= "z" || char === "$" || char === "_" || char >= "€";
43
+ }
44
+ function isWhitespace(char) {
45
+ return char === " " || char === " " || char === "\n" || char === "\r" || char === "\f" || char === "\v";
46
+ }
47
+ function endOfRun(sql, start, belongs) {
48
+ let end = start;
49
+ while (end < sql.length && belongs(sql[end])) end += 1;
50
+ return end;
51
+ }
52
+ /**
53
+ * Splits MySQL SQL into tokens as MySQL's lexer reads it: a `?` inside a quoted string, a backtick identifier or a `#`, `--` or block comment is not a placeholder, and a keyword inside one is not a word. Joining the tokens' text gives the SQL back. Refuses an executable `/*!` comment, whose content MySQL runs as SQL and whose strings the comment's closing marker does not end.
54
+ */
55
+ function tokenizeMysqlSql(sql) {
56
+ const tokens = [];
57
+ let index = 0;
58
+ while (index < sql.length) {
59
+ const char = sql[index];
60
+ let kind = "symbol";
61
+ let end = index + 1;
62
+ if (char === "'" || char === "\"" || char === "`") {
63
+ kind = "quoted";
64
+ end = endOfQuoted(sql, index, char);
65
+ } else if (char === "#" || opensDashComment(sql, index) || sql.startsWith("/*", index)) {
66
+ if (sql.startsWith("/*!", index)) throw mysqlError("RUNTIME.AST_INVALID", "A MySQL statement may not contain an executable /*! comment, whose content MySQL runs as SQL", { meta: {
67
+ target: "mysql",
68
+ position: index
69
+ } });
70
+ kind = "comment";
71
+ end = sql.startsWith("/*", index) ? endOf(sql, index + 2, "*/") : endOf(sql, index, "\n");
72
+ } else if (char === "?") {
73
+ kind = "placeholder";
74
+ end = endOfRun(sql, end, isDigit);
75
+ } else if (isWhitespace(char)) {
76
+ kind = "whitespace";
77
+ end = endOfRun(sql, index, isWhitespace);
78
+ } else if (isWordChar(char)) {
79
+ kind = "word";
80
+ end = endOfRun(sql, index, isWordChar);
81
+ }
82
+ const text = sql.slice(index, end);
83
+ tokens.push(kind === "placeholder" ? placeholderToken(text) : {
84
+ kind,
85
+ text
86
+ });
87
+ index = end;
88
+ }
89
+ return tokens;
90
+ }
91
+ //#endregion
92
+ export { tokenizeMysqlSql as t };
93
+
94
+ //# sourceMappingURL=sql-utils-RW0vJvDl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-utils-RW0vJvDl.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/sql-utils.mjs"],"sourcesContent":["import { t as mysqlError } from \"./errors-rvH_F2Yj.mjs\";\nimport { n as quoteIdentifier, r as quoteLiteral, t as escapeLiteral } from \"./sql-utils-Db0IQO_B.mjs\";\n//#region src/core/sql-lexer.ts\nconst NUMBERED_PLACEHOLDER = /^\\?([1-9]\\d*)$/;\nfunction placeholderToken(text) {\n\tconst digits = NUMBERED_PLACEHOLDER.exec(text)?.[1];\n\treturn {\n\t\tkind: \"placeholder\",\n\t\ttext,\n\t\tnumber: digits === void 0 ? void 0 : Number(digits)\n\t};\n}\n/** The index just past the quoted text that opens at `start`, where a doubled quote stays inside and, outside a backtick identifier, a backslash escapes the next character. The session clears `NO_BACKSLASH_ESCAPES` and `ANSI_QUOTES`, so MySQL reads quotes the same way. */\nfunction endOfQuoted(sql, start, quote) {\n\tlet index = start + 1;\n\twhile (index < sql.length) {\n\t\tconst char = sql[index];\n\t\tif (char === \"\\\\\" && quote !== \"`\") index += 2;\n\t\telse if (char === quote) {\n\t\t\tif (sql[index + 1] !== quote) return index + 1;\n\t\t\tindex += 2;\n\t\t} else index += 1;\n\t}\n\treturn sql.length;\n}\nfunction endOf(sql, start, terminator) {\n\tconst end = sql.indexOf(terminator, start);\n\treturn end === -1 ? sql.length : end + terminator.length;\n}\n/** MySQL opens a `--` comment when the next character is whitespace or a control character, or the text ends: `my_isspace` or `my_iscntrl` in its lexer. */\nfunction opensDashComment(sql, index) {\n\tif (!sql.startsWith(\"--\", index)) return false;\n\tconst next = sql.charCodeAt(index + 2);\n\treturn Number.isNaN(next) || next <= 32 || next === 127;\n}\nfunction isDigit(char) {\n\treturn char !== void 0 && char >= \"0\" && char <= \"9\";\n}\n/** A character of an unquoted identifier, keyword or number, as MySQL reads one: a letter, a digit, `$`, `_`, or any character past ASCII. */\nfunction isWordChar(char) {\n\tif (char === void 0) return false;\n\tconst lower = char.toLowerCase();\n\treturn isDigit(char) || lower >= \"a\" && lower <= \"z\" || char === \"$\" || char === \"_\" || char >= \"€\";\n}\nfunction isWhitespace(char) {\n\treturn char === \" \" || char === \"\t\" || char === \"\\n\" || char === \"\\r\" || char === \"\\f\" || char === \"\\v\";\n}\nfunction endOfRun(sql, start, belongs) {\n\tlet end = start;\n\twhile (end < sql.length && belongs(sql[end])) end += 1;\n\treturn end;\n}\n/**\n* Splits MySQL SQL into tokens as MySQL's lexer reads it: a `?` inside a quoted string, a backtick identifier or a `#`, `--` or block comment is not a placeholder, and a keyword inside one is not a word. Joining the tokens' text gives the SQL back. Refuses an executable `/*!` comment, whose content MySQL runs as SQL and whose strings the comment's closing marker does not end.\n*/\nfunction tokenizeMysqlSql(sql) {\n\tconst tokens = [];\n\tlet index = 0;\n\twhile (index < sql.length) {\n\t\tconst char = sql[index];\n\t\tlet kind = \"symbol\";\n\t\tlet end = index + 1;\n\t\tif (char === \"'\" || char === \"\\\"\" || char === \"`\") {\n\t\t\tkind = \"quoted\";\n\t\t\tend = endOfQuoted(sql, index, char);\n\t\t} else if (char === \"#\" || opensDashComment(sql, index) || sql.startsWith(\"/*\", index)) {\n\t\t\tif (sql.startsWith(\"/*!\", index)) throw mysqlError(\"RUNTIME.AST_INVALID\", \"A MySQL statement may not contain an executable /*! comment, whose content MySQL runs as SQL\", { meta: {\n\t\t\t\ttarget: \"mysql\",\n\t\t\t\tposition: index\n\t\t\t} });\n\t\t\tkind = \"comment\";\n\t\t\tend = sql.startsWith(\"/*\", index) ? endOf(sql, index + 2, \"*/\") : endOf(sql, index, \"\\n\");\n\t\t} else if (char === \"?\") {\n\t\t\tkind = \"placeholder\";\n\t\t\tend = endOfRun(sql, end, isDigit);\n\t\t} else if (isWhitespace(char)) {\n\t\t\tkind = \"whitespace\";\n\t\t\tend = endOfRun(sql, index, isWhitespace);\n\t\t} else if (isWordChar(char)) {\n\t\t\tkind = \"word\";\n\t\t\tend = endOfRun(sql, index, isWordChar);\n\t\t}\n\t\tconst text = sql.slice(index, end);\n\t\ttokens.push(kind === \"placeholder\" ? placeholderToken(text) : {\n\t\t\tkind,\n\t\t\ttext\n\t\t});\n\t\tindex = end;\n\t}\n\treturn tokens;\n}\n//#endregion\nexport { escapeLiteral, quoteIdentifier, quoteLiteral, tokenizeMysqlSql };\n\n//# sourceMappingURL=sql-utils.mjs.map"],"mappings":";;AAGA,MAAM,uBAAuB;AAC7B,SAAS,iBAAiB,MAAM;CAC/B,MAAM,SAAS,qBAAqB,KAAK,IAAI,CAAC,GAAG;CACjD,OAAO;EACN,MAAM;EACN;EACA,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,OAAO,MAAM;CACnD;AACD;;AAEA,SAAS,YAAY,KAAK,OAAO,OAAO;CACvC,IAAI,QAAQ,QAAQ;CACpB,OAAO,QAAQ,IAAI,QAAQ;EAC1B,MAAM,OAAO,IAAI;EACjB,IAAI,SAAS,QAAQ,UAAU,KAAK,SAAS;OACxC,IAAI,SAAS,OAAO;GACxB,IAAI,IAAI,QAAQ,OAAO,OAAO,OAAO,QAAQ;GAC7C,SA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