@prisma/orm-target-mysql 8.0.0-rc.24-dev.28 → 8.0.0-rc.24-dev.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter-D4QpAe2i.d.mts +374 -0
- package/dist/adapter-D4QpAe2i.d.mts.map +1 -0
- package/dist/adapter.d.mts +8 -6
- package/dist/adapter.mjs +5 -3
- package/dist/adapter__adapter.d.mts +1 -1
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__codec-types.d.mts +2 -2
- package/dist/adapter__control.d.mts +1 -1
- package/dist/adapter__control.mjs +1 -1
- package/dist/adapter__runtime.d.mts +2 -2
- package/dist/adapter__runtime.mjs +2 -501
- package/dist/adapter__sql-renderer.d.mts +3 -0
- package/dist/adapter__sql-renderer.mjs +2 -0
- package/dist/aggregates-BK8qyA2x.d.mts +164 -0
- package/dist/aggregates-BK8qyA2x.d.mts.map +1 -0
- package/dist/aggregates-Bk6CCgQ-.mjs +145 -0
- package/dist/aggregates-Bk6CCgQ-.mjs.map +1 -0
- package/dist/codec-descriptor-B1fMmxOK-D59zKJws.d.mts +1 -0
- package/dist/{codec-descriptor-3xp1XvVH-DfPKpYeP.mjs → codec-descriptor-ByN7iIha-48yW7oDN.mjs} +23 -16
- package/dist/codec-descriptor-ByN7iIha-48yW7oDN.mjs.map +1 -0
- package/dist/codec-descriptor-CqM_hQjY.d.mts +2 -0
- package/dist/{codec-descriptor-DXyubAS6-XDBj6Yet.d.mts → codec-descriptor-DXsJwUng-D4abEAFs.d.mts} +10 -5
- package/dist/codec-descriptor-DXsJwUng-D4abEAFs.d.mts.map +1 -0
- package/dist/codec-ids-DHeJ2SMJ-Uz1FAFmQ.d.mts +26 -0
- package/dist/codec-ids-DHeJ2SMJ-Uz1FAFmQ.d.mts.map +1 -0
- package/dist/codec-ids-DuWt4aOn-DiyLf9dW.mjs +26 -0
- package/dist/codec-ids-DuWt4aOn-DiyLf9dW.mjs.map +1 -0
- package/dist/codec-types-BQBBUlf_.d.mts +1 -0
- package/dist/{codec-types-Bai_CFkk-DmZ74URd.d.mts → codec-types-C4Q_JJgX-CUPkvPDx.d.mts} +11 -5
- package/dist/codec-types-C4Q_JJgX-CUPkvPDx.d.mts.map +1 -0
- package/dist/codec-types-DxSSgcpB.d.mts +1 -0
- package/dist/{codecs-BMidk26M-B_iWNti6.d.mts → codecs-D35fqdXJ-BZwilYUu.d.mts} +115 -7
- package/dist/codecs-D35fqdXJ-BZwilYUu.d.mts.map +1 -0
- package/dist/{codecs-CIJRyUd3.d.mts → codecs-DTfUoamS.d.mts} +3 -3
- package/dist/{codecs-CIJRyUd3.d.mts.map → codecs-DTfUoamS.d.mts.map} +1 -1
- package/dist/{codecs-wVJlFapM.mjs → codecs-DVX-3El1.mjs} +429 -12
- package/dist/codecs-DVX-3El1.mjs.map +1 -0
- package/dist/{control-Dj8nIA1M.d.mts → control-B7v7zc3l.d.mts} +272 -13
- package/dist/control-B7v7zc3l.d.mts.map +1 -0
- package/dist/{control-D7_IpeiU.d.mts → control-BFe8NrSk.d.mts} +22 -5
- package/dist/control-BFe8NrSk.d.mts.map +1 -0
- package/dist/{control-BiZaCqna.mjs → control-BTolgwH5.mjs} +28 -13
- package/dist/control-BTolgwH5.mjs.map +1 -0
- package/dist/{control-CTfV1Zag.mjs → control-CZSBblPm.mjs} +26 -19
- package/dist/control-CZSBblPm.mjs.map +1 -0
- package/dist/{control-WNuLF2Wh.d.mts → control-DqJJGh-5.d.mts} +3 -3
- package/dist/control-DqJJGh-5.d.mts.map +1 -0
- package/dist/{control-RYDTbndD.mjs → control-DtXS4WsY.mjs} +9 -14
- package/dist/control-DtXS4WsY.mjs.map +1 -0
- package/dist/data-type-entries-DlbQ1Bvl-BFkHeHVz.mjs +108 -0
- package/dist/data-type-entries-DlbQ1Bvl-BFkHeHVz.mjs.map +1 -0
- package/dist/{data-types-65iVc7q1.d.mts → data-types-COQT9bVG.d.mts} +2 -2
- package/dist/data-types-COQT9bVG.d.mts.map +1 -0
- package/dist/data-types-CU_43cNv-CQ8eHx3H.mjs +461 -0
- package/dist/data-types-CU_43cNv-CQ8eHx3H.mjs.map +1 -0
- package/dist/{data-types-D2HAT-Qf-CSdDz1Pk.d.mts → data-types-C_vInIbm-Gt1XINav.d.mts} +58 -4
- package/dist/data-types-C_vInIbm-Gt1XINav.d.mts.map +1 -0
- package/dist/{date-time-now-generators-BKakW3gd-CIFPuRdM.mjs → date-time-now-generators-Cx_aQTSw-ay1tlvw6.mjs} +4 -15
- package/dist/date-time-now-generators-Cx_aQTSw-ay1tlvw6.mjs.map +1 -0
- package/dist/default-normalizer-C9c043DP-DPhwJOC4.mjs +175 -0
- package/dist/default-normalizer-C9c043DP-DPhwJOC4.mjs.map +1 -0
- package/dist/default-normalizer-zXWtDBp_.d.mts +31 -0
- package/dist/default-normalizer-zXWtDBp_.d.mts.map +1 -0
- package/dist/{descriptor-meta-e29H69KN-t-S8_DYh.mjs → descriptor-meta-BFQUMwkh-Bc3o-ZMV.mjs} +19 -12
- package/dist/descriptor-meta-BFQUMwkh-Bc3o-ZMV.mjs.map +1 -0
- package/dist/{descriptor-meta-BF6YvSag-ChHHvlHc.mjs → descriptor-meta-BHSEcFWR-41BcRcOy.mjs} +219 -25
- package/dist/descriptor-meta-BHSEcFWR-41BcRcOy.mjs.map +1 -0
- package/dist/descriptor-meta-runtime-BaIF7fOE-BX9t3rkk.mjs +17 -0
- package/dist/descriptor-meta-runtime-BaIF7fOE-BX9t3rkk.mjs.map +1 -0
- package/dist/descriptor-meta-runtime-DEKunXiL.d.mts +22 -0
- package/dist/descriptor-meta-runtime-DEKunXiL.d.mts.map +1 -0
- package/dist/driver.d.mts +3 -3
- package/dist/driver.mjs +2 -2
- package/dist/driver__control.d.mts +2 -2
- package/dist/driver__control.mjs +1 -1
- package/dist/driver__runtime.d.mts +2 -2
- package/dist/driver__runtime.mjs +1 -1
- package/dist/{errors-DjCkC9IM.d.mts → errors-B81Qeu5_.d.mts} +3 -2
- package/dist/errors-B81Qeu5_.d.mts.map +1 -0
- package/dist/{errors-Cng94tYg-DTH51xWG.mjs → errors-CWtFTnst-xBLJ-9Lp.mjs} +43 -17
- package/dist/errors-CWtFTnst-xBLJ-9Lp.mjs.map +1 -0
- package/dist/{marker-lock-Bwew7cAs-ElLxlCQp.mjs → marker-lock-B7CyXf2F-CakjZnQP.mjs} +3 -3
- package/dist/{marker-lock-Bwew7cAs-ElLxlCQp.mjs.map → marker-lock-B7CyXf2F-CakjZnQP.mjs.map} +1 -1
- package/dist/{marker-read-D1hp62hF-3-4fEgDD.mjs → marker-read-D1hp62hF-BSXs2TVo.mjs} +3 -3
- package/dist/{marker-read-D1hp62hF-3-4fEgDD.mjs.map → marker-read-D1hp62hF-BSXs2TVo.mjs.map} +1 -1
- package/dist/{migration-DILkj7kB.d.mts → migration-O-3NHVlW.d.mts} +2 -5
- package/dist/migration-O-3NHVlW.d.mts.map +1 -0
- package/dist/{mysql-contract-serializer-BnTKRSsN-BnV7fdYd.mjs → mysql-contract-serializer-D7NjmI2L-gTs-kAW1.mjs} +4 -4
- package/dist/{mysql-contract-serializer-BnTKRSsN-BnV7fdYd.mjs.map → mysql-contract-serializer-D7NjmI2L-gTs-kAW1.mjs.map} +1 -1
- package/dist/{mysql-database-CHl9-oSL-B1arvq6Q.mjs → mysql-database-ByniOtau-BKBIGgSm.mjs} +45 -17
- package/dist/mysql-database-ByniOtau-BKBIGgSm.mjs.map +1 -0
- package/dist/{now-expression-DVD18CUc-DJqdZY96.mjs → now-expression-DDHpZL6o-Ixs-vg-B.mjs} +3 -3
- package/dist/{now-expression-DVD18CUc-DJqdZY96.mjs.map → now-expression-DDHpZL6o-Ixs-vg-B.mjs.map} +1 -1
- package/dist/{pack-CqULIal0.d.mts → pack-C5_g-3YX.d.mts} +272 -11
- package/dist/{pack-CqULIal0.d.mts.map → pack-C5_g-3YX.d.mts.map} +1 -1
- package/dist/{require-temporal-DeDQhbTn-CdpjEWCB.mjs → require-temporal-DDdrgVtL-VOKxTqhD.mjs} +3 -3
- package/dist/{require-temporal-DeDQhbTn-CdpjEWCB.mjs.map → require-temporal-DDdrgVtL-VOKxTqhD.mjs.map} +1 -1
- package/dist/{runner-DEKKxDyw-Cdo1Ysod.mjs → runner-IjNtlp_v-DLCqpSh5.mjs} +68 -72
- package/dist/runner-IjNtlp_v-DLCqpSh5.mjs.map +1 -0
- package/dist/runtime-Bw6vKz9t.mjs +96 -0
- package/dist/runtime-Bw6vKz9t.mjs.map +1 -0
- package/dist/{runtime-DB0w8R7i.mjs → runtime-CHWztV6c.mjs} +66 -46
- package/dist/runtime-CHWztV6c.mjs.map +1 -0
- package/dist/{runtime-DN20lWEg.d.mts → runtime-CQ1V-8Yh.d.mts} +11 -4
- package/dist/runtime-CQ1V-8Yh.d.mts.map +1 -0
- package/dist/{runtime-CbqytTbM.d.mts → runtime-Ci3hPz1j.d.mts} +16 -5
- package/dist/runtime-Ci3hPz1j.d.mts.map +1 -0
- package/dist/{runtime-DUDdsFyy.mjs → runtime-_c_DZuYR.mjs} +18 -13
- package/dist/runtime-_c_DZuYR.mjs.map +1 -0
- package/dist/runtime-dn4-kzZV.d.mts +43 -0
- package/dist/runtime-dn4-kzZV.d.mts.map +1 -0
- package/dist/sql-renderer-CrnJ8cCo.d.mts +1 -0
- package/dist/sql-renderer-DfPaqPkD-DFaweHvr.mjs +501 -0
- package/dist/sql-renderer-DfPaqPkD-DFaweHvr.mjs.map +1 -0
- package/dist/sql-renderer-fnDhRUHs-CcsyIaZ4.d.mts +95 -0
- package/dist/sql-renderer-fnDhRUHs-CcsyIaZ4.d.mts.map +1 -0
- package/dist/{sql-utils-Cmv_TVa8-CNW3UmfQ.mjs → sql-utils-CveZhawQ-B2QmUlY0.mjs} +3 -3
- package/dist/{sql-utils-Cmv_TVa8-CNW3UmfQ.mjs.map → sql-utils-CveZhawQ-B2QmUlY0.mjs.map} +1 -1
- package/dist/{sql-utils-BE8tDXHs.mjs → sql-utils-DVH8boEI.mjs} +3 -6
- package/dist/sql-utils-DVH8boEI.mjs.map +1 -0
- package/dist/{statement-CT5tB4uX-CHqHFM3z.mjs → statement-a2Eekpu6-BDJa255m.mjs} +73 -67
- package/dist/statement-a2Eekpu6-BDJa255m.mjs.map +1 -0
- package/dist/target.d.mts +18 -16
- package/dist/target.mjs +21 -19
- package/dist/target__aggregates.d.mts +2 -0
- package/dist/target__aggregates.mjs +2 -0
- package/dist/target__codec-descriptor.d.mts +2 -2
- package/dist/target__codec-descriptor.mjs +1 -1
- package/dist/target__codec-ids.d.mts +2 -2
- package/dist/target__codec-ids.mjs +2 -2
- package/dist/target__codec-types.d.mts +2 -2
- package/dist/target__codecs.d.mts +2 -2
- package/dist/target__codecs.mjs +2 -2
- package/dist/target__control.d.mts +1 -1
- package/dist/target__control.mjs +2 -2
- package/dist/target__data-types.d.mts +3 -3
- package/dist/target__data-types.mjs +3 -3
- package/dist/target__default-normalizer.d.mts +2 -2
- package/dist/target__default-normalizer.mjs +2 -2
- package/dist/target__descriptor-meta-runtime.d.mts +2 -0
- package/dist/target__descriptor-meta-runtime.mjs +2 -0
- package/dist/target__errors.d.mts +1 -1
- package/dist/target__errors.mjs +1 -1
- package/dist/target__marker-lock.mjs +1 -1
- package/dist/target__migration.d.mts +1 -1
- package/dist/target__migration.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__runtime.d.mts +2 -2
- package/dist/target__runtime.mjs +4 -4
- package/dist/target__sql-utils.mjs +2 -2
- package/dist/target__types.mjs +1 -1
- package/package.json +13 -10
- package/dist/adapter-1Kd67Gfa.d.mts +0 -66
- package/dist/adapter-1Kd67Gfa.d.mts.map +0 -1
- package/dist/adapter__runtime.mjs.map +0 -1
- package/dist/codec-descriptor-3xp1XvVH-DfPKpYeP.mjs.map +0 -1
- package/dist/codec-descriptor-BRcKIX3h.d.mts +0 -2
- package/dist/codec-descriptor-DXyubAS6-XDBj6Yet.d.mts.map +0 -1
- package/dist/codec-descriptor-J3TP08l8-BmdgkIU6.d.mts +0 -1
- package/dist/codec-ids-CrR9Xi7r-CjbGCS3o.mjs +0 -20
- package/dist/codec-ids-CrR9Xi7r-CjbGCS3o.mjs.map +0 -1
- package/dist/codec-ids-Dgh5IpML-DGXIq6j8.d.mts +0 -20
- package/dist/codec-ids-Dgh5IpML-DGXIq6j8.d.mts.map +0 -1
- package/dist/codec-types-BS-lWfda.d.mts +0 -1
- package/dist/codec-types-Bai_CFkk-DmZ74URd.d.mts.map +0 -1
- package/dist/codec-types-Dk2h5dBB.d.mts +0 -1
- package/dist/codecs-BMidk26M-B_iWNti6.d.mts.map +0 -1
- package/dist/codecs-wVJlFapM.mjs.map +0 -1
- package/dist/control-BiZaCqna.mjs.map +0 -1
- package/dist/control-CTfV1Zag.mjs.map +0 -1
- package/dist/control-D7_IpeiU.d.mts.map +0 -1
- package/dist/control-Dj8nIA1M.d.mts.map +0 -1
- package/dist/control-RYDTbndD.mjs.map +0 -1
- package/dist/control-WNuLF2Wh.d.mts.map +0 -1
- package/dist/data-type-entries-C7VH2IHc-DM6TbTaz.mjs +0 -59
- package/dist/data-type-entries-C7VH2IHc-DM6TbTaz.mjs.map +0 -1
- package/dist/data-types-65iVc7q1.d.mts.map +0 -1
- package/dist/data-types-D2HAT-Qf-CSdDz1Pk.d.mts.map +0 -1
- package/dist/data-types-DOaaPS93-lycGybNk.mjs +0 -289
- package/dist/data-types-DOaaPS93-lycGybNk.mjs.map +0 -1
- package/dist/date-time-now-generators-BKakW3gd-CIFPuRdM.mjs.map +0 -1
- package/dist/default-normalizer-C8pc7SbL-BXd70q02.mjs +0 -100
- package/dist/default-normalizer-C8pc7SbL-BXd70q02.mjs.map +0 -1
- package/dist/default-normalizer-D-8Ii0df.d.mts +0 -27
- package/dist/default-normalizer-D-8Ii0df.d.mts.map +0 -1
- package/dist/descriptor-meta-BF6YvSag-ChHHvlHc.mjs.map +0 -1
- package/dist/descriptor-meta-e29H69KN-t-S8_DYh.mjs.map +0 -1
- package/dist/errors-Cng94tYg-DTH51xWG.mjs.map +0 -1
- package/dist/errors-DjCkC9IM.d.mts.map +0 -1
- package/dist/migration-DILkj7kB.d.mts.map +0 -1
- package/dist/mysql-database-CHl9-oSL-B1arvq6Q.mjs.map +0 -1
- package/dist/runner-DEKKxDyw-Cdo1Ysod.mjs.map +0 -1
- package/dist/runtime-CbqytTbM.d.mts.map +0 -1
- package/dist/runtime-Cm-T3hbP.d.mts +0 -29
- package/dist/runtime-Cm-T3hbP.d.mts.map +0 -1
- package/dist/runtime-DB0w8R7i.mjs.map +0 -1
- package/dist/runtime-DN20lWEg.d.mts.map +0 -1
- package/dist/runtime-DUDdsFyy.mjs.map +0 -1
- package/dist/sql-utils-BE8tDXHs.mjs.map +0 -1
- package/dist/statement-CT5tB4uX-CHqHFM3z.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runner-DEKKxDyw-Cdo1Ysod.mjs","names":["#written","#migrationModule","#calls","#meta","#spaceId","#snapshotsImportPath","#destination","#lowerer","#operationsCache","#target","#planSql","#applySpaces","#applySpace","#checkDestination","#checkPolicy","#ensureControlTables","#checkOrigin","#applyOperations","#writeMarkerAndLedger","#allHold","#runChecks","#runSteps","#writeLedger"],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/runner-DEKKxDyw.mjs"],"sourcesContent":["import { s as mysqlError } from \"./errors-Cng94tYg.mjs\";\nimport { n as quoteIdentifier } from \"./sql-utils-Cmv_TVa8.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-C8pc7SbL.mjs\";\nimport { i as withMarkerLock } from \"./marker-lock-Bwew7cAs.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 { ifDefined } from \"@internal/utils/defined\";\nimport { contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, diffSchemas, expectAbsent, expectPresent, failedPostcheckWhy, failedPrecheckWhy, issueOutcome, migrationRunnerFailure, orderIssuesByDependencies, schemaCheckWhy, withDatabaseUnchanged, withFailingSpace } from \"@internal/framework-components/control\";\nimport { NO_RENAMED_ORIGINS, checkDatabasePoliciesHeld, 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 { TsExpression, jsonToTsSource, renderImports } from \"@internal/ts-render\";\nimport { REFERENTIAL_ACTION_SQL } from \"@internal/sql-contract/referential-action-sql\";\nimport { notOk, ok, okVoid } from \"@internal/utils/result\";\nimport { Migration } from \"@internal/family-sql/migration\";\nimport { isThenable } from \"@internal/utils/promise\";\nimport { keepInternalSpecifiers, 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/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\n/** The module every MySQL `migration.ts` imports its base class and helpers from. */\nconst MYSQL_MIGRATION_MODULE = \"@internal/mysql/migration\";\n/** The module call nodes name in their import requirements. `renderCallsToTypeScript` replaces it with the migration module of the target the scaffold is for. */\nconst MIGRATION_MODULE_PLACEHOLDER = MYSQL_MIGRATION_MODULE;\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\ttargetIdFor(targetId) {\n\t\tif (targetId === void 0) throw new InternalError(`${this.factoryName}: an operation cannot be built without a target id; pass the id of the target the migration is for.`);\n\t\treturn targetId;\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: MIGRATION_MODULE_PLACEHOLDER,\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, targetId) {\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: this.targetIdFor(targetId),\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(MIGRATION_MODULE_PLACEHOLDER);\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: MIGRATION_MODULE_PLACEHOLDER,\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(_lowerer, targetId) {\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: this.targetIdFor(targetId),\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, targetId) {\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: this.targetIdFor(targetId),\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(MIGRATION_MODULE_PLACEHOLDER);\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(_lowerer, targetId) {\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: this.targetIdFor(targetId),\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(_lowerer, targetId) {\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: this.targetIdFor(targetId),\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(_lowerer, targetId) {\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: this.targetIdFor(targetId),\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(_lowerer, targetId) {\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: this.targetIdFor(targetId),\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(_lowerer, targetId) {\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: this.targetIdFor(targetId),\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(_lowerer, targetId) {\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: this.targetIdFor(targetId),\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(_lowerer, targetId) {\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: this.targetIdFor(targetId),\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: MIGRATION_MODULE_PLACEHOLDER,\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, targetId) {\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: targetId,\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/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/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 by the migration planner (${placeOf(issue, conflictLocation)})`,\n\t\twhy: \"The migration 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 the database allows (${placeText(at)})`,\n\t\twhy: `The database 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 by the database (${call.tableName}.${column.name})`,\n\t\twhy: \"The database 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 by the migration planner (${tableName})`,\n\t\twhy: \"The database 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 `migration.ts` for MySQL or a target that extends it, such as MariaDB. Each protected method returns the operation its name says, for the target `targetId` names, rendered through the control adapter the migration CLI builds from `prisma.config.ts`.\n*/\nvar MysqlMigrationBase = class extends Migration {\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\"), this.targetId);\n\t}\n\tdropTable(options) {\n\t\treturn new DropTableCall(options.table).toOp(void 0, this.targetId);\n\t}\n\taddColumn(options) {\n\t\treturn new AddColumnCall(options.table, options.column).toOp(this.adapterFor(\"addColumn\"), this.targetId);\n\t}\n\tdropColumn(options) {\n\t\treturn new DropColumnCall(options.table, options.column).toOp(void 0, this.targetId);\n\t}\n\tcreateIndex(options) {\n\t\treturn new CreateIndexCall(options.table, options.index, options.columns, options.unique === true).toOp(void 0, this.targetId);\n\t}\n\tdropIndex(options) {\n\t\treturn new DropIndexCall(options.table, options.index).toOp(void 0, this.targetId);\n\t}\n\taddUnique(options) {\n\t\treturn new AddUniqueCall(options.table, options.name, options.columns).toOp(void 0, this.targetId);\n\t}\n\tdropUnique(options) {\n\t\treturn new DropUniqueCall(options.table, options.name).toOp(void 0, this.targetId);\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(void 0, this.targetId);\n\t}\n\tdropForeignKey(options) {\n\t\treturn new DropForeignKeyCall(options.table, options.name).toOp(void 0, this.targetId);\n\t}\n};\n/** The base class of a MySQL `migration.ts`. */\nvar MysqlMigration = class extends MysqlMigrationBase {\n\ttargetId = \"mysql\";\n};\n//#endregion\n//#region src/core/migrations/render-ops.ts\nfunction assertTargetOp(op, factoryName, expectedTargetId) {\n\tconst targetId = blindCast(op).target?.id;\n\tif (targetId !== expectedTargetId) throw new InternalError(`renderOps: expected a ${expectedTargetId} operation but got target.id=\"${String(targetId)}\" for op.id=\"${op.id}\" (factoryName=\"${factoryName}\").`);\n}\nfunction checkedOp(opOrPromise, factoryName, targetId) {\n\tif (isThenable(opOrPromise)) {\n\t\tconst checked = opOrPromise.then((op) => {\n\t\t\tassertTargetOp(op, factoryName, targetId);\n\t\t\treturn op;\n\t\t});\n\t\tchecked.catch(() => void 0);\n\t\treturn checked;\n\t}\n\tassertTargetOp(opOrPromise, factoryName, targetId);\n\treturn opOrPromise;\n}\n/** The operations `calls` lower to, in order, each checked to be an operation of the target `targetId` names. */\nfunction renderOps(calls, lowerer, targetId) {\n\treturn calls.map((call) => checkedOp(isMysqlOpFactoryCall(call) ? call.toOp(lowerer, targetId) : blindCast(call).toOp(lowerer), call.factoryName, targetId));\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 facade's `migration` module. */\nconst BASE_IMPORTS = [{\n\tmoduleSpecifier: MIGRATION_MODULE_PLACEHOLDER,\n\tsymbol: \"Migration\"\n}, {\n\tmoduleSpecifier: MIGRATION_MODULE_PLACEHOLDER,\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\tconst resolve = meta.resolveImportSpecifier ?? keepInternalSpecifiers;\n\treturn renderImports(resolveRequirementSpecifiers(requirements, (specifier) => resolve(specifier === \"@internal/mysql/migration\" ? meta.migrationModule : specifier)));\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 MysqlMigrationBase {\n\ttargetId;\n\t#migrationModule;\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.targetId = options.target.targetId;\n\t\tthis.#migrationModule = options.target.migrationModule;\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, this.targetId);\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\tmigrationModule: this.#migrationModule\n\t\t});\n\t}\n};\n//#endregion\n//#region src/core/migrations/planner.ts\nfunction tableRenameByHand(targetId) {\n\treturn {\n\t\trenderTableRename: (rename) => new RawSqlCall(renameTableByHandOp(rename.from, rename.to, targetId)).renderTypeScript(),\n\t\ttableRenameByHand: (rename) => [`RENAME TABLE ${quoteIdentifier(rename.from)} TO ${quoteIdentifier(rename.to)}`]\n\t};\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, for MySQL or a target that extends it. 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\t#target;\n\tconstructor(lowerer, target) {\n\t\tthis.#lowerer = lowerer;\n\t\tthis.#target = target;\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\ttarget: this.#target\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\ttarget: this.#target\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: tableRenameByHand(this.#target.targetId),\n\t\t\t\tremovedVariants: []\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 by the migration planner`,\n\t\twhy: \"The migration 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, target) {\n\treturn new MysqlMigrationPlanner(lowerer, target);\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, expectedDatabasePolicies } = options;\n\t\tif (perSpaceOptions.length === 0) return ok({ perSpaceResults: [] });\n\t\treturn withMarkerLock(driver, async () => {\n\t\t\tif (expectedDatabasePolicies !== void 0) {\n\t\t\t\tconst policiesCheck = await checkDatabasePoliciesHeld(this.family, driver, expectedDatabasePolicies);\n\t\t\t\tif (!policiesCheck.ok) return notOk(withDatabaseUnchanged(policiesCheck.failure, true));\n\t\t\t}\n\t\t\treturn this.#applySpaces(driver, perSpaceOptions);\n\t\t}, (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 atDestination = existingMarker !== null && existingMarker.storageHash === options.plan.destination.storageHash && (options.plan.destination.profileHash === void 0 || existingMarker.profileHash === options.plan.destination.profileHash);\n\t\tconst applied = atDestination && 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\tconst incomingIsSubsetOfExisting = options.plan.providedInvariants.every((id) => existingInvariants.has(id));\n\t\tconst isSelfEdgeNoOp = isSelfEdge && applied.executedCount === 0 && incomingIsSubsetOfExisting;\n\t\tconst recordsPoliciesOnly = options.databasePolicies !== void 0 && applied.executedCount === 0 && atDestination && incomingIsSubsetOfExisting;\n\t\tif (!isSelfEdgeNoOp || options.databasePolicies !== void 0) {\n\t\t\tconst written = await this.#writeMarkerAndLedger(driver, options, existingMarker, isSelfEdgeNoOp || recordsPoliciesOnly ? void 0 : 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\t...ifDefined(\"databasePolicies\", options.databasePolicies)\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\treason: \"storageHash\",\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\tif (executed !== void 0) await 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 { MYSQL_MIGRATION_MODULE as _, MysqlMigration as a, diffMysqlSchema as b, AddForeignKeyCall as c, CreateTableCall as d, DropColumnCall as f, DropUniqueCall as g, DropTableCall as h, TypeScriptRenderableMysqlMigration as i, AddUniqueCall as l, DropIndexCall as m, MysqlMigrationPlanner as n, MysqlMigrationBase as o, DropForeignKeyCall as p, createMysqlMigrationPlanner as r, AddColumnCall as s, createMysqlMigrationRunner as t, CreateIndexCall as u, RawSqlCall as v, mysqlContractToSchema as x, rawSql as y };\n\n//# sourceMappingURL=runner-DEKKxDyw.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;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BAC1B,cAAc,SAAS;;;;cAI1B;WACH;WACA,iBAAiB;;WAEjB;WACA,iBAAiB;;WAEjB;WACA,iBAAiB;;WAEjB;WACA,iBAAiB;;WAEjB;WACA,iBAAiB,UAAU;;WAE3B;WACA,iBAAiB;;;;;cAKd,gCAAgC,0BAA0B,SAAS;EAC/E;YACU,yBAAyB,cAAc,KAAK,0BAA0B,YAAY;EAC5F,kBAAkB,UAAU,SAAS,cAAc;;;;UAI3C,mCAAmC;cAC/B,8BAA8B,oCAAoC;;;cAGlE;WACH;WACA;WACA;WACA;;KAEN,8BAA8B,mCAAmC;cACxD,yEAAyE;iBACtE,4BAA4B,iBAAiB"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { i as MysqlCodecRegistry } from "./codecs-CIJRyUd3.mjs";
|
|
2
|
-
import "./codec-descriptor-BRcKIX3h.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/1-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-Cm-T3hbP.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-Cm-T3hbP.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-DB0w8R7i.mjs","names":["#url","#idleTimeoutMillis","#closed","#idleTimer","#connection","#open","#setAside","#pending","#pendingOn","#idleLater","#streamRows","#runReleasing","#stopEarly","#refuseIfUnusable","#onRelease","#cancelRunning","#runningSettled","#close","#released","#count","#idle","#fail","#canceller","#options","#sessionSettings","#state","#inUse"],"sources":["../../../../3-targets/mysql/1-mysql/3-driver/dist/runtime.mjs"],"sourcesContent":["import { a as connectingCannotSucceed, c as isFatal, d as mysqlConnectionOptions, f as mysqlPoolIdleTimeoutMillis, l as normalizeMysqlError, m as acquireClientQueryLock, n as SessionSettingsGuard, p as mysqlPoolOptions, t as statementFor, u as mysqlDriverDescriptorMetaFor } from \"./statement-CT5tB4uX.mjs\";\nimport { errorRuntime } from \"@internal/errors/execution\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { createConnection, createPool } from \"mariadb\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { EventEmitter } from \"node:events\";\nimport { finished } from \"node:stream/promises\";\nimport { validateMysqlIsolationLevel } from \"@internal/target-mysql/runtime\";\n//#region src/core/runtime/canceller.ts\n/** How long the canceller waits to open its connection, and for MySQL to answer a `KILL QUERY`. */\nconst CANCEL_TIMEOUT_MILLIS = 2e3;\nfunction timeout(millis) {\n\tlet timer;\n\treturn {\n\t\texpired: new Promise((resolve) => {\n\t\t\ttimer = setTimeout(() => resolve(\"expired\"), millis);\n\t\t}),\n\t\tclear: () => clearTimeout(timer)\n\t};\n}\n/**\n* Cancels statements with `KILL QUERY`, which MySQL takes only from another connection. It keeps one connection of its own, outside the pool, so a cancel neither waits for a pooled connection nor normally opens one; it opens it on first need, and ends it once it has been idle for the pool's idle timeout, as the pool ends its own; with a timeout of 0 it keeps it open, as the pool keeps its own. Opening it and each `KILL QUERY` are bounded by two seconds. The connection is never destroyed: the package's `destroy()` sends a `KILL` of its own whose failure it does not handle (`mariadb` 3.5.4). A connection that stops answering is set aside and ended with `end()` once its statement settles.\n*/\nvar Canceller = class {\n\t#url;\n\t#idleTimeoutMillis;\n\t#connection;\n\t#pending = /* @__PURE__ */ new WeakMap();\n\t#closed = false;\n\t#idleTimer;\n\tconstructor(url, idleTimeoutMillis) {\n\t\tthis.#url = url;\n\t\tthis.#idleTimeoutMillis = idleTimeoutMillis;\n\t}\n\t/** Sends `KILL QUERY` for `threadId`. Never rejects. A kept connection that is no longer valid is replaced once. */\n\tasync cancel(threadId, replaced = false) {\n\t\tif (this.#closed || threadId === null) return \"unsent\";\n\t\tclearTimeout(this.#idleTimer);\n\t\tconst opening = this.#connection ?? this.#open();\n\t\tthis.#connection = opening;\n\t\tconst connection = await opening;\n\t\tif (connection === void 0) {\n\t\t\tthis.#setAside(opening);\n\t\t\treturn \"unsent\";\n\t\t}\n\t\tif (!connection.isValid()) {\n\t\t\tthis.#setAside(opening);\n\t\t\treturn replaced ? \"unsent\" : this.cancel(threadId, true);\n\t\t}\n\t\tthis.#pending.set(connection, this.#pendingOn(connection) + 1);\n\t\tconst killing = connection.query(\"KILL QUERY ?\", [threadId]).then(() => \"sent\", (error) => isFatal(error) ? \"unconfirmed\" : \"unsent\");\n\t\tkilling.then(() => {\n\t\t\tthis.#pending.set(connection, this.#pendingOn(connection) - 1);\n\t\t\tthis.#idleLater(opening, connection);\n\t\t});\n\t\tconst limit = timeout(CANCEL_TIMEOUT_MILLIS);\n\t\tconst result = await Promise.race([killing, limit.expired]);\n\t\tlimit.clear();\n\t\tif (result === \"sent\" || result === \"unsent\") return result;\n\t\tthis.#setAside(opening);\n\t\tconnection.end().catch(() => void 0);\n\t\treturn \"unconfirmed\";\n\t}\n\t/** Ends the connection: `end()` sends `QUIT` once any `KILL QUERY` on it settles. Waits for that only when no `KILL QUERY` is pending on it, so a connection that stopped answering cannot hold `close()` up. */\n\tasync close() {\n\t\tthis.#closed = true;\n\t\tclearTimeout(this.#idleTimer);\n\t\tconst connection = await this.#connection;\n\t\tthis.#connection = void 0;\n\t\tif (connection === void 0) return;\n\t\tconst ending = connection.end().catch(() => void 0);\n\t\tif (this.#pendingOn(connection) === 0) await ending;\n\t}\n\t#idleLater(opening, connection) {\n\t\tif (this.#idleTimeoutMillis === 0 || this.#pendingOn(connection) > 0 || this.#connection !== opening) return;\n\t\tclearTimeout(this.#idleTimer);\n\t\tthis.#idleTimer = setTimeout(() => {\n\t\t\tif (this.#pendingOn(connection) > 0 || this.#connection !== opening) return;\n\t\t\tthis.#connection = void 0;\n\t\t\tconnection.end().catch(() => void 0);\n\t\t}, this.#idleTimeoutMillis);\n\t\tthis.#idleTimer.unref();\n\t}\n\t#pendingOn(connection) {\n\t\treturn this.#pending.get(connection) ?? 0;\n\t}\n\t#setAside(opening) {\n\t\tif (this.#connection === opening) this.#connection = void 0;\n\t}\n\tasync #open() {\n\t\ttry {\n\t\t\tconst connection = await createConnection(mysqlConnectionOptions(this.#url, { connectTimeoutMs: CANCEL_TIMEOUT_MILLIS }));\n\t\t\tconnection.on(\"error\", () => void 0);\n\t\t\tif (this.#closed) {\n\t\t\t\tawait connection.end().catch(() => void 0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn connection;\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n};\n//#endregion\n//#region src/core/runtime/mysql-driver.ts\nfunction notConnected(message) {\n\treturn errorRuntime(\"DRIVER.NOT_CONNECTED\", message, { fix: \"Call connect(binding) before running queries, and do not use the driver after close().\" });\n}\n/** Runs `request` on `client` in one round trip and returns its result: its `?N` placeholders written as `?`, and its values handed to the package, which writes them into the statement. Throws the package's error as it is. */\nasync function run(client, request) {\n\tconst { sql, values } = statementFor(client, request.sql, request.params ?? []);\n\treturn client.query(sql, values);\n}\n/** Starts streaming the rows of `request` on `client`, sent as {@link run} sends it. Throws the error to report, after noting in `outcome` whether it left the client unusable. */\nfunction startStream(client, request, outcome) {\n\ttry {\n\t\tconst { sql, values } = statementFor(client, request.sql, request.params ?? []);\n\t\treturn client.queryStream(sql, values);\n\t} catch (error) {\n\t\tsettle(error, outcome);\n\t}\n}\n/** What a statement's result reports: the rows it changed, and, when it changed one row, the value MySQL numbered for it. MySQL reports 0 when it numbered none. */\nfunction statementStats(result) {\n\tif (typeof result !== \"object\" || result === null) return { affectedRows: 0 };\n\tconst affectedRows = \"affectedRows\" in result && typeof result.affectedRows === \"number\" ? result.affectedRows : 0;\n\tconst insertId = \"insertId\" in result ? result.insertId : void 0;\n\treturn affectedRows === 1 && (typeof insertId === \"bigint\" || typeof insertId === \"number\") && insertId > 0 ? {\n\t\taffectedRows,\n\t\tinsertId: String(insertId)\n\t} : { affectedRows };\n}\n/** The error to report for `error`, after noting in `outcome` whether it left the client unusable. */\nfunction settle(error, outcome) {\n\tif (isFatal(error)) outcome.destroy = true;\n\tthrow normalizeMysqlError(error);\n}\n/**\n* Whether the package has received the end of the result, so that any rows the caller has not read are already in the stream's buffer. The package pushes the end of the stream when MySQL's last packet arrives; Node records that in `_readableState.ended`, and its public API reports the end only after the caller has read every row.\n*/\nfunction resultReceived(rows) {\n\tconst state = \"_readableState\" in rows ? rows._readableState : void 0;\n\treturn typeof state === \"object\" && state !== null && \"ended\" in state && state.ended === true;\n}\n/**\n* Reads and drops what is left of a stream's result. The package's `close()` stops it keeping new rows; the rows already buffered are read here with `read()`, which works whether or not the caller's iterator is still attached to the stream, so an iterator the caller abandoned cannot hold the drain up.\n*/\nasync function dropRest(rows) {\n\trows.close?.();\n\tconst drain = () => {\n\t\twhile (rows.read() !== null);\n\t};\n\trows.on(\"readable\", drain);\n\ttry {\n\t\tdrain();\n\t\tawait finished(rows);\n\t} finally {\n\t\trows.off(\"readable\", drain);\n\t}\n}\nfunction cancelNotConfirmed() {\n\treturn errorRuntime(\"DRIVER.NOT_CONNECTED\", \"A cancel on this MySQL connection could not be confirmed, so the connection can no longer be used\", {\n\t\twhy: \"The driver cancelled a stream the caller stopped early, and MySQL did not answer the KILL QUERY in time. It may still arrive and would interrupt whatever statement the connection runs then.\",\n\t\tfix: \"Release the connection, which closes it; MySQL rolls back an open transaction on it. Acquire another connection and run the work again.\"\n\t});\n}\nfunction connectionReleased() {\n\treturn errorRuntime(\"DRIVER.NOT_CONNECTED\", \"MySQL connection was released\", { fix: \"Send statements on a connection only until you release it, and await each one before release().\" });\n}\n/** The package can report an error on a stream after the caller stopped reading it, such as MySQL's for a statement the driver cancelled; the generator has already settled by then. */\nfunction ignoreAfterStop() {}\n/** MySQL's error for a statement `KILL QUERY` cancelled (`ER_QUERY_INTERRUPTED`). The package marks it fatal when it arrives in the middle of a result, but the connection stays usable. */\nfunction isQueryInterrupted(error) {\n\treturn error instanceof Error && \"errno\" in error && error.errno === 1317;\n}\nvar MysqlQueryable = class {\n\tstreams;\n\tconstructor(streams) {\n\t\tthis.streams = streams;\n\t}\n\t/** Records a stream that is open, and returns the call that records its end. */\n\tstreamOpened(_rows) {\n\t\treturn () => {};\n\t}\n\t/** Takes the client's lock, which keeps statements on it one at a time in the order sent. */\n\tlockClient(client) {\n\t\treturn acquireClientQueryLock(client);\n\t}\n\t/** Runs one statement that is not a stream, under the client's lock. */\n\trunStatement(work) {\n\t\treturn work();\n\t}\n\t/** Whether the client went back to the pool under this queryable, so it must send nothing more on it. */\n\tget handedBack() {\n\t\treturn false;\n\t}\n\tasync *query(request) {\n\t\tif (this.streams) {\n\t\t\tyield* this.#streamRows(request);\n\t\t\treturn;\n\t\t}\n\t\tconst result = await this.#runReleasing(request);\n\t\tfor (const row of Array.isArray(result) ? result : []) yield blindCast(row);\n\t}\n\tasync execute(request) {\n\t\treturn statementStats(await this.#runReleasing(request));\n\t}\n\tasync #runReleasing(request) {\n\t\tconst client = await this.acquireClient();\n\t\tconst outcome = { destroy: false };\n\t\ttry {\n\t\t\tconst releaseLock = await this.lockClient(client);\n\t\t\ttry {\n\t\t\t\treturn await this.runStatement(() => run(client, request));\n\t\t\t} finally {\n\t\t\t\treleaseLock();\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tsettle(error, outcome);\n\t\t} finally {\n\t\t\tawait this.releaseClient(client, outcome);\n\t\t}\n\t}\n\t/**\n\t* Streams the rows of `request` as they arrive; the package pauses the socket while the caller is busy. A caller that stops reading early is handled by {@link MysqlQueryable.#stopEarly}. A fatal error, such as a lost connection, destroys the client.\n\t*/\n\tasync *#streamRows(request) {\n\t\tconst client = await this.acquireClient();\n\t\tconst outcome = { destroy: false };\n\t\tlet releaseLock;\n\t\ttry {\n\t\t\treleaseLock = await this.lockClient(client);\n\t\t} catch (error) {\n\t\t\tawait this.releaseClient(client, outcome);\n\t\t\tthrow error;\n\t\t}\n\t\ttry {\n\t\t\tconst rows = startStream(client, request, outcome);\n\t\t\trows.on(\"error\", ignoreAfterStop);\n\t\t\tconst streamClosed = this.streamOpened(rows);\n\t\t\tlet settled = false;\n\t\t\ttry {\n\t\t\t\tfor await (const row of rows.iterator({ destroyOnReturn: false })) yield blindCast(row);\n\t\t\t\tsettled = true;\n\t\t\t} catch (error) {\n\t\t\t\tsettled = true;\n\t\t\t\tsettle(error, outcome);\n\t\t\t} finally {\n\t\t\t\tif (!settled && !this.handedBack) await this.#stopEarly(client, rows, outcome);\n\t\t\t\tif (outcome.destroy) rows.destroy();\n\t\t\t\tstreamClosed();\n\t\t\t}\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t\tawait this.releaseClient(client, outcome);\n\t\t}\n\t}\n\t/**\n\t* Ends a stream the caller stopped reading early, and keeps the client usable. While its result is still arriving, the statement is first cancelled with `KILL QUERY`, so a large result is not downloaded only to be thrown away; MySQL does not say how many rows remain. On a held connection or in a transaction, as on a pooled one: `KILL QUERY` ends only the statement, the session survives, and in a transaction MySQL rolls back only that statement. The rest of the result is then read and dropped, MySQL's error for the cancelled statement among it. The client is never destroyed while its statement runs: the package's `destroy()` would send `KILL` itself, on a connection whose failure it does not handle.\n\t*/\n\tasync #stopEarly(client, rows, outcome) {\n\t\tconst cancel = resultReceived(rows) ? \"unsent\" : await this.cancelStatement(client.threadId);\n\t\tawait dropRest(rows).catch((error) => {\n\t\t\tif (isFatal(error) && !(cancel !== \"unsent\" && isQueryInterrupted(error))) outcome.destroy = true;\n\t\t});\n\t\tif (cancel === \"unconfirmed\") this.cancelUnconfirmed(outcome);\n\t}\n\t/**\n\t* A cancel that went out without an answer may still reach MySQL and interrupt the next statement on the client, so the client must not serve another caller. Once its rest has been read, nothing is receiving on it, so closing it sends no `KILL` of the package's own; a late `KILL QUERY` then finds no thread.\n\t*/\n\tcancelUnconfirmed(outcome) {\n\t\toutcome.destroy = true;\n\t}\n};\nfunction handedBackState() {\n\tlet refuse = () => {};\n\tconst signal = new Promise((_, reject) => {\n\t\trefuse = () => reject(connectionReleased());\n\t});\n\tsignal.catch(() => void 0);\n\tconst state = {\n\t\tdone: false,\n\t\tsignal,\n\t\trefuse: () => {\n\t\t\tstate.done = true;\n\t\t\trefuse();\n\t\t}\n\t};\n\treturn state;\n}\n/**\n* A queryable on a connection the caller holds, whose statements all run on the same session, in the order they are sent, under the client's lock. A statement sent while a stream on the connection is open waits for that stream to end; one awaited inside the stream's own loop never finishes, as on Postgres with a cursor.\n*/\nvar MysqlHeldQueryable = class extends MysqlQueryable {\n\tclient;\n\theld;\n\tholdsClient = true;\n\tget cancelStatement() {\n\t\treturn this.held.cancel;\n\t}\n\tstreamOpened(rows) {\n\t\tthis.held.streams.add(rows);\n\t\treturn () => this.held.streams.delete(rows);\n\t}\n\tget handedBack() {\n\t\treturn this.held.handedBack.done;\n\t}\n\tcancelUnconfirmed() {\n\t\tthis.held.cancelUnconfirmed = true;\n\t}\n\t/** Takes the client's lock, or fails once the connection is handed back, whether the statement was sent after that or was still waiting for the lock. A lock taken after that is given straight back. */\n\tasync lockClient(client) {\n\t\tthis.#refuseIfUnusable();\n\t\tconst locking = acquireClientQueryLock(client);\n\t\ttry {\n\t\t\tconst releaseLock = await Promise.race([locking, this.held.handedBack.signal]);\n\t\t\tif (!this.held.handedBack.done && !this.held.cancelUnconfirmed) return releaseLock;\n\t\t\treleaseLock();\n\t\t} catch {\n\t\t\tlocking.then((releaseLock) => releaseLock());\n\t\t}\n\t\tthis.#refuseIfUnusable();\n\t\tthrow connectionReleased();\n\t}\n\t/** Refuses a statement on a connection that was handed back, or whose cancel went out without an answer: a late `KILL QUERY` would interrupt it. */\n\t#refuseIfUnusable() {\n\t\tif (this.held.handedBack.done) throw connectionReleased();\n\t\tif (this.held.cancelUnconfirmed) throw cancelNotConfirmed();\n\t}\n\trunStatement(work) {\n\t\tconst running = work();\n\t\tthis.held.running.add(running);\n\t\trunning.then(() => this.held.running.delete(running), () => this.held.running.delete(running));\n\t\treturn running;\n\t}\n\tconstructor(client, held, streams) {\n\t\tsuper(streams);\n\t\tthis.client = client;\n\t\tthis.held = held;\n\t}\n\tasync acquireClient() {\n\t\tthis.#refuseIfUnusable();\n\t\treturn this.client;\n\t}\n\tasync releaseClient() {}\n\t/** Runs one of the package's transaction calls under the client's lock, taken as a statement takes it, so it keeps its place among the statements sent. */\n\tasync underLock(call) {\n\t\tconst client = await this.acquireClient();\n\t\tconst releaseLock = await this.lockClient(client);\n\t\ttry {\n\t\t\tawait this.runStatement(call);\n\t\t} catch (error) {\n\t\t\tthrow normalizeMysqlError(error);\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t}\n\t}\n};\nvar MysqlConnectionImpl = class extends MysqlHeldQueryable {\n\t#onRelease;\n\tconstructor(client, streams, cancel, onRelease) {\n\t\tsuper(client, {\n\t\t\tstreams: /* @__PURE__ */ new Set(),\n\t\t\tcancelUnconfirmed: false,\n\t\t\trunning: /* @__PURE__ */ new Set(),\n\t\t\tcancel,\n\t\t\thandedBack: handedBackState()\n\t\t}, streams);\n\t\tthis.#onRelease = onRelease;\n\t}\n\t#released() {\n\t\tconst onRelease = this.#onRelease;\n\t\tthis.#onRelease = void 0;\n\t\tonRelease?.();\n\t}\n\tasync beginTransaction(start) {\n\t\tconst isolationLevel = start?.isolationLevel === void 0 ? void 0 : validateMysqlIsolationLevel(start.isolationLevel);\n\t\tconst statements = {\n\t\t\tReadUncommitted: \"SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED\",\n\t\t\tReadCommitted: \"SET TRANSACTION ISOLATION LEVEL READ COMMITTED\",\n\t\t\tRepeatableRead: \"SET TRANSACTION ISOLATION LEVEL REPEATABLE READ\",\n\t\t\tSerializable: \"SET TRANSACTION ISOLATION LEVEL SERIALIZABLE\"\n\t\t};\n\t\tawait this.underLock(async () => {\n\t\t\tif (isolationLevel !== void 0) await this.client.query(statements[isolationLevel]);\n\t\t\tawait this.client.beginTransaction();\n\t\t});\n\t\treturn new MysqlTransactionImpl(this.client, this.held, this.streams);\n\t}\n\t/**\n\t* Returns the connection to the pool, as the Postgres driver's `release()` does. From then on the connection refuses every statement, those still waiting for its lock included, so none runs later in another caller's session. A statement that is not a stream and is already running finishes, as on Postgres. A stream still open, such as one the caller dropped, is cancelled and read to its end by the driver: the package's release sends `ROLLBACK` behind that statement and waits for it, which would otherwise never finish, where `pg`'s release does not wait on the server.\n\t*/\n\tasync release() {\n\t\tif (this.held.handedBack.done) return;\n\t\tthis.held.handedBack.refuse();\n\t\ttry {\n\t\t\tif (this.held.streams.size > 0) await this.#cancelRunning();\n\t\t\tawait this.#runningSettled();\n\t\t\tif (this.held.cancelUnconfirmed) await this.#close();\n\t\t\telse await this.client.release();\n\t\t} finally {\n\t\t\tthis.#released();\n\t\t}\n\t}\n\t/** Closes the connection instead of returning it. It refuses every statement from then on, cancels whatever still runs and waits for it to end, so the package's `destroy()` never sends a `KILL` of its own. */\n\tasync destroy(_reason) {\n\t\tif (this.held.handedBack.done) return;\n\t\tthis.held.handedBack.refuse();\n\t\ttry {\n\t\t\tif (this.held.streams.size > 0 || this.held.running.size > 0) await this.#cancelRunning();\n\t\t\tawait this.#runningSettled();\n\t\t\tawait this.#close();\n\t\t} finally {\n\t\t\tthis.#released();\n\t\t}\n\t}\n\t/** Closes the client once the `ping` queued behind anything left on it has answered, so nothing is receiving and the package's `destroy()` sends no `KILL` of its own. */\n\tasync #close() {\n\t\tawait this.client.ping().catch(() => void 0);\n\t\tthis.client.destroy();\n\t}\n\tasync #cancelRunning() {\n\t\tif (await this.held.cancel(this.client.threadId) === \"unconfirmed\") this.held.cancelUnconfirmed = true;\n\t\tawait Promise.all([...this.held.streams].map((rows) => dropRest(rows).catch(() => void 0)));\n\t}\n\tasync #runningSettled() {\n\t\tawait Promise.allSettled([...this.held.running]);\n\t}\n};\nvar MysqlTransactionImpl = class extends MysqlHeldQueryable {\n\tasync commit() {\n\t\tawait this.underLock(() => this.client.commit());\n\t}\n\tasync rollback() {\n\t\tawait this.underLock(() => this.client.rollback());\n\t}\n\tasync savepoint(name) {\n\t\tawait this.underLock(() => this.client.query(`SAVEPOINT ${name}`));\n\t\treturn new MysqlSavepointImpl(this.client, this.held, this.streams, name);\n\t}\n};\nvar MysqlSavepointImpl = class MysqlSavepointImpl extends MysqlHeldQueryable {\n\tname;\n\tconstructor(client, held, streams, name) {\n\t\tsuper(client, held, streams);\n\t\tthis.name = name;\n\t}\n\tasync commit() {\n\t\tawait this.underLock(() => this.client.query(`RELEASE SAVEPOINT ${this.name}`));\n\t}\n\tasync rollback() {\n\t\tawait this.underLock(() => this.client.query(`ROLLBACK TO SAVEPOINT ${this.name}`));\n\t}\n\tasync savepoint(name) {\n\t\tawait this.underLock(() => this.client.query(`SAVEPOINT ${name}`));\n\t\treturn new MysqlSavepointImpl(this.client, this.held, this.streams, name);\n\t}\n};\n/** How many clients the driver has handed out and not had back, a held connection or one lent to a single statement, so `close()` can wait until every one is back. */\nvar ClientsInUse = class {\n\t#count = 0;\n\t#idle = [];\n\tacquired() {\n\t\tthis.#count += 1;\n\t}\n\treleased() {\n\t\tthis.#count -= 1;\n\t\tif (this.#count === 0) for (const resolve of this.#idle.splice(0)) resolve();\n\t}\n\tnone() {\n\t\treturn this.#count === 0 ? Promise.resolve() : new Promise((resolve) => this.#idle.push(resolve));\n\t}\n};\n/** The pool reports a connection it failed to open on its `'error'` event, and again as the cause of a `getConnection` that times out; the driver reports it there. */\nfunction ignoreConnectionFailure() {}\n/**\n* The statements waiting for a connection from the pool. The pool keeps retrying a connection it cannot open, with a growing pause between attempts, and fails a waiting `getConnection` only when `connectionTimeoutMillis` ends; the package reports each failure to its `logger.error` as it happens, together with every failed statement. `pg.Pool` instead rejects a pending connect whose connection fails, at once. So the driver fails the waiting statements at once with a failure no retry can get past. It keeps no failure: a later statement waits for the pool's next attempt.\n*/\nvar WaitingForConnection = class {\n\t#fail = /* @__PURE__ */ new Set();\n\tasync race(getting) {\n\t\tlet fail = () => {};\n\t\tconst failed = new Promise((_, reject) => {\n\t\t\tfail = reject;\n\t\t});\n\t\tthis.#fail.add(fail);\n\t\ttry {\n\t\t\treturn await Promise.race([getting, failed]);\n\t\t} finally {\n\t\t\tthis.#fail.delete(fail);\n\t\t}\n\t}\n\t/** Reacts to an error the package reports: only a failure to connect, which the package marks fatal, that no retry can get past. A statement can fail with the same error number, such as 1524 for a missing authentication plugin, but not fatally. */\n\treported(error) {\n\t\tif (!isFatal(error) || !connectingCannotSucceed(error)) return;\n\t\tfor (const fail of this.#fail) fail(error);\n\t\tthis.#fail.clear();\n\t}\n};\n/** Gives a connection the pool hands over after its statement stopped waiting back to the pool. */\nfunction releaseLate(getting) {\n\tgetting.then((late) => late.release(), ignoreConnectionFailure).catch(ignoreConnectionFailure);\n}\n/**\n* The MySQL runtime driver: a `mariadb` pool. Every statement takes one round trip over the text protocol, the package writing its values into it. A query reads its whole result before the first row unless `stream` is set. The pool runs the session setup once on each physical connection, and the driver then sets the target's session settings on it; a connection goes back to the pool after each statement as it is; a broken connection is destroyed. `close()` waits for every connection and stream it has handed out before it ends the pool.\n*/\nvar MysqlDriver = class extends MysqlQueryable {\n\tfamilyId = \"sql\";\n\ttargetId;\n\tholdsClient = false;\n\t#state = { kind: \"unbound\" };\n\t#inUse = new ClientsInUse();\n\t#canceller;\n\tcancelStatement = (threadId) => this.#canceller?.cancel(threadId) ?? Promise.resolve(\"unsent\");\n\t#options;\n\t#sessionSettings;\n\tconstructor(options, targetId) {\n\t\tsuper(options.stream ?? false);\n\t\tthis.targetId = targetId;\n\t\tthis.#options = options;\n\t\tthis.#sessionSettings = new SessionSettingsGuard(options.sessionSettings ?? {});\n\t}\n\tget state() {\n\t\treturn this.#state.kind;\n\t}\n\tasync connect(binding) {\n\t\tif (this.#state.kind === \"connected\") throw errorRuntime(\"DRIVER.ALREADY_CONNECTED\", \"MySQL driver already connected\", { fix: \"Call close() before connecting again.\" });\n\t\tconst waiting = new WaitingForConnection();\n\t\tconst pool = createPool({\n\t\t\t...mysqlPoolOptions(binding.url, this.#options.poolOptions),\n\t\t\tlogger: { error: (error) => waiting.reported(error) }\n\t\t});\n\t\tif (pool instanceof EventEmitter) pool.on(\"error\", ignoreConnectionFailure);\n\t\tthis.#state = {\n\t\t\tkind: \"connected\",\n\t\t\tpool,\n\t\t\twaiting\n\t\t};\n\t\tthis.#canceller = new Canceller(binding.url, mysqlPoolIdleTimeoutMillis(this.#options.poolOptions));\n\t}\n\tasync acquireConnection() {\n\t\treturn new MysqlConnectionImpl(await this.acquireClient(), this.streams, this.cancelStatement, () => this.#inUse.released());\n\t}\n\tasync close() {\n\t\tif (this.#state.kind !== \"connected\") return;\n\t\tconst { pool } = this.#state;\n\t\tthis.#state = { kind: \"closed\" };\n\t\tawait this.#inUse.none();\n\t\tawait this.#canceller?.close();\n\t\tthis.#canceller = void 0;\n\t\tawait pool.end();\n\t}\n\tasync acquireClient() {\n\t\tif (this.#state.kind !== \"connected\") throw notConnected(this.#state.kind === \"closed\" ? \"MySQL driver is closed\" : \"MySQL driver not connected\");\n\t\tconst { pool, waiting } = this.#state;\n\t\tthis.#inUse.acquired();\n\t\tconst getting = pool.getConnection();\n\t\tlet client;\n\t\ttry {\n\t\t\tclient = await waiting.race(getting);\n\t\t} catch (error) {\n\t\t\treleaseLate(getting);\n\t\t\tthis.#inUse.released();\n\t\t\tthrow normalizeMysqlError(error);\n\t\t}\n\t\ttry {\n\t\t\tawait this.#sessionSettings.ensure(client);\n\t\t} catch (error) {\n\t\t\tclient.destroy();\n\t\t\tthis.#inUse.released();\n\t\t\tthrow normalizeMysqlError(error);\n\t\t}\n\t\treturn client;\n\t}\n\t/**\n\t* Destroys a client only after an error the package marks fatal, or after a cancel that went out without an answer once the rest of its result was read (`cancelUnconfirmed`). The package marks an error fatal when the connection's socket is gone or can no longer be trusted, and it has then already set the connection closed and failed every command on it (`fatalError` in its `connection.js`), so no command is receiving and its `destroy()` sends no `KILL`. A statement the caller stopped early is cancelled and read to its end instead (`#stopEarly`).\n\t*/\n\tasync releaseClient(client, { destroy }) {\n\t\ttry {\n\t\t\tif (destroy) client.destroy();\n\t\t\telse await client.release();\n\t\t} finally {\n\t\t\tthis.#inUse.released();\n\t\t}\n\t}\n};\n//#endregion\n//#region src/core/runtime/runtime-driver.ts\n/** The runtime driver descriptor of MySQL, or of a target that extends it, whose drivers carry `targetId`. */\nfunction createMysqlRuntimeDriverDescriptor(targetId) {\n\treturn {\n\t\t...mysqlDriverDescriptorMetaFor(targetId),\n\t\tcreate(options, sessionSettings) {\n\t\t\treturn new MysqlDriver({\n\t\t\t\t...options,\n\t\t\t\t...ifDefined(\"sessionSettings\", sessionSettings)\n\t\t\t}, targetId);\n\t\t}\n\t};\n}\nconst mysqlRuntimeDriverDescriptor = createMysqlRuntimeDriverDescriptor(\"mysql\");\n//#endregion\nexport { createMysqlRuntimeDriverDescriptor, mysqlRuntimeDriverDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;AAUA,MAAM,wBAAwB;AAC9B,SAAS,QAAQ,QAAQ;CACxB,IAAI;CACJ,OAAO;EACN,SAAS,IAAI,SAAS,YAAY;GACjC,QAAQ,iBAAiB,QAAQ,SAAS,GAAG,MAAM;EACpD,CAAC;EACD,aAAa,aAAa,KAAK;CAChC;AACD;;;;AAIA,IAAI,YAAY,MAAM;CACrB;CACA;CACA;CACA,2BAA2B,IAAI,QAAQ;CACvC,UAAU;CACV;CACA,YAAY,KAAK,mBAAmB;EACnC,KAAKA,OAAO;EACZ,KAAKC,qBAAqB;CAC3B;;CAEA,MAAM,OAAO,UAAU,WAAW,OAAO;EACxC,IAAI,KAAKC,WAAW,aAAa,MAAM,OAAO;EAC9C,aAAa,KAAKC,UAAU;EAC5B,MAAM,UAAU,KAAKC,eAAe,KAAKC,MAAM;EAC/C,KAAKD,cAAc;EACnB,MA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AAK;EAChC;EACA,IAAI;GACH,MAAM,KAAKF,iBAAiB,OAAO,MAAM;EAC1C,SAAS,OAAO;GACf,OAAO,QAAQ;GACf,KAAKE,OAAO,SAAS;GACrB,MAAM,oBAAoB,KAAK;EAChC;EACA,OAAO;CACR;;;;CAIA,MAAM,cAAc,QAAQ,EAAE,WAAW;EACxC,IAAI;GACH,IAAI,SAAS,OAAO,QAAQ;QACvB,MAAM,OAAO,QAAQ;EAC3B,UAAU;GACT,KAAKA,OAAO,SAAS;EACtB;CACD;AACD;;AAIA,SAAS,mCAAmC,UAAU;CACrD,OAAO;EACN,GAAG,6BAA6B,QAAQ;EACxC,OAAO,SAAS,iBAAiB;GAChC,OAAO,IAAI,YAAY;IACtB,GAAG;IACH,GAAG,UAAU,mBAAmB,eAAe;GAChD,GAAG,QAAQ;EACZ;CACD;AACD;AACA,MAAM,+BAA+B,mCAAmC,OAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-DN20lWEg.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-mysql/3-driver/dist/runtime.d.mts"],"mappings":";;;;;;;UAMU;;WAEC;;WAEA;;WAEA;;;;;KAKN;WACM;WACA;;KAEN,mBAAmB,qCAAqC,6BAA6B,YAAY,UAAU;UACtG;;WAEC;WACA,cAAc;;WAEd,kBAAkB;;;;;iBAKZ,mCAAmC,yBAAyB,UAAU,WAAW,+BAA+B,UAAU,0BAA0B,mBAAmB;cAC1K,8BAA8B,wCAAwC,0BAA0B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-DUDdsFyy.mjs","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/runtime.mjs"],"sourcesContent":["import { n as mysqlTargetDescriptorMetaRuntime, t as mysqlNowGenerators } from \"./date-time-now-generators-BKakW3gd.mjs\";\nimport { t as MysqlContractSerializer } from \"./mysql-contract-serializer-BnTKRSsN.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { type } from \"arktype\";\n//#region src/core/runtime/runtime-target.ts\nconst mysqlRuntimeTargetDescriptor = {\n\t...mysqlTargetDescriptorMetaRuntime,\n\tcodecs: () => [],\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"mysql\"\n\t\t};\n\t}\n};\n//#endregion\n//#region src/core/transaction-isolation.ts\nconst mysqlIsolationLevels = {\n\tReadUncommitted: \"ReadUncommitted\",\n\tReadCommitted: \"ReadCommitted\",\n\tRepeatableRead: \"RepeatableRead\",\n\tSerializable: \"Serializable\"\n};\nconst mysqlIsolationLevelSchema = type.enumerated(...Object.values(mysqlIsolationLevels));\nfunction validateMysqlIsolationLevel(value) {\n\tconst result = mysqlIsolationLevelSchema(value);\n\tif (result instanceof type.errors) throw structuredError(\"RUNTIME.ARGUMENT_INVALID\", \"Invalid transaction isolation level\", {\n\t\twhy: result.summary,\n\t\tfix: \"Use ReadUncommitted, ReadCommitted, RepeatableRead, or Serializable.\",\n\t\tmeta: {\n\t\t\targument: \"isolationLevel\",\n\t\t\treceived: value\n\t\t}\n\t});\n\treturn result;\n}\n//#endregion\nexport { MysqlContractSerializer, mysqlRuntimeTargetDescriptor as default, mysqlIsolationLevelSchema, mysqlIsolationLevels, mysqlNowGenerators, validateMysqlIsolationLevel };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;AAKA,MAAM,+BAA+B;CACpC,GAAG;CACH,cAAc,CAAC;CACf,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD;AAGA,MAAM,uBAAuB;CAC5B,iBAAiB;CACjB,eAAe;CACf,gBAAgB;CAChB,cAAc;AACf;AACA,MAAM,4BAA4B,KAAK,WAAW,GAAG,OAAO,OAAO,oBAAoB,CAAC;AACxF,SAAS,4BAA4B,OAAO;CAC3C,MAAM,SAAS,0BAA0B,KAAK;CAC9C,IAAI,kBAAkB,KAAK,QAAQ,MAAM,gBAAgB,4BAA4B,uCAAuC;EAC3H,KAAK,OAAO;EACZ,KAAK;EACL,MAAM;GACL,UAAU;GACV,UAAU;EACX;CACD,CAAC;CACD,OAAO;AACR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sql-utils-BE8tDXHs.mjs","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/sql-utils.mjs"],"sourcesContent":["import { s as mysqlError } from \"./errors-Cng94tYg.mjs\";\nimport { n as quoteIdentifier, r as quoteLiteral, t as escapeLiteral } from \"./sql-utils-Cmv_TVa8.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,SAAS;EACV,OAAO,SAAS;CACjB;CACA,OAAO,IAAI;AACZ;AACA,SAAS,MAAM,KAAK,OAAO,YAAY;CACtC,MAAM,MAAM,IAAI,QAAQ,YAAY,KAAK;CACzC,OAAO,QAAQ,KAAK,IAAI,SAAS,MAAM,WAAW;AACnD;;AAEA,SAAS,iBAAiB,KAAK,OAAO;CACrC,IAAI,CAAC,IAAI,WAAW,MAAM,KAAK,GAAG,OAAO;CACzC,MAAM,OAAO,IAAI,WAAW,QAAQ,CAAC;CACrC,OAAO,OAAO,MAAM,IAAI,KAAK,QAAQ,MAAM,SAAS;AACrD;AACA,SAAS,QAAQ,MAAM;CACtB,OAAO,SAAS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AAO,IAAI,WAAW,IAAI,GAAG;GAC5B,OAAO;GACP,MAAM,SAAS,KAAK,OAAO,UAAU;EACtC;EACA,MAAM,OAAO,IAAI,MAAM,OAAO,GAAG;EACjC,OAAO,KAAK,SAAS,gBAAgB,iBAAiB,IAAI,IAAI;GAC7D;GACA;EACD,CAAC;EACD,QAAQ;CACT;CACA,OAAO;AACR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"statement-CT5tB4uX-CHqHFM3z.mjs","names":["#queue","#statement","#ensured"],"sources":["../../../../3-targets/mysql/1-mysql/3-driver/dist/statement-CT5tB4uX.mjs"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { type } from \"arktype\";\nimport { SqlConnectionError, SqlQueryError } from \"@internal/sql-errors\";\nimport { quoteIdentifier, tokenizeMysqlSql } from \"@internal/target-mysql/sql-utils\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { mysqlError } from \"@internal/target-mysql/errors\";\n//#region src/core/client-query-lock.ts\nvar AsyncMutex = class {\n\t#queue = Promise.resolve();\n\tasync lock() {\n\t\tconst previous = this.#queue;\n\t\tlet releaseLock;\n\t\tthis.#queue = new Promise((resolve) => {\n\t\t\treleaseLock = resolve;\n\t\t});\n\t\tawait previous;\n\t\treturn () => {\n\t\t\treleaseLock?.();\n\t\t\treleaseLock = void 0;\n\t\t};\n\t}\n};\n/**\n* One statement at a time on each client, in the order sent, as the Postgres driver's per-client lock runs them, on the runtime and the control driver alike. The lock is held until the statement settles, or for a stream's whole life, so a statement sent while a stream is open waits for it.\n*/\nconst clientQueryLocks = /* @__PURE__ */ new WeakMap();\nfunction acquireClientQueryLock(client) {\n\tlet mutex = clientQueryLocks.get(client);\n\tif (mutex === void 0) {\n\t\tmutex = new AsyncMutex();\n\t\tclientQueryLocks.set(client, mutex);\n\t}\n\treturn mutex.lock();\n}\n//#endregion\n//#region src/core/session-setup.ts\n/**\n* Removes the `sql_mode` entries the MySQL target does not support, `NO_BACKSLASH_ESCAPES` and `ANSI_QUOTES`, and the combination mode `ANSI`, which MySQL lists beside its parts and which would set `ANSI_QUOTES` again; no other combination mode includes either. It adds `NO_AUTO_VALUE_ON_ZERO`, so an explicit 0 in an auto-increment column is stored as 0, as Postgres stores it, rather than replaced with a generated value. Leaves no empty entry between two commas.\n*/\nconst SET_SQL_MODE = \"SET SESSION sql_mode = TRIM(LEADING ',' FROM CONCAT(REPLACE(REPLACE(REPLACE(REPLACE(CONCAT(',', @@SESSION.sql_mode, ','), ',NO_BACKSLASH_ESCAPES,', ','), ',ANSI_QUOTES,', ','), ',ANSI,', ','), ',NO_AUTO_VALUE_ON_ZERO,', ','), 'NO_AUTO_VALUE_ON_ZERO'))\";\n/** Makes MySQL read each statement, and the package write it, as utf8mb4. */\nconst SET_UTF8MB4 = \"SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci\";\n/**\n* The statements every new connection runs once, before any other. The lexer that finds placeholders reads a backslash as an escape and `\"…\"` as a string, so the session clears NO_BACKSLASH_ESCAPES and ANSI_QUOTES and MySQL reads quoted text the same way, and sets NO_AUTO_VALUE_ON_ZERO; and it reads each statement as utf8mb4. These hold no value, so they run through the package's `initSql`; the target's session settings, which do, are set afterwards.\n*/\nconst SESSION_SETUP = [SET_SQL_MODE, SET_UTF8MB4];\n//#endregion\n//#region src/core/text-or-bytes.ts\n/** MySQL's `binary` collation, which marks a string or blob column that holds bytes. */\nconst BINARY_COLLATION = 63;\n/** The column types whose value is text, or bytes when the column's collation is binary. */\nconst CHARACTER_OR_BLOB_TYPES = /* @__PURE__ */ new Set([\n\t\"VARCHAR\",\n\t\"VAR_STRING\",\n\t\"STRING\",\n\t\"TINY_BLOB\",\n\t\"MEDIUM_BLOB\",\n\t\"LONG_BLOB\",\n\t\"BLOB\"\n]);\n/** The column types whose value MySQL sends as text. A type outside this list, such as BIT, GEOMETRY or one the package has no name for, is read as bytes. */\nconst TEXT_TYPES = /* @__PURE__ */ new Set([\n\t...CHARACTER_OR_BLOB_TYPES,\n\t\"DECIMAL\",\n\t\"NEWDECIMAL\",\n\t\"FLOAT\",\n\t\"DOUBLE\",\n\t\"TINY\",\n\t\"SHORT\",\n\t\"INT\",\n\t\"INT24\",\n\t\"BIGINT\",\n\t\"YEAR\",\n\t\"DATE\",\n\t\"NEWDATE\",\n\t\"TIME\",\n\t\"TIME2\",\n\t\"DATETIME\",\n\t\"DATETIME2\",\n\t\"TIMESTAMP\",\n\t\"TIMESTAMP2\",\n\t\"JSON\",\n\t\"ENUM\",\n\t\"SET\",\n\t\"NULL\"\n]);\n/**\n* Reads each column as the row value ADR 155 sets at the driver boundary: a binary string or blob, BIT, GEOMETRY and a column of a type the package does not know as its bytes, every other column as text, and NULL as `null`. Bytes are a plain `Uint8Array`, not the package's `Buffer`.\n*/\nconst readTextOrBytes = (field) => {\n\tif (!TEXT_TYPES.has(field.type) || CHARACTER_OR_BLOB_TYPES.has(field.type) && field.collation.index === BINARY_COLLATION) {\n\t\tconst bytes = field.buffer();\n\t\treturn bytes === null ? null : new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n\t}\n\treturn field.string();\n};\n//#endregion\n//#region src/core/connection-options.ts\nconst DEFAULT_CONNECT_TIMEOUT_MILLIS = 2e4;\nconst DEFAULT_IDLE_TIMEOUT_MILLIS = 3e4;\nconst urlParameters = type({\n\t\"ssl?\": type(\"'true' | '1' | 'false' | '0'\").pipe((text) => text === \"true\" || text === \"1\"),\n\t\"sslmode?\": \"'disable' | 'prefer' | 'require' | 'verify-ca' | 'verify-full' | 'no-verify'\",\n\t\"sslcert?\": \"string > 0\",\n\t\"sslkey?\": \"string > 0\",\n\t\"sslrootcert?\": \"string > 0\",\n\t\"allowPublicKeyRetrieval?\": type(\"'true' | 'false'\").pipe((text) => text === \"true\")\n});\n/** The form each URL parameter's value must take, for the refusal of a value. */\nconst PARAMETER_FORMS = {\n\tssl: \"true, 1, false or 0\",\n\tsslmode: \"disable, prefer, require, verify-ca, verify-full or no-verify\",\n\tsslcert: \"the path of a PEM file\",\n\tsslkey: \"the path of a PEM file\",\n\tsslrootcert: \"the path of a PEM file\",\n\tallowPublicKeyRetrieval: \"true or false\"\n};\nfunction isParameterName(name) {\n\treturn Object.hasOwn(PARAMETER_FORMS, name);\n}\n/**\n* Options the URL cannot change. The package writes each value into its statement at a bare `?`; every option that would change where or how it writes one (named placeholders, an object written as `SET` entries, several statements in one) stays off, and `logParam` keeps values out of error messages. `permitRedirect` stays off, so a server cannot send the client, with its credentials, to another host, which `pg` never does. `typeCast` reads every column as text or bytes, so no column reaches a codec as a value the package parsed. `foundRows` makes an UPDATE count the rows it matched, as Postgres's row count does. The connection is utf8mb4: the driver reads each statement as utf8mb4 to find its placeholders, and MySQL must read it the same way.\n*/\nconst FIXED_OPTIONS = {\n\tcollation: \"UTF8MB4_UNICODE_CI\",\n\tmultipleStatements: false,\n\tnamedPlaceholders: false,\n\tpermitSetMultiParamEntries: false,\n\tpermitLocalInfile: false,\n\tlogParam: false,\n\tpermitRedirect: false,\n\tfoundRows: true,\n\ttypeCast: readTextOrBytes\n};\n/** Refuses the URL. `parameters` names the parameters at fault; no value from the URL goes into the error, because a URL carries the password. */\nfunction invalidBinding(reason, parameters) {\n\treturn structuredError(\"RUNTIME.BINDING_INVALID\", `MySQL connection URL: ${reason}`, { meta: {\n\t\treceived: parameters.join(\", \"),\n\t\treason\n\t} });\n}\n/** Parses `url` as the Postgres facade does, refusing it without the parser's error, which carries the whole URL. */\nfunction parseUrl(url) {\n\ttry {\n\t\treturn new URL(url);\n\t} catch {\n\t\tthrow invalidBinding(\"the URL cannot be parsed\", []);\n\t}\n}\nfunction readUrl(url) {\n\tconst parsed = parseUrl(url);\n\tif (parsed.searchParams.has(\"charset\")) throw invalidBinding(\"the driver always uses utf8mb4, because it reads each statement as utf8mb4 to find its placeholders; remove the charset parameter\", [\"charset\"]);\n\tconst names = [...new Set(parsed.searchParams.keys())].filter(isParameterName);\n\tconst parameters = urlParameters(Object.fromEntries([...parsed.searchParams].filter(([name]) => isParameterName(name))));\n\tif (parameters instanceof type.errors) {\n\t\tconst invalid = names.filter((name) => parameters.some((error) => error.path[0] === name));\n\t\tthrow invalidBinding(invalid.map((name) => `${name} must be ${PARAMETER_FORMS[name]}`).join(\"; \"), invalid);\n\t}\n\tif (parameters.sslcert !== void 0 && parameters.sslkey === void 0) throw invalidBinding(\"sslcert names the client's certificate and needs sslkey; to check the server's certificate against a CA file, as sslcert did in Prisma 7, use sslrootcert\", [\"sslcert\"]);\n\treturn {\n\t\tparsed,\n\t\tparameters\n\t};\n}\nfunction readPem(parameter, path) {\n\ttry {\n\t\treturn readFileSync(path, \"utf8\");\n\t} catch {\n\t\tthrow invalidBinding(`the file ${parameter} names cannot be read`, [parameter]);\n\t}\n}\n/**\n* The TLS settings the URL gives, read as `pg-connection-string` reads them for the Postgres driver: `ssl=true` turns TLS on and `ssl=false` off; `sslcert`, `sslkey`, `sslrootcert` or `sslmode` turn it on, with the certificate, key and CA read from the files they name. `sslmode=disable` turns it off; `no-verify` accepts any server certificate; every other mode verifies the certificate and the host name, as `verify-full` does.\n*/\nfunction tlsOptions(parameters) {\n\tconst { sslcert, sslkey, sslrootcert, sslmode } = parameters;\n\tif ([\n\t\tsslcert,\n\t\tsslkey,\n\t\tsslrootcert,\n\t\tsslmode\n\t].every((value) => value === void 0)) return parameters.ssl;\n\tif (sslmode === \"disable\") return false;\n\treturn {\n\t\t...ifDefined(\"cert\", sslcert === void 0 ? void 0 : readPem(\"sslcert\", sslcert)),\n\t\t...ifDefined(\"key\", sslkey === void 0 ? void 0 : readPem(\"sslkey\", sslkey)),\n\t\t...ifDefined(\"ca\", sslrootcert === void 0 ? void 0 : readPem(\"sslrootcert\", sslrootcert)),\n\t\t...sslmode === \"no-verify\" ? { rejectUnauthorized: false } : {}\n\t};\n}\nfunction connectionOptions(parsed, parameters, connectTimeoutMs) {\n\treturn {\n\t\thost: decodeURIComponent(parsed.hostname).replace(/^\\[(.*)\\]$/, \"$1\"),\n\t\t...ifDefined(\"port\", parsed.port === \"\" ? void 0 : Number(parsed.port)),\n\t\tuser: decodeURIComponent(parsed.username),\n\t\tpassword: decodeURIComponent(parsed.password),\n\t\tdatabase: decodeURIComponent(parsed.pathname.slice(1)),\n\t\t...ifDefined(\"ssl\", tlsOptions(parameters)),\n\t\tallowPublicKeyRetrieval: parameters.allowPublicKeyRetrieval ?? false,\n\t\tconnectTimeout: connectTimeoutMs ?? DEFAULT_CONNECT_TIMEOUT_MILLIS,\n\t\tinitSql: [...SESSION_SETUP],\n\t\t...FIXED_OPTIONS\n\t};\n}\n/** The `mariadb` options for one connection to the server a `mysql://` URL names. Ignores a URL parameter the driver does not read, as `pg` does, and refuses a charset. */\nfunction mysqlConnectionOptions(url, settings) {\n\tconst { parsed, parameters } = readUrl(url);\n\treturn connectionOptions(parsed, parameters, settings?.connectTimeoutMs);\n}\n/** How long a connection may stay idle before the pool, and the driver's cancel connection, close it. */\nfunction mysqlPoolIdleTimeoutMillis(poolOptions) {\n\treturn poolOptions?.idleTimeoutMillis ?? DEFAULT_IDLE_TIMEOUT_MILLIS;\n}\n/**\n* The `mariadb` pool options for a `mysql://` URL, sized and timed as the Postgres driver's `pg.Pool`: it opens a connection only when one is needed (`minimumIdle: 0`), closes one idle for `idleTimeoutMillis`, and waits `connectionTimeoutMillis` both to open a connection and for a pooled one to come free.\n*/\nfunction mysqlPoolOptions(url, poolOptions) {\n\tconst { parsed, parameters } = readUrl(url);\n\tconst timeoutMs = poolOptions?.connectionTimeoutMillis ?? DEFAULT_CONNECT_TIMEOUT_MILLIS;\n\treturn {\n\t\t...connectionOptions(parsed, parameters, timeoutMs),\n\t\tacquireTimeout: timeoutMs,\n\t\tminimumIdle: 0,\n\t\tidleTimeout: Math.ceil(mysqlPoolIdleTimeoutMillis(poolOptions) / 1e3),\n\t\t...ifDefined(\"connectionLimit\", poolOptions?.max)\n\t};\n}\n//#endregion\n//#region src/core/descriptor-meta.ts\n/** The descriptor meta of the MySQL driver built for `targetId`: MySQL's, or a target's that extends MySQL. */\nfunction mysqlDriverDescriptorMetaFor(targetId) {\n\treturn {\n\t\tkind: \"driver\",\n\t\tfamilyId: \"sql\",\n\t\ttargetId,\n\t\tid: targetId,\n\t\tversion: \"0.0.1\",\n\t\tcapabilities: {}\n\t};\n}\n//#endregion\n//#region src/core/normalize-error.ts\nfunction isMariadbError(error) {\n\treturn error instanceof Error && \"errno\" in error && typeof error.errno === \"number\";\n}\n/** Whether `error` left its connection unusable: the package marks a lost socket, and a server error of SQLSTATE class 08, as fatal. */\nfunction isFatal(error) {\n\treturn error instanceof Error && \"fatal\" in error && error.fatal === true;\n}\nfunction serverMessage(error) {\n\treturn isMariadbError(error) ? error.sqlMessage ?? error.message : error.message;\n}\n/** The error a statement ends with when its connection is lost or closed under it: a `SqlConnectionError` a retry on a new connection can get past, as on Postgres. */\nfunction connectionLost(cause) {\n\treturn new SqlConnectionError(serverMessage(cause), {\n\t\tcause,\n\t\ttransient: true,\n\t\t...ifDefined(\"sqlState\", isMariadbError(cause) ? cause.sqlState ?? void 0 : void 0)\n\t});\n}\n/** Node's socket and DNS error codes, and whether a retry can succeed after each, as the Postgres driver classifies them. */\nconst NODE_CONNECTION_CODES = /* @__PURE__ */ new Map([\n\t[\"ECONNRESET\", true],\n\t[\"ETIMEDOUT\", true],\n\t[\"EPIPE\", true],\n\t[\"EAI_AGAIN\", true],\n\t[\"ECONNREFUSED\", false],\n\t[\"ENOTFOUND\", false],\n\t[\"EHOSTUNREACH\", false]\n]);\n/** Whether a retry can succeed after `error`, for a Node socket or DNS error; undefined for any other. */\nfunction nodeConnectionTransience(error) {\n\treturn error instanceof Error && \"code\" in error && typeof error.code === \"string\" ? NODE_CONNECTION_CODES.get(error.code) : void 0;\n}\nconst ER_GET_CONNECTION_TIMEOUT = 45028;\nconst ER_INITIAL_SQL_ERROR = 45030;\nconst ER_CANNOT_RETRIEVE_RSA_KEY = 45044;\n/** The errors MySQL refuses a sign-in with: access denied, access denied for a socket-authenticated account, and an authentication plugin the server has not loaded. Another attempt with the same URL fails the same way. */\nconst SIGN_IN_REFUSED = /* @__PURE__ */ new Set([\n\t1045,\n\t1698,\n\t1524\n]);\n/** Whether `error` is one another attempt to connect with the same settings cannot get past: a refused connection, an unknown or unreachable host, a refused sign-in, a sign-in that needs the server's public key, or session setup MySQL refuses. */\nfunction connectingCannotSucceed(error) {\n\tif (nodeConnectionTransience(error) === false) return true;\n\treturn isMariadbError(error) && (SIGN_IN_REFUSED.has(error.errno) || error.errno === ER_CANNOT_RETRIEVE_RSA_KEY || error.errno === ER_INITIAL_SQL_ERROR);\n}\nconst UNIQUE_VIOLATION = \"23505\";\nconst FOREIGN_KEY_VIOLATION = \"23503\";\n/** The SQLSTATE Postgres sends for each constraint MySQL reports under a shared SQLSTATE, as the SQLite driver maps its own codes, so a consumer such as `isUniqueConstraintViolation` reads them alike. */\nconst CONSTRAINT_SQLSTATES = /* @__PURE__ */ new Map([\n\t[1062, UNIQUE_VIOLATION],\n\t[1586, UNIQUE_VIOLATION],\n\t[1216, FOREIGN_KEY_VIOLATION],\n\t[1217, FOREIGN_KEY_VIOLATION],\n\t[1451, FOREIGN_KEY_VIOLATION],\n\t[1452, FOREIGN_KEY_VIOLATION],\n\t[1048, \"23502\"],\n\t[3819, \"23514\"]\n]);\nconst PUBLIC_KEY_FIX = \"Add allowPublicKeyRetrieval=true to the URL, or connect over TLS with sslmode or ssl=true in the URL. Fetching the key over plain TCP lets a machine between the client and the server pose as the server and read the password; TLS does not.\";\n/** The fix for a failed connection when the package's error names its cause, such as a sign-in that needs the server's public key. */\nfunction connectionFix(error) {\n\treturn isMariadbError(error) && error.errno === ER_CANNOT_RETRIEVE_RSA_KEY ? PUBLIC_KEY_FIX : void 0;\n}\nfunction publicKeyNeeded(error) {\n\treturn new SqlConnectionError(`MySQL sign-in needs the server's public key: the account signs in with caching_sha2_password or sha256_password over a connection without TLS. ${PUBLIC_KEY_FIX}`, {\n\t\tcause: error,\n\t\ttransient: false\n\t});\n}\nfunction poolTimedOut(error) {\n\tconst cause = error.cause;\n\tif (connectingCannotSucceed(cause)) return normalizeMysqlError(cause);\n\treturn new SqlConnectionError(cause instanceof Error ? `Timed out waiting for a pooled MySQL connection; the pool could not open one: ${serverMessage(cause)}` : \"Timed out waiting for a pooled MySQL connection; every connection in the pool was in use.\", {\n\t\tcause: error,\n\t\ttransient: true\n\t});\n}\n/**\n* An error from the `mariadb` package as the driver reports it, in the family's types as the Postgres driver reports its own: a Node socket or DNS error as a `SqlConnectionError`, transient as the Postgres driver's table says; a lost connection and a pool that gave no connection in time as a transient `SqlConnectionError`; a sign-in that needs the server's public key, and session setup that fails, as a `SqlConnectionError` that is not transient; a sign-in MySQL refuses, as Postgres's 28P01, and an error MySQL reported about a statement as `SqlQueryError` with its SQLSTATE, a constraint violation with the SQLSTATE Postgres sends; and any other error unchanged. A pool that timed out because it could not connect in a way no retry can get past reports that error.\n*/\nfunction normalizeMysqlError(error) {\n\tconst transient = nodeConnectionTransience(error);\n\tif (transient !== void 0 && error instanceof Error) return new SqlConnectionError(error.message, {\n\t\tcause: error,\n\t\ttransient\n\t});\n\tif (!isMariadbError(error)) return error;\n\tif (error.errno === ER_CANNOT_RETRIEVE_RSA_KEY) return publicKeyNeeded(error);\n\tif (error.errno === ER_INITIAL_SQL_ERROR) return new SqlConnectionError(serverMessage(error), {\n\t\tcause: error,\n\t\ttransient: false\n\t});\n\tif (isFatal(error) && !SIGN_IN_REFUSED.has(error.errno)) return connectionLost(error);\n\tif (error.errno === ER_GET_CONNECTION_TIMEOUT) return poolTimedOut(error);\n\tif (typeof error.sqlState !== \"string\") return error;\n\treturn new SqlQueryError(error.sqlMessage ?? error.message, {\n\t\tcause: error,\n\t\tsqlState: CONSTRAINT_SQLSTATES.get(error.errno) ?? error.sqlState\n\t});\n}\n//#endregion\n//#region src/core/session-settings.ts\nconst DECIMAL_INTEGER = /^-?\\d+$/;\n/** A setting's value as MySQL takes it: decimal integer text as a whole number, because MySQL refuses text for an integer variable, and any other text as it is. */\nfunction settingValue(value) {\n\treturn DECIMAL_INTEGER.test(value) ? BigInt(value) : value;\n}\n/** The one statement that sets `sessionSettings`: each name a quoted identifier, each value a parameter. Undefined when there is nothing to set. */\nfunction sessionSettingsStatement(sessionSettings) {\n\tconst entries = Object.entries(sessionSettings);\n\tif (entries.length === 0) return void 0;\n\treturn {\n\t\tsql: `SET SESSION ${entries.map(([name]) => `${quoteIdentifier(name)} = ?`).join(\", \")}`,\n\t\tvalues: entries.map(([, value]) => settingValue(value))\n\t};\n}\n/** Sets the session settings on `connection`, the package writing each value into the statement. Throws the package's error as it is. */\nasync function applySessionSettings(connection, statement) {\n\tawait connection.query(statement.sql, [...statement.values]);\n}\n/**\n* Ensures the session settings a target declares on each physical connection the runtime driver gets from its pool, once, as the Postgres driver's `SessionSettingsGuard` does for a pool it did not start the sessions of. The package hands out a new wrapper for each `getConnection`, so a connection is known by its `info`, which belongs to the physical connection.\n*/\nvar SessionSettingsGuard = class {\n\t#statement;\n\t#ensured = /* @__PURE__ */ new WeakSet();\n\tconstructor(sessionSettings) {\n\t\tthis.#statement = sessionSettingsStatement(sessionSettings);\n\t}\n\tasync ensure(connection) {\n\t\tconst key = connection.info;\n\t\tassertDefined(key, \"the package gives every connection its info when it creates it\");\n\t\tif (this.#statement === void 0 || this.#ensured.has(key)) return;\n\t\tawait applySessionSettings(connection, this.#statement);\n\t\tthis.#ensured.add(key);\n\t}\n};\n//#endregion\n//#region src/core/parameter-values.ts\nfunction unsendable(message, paramIndex, received) {\n\treturn mysqlError(\"RUNTIME.ENCODE_FAILED\", message, { meta: {\n\t\ttarget: \"mysql\",\n\t\tparamIndex,\n\t\treceived\n\t} });\n}\nconst BIGINT_MIN = -(2n ** 63n);\nconst BIGINT_MAX = 2n ** 63n - 1n;\nconst LONE_SURROGATE = /\\p{Surrogate}/u;\nfunction withinBigint(value) {\n\treturn value >= BIGINT_MIN && value <= BIGINT_MAX;\n}\nfunction receivedKind(value) {\n\tif (value instanceof Date) return \"Date\";\n\tif (Array.isArray(value)) return \"array\";\n\treturn typeof value;\n}\n/**\n* The value the `mariadb` package writes into the statement for a parameter. A finite number or a bigint goes as it is, and the package writes its digits. A non-finite number is refused, because the package would write `NaN` or `Infinity` into the SQL. A bigint must fit a signed BIGINT, so a parameter's type never depends on its value. A `Uint8Array` goes as a Buffer over the same bytes, because the package writes any other `Uint8Array` as JSON text. A `Date` is refused: the package writes it in the process's local time zone, and the MySQL codecs send dates as text. So is text with a lone UTF-16 surrogate, which the package writes as `?` or U+FFFD depending on the text's length.\n*/\nfunction bindValue(value, index) {\n\tif (value === null || value === void 0) return null;\n\tif (typeof value === \"number\") {\n\t\tif (!Number.isFinite(value)) throw unsendable(`Parameter ${index + 1} is ${value}, which MySQL cannot store`, index, String(value));\n\t\treturn value;\n\t}\n\tif (typeof value === \"bigint\") {\n\t\tif (withinBigint(value)) return value;\n\t\tthrow unsendable(`Parameter ${index + 1} is an integer outside MySQL's signed 64-bit BIGINT`, index, \"bigint\");\n\t}\n\tif (Buffer.isBuffer(value)) return value;\n\tif (value instanceof Uint8Array) return Buffer.from(value.buffer, value.byteOffset, value.byteLength);\n\tif (typeof value === \"string\") {\n\t\tif (!LONE_SURROGATE.test(value)) return value;\n\t\tthrow unsendable(`Parameter ${index + 1} is text with a lone UTF-16 surrogate, which is not a character and has no utf8mb4 form; the mariadb package would store it as ? or as U+FFFD, depending on the length of the text`, index, \"string\");\n\t}\n\tif (typeof value === \"boolean\") return value;\n\tconst received = receivedKind(value);\n\tthrow unsendable(`Parameter ${index + 1} is of type ${received}; a MySQL parameter must be text, a number, a bigint, a boolean, bytes or null, and a Date is sent as text by its codec`, index, received);\n}\n//#endregion\n//#region src/core/positional-params.ts\nfunction placeholderMismatch(placeholders, values) {\n\treturn structuredError(\"RUNTIME.PARAM_PLACEHOLDER_MISMATCH\", `The MySQL statement writes placeholders ${JSON.stringify(placeholders)} for ${values} parameter value(s); write each value as a numbered ?N, or every value as a bare ? in order, and no other placeholder.`, {\n\t\twhy: \"A placeholder that does not match a value binds a value to the wrong place in the statement, or leaves a value unbound.\",\n\t\tfix: \"Pass values into raw SQL through interpolation rather than writing a `?` in the SQL text.\",\n\t\tmeta: {\n\t\t\tplaceholders,\n\t\t\tparams: values\n\t\t}\n\t});\n}\n/** The index into `values` each placeholder takes: `?N` takes value N, and bare `?`s take the values in order. */\nfunction valueIndexes(placeholders, values) {\n\tconst texts = placeholders.map((placeholder) => placeholder.text);\n\tif (texts.every((text) => text === \"?\")) {\n\t\tif (placeholders.length !== values) throw placeholderMismatch(texts, values);\n\t\treturn placeholders.map((_, index) => index);\n\t}\n\tconst indexes = placeholders.map((placeholder) => (placeholder.number ?? 0) - 1);\n\tif (!(indexes.every((index) => index >= 0 && index < values) && new Set(indexes).size === values)) throw placeholderMismatch(texts, values);\n\treturn indexes;\n}\n/**\n* The statement with each placeholder written as MySQL's positional `?`, and its values in that order. The adapter writes numbered `?N` placeholders, a value written as often as its `?N` appears; the control plane writes bare `?`s, which take the values in order. `tokenizeMysqlSql` reads the statement as MySQL's lexer does, so a `?` inside a quoted string, a backtick identifier or a comment stays text. Refuses a statement that mixes the two forms, or whose placeholders and values do not match.\n*/\nfunction positionalParams(sql, values) {\n\tconst tokens = tokenizeMysqlSql(sql);\n\tconst indexes = valueIndexes(tokens.filter((token) => token.kind === \"placeholder\"), values.length);\n\treturn {\n\t\tsql: tokens.map((token) => token.kind === \"placeholder\" ? \"?\" : token.text).join(\"\"),\n\t\tvalues: indexes.map((index) => bindValue(values[index], index))\n\t};\n}\n//#endregion\n//#region src/core/statement.ts\n/** The server status flag MySQL sets in every reply while it reports `NO_BACKSLASH_ESCAPES` in the session's `sql_mode`. */\nconst NO_BACKSLASH_ESCAPES = 512;\nfunction noBackslashEscapesRefusal(params) {\n\treturn mysqlError(\"RUNTIME.SQL_MODE_UNSUPPORTED\", \"MySQL reports NO_BACKSLASH_ESCAPES in this connection's sql_mode, which the MySQL target does not support, so the driver does not send a statement with values\", {\n\t\twhy: \"In this mode MySQL ends a string at a backslash and a quote, while the mariadb package, which writes the values into the statement, finds its placeholders as if the backslash escaped the quote, so a value could land outside its string literal and run as SQL. The driver removes the mode on every connection it opens, so a statement on this connection made MySQL report it: a raw SET sql_mode that set it, which stays until the connection closes or a statement clears it, or a stored procedure that set it inside itself, after which MySQL restores the mode the connection had, which may be off, but keeps reporting this one until a statement sets sql_mode again.\",\n\t\tfix: `Do not set NO_BACKSLASH_ESCAPES on a connection Prisma uses, in raw SQL, a stored procedure or a trigger. A raw SET run outside a transaction stays on whichever pooled connection ran it; restart the client to close that connection. A statement that needs the mode must run in a transaction or on a connection you hold, which must set the mode back before it is released, with ${SET_SQL_MODE}. A statement without values still runs.`,\n\t\tmeta: {\n\t\t\tsqlMode: \"NO_BACKSLASH_ESCAPES\",\n\t\t\tparams\n\t\t}\n\t});\n}\n/** The character set MySQL last reported for the statements the connection sends, as the package records it: utf8mb3 and utf8mb4 both as `utf8`, told apart by their longest character. */\nfunction reportedCharacterSet(collation) {\n\tif (typeof collation === \"object\" && collation !== null && \"charset\" in collation && \"maxLength\" in collation) return collation.charset === \"utf8\" ? `utf8mb${String(collation.maxLength)}` : String(collation.charset);\n\treturn \"unknown\";\n}\nfunction characterSetRefusal(characterSet, params) {\n\treturn mysqlError(\"RUNTIME.CHARACTER_SET_UNSUPPORTED\", `The driver could not confirm that MySQL reads this connection's statements as utf8mb4: the character set the mariadb package last recorded for it is ${characterSet}. The MySQL target supports only utf8mb4, so the driver does not send a statement with values`, {\n\t\twhy: \"The mariadb package, which writes the values into the statement, encodes the statement in the character set it last recorded and finds its placeholders byte by byte. In a character set such as sjis, cp932, big5 or gbk, the second byte of some characters is a backslash, so the package can read the end of a string literal in the SQL differently from MySQL, and a value could run as SQL. The package records the character set from the server greeting and from MySQL's report of changed session variables. Two causes are known: a statement on this connection changed character_set_client, such as a raw SET NAMES; or the server does not report character_set_client in session_track_system_variables, so the package never saw the driver set utf8mb4 and still holds the default character set from the greeting.\",\n\t\tfix: `If a statement changed the character set: do not change it on a connection Prisma uses. A raw SET run outside a transaction stays on whichever pooled connection ran it; restart the client to close that connection. A statement that needs another character set must run in a transaction or on a connection you hold, which must set it back before it is released, with ${SET_UTF8MB4}. If no statement changed it: add character_set_client back to the server's session_track_system_variables, as in MySQL's default, and restart the client. A statement without values still runs.`,\n\t\tmeta: {\n\t\t\tcharacterSet,\n\t\t\tparams\n\t\t}\n\t});\n}\n/**\n* The statement to hand to `connection`: `sql` with its placeholders written as `?` and the values in their order, for the package to write in. A statement without values comes back as written with no values, so the package sends it without searching it for placeholders. Refuses a statement with values while the server last reported `NO_BACKSLASH_ESCAPES` on, or while the package's record of the character set is not utf8mb4, which a statement the application sends or a server that does not report `character_set_client` can cause. A statement without values still runs, so the setting can be put back; the driver's lexer still reads a backslash as an escape then, so at worst it refuses such a statement for a `?` it reads outside a string.\n*/\nfunction statementFor(connection, sql, params) {\n\tconst { info } = connection;\n\tassertDefined(info, \"the package gives every connection its info when it creates it\");\n\tif (params.length > 0) {\n\t\tif ((info.status & NO_BACKSLASH_ESCAPES) !== 0) throw noBackslashEscapesRefusal(params.length);\n\t\tconst characterSet = reportedCharacterSet(info.collation);\n\t\tif (characterSet !== \"utf8mb4\") throw characterSetRefusal(characterSet, params.length);\n\t}\n\tconst statement = positionalParams(sql, params);\n\treturn params.length > 0 ? statement : {\n\t\tsql,\n\t\tvalues: void 0\n\t};\n}\n//#endregion\nexport { connectingCannotSucceed as a, isFatal as c, mysqlConnectionOptions as d, mysqlPoolIdleTimeoutMillis as f, sessionSettingsStatement as i, normalizeMysqlError as l, acquireClientQueryLock as m, SessionSettingsGuard as n, connectionFix as o, mysqlPoolOptions as p, applySessionSettings as r, connectionLost as s, statementFor as t, mysqlDriverDescriptorMetaFor as u };\n\n//# sourceMappingURL=statement-CT5tB4uX.mjs.map"],"mappings":";;;;;;;;;;AASA,IAAI,aAAa,MAAM;C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