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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +20 -2
  3. package/dist/adapter-_WBomuTw.d.mts +27 -0
  4. package/dist/adapter-_WBomuTw.d.mts.map +1 -0
  5. package/dist/adapter.d.mts +6 -0
  6. package/dist/adapter.mjs +3 -0
  7. package/dist/adapter__adapter.d.mts +2 -0
  8. package/dist/adapter__adapter.mjs +2 -0
  9. package/dist/adapter__codec-types.d.mts +3 -0
  10. package/dist/adapter__codec-types.mjs +1 -0
  11. package/dist/adapter__control.d.mts +2 -0
  12. package/dist/adapter__control.mjs +2 -0
  13. package/dist/adapter__runtime.d.mts +2 -0
  14. package/dist/adapter__runtime.mjs +417 -0
  15. package/dist/adapter__runtime.mjs.map +1 -0
  16. package/dist/codec-descriptor-DXyubAS6-siA0R8Ow.d.mts +43 -0
  17. package/dist/codec-descriptor-DXyubAS6-siA0R8Ow.d.mts.map +1 -0
  18. package/dist/codec-descriptor-Du6DSz-3-ytBCu_mq.mjs +93 -0
  19. package/dist/codec-descriptor-Du6DSz-3-ytBCu_mq.mjs.map +1 -0
  20. package/dist/codec-descriptor-J3TP08l8-ekLvUVxW.d.mts +1 -0
  21. package/dist/codec-descriptor-oLRh9E29.d.mts +2 -0
  22. package/dist/codec-ids-BHUwoNOM.d.mts +2 -0
  23. package/dist/codec-ids-C00hAFkc.mjs +2 -0
  24. package/dist/codec-ids-cjxtOcLM-vFeQhgPm.mjs +10 -0
  25. package/dist/codec-ids-cjxtOcLM-vFeQhgPm.mjs.map +1 -0
  26. package/dist/codec-ids-sMOU8F-B-BQbCq2dr.d.mts +10 -0
  27. package/dist/codec-ids-sMOU8F-B-BQbCq2dr.d.mts.map +1 -0
  28. package/dist/codec-types-Bd7DL1Mr-CZWNfnp9.d.mts +21 -0
  29. package/dist/codec-types-Bd7DL1Mr-CZWNfnp9.d.mts.map +1 -0
  30. package/dist/codec-types-Bo3Jfilx.d.mts +1 -0
  31. package/dist/codec-types-Ja2kLzLS.d.mts +1 -0
  32. package/dist/codecs-C00kjHgh.mjs +282 -0
  33. package/dist/codecs-C00kjHgh.mjs.map +1 -0
  34. package/dist/codecs-CO_VNEYU-CwAnKzRs.d.mts +102 -0
  35. package/dist/codecs-CO_VNEYU-CwAnKzRs.d.mts.map +1 -0
  36. package/dist/codecs-DM61agRr.d.mts +21 -0
  37. package/dist/codecs-DM61agRr.d.mts.map +1 -0
  38. package/dist/contract-contributions-B9njRJbt-ClEtrK2L.mjs +14 -0
  39. package/dist/contract-contributions-B9njRJbt-ClEtrK2L.mjs.map +1 -0
  40. package/dist/contract-free-BvCdx_Ee.mjs +71 -0
  41. package/dist/contract-free-BvCdx_Ee.mjs.map +1 -0
  42. package/dist/contract-free-Cw9Mjcro.d.mts +22 -0
  43. package/dist/contract-free-Cw9Mjcro.d.mts.map +1 -0
  44. package/dist/control-C9zxRXNN.mjs +74 -0
  45. package/dist/control-C9zxRXNN.mjs.map +1 -0
  46. package/dist/control-DHkZbo58.d.mts +25 -0
  47. package/dist/control-DHkZbo58.d.mts.map +1 -0
  48. package/dist/control-Ez_PtlFI.d.mts +121 -0
  49. package/dist/control-Ez_PtlFI.d.mts.map +1 -0
  50. package/dist/control-WTY7Jpxk.mjs +577 -0
  51. package/dist/control-WTY7Jpxk.mjs.map +1 -0
  52. package/dist/control-_4epnrIW.d.mts +27 -0
  53. package/dist/control-_4epnrIW.d.mts.map +1 -0
  54. package/dist/control-tables-CHw2F-rg.d.mts +9 -0
  55. package/dist/control-tables-CHw2F-rg.d.mts.map +1 -0
  56. package/dist/control-tables-CcQ77JE7-CxTQYoQJ.mjs +9 -0
  57. package/dist/control-tables-CcQ77JE7-CxTQYoQJ.mjs.map +1 -0
  58. package/dist/data-type-entries-B0AoBozh-f9AEUIUQ.mjs +42 -0
  59. package/dist/data-type-entries-B0AoBozh-f9AEUIUQ.mjs.map +1 -0
  60. package/dist/data-types-BpihGKoK-BMW-m4EN.d.mts +52 -0
  61. package/dist/data-types-BpihGKoK-BMW-m4EN.d.mts.map +1 -0
  62. package/dist/data-types-Dv9gwVRV-BZPzCWZk.mjs +181 -0
  63. package/dist/data-types-Dv9gwVRV-BZPzCWZk.mjs.map +1 -0
  64. package/dist/data-types-SXrh0Lou.d.mts +8 -0
  65. package/dist/data-types-SXrh0Lou.d.mts.map +1 -0
  66. package/dist/ddl-CT6DPEqg.d.mts +1 -0
  67. package/dist/ddl-DDmMHyA_-Bb8sXoS0.mjs +12 -0
  68. package/dist/ddl-DDmMHyA_-Bb8sXoS0.mjs.map +1 -0
  69. package/dist/default-normalizer-BBhGpw7r.d.mts +27 -0
  70. package/dist/default-normalizer-BBhGpw7r.d.mts.map +1 -0
  71. package/dist/default-normalizer-BDUgHXUn-Xk7HQJuI.mjs +90 -0
  72. package/dist/default-normalizer-BDUgHXUn-Xk7HQJuI.mjs.map +1 -0
  73. package/dist/descriptor-meta-BurjcSiU-Cbk2L1jf.mjs +82 -0
  74. package/dist/descriptor-meta-BurjcSiU-Cbk2L1jf.mjs.map +1 -0
  75. package/dist/descriptor-meta-runtime-Bk_00UrX-BLN4Ahpj.mjs +17 -0
  76. package/dist/descriptor-meta-runtime-Bk_00UrX-BLN4Ahpj.mjs.map +1 -0
  77. package/dist/driver.d.mts +3 -0
  78. package/dist/driver.mjs +2 -0
  79. package/dist/driver__control.d.mts +2 -0
  80. package/dist/driver__control.mjs +2 -0
  81. package/dist/driver__runtime.d.mts +2 -0
  82. package/dist/driver__runtime.mjs +325 -0
  83. package/dist/driver__runtime.mjs.map +1 -0
  84. package/dist/errors-BYhjQT7y.d.mts +10 -0
  85. package/dist/errors-BYhjQT7y.d.mts.map +1 -0
  86. package/dist/errors-rvH_F2Yj-BQrO_--u.mjs +20 -0
  87. package/dist/errors-rvH_F2Yj-BQrO_--u.mjs.map +1 -0
  88. package/dist/marker-lock-CmGvN4hw-Com29AtQ.mjs +51 -0
  89. package/dist/marker-lock-CmGvN4hw-Com29AtQ.mjs.map +1 -0
  90. package/dist/marker-lock-su6IxinO.d.mts +18 -0
  91. package/dist/marker-lock-su6IxinO.d.mts.map +1 -0
  92. package/dist/marker-read-aEaHihYj-Cyg16yn1.mjs +78 -0
  93. package/dist/marker-read-aEaHihYj-Cyg16yn1.mjs.map +1 -0
  94. package/dist/migration-DmlblTTw.d.mts +284 -0
  95. package/dist/migration-DmlblTTw.d.mts.map +1 -0
  96. package/dist/migration-tFuoN9GB.mjs +5 -0
  97. package/dist/mysql-contract-serializer-DLv0uW_f-Cg4A43Ry.mjs +160 -0
  98. package/dist/mysql-contract-serializer-DLv0uW_f-Cg4A43Ry.mjs.map +1 -0
  99. package/dist/nodes-CvcX47ot-B-ZaUYRj.mjs +25 -0
  100. package/dist/nodes-CvcX47ot-B-ZaUYRj.mjs.map +1 -0
  101. package/dist/nodes-xc0cR0_c-2YbhgEjb.d.mts +27 -0
  102. package/dist/nodes-xc0cR0_c-2YbhgEjb.d.mts.map +1 -0
  103. package/dist/pack-YVG-iBMQ.d.mts +1073 -0
  104. package/dist/pack-YVG-iBMQ.d.mts.map +1 -0
  105. package/dist/planner-target-details-D6g2uSp--C5NKHmCc.d.mts +12 -0
  106. package/dist/planner-target-details-D6g2uSp--C5NKHmCc.d.mts.map +1 -0
  107. package/dist/runner-C4r6yEd1-BWQrxW9q.mjs +1644 -0
  108. package/dist/runner-C4r6yEd1-BWQrxW9q.mjs.map +1 -0
  109. package/dist/runtime-BGyTXcQH.d.mts +36 -0
  110. package/dist/runtime-BGyTXcQH.d.mts.map +1 -0
  111. package/dist/runtime-CeuRr9nE.d.mts +29 -0
  112. package/dist/runtime-CeuRr9nE.d.mts.map +1 -0
  113. package/dist/runtime-Cl0BbTZq.d.mts +22 -0
  114. package/dist/runtime-Cl0BbTZq.d.mts.map +1 -0
  115. package/dist/sql-utils-BOS1c2QT.d.mts +30 -0
  116. package/dist/sql-utils-BOS1c2QT.d.mts.map +1 -0
  117. package/dist/sql-utils-Db0IQO_B-PaULnfrE.mjs +30 -0
  118. package/dist/sql-utils-Db0IQO_B-PaULnfrE.mjs.map +1 -0
  119. package/dist/sql-utils-RW0vJvDl.mjs +94 -0
  120. package/dist/sql-utils-RW0vJvDl.mjs.map +1 -0
  121. package/dist/statement-A6bbPBf1-q61iHQLb.mjs +483 -0
  122. package/dist/statement-A6bbPBf1-q61iHQLb.mjs.map +1 -0
  123. package/dist/target.d.mts +24 -0
  124. package/dist/target.mjs +19 -0
  125. package/dist/target__codec-descriptor.d.mts +3 -0
  126. package/dist/target__codec-descriptor.mjs +2 -0
  127. package/dist/target__codec-ids.d.mts +3 -0
  128. package/dist/target__codec-ids.mjs +3 -0
  129. package/dist/target__codec-types.d.mts +3 -0
  130. package/dist/target__codec-types.mjs +1 -0
  131. package/dist/target__codecs.d.mts +3 -0
  132. package/dist/target__codecs.mjs +2 -0
  133. package/dist/target__contract-free.d.mts +2 -0
  134. package/dist/target__contract-free.mjs +3 -0
  135. package/dist/target__control-tables.d.mts +2 -0
  136. package/dist/target__control-tables.mjs +2 -0
  137. package/dist/target__control.d.mts +3 -0
  138. package/dist/target__control.mjs +58 -0
  139. package/dist/target__control.mjs.map +1 -0
  140. package/dist/target__data-types.d.mts +3 -0
  141. package/dist/target__data-types.mjs +3 -0
  142. package/dist/target__ddl.d.mts +3 -0
  143. package/dist/target__ddl.mjs +2 -0
  144. package/dist/target__default-normalizer.d.mts +2 -0
  145. package/dist/target__default-normalizer.mjs +2 -0
  146. package/dist/target__errors.d.mts +2 -0
  147. package/dist/target__errors.mjs +2 -0
  148. package/dist/target__marker-lock.d.mts +2 -0
  149. package/dist/target__marker-lock.mjs +2 -0
  150. package/dist/target__migration.d.mts +2 -0
  151. package/dist/target__migration.mjs +3 -0
  152. package/dist/target__pack.d.mts +2 -0
  153. package/dist/target__pack.mjs +2 -0
  154. package/dist/target__runtime.d.mts +2 -0
  155. package/dist/target__runtime.mjs +17 -0
  156. package/dist/target__runtime.mjs.map +1 -0
  157. package/dist/target__sql-utils.d.mts +2 -0
  158. package/dist/target__sql-utils.mjs +3 -0
  159. package/package.json +71 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-descriptor-Du6DSz-3-ytBCu_mq.mjs","names":["#descriptors"],"sources":["../../../../3-targets/mysql/1-target/dist/codec-descriptor-Du6DSz-3.mjs"],"sourcesContent":["import { CodecDescriptorImpl, validateCodecTypeParams } from \"@internal/framework-components/codec\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/core/codec-descriptor.ts\nconst MYSQL_CODEC_DESCRIPTOR_KIND = \"mysql-codec\";\n/**\n* A codec descriptor the MySQL target registers. `jsonProjection` writes a column into the JSON an include reads, in the form the codec's `fromWire` reads from a row.\n*/\nvar MysqlCodecDescriptor = class extends CodecDescriptorImpl {\n\tdescriptorKind = MYSQL_CODEC_DESCRIPTOR_KIND;\n\tprojectJson(expression, ref) {\n\t\tif (ref.many === true) throw structuredError(\"RUNTIME.CODEC_DESCRIPTOR_ARRAY_UNSUPPORTED\", `Codec '${ref.codecId}' uses CodecRef.many, but MySQL has no stored scalar arrays.`, {\n\t\t\twhy: \"MySQL codec descriptors project scalar values only.\",\n\t\t\tfix: \"Use a scalar CodecRef.\",\n\t\t\tmeta: { codecId: ref.codecId }\n\t\t});\n\t\treturn this.jsonProjection(expression, blindCast(validateCodecTypeParams(this, ref)));\n\t}\n};\nvar MysqlCodecDescriptorAdapter = class extends MysqlCodecDescriptor {\n\toptions;\n\tdataType;\n\tcodecId;\n\ttraits;\n\tparamsSchema;\n\trenderValueLiteral;\n\tconstructor(descriptor, options) {\n\t\tsuper();\n\t\tthis.options = options;\n\t\tthis.dataType = options.dataType.id;\n\t\tthis.codecId = descriptor.codecId;\n\t\tthis.traits = descriptor.traits;\n\t\tthis.paramsSchema = blindCast(options.dataType.params);\n\t\tif (descriptor.renderValueLiteral !== void 0) throw new InternalError(`${descriptor.codecId} is a family codec template with its own renderValueLiteral; pass renderValueLiteral in the options instead.`);\n\t\tif (options.renderValueLiteral !== void 0) this.renderValueLiteral = options.renderValueLiteral;\n\t}\n\tfactory = (params) => this.options.factory(this, this.options.dataType, params);\n\tjsonProjection(expression, params) {\n\t\treturn this.options.jsonProjection(expression, params);\n\t}\n};\n/** Adapts a family codec template to MySQL, naming the MySQL data type it represents. */\nfunction mysqlCodec(descriptor, options) {\n\treturn blindCast(new MysqlCodecDescriptorAdapter(descriptor, options));\n}\nfunction isMysqlCodecDescriptor(value) {\n\treturn typeof value === \"object\" && value !== null && \"descriptorKind\" in value && value.descriptorKind === MYSQL_CODEC_DESCRIPTOR_KIND && \"codecId\" in value && typeof value.codecId === \"string\" && \"factory\" in value && typeof value.factory === \"function\" && \"projectJson\" in value && typeof value.projectJson === \"function\";\n}\nvar MysqlCodecDescriptorRegistryImpl = class {\n\t#descriptors;\n\tconstructor(descriptors) {\n\t\tthis.#descriptors = descriptors;\n\t\tObject.freeze(this);\n\t}\n\tdescriptorFor(codecId) {\n\t\treturn this.#descriptors.get(codecId);\n\t}\n\t*values() {\n\t\tyield* this.#descriptors.values();\n\t}\n};\n/** Indexes MySQL codec descriptors by codec id, refusing a descriptor that is not a MySQL one and a codec id given twice. */\nfunction buildMysqlCodecDescriptorRegistry(descriptors) {\n\tconst byId = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tif (!isMysqlCodecDescriptor(descriptor)) {\n\t\t\tconst codecId = candidateCodecId(descriptor);\n\t\t\tthrow structuredError(\"RUNTIME.CODEC_DESCRIPTOR_INVALID\", `Codec descriptor '${codecId}' is not a valid MySQL codec descriptor.`, {\n\t\t\t\twhy: \"MySQL codec registries require the mysql-codec discriminant and the MySQL descriptor methods.\",\n\t\t\t\tfix: \"Extend MysqlCodecDescriptor or adapt a family descriptor with mysqlCodec().\",\n\t\t\t\tmeta: { codecId }\n\t\t\t});\n\t\t}\n\t\tif (byId.has(descriptor.codecId)) throw structuredError(\"RUNTIME.DUPLICATE_CODEC\", `Duplicate MySQL codec descriptor id '${descriptor.codecId}'.`, {\n\t\t\twhy: \"Each codecId must resolve to exactly one MySQL descriptor during registry composition.\",\n\t\t\tfix: \"Remove the duplicate target, adapter, or extension contribution.\",\n\t\t\tmeta: {\n\t\t\t\tcodecId: descriptor.codecId,\n\t\t\t\ttarget: \"mysql\"\n\t\t\t}\n\t\t});\n\t\tbyId.set(descriptor.codecId, descriptor);\n\t}\n\treturn new MysqlCodecDescriptorRegistryImpl(byId);\n}\nfunction candidateCodecId(value) {\n\treturn typeof value === \"object\" && value !== null && \"codecId\" in value && typeof value.codecId === \"string\" ? value.codecId : \"<unknown>\";\n}\n//#endregion\nexport { mysqlCodec as i, buildMysqlCodecDescriptorRegistry as n, isMysqlCodecDescriptor as r, MysqlCodecDescriptor as t };\n\n//# sourceMappingURL=codec-descriptor-Du6DSz-3.mjs.map"],"mappings":";;;;;AAKA,MAAM,8BAA8B;;;;AAIpC,IAAI,uBAAuB,cAAc,oBAAoB;CAC5D,iBAAiB;CACjB,YAAY,YAAY,KAAK;EAC5B,IAAI,IAAI,SAAS,MAAM,MAAM,gBAAgB,8CAA8C,UAAU,IAAI,QAAQ,+DAA+D;GAC/K,KAAK;GACL,KAAK;GACL,MAAM,EAAE,SAAS,IAAI,QAAQ;EAC9B,CAAC;EACD,OAAO,KAAK,eAAe,YAAY,UAAU,wBAAwB,MAAM,GAAG,CAAC,CAAC;CACrF;AACD;AACA,IAAI,8BAA8B,cAAc,qBAAqB;CACpE;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,YAAY,SAAS;EAChC,MAAM;EACN,KAAK,UAAU;EACf,KAAK,WAAW,QAAQ,SAAS;EACjC,KAAK,UAAU,WAAW;EAC1B,KAAK,SAAS,WAAW;EACzB,KAAK,eAAe,UAAU,QAAQ,SAAS,MAAM;EACrD,IAAI,WAAW,uBAAuB,KAA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GACT;EACD,CAAC;EACD,KAAK,IAAI,WAAW,SAAS,UAAU;CACxC;CACA,OAAO,IAAI,iCAAiC,IAAI;AACjD;AACA,SAAS,iBAAiB,OAAO;CAChC,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,aAAa,SAAS,OAAO,MAAM,YAAY,WAAW,MAAM,UAAU;AACjI"}
