@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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codecs-C00kjHgh.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/codecs.mjs"],"sourcesContent":["import { i as mysqlCodec, n as buildMysqlCodecDescriptorRegistry, t as MysqlCodecDescriptor } from \"./codec-descriptor-Du6DSz-3.mjs\";\nimport { a as MYSQL_TEXT_CODEC_ID, i as MYSQL_INT_CODEC_ID, n as MYSQL_DATETIME_CODEC_ID, r as MYSQL_ENUM_CODEC_ID, t as MYSQL_BIGINT_CODEC_ID } from \"./codec-ids-cjxtOcLM.mjs\";\nimport { n as mysqlQueryNotYetSupported, t as mysqlError } from \"./errors-rvH_F2Yj.mjs\";\nimport { a as mysqlDatetime, c as mysqlEnum, d as mysqlText, l as mysqlEnumParams, n as mysqlChar, o as mysqlDatetimeParams, p as mysqlVarchar, t as mysqlBigint, u as mysqlInt } from \"./data-types-Dv9gwVRV.mjs\";\nimport { CodecImpl, 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 { extractCodecLookup } from \"@internal/framework-components/control\";\nimport { buildCodecDescriptorRegistry } from \"@internal/sql-relational-core/codec-descriptor-registry\";\n//#region src/core/codecs.ts\nconst DECIMAL_INTEGER = /^-?\\d+$/;\nconst BIGINT_MIN = -(2n ** 63n);\nconst BIGINT_MAX = 2n ** 63n - 1n;\n/** Projects a column whose JSON form, a number or a string, is what its `fromWire` reads. */\nconst identityJsonProjection = (expression) => expression;\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();\nconst WIRE_DATETIME = /^(\\d{4}-\\d{2}-\\d{2})[ T](\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?)$/;\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\tconst match = WIRE_DATETIME.exec(wire);\n\tconst date = match === null ? void 0 : /* @__PURE__ */ new Date(`${match[1]}T${match[2]}Z`);\n\tif (date === void 0 || Number.isNaN(date.getTime())) return decodeFailed(MYSQL_DATETIME_CODEC_ID, \"a date and time as MySQL prints it\", wire);\n\treturn date;\n}\n/** The text MySQL reads for an instant in UTC, with millisecond digits. */\nfunction encodeMysqlDatetime(value) {\n\tif (Number.isNaN(value.getTime())) return encodeFailed(MYSQL_DATETIME_CODEC_ID, \"a valid Date\", value);\n\treturn value.toISOString().replace(\"T\", \" \").replace(\"Z\", \"\");\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 encodeMysqlDatetime(value);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn decodeMysqlDatetime(wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\tif (/[1-9]/.test(/\\.(\\d+)/.exec(value.value)?.[1]?.slice(3) ?? \"\")) 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(`${value.value}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\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 { assembleMysqlCodecRegistry, createMysqlBuiltinCodecLookup, decodeMysqlDatetime, encodeMysqlDatetime, mysqlCodecDescriptorRegistry, mysqlCodecRegistry };\n\n//# sourceMappingURL=codecs.mjs.map"],"mappings":";;;;;;;;;;AAUA,MAAM,kBAAkB;AACxB,MAAM,aAAa,EAAE,MAAM;AAC3B,MAAM,aAAa,MAAM,MAAM;;AAE/B,MAAM,0BAA0B,eAAe;;AAE/C,MAAM,sBAAsB,eAAe,SAAS,GAAG,YAAY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YAAY,OAAO,YAAY,oBAAoB,CAAC,CAAC;AACnG;AACA,SAAS,wBAAwB,aAAa;CAC7C,MAAM,qBAAqB,kCAAkC,WAAW;CACxE,MAAM,WAAW;EAChB,GAAG,mBAAmB,CAAC;GACtB,IAAI;GACJ,OAAO,EAAE,YAAY,EAAE,kBAAkB,MAAM,KAAK,mBAAmB,OAAO,CAAC,EAAE,EAAE;EACpF,CAAC,CAAC;EACF,gBAAgB,YAAY,mBAAmB,cAAc,OAAO;EACpE,cAAc,mBAAmB,OAAO;CACzC;CACA,OAAO,OAAO,OAAO,QAAQ;AAC9B;;AAEA,SAAS,2BAA2B,QAAQ,YAAY;CACvD,OAAO,wBAAwB;EAC9B,GAAG,gBAAgB,CAAC,MAAM,CAAC;EAC3B,GAAG,6BAA6B,OAAO;EACvC,GAAG,gBAAgB,UAAU;CAC9B,CAAC;AACF;;AAEA,SAAS,gCAAgC;CACxC,OAAO,wBAAwB,CAAC,GAAG,6BAA6B,OAAO,CAAC,CAAC;AAC1E"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { r as MysqlCodecDescriptor } from "./codec-descriptor-DXyubAS6-siA0R8Ow.mjs";
|
|
2
|
-
import { a as MYSQL_TEXT_CODEC_ID, i as MYSQL_INT_CODEC_ID, n as MYSQL_DATETIME_CODEC_ID, r as MYSQL_ENUM_CODEC_ID, t as MYSQL_BIGINT_CODEC_ID } from "./codec-ids-sMOU8F-B-BQbCq2dr.mjs";
|
|
3
|
-
import { l as mysqlEnumParams, o as mysqlDatetimeParams } from "./data-types-BpihGKoK-BMW-m4EN.mjs";
|
|
4
|
-
import { CodecCallContext, CodecImpl, CodecInstanceContext, DataTypeValue } from "@prisma/orm-framework/components/codec";
|
|
5
|
-
import { ProjectionExpr } from "@prisma/orm-family-sql/relational-core/ast";
|
|
6
|
-
import { JsonValue } from "@prisma/orm-framework/contract/types";
|
|
7
|
-
//#region ../../../3-targets/mysql/1-target/dist/codecs-CO_VNEYU.d.mts
|
|
8
|
-
//#region src/core/codecs.d.ts
|
|
9
|
-
declare class MysqlTextCodec extends CodecImpl<typeof MYSQL_TEXT_CODEC_ID, readonly ['equality', 'order', 'textual'], string, string> {
|
|
10
|
-
toWire(value: string, _ctx: CodecCallContext): Promise<string>;
|
|
11
|
-
fromWire(wire: string, _ctx: CodecCallContext): Promise<string>;
|
|
12
|
-
fromDataTypeValue(value: DataTypeValue<string>): string;
|
|
13
|
-
toDataTypeValue(input: string): DataTypeValue;
|
|
14
|
-
}
|
|
15
|
-
declare class MysqlTextDescriptor extends MysqlCodecDescriptor<void> {
|
|
16
|
-
readonly dataType: import("@prisma/orm-framework/components/codec").DataTypeId;
|
|
17
|
-
readonly codecId: "mysql/text@1";
|
|
18
|
-
readonly traits: readonly ["equality", "order", "textual"];
|
|
19
|
-
readonly paramsSchema: undefined;
|
|
20
|
-
renderValueLiteral(value: JsonValue): string | undefined;
|
|
21
|
-
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
22
|
-
factory(): (ctx: CodecInstanceContext) => MysqlTextCodec;
|
|
23
|
-
}
|
|
24
|
-
/** A MySQL `int` as a JavaScript number. A row carries it as decimal text, and an include's JSON as a number. */
|
|
25
|
-
declare class MysqlIntCodec extends CodecImpl<typeof MYSQL_INT_CODEC_ID, readonly ['equality', 'order', 'numeric'], string | number, number> {
|
|
26
|
-
toWire(value: number, _ctx: CodecCallContext): Promise<number>;
|
|
27
|
-
fromWire(wire: string | number, _ctx: CodecCallContext): Promise<number>;
|
|
28
|
-
fromDataTypeValue(value: DataTypeValue<number>): number;
|
|
29
|
-
toDataTypeValue(input: number): DataTypeValue;
|
|
30
|
-
}
|
|
31
|
-
declare class MysqlIntDescriptor extends MysqlCodecDescriptor<void> {
|
|
32
|
-
readonly dataType: import("@prisma/orm-framework/components/codec").DataTypeId;
|
|
33
|
-
readonly codecId: "mysql/int@1";
|
|
34
|
-
readonly traits: readonly ["equality", "order", "numeric"];
|
|
35
|
-
readonly paramsSchema: undefined;
|
|
36
|
-
renderValueLiteral(value: JsonValue): string | undefined;
|
|
37
|
-
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
38
|
-
factory(): (ctx: CodecInstanceContext) => MysqlIntCodec;
|
|
39
|
-
}
|
|
40
|
-
/** 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. */
|
|
41
|
-
declare class MysqlBigintCodec extends CodecImpl<typeof MYSQL_BIGINT_CODEC_ID, readonly ['equality', 'order', 'numeric'], string | bigint, bigint> {
|
|
42
|
-
/** 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. */
|
|
43
|
-
toWire(value: bigint, _ctx: CodecCallContext): Promise<bigint>;
|
|
44
|
-
fromWire(wire: string | bigint, _ctx: CodecCallContext): Promise<bigint>;
|
|
45
|
-
fromDataTypeValue(value: DataTypeValue<string>): bigint;
|
|
46
|
-
toDataTypeValue(input: bigint): DataTypeValue;
|
|
47
|
-
}
|
|
48
|
-
declare class MysqlBigintDescriptor extends MysqlCodecDescriptor<void> {
|
|
49
|
-
readonly dataType: import("@prisma/orm-framework/components/codec").DataTypeId;
|
|
50
|
-
readonly codecId: "mysql/bigint@1";
|
|
51
|
-
readonly traits: readonly ["equality", "order", "numeric"];
|
|
52
|
-
readonly paramsSchema: undefined;
|
|
53
|
-
renderValueLiteral(value: JsonValue): string | undefined;
|
|
54
|
-
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
55
|
-
factory(): (ctx: CodecInstanceContext) => MysqlBigintCodec;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* 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.
|
|
59
|
-
*/
|
|
60
|
-
declare function decodeMysqlDatetime(wire: string): Date;
|
|
61
|
-
/** The text MySQL reads for an instant in UTC, with millisecond digits. */
|
|
62
|
-
declare function encodeMysqlDatetime(value: Date): string;
|
|
63
|
-
/** A MySQL `datetime` as a JavaScript `Date`, read and written in UTC. */
|
|
64
|
-
declare class MysqlDatetimeCodec extends CodecImpl<typeof MYSQL_DATETIME_CODEC_ID, readonly ['equality', 'order'], string, Date> {
|
|
65
|
-
toWire(value: Date, _ctx: CodecCallContext): Promise<string>;
|
|
66
|
-
fromWire(wire: string, _ctx: CodecCallContext): Promise<Date>;
|
|
67
|
-
fromDataTypeValue(value: DataTypeValue<string>): Date;
|
|
68
|
-
toDataTypeValue(input: Date): DataTypeValue;
|
|
69
|
-
}
|
|
70
|
-
type DatetimeParams = typeof mysqlDatetimeParams.infer;
|
|
71
|
-
declare class MysqlDatetimeDescriptor extends MysqlCodecDescriptor<DatetimeParams> {
|
|
72
|
-
readonly dataType: import("@prisma/orm-framework/components/codec").DataTypeId;
|
|
73
|
-
readonly codecId: "mysql/datetime@1";
|
|
74
|
-
readonly traits: readonly ["equality", "order"];
|
|
75
|
-
readonly paramsSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
76
|
-
precision?: number;
|
|
77
|
-
}, {}>;
|
|
78
|
-
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
79
|
-
factory(params: DatetimeParams): (ctx: CodecInstanceContext) => MysqlDatetimeCodec;
|
|
80
|
-
}
|
|
81
|
-
/** A native MySQL enum column, whose value is the member's text. */
|
|
82
|
-
declare class MysqlEnumCodec extends CodecImpl<typeof MYSQL_ENUM_CODEC_ID, readonly ['equality', 'order', 'textual'], string, string> {
|
|
83
|
-
toWire(value: string, _ctx: CodecCallContext): Promise<string>;
|
|
84
|
-
fromWire(wire: string, _ctx: CodecCallContext): Promise<string>;
|
|
85
|
-
fromDataTypeValue(value: DataTypeValue<string>): string;
|
|
86
|
-
toDataTypeValue(input: string): DataTypeValue;
|
|
87
|
-
}
|
|
88
|
-
type EnumParams = typeof mysqlEnumParams.infer;
|
|
89
|
-
declare class MysqlEnumDescriptor extends MysqlCodecDescriptor<EnumParams> {
|
|
90
|
-
readonly dataType: import("@prisma/orm-framework/components/codec").DataTypeId;
|
|
91
|
-
readonly codecId: "mysql/enum@1";
|
|
92
|
-
readonly traits: readonly ["equality", "order", "textual"];
|
|
93
|
-
readonly paramsSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
94
|
-
values?: string[];
|
|
95
|
-
}, {}>;
|
|
96
|
-
renderValueLiteral(value: JsonValue): string | undefined;
|
|
97
|
-
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
98
|
-
factory(params: EnumParams): (ctx: CodecInstanceContext) => MysqlEnumCodec;
|
|
99
|
-
}
|
|
100
|
-
//#endregion
|
|
101
|
-
export { MysqlTextDescriptor as a, MysqlIntDescriptor as i, MysqlDatetimeDescriptor as n, decodeMysqlDatetime as o, MysqlEnumDescriptor as r, encodeMysqlDatetime as s, MysqlBigintDescriptor as t };
|
|
102
|
-
//# sourceMappingURL=codecs-CO_VNEYU-CwAnKzRs.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codecs-CO_VNEYU-CwAnKzRs.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/codecs-CO_VNEYU.d.mts"],"mappings":";;;;;;;;cAOc,uBAAuB,iBAAiB;EACpD,OAAO,eAAe,MAAM,mBAAmB;EAC/C,SAAS,cAAc,MAAM,mBAAmB;EAChD,kBAAkB,OAAO;EACzB,gBAAgB,gBAAgB;;cAEpB,4BAA4B;WAC/B,yDAAyD;WACzD;WACA;WACA;EACT,mBAAmB,OAAO;YAChB,eAAe,YAAY,iBAAiB;EACtD,YAAY,KAAK,yBAAyB;;;cAG9B,sBAAsB,iBAAiB;EACnD,OAAO,eAAe,MAAM,mBAAmB;EAC/C,SAAS,uBAAuB,MAAM,mBAAmB;EACzD,kBAAkB,OAAO;EACzB,gBAAgB,gBAAgB;;cAEpB,2BAA2B;WAC9B,yDAAyD;WACzD;WACA;WACA;EACT,mBAAmB,OAAO;YAChB,eAAe,YAAY,iBAAiB;EACtD,YAAY,KAAK,yBAAyB;;;cAG9B,yBAAyB,iBAAiB;;EAEtD,OAAO,eAAe,MAAM,mBAAmB;EAC/C,SAAS,uBAAuB,MAAM,mBAAmB;EACzD,kBAAkB,OAAO;EACzB,gBAAgB,gBAAgB;;cAEpB,8BAA8B;WACjC,yDAAyD;WACzD;WACA;WACA;EACT,mBAAmB,OAAO;YAChB,eAAe,YAAY,iBAAiB;EACtD,YAAY,KAAK,yBAAyB;;;;;iBAK3B,oBAAoB,eAAe;;iBAEnC,oBAAoB,OAAO;;cAE9B,2BAA2B,iBAAiB,iEAAiE;EACzH,OAAO,OAAO,MAAM,MAAM,mBAAmB;EAC7C,SAAS,cAAc,MAAM,mBAAmB,QAAQ;EACxD,kBAAkB,OAAO,wBAAwB;EACjD,gBAAgB,OAAO,OAAO;;KAE3B,wBAAwB,oBAAoB;cACnC,gCAAgC,qBAAqB;WACxD,yDAAyD;WACzD;WACA;WACA,4DAA4D;IACnE;;YAEQ,eAAe,YAAY,iBAAiB;EACtD,QAAQ,QAAQ,kBAAkB,KAAK,yBAAyB;;;cAGpD,uBAAuB,iBAAiB;EACpD,OAAO,eAAe,MAAM,mBAAmB;EAC/C,SAAS,cAAc,MAAM,mBAAmB;EAChD,kBAAkB,OAAO;EACzB,gBAAgB,gBAAgB;;KAE7B,oBAAoB,gBAAgB;cAC3B,4BAA4B,qBAAqB;WACpD,yDAAyD;WACzD;WACA;WACA,4DAA4D;IACnE;;EAEF,mBAAmB,OAAO;YAChB,eAAe,YAAY,iBAAiB;EACtD,QAAQ,QAAQ,cAAc,KAAK,yBAAyB"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { i as MysqlCodecDescriptorRegistry } from "./codec-descriptor-DXyubAS6-siA0R8Ow.mjs";
|
|
2
|
-
import "./codecs-CO_VNEYU-CwAnKzRs.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/registry.d.ts
|
|
16
|
-
/** Every codec descriptor `@internal/target-mysql` ships, for consumers that enumerate or look up a MySQL codec by id. ADR 208. */
|
|
17
|
-
declare const mysqlCodecRegistry: CodecDescriptorRegistry;
|
|
18
|
-
declare const mysqlCodecDescriptorRegistry: MysqlCodecDescriptorRegistry;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { mysqlCodecRegistry as a, mysqlCodecDescriptorRegistry as i, assembleMysqlCodecRegistry as n, createMysqlBuiltinCodecLookup as r, MysqlCodecRegistry as t };
|
|
21
|
-
//# sourceMappingURL=codecs-DM61agRr.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codecs-DM61agRr.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,oBAAoB;cACpB,8BAA8B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contract-contributions-B9njRJbt-ClEtrK2L.mjs","names":[],"sources":["../../../../3-targets/mysql/2-adapter/dist/contract-contributions-B9njRJbt.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. */\nconst mysqlAdapterCapabilities = Object.freeze({ sql: {\n\torderBy: true,\n\tlimit: true,\n\tforeignKeys: true,\n\tenums: 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-B9njRJbt.mjs.map"],"mappings":";;AAEA,MAAM,2BAA2B,OAAO,OAAO,EAAE,KAAK;CACrD,SAAS;CACT,OAAO;CACP,aAAa;CACb,OAAO;AACR,EAAE,CAAC;;AAIH,MAAM,oCAAoC,EAAE,cAAc,yBAAyB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-WTY7Jpxk.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-aEaHihYj.mjs\";\nimport { checkSqlDefaultText, contractColumns, readColumnDefault, sqlDefaultFunctions } from \"@internal/family-sql/control\";\nimport { assembleMysqlCodecRegistry, decodeMysqlDatetime, encodeMysqlDatetime } 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)\\((\\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/** `CURRENT_TIMESTAMP` with the column's fractional-second precision, which MySQL requires to match. */\nfunction currentTimestampFor(columnType) {\n\tconst precision = FRACTIONAL_SECONDS.exec(columnType.trim())?.[1];\n\treturn precision === void 0 ? \"CURRENT_TIMESTAMP\" : `CURRENT_TIMESTAMP(${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 (${currentTimestampFor(columnType)})`;\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,I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],"sources":["../../../../3-targets/mysql/1-target/dist/control.d.mts"],"mappings":";;;;;cAIc,8BAA8B,oCAAoC;;;;;;cAMlE,sBAAsB;WACzB;WACA;WACA,SAAS;EAClB,YAAY,OAAO;MACf,SAAS,SAAS,eAAe;EACrC;EACA,aAAa;;;;;iBAKE,qBAAqB,OAAO,oBAAoB"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { d as mysqlText, t as mysqlBigint, u as mysqlInt } from "./data-types-Dv9gwVRV-BZPzCWZk.mjs";
|
|
2
|
-
import { createNumberClassifier, numeralText, signedRange } from "@prisma/orm-framework/components/codec";
|
|
3
|
-
//#region ../../../3-targets/mysql/1-target/dist/data-type-entries-B0AoBozh.mjs
|
|
4
|
-
const classifyMysqlNumber = createNumberClassifier({ integers: [{
|
|
5
|
-
type: mysqlInt.id,
|
|
6
|
-
form: "number",
|
|
7
|
-
...signedRange(32)
|
|
8
|
-
}, {
|
|
9
|
-
type: mysqlBigint.id,
|
|
10
|
-
form: "text",
|
|
11
|
-
...signedRange(64)
|
|
12
|
-
}] });
|
|
13
|
-
function printNumber(value) {
|
|
14
|
-
return typeof value === "number" ? numeralText(value) : String(value);
|
|
15
|
-
}
|
|
16
|
-
function mysqlDataTypeEntries() {
|
|
17
|
-
return {
|
|
18
|
-
[mysqlText.id]: {
|
|
19
|
-
written: {
|
|
20
|
-
kind: "plain",
|
|
21
|
-
syntax: "string",
|
|
22
|
-
parse: (text) => text
|
|
23
|
-
},
|
|
24
|
-
print: (value) => String(value),
|
|
25
|
-
documentation: "Text."
|
|
26
|
-
},
|
|
27
|
-
[mysqlBigint.id]: {
|
|
28
|
-
written: {
|
|
29
|
-
kind: "plain",
|
|
30
|
-
syntax: "number",
|
|
31
|
-
types: [mysqlInt.id, mysqlBigint.id],
|
|
32
|
-
classify: classifyMysqlNumber
|
|
33
|
-
},
|
|
34
|
-
print: printNumber,
|
|
35
|
-
documentation: "A whole number, whose type is the narrowest MySQL integer type that holds it."
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
//#endregion
|
|
40
|
-
export { mysqlDataTypeEntries as t };
|
|
41
|
-
|
|
42
|
-
//# sourceMappingURL=data-type-entries-B0AoBozh-f9AEUIUQ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-type-entries-B0AoBozh-f9AEUIUQ.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/data-type-entries-B0AoBozh.mjs"],"sourcesContent":["import { d as mysqlText, t as mysqlBigint, u as mysqlInt } from \"./data-types-Dv9gwVRV.mjs\";\nimport { createNumberClassifier, numeralText, signedRange } from \"@internal/framework-components/codec\";\n//#region src/core/data-type-entries.ts\nconst classifyMysqlNumber = createNumberClassifier({ integers: [{\n\ttype: mysqlInt.id,\n\tform: \"number\",\n\t...signedRange(32)\n}, {\n\ttype: mysqlBigint.id,\n\tform: \"text\",\n\t...signedRange(64)\n}] });\nfunction printNumber(value) {\n\treturn typeof value === \"number\" ? numeralText(value) : String(value);\n}\nfunction mysqlDataTypeEntries() {\n\treturn {\n\t\t[mysqlText.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"string\",\n\t\t\t\tparse: (text) => text\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"Text.\"\n\t\t},\n\t\t[mysqlBigint.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"number\",\n\t\t\t\ttypes: [mysqlInt.id, mysqlBigint.id],\n\t\t\t\tclassify: classifyMysqlNumber\n\t\t\t},\n\t\t\tprint: printNumber,\n\t\t\tdocumentation: \"A whole number, whose type is the narrowest MySQL integer type that holds it.\"\n\t\t}\n\t};\n}\n//#endregion\nexport { mysqlDataTypeEntries as t };\n\n//# sourceMappingURL=data-type-entries-B0AoBozh.mjs.map"],"mappings":";;;AAGA,MAAM,sBAAsB,uBAAuB,EAAE,UAAU,CAAC;CAC/D,MAAM,SAAS;CACf,MAAM;CACN,GAAG,YAAY,EAAE;AAClB,GAAG;CACF,MAAM,YAAY;CAClB,MAAM;CACN,GAAG,YAAY,EAAE;AAClB,CAAC,EAAE,CAAC;AACJ,SAAS,YAAY,OAAO;CAC3B,OAAO,OAAO,UAAU,WAAW,YAAY,KAAK,IAAI,OAAO,KAAK;AACrE;AACA,SAAS,uBAAuB;CAC/B,OAAO;GACL,UAAU,KAAK;GACf,SAAS;IACR,MAAM;IACN,QAAQ;IACR,QAAQ,SAAS;GAClB;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,YAAY,KAAK;GACjB,SAAS;IACR,MAAM;IACN,QAAQ;IACR,OAAO,CAAC,SAAS,IAAI,YAAY,EAAE;IACnC,UAAU;GACX;GACA,OAAO;GACP,eAAe;EAChB;CACD;AACD"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { DataType, DataTypeId } from "@prisma/orm-framework/components/codec";
|
|
2
|
-
//#region ../../../3-targets/mysql/1-target/dist/data-types-BpihGKoK.d.mts
|
|
3
|
-
//#region src/core/data-types.d.ts
|
|
4
|
-
declare const mysqlText: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
5
|
-
/** A signed 32-bit integer, stored as a JSON number. */
|
|
6
|
-
declare const mysqlInt: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
7
|
-
/** A signed 64-bit integer, stored as digit text so that no digit is lost. */
|
|
8
|
-
declare const mysqlBigint: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
9
|
-
/** The length of `varchar`, which MySQL requires, up to the largest it accepts. */
|
|
10
|
-
declare const mysqlVarcharParams: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
11
|
-
length: number;
|
|
12
|
-
}, {}>;
|
|
13
|
-
declare const mysqlVarchar: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<{
|
|
14
|
-
length: number;
|
|
15
|
-
}>;
|
|
16
|
-
/** The length of `char`, at most 255; a bare `char` is `char(1)`. */
|
|
17
|
-
declare const mysqlCharParams: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
18
|
-
length?: number;
|
|
19
|
-
}, {}>;
|
|
20
|
-
declare const mysqlChar: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<{
|
|
21
|
-
length?: number;
|
|
22
|
-
}>;
|
|
23
|
-
/** The fractional-second precision of `datetime`, 0 to 6; MySQL prints a precision of 0 as a bare `datetime`. */
|
|
24
|
-
declare const mysqlDatetimeParams: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
25
|
-
precision?: number;
|
|
26
|
-
}, {}>;
|
|
27
|
-
/**
|
|
28
|
-
* The value of `mysql/datetime`: a date and time without a time zone, ISO 8601 text with a `T` and no trailing zeros in the fraction, within MySQL's range. Throws `CONTRACT.CAST_REFUSED` for text that names no such date and time.
|
|
29
|
-
*/
|
|
30
|
-
declare function mysqlDatetimeText(text: string): string;
|
|
31
|
-
declare const mysqlDatetime: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<{
|
|
32
|
-
precision?: number;
|
|
33
|
-
}>;
|
|
34
|
-
/** The members of a native enum column, in the order they are declared. */
|
|
35
|
-
declare const mysqlEnumParams: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
36
|
-
values?: string[];
|
|
37
|
-
}, {}>;
|
|
38
|
-
/** `enum('A','B')`, the text MySQL's catalog prints for the column type, with each member a quoted literal. */
|
|
39
|
-
declare function renderMysqlEnumType(values: readonly string[] | undefined): string;
|
|
40
|
-
/**
|
|
41
|
-
* A native MySQL enum. Its name is the catalog text `enum('A','B')`, so `db verify` compares the members and their order with what MySQL reports (ADR 273). A column's members are its value set's, written into its parameters by the target's namespace (see `mysql-database.ts`).
|
|
42
|
-
*/
|
|
43
|
-
declare const mysqlEnum: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<{
|
|
44
|
-
values?: string[];
|
|
45
|
-
}>;
|
|
46
|
-
/** Every data type this target registers. */
|
|
47
|
-
declare const mysqlDataTypes: readonly DataType[];
|
|
48
|
-
/** MySQL's text data types, which a SQL discriminator column may have. */
|
|
49
|
-
declare const mysqlTextDataTypes: readonly DataTypeId[];
|
|
50
|
-
//#endregion
|
|
51
|
-
export { mysqlDatetime as a, mysqlEnum as c, mysqlText as d, mysqlTextDataTypes as f, renderMysqlEnumType as h, mysqlDataTypes as i, mysqlEnumParams as l, mysqlVarcharParams as m, mysqlChar as n, mysqlDatetimeParams as o, mysqlVarchar as p, mysqlCharParams as r, mysqlDatetimeText as s, mysqlBigint as t, mysqlInt as u };
|
|
52
|
-
//# sourceMappingURL=data-types-BpihGKoK-BMW-m4EN.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-types-BpihGKoK-BMW-m4EN.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/data-types-BpihGKoK.d.mts"],"mappings":";;;cAEc,sDAAsD,YAAY,SAAS;;cAE3E,qDAAqD,YAAY,SAAS;;cAE1E,wDAAwD,YAAY,SAAS;;cAE7E,kEAAkE;EAC9E;;cAEY,yDAAyD;EACrE;;;cAGY,+DAA+D;EAC3E;;cAEY,sDAAsD;EAClE;;;cAGY,mEAAmE;EAC/E;;;;;iBAKe,kBAAkB;cACrB,0DAA0D;EACtE;;;cAGY,+DAA+D;EAC3E;;;iBAGe,oBAAoB;;;;cAIvB,sDAAsD;EAClE;;;cAGY,yBAAyB;;cAEzB,6BAA6B"}
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import { t as mysqlError } from "./errors-rvH_F2Yj-BQrO_--u.mjs";
|
|
2
|
-
import { r as quoteLiteral } from "./sql-utils-Db0IQO_B-PaULnfrE.mjs";
|
|
3
|
-
import { INT32_RANGE, INT64_RANGE, dateTimeStoredText, numeralText, readJsonInteger, readJsonIntegerText, readJsonString, refuseJsonValue } from "@prisma/orm-framework/components/codec";
|
|
4
|
-
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
5
|
-
import { sqlDataType, sqlRawDataType } from "@prisma/orm-family-sql/contract/data-type";
|
|
6
|
-
import { type } from "arktype";
|
|
7
|
-
//#region ../../../3-targets/mysql/1-target/dist/data-types-Dv9gwVRV.mjs
|
|
8
|
-
const unchanged = (value) => value;
|
|
9
|
-
function wrongShape(value, expected) {
|
|
10
|
-
throw structuredError("CONTRACT.CAST_REFUSED", `Expected ${expected}, got ${JSON.stringify(value)}.`, {
|
|
11
|
-
why: "A cast reads the stored form of the type it takes values of.",
|
|
12
|
-
fix: "Hand the cast a value in the shape its source type stores."
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
const asNumeralText = (value) => typeof value === "number" ? numeralText(value) : wrongShape(value, "a number");
|
|
16
|
-
function integerParam(params, name) {
|
|
17
|
-
const value = params[name];
|
|
18
|
-
return typeof value === "number" ? value : void 0;
|
|
19
|
-
}
|
|
20
|
-
/** Text of at most `length` characters, counted as code points, as MySQL counts characters. */
|
|
21
|
-
function readTextOfLength(owner, json, length) {
|
|
22
|
-
const text = readJsonString(owner, json);
|
|
23
|
-
if (length !== void 0 && [...text].length > length) return refuseJsonValue(owner, `a string of at most ${length} ${length === 1 ? "character" : "characters"}`, json);
|
|
24
|
-
return json;
|
|
25
|
-
}
|
|
26
|
-
const mysqlText = sqlDataType("mysql/text", {
|
|
27
|
-
texts: [{
|
|
28
|
-
text: "text",
|
|
29
|
-
written: true,
|
|
30
|
-
catalog: true
|
|
31
|
-
}],
|
|
32
|
-
read: (json) => readJsonString("mysql/text", json),
|
|
33
|
-
casts: {}
|
|
34
|
-
});
|
|
35
|
-
const fromText = { [mysqlText.id]: unchanged };
|
|
36
|
-
/** A signed 32-bit integer, stored as a JSON number. */
|
|
37
|
-
const mysqlInt = sqlDataType("mysql/int", {
|
|
38
|
-
texts: [{
|
|
39
|
-
text: "int",
|
|
40
|
-
written: true,
|
|
41
|
-
catalog: true
|
|
42
|
-
}, { text: "integer" }],
|
|
43
|
-
read: (json) => readJsonInteger("mysql/int", json, INT32_RANGE),
|
|
44
|
-
casts: {}
|
|
45
|
-
});
|
|
46
|
-
/** A signed 64-bit integer, stored as digit text so that no digit is lost. */
|
|
47
|
-
const mysqlBigint = sqlDataType("mysql/bigint", {
|
|
48
|
-
texts: [{
|
|
49
|
-
text: "bigint",
|
|
50
|
-
written: true,
|
|
51
|
-
catalog: true
|
|
52
|
-
}],
|
|
53
|
-
read: (json) => {
|
|
54
|
-
readJsonIntegerText("mysql/bigint", json, INT64_RANGE);
|
|
55
|
-
return json;
|
|
56
|
-
},
|
|
57
|
-
casts: { [mysqlInt.id]: asNumeralText }
|
|
58
|
-
});
|
|
59
|
-
/** The length of `varchar`, which MySQL requires, up to the largest it accepts. */
|
|
60
|
-
const mysqlVarcharParams = type({ length: "number.integer >= 1 & number.integer <= 65535" });
|
|
61
|
-
const mysqlVarchar = sqlDataType("mysql/varchar", {
|
|
62
|
-
params: mysqlVarcharParams,
|
|
63
|
-
texts: [{
|
|
64
|
-
text: "varchar({length})",
|
|
65
|
-
written: true,
|
|
66
|
-
catalog: true
|
|
67
|
-
}],
|
|
68
|
-
read: (json, params) => readTextOfLength("mysql/varchar", json, integerParam(params, "length")),
|
|
69
|
-
casts: fromText
|
|
70
|
-
});
|
|
71
|
-
/** The length of `char`, at most 255; a bare `char` is `char(1)`. */
|
|
72
|
-
const mysqlCharParams = type({ "length?": "number.integer >= 1 & number.integer <= 255" });
|
|
73
|
-
const mysqlChar = sqlDataType("mysql/char", {
|
|
74
|
-
params: mysqlCharParams,
|
|
75
|
-
texts: [{
|
|
76
|
-
text: "char",
|
|
77
|
-
written: true
|
|
78
|
-
}, {
|
|
79
|
-
text: "char({length})",
|
|
80
|
-
written: true,
|
|
81
|
-
catalog: true
|
|
82
|
-
}],
|
|
83
|
-
read: (json, params) => readTextOfLength("mysql/char", json, integerParam(params, "length") ?? 1),
|
|
84
|
-
normalize: (params) => params.length === void 0 ? {
|
|
85
|
-
...params,
|
|
86
|
-
length: 1
|
|
87
|
-
} : params,
|
|
88
|
-
casts: fromText
|
|
89
|
-
});
|
|
90
|
-
/** The fractional-second precision of `datetime`, 0 to 6; MySQL prints a precision of 0 as a bare `datetime`. */
|
|
91
|
-
const mysqlDatetimeParams = type({ "precision?": "number.integer >= 0 & number.integer <= 6" });
|
|
92
|
-
const DATETIME_RANGE = {
|
|
93
|
-
earliest: "1000-01-01T00:00:00",
|
|
94
|
-
latest: "9999-12-31T23:59:59.999999"
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
* The value of `mysql/datetime`: a date and time without a time zone, ISO 8601 text with a `T` and no trailing zeros in the fraction, within MySQL's range. Throws `CONTRACT.CAST_REFUSED` for text that names no such date and time.
|
|
98
|
-
*/
|
|
99
|
-
function mysqlDatetimeText(text) {
|
|
100
|
-
return dateTimeStoredText(text, {
|
|
101
|
-
shape: "dateTime",
|
|
102
|
-
ownerId: "mysql/datetime",
|
|
103
|
-
range: DATETIME_RANGE
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
function storedDatetime(text) {
|
|
107
|
-
try {
|
|
108
|
-
return mysqlDatetimeText(text);
|
|
109
|
-
} catch {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
const readDatetime = (json) => typeof json === "string" && storedDatetime(json) !== void 0 ? json : refuseJsonValue("mysql/datetime", "ISO 8601 date and time text without a UTC offset, as in \"2024-01-01T00:00:00\"", json);
|
|
114
|
-
const spellDatetime = (json) => typeof json === "string" ? storedDatetime(json) ?? json : json;
|
|
115
|
-
const mysqlDatetime = sqlDataType("mysql/datetime", {
|
|
116
|
-
params: mysqlDatetimeParams,
|
|
117
|
-
texts: [{
|
|
118
|
-
text: "datetime",
|
|
119
|
-
written: true,
|
|
120
|
-
catalog: true
|
|
121
|
-
}, {
|
|
122
|
-
text: "datetime({precision})",
|
|
123
|
-
written: true,
|
|
124
|
-
catalog: true
|
|
125
|
-
}],
|
|
126
|
-
read: readDatetime,
|
|
127
|
-
spell: spellDatetime,
|
|
128
|
-
normalize: ({ precision, ...rest }) => precision === 0 ? rest : {
|
|
129
|
-
...rest,
|
|
130
|
-
precision
|
|
131
|
-
},
|
|
132
|
-
casts: {}
|
|
133
|
-
});
|
|
134
|
-
/** The members of a native enum column, in the order they are declared. */
|
|
135
|
-
const mysqlEnumParams = type({ "values?": "string[]" });
|
|
136
|
-
/** `enum('A','B')`, the text MySQL's catalog prints for the column type, with each member a quoted literal. */
|
|
137
|
-
function renderMysqlEnumType(values) {
|
|
138
|
-
if (values === void 0 || values.length === 0) throw mysqlError("CONTRACT.TYPE_PARAMS_INVALID", "A MySQL enum column type needs at least one member.", {
|
|
139
|
-
why: "A native enum column is written with its members, and this column has none.",
|
|
140
|
-
fix: "Type the column with a PSL enum or an enumType() that declares its members.",
|
|
141
|
-
meta: { dataType: "mysql/enum" }
|
|
142
|
-
});
|
|
143
|
-
return `enum(${values.map(quoteLiteral).join(",")})`;
|
|
144
|
-
}
|
|
145
|
-
const readEnumMember = (json, params) => {
|
|
146
|
-
const member = readJsonString("mysql/enum", json);
|
|
147
|
-
const values = params["values"];
|
|
148
|
-
if (Array.isArray(values) && !values.includes(member)) return refuseJsonValue("mysql/enum", `one of the members ${values.join(", ")}`, json);
|
|
149
|
-
return json;
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
|
-
* A native MySQL enum. Its name is the catalog text `enum('A','B')`, so `db verify` compares the members and their order with what MySQL reports (ADR 273). A column's members are its value set's, written into its parameters by the target's namespace (see `mysql-database.ts`).
|
|
153
|
-
*/
|
|
154
|
-
const mysqlEnum = sqlDataType("mysql/enum", {
|
|
155
|
-
params: mysqlEnumParams,
|
|
156
|
-
nameIsCatalogText: true,
|
|
157
|
-
render: ({ values }) => renderMysqlEnumType(values),
|
|
158
|
-
read: readEnumMember,
|
|
159
|
-
casts: fromText
|
|
160
|
-
});
|
|
161
|
-
/** Every data type this target registers. */
|
|
162
|
-
const mysqlDataTypes = [
|
|
163
|
-
mysqlText,
|
|
164
|
-
mysqlInt,
|
|
165
|
-
mysqlBigint,
|
|
166
|
-
mysqlVarchar,
|
|
167
|
-
mysqlChar,
|
|
168
|
-
mysqlDatetime,
|
|
169
|
-
mysqlEnum,
|
|
170
|
-
sqlRawDataType
|
|
171
|
-
];
|
|
172
|
-
/** MySQL's text data types, which a SQL discriminator column may have. */
|
|
173
|
-
const mysqlTextDataTypes = [
|
|
174
|
-
mysqlText.id,
|
|
175
|
-
mysqlVarchar.id,
|
|
176
|
-
mysqlChar.id
|
|
177
|
-
];
|
|
178
|
-
//#endregion
|
|
179
|
-
export { mysqlDatetime as a, mysqlEnum as c, mysqlText as d, mysqlTextDataTypes as f, renderMysqlEnumType as h, mysqlDataTypes as i, mysqlEnumParams as l, mysqlVarcharParams as m, mysqlChar as n, mysqlDatetimeParams as o, mysqlVarchar as p, mysqlCharParams as r, mysqlDatetimeText as s, mysqlBigint as t, mysqlInt as u };
|
|
180
|
-
|
|
181
|
-
//# sourceMappingURL=data-types-Dv9gwVRV-BZPzCWZk.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-types-Dv9gwVRV-BZPzCWZk.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/data-types-Dv9gwVRV.mjs"],"sourcesContent":["import { t as mysqlError } from \"./errors-rvH_F2Yj.mjs\";\nimport { r as quoteLiteral } from \"./sql-utils-Db0IQO_B.mjs\";\nimport { INT32_RANGE, INT64_RANGE, dateTimeStoredText, numeralText, readJsonInteger, readJsonIntegerText, readJsonString, refuseJsonValue } from \"@internal/framework-components/codec\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { sqlDataType, sqlRawDataType } from \"@internal/sql-contract/data-type\";\nimport { type } from \"arktype\";\n//#region src/core/data-types.ts\nconst unchanged = (value) => value;\nfunction wrongShape(value, expected) {\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `Expected ${expected}, got ${JSON.stringify(value)}.`, {\n\t\twhy: \"A cast reads the stored form of the type it takes values of.\",\n\t\tfix: \"Hand the cast a value in the shape its source type stores.\"\n\t});\n}\nconst asNumeralText = (value) => typeof value === \"number\" ? numeralText(value) : wrongShape(value, \"a number\");\nfunction integerParam(params, name) {\n\tconst value = params[name];\n\treturn typeof value === \"number\" ? value : void 0;\n}\n/** Text of at most `length` characters, counted as code points, as MySQL counts characters. */\nfunction readTextOfLength(owner, json, length) {\n\tconst text = readJsonString(owner, json);\n\tif (length !== void 0 && [...text].length > length) return refuseJsonValue(owner, `a string of at most ${length} ${length === 1 ? \"character\" : \"characters\"}`, json);\n\treturn json;\n}\nconst mysqlText = sqlDataType(\"mysql/text\", {\n\ttexts: [{\n\t\ttext: \"text\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread: (json) => readJsonString(\"mysql/text\", json),\n\tcasts: {}\n});\nconst fromText = { [mysqlText.id]: unchanged };\n/** A signed 32-bit integer, stored as a JSON number. */\nconst mysqlInt = sqlDataType(\"mysql/int\", {\n\ttexts: [{\n\t\ttext: \"int\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}, { text: \"integer\" }],\n\tread: (json) => readJsonInteger(\"mysql/int\", json, INT32_RANGE),\n\tcasts: {}\n});\n/** A signed 64-bit integer, stored as digit text so that no digit is lost. */\nconst mysqlBigint = sqlDataType(\"mysql/bigint\", {\n\ttexts: [{\n\t\ttext: \"bigint\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread: (json) => {\n\t\treadJsonIntegerText(\"mysql/bigint\", json, INT64_RANGE);\n\t\treturn json;\n\t},\n\tcasts: { [mysqlInt.id]: asNumeralText }\n});\n/** The length of `varchar`, which MySQL requires, up to the largest it accepts. */\nconst mysqlVarcharParams = type({ length: \"number.integer >= 1 & number.integer <= 65535\" });\nconst mysqlVarchar = sqlDataType(\"mysql/varchar\", {\n\tparams: mysqlVarcharParams,\n\ttexts: [{\n\t\ttext: \"varchar({length})\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread: (json, params) => readTextOfLength(\"mysql/varchar\", json, integerParam(params, \"length\")),\n\tcasts: fromText\n});\n/** The length of `char`, at most 255; a bare `char` is `char(1)`. */\nconst mysqlCharParams = type({ \"length?\": \"number.integer >= 1 & number.integer <= 255\" });\nconst mysqlChar = sqlDataType(\"mysql/char\", {\n\tparams: mysqlCharParams,\n\ttexts: [{\n\t\ttext: \"char\",\n\t\twritten: true\n\t}, {\n\t\ttext: \"char({length})\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread: (json, params) => readTextOfLength(\"mysql/char\", json, integerParam(params, \"length\") ?? 1),\n\tnormalize: (params) => params.length === void 0 ? {\n\t\t...params,\n\t\tlength: 1\n\t} : params,\n\tcasts: fromText\n});\n/** The fractional-second precision of `datetime`, 0 to 6; MySQL prints a precision of 0 as a bare `datetime`. */\nconst mysqlDatetimeParams = type({ \"precision?\": \"number.integer >= 0 & number.integer <= 6\" });\nconst DATETIME_RANGE = {\n\tearliest: \"1000-01-01T00:00:00\",\n\tlatest: \"9999-12-31T23:59:59.999999\"\n};\n/**\n* The value of `mysql/datetime`: a date and time without a time zone, ISO 8601 text with a `T` and no trailing zeros in the fraction, within MySQL's range. Throws `CONTRACT.CAST_REFUSED` for text that names no such date and time.\n*/\nfunction mysqlDatetimeText(text) {\n\treturn dateTimeStoredText(text, {\n\t\tshape: \"dateTime\",\n\t\townerId: \"mysql/datetime\",\n\t\trange: DATETIME_RANGE\n\t});\n}\nfunction storedDatetime(text) {\n\ttry {\n\t\treturn mysqlDatetimeText(text);\n\t} catch {\n\t\treturn;\n\t}\n}\nconst readDatetime = (json) => typeof json === \"string\" && storedDatetime(json) !== void 0 ? json : refuseJsonValue(\"mysql/datetime\", \"ISO 8601 date and time text without a UTC offset, as in \\\"2024-01-01T00:00:00\\\"\", json);\nconst spellDatetime = (json) => typeof json === \"string\" ? storedDatetime(json) ?? json : json;\nconst mysqlDatetime = sqlDataType(\"mysql/datetime\", {\n\tparams: mysqlDatetimeParams,\n\ttexts: [{\n\t\ttext: \"datetime\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}, {\n\t\ttext: \"datetime({precision})\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread: readDatetime,\n\tspell: spellDatetime,\n\tnormalize: ({ precision, ...rest }) => precision === 0 ? rest : {\n\t\t...rest,\n\t\tprecision\n\t},\n\tcasts: {}\n});\n/** The members of a native enum column, in the order they are declared. */\nconst mysqlEnumParams = type({ \"values?\": \"string[]\" });\n/** `enum('A','B')`, the text MySQL's catalog prints for the column type, with each member a quoted literal. */\nfunction renderMysqlEnumType(values) {\n\tif (values === void 0 || values.length === 0) throw mysqlError(\"CONTRACT.TYPE_PARAMS_INVALID\", \"A MySQL enum column type needs at least one member.\", {\n\t\twhy: \"A native enum column is written with its members, and this column has none.\",\n\t\tfix: \"Type the column with a PSL enum or an enumType() that declares its members.\",\n\t\tmeta: { dataType: \"mysql/enum\" }\n\t});\n\treturn `enum(${values.map(quoteLiteral).join(\",\")})`;\n}\nconst readEnumMember = (json, params) => {\n\tconst member = readJsonString(\"mysql/enum\", json);\n\tconst values = params[\"values\"];\n\tif (Array.isArray(values) && !values.includes(member)) return refuseJsonValue(\"mysql/enum\", `one of the members ${values.join(\", \")}`, json);\n\treturn json;\n};\n/**\n* A native MySQL enum. Its name is the catalog text `enum('A','B')`, so `db verify` compares the members and their order with what MySQL reports (ADR 273). A column's members are its value set's, written into its parameters by the target's namespace (see `mysql-database.ts`).\n*/\nconst mysqlEnum = sqlDataType(\"mysql/enum\", {\n\tparams: mysqlEnumParams,\n\tnameIsCatalogText: true,\n\trender: ({ values }) => renderMysqlEnumType(values),\n\tread: readEnumMember,\n\tcasts: fromText\n});\n/** Every data type this target registers. */\nconst mysqlDataTypes = [\n\tmysqlText,\n\tmysqlInt,\n\tmysqlBigint,\n\tmysqlVarchar,\n\tmysqlChar,\n\tmysqlDatetime,\n\tmysqlEnum,\n\tsqlRawDataType\n];\n/** MySQL's text data types, which a SQL discriminator column may have. */\nconst mysqlTextDataTypes = [\n\tmysqlText.id,\n\tmysqlVarchar.id,\n\tmysqlChar.id\n];\n//#endregion\nexport { mysqlDatetime as a, mysqlEnum as c, mysqlText as d, mysqlTextDataTypes as f, renderMysqlEnumType as h, mysqlDataTypes as i, mysqlEnumParams as l, mysqlVarcharParams as m, mysqlChar as n, mysqlDatetimeParams as o, mysqlVarchar as p, mysqlCharParams as r, mysqlDatetimeText as s, mysqlBigint as t, mysqlInt as u };\n\n//# sourceMappingURL=data-types-Dv9gwVRV.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,aAAa,UAAU;AAC7B,SAAS,WAAW,OAAO,UAAU;CACpC,MAAM,gBAAgB,yBAAyB,YAAY,SAAS,QAAQ,KAAK,UAAU,KAAK,EAAE,IAAI;EACrG,KAAK;EACL,KAAK;CACN,CAAC;AACF;AACA,MAAM,iBAAiB,UAAU,OAAO,UAAU,WAAW,YAAY,KAAK,IAAI,WAAW,OAAO,UAAU;AAC9G,SAAS,aAAa,QAAQ,MAAM;CACnC,MAAM,QAAQ,OAAO;CACrB,OAAO,OAAO,UAAU,WAAW,QAAQ,KAAK;AACjD;;AAEA,SAAS,iBAAiB,OAAO,MAAM,QAAQ;CAC9C,MAAM,OAAO,eAAe,OAAO,IAAI;CACvC,IAAI,WAAW,KAAK,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,SAAS,QAAQ,OAAO,gBAAgB,OAAO,uBAAuB,OAAO,GAAG,WAAW,IAAI,cAAc,gBAAgB,IAAI;CACpK,OAAO;AACR;AACA,MAAM,YAAY,YAAY,cAAc;CAC3C,OAAO,CAAC;EACP,MAAM;EACN,SAAS;EACT,SAAS;CACV,CAAC;CACD,OAAO,SAAS,eAAe,cAAc,IAAI;CACjD,OAAO,CAAC;AACT,CAAC;AACD,MAAM,WAAW,GAAG,UAAU,KAAK,UAAU;;AAE7C,MAAM,WAAW,YAAY,aAAa;CACzC,OAAO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;AACD;;AAEA,MAAM,qBAAqB;CAC1B,UAAU;CACV,aAAa;CACb,UAAU;AACX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-types-SXrh0Lou.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/data-types.d.mts"],"mappings":";;;;iBAGiB,wBAAwB,SAAS,eAAe"}
|