@prisma/orm-target-mysql 8.0.0-rc.22-dev.10 → 8.0.0-rc.22-dev.12
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/README.md +3 -1
- package/dist/{adapter-_WBomuTw.d.mts → adapter-Dl4Wwz1I.d.mts} +4 -2
- package/dist/adapter-Dl4Wwz1I.d.mts.map +1 -0
- package/dist/adapter.d.mts +5 -5
- package/dist/adapter.mjs +2 -2
- 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 +1 -1
- package/dist/adapter__runtime.mjs +89 -14
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/{codec-descriptor-Du6DSz-3-ytBCu_mq.mjs → codec-descriptor-3xp1XvVH-yVLnNzZ8.mjs} +5 -3
- package/dist/codec-descriptor-3xp1XvVH-yVLnNzZ8.mjs.map +1 -0
- package/dist/codec-ids-CrR9Xi7r-CarpqbNM.mjs +20 -0
- package/dist/codec-ids-CrR9Xi7r-CarpqbNM.mjs.map +1 -0
- package/dist/codec-ids-Dgh5IpML-76oBMuwK.d.mts +20 -0
- package/dist/codec-ids-Dgh5IpML-76oBMuwK.d.mts.map +1 -0
- package/dist/codec-types-BH5moCD9.d.mts +1 -0
- package/dist/codec-types-Bai_CFkk-Blx2GxCH.d.mts +31 -0
- package/dist/codec-types-Bai_CFkk-Blx2GxCH.d.mts.map +1 -0
- package/dist/codec-types-zzVcrnbk.d.mts +1 -0
- package/dist/codecs-BMidk26M-DsKq6wt5.d.mts +282 -0
- package/dist/codecs-BMidk26M-DsKq6wt5.d.mts.map +1 -0
- package/dist/codecs-BfiB79-5.mjs +750 -0
- package/dist/codecs-BfiB79-5.mjs.map +1 -0
- package/dist/codecs-C_twedMx.d.mts +36 -0
- package/dist/codecs-C_twedMx.d.mts.map +1 -0
- package/dist/{contract-contributions-B9njRJbt-ClEtrK2L.mjs → contract-contributions-ChiX6W0F-CAng98bZ.mjs} +5 -4
- package/dist/contract-contributions-ChiX6W0F-CAng98bZ.mjs.map +1 -0
- package/dist/{control-6wRZXIJ7.mjs → control-5eVF1TXc.mjs} +2 -2
- package/dist/{control-6wRZXIJ7.mjs.map → control-5eVF1TXc.mjs.map} +1 -1
- package/dist/{control-WTY7Jpxk.mjs → control-BBhWaGnH.mjs} +24 -13
- package/dist/control-BBhWaGnH.mjs.map +1 -0
- package/dist/control-BvSM7mGR.d.mts +396 -0
- package/dist/control-BvSM7mGR.d.mts.map +1 -0
- package/dist/{control-Ez_PtlFI.d.mts → control-MoPFgSaQ.d.mts} +2 -2
- package/dist/{control-Ez_PtlFI.d.mts.map → control-MoPFgSaQ.d.mts.map} +1 -1
- package/dist/data-type-entries-C7VH2IHc-D1d5I8zF.mjs +59 -0
- package/dist/data-type-entries-C7VH2IHc-D1d5I8zF.mjs.map +1 -0
- package/dist/{data-types-SXrh0Lou.d.mts → data-types-C-rfxpgB.d.mts} +2 -2
- package/dist/data-types-C-rfxpgB.d.mts.map +1 -0
- package/dist/data-types-D2HAT-Qf-CRI506c0.d.mts +88 -0
- package/dist/data-types-D2HAT-Qf-CRI506c0.d.mts.map +1 -0
- package/dist/data-types-DOaaPS93-DBkMJyh1.mjs +289 -0
- package/dist/data-types-DOaaPS93-DBkMJyh1.mjs.map +1 -0
- package/dist/date-time-now-generators-DY-8Bodc-DcQ3h4Fg.mjs +72 -0
- package/dist/date-time-now-generators-DY-8Bodc-DcQ3h4Fg.mjs.map +1 -0
- package/dist/{default-normalizer-BDUgHXUn-Xk7HQJuI.mjs → default-normalizer-C8pc7SbL-CKgOEnGl.mjs} +22 -12
- package/dist/default-normalizer-C8pc7SbL-CKgOEnGl.mjs.map +1 -0
- package/dist/{default-normalizer-BBhGpw7r.d.mts → default-normalizer-CGIwQiKB.d.mts} +4 -4
- package/dist/{default-normalizer-BBhGpw7r.d.mts.map → default-normalizer-CGIwQiKB.d.mts.map} +1 -1
- package/dist/descriptor-meta-CsMPRsxp-DhK87vlc.mjs +352 -0
- package/dist/descriptor-meta-CsMPRsxp-DhK87vlc.mjs.map +1 -0
- package/dist/driver.mjs +1 -1
- package/dist/driver__control.mjs +1 -1
- package/dist/driver__runtime.mjs +275 -126
- package/dist/driver__runtime.mjs.map +1 -1
- package/dist/errors-Cng94tYg-D02Eud2d.mjs +87 -0
- package/dist/errors-Cng94tYg-D02Eud2d.mjs.map +1 -0
- package/dist/{errors-BYhjQT7y.d.mts → errors-DfrC_yfG.d.mts} +2 -2
- package/dist/{errors-BYhjQT7y.d.mts.map → errors-DfrC_yfG.d.mts.map} +1 -1
- package/dist/{marker-lock-CmGvN4hw-Com29AtQ.mjs → marker-lock-Bwew7cAs-CZ20Y_tA.mjs} +3 -3
- package/dist/{marker-lock-CmGvN4hw-Com29AtQ.mjs.map → marker-lock-Bwew7cAs-CZ20Y_tA.mjs.map} +1 -1
- package/dist/{marker-read-aEaHihYj-Cyg16yn1.mjs → marker-read-Cf80LSbG-CUp3v1e5.mjs} +5 -5
- package/dist/{marker-read-aEaHihYj-Cyg16yn1.mjs.map → marker-read-Cf80LSbG-CUp3v1e5.mjs.map} +1 -1
- package/dist/mysql-contract-serializer-BnTKRSsN-B2O3EreV.mjs +35 -0
- package/dist/mysql-contract-serializer-BnTKRSsN-B2O3EreV.mjs.map +1 -0
- package/dist/{mysql-contract-serializer-DLv0uW_f-Cg4A43Ry.mjs → mysql-database-CHl9-oSL-CWZLDXt6.mjs} +39 -40
- package/dist/mysql-database-CHl9-oSL-CWZLDXt6.mjs.map +1 -0
- package/dist/now-expression-DVD18CUc-00buJUto.mjs +38 -0
- package/dist/now-expression-DVD18CUc-00buJUto.mjs.map +1 -0
- package/dist/{pack-YVG-iBMQ.d.mts → pack-BXvLVBWP.d.mts} +395 -14
- package/dist/{pack-YVG-iBMQ.d.mts.map → pack-BXvLVBWP.d.mts.map} +1 -1
- package/dist/require-temporal-DeDQhbTn-Bxc65WbA.mjs +16 -0
- package/dist/require-temporal-DeDQhbTn-Bxc65WbA.mjs.map +1 -0
- package/dist/{runner-BaBQoXiU-C7ln-4b2.mjs → runner-C39AEe6--BVG3xPYw.mjs} +7 -7
- package/dist/{runner-BaBQoXiU-C7ln-4b2.mjs.map → runner-C39AEe6--BVG3xPYw.mjs.map} +1 -1
- package/dist/{runtime-CeuRr9nE.d.mts → runtime-ClRDfPiY.d.mts} +2 -2
- package/dist/{runtime-CeuRr9nE.d.mts.map → runtime-ClRDfPiY.d.mts.map} +1 -1
- package/dist/runtime-CrB5DXx4.d.mts +54 -0
- package/dist/runtime-CrB5DXx4.d.mts.map +1 -0
- package/dist/{sql-utils-Db0IQO_B-PaULnfrE.mjs → sql-utils-Cmv_TVa8-BetrIUcj.mjs} +3 -3
- package/dist/{sql-utils-Db0IQO_B-PaULnfrE.mjs.map → sql-utils-Cmv_TVa8-BetrIUcj.mjs.map} +1 -1
- package/dist/{sql-utils-RW0vJvDl.mjs → sql-utils-bD4SfgX0.mjs} +2 -2
- package/dist/{sql-utils-RW0vJvDl.mjs.map → sql-utils-bD4SfgX0.mjs.map} +1 -1
- package/dist/{statement-kfMRMKIt-D6cAOKys.mjs → statement-DC62oiSx-Buzptbpk.mjs} +21 -15
- package/dist/statement-DC62oiSx-Buzptbpk.mjs.map +1 -0
- package/dist/target.d.mts +14 -13
- package/dist/target.mjs +17 -13
- 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 +3 -3
- package/dist/target__codecs.mjs +3 -2
- package/dist/target__control.d.mts +2 -2
- package/dist/target__control.mjs +38 -32
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__data-types.d.mts +3 -3
- package/dist/target__data-types.mjs +3 -3
- package/dist/target__default-normalizer.d.mts +1 -1
- package/dist/target__default-normalizer.mjs +1 -1
- 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.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 +3 -3
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/target__sql-utils.mjs +2 -2
- package/dist/target__types.d.mts +2 -0
- package/dist/target__types.mjs +2 -0
- package/dist/{control-_4epnrIW.d.mts → types-CgrFHUdk.d.mts} +3 -8
- package/dist/types-CgrFHUdk.d.mts.map +1 -0
- package/package.json +18 -12
- package/dist/adapter-_WBomuTw.d.mts.map +0 -1
- package/dist/codec-descriptor-Du6DSz-3-ytBCu_mq.mjs.map +0 -1
- package/dist/codec-ids-cjxtOcLM-vFeQhgPm.mjs +0 -10
- package/dist/codec-ids-cjxtOcLM-vFeQhgPm.mjs.map +0 -1
- package/dist/codec-ids-sMOU8F-B-BQbCq2dr.d.mts +0 -10
- package/dist/codec-ids-sMOU8F-B-BQbCq2dr.d.mts.map +0 -1
- package/dist/codec-types-Bd7DL1Mr-CZWNfnp9.d.mts +0 -21
- package/dist/codec-types-Bd7DL1Mr-CZWNfnp9.d.mts.map +0 -1
- package/dist/codec-types-Bo3Jfilx.d.mts +0 -1
- package/dist/codec-types-Ja2kLzLS.d.mts +0 -1
- package/dist/codecs-C00kjHgh.mjs +0 -282
- package/dist/codecs-C00kjHgh.mjs.map +0 -1
- package/dist/codecs-CO_VNEYU-CwAnKzRs.d.mts +0 -102
- package/dist/codecs-CO_VNEYU-CwAnKzRs.d.mts.map +0 -1
- package/dist/codecs-DM61agRr.d.mts +0 -21
- package/dist/codecs-DM61agRr.d.mts.map +0 -1
- package/dist/contract-contributions-B9njRJbt-ClEtrK2L.mjs.map +0 -1
- package/dist/control-WTY7Jpxk.mjs.map +0 -1
- package/dist/control-_4epnrIW.d.mts.map +0 -1
- package/dist/data-type-entries-B0AoBozh-f9AEUIUQ.mjs +0 -42
- package/dist/data-type-entries-B0AoBozh-f9AEUIUQ.mjs.map +0 -1
- package/dist/data-types-BpihGKoK-BMW-m4EN.d.mts +0 -52
- package/dist/data-types-BpihGKoK-BMW-m4EN.d.mts.map +0 -1
- package/dist/data-types-Dv9gwVRV-BZPzCWZk.mjs +0 -181
- package/dist/data-types-Dv9gwVRV-BZPzCWZk.mjs.map +0 -1
- package/dist/data-types-SXrh0Lou.d.mts.map +0 -1
- package/dist/default-normalizer-BDUgHXUn-Xk7HQJuI.mjs.map +0 -1
- package/dist/descriptor-meta-BurjcSiU-Cbk2L1jf.mjs +0 -82
- package/dist/descriptor-meta-BurjcSiU-Cbk2L1jf.mjs.map +0 -1
- package/dist/descriptor-meta-runtime-Bk_00UrX-BLN4Ahpj.mjs +0 -17
- package/dist/descriptor-meta-runtime-Bk_00UrX-BLN4Ahpj.mjs.map +0 -1
- package/dist/errors-rvH_F2Yj-BQrO_--u.mjs +0 -20
- package/dist/errors-rvH_F2Yj-BQrO_--u.mjs.map +0 -1
- package/dist/mysql-contract-serializer-DLv0uW_f-Cg4A43Ry.mjs.map +0 -1
- package/dist/runtime-Cl0BbTZq.d.mts +0 -22
- package/dist/runtime-Cl0BbTZq.d.mts.map +0 -1
- package/dist/statement-kfMRMKIt-D6cAOKys.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs-BfiB79-5.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/codecs.mjs"],"sourcesContent":["import { a as mysqlCodec, n as buildMysqlCodecDescriptorRegistry, r as identityJsonProjection, t as MysqlCodecDescriptor } from \"./codec-descriptor-3xp1XvVH.mjs\";\nimport { a as MYSQL_DATE_STRING_CODEC_ID, c as MYSQL_ENUM_CODEC_ID, d as MYSQL_TIMESTAMP_DATE_CODEC_ID, f as MYSQL_TIMESTAMP_STRING_CODEC_ID, h as MYSQL_TIME_TEMPORAL_CODEC_ID, i as MYSQL_DATETIME_TEMPORAL_CODEC_ID, l as MYSQL_INT_CODEC_ID, m as MYSQL_TIME_STRING_CODEC_ID, n as MYSQL_DATETIME_CODEC_ID, o as MYSQL_DATE_TEMPORAL_CODEC_ID, p as MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID, r as MYSQL_DATETIME_STRING_CODEC_ID, s as MYSQL_DURATION_STRING_CODEC_ID, t as MYSQL_BIGINT_CODEC_ID, u as MYSQL_TEXT_CODEC_ID } from \"./codec-ids-CrR9Xi7r.mjs\";\nimport { c as mysqlQueryNotYetSupported, n as errorDateTimeUnwritable, o as errorTemporalWrongType, r as errorTemporalNonIsoCalendar, s as mysqlError, t as errorDateTimeUnreadable } from \"./errors-Cng94tYg.mjs\";\nimport { C as mysqlTimestampText, S as mysqlTimestamp, _ as mysqlInt, b as mysqlTime, c as mysqlDateText, d as mysqlDatetimeText, f as mysqlDuration, g as mysqlEnumParams, h as mysqlEnum, i as mysqlChar, l as mysqlDatetime, m as mysqlDurationText, p as mysqlDurationParams, r as mysqlBigint, s as mysqlDate, u as mysqlDatetimeParams, v as mysqlText, w as mysqlVarchar, x as mysqlTimeText } from \"./data-types-DOaaPS93.mjs\";\nimport { t as requireTemporal } from \"./require-temporal-DeDQhbTn.mjs\";\nimport { a as mysqlNowExpression, i as mysqlCurrentValueFor, n as MYSQL_INSTANT_NOW, r as MYSQL_TIME_NOW, t as MYSQL_DATE_NOW } from \"./now-expression-DVD18CUc.mjs\";\nimport { CodecImpl, dateTimeStoredText, decimalTextBigintLiteral, refuseJsonValue, renderTsLiteral } from \"@internal/framework-components/codec\";\nimport { CastExpr, SqlCharCodec, SqlRawCodec, SqlVarcharCodec, sqlCharDescriptor, sqlRawDescriptor, sqlVarcharDescriptor } from \"@internal/sql-relational-core/ast\";\nimport { sqlRawDataType } from \"@internal/sql-contract/data-type\";\nimport { hasDigitsBelow, hasDigitsBelowAMillisecond, isValidDate } from \"@internal/type-implementations/date\";\nimport { describeValue, temporalFromText, temporalToText, withoutUtcDesignator } from \"@internal/type-implementations/temporal-text\";\nimport { extractCodecLookup } from \"@internal/framework-components/control\";\nimport { buildCodecDescriptorRegistry } from \"@internal/sql-relational-core/codec-descriptor-registry\";\n//#region src/core/date-time-values.ts\nfunction messageOf(cause) {\n\treturn cause instanceof Error ? cause.message : String(cause);\n}\n/** The text MySQL reads for a stored date and time, `2024-01-02 03:04:05.5`. */\nfunction mysqlWireText(stored) {\n\treturn stored.replace(\"T\", \" \");\n}\n/** The UTC date and time without an offset that ISO 8601 text with a UTC offset names, in the form `stored` writes. Throws when the text names no instant, or one `stored` refuses. */\nfunction utcDateTimeOfInstantText(codecId, text, stored) {\n\treturn stored(withoutUtcDesignator(dateTimeStoredText(text, {\n\t\tshape: \"instant\",\n\t\townerId: codecId\n\t})));\n}\n/** The stored form `stored` writes for a value an application wrote; a value it refuses is refused as `RUNTIME.ENCODE_FAILED`. */\nfunction storedTextForWrite(codecId, value, stored) {\n\tif (typeof value !== \"string\") throw errorDateTimeUnwritable({\n\t\tcodecId,\n\t\treceived: describeValue(value),\n\t\tdetail: \"It writes ISO 8601 text.\"\n\t});\n\ttry {\n\t\treturn stored(value);\n\t} catch (cause) {\n\t\tthrow errorDateTimeUnwritable({\n\t\t\tcodecId,\n\t\t\treceived: JSON.stringify(value),\n\t\t\tdetail: messageOf(cause),\n\t\t\tcause\n\t\t});\n\t}\n}\n/** The stored form of the text MySQL returned for a row, as `stored` reads it; text `stored` refuses is refused as `RUNTIME.DECODE_FAILED`. */\nfunction storedTextFromWire(codecId, wire, stored) {\n\tif (typeof wire !== \"string\") throw errorDateTimeUnreadable({\n\t\tcodecId,\n\t\tvalue: String(wire),\n\t\tdetail: `MySQL returned ${describeValue(wire)}, not text.`\n\t});\n\ttry {\n\t\treturn stored(wire);\n\t} catch (cause) {\n\t\tthrow errorDateTimeUnreadable({\n\t\t\tcodecId,\n\t\t\tvalue: wire,\n\t\t\tdetail: messageOf(cause),\n\t\t\tcause\n\t\t});\n\t}\n}\n/** The Temporal value that stored text names, read with `parse`. */\nfunction temporalFromStoredText(identity, text, parse) {\n\tconst read = temporalFromText(requireTemporal({\n\t\tcodecId: identity.codecId,\n\t\toperation: \"decode\"\n\t}), text, parse);\n\tif (read.kind === \"unreadable\") throw errorDateTimeUnreadable({\n\t\tcodecId: identity.codecId,\n\t\tvalue: text,\n\t\tdetail: `${identity.temporalTag} cannot hold it: ${read.detail}. Use ${identity.stringType} to read the column as text.`,\n\t\tcause: read.cause\n\t});\n\treturn read.value;\n}\n/** The stored form of a Temporal value, as `stored` writes its ISO text. A value of another kind, in a calendar other than ISO 8601, or with digits below a microsecond, which MySQL does not hold, is refused. */\nfunction storedTextOfTemporal(identity, value, stored) {\n\tconst encoded = temporalToText(value, identity.temporalTag);\n\tswitch (encoded.kind) {\n\t\tcase \"wrong-type\": throw errorTemporalWrongType(identity.codecId, identity.temporalTag, identity.stringType, encoded.received);\n\t\tcase \"non-iso-calendar\": throw errorTemporalNonIsoCalendar(identity.codecId, encoded.calendarId);\n\t\tcase \"text\":\n\t\t\tif (hasDigitsBelow(encoded.text, 6)) throw errorDateTimeUnwritable({\n\t\t\t\tcodecId: identity.codecId,\n\t\t\t\treceived: `the ${identity.temporalTag} ${encoded.text}`,\n\t\t\t\tdetail: \"It has digits below a microsecond, and MySQL holds microseconds at most. Round it first, as in value.round({ smallestUnit: 'microsecond', roundingMode: 'trunc' }).\"\n\t\t\t});\n\t\t\treturn storedTextForWrite(identity.codecId, encoded.text, stored);\n\t}\n}\nconst WIRE_DATE_TIME = /^(\\d{4}-\\d{2}-\\d{2})[ T](\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?)$/;\n/** The instant the text MySQL sends for a `datetime` or a `timestamp` names in UTC: every session runs in UTC, so the text holds no time zone of its own. */\nfunction dateOfWireText(codecId, wire) {\n\tconst match = WIRE_DATE_TIME.exec(wire);\n\tconst date = match === null ? void 0 : /* @__PURE__ */ new Date(`${match[1]}T${match[2]}Z`);\n\tif (date === void 0 || !isValidDate(date)) throw mysqlError(\"RUNTIME.DECODE_FAILED\", `${codecId} wire value must be a date and time as MySQL prints it`, { meta: {\n\t\tcodecId,\n\t\treceived: String(wire)\n\t} });\n\treturn date;\n}\n/** The text MySQL reads for a `Date` in UTC, with millisecond digits. An Invalid Date, and an instant `stored` refuses, are refused. */\nfunction wireTextOfDate(codecId, value, stored) {\n\tif (!isValidDate(value)) throw mysqlError(\"RUNTIME.ENCODE_FAILED\", `${codecId} value must be a valid Date`, { meta: {\n\t\tcodecId,\n\t\treceived: String(value)\n\t} });\n\tconst text = value.toISOString();\n\tstoredTextForWrite(codecId, text, (instant) => utcDateTimeOfInstantText(codecId, instant, stored));\n\treturn mysqlWireText(withoutUtcDesignator(text));\n}\n/** The fraction digits a column with `params` holds: its `precision`, or 0, which MySQL holds when none is written. */\nfunction precisionOf(params) {\n\tconst precision = params[\"precision\"];\n\treturn typeof precision === \"number\" ? precision : 0;\n}\n/** `stored`, a contract value of a column with `params`; a value with more fraction digits than the column holds, which MySQL would round, is refused. */\nfunction storedWithinPrecision(codecId, stored, params) {\n\tconst precision = precisionOf(params);\n\tif (!hasDigitsBelow(stored, precision)) return stored;\n\treturn refuseJsonValue(codecId, `a value with at most ${precision} ${precision === 1 ? \"fraction digit\" : \"fraction digits\"} of a second, which precision ${precision} holds without rounding`, stored);\n}\n/** Wire text with its fraction cut to the digits the column's `precision` holds: MySQL rounds a value to its column, which could carry it to the next second, day or past the column's range. A codec reference that names no precision, as a raw parameter writes, describes no column, so its value is written whole. */\nfunction roundedDownToPrecision(text, params) {\n\tconst precision = params[\"precision\"];\n\tif (typeof precision !== \"number\") return text;\n\treturn text.replace(/\\.(\\d+)$/, (_fraction, digits) => precision === 0 ? \"\" : `.${digits.slice(0, precision)}`);\n}\n//#endregion\n//#region src/core/date-time-codecs.ts\n/** The stored form of an instant written as ISO 8601 text with a UTC offset: its UTC date and time, in the form `stored` writes. */\nconst instantIn = (codecId, stored) => (text) => utcDateTimeOfInstantText(codecId, text, stored);\n/** Reads the text MySQL returns for a row in any year: a column's range is refused on write only. */\nconst anyYear = (ownerId, shape) => (text) => dateTimeStoredText(text, {\n\tshape,\n\townerId\n});\nconst datetimeRow = anyYear(mysqlDatetime.id, \"dateTime\");\nconst timestampRow = anyYear(mysqlTimestamp.id, \"dateTime\");\nconst dateRow = anyYear(mysqlDate.id, \"date\");\nconst DATETIME_TEMPORAL = {\n\tcodecId: MYSQL_DATETIME_TEMPORAL_CODEC_ID,\n\ttemporalTag: \"Temporal.Instant\",\n\tstringType: \"DatetimeString\"\n};\nconst TIMESTAMP_TEMPORAL = {\n\tcodecId: MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID,\n\ttemporalTag: \"Temporal.Instant\",\n\tstringType: \"TimestampString\"\n};\nconst DATE_TEMPORAL = {\n\tcodecId: MYSQL_DATE_TEMPORAL_CODEC_ID,\n\ttemporalTag: \"Temporal.PlainDate\",\n\tstringType: \"DateString\"\n};\nconst TIME_TEMPORAL = {\n\tcodecId: MYSQL_TIME_TEMPORAL_CODEC_ID,\n\ttemporalTag: \"Temporal.PlainTime\",\n\tstringType: \"TimeString\"\n};\nconst instantOf = (identity, stored) => temporalFromStoredText(identity, `${stored}Z`, (temporal, text) => temporal.Instant.from(text));\n/** A MySQL `timestamp` as a JavaScript `Date`, read and written in UTC. */\nvar MysqlTimestampDateCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn roundedDownToPrecision(wireTextOfDate(this.id, value, mysqlTimestampText), this.dataTypeParams);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn dateOfWireText(this.id, wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\tconst stored = storedWithinPrecision(this.id, value.value, this.dataTypeParams);\n\t\tif (hasDigitsBelowAMillisecond(stored)) return refuseJsonValue(this.id, `a timestamp with no digits below a millisecond, which a Date drops: ${JSON.stringify(value.value)} has them`, value.value);\n\t\treturn /* @__PURE__ */ new Date(`${stored}Z`);\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(input.toISOString().replace(\"Z\", \"\"));\n\t}\n};\nvar MysqlTimestampDateDescriptor = class extends MysqlCodecDescriptor {\n\tdataType = mysqlTimestamp.id;\n\tcodecId = MYSQL_TIMESTAMP_DATE_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\n\tparamsSchema = mysqlDatetimeParams;\n\tjsonProjection(expression) {\n\t\treturn identityJsonProjection(expression);\n\t}\n\tfactory(params) {\n\t\treturn () => new MysqlTimestampDateCodec(this, mysqlTimestamp, params);\n\t}\n};\nconst mysqlTimestampDateDescriptor = new MysqlTimestampDateDescriptor();\n/** An instant read as `Temporal.Instant` from a `datetime` that holds it in UTC. */\nvar MysqlDatetimeTemporalCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn roundedDownToPrecision(mysqlWireText(this.stored(value)), this.dataTypeParams);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn instantOf(DATETIME_TEMPORAL, storedTextFromWire(this.id, wire, datetimeRow));\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn instantOf(DATETIME_TEMPORAL, storedWithinPrecision(this.id, value.value, this.dataTypeParams));\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(this.stored(input));\n\t}\n\tstored(value) {\n\t\treturn storedTextOfTemporal(DATETIME_TEMPORAL, value, instantIn(this.id, mysqlDatetimeText));\n\t}\n};\nvar MysqlDatetimeTemporalDescriptor = class extends MysqlCodecDescriptor {\n\tdataType = mysqlDatetime.id;\n\tcodecId = MYSQL_DATETIME_TEMPORAL_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\n\tparamsSchema = mysqlDatetimeParams;\n\tjsonProjection(expression) {\n\t\treturn identityJsonProjection(expression);\n\t}\n\tfactory(params) {\n\t\treturn () => new MysqlDatetimeTemporalCodec(this, mysqlDatetime, params);\n\t}\n};\nconst mysqlDatetimeTemporalDescriptor = new MysqlDatetimeTemporalDescriptor();\n/** An instant read as `Temporal.Instant` from a `timestamp`. */\nvar MysqlTimestampTemporalCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn roundedDownToPrecision(mysqlWireText(this.stored(value)), this.dataTypeParams);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn instantOf(TIMESTAMP_TEMPORAL, storedTextFromWire(this.id, wire, timestampRow));\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn instantOf(TIMESTAMP_TEMPORAL, storedWithinPrecision(this.id, value.value, this.dataTypeParams));\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(this.stored(input));\n\t}\n\tstored(value) {\n\t\treturn storedTextOfTemporal(TIMESTAMP_TEMPORAL, value, instantIn(this.id, mysqlTimestampText));\n\t}\n};\nvar MysqlTimestampTemporalDescriptor = class extends MysqlCodecDescriptor {\n\tdataType = mysqlTimestamp.id;\n\tcodecId = MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\n\tparamsSchema = mysqlDatetimeParams;\n\tjsonProjection(expression) {\n\t\treturn identityJsonProjection(expression);\n\t}\n\tfactory(params) {\n\t\treturn () => new MysqlTimestampTemporalCodec(this, mysqlTimestamp, params);\n\t}\n};\nconst mysqlTimestampTemporalDescriptor = new MysqlTimestampTemporalDescriptor();\n/** The literal of the instant text a string codec reads from a stored date and time, which has no offset. */\nfunction renderInstantTextLiteral(value) {\n\treturn typeof value === \"string\" ? renderTsLiteral(`${value}Z`) : void 0;\n}\n/** An instant read as ISO 8601 text in UTC, `2024-01-01T00:00:00.5Z`, from a `datetime`. A write takes ISO 8601 text with any UTC offset. */\nvar MysqlDatetimeStringCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn roundedDownToPrecision(mysqlWireText(storedTextForWrite(this.id, value, instantIn(this.id, mysqlDatetimeText))), this.dataTypeParams);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn `${storedTextFromWire(this.id, wire, datetimeRow)}Z`;\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn `${storedWithinPrecision(this.id, value.value, this.dataTypeParams)}Z`;\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(instantIn(this.id, mysqlDatetimeText)(input));\n\t}\n};\nvar MysqlDatetimeStringDescriptor = class extends MysqlCodecDescriptor {\n\tdataType = mysqlDatetime.id;\n\tcodecId = MYSQL_DATETIME_STRING_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\n\tparamsSchema = mysqlDatetimeParams;\n\trenderValueLiteral(value) {\n\t\treturn renderInstantTextLiteral(value);\n\t}\n\tjsonProjection(expression) {\n\t\treturn identityJsonProjection(expression);\n\t}\n\tfactory(params) {\n\t\treturn () => new MysqlDatetimeStringCodec(this, mysqlDatetime, params);\n\t}\n};\nconst mysqlDatetimeStringDescriptor = new MysqlDatetimeStringDescriptor();\n/** An instant read as ISO 8601 text in UTC, `2024-01-01T00:00:00.5Z`, from a `timestamp`. A write takes ISO 8601 text with any UTC offset. */\nvar MysqlTimestampStringCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn roundedDownToPrecision(mysqlWireText(storedTextForWrite(this.id, value, instantIn(this.id, mysqlTimestampText))), this.dataTypeParams);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn `${storedTextFromWire(this.id, wire, timestampRow)}Z`;\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn `${storedWithinPrecision(this.id, value.value, this.dataTypeParams)}Z`;\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(instantIn(this.id, mysqlTimestampText)(input));\n\t}\n};\nvar MysqlTimestampStringDescriptor = class extends MysqlCodecDescriptor {\n\tdataType = mysqlTimestamp.id;\n\tcodecId = MYSQL_TIMESTAMP_STRING_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\n\tparamsSchema = mysqlDatetimeParams;\n\trenderValueLiteral(value) {\n\t\treturn renderInstantTextLiteral(value);\n\t}\n\tjsonProjection(expression) {\n\t\treturn identityJsonProjection(expression);\n\t}\n\tfactory(params) {\n\t\treturn () => new MysqlTimestampStringCodec(this, mysqlTimestamp, params);\n\t}\n};\nconst mysqlTimestampStringDescriptor = new MysqlTimestampStringDescriptor();\n/** A calendar date read as ISO 8601 text, `2024-02-29`. */\nvar MysqlDateStringCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn storedTextForWrite(this.id, value, mysqlDateText);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn storedTextFromWire(this.id, wire, dateRow);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn value.value;\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.storedDataTypeValueOf(input);\n\t}\n};\nvar MysqlDateStringDescriptor = class extends MysqlCodecDescriptor {\n\tdataType = mysqlDate.id;\n\tcodecId = MYSQL_DATE_STRING_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\n\tparamsSchema = void 0;\n\trenderValueLiteral(value) {\n\t\treturn renderTsLiteral(value);\n\t}\n\tjsonProjection(expression) {\n\t\treturn identityJsonProjection(expression);\n\t}\n\tfactory() {\n\t\treturn () => new MysqlDateStringCodec(this, mysqlDate);\n\t}\n};\nconst mysqlDateStringDescriptor = new MysqlDateStringDescriptor();\n/** A calendar date read as `Temporal.PlainDate`. */\nvar MysqlDateTemporalCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn storedTextOfTemporal(DATE_TEMPORAL, value, mysqlDateText);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn this.plainDateOf(storedTextFromWire(this.id, wire, dateRow));\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn this.plainDateOf(value.value);\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(storedTextOfTemporal(DATE_TEMPORAL, input, mysqlDateText));\n\t}\n\tplainDateOf(stored) {\n\t\treturn temporalFromStoredText(DATE_TEMPORAL, stored, (temporal, text) => temporal.PlainDate.from(text));\n\t}\n};\nvar MysqlDateTemporalDescriptor = class extends MysqlCodecDescriptor {\n\tdataType = mysqlDate.id;\n\tcodecId = MYSQL_DATE_TEMPORAL_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\n\tparamsSchema = void 0;\n\tjsonProjection(expression) {\n\t\treturn identityJsonProjection(expression);\n\t}\n\tfactory() {\n\t\treturn () => new MysqlDateTemporalCodec(this, mysqlDate);\n\t}\n};\nconst mysqlDateTemporalDescriptor = new MysqlDateTemporalDescriptor();\n/** A time of day read as ISO 8601 text, `09:30:00.5`. A MySQL `time` outside 00:00:00 to 23:59:59.999999 is no time of day, so it is refused on read and on write. */\nvar MysqlTimeStringCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn roundedDownToPrecision(storedTextForWrite(this.id, value, mysqlTimeText), this.dataTypeParams);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn storedTextFromWire(this.id, wire, mysqlTimeText);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn storedWithinPrecision(this.id, value.value, this.dataTypeParams);\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.storedDataTypeValueOf(input);\n\t}\n};\nvar MysqlTimeStringDescriptor = class extends MysqlCodecDescriptor {\n\tdataType = mysqlTime.id;\n\tcodecId = MYSQL_TIME_STRING_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\n\tparamsSchema = mysqlDatetimeParams;\n\trenderValueLiteral(value) {\n\t\treturn renderTsLiteral(value);\n\t}\n\tjsonProjection(expression) {\n\t\treturn identityJsonProjection(expression);\n\t}\n\tfactory(params) {\n\t\treturn () => new MysqlTimeStringCodec(this, mysqlTime, params);\n\t}\n};\nconst mysqlTimeStringDescriptor = new MysqlTimeStringDescriptor();\n/** A time of day read as `Temporal.PlainTime`. */\nvar MysqlTimeTemporalCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn roundedDownToPrecision(storedTextOfTemporal(TIME_TEMPORAL, value, mysqlTimeText), this.dataTypeParams);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn this.plainTimeOf(storedTextFromWire(this.id, wire, mysqlTimeText));\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn this.plainTimeOf(storedWithinPrecision(this.id, value.value, this.dataTypeParams));\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(storedTextOfTemporal(TIME_TEMPORAL, input, mysqlTimeText));\n\t}\n\tplainTimeOf(stored) {\n\t\treturn temporalFromStoredText(TIME_TEMPORAL, stored, (temporal, text) => temporal.PlainTime.from(text));\n\t}\n};\nvar MysqlTimeTemporalDescriptor = class extends MysqlCodecDescriptor {\n\tdataType = mysqlTime.id;\n\tcodecId = MYSQL_TIME_TEMPORAL_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\n\tparamsSchema = mysqlDatetimeParams;\n\tjsonProjection(expression) {\n\t\treturn identityJsonProjection(expression);\n\t}\n\tfactory(params) {\n\t\treturn () => new MysqlTimeTemporalCodec(this, mysqlTime, params);\n\t}\n};\nconst mysqlTimeTemporalDescriptor = new MysqlTimeTemporalDescriptor();\n/** A length of time read as the ISO 8601 duration it was written as, `PT1H30M`, stored in a `varchar` column. Its text does not sort in the order of the durations, so it offers no order. */\nvar MysqlDurationStringCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn storedTextForWrite(this.id, value, mysqlDurationText);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn storedTextFromWire(this.id, wire, mysqlDurationText);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn value.value;\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.storedDataTypeValueOf(input);\n\t}\n};\nvar MysqlDurationStringDescriptor = class extends MysqlCodecDescriptor {\n\tdataType = mysqlDuration.id;\n\tcodecId = MYSQL_DURATION_STRING_CODEC_ID;\n\ttraits = [\"equality\"];\n\tparamsSchema = mysqlDurationParams;\n\trenderValueLiteral(value) {\n\t\treturn renderTsLiteral(value);\n\t}\n\tjsonProjection(expression) {\n\t\treturn identityJsonProjection(expression);\n\t}\n\tfactory(_params) {\n\t\treturn () => new MysqlDurationStringCodec(this, mysqlDuration);\n\t}\n};\nconst mysqlDurationStringDescriptor = new MysqlDurationStringDescriptor();\n//#endregion\n//#region src/core/codecs.ts\nconst DECIMAL_INTEGER = /^-?\\d+$/;\nconst BIGINT_MIN = -(2n ** 63n);\nconst BIGINT_MAX = 2n ** 63n - 1n;\n/** Projects a bigint as its decimal text: a JSON number past 2^53 would lose digits when JavaScript parses the include. */\nconst textJsonProjection = (expression) => CastExpr.as(expression, \"CHAR\");\nfunction decodeFailed(codecId, expected, received) {\n\tthrow mysqlError(\"RUNTIME.DECODE_FAILED\", `${codecId} wire value must be ${expected}`, { meta: {\n\t\tcodecId,\n\t\treceived: String(received)\n\t} });\n}\nfunction encodeFailed(codecId, expected, received) {\n\tthrow mysqlError(\"RUNTIME.ENCODE_FAILED\", `${codecId} value must be ${expected}`, { meta: {\n\t\tcodecId,\n\t\treceived: String(received)\n\t} });\n}\nconst mysqlSqlCharDescriptor = mysqlCodec(sqlCharDescriptor, {\n\tdataType: mysqlChar,\n\trenderValueLiteral: renderTsLiteral,\n\tjsonProjection: identityJsonProjection,\n\tfactory: (descriptor, dataType, params) => () => new SqlCharCodec(descriptor, dataType, params)\n});\nconst mysqlSqlVarcharDescriptor = mysqlCodec(sqlVarcharDescriptor, {\n\tdataType: mysqlVarchar,\n\trenderValueLiteral: renderTsLiteral,\n\tjsonProjection: identityJsonProjection,\n\tfactory: (descriptor, dataType, params) => () => new SqlVarcharCodec(descriptor, dataType, params)\n});\nconst mysqlSqlRawDescriptor = mysqlCodec(sqlRawDescriptor, {\n\tdataType: sqlRawDataType,\n\tjsonProjection: () => {\n\t\tthrow mysqlQueryNotYetSupported(\"Reading a raw column inside an include\");\n\t},\n\tfactory: (descriptor, dataType, params) => () => new SqlRawCodec(descriptor, dataType, params)\n});\nvar MysqlTextCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn value;\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn wire;\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn value.value;\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(input);\n\t}\n};\nvar MysqlTextDescriptor = class extends MysqlCodecDescriptor {\n\tdataType = mysqlText.id;\n\tcodecId = MYSQL_TEXT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\tparamsSchema = void 0;\n\trenderValueLiteral(value) {\n\t\treturn renderTsLiteral(value);\n\t}\n\tjsonProjection(expression) {\n\t\treturn identityJsonProjection(expression);\n\t}\n\tfactory() {\n\t\treturn () => new MysqlTextCodec(this, mysqlText);\n\t}\n};\nconst mysqlTextDescriptor = new MysqlTextDescriptor();\n/** A MySQL `int` as a JavaScript number. A row carries it as decimal text, and an include's JSON as a number. */\nvar MysqlIntCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\tif (!Number.isSafeInteger(value)) return encodeFailed(MYSQL_INT_CODEC_ID, \"an integer\", value);\n\t\treturn value;\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\tif (typeof wire === \"number\") return wire;\n\t\tif (!DECIMAL_INTEGER.test(wire)) return decodeFailed(MYSQL_INT_CODEC_ID, \"the decimal text of an integer\", wire);\n\t\treturn Number(wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn value.value;\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(input);\n\t}\n};\nvar MysqlIntDescriptor = class extends MysqlCodecDescriptor {\n\tdataType = mysqlInt.id;\n\tcodecId = MYSQL_INT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\tparamsSchema = void 0;\n\trenderValueLiteral(value) {\n\t\treturn renderTsLiteral(value);\n\t}\n\tjsonProjection(expression) {\n\t\treturn identityJsonProjection(expression);\n\t}\n\tfactory() {\n\t\treturn () => new MysqlIntCodec(this, mysqlInt);\n\t}\n};\nconst mysqlIntDescriptor = new MysqlIntDescriptor();\n/** A MySQL `bigint` as a JavaScript bigint. A row, an include's JSON and a parameter carry it as decimal text, as the Postgres `int8` codec does; MySQL reads a text parameter beside a `bigint` column exactly. */\nvar MysqlBigintCodec = class extends CodecImpl {\n\t/** The bigint itself: the driver writes it as bare digits, which MySQL reads as an exact integer even beside an expression, where it compares quoted text as a double. */\n\tasync toWire(value, _ctx) {\n\t\tif (typeof value !== \"bigint\" || value < BIGINT_MIN || value > BIGINT_MAX) return encodeFailed(MYSQL_BIGINT_CODEC_ID, `a bigint from ${BIGINT_MIN} to ${BIGINT_MAX}`, value);\n\t\treturn value;\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\tif (typeof wire === \"bigint\") return wire;\n\t\tif (!DECIMAL_INTEGER.test(wire)) return decodeFailed(MYSQL_BIGINT_CODEC_ID, \"the decimal text of an integer\", wire);\n\t\treturn BigInt(wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn BigInt(value.value);\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(input.toString());\n\t}\n};\nvar MysqlBigintDescriptor = class extends MysqlCodecDescriptor {\n\tdataType = mysqlBigint.id;\n\tcodecId = MYSQL_BIGINT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\tparamsSchema = void 0;\n\trenderValueLiteral(value) {\n\t\treturn decimalTextBigintLiteral(value);\n\t}\n\tjsonProjection(expression) {\n\t\treturn textJsonProjection(expression);\n\t}\n\tfactory() {\n\t\treturn () => new MysqlBigintCodec(this, mysqlBigint);\n\t}\n};\nconst mysqlBigintDescriptor = new MysqlBigintDescriptor();\n/**\n* Reads the text MySQL sends for a `datetime` as the instant it names in UTC: the codec writes every value in UTC, so the column holds no time zone of its own.\n*/\nfunction decodeMysqlDatetime(wire) {\n\treturn dateOfWireText(MYSQL_DATETIME_CODEC_ID, wire);\n}\n/** The text MySQL reads for an instant in UTC, with millisecond digits. A `Date` outside the years a `datetime` holds is refused. */\nfunction encodeMysqlDatetime(value) {\n\treturn wireTextOfDate(MYSQL_DATETIME_CODEC_ID, value, mysqlDatetimeText);\n}\n/** A MySQL `datetime` as a JavaScript `Date`, read and written in UTC. */\nvar MysqlDatetimeCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn roundedDownToPrecision(encodeMysqlDatetime(value), this.dataTypeParams);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn decodeMysqlDatetime(wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\tconst stored = storedWithinPrecision(this.id, value.value, this.dataTypeParams);\n\t\tif (hasDigitsBelowAMillisecond(stored)) return refuseJsonValue(this.id, `a datetime with no digits below a millisecond, which a Date drops: ${JSON.stringify(value.value)} has them`, value.value);\n\t\treturn /* @__PURE__ */ new Date(`${stored}Z`);\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(input.toISOString().replace(\"Z\", \"\"));\n\t}\n};\nvar MysqlDatetimeDescriptor = class extends MysqlCodecDescriptor {\n\tdataType = mysqlDatetime.id;\n\tcodecId = MYSQL_DATETIME_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\n\tparamsSchema = mysqlDatetimeParams;\n\tjsonProjection(expression) {\n\t\treturn identityJsonProjection(expression);\n\t}\n\tfactory(params) {\n\t\treturn () => new MysqlDatetimeCodec(this, mysqlDatetime, params);\n\t}\n};\nconst mysqlDatetimeDescriptor = new MysqlDatetimeDescriptor();\n/** A native MySQL enum column, whose value is the member's text. */\nvar MysqlEnumCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn value;\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn wire;\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn value.value;\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(input);\n\t}\n};\nvar MysqlEnumDescriptor = class extends MysqlCodecDescriptor {\n\tdataType = mysqlEnum.id;\n\tcodecId = MYSQL_ENUM_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\tparamsSchema = mysqlEnumParams;\n\trenderValueLiteral(value) {\n\t\treturn renderTsLiteral(value);\n\t}\n\tjsonProjection(expression) {\n\t\treturn identityJsonProjection(expression);\n\t}\n\tfactory(params) {\n\t\treturn () => new MysqlEnumCodec(this, mysqlEnum, params);\n\t}\n};\n/** Every codec descriptor this target ships. */\nconst codecDescriptors = [\n\tmysqlSqlCharDescriptor,\n\tmysqlSqlVarcharDescriptor,\n\tmysqlSqlRawDescriptor,\n\tmysqlTextDescriptor,\n\tmysqlIntDescriptor,\n\tmysqlBigintDescriptor,\n\tmysqlDatetimeDescriptor,\n\tmysqlDatetimeTemporalDescriptor,\n\tmysqlDatetimeStringDescriptor,\n\tmysqlTimestampDateDescriptor,\n\tmysqlTimestampTemporalDescriptor,\n\tmysqlTimestampStringDescriptor,\n\tmysqlDateStringDescriptor,\n\tmysqlDateTemporalDescriptor,\n\tmysqlTimeStringDescriptor,\n\tmysqlTimeTemporalDescriptor,\n\tmysqlDurationStringDescriptor,\n\tnew MysqlEnumDescriptor()\n];\n//#endregion\n//#region src/core/registry.ts\n/** Every codec descriptor `@internal/target-mysql` ships, for consumers that enumerate or look up a MySQL codec by id. ADR 208. */\nconst mysqlCodecRegistry = buildCodecDescriptorRegistry(codecDescriptors);\nconst mysqlCodecDescriptorRegistry = buildMysqlCodecDescriptorRegistry(codecDescriptors);\n//#endregion\n//#region src/core/codec-registry.ts\nfunction descriptorsFrom(contributors) {\n\treturn contributors.flatMap((contributor) => contributor.types?.codecTypes?.codecDescriptors ?? []);\n}\nfunction buildMysqlCodecRegistry(descriptors) {\n\tconst descriptorRegistry = buildMysqlCodecDescriptorRegistry(descriptors);\n\tconst registry = {\n\t\t...extractCodecLookup([{\n\t\t\tid: \"mysql-codecs\",\n\t\t\ttypes: { codecTypes: { codecDescriptors: Array.from(descriptorRegistry.values()) } }\n\t\t}]),\n\t\tdescriptorFor: (codecId) => descriptorRegistry.descriptorFor(codecId),\n\t\tvalues: () => descriptorRegistry.values()\n\t};\n\treturn Object.freeze(registry);\n}\n/** The codec registry of a MySQL stack: the target's built-in codecs and those its extensions contribute. */\nfunction assembleMysqlCodecRegistry(target, extensions) {\n\treturn buildMysqlCodecRegistry([\n\t\t...descriptorsFrom([target]),\n\t\t...mysqlCodecDescriptorRegistry.values(),\n\t\t...descriptorsFrom(extensions)\n\t]);\n}\n/** A codec registry of the MySQL built-in codecs only. */\nfunction createMysqlBuiltinCodecLookup() {\n\treturn buildMysqlCodecRegistry([...mysqlCodecDescriptorRegistry.values()]);\n}\n//#endregion\nexport { MYSQL_DATE_NOW, MYSQL_INSTANT_NOW, MYSQL_TIME_NOW, assembleMysqlCodecRegistry, createMysqlBuiltinCodecLookup, decodeMysqlDatetime, encodeMysqlDatetime, mysqlCodecDescriptorRegistry, mysqlCodecRegistry, mysqlCurrentValueFor, mysqlNowExpression };\n\n//# sourceMappingURL=codecs.mjs.map"],"mappings":";;;;;;;;;;;;;AAcA,SAAS,UAAU,OAAO;CACzB,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC7D;;AAEA,SAAS,cAAc,QAAQ;CAC9B,OAAO,OAAO,QAAQ,KAAK,GAAG;AAC/B;;AAEA,SAAS,yBAAyB,SAAS,MAAM,QAAQ;CACxD,OAAO,OAAO,qBAAqB,mBAAmB,MAAM;EAC3D,OAAO;EACP,SAAS;CACV,CAAC,CAAC,CAAC;AACJ;;AAEA,SAAS,mBAAmB,SAAS,OAAO,QAAQ;CACnD,IAAI,OAAO,UAAU,UAAU,MAAM,wBAAwB;EAC5D;EACA,UAAU,cAAc,KAAK;EAC7B,QAAQ;CACT,CAAC;CACD,IAAI;EACH,OAAO,OAAO,K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ubAS6-siA0R8Ow.mjs";
|
|
2
|
+
import "./codecs-BMidk26M-DsKq6wt5.mjs";
|
|
3
|
+
import { CodecRegistry } from "@prisma/orm-framework/components/codec";
|
|
4
|
+
import { ComponentMetadata } from "@prisma/orm-framework/components/components";
|
|
5
|
+
import { CodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/query-lane-context";
|
|
6
|
+
//#region ../../../3-targets/mysql/1-target/dist/codecs.d.mts
|
|
7
|
+
//#region src/core/codec-registry.d.ts
|
|
8
|
+
type CodecContributor = Pick<ComponentMetadata, 'types'>;
|
|
9
|
+
type MysqlCodecRegistry = CodecRegistry & MysqlCodecDescriptorRegistry;
|
|
10
|
+
/** The codec registry of a MySQL stack: the target's built-in codecs and those its extensions contribute. */
|
|
11
|
+
declare function assembleMysqlCodecRegistry(target: CodecContributor, extensions: ReadonlyArray<CodecContributor>): MysqlCodecRegistry;
|
|
12
|
+
/** A codec registry of the MySQL built-in codecs only. */
|
|
13
|
+
declare function createMysqlBuiltinCodecLookup(): MysqlCodecRegistry;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/core/now-expression.d.ts
|
|
16
|
+
/** The name of the current instant, as a contract writes it. */
|
|
17
|
+
declare const MYSQL_INSTANT_NOW = "now()";
|
|
18
|
+
/** The name a `now()` default on a `date` column reads back as: MySQL reports `curdate()`, which writes a date, not an instant. */
|
|
19
|
+
declare const MYSQL_DATE_NOW = "CURRENT_DATE";
|
|
20
|
+
/** The name a `now()` default on a `time` column reads back as: MySQL reports `curtime(p)`, which writes a time of day. */
|
|
21
|
+
declare const MYSQL_TIME_NOW = "CURRENT_TIME";
|
|
22
|
+
type CurrentValue = typeof MYSQL_INSTANT_NOW | typeof MYSQL_DATE_NOW | typeof MYSQL_TIME_NOW;
|
|
23
|
+
/**
|
|
24
|
+
* The current value a `now()` default writes on a column of `dataTypeId`: the current date on `mysql/date`, the current time of day on `mysql/time`, and the current instant on `datetime`, `timestamp`, text, a raw column, whose values Prisma does not read, and a column of no known data type. `undefined` on a data type that stores no date or time, such as `mysql/int` or `mysql/duration`, as PostgreSQL refuses `now()` on an `integer` or an `interval` column.
|
|
25
|
+
*/
|
|
26
|
+
declare function mysqlCurrentValueFor(dataTypeId: string | undefined): CurrentValue | undefined;
|
|
27
|
+
/** The MySQL expression for a current value, with the column's fraction digits, which MySQL requires to match the column's. */
|
|
28
|
+
declare function mysqlNowExpression(current: CurrentValue, precision: number | undefined): string;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/core/registry.d.ts
|
|
31
|
+
/** Every codec descriptor `@internal/target-mysql` ships, for consumers that enumerate or look up a MySQL codec by id. ADR 208. */
|
|
32
|
+
declare const mysqlCodecRegistry: CodecDescriptorRegistry;
|
|
33
|
+
declare const mysqlCodecDescriptorRegistry: MysqlCodecDescriptorRegistry;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { assembleMysqlCodecRegistry as a, mysqlCodecRegistry as c, MysqlCodecRegistry as i, mysqlCurrentValueFor as l, MYSQL_INSTANT_NOW as n, createMysqlBuiltinCodecLookup as o, MYSQL_TIME_NOW as r, mysqlCodecDescriptorRegistry as s, MYSQL_DATE_NOW as t, mysqlNowExpression as u };
|
|
36
|
+
//# sourceMappingURL=codecs-C_twedMx.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs-C_twedMx.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/codecs.d.mts"],"mappings":";;;;;;;KAMK,mBAAmB,KAAK;KACxB,qBAAqB,gBAAgB;;iBAEzB,2BAA2B,QAAQ,kBAAkB,YAAY,cAAc,oBAAoB;;iBAEnG,iCAAiC;;;;cAIpC;;cAEA;;cAEA;KACT,sBAAsB,2BAA2B,wBAAwB;;;;iBAI7D,qBAAqB,iCAAiC;;iBAEtD,mBAAmB,SAAS,cAAc;;;;cAI7C,oBAAoB;cACpB,8BAA8B"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
//#region ../../../3-targets/mysql/2-adapter/dist/contract-contributions-
|
|
2
|
-
/** What a MySQL 8.4 server does that the SQL family asks about. `RETURNING`, `LATERAL` and conflict targets are not among them. */
|
|
1
|
+
//#region ../../../3-targets/mysql/2-adapter/dist/contract-contributions-ChiX6W0F.mjs
|
|
2
|
+
/** What a MySQL 8.4 server does that the SQL family asks about. `RETURNING`, `LATERAL` and conflict targets are not among them: `ON DUPLICATE KEY UPDATE` fires on any unique key. */
|
|
3
3
|
const mysqlAdapterCapabilities = Object.freeze({ sql: {
|
|
4
4
|
orderBy: true,
|
|
5
5
|
limit: true,
|
|
6
6
|
foreignKeys: true,
|
|
7
|
-
enums: true
|
|
7
|
+
enums: true,
|
|
8
|
+
defaultInInsert: true
|
|
8
9
|
} });
|
|
9
10
|
/** What this adapter adds to every contract it runs: its capabilities. `prisma contract emit` reads them through the adapter's descriptor, and the TypeScript `defineContract` passes them to the contract build. */
|
|
10
11
|
const mysqlAdapterContractContributions = { capabilities: mysqlAdapterCapabilities };
|
|
11
12
|
//#endregion
|
|
12
13
|
export { mysqlAdapterContractContributions as n, mysqlAdapterCapabilities as t };
|
|
13
14
|
|
|
14
|
-
//# sourceMappingURL=contract-contributions-
|
|
15
|
+
//# sourceMappingURL=contract-contributions-ChiX6W0F-CAng98bZ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-contributions-ChiX6W0F-CAng98bZ.mjs","names":[],"sources":["../../../../3-targets/mysql/2-adapter/dist/contract-contributions-ChiX6W0F.mjs"],"sourcesContent":["//#region src/core/capabilities.ts\n/** What a MySQL 8.4 server does that the SQL family asks about. `RETURNING`, `LATERAL` and conflict targets are not among them: `ON DUPLICATE KEY UPDATE` fires on any unique key. */\nconst mysqlAdapterCapabilities = Object.freeze({ sql: {\n\torderBy: true,\n\tlimit: true,\n\tforeignKeys: true,\n\tenums: true,\n\tdefaultInInsert: true\n} });\n//#endregion\n//#region src/core/contract-contributions.ts\n/** What this adapter adds to every contract it runs: its capabilities. `prisma contract emit` reads them through the adapter's descriptor, and the TypeScript `defineContract` passes them to the contract build. */\nconst mysqlAdapterContractContributions = { capabilities: mysqlAdapterCapabilities };\n//#endregion\nexport { mysqlAdapterCapabilities as n, mysqlAdapterContractContributions as t };\n\n//# sourceMappingURL=contract-contributions-ChiX6W0F.mjs.map"],"mappings":";;AAEA,MAAM,2BAA2B,OAAO,OAAO,EAAE,KAAK;CACrD,SAAS;CACT,OAAO;CACP,aAAa;CACb,OAAO;CACP,iBAAiB;AAClB,EAAE,CAAC;;AAIH,MAAM,oCAAoC,EAAE,cAAc,yBAAyB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as connectionFix, c as mysqlConnectionOptions, f as normalizeMysqlError, l as mysqlDriverDescriptorMeta, m as statementFor, n as acquireClientQueryLock, o as connectionLost, p as sessionSettingsStatement, r as applySessionSettings, s as isFatal } from "./statement-DC62oiSx-Buzptbpk.mjs";
|
|
2
2
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
3
3
|
import { errorRuntime } from "@prisma/orm-framework/errors/execution";
|
|
4
4
|
import { redactDatabaseUrl } from "@prisma/orm-framework/utils/redact-db-url";
|
|
@@ -71,4 +71,4 @@ const mysqlDriverDescriptor = {
|
|
|
71
71
|
//#endregion
|
|
72
72
|
export { mysqlDriverDescriptor as n, MysqlControlDriver as t };
|
|
73
73
|
|
|
74
|
-
//# sourceMappingURL=control-
|
|
74
|
+
//# sourceMappingURL=control-5eVF1TXc.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-
|
|
1
|
+
{"version":3,"file":"control-5eVF1TXc.mjs","names":["#lost"],"sources":["../../../../3-targets/mysql/3-driver/dist/control.mjs"],"sourcesContent":["import { c as isFatal, d as mysqlConnectionOptions, i as sessionSettingsStatement, l as normalizeMysqlError, m as acquireClientQueryLock, o as connectionFix, r as applySessionSettings, s as connectionLost, t as statementFor, u as mysqlDriverDescriptorMeta } from \"./statement-DC62oiSx.mjs\";\nimport { errorRuntime } from \"@internal/errors/execution\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { redactDatabaseUrl } from \"@internal/utils/redact-db-url\";\nimport { createConnection } from \"mariadb\";\n//#region src/core/migrations/control-driver.ts\n/**\n* A MySQL connection for the control plane. It runs every statement as the runtime driver does, a user's `rawSql` migration step included: in one round trip over the text protocol, the package writing its values into it, one at a time in the order sent, under the runtime driver's per-client lock.\n*/\nvar MysqlControlDriver = class {\n\tconnection;\n\tfamilyId = \"sql\";\n\ttargetId = \"mysql\";\n\t#lost;\n\tconstructor(connection) {\n\t\tthis.connection = connection;\n\t\tconnection.on(\"error\", (error) => {\n\t\t\tthis.#lost = error;\n\t\t});\n\t}\n\t/** Runs `sql` and returns its rows, every column as text and a binary column as bytes. */\n\tasync query(sql, params) {\n\t\tconst releaseLock = await acquireClientQueryLock(this.connection);\n\t\ttry {\n\t\t\tif (this.#lost !== void 0) throw connectionLost(this.#lost);\n\t\t\tconst statement = statementFor(this.connection, sql, params ?? []);\n\t\t\tconst result = await this.connection.query(statement.sql, statement.values);\n\t\t\treturn { rows: Array.isArray(result) ? blindCast([...result]) : [] };\n\t\t} catch (error) {\n\t\t\tif (error instanceof Error && isFatal(error)) {\n\t\t\t\tthis.#lost = error;\n\t\t\t\tthrow connectionLost(error);\n\t\t\t}\n\t\t\tthrow normalizeMysqlError(error);\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t}\n\t}\n\tasync databaseName() {\n\t\tconst { rows } = await this.query(\"SELECT DATABASE() AS name\");\n\t\tconst name = rows[0]?.name;\n\t\treturn typeof name === \"string\" && name.length > 0 ? name : void 0;\n\t}\n\tasync close() {\n\t\tawait this.connection.end().catch(() => {});\n\t}\n};\nconst mysqlDriverDescriptor = {\n\t...mysqlDriverDescriptorMeta,\n\tasync create(url, options) {\n\t\tconst connectionOptions = mysqlConnectionOptions(url, { connectTimeoutMs: options?.connectTimeoutMs });\n\t\tconst settings = sessionSettingsStatement(options?.sessionSettings ?? {});\n\t\ttry {\n\t\t\tconst connection = await createConnection(connectionOptions);\n\t\t\tif (settings !== void 0) await applySessionSettings(connection, settings).catch(async (error) => {\n\t\t\t\tawait connection.end().catch(() => {});\n\t\t\t\tthrow error;\n\t\t\t});\n\t\t\treturn new MysqlControlDriver(connection);\n\t\t} catch (error) {\n\t\t\tconst normalized = normalizeMysqlError(error);\n\t\t\tthrow errorRuntime(\"DRIVER.CONNECTION_FAILED\", \"Database connection failed\", {\n\t\t\t\twhy: normalized instanceof Error ? normalized.message : String(normalized),\n\t\t\t\tfix: connectionFix(error) ?? \"Verify the database URL, ensure the database is reachable, and confirm credentials/permissions\",\n\t\t\t\tmeta: { ...redactDatabaseUrl(url) },\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t}\n};\n//#endregion\nexport { MysqlControlDriver, mysqlDriverDescriptor as default };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;AASA,IAAI,qBAAqB,MAAM;CAC9B;CACA,WAAW;CACX,WAAW;CACX;CACA,YAAY,YAAY;EACvB,KAAK,aAAa;EAClB,WAAW,GAAG,UAAU,UAAU;GACjC,KAAKA,QAAQ;EACd,CAAC;CACF;;CAEA,MAAM,MAAM,KAAK,QAAQ;EACxB,MAAM,cAAc,MAAM,uBAAuB,KAAK,UAAU;EAChE,IAAI;GACH,IAAI,KAAKA,UAAU,KAAK,GAAG,MAAM,eAAe,KAAKA,KAAK;GAC1D,MAAM,YAAY,aAAa,KAAK,YAAY,KAAK,UAAU,CAAC,CAAC;GACjE,MAAM,SAAS,MAAM,KAAK,WAAW,MAAM,UAAU,KAAK,UAAU,MAAM;GAC1E,OAAO,EAAE,MAAM,MAAM,QAAQ,MAAM,IAAI,UAAU,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE;EACpE,SAAS,OAAO;GACf,IAAI,iBAAiB,SAAS,QAAQ,KAAK,GAAG;IAC7C,KAAKA,QAAQ;IACb,MAAM,eAAe,KAAK;GAC3B;GACA,MAAM,oBAAoB,KAAK;EAChC,UAAU;GACT,YAAY;EACb;CACD;CACA,MAAM,eAAe;EACpB,MAAM,EAAE,SAAS,MAAM,KAAK,MAAM,2BAA2B;EAC7D,MAAM,OAAO,KAAK,EAAE,EAAE;EACtB,OAAO,OAAO,SAAS,YAAY,KAAK,SAAS,IAAI,OAAO,KAAK;CAClE;CACA,MAAM,QAAQ;EACb,MAAM,KAAK,WAAW,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC;CAC3C;AACD;AACA,MAAM,wBAAwB;CAC7B,GAAG;CACH,MAAM,OAAO,KAAK,SAAS;EAC1B,MAAM,oBAAoB,uBAAuB,KAAK,EAAE,kBAAkB,SAAS,iBAAiB,CAAC;EACrG,MAAM,WAAW,yBAAyB,SAAS,mBAAmB,CAAC,CAAC;EACxE,IAAI;GACH,MAAM,aAAa,MAAM,iBAAiB,iBAAiB;GAC3D,IAAI,aAAa,KAAK,GAAG,MAAM,qBAAqB,YAAY,QAAQ,CAAC,CAAC,MAAM,OAAO,UAAU;IAChG,MAAM,WAAW,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC;IACrC,MAAM;GACP,CAAC;GACD,OAAO,IAAI,mBAAmB,UAAU;EACzC,SAAS,OAAO;GACf,MAAM,aAAa,oBAAoB,KAAK;GAC5C,MAAM,aAAa,4BAA4B,8BAA8B;IAC5E,KAAK,sBAAsB,QAAQ,WAAW,UAAU,OAAO,UAAU;IACzE,KAAK,cAAc,KAAK,KAAK;IAC7B,MAAM,EAAE,GAAG,kBAAkB,GAAG,EAAE;IAClC,OAAO;GACR,CAAC;EACF;CACD;AACD"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as quoteIdentifier, r as quoteLiteral } from "./sql-utils-
|
|
3
|
-
import {
|
|
1
|
+
import { c as mysqlQueryNotYetSupported } from "./errors-Cng94tYg-D02Eud2d.mjs";
|
|
2
|
+
import { n as quoteIdentifier, r as quoteLiteral } from "./sql-utils-Cmv_TVa8-BetrIUcj.mjs";
|
|
3
|
+
import { a as mysqlNowExpression, i as mysqlCurrentValueFor } from "./now-expression-DVD18CUc-00buJUto.mjs";
|
|
4
|
+
import { i as encodeMysqlDatetime, r as decodeMysqlDatetime, t as assembleMysqlCodecRegistry } from "./codecs-BfiB79-5.mjs";
|
|
4
5
|
import { n as LEDGER_TABLE_NAME, r as MARKER_TABLE_NAME, t as CONTROL_TABLE_NAMES } from "./control-tables-CcQ77JE7-CxTQYoQJ.mjs";
|
|
5
6
|
import { n as buildSignMarkerBootstrapQueries, t as buildControlTableBootstrapQueries } from "./contract-free-BvCdx_Ee.mjs";
|
|
6
|
-
import { n as readMysqlDefault } from "./default-normalizer-
|
|
7
|
-
import { i as withMarkerLock } from "./marker-lock-
|
|
8
|
-
import { a as readMarkerRows, i as readMarkerResult, n as mysqlAdapterDescriptorMeta, o as tableExists, r as parseJsonColumn, t as decodeMysqlMarkerRow } from "./marker-read-
|
|
7
|
+
import { n as readMysqlDefault } from "./default-normalizer-C8pc7SbL-CKgOEnGl.mjs";
|
|
8
|
+
import { i as withMarkerLock } from "./marker-lock-Bwew7cAs-CZ20Y_tA.mjs";
|
|
9
|
+
import { a as readMarkerRows, i as readMarkerResult, n as mysqlAdapterDescriptorMeta, o as tableExists, r as parseJsonColumn, t as decodeMysqlMarkerRow } from "./marker-read-Cf80LSbG-CUp3v1e5.mjs";
|
|
9
10
|
import { codecForRef } from "@prisma/orm-framework/components/codec";
|
|
10
11
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
11
12
|
import { encodeLiteralDefault, isDdlNode, renderOpaqueSql } from "@prisma/orm-family-sql/relational-core/ast";
|
|
13
|
+
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
12
14
|
import { APP_SPACE_ID } from "@prisma/orm-framework/components/control";
|
|
13
15
|
import { checkSqlDefaultText, contractColumns, readColumnDefault, sqlDefaultFunctions } from "@prisma/orm-family-sql/family/control";
|
|
14
16
|
import { RelationalSchemaNodeKind, SqlSchemaIR, SqlTableIR } from "@prisma/orm-family-sql/schema-ir/types";
|
|
15
|
-
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
16
17
|
import { REFERENTIAL_ACTION_SQL } from "@prisma/orm-family-sql/contract/referential-action-sql";
|
|
17
18
|
import { parseMarkerRowSafely, withMarkerReadErrorHandling } from "@prisma/orm-framework/errors/execution";
|
|
18
19
|
import { resolveIntrospectedColumnType } from "@prisma/orm-family-sql/family/control-adapter";
|
|
@@ -20,7 +21,7 @@ import { ledgerOriginFromStored } from "@prisma/orm-toolchain/migration-tools/le
|
|
|
20
21
|
//#region ../../../3-targets/mysql/2-adapter/dist/control.mjs
|
|
21
22
|
/** Column types MySQL gives a default only when it is written as an expression in parentheses. */
|
|
22
23
|
const EXPRESSION_DEFAULT_ONLY = /^(?:(?:tiny|medium|long)?(?:text|blob)|json|geometry)\b/i;
|
|
23
|
-
const FRACTIONAL_SECONDS = /^(?:datetime|timestamp)\((\d)\)$/i;
|
|
24
|
+
const FRACTIONAL_SECONDS = /^(?:datetime|timestamp|time)\((\d)\)$/i;
|
|
24
25
|
function refusedDefault(where, why) {
|
|
25
26
|
throw structuredError("CONTRACT.DEFAULT_INVALID", `Column "${where.table}"."${where.column}" has a default MySQL cannot store: ${why}`, { meta: {
|
|
26
27
|
table: where.table,
|
|
@@ -45,10 +46,20 @@ function mysqlInlineLiteral(wire, where) {
|
|
|
45
46
|
function withinParentheses(columnType, literal) {
|
|
46
47
|
return EXPRESSION_DEFAULT_ONLY.test(columnType.trim()) ? `(${literal})` : literal;
|
|
47
48
|
}
|
|
48
|
-
/**
|
|
49
|
-
|
|
49
|
+
/**
|
|
50
|
+
* The expression a `now()` default is written as: the current value the column's data type holds, `CURRENT_TIMESTAMP`, `CURRENT_DATE` or `CURRENT_TIME`, with the column's fractional-second precision, which MySQL requires to match. A column of a data type that holds no date or time is refused.
|
|
51
|
+
*/
|
|
52
|
+
function nowExpressionFor(columnType, codecLookup, codecRef, where) {
|
|
53
|
+
const dataType = codecRef === void 0 ? void 0 : codecLookup.descriptorFor(codecRef.codecId)?.dataType;
|
|
54
|
+
const current = mysqlCurrentValueFor(dataType);
|
|
55
|
+
if (current === void 0) throw structuredError("CONTRACT.DEFAULT_INVALID", `The column "${where.table}"."${where.column}" has a now() default, but its data type ${dataType} stores no date or time, so there is no current value to write. Remove the default, or give the field a date or time type.`, { meta: {
|
|
56
|
+
table: where.table,
|
|
57
|
+
column: where.column,
|
|
58
|
+
dataType,
|
|
59
|
+
reason: "now-default-not-date-or-time"
|
|
60
|
+
} });
|
|
50
61
|
const precision = FRACTIONAL_SECONDS.exec(columnType.trim())?.[1];
|
|
51
|
-
return precision === void 0 ?
|
|
62
|
+
return mysqlNowExpression(current, precision === void 0 ? void 0 : Number(precision));
|
|
52
63
|
}
|
|
53
64
|
/**
|
|
54
65
|
* The `DEFAULT …` clause of a column, or `''` for an `autoincrement()` default, which a column writes as `AUTO_INCREMENT` instead. A literal is read by the column's codec, and a text or blob column's literal is written as an expression, as MySQL requires.
|
|
@@ -57,7 +68,7 @@ async function renderMysqlColumnDefault(def, columnType, codecLookup, codecRef,
|
|
|
57
68
|
if (def.kind === "function") {
|
|
58
69
|
const text = def.expression.text;
|
|
59
70
|
if (text === "autoincrement()") return "";
|
|
60
|
-
if (text === "now()") return `DEFAULT (${
|
|
71
|
+
if (text === "now()") return `DEFAULT (${nowExpressionFor(columnType, codecLookup, codecRef, where)})`;
|
|
61
72
|
if (checkSqlDefaultText(text) !== void 0) throw structuredError("CONTRACT.DEFAULT_INVALID", `Unsafe default expression in contract: "${text}". Default expressions must not contain semicolons, SQL comment tokens, dollar-quoting, or subqueries.`, { meta: { expression: text } });
|
|
62
73
|
return `DEFAULT (${renderOpaqueSql(def.expression)})`;
|
|
63
74
|
}
|
|
@@ -574,4 +585,4 @@ const mysqlAdapterDescriptor = {
|
|
|
574
585
|
//#endregion
|
|
575
586
|
export { buildMysqlSchemaIR as n, mysqlAdapterDescriptor as r, MysqlControlAdapter as t };
|
|
576
587
|
|
|
577
|
-
//# sourceMappingURL=control-
|
|
588
|
+
//# sourceMappingURL=control-BBhWaGnH.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-BBhWaGnH.mjs","names":["#inTransaction"],"sources":["../../../../3-targets/mysql/2-adapter/dist/control.mjs"],"sourcesContent":["import { a as tableExists, i as readMarkerRows, n as parseJsonColumn, o as mysqlAdapterDescriptorMeta, r as readMarkerResult, t as decodeMysqlMarkerRow } from \"./marker-read-Cf80LSbG.mjs\";\nimport { checkSqlDefaultText, contractColumns, readColumnDefault, sqlDefaultFunctions } from \"@internal/family-sql/control\";\nimport { assembleMysqlCodecRegistry, decodeMysqlDatetime, encodeMysqlDatetime, mysqlCurrentValueFor, mysqlNowExpression } from \"@internal/target-mysql/codecs\";\nimport { parseMarkerRowSafely, withMarkerReadErrorHandling } from \"@internal/errors/execution\";\nimport { codecForRef } from \"@internal/framework-components/codec\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { encodeLiteralDefault, isDdlNode, renderOpaqueSql } from \"@internal/sql-relational-core/ast\";\nimport { buildControlTableBootstrapQueries, buildSignMarkerBootstrapQueries } from \"@internal/target-mysql/contract-free\";\nimport { CONTROL_TABLE_NAMES, LEDGER_TABLE_NAME, MARKER_TABLE_NAME } from \"@internal/target-mysql/control-tables\";\nimport { mysqlQueryNotYetSupported } from \"@internal/target-mysql/errors\";\nimport { withMarkerLock } from \"@internal/target-mysql/marker-lock\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { quoteIdentifier, quoteLiteral } from \"@internal/target-mysql/sql-utils\";\nimport { REFERENTIAL_ACTION_SQL } from \"@internal/sql-contract/referential-action-sql\";\nimport { resolveIntrospectedColumnType } from \"@internal/family-sql/control-adapter\";\nimport { RelationalSchemaNodeKind, SqlSchemaIR, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { readMysqlDefault } from \"@internal/target-mysql/default-normalizer\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { ledgerOriginFromStored } from \"@internal/migration-tools/ledger-origin\";\n//#region src/core/migrations/ddl-renderer.ts\n/** Column types MySQL gives a default only when it is written as an expression in parentheses. */\nconst EXPRESSION_DEFAULT_ONLY = /^(?:(?:tiny|medium|long)?(?:text|blob)|json|geometry)\\b/i;\nconst FRACTIONAL_SECONDS = /^(?:datetime|timestamp|time)\\((\\d)\\)$/i;\nfunction refusedDefault(where, why) {\n\tthrow structuredError(\"CONTRACT.DEFAULT_INVALID\", `Column \"${where.table}\".\"${where.column}\" has a default MySQL cannot store: ${why}`, { meta: {\n\t\ttable: where.table,\n\t\tcolumn: where.column\n\t} });\n}\n/** A wire value as the SQL literal MySQL reads for it. */\nfunction mysqlInlineLiteral(wire, where) {\n\tif (wire === null) return \"NULL\";\n\tif (typeof wire === \"boolean\") return wire ? \"1\" : \"0\";\n\tif (typeof wire === \"number\") {\n\t\tif (!Number.isFinite(wire)) return refusedDefault(where, `${wire} is not a finite number`);\n\t\treturn String(wire);\n\t}\n\tif (typeof wire === \"bigint\") return String(wire);\n\tif (typeof wire === \"string\") return quoteLiteral(wire);\n\tif (wire instanceof Date) return quoteLiteral(encodeMysqlDatetime(wire));\n\tif (wire instanceof Uint8Array) return `X'${Buffer.from(wire).toString(\"hex\")}'`;\n\tif (typeof wire === \"object\") return quoteLiteral(JSON.stringify(wire));\n\treturn refusedDefault(where, `a ${typeof wire} has no SQL literal`);\n}\nfunction withinParentheses(columnType, literal) {\n\treturn EXPRESSION_DEFAULT_ONLY.test(columnType.trim()) ? `(${literal})` : literal;\n}\n/**\n* The expression a `now()` default is written as: the current value the column's data type holds, `CURRENT_TIMESTAMP`, `CURRENT_DATE` or `CURRENT_TIME`, with the column's fractional-second precision, which MySQL requires to match. A column of a data type that holds no date or time is refused.\n*/\nfunction nowExpressionFor(columnType, codecLookup, codecRef, where) {\n\tconst dataType = codecRef === void 0 ? void 0 : codecLookup.descriptorFor(codecRef.codecId)?.dataType;\n\tconst current = mysqlCurrentValueFor(dataType);\n\tif (current === void 0) throw structuredError(\"CONTRACT.DEFAULT_INVALID\", `The column \"${where.table}\".\"${where.column}\" has a now() default, but its data type ${dataType} stores no date or time, so there is no current value to write. Remove the default, or give the field a date or time type.`, { meta: {\n\t\ttable: where.table,\n\t\tcolumn: where.column,\n\t\tdataType,\n\t\treason: \"now-default-not-date-or-time\"\n\t} });\n\tconst precision = FRACTIONAL_SECONDS.exec(columnType.trim())?.[1];\n\treturn mysqlNowExpression(current, precision === void 0 ? void 0 : Number(precision));\n}\n/**\n* The `DEFAULT …` clause of a column, or `''` for an `autoincrement()` default, which a column writes as `AUTO_INCREMENT` instead. A literal is read by the column's codec, and a text or blob column's literal is written as an expression, as MySQL requires.\n*/\nasync function renderMysqlColumnDefault(def, columnType, codecLookup, codecRef, where) {\n\tif (def.kind === \"function\") {\n\t\tconst text = def.expression.text;\n\t\tif (text === \"autoincrement()\") return \"\";\n\t\tif (text === \"now()\") return `DEFAULT (${nowExpressionFor(columnType, codecLookup, codecRef, where)})`;\n\t\tif (checkSqlDefaultText(text) !== void 0) throw structuredError(\"CONTRACT.DEFAULT_INVALID\", `Unsafe default expression in contract: \"${text}\". Default expressions must not contain semicolons, SQL comment tokens, dollar-quoting, or subqueries.`, { meta: { expression: text } });\n\t\treturn `DEFAULT (${renderOpaqueSql(def.expression)})`;\n\t}\n\tconst encoded = codecRef === void 0 ? void 0 : await encodeLiteralDefault(codecLookup, codecRef, def.value, where);\n\tif (encoded?.kind === \"sql-null\") return \"DEFAULT NULL\";\n\treturn `DEFAULT ${withinParentheses(columnType, mysqlInlineLiteral(encoded === void 0 ? def.value : encoded.wire, where))}`;\n}\nfunction isAutoincrement(column) {\n\treturn column.default?.kind === \"function\" && column.default.expression.text === \"autoincrement()\";\n}\nasync function renderColumn(column, codecLookup, table) {\n\tconst parts = [quoteIdentifier(column.name), column.type];\n\tif (column.notNull) parts.push(\"NOT NULL\");\n\tif (column.default !== void 0) {\n\t\tconst clause = await renderMysqlColumnDefault(column.default, column.type, codecLookup, column.codecRef, {\n\t\t\ttable,\n\t\t\tcolumn: column.name\n\t\t});\n\t\tif (clause.length > 0) parts.push(clause);\n\t}\n\tif (isAutoincrement(column)) parts.push(\"AUTO_INCREMENT\");\n\tif (column.primaryKey) parts.push(\"PRIMARY KEY\");\n\treturn parts.join(\" \");\n}\nfunction columnList(columns) {\n\treturn columns.map(quoteIdentifier).join(\", \");\n}\nfunction named(name, body) {\n\treturn name === void 0 ? body : `CONSTRAINT ${quoteIdentifier(name)} ${body}`;\n}\nfunction renderConstraint(constraint) {\n\tswitch (constraint.kind) {\n\t\tcase \"primary-key\": return named(constraint.name, `PRIMARY KEY (${columnList(constraint.columns)})`);\n\t\tcase \"unique\": return named(constraint.name, `UNIQUE (${columnList(constraint.columns)})`);\n\t\tcase \"foreign-key\": {\n\t\t\tconst actions = [constraint.onDelete === void 0 ? void 0 : `ON DELETE ${REFERENTIAL_ACTION_SQL[constraint.onDelete]}`, constraint.onUpdate === void 0 ? void 0 : `ON UPDATE ${REFERENTIAL_ACTION_SQL[constraint.onUpdate]}`].filter((action) => action !== void 0);\n\t\t\treturn named(constraint.name, [`FOREIGN KEY (${columnList(constraint.columns)}) REFERENCES ${quoteIdentifier(constraint.refTable)} (${columnList(constraint.refColumns)})`, ...actions].join(\" \"));\n\t\t}\n\t\tcase \"check-expression\": throw structuredError(\"CONTRACT.CONSTRAINT_INVALID\", `The MySQL target does not write CHECK constraints yet (constraint \"${constraint.name}\").`, { meta: { constraintName: constraint.name } });\n\t}\n}\n/** The `CREATE TABLE` statement of a MySQL DDL node. */\nasync function renderMysqlCreateTable(node, codecLookup) {\n\tconst definitions = [...await Promise.all(node.columns.map((column) => renderColumn(column, codecLookup, node.table))), ...(node.constraints ?? []).map(renderConstraint)];\n\treturn {\n\t\tsql: `CREATE TABLE ${node.ifNotExists === true ? \"IF NOT EXISTS \" : \"\"}${quoteIdentifier(node.table)} (\\n ${definitions.join(\",\\n \")}\\n)`,\n\t\tparams: []\n\t};\n}\n//#endregion\n//#region src/core/migrations/declared-indexes.ts\nfunction isLoose(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\nfunction child(value, key) {\n\tconst found = isLoose(value) ? value[key] : void 0;\n\treturn isLoose(found) ? found : void 0;\n}\nfunction tableIndexKey(tableName, indexName) {\n\treturn JSON.stringify([tableName, indexName]);\n}\n/** The indexes the contract handed to introspection declares, read from every contract space it holds. */\nfunction declaredIndexes(contract) {\n\tconst contracts = isLoose(contract) && Array.isArray(contract[\"contracts\"]) ? contract[\"contracts\"] : [contract];\n\tconst declared = /* @__PURE__ */ new Set();\n\tconst declaredUnique = /* @__PURE__ */ new Set();\n\tfor (const space of contracts) for (const namespace of Object.values(child(child(space, \"storage\"), \"namespaces\") ?? {})) for (const [tableName, table] of Object.entries(child(child(namespace, \"entries\"), \"table\") ?? {})) {\n\t\tconst indexes = isLoose(table) ? table[\"indexes\"] : void 0;\n\t\tfor (const index of Array.isArray(indexes) ? indexes : []) {\n\t\t\tif (!isLoose(index) || typeof index[\"name\"] !== \"string\") continue;\n\t\t\tconst key = tableIndexKey(tableName, index[\"name\"]);\n\t\t\tdeclared.add(key);\n\t\t\tif (index[\"unique\"] === true) declaredUnique.add(key);\n\t\t}\n\t}\n\treturn {\n\t\tdeclaresIndex: (tableName, indexName) => declared.has(tableIndexKey(tableName, indexName)),\n\t\tdeclaresUniqueIndex: (tableName, indexName) => declaredUnique.has(tableIndexKey(tableName, indexName))\n\t};\n}\n//#endregion\n//#region src/core/migrations/introspection.ts\nconst NOTHING_DECLARED = {\n\tdeclaresIndex: () => false,\n\tdeclaresUniqueIndex: () => false\n};\nconst PRIMARY_INDEX = \"PRIMARY\";\nconst REFERENTIAL_ACTIONS = {\n\tRESTRICT: \"restrict\",\n\tCASCADE: \"cascade\",\n\t\"SET NULL\": \"setNull\",\n\t\"SET DEFAULT\": \"setDefault\"\n};\n/** A rule `REFERENTIAL_CONSTRAINTS` reports, with `NO ACTION`, MySQL's default, as no action at all. */\nfunction referentialAction(rule) {\n\tconst normalized = rule.toUpperCase();\n\tif (normalized === \"NO ACTION\") return void 0;\n\tconst action = REFERENTIAL_ACTIONS[normalized];\n\tif (action === void 0) throw structuredError(\"CONTRACT.INTROSPECTION_UNSUPPORTED\", `Unknown MySQL referential action rule: \"${rule}\". Expected one of: NO ACTION, RESTRICT, CASCADE, SET NULL, SET DEFAULT.`, { meta: { rule } });\n\treturn action;\n}\nfunction tableDependsOn(tableName) {\n\treturn [{\n\t\tnodeKind: RelationalSchemaNodeKind.schema,\n\t\tid: \"database\"\n\t}, {\n\t\tnodeKind: RelationalSchemaNodeKind.table,\n\t\tid: tableName\n\t}];\n}\nfunction columnDependsOn(tableName, columns) {\n\treturn columns.map((column) => [...tableDependsOn(tableName), {\n\t\tnodeKind: RelationalSchemaNodeKind.column,\n\t\tid: `column:${column}`\n\t}]);\n}\nfunction groupBy(rows, key) {\n\tconst groups = /* @__PURE__ */ new Map();\n\tfor (const row of rows) {\n\t\tconst group = groups.get(key(row));\n\t\tif (group === void 0) groups.set(key(row), [row]);\n\t\telse group.push(row);\n\t}\n\treturn groups;\n}\nfunction byPosition(position) {\n\treturn (a, b) => Number(position(a)) - Number(position(b));\n}\nasync function columnOf(row, dataTypes, readLiteralDefault) {\n\tconst reported = readMysqlDefault(row.column_default, row.extra);\n\tconst readDefault = reported === void 0 ? {} : reported.kind === \"function\" ? { resolvedDefault: reported } : await readLiteralDefault(row.table_name, row.column_name, reported.literal.body);\n\tconst reportedType = {\n\t\ttext: row.column_type,\n\t\tkind: void 0,\n\t\tschema: void 0,\n\t\tname: void 0\n\t};\n\treturn {\n\t\tname: row.column_name,\n\t\ttypeText: row.column_type,\n\t\tnullable: row.is_nullable === \"YES\",\n\t\t...ifDefined(\"default\", row.column_default ?? void 0),\n\t\t...readDefault,\n\t\treportedType,\n\t\t...resolveIntrospectedColumnType(reportedType, dataTypes)\n\t};\n}\nfunction indexesOf(rows) {\n\treturn [...groupBy(rows, (row) => row.index_name).entries()].map(([name, parts]) => {\n\t\tconst ordered = [...parts].sort(byPosition((part) => part.seq_in_index));\n\t\tconst expressions = ordered.flatMap((part) => part.expression === null ? [] : [part.expression]);\n\t\treturn {\n\t\t\tname,\n\t\t\tunique: ordered[0]?.non_unique === \"0\",\n\t\t\tcolumns: ordered.flatMap((part) => part.column_name === null ? [] : [part.column_name]),\n\t\t\texpression: expressions.length === 0 ? void 0 : expressions.join(\", \")\n\t\t};\n\t});\n}\nfunction sameColumns(a, b) {\n\treturn a.length === b.length && a.every((column, index) => column === b[index]);\n}\nfunction foreignKeysOf(tableName, rows) {\n\treturn [...groupBy(rows, (row) => row.constraint_name).entries()].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([name, parts]) => {\n\t\tconst ordered = [...parts].sort(byPosition((part) => part.ordinal_position));\n\t\tconst [first] = ordered;\n\t\tconst columns = ordered.map((part) => part.column_name);\n\t\tconst referencedTable = first?.referenced_table_name ?? \"\";\n\t\tconst referencedSchema = first?.referenced_table_schema ?? void 0;\n\t\treturn {\n\t\t\tcolumns,\n\t\t\treferencedTable,\n\t\t\treferencedColumns: ordered.map((part) => part.referenced_column_name),\n\t\t\t...ifDefined(\"referencedSchema\", referencedSchema),\n\t\t\tname,\n\t\t\t...ifDefined(\"onDelete\", first === void 0 ? void 0 : referentialAction(first.delete_rule)),\n\t\t\t...ifDefined(\"onUpdate\", first === void 0 ? void 0 : referentialAction(first.update_rule)),\n\t\t\tdependsOn: [...referencedSchema === void 0 ? [tableDependsOn(referencedTable)] : [], ...columnDependsOn(tableName, columns)]\n\t\t};\n\t});\n}\n/**\n* The index InnoDB creates for a foreign key that no index already serves: it carries the key's name and exactly the key's columns. Introspection leaves it out, because the contract describes the key, not that index. An explicit index can look the same, so one the contract declares is kept.\n*/\nfunction isForeignKeyIndex(tableName, index, foreignKeys, declared) {\n\tif (declared.declaresIndex(tableName, index.name)) return false;\n\treturn foreignKeys.some((fk) => fk.name === index.name && index.expression === void 0 && sameColumns(fk.columns, index.columns));\n}\nasync function tableOf(tableName, rows, dataTypes, readLiteralDefault, declared) {\n\tconst columns = {};\n\tfor (const row of [...rows.columns].sort(byPosition((column) => column.ordinal_position))) columns[row.column_name] = await columnOf(row, dataTypes, readLiteralDefault);\n\tconst foreignKeys = foreignKeysOf(tableName, rows.foreignKeys);\n\tconst indexes = indexesOf(rows.indexes);\n\tconst expressionIndexNames = new Set(indexes.filter((index) => index.expression !== void 0).map((index) => index.name));\n\tconst uniqueConstraintNames = new Set(rows.constraints.filter((constraint) => constraint.constraint_type === \"UNIQUE\" && !expressionIndexNames.has(constraint.constraint_name) && !declared.declaresUniqueIndex(tableName, constraint.constraint_name)).map((constraint) => constraint.constraint_name));\n\tconst primary = indexes.find((index) => index.name === PRIMARY_INDEX);\n\tconst primaryKey = primary === void 0 ? void 0 : {\n\t\tcolumns: primary.columns,\n\t\tdependsOn: columnDependsOn(tableName, primary.columns)\n\t};\n\tconst uniques = indexes.filter((index) => uniqueConstraintNames.has(index.name)).map((index) => ({\n\t\tcolumns: index.columns,\n\t\tname: index.name,\n\t\tdependsOn: columnDependsOn(tableName, index.columns)\n\t}));\n\tconst plainIndexes = indexes.filter((index) => index.name !== PRIMARY_INDEX && !uniqueConstraintNames.has(index.name) && !isForeignKeyIndex(tableName, index, foreignKeys, declared)).map((index) => {\n\t\tconst base = {\n\t\t\tnaming: {\n\t\t\t\tkind: \"exact\",\n\t\t\t\tname: index.name\n\t\t\t},\n\t\t\twhere: void 0,\n\t\t\tunique: index.unique,\n\t\t\tpartial: false,\n\t\t\ttype: void 0,\n\t\t\toptions: void 0,\n\t\t\tannotations: void 0,\n\t\t\tdependsOn: columnDependsOn(tableName, index.columns)\n\t\t};\n\t\treturn index.expression === void 0 ? {\n\t\t\t...base,\n\t\t\tcolumns: index.columns\n\t\t} : {\n\t\t\t...base,\n\t\t\texpression: index.expression\n\t\t};\n\t});\n\treturn new SqlTableIR({\n\t\tname: tableName,\n\t\tcolumns,\n\t\t...ifDefined(\"primaryKey\", primaryKey),\n\t\tforeignKeys,\n\t\tuniques,\n\t\tindexes: plainIndexes\n\t});\n}\n/**\n* The schema IR of the database the rows describe: one flat tree of its tables. MySQL lists every unique index as a UNIQUE constraint, so one is reported as a unique constraint unless the contract declares a unique index of that name on the table, or it indexes an expression. The index InnoDB creates for a foreign key is left out, unless the contract declares an index of that name on the table.\n*/\nasync function buildMysqlSchemaIR(rows, dataTypes, readLiteralDefault, declared = NOTHING_DECLARED) {\n\tconst columnsByTable = groupBy(rows.columns, (row) => row.table_name);\n\tconst indexesByTable = groupBy(rows.indexes, (row) => row.table_name);\n\tconst constraintsByTable = groupBy(rows.constraints, (row) => row.table_name);\n\tconst foreignKeysByTable = groupBy(rows.foreignKeys, (row) => row.table_name);\n\tconst tables = {};\n\tfor (const tableName of rows.tables) tables[tableName] = await tableOf(tableName, {\n\t\tcolumns: columnsByTable.get(tableName) ?? [],\n\t\tindexes: indexesByTable.get(tableName) ?? [],\n\t\tconstraints: constraintsByTable.get(tableName) ?? [],\n\t\tforeignKeys: foreignKeysByTable.get(tableName) ?? []\n\t}, dataTypes, readLiteralDefault, declared);\n\treturn new SqlSchemaIR({ tables });\n}\n//#endregion\n//#region src/core/migrations/introspection-queries.ts\nconst TABLES = `SELECT TABLE_NAME AS table_name\n FROM information_schema.TABLES\n WHERE TABLE_SCHEMA = DATABASE() AND TABLE_TYPE = 'BASE TABLE'\n ORDER BY TABLE_NAME`;\nconst COLUMNS = `SELECT TABLE_NAME AS table_name, COLUMN_NAME AS column_name,\n ORDINAL_POSITION AS ordinal_position, COLUMN_DEFAULT AS column_default,\n IS_NULLABLE AS is_nullable, COLUMN_TYPE AS column_type, EXTRA AS extra\n FROM information_schema.COLUMNS\n WHERE TABLE_SCHEMA = DATABASE()\n ORDER BY TABLE_NAME, ORDINAL_POSITION`;\nconst INDEXES = `SELECT TABLE_NAME AS table_name, INDEX_NAME AS index_name,\n NON_UNIQUE AS non_unique, SEQ_IN_INDEX AS seq_in_index,\n COLUMN_NAME AS column_name, EXPRESSION AS expression\n FROM information_schema.STATISTICS\n WHERE TABLE_SCHEMA = DATABASE()\n ORDER BY TABLE_NAME, INDEX_NAME, SEQ_IN_INDEX`;\nconst CONSTRAINTS = `SELECT TABLE_NAME AS table_name, CONSTRAINT_NAME AS constraint_name,\n CONSTRAINT_TYPE AS constraint_type\n FROM information_schema.TABLE_CONSTRAINTS\n WHERE TABLE_SCHEMA = DATABASE()`;\nconst FOREIGN_KEYS = `SELECT k.TABLE_NAME AS table_name, k.CONSTRAINT_NAME AS constraint_name,\n k.COLUMN_NAME AS column_name, k.ORDINAL_POSITION AS ordinal_position,\n NULLIF(k.REFERENCED_TABLE_SCHEMA, k.TABLE_SCHEMA) AS referenced_table_schema,\n k.REFERENCED_TABLE_NAME AS referenced_table_name,\n k.REFERENCED_COLUMN_NAME AS referenced_column_name,\n r.UPDATE_RULE AS update_rule, r.DELETE_RULE AS delete_rule\n FROM information_schema.KEY_COLUMN_USAGE k\n JOIN information_schema.REFERENTIAL_CONSTRAINTS r\n ON r.CONSTRAINT_SCHEMA = k.CONSTRAINT_SCHEMA\n AND r.TABLE_NAME = k.TABLE_NAME\n AND r.CONSTRAINT_NAME = k.CONSTRAINT_NAME\n WHERE k.TABLE_SCHEMA = DATABASE() AND k.REFERENCED_TABLE_NAME IS NOT NULL\n ORDER BY k.TABLE_NAME, k.CONSTRAINT_NAME, k.ORDINAL_POSITION`;\n/** Reads the catalog rows of the connection's database, leaving out the runner's control tables. */\nasync function readMysqlCatalog(driver) {\n\tconst keep = (rows) => rows.filter((row) => !CONTROL_TABLE_NAMES.has(row.table_name));\n\tconst tables = await driver.query(TABLES);\n\tconst columns = await driver.query(COLUMNS);\n\tconst indexes = await driver.query(INDEXES);\n\tconst constraints = await driver.query(CONSTRAINTS);\n\tconst foreignKeys = await driver.query(FOREIGN_KEYS);\n\treturn {\n\t\ttables: keep(tables.rows).map((row) => row.table_name),\n\t\tcolumns: keep(columns.rows),\n\t\tindexes: keep(indexes.rows),\n\t\tconstraints: keep(constraints.rows),\n\t\tforeignKeys: keep(foreignKeys.rows)\n\t};\n}\n//#endregion\n//#region src/core/migrations/marker-ledger.ts\nconst LEDGER_COLUMNS = \"space, migration_name, migration_hash, origin_core_hash, destination_core_hash, operations, created_at\";\nfunction operationCount(operations) {\n\tconst parsed = typeof operations === \"string\" ? parseOperations(operations) : operations;\n\treturn Array.isArray(parsed) ? parsed.length : 0;\n}\nfunction parseOperations(text) {\n\ttry {\n\t\treturn JSON.parse(text);\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction text(row, column) {\n\tconst value = row[column];\n\treturn typeof value === \"string\" ? value : String(value);\n}\n/** The ledger's entries for `space`, or for every space, in the order they were applied. */\nasync function readLedgerEntries(driver, space) {\n\tif (!await tableExists(driver, LEDGER_TABLE_NAME)) return [];\n\tconst select = `SELECT ${LEDGER_COLUMNS} FROM ${quoteIdentifier(LEDGER_TABLE_NAME)}`;\n\tconst { rows } = space === void 0 ? await driver.query(`${select} ORDER BY id`) : await driver.query(`${select} WHERE space = ? ORDER BY id`, [space]);\n\treturn rows.map((row) => {\n\t\tconst origin = row[\"origin_core_hash\"];\n\t\treturn {\n\t\t\tspace: text(row, \"space\"),\n\t\t\tmigrationName: text(row, \"migration_name\"),\n\t\t\tmigrationHash: text(row, \"migration_hash\"),\n\t\t\tfrom: ledgerOriginFromStored(typeof origin === \"string\" ? origin : null),\n\t\t\tto: text(row, \"destination_core_hash\"),\n\t\t\tappliedAt: decodeMysqlDatetime(text(row, \"created_at\")),\n\t\t\toperationCount: operationCount(row[\"operations\"])\n\t\t};\n\t});\n}\nconst MARKER_INSERT = `INSERT INTO ${quoteIdentifier(MARKER_TABLE_NAME)} (space, core_hash, profile_hash, contract_json, canonical_version, updated_at, app_tag, meta, invariants) VALUES (?, ?, ?, NULL, NULL, CURRENT_TIMESTAMP(3), NULL, '{}', ?)`;\nfunction markerInsertParams(space, destination) {\n\treturn [\n\t\tspace,\n\t\tdestination.storageHash,\n\t\tdestination.profileHash,\n\t\tJSON.stringify(destination.invariants ?? [])\n\t];\n}\n/** Inserts the marker row of `space`; fails when the space already has one. */\nasync function insertMarkerRow(driver, space, destination) {\n\tawait driver.query(MARKER_INSERT, markerInsertParams(space, destination));\n}\n/** Writes the marker row of `space`, replacing the row the space already has. */\nasync function upsertMarkerRow(driver, space, destination) {\n\tawait driver.query(`${MARKER_INSERT} AS incoming ON DUPLICATE KEY UPDATE core_hash = incoming.core_hash, profile_hash = incoming.profile_hash, contract_json = incoming.contract_json, canonical_version = incoming.canonical_version, updated_at = CURRENT_TIMESTAMP(3), app_tag = incoming.app_tag, meta = incoming.meta, invariants = incoming.invariants`, markerInsertParams(space, destination));\n}\nfunction invariantsOf(text) {\n\tconst parsed = parseJsonColumn(\"invariants\", text);\n\treturn Array.isArray(parsed) ? parsed.filter((item) => typeof item === \"string\") : [];\n}\n/**\n* Advances the marker row of `space` from `expectedFrom` to `destination`, and says whether it did. MySQL has no `RETURNING`, so the row is read and locked with `FOR UPDATE` first, inside the transaction the caller holds, and written only when it still holds `expectedFrom`. Supplied invariants are merged with the stored ones.\n*/\nasync function compareAndSwapMarkerRow(driver, space, expectedFrom, destination) {\n\tconst { rows } = await driver.query(`SELECT core_hash, invariants FROM ${quoteIdentifier(MARKER_TABLE_NAME)} WHERE space = ? FOR UPDATE`, [space]);\n\tconst [row] = rows;\n\tif (row === void 0 || row[\"core_hash\"] !== expectedFrom) return false;\n\tconst invariants = destination.invariants === void 0 ? void 0 : [.../* @__PURE__ */ new Set([...invariantsOf(row[\"invariants\"]), ...destination.invariants])].sort();\n\tawait driver.query(`UPDATE ${quoteIdentifier(MARKER_TABLE_NAME)} SET core_hash = ?, profile_hash = ?, updated_at = CURRENT_TIMESTAMP(3)${invariants === void 0 ? \"\" : \", invariants = ?\"} WHERE space = ? AND core_hash = ?`, [\n\t\tdestination.storageHash,\n\t\tdestination.profileHash,\n\t\t...invariants === void 0 ? [] : [JSON.stringify(invariants)],\n\t\tspace,\n\t\texpectedFrom\n\t]);\n\treturn true;\n}\n/** Appends a ledger entry for `space`. */\nasync function insertLedgerRow(driver, space, entry) {\n\tawait driver.query(`INSERT INTO ${quoteIdentifier(LEDGER_TABLE_NAME)} (space, migration_name, migration_hash, origin_core_hash, destination_core_hash, operations) VALUES (?, ?, ?, ?, ?, ?)`, [\n\t\tspace,\n\t\tentry.migrationName,\n\t\tentry.migrationHash,\n\t\tentry.from,\n\t\tentry.to,\n\t\tJSON.stringify(entry.operations)\n\t]);\n}\n//#endregion\n//#region src/core/migrations/control-adapter.ts\n/** A DDL node MySQL does not build, such as one another target's visitor accepts. */\nfunction unsupportedDdl(ast) {\n\treturn structuredError(\"RUNTIME.DDL_UNSUPPORTED\", `The MySQL control adapter cannot lower the DDL node \"${ast.kind}\".`, { meta: {\n\t\tsurface: \"control-adapter\",\n\t\tkind: ast.kind\n\t} });\n}\n/**\n* The MySQL control adapter. It introspects the connection's database from `information_schema`, creates, reads and writes the marker and ledger tables, takes the marker lock, and runs work in a transaction. Query lowering refuses with `RUNTIME.AST_UNSUPPORTED`.\n*/\nvar MysqlControlAdapter = class {\n\tcodecRegistry;\n\tdeclaredDataTypes;\n\tfamilyId = \"sql\";\n\ttargetId = \"mysql\";\n\tmarkerLocation = MARKER_TABLE_NAME;\n\t/** `declaredDataTypes` are the stack's data types, which introspection resolves each column's reported type over. */\n\tconstructor(codecRegistry, declaredDataTypes) {\n\t\tthis.codecRegistry = codecRegistry;\n\t\tthis.declaredDataTypes = declaredDataTypes;\n\t}\n\tbootstrapControlTableQueries() {\n\t\treturn buildControlTableBootstrapQueries();\n\t}\n\tbootstrapSignMarkerQueries() {\n\t\treturn buildSignMarkerBootstrapQueries();\n\t}\n\tlower(ast) {\n\t\tif (isDdlNode(ast)) throw structuredError(\"RUNTIME.DDL_UNSUPPORTED\", \"lower() cannot lower DDL: DDL default literals require inline codec encoding, which is async. Use lowerToExecuteRequest().\", { meta: { surface: \"control-adapter\" } });\n\t\tthrow mysqlQueryNotYetSupported(\"Lowering queries\");\n\t}\n\tasync lowerToExecuteRequest(ast) {\n\t\tif (!isDdlNode(ast)) throw mysqlQueryNotYetSupported(\"Lowering queries\");\n\t\tif (typeof ast.accept !== \"function\") throw unsupportedDdl(ast);\n\t\treturn ast.accept(new Proxy({ createTable: (node) => renderMysqlCreateTable(node, this.codecRegistry) }, { get: (target, method) => Reflect.get(target, method) ?? (() => Promise.reject(unsupportedDdl(ast))) }));\n\t}\n\tasync renderColumnDefault(column, table) {\n\t\tif (column.default === void 0) return \"\";\n\t\treturn renderMysqlColumnDefault(column.default, column.type, this.codecRegistry, column.codecRef, {\n\t\t\ttable,\n\t\t\tcolumn: column.name\n\t\t});\n\t}\n\tasync readMarker(driver, space) {\n\t\tconst result = await readMarkerResult(driver, space);\n\t\treturn result.kind === \"present\" ? result.record : null;\n\t}\n\tasync readAllMarkers(driver) {\n\t\treturn withMarkerReadErrorHandling(async () => {\n\t\t\tconst markers = /* @__PURE__ */ new Map();\n\t\t\tfor (const row of await readMarkerRows(driver, void 0) ?? []) {\n\t\t\t\tconst space = String(row[\"space\"]);\n\t\t\t\tmarkers.set(space, parseMarkerRowSafely(row, () => decodeMysqlMarkerRow(row), {\n\t\t\t\t\tspace,\n\t\t\t\t\tmarkerLocation: MARKER_TABLE_NAME\n\t\t\t\t}));\n\t\t\t}\n\t\t\treturn markers;\n\t\t}, {\n\t\t\tspace: APP_SPACE_ID,\n\t\t\tmarkerLocation: MARKER_TABLE_NAME\n\t\t});\n\t}\n\tasync readLedger(driver, space) {\n\t\treturn withMarkerReadErrorHandling(() => readLedgerEntries(driver, space), {\n\t\t\tspace: space ?? \"*\",\n\t\t\tmarkerLocation: LEDGER_TABLE_NAME\n\t\t});\n\t}\n\tasync insertMarker(driver, space, destination) {\n\t\tawait insertMarkerRow(driver, space, destination);\n\t}\n\tasync initMarker(driver, space, destination) {\n\t\tawait upsertMarkerRow(driver, space, destination);\n\t}\n\tasync updateMarker(driver, space, expectedFrom, destination) {\n\t\treturn compareAndSwapMarkerRow(driver, space, expectedFrom, destination);\n\t}\n\tasync writeLedgerEntry(driver, space, entry) {\n\t\tawait insertLedgerRow(driver, space, entry);\n\t}\n\t/** Takes no lock: MySQL's `GET_LOCK` lives for the session, not the transaction, so {@link holdMarkerLock} takes it around the transaction instead. */\n\tasync lockMarker(_driver) {}\n\t/** Takes `GET_LOCK` before `work` runs and releases it when `work` ends, so `db sign` creates the marker table, whose DDL would end a transaction, under the lock. */\n\tasync holdMarkerLock(driver, work) {\n\t\treturn withMarkerLock(driver, work);\n\t}\n\tasync withTransaction(driver, fn) {\n\t\treturn this.#inTransaction(driver, fn);\n\t}\n\tasync #inTransaction(driver, fn) {\n\t\tawait driver.query(\"START TRANSACTION\");\n\t\tlet result;\n\t\ttry {\n\t\t\tresult = await fn();\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\tawait driver.query(\"ROLLBACK\");\n\t\t\t} catch (rollbackError) {\n\t\t\t\tif (error instanceof Error && error.cause === void 0) error.cause = rollbackError;\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t\tawait driver.query(\"COMMIT\");\n\t\treturn result;\n\t}\n\tasync introspect(driver, contract) {\n\t\tconst columns = contractColumns(contract);\n\t\treturn buildMysqlSchemaIR(await readMysqlCatalog(driver), this.declaredDataTypes, async (tableName, columnName, rawDefault) => {\n\t\t\tconst column = columns.columnOf(void 0, tableName, columnName);\n\t\t\tconst codec = column === void 0 ? void 0 : codecForRef(this.codecRegistry, column.codecRef);\n\t\t\tif (codec === void 0) return {};\n\t\t\treturn readColumnDefault(codec, {\n\t\t\t\tliteral: {\n\t\t\t\t\tkind: \"value\",\n\t\t\t\t\tbody: rawDefault\n\t\t\t\t},\n\t\t\t\traw: rawDefault\n\t\t\t}, void 0);\n\t\t}, declaredIndexes(contract));\n\t}\n};\n//#endregion\n//#region src/exports/control.ts\nconst mysqlAdapterDescriptor = {\n\t...mysqlAdapterDescriptorMeta,\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: new Map(Object.entries(sqlDefaultFunctions())),\n\t\tgeneratorDescriptors: []\n\t},\n\tcreate(stack) {\n\t\treturn new MysqlControlAdapter(assembleMysqlCodecRegistry(stack.target, stack.extensions), stack.declaredDataTypes.map(({ type }) => type));\n\t}\n};\n//#endregion\nexport { MysqlControlAdapter, buildMysqlSchemaIR, mysqlAdapterDescriptor as default };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,0BAA0B;AAChC,MAAM,qBAAqB;AAC3B,SAAS,eAAe,OAAO,KAAK;CACnC,MAAM,gBAAgB,4BAA4B,WAAW,MAAM,MAAM,KAAK,MAAM,OAAO,sCAAsC,OAAO,EAAE,MAAM;EAC/I,OAAO,MAAM;EACb,QAAQ,MAAM;CACf,EAAE,CAAC;AACJ;;AAEA,SAAS,mBAAmB,MAAM,OAAO;CACxC,IAAI,SAAS,MAAM,OAAO;CAC1B,IAAI,OAAO,SAAS,WAAW,OAAO,OAAO,MAAM;CACnD,IAAI,OAAO,SAAS,UAAU;EAC7B,IAAI,CAAC,OAAO,SAAS,IAAI,GAAG,OAAO,eAAe,OAAO,GAAG,KAAK,wBAAwB;EACzF,OAAO,OAAO,IAAI;CACnB;CACA,IAAI,OAAO,SAAS,UAAU,OAAO,OAAO,IAAI;CAChD,IAAI,OAAO,SAAS,UAAU,OAAO,aAAa,IAAI;CACtD,IAAI,gBAAgB,MAAM,OAAO,aAAa,oBAAoB,IAAI,CAAC;CACvE,IAAI,gBAAgB,YAAY,OAAO,KAAK,OAAO,KAAK,IAAI,CAAC,CAAC,SAAS,KAAK,EAAE;CAC9E,IAAI,OAAO,SAAS,UAAU,OAAO,aAAa,KAAK,UAAU,IAAI,CAAC;CACtE,OAAO,eAAe,OAAO,KAAK,OAAO,KAAK,oBAAoB;AACnE;AACA,SAAS,kBAAkB,YAAY,SAAS;CAC/C,OAAO,wBAAwB,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