@@ -0,0 +1 @@
1
+ import "./codec-descriptor-DXyubAS6-siA0R8Ow.mjs";
@@ -0,0 +1,2 @@
1
+ import "./codec-descriptor-DXyubAS6-siA0R8Ow.mjs";
2
+ import "./codec-descriptor-J3TP08l8-ekLvUVxW.mjs";
@@ -0,0 +1,2 @@
1
+ import { SQL_CHAR_CODEC_ID, SQL_RAW_CODEC_ID, SQL_VARCHAR_CODEC_ID as SQL_VARCHAR_CODEC_ID$1 } from "@prisma/orm-family-sql/relational-core/ast";
2
+ export { SQL_RAW_CODEC_ID as n, SQL_VARCHAR_CODEC_ID$1 as r, SQL_CHAR_CODEC_ID as t };
@@ -0,0 +1,2 @@
1
+ import { SQL_CHAR_CODEC_ID, SQL_RAW_CODEC_ID, SQL_VARCHAR_CODEC_ID as SQL_VARCHAR_CODEC_ID$1 } from "@prisma/orm-family-sql/relational-core/ast";
2
+ export { SQL_RAW_CODEC_ID as n, SQL_VARCHAR_CODEC_ID$1 as r, SQL_CHAR_CODEC_ID as t };
@@ -0,0 +1,10 @@
1
+ //#region ../../../3-targets/mysql/1-target/dist/codec-ids-cjxtOcLM.mjs
2
+ const MYSQL_INT_CODEC_ID = "mysql/int@1";
3
+ const MYSQL_BIGINT_CODEC_ID = "mysql/bigint@1";
4
+ const MYSQL_TEXT_CODEC_ID = "mysql/text@1";
5
+ const MYSQL_DATETIME_CODEC_ID = "mysql/datetime@1";
6
+ const MYSQL_ENUM_CODEC_ID = "mysql/enum@1";
7
+ //#endregion
8
+ export { MYSQL_TEXT_CODEC_ID as a, MYSQL_INT_CODEC_ID as i, MYSQL_DATETIME_CODEC_ID as n, MYSQL_ENUM_CODEC_ID as r, MYSQL_BIGINT_CODEC_ID as t };
9
+
10
+ //# sourceMappingURL=codec-ids-cjxtOcLM-vFeQhgPm.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-ids-cjxtOcLM-vFeQhgPm.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/codec-ids-cjxtOcLM.mjs"],"sourcesContent":["//#region src/core/codec-ids.ts\nconst MYSQL_INT_CODEC_ID = \"mysql/int@1\";\nconst MYSQL_BIGINT_CODEC_ID = \"mysql/bigint@1\";\nconst MYSQL_TEXT_CODEC_ID = \"mysql/text@1\";\nconst MYSQL_DATETIME_CODEC_ID = \"mysql/datetime@1\";\nconst MYSQL_ENUM_CODEC_ID = \"mysql/enum@1\";\n//#endregion\nexport { MYSQL_TEXT_CODEC_ID as a, MYSQL_INT_CODEC_ID as i, MYSQL_DATETIME_CODEC_ID as n, MYSQL_ENUM_CODEC_ID as r, MYSQL_BIGINT_CODEC_ID as t };\n\n//# sourceMappingURL=codec-ids-cjxtOcLM.mjs.map"],"mappings":";AACA,MAAM,qBAAqB;AAC3B,MAAM,wBAAwB;AAC9B,MAAM,sBAAsB;AAC5B,MAAM,0BAA0B;AAChC,MAAM,sBAAsB"}
@@ -0,0 +1,10 @@
1
+ //#region ../../../3-targets/mysql/1-target/dist/codec-ids-sMOU8F-B.d.mts
2
+ //#region src/core/codec-ids.d.ts
3
+ declare const MYSQL_INT_CODEC_ID: "mysql/int@1";
4
+ declare const MYSQL_BIGINT_CODEC_ID: "mysql/bigint@1";
5
+ declare const MYSQL_TEXT_CODEC_ID: "mysql/text@1";
6
+ declare const MYSQL_DATETIME_CODEC_ID: "mysql/datetime@1";
7
+ declare const MYSQL_ENUM_CODEC_ID: "mysql/enum@1";
8
+ //#endregion
9
+ export { MYSQL_TEXT_CODEC_ID as a, MYSQL_INT_CODEC_ID as i, MYSQL_DATETIME_CODEC_ID as n, MYSQL_ENUM_CODEC_ID as r, MYSQL_BIGINT_CODEC_ID as t };
10
+ //# sourceMappingURL=codec-ids-sMOU8F-B-BQbCq2dr.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-ids-sMOU8F-B-BQbCq2dr.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/codec-ids-sMOU8F-B.d.mts"],"mappings":";;cACc;cACA;cACA;cACA;cACA"}
@@ -0,0 +1,21 @@
1
+ import { t as AdaptedMysqlCodecDescriptor } from "./codec-descriptor-DXyubAS6-siA0R8Ow.mjs";
2
+ import "./codec-descriptor-J3TP08l8-ekLvUVxW.mjs";
3
+ import { a as MysqlTextDescriptor, i as MysqlIntDescriptor, n as MysqlDatetimeDescriptor, r as MysqlEnumDescriptor, t as MysqlBigintDescriptor } from "./codecs-CO_VNEYU-CwAnKzRs.mjs";
4
+ import { ExtractCodecTypes } from "@prisma/orm-family-sql/relational-core/ast";
5
+ //#region ../../../3-targets/mysql/1-target/dist/codec-types-Bd7DL1Mr.d.mts
6
+ //#region src/exports/codec-types.d.ts
7
+ declare const codecDescriptorMap: {
8
+ readonly char: AdaptedMysqlCodecDescriptor<import("@prisma/orm-family-sql/relational-core/ast").SqlCharDescriptor>;
9
+ readonly varchar: AdaptedMysqlCodecDescriptor<import("@prisma/orm-family-sql/relational-core/ast").SqlVarcharDescriptor>;
10
+ readonly raw: AdaptedMysqlCodecDescriptor<import("@prisma/orm-family-sql/relational-core/ast").SqlRawDescriptor>;
11
+ readonly text: MysqlTextDescriptor;
12
+ readonly int: MysqlIntDescriptor;
13
+ readonly bigint: MysqlBigintDescriptor;
14
+ readonly datetime: MysqlDatetimeDescriptor;
15
+ readonly enum: MysqlEnumDescriptor;
16
+ };
17
+ type Resolve<T> = { readonly [K in keyof T]: { readonly [P in keyof T[K]]: T[K][P]; }; };
18
+ type CodecTypes = Resolve<ExtractCodecTypes<typeof codecDescriptorMap>>;
19
+ //#endregion
20
+ export { CodecTypes as t };
21
+ //# sourceMappingURL=codec-types-Bd7DL1Mr-CZWNfnp9.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-types-Bd7DL1Mr-CZWNfnp9.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/codec-types-Bd7DL1Mr.d.mts"],"mappings":";;;;;;cAKc;WACH,MAAM,wEAAwE;WAC9E,SAAS,wEAAwE;WACjF,KAAK,wEAAwE;WAC7E,MAAM;WACN,KAAK;WACL,QAAQ;WACR,UAAU;WACV,MAAM;;KAEZ,QAAQ,iBAAiB,WAAW,gBAAgB,WAAW,EAAE,KAAK,EAAE,GAAG;KAC3E,aAAa,QAAQ,yBAAyB"}
@@ -0,0 +1 @@
1
+ import "./codec-types-Ja2kLzLS.mjs";
@@ -0,0 +1 @@
1
+ import "./codec-types-Bd7DL1Mr-CZWNfnp9.mjs";
@@ -0,0 +1,282 @@
1
+ import { i as mysqlCodec, n as buildMysqlCodecDescriptorRegistry, t as MysqlCodecDescriptor } from "./codec-descriptor-Du6DSz-3-ytBCu_mq.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-cjxtOcLM-vFeQhgPm.mjs";
3
+ import { n as mysqlQueryNotYetSupported, t as mysqlError } from "./errors-rvH_F2Yj-BQrO_--u.mjs";
4
+ import { 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-BZPzCWZk.mjs";
5
+ import { CodecImpl, decimalTextBigintLiteral, refuseJsonValue, renderTsLiteral } from "@prisma/orm-framework/components/codec";
6
+ import { CastExpr, SqlCharCodec, SqlRawCodec, SqlVarcharCodec, sqlCharDescriptor, sqlRawDescriptor, sqlVarcharDescriptor } from "@prisma/orm-family-sql/relational-core/ast";
7
+ import { sqlRawDataType } from "@prisma/orm-family-sql/contract/data-type";
8
+ import { extractCodecLookup } from "@prisma/orm-framework/components/control";
9
+ import { buildCodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/codec-descriptor-registry";
10
+ //#region ../../../3-targets/mysql/1-target/dist/codecs.mjs
11
+ const DECIMAL_INTEGER = /^-?\d+$/;
12
+ const BIGINT_MIN = -(2n ** 63n);
13
+ const BIGINT_MAX = 2n ** 63n - 1n;
14
+ /** Projects a column whose JSON form, a number or a string, is what its `fromWire` reads. */
15
+ const identityJsonProjection = (expression) => expression;
16
+ /** Projects a bigint as its decimal text: a JSON number past 2^53 would lose digits when JavaScript parses the include. */
17
+ const textJsonProjection = (expression) => CastExpr.as(expression, "CHAR");
18
+ function decodeFailed(codecId, expected, received) {
19
+ throw mysqlError("RUNTIME.DECODE_FAILED", `${codecId} wire value must be ${expected}`, { meta: {
20
+ codecId,
21
+ received: String(received)
22
+ } });
23
+ }
24
+ function encodeFailed(codecId, expected, received) {
25
+ throw mysqlError("RUNTIME.ENCODE_FAILED", `${codecId} value must be ${expected}`, { meta: {
26
+ codecId,
27
+ received: String(received)
28
+ } });
29
+ }
30
+ const mysqlSqlCharDescriptor = mysqlCodec(sqlCharDescriptor, {
31
+ dataType: mysqlChar,
32
+ renderValueLiteral: renderTsLiteral,
33
+ jsonProjection: identityJsonProjection,
34
+ factory: (descriptor, dataType, params) => () => new SqlCharCodec(descriptor, dataType, params)
35
+ });
36
+ const mysqlSqlVarcharDescriptor = mysqlCodec(sqlVarcharDescriptor, {
37
+ dataType: mysqlVarchar,
38
+ renderValueLiteral: renderTsLiteral,
39
+ jsonProjection: identityJsonProjection,
40
+ factory: (descriptor, dataType, params) => () => new SqlVarcharCodec(descriptor, dataType, params)
41
+ });
42
+ const mysqlSqlRawDescriptor = mysqlCodec(sqlRawDescriptor, {
43
+ dataType: sqlRawDataType,
44
+ jsonProjection: () => {
45
+ throw mysqlQueryNotYetSupported("Reading a raw column inside an include");
46
+ },
47
+ factory: (descriptor, dataType, params) => () => new SqlRawCodec(descriptor, dataType, params)
48
+ });
49
+ var MysqlTextCodec = class extends CodecImpl {
50
+ async toWire(value, _ctx) {
51
+ return value;
52
+ }
53
+ async fromWire(wire, _ctx) {
54
+ return wire;
55
+ }
56
+ fromDataTypeValue(value) {
57
+ return value.value;
58
+ }
59
+ toDataTypeValue(input) {
60
+ return this.dataTypeValueOf(input);
61
+ }
62
+ };
63
+ var MysqlTextDescriptor = class extends MysqlCodecDescriptor {
64
+ dataType = mysqlText.id;
65
+ codecId = MYSQL_TEXT_CODEC_ID;
66
+ traits = [
67
+ "equality",
68
+ "order",
69
+ "textual"
70
+ ];
71
+ paramsSchema = void 0;
72
+ renderValueLiteral(value) {
73
+ return renderTsLiteral(value);
74
+ }
75
+ jsonProjection(expression) {
76
+ return identityJsonProjection(expression);
77
+ }
78
+ factory() {
79
+ return () => new MysqlTextCodec(this, mysqlText);
80
+ }
81
+ };
82
+ const mysqlTextDescriptor = new MysqlTextDescriptor();
83
+ /** A MySQL `int` as a JavaScript number. A row carries it as decimal text, and an include's JSON as a number. */
84
+ var MysqlIntCodec = class extends CodecImpl {
85
+ async toWire(value, _ctx) {
86
+ if (!Number.isSafeInteger(value)) return encodeFailed(MYSQL_INT_CODEC_ID, "an integer", value);
87
+ return value;
88
+ }
89
+ async fromWire(wire, _ctx) {
90
+ if (typeof wire === "number") return wire;
91
+ if (!DECIMAL_INTEGER.test(wire)) return decodeFailed(MYSQL_INT_CODEC_ID, "the decimal text of an integer", wire);
92
+ return Number(wire);
93
+ }
94
+ fromDataTypeValue(value) {
95
+ return value.value;
96
+ }
97
+ toDataTypeValue(input) {
98
+ return this.dataTypeValueOf(input);
99
+ }
100
+ };
101
+ var MysqlIntDescriptor = class extends MysqlCodecDescriptor {
102
+ dataType = mysqlInt.id;
103
+ codecId = MYSQL_INT_CODEC_ID;
104
+ traits = [
105
+ "equality",
106
+ "order",
107
+ "numeric"
108
+ ];
109
+ paramsSchema = void 0;
110
+ renderValueLiteral(value) {
111
+ return renderTsLiteral(value);
112
+ }
113
+ jsonProjection(expression) {
114
+ return identityJsonProjection(expression);
115
+ }
116
+ factory() {
117
+ return () => new MysqlIntCodec(this, mysqlInt);
118
+ }
119
+ };
120
+ const mysqlIntDescriptor = new MysqlIntDescriptor();
121
+ /** 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. */
122
+ var MysqlBigintCodec = class extends CodecImpl {
123
+ /** 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. */
124
+ async toWire(value, _ctx) {
125
+ if (typeof value !== "bigint" || value < BIGINT_MIN || value > BIGINT_MAX) return encodeFailed(MYSQL_BIGINT_CODEC_ID, `a bigint from ${BIGINT_MIN} to ${BIGINT_MAX}`, value);
126
+ return value;
127
+ }
128
+ async fromWire(wire, _ctx) {
129
+ if (typeof wire === "bigint") return wire;
130
+ if (!DECIMAL_INTEGER.test(wire)) return decodeFailed(MYSQL_BIGINT_CODEC_ID, "the decimal text of an integer", wire);
131
+ return BigInt(wire);
132
+ }
133
+ fromDataTypeValue(value) {
134
+ return BigInt(value.value);
135
+ }
136
+ toDataTypeValue(input) {
137
+ return this.dataTypeValueOf(input.toString());
138
+ }
139
+ };
140
+ var MysqlBigintDescriptor = class extends MysqlCodecDescriptor {
141
+ dataType = mysqlBigint.id;
142
+ codecId = MYSQL_BIGINT_CODEC_ID;
143
+ traits = [
144
+ "equality",
145
+ "order",
146
+ "numeric"
147
+ ];
148
+ paramsSchema = void 0;
149
+ renderValueLiteral(value) {
150
+ return decimalTextBigintLiteral(value);
151
+ }
152
+ jsonProjection(expression) {
153
+ return textJsonProjection(expression);
154
+ }
155
+ factory() {
156
+ return () => new MysqlBigintCodec(this, mysqlBigint);
157
+ }
158
+ };
159
+ const mysqlBigintDescriptor = new MysqlBigintDescriptor();
160
+ const WIRE_DATETIME = /^(\d{4}-\d{2}-\d{2})[ T](\d{2}:\d{2}:\d{2}(?:\.\d+)?)$/;
161
+ /**
162
+ * 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.
163
+ */
164
+ function decodeMysqlDatetime(wire) {
165
+ const match = WIRE_DATETIME.exec(wire);
166
+ const date = match === null ? void 0 : /* @__PURE__ */ new Date(`${match[1]}T${match[2]}Z`);
167
+ if (date === void 0 || Number.isNaN(date.getTime())) return decodeFailed(MYSQL_DATETIME_CODEC_ID, "a date and time as MySQL prints it", wire);
168
+ return date;
169
+ }
170
+ /** The text MySQL reads for an instant in UTC, with millisecond digits. */
171
+ function encodeMysqlDatetime(value) {
172
+ if (Number.isNaN(value.getTime())) return encodeFailed(MYSQL_DATETIME_CODEC_ID, "a valid Date", value);
173
+ return value.toISOString().replace("T", " ").replace("Z", "");
174
+ }
175
+ /** A MySQL `datetime` as a JavaScript `Date`, read and written in UTC. */
176
+ var MysqlDatetimeCodec = class extends CodecImpl {
177
+ async toWire(value, _ctx) {
178
+ return encodeMysqlDatetime(value);
179
+ }
180
+ async fromWire(wire, _ctx) {
181
+ return decodeMysqlDatetime(wire);
182
+ }
183
+ fromDataTypeValue(value) {
184
+ if (/[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);
185
+ return /* @__PURE__ */ new Date(`${value.value}Z`);
186
+ }
187
+ toDataTypeValue(input) {
188
+ return this.dataTypeValueOf(input.toISOString().replace("Z", ""));
189
+ }
190
+ };
191
+ var MysqlDatetimeDescriptor = class extends MysqlCodecDescriptor {
192
+ dataType = mysqlDatetime.id;
193
+ codecId = MYSQL_DATETIME_CODEC_ID;
194
+ traits = ["equality", "order"];
195
+ paramsSchema = mysqlDatetimeParams;
196
+ jsonProjection(expression) {
197
+ return identityJsonProjection(expression);
198
+ }
199
+ factory(params) {
200
+ return () => new MysqlDatetimeCodec(this, mysqlDatetime, params);
201
+ }
202
+ };
203
+ const mysqlDatetimeDescriptor = new MysqlDatetimeDescriptor();
204
+ /** A native MySQL enum column, whose value is the member's text. */
205
+ var MysqlEnumCodec = class extends CodecImpl {
206
+ async toWire(value, _ctx) {
207
+ return value;
208
+ }
209
+ async fromWire(wire, _ctx) {
210
+ return wire;
211
+ }
212
+ fromDataTypeValue(value) {
213
+ return value.value;
214
+ }
215
+ toDataTypeValue(input) {
216
+ return this.dataTypeValueOf(input);
217
+ }
218
+ };
219
+ var MysqlEnumDescriptor = class extends MysqlCodecDescriptor {
220
+ dataType = mysqlEnum.id;
221
+ codecId = MYSQL_ENUM_CODEC_ID;
222
+ traits = [
223
+ "equality",
224
+ "order",
225
+ "textual"
226
+ ];
227
+ paramsSchema = mysqlEnumParams;
228
+ renderValueLiteral(value) {
229
+ return renderTsLiteral(value);
230
+ }
231
+ jsonProjection(expression) {
232
+ return identityJsonProjection(expression);
233
+ }
234
+ factory(params) {
235
+ return () => new MysqlEnumCodec(this, mysqlEnum, params);
236
+ }
237
+ };
238
+ /** Every codec descriptor this target ships. */
239
+ const codecDescriptors = [
240
+ mysqlSqlCharDescriptor,
241
+ mysqlSqlVarcharDescriptor,
242
+ mysqlSqlRawDescriptor,
243
+ mysqlTextDescriptor,
244
+ mysqlIntDescriptor,
245
+ mysqlBigintDescriptor,
246
+ mysqlDatetimeDescriptor,
247
+ new MysqlEnumDescriptor()
248
+ ];
249
+ /** Every codec descriptor `@internal/target-mysql` ships, for consumers that enumerate or look up a MySQL codec by id. ADR 208. */
250
+ const mysqlCodecRegistry = buildCodecDescriptorRegistry(codecDescriptors);
251
+ const mysqlCodecDescriptorRegistry = buildMysqlCodecDescriptorRegistry(codecDescriptors);
252
+ function descriptorsFrom(contributors) {
253
+ return contributors.flatMap((contributor) => contributor.types?.codecTypes?.codecDescriptors ?? []);
254
+ }
255
+ function buildMysqlCodecRegistry(descriptors) {
256
+ const descriptorRegistry = buildMysqlCodecDescriptorRegistry(descriptors);
257
+ const registry = {
258
+ ...extractCodecLookup([{
259
+ id: "mysql-codecs",
260
+ types: { codecTypes: { codecDescriptors: Array.from(descriptorRegistry.values()) } }
261
+ }]),
262
+ descriptorFor: (codecId) => descriptorRegistry.descriptorFor(codecId),
263
+ values: () => descriptorRegistry.values()
264
+ };
265
+ return Object.freeze(registry);
266
+ }
267
+ /** The codec registry of a MySQL stack: the target's built-in codecs and those its extensions contribute. */
268
+ function assembleMysqlCodecRegistry(target, extensions) {
269
+ return buildMysqlCodecRegistry([
270
+ ...descriptorsFrom([target]),
271
+ ...mysqlCodecDescriptorRegistry.values(),
272
+ ...descriptorsFrom(extensions)
273
+ ]);
274
+ }
275
+ /** A codec registry of the MySQL built-in codecs only. */
276
+ function createMysqlBuiltinCodecLookup() {
277
+ return buildMysqlCodecRegistry([...mysqlCodecDescriptorRegistry.values()]);
278
+ }
279
+ //#endregion
280
+ export { mysqlCodecDescriptorRegistry as a, encodeMysqlDatetime as i, createMysqlBuiltinCodecLookup as n, mysqlCodecRegistry as o, decodeMysqlDatetime as r, assembleMysqlCodecRegistry as t };
281
+
282
+ //# sourceMappingURL=codecs-C00kjHgh.mjs.map
@@ -0,0 +1 @@
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,MAAM;AACzE,SAAS,aAAa,SAAS,UAAU,UAAU;CAClD,MAAM,WAAW,yBAAyB,GAAG,QAAQ,sBAAsB,YAAY,EAAE,MAAM;EAC9F;EACA,UAAU,OAAO,Q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,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"}
@@ -0,0 +1,102 @@
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
@@ -0,0 +1 @@
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,gBA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AyD;WACzD;WACA;WACA,4DAA4D;IACnE;;EAEF,mBAAmB,OAAO;YAChB,eAAe,YAAY,iBAAiB;EACtD,QAAQ,QAAQ,cAAc,KAAK,yBAAyB"}
@@ -0,0 +1,21 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,14 @@
1
+ //#region ../../../3-targets/mysql/2-adapter/dist/contract-contributions-B9njRJbt.mjs
2
+ /** What a MySQL 8.4 server does that the SQL family asks about. `RETURNING`, `LATERAL` and conflict targets are not among them. */
3
+ const mysqlAdapterCapabilities = Object.freeze({ sql: {
4
+ orderBy: true,
5
+ limit: true,
6
+ foreignKeys: true,
7
+ enums: true
8
+ } });
9
+ /** 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
+ const mysqlAdapterContractContributions = { capabilities: mysqlAdapterCapabilities };
11
+ //#endregion
12
+ export { mysqlAdapterContractContributions as n, mysqlAdapterCapabilities as t };
13
+
14
+ //# sourceMappingURL=contract-contributions-B9njRJbt-ClEtrK2L.mjs.map
@@ -0,0 +1 @@
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"}