@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
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ The concrete MySQL target of Prisma 8: the target descriptor (DDL planning, code
|
|
|
4
4
|
|
|
5
5
|
Applications receive it as an exact-pinned dependency of `@prisma/orm-mysql`; app developers install that facade. Extension authors targeting MySQL and decomposed installs import this package directly.
|
|
6
6
|
|
|
7
|
-
MySQL support is early. This package carries the control plane (emitting contracts, planning and applying migrations, `db verify`, `db sign` and introspection) and the runtime
|
|
7
|
+
MySQL support is early. This package carries the control plane (emitting contracts, planning and applying migrations, `db verify`, `db sign` and introspection) and the runtime: the SQL renderer and the runtime driver, which runs every statement on the `mariadb` package. The package writes each value into the statement with its own escaping, in one round trip, under the session settings the driver sets and checks: no `NO_BACKSLASH_ESCAPES`, and `utf8mb4`. The renderer writes inserts, updates, deletes and upserts (`INSERT … AS new ON DUPLICATE KEY UPDATE`), and refuses `RETURNING`, row locks and `LATERAL` joins.
|
|
8
8
|
|
|
9
9
|
## Entrypoints
|
|
10
10
|
|
|
@@ -16,6 +16,8 @@ MySQL support is early. This package carries the control plane (emitting contrac
|
|
|
16
16
|
|
|
17
17
|
A bare namespace import (e.g. `@prisma/orm-target-mysql/adapter`) aggregates that layer's full surface; deeper paths select individual modules.
|
|
18
18
|
|
|
19
|
+
`temporal-polyfill` is a required peer dependency. Only the `/target/control` entry loads it, as a fallback `Temporal` when the runtime has none; no entry an application loads at run time does. npm, pnpm and bun install it automatically; with Yarn, add `temporal-polyfill` to your dependencies.
|
|
20
|
+
|
|
19
21
|
## Responsibilities
|
|
20
22
|
|
|
21
23
|
Everything MySQL-specific: native type normalization, DDL generation, control tables, and the database connection. Shared SQL semantics live in `@prisma/orm-family-sql`.
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
//#region ../../../3-targets/mysql/2-adapter/dist/adapter.d.mts
|
|
2
2
|
//#region src/core/capabilities.d.ts
|
|
3
|
-
/** What a MySQL 8.4 server does that the SQL family asks about. `RETURNING`, `LATERAL` and conflict targets are not among them. */
|
|
3
|
+
/** What a MySQL 8.4 server does that the SQL family asks about. `RETURNING`, `LATERAL` and conflict targets are not among them: `ON DUPLICATE KEY UPDATE` fires on any unique key. */
|
|
4
4
|
declare const mysqlAdapterCapabilities: Readonly<{
|
|
5
5
|
readonly sql: {
|
|
6
6
|
readonly orderBy: true;
|
|
7
7
|
readonly limit: true;
|
|
8
8
|
readonly foreignKeys: true;
|
|
9
9
|
readonly enums: true;
|
|
10
|
+
readonly defaultInInsert: true;
|
|
10
11
|
};
|
|
11
12
|
}>;
|
|
12
13
|
//#endregion
|
|
@@ -19,9 +20,10 @@ declare const mysqlAdapterContractContributions: {
|
|
|
19
20
|
readonly limit: true;
|
|
20
21
|
readonly foreignKeys: true;
|
|
21
22
|
readonly enums: true;
|
|
23
|
+
readonly defaultInInsert: true;
|
|
22
24
|
};
|
|
23
25
|
}>;
|
|
24
26
|
};
|
|
25
27
|
//#endregion
|
|
26
28
|
export { mysqlAdapterContractContributions as n, mysqlAdapterCapabilities as t };
|
|
27
|
-
//# sourceMappingURL=adapter-
|
|
29
|
+
//# sourceMappingURL=adapter-Dl4Wwz1I.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter-Dl4Wwz1I.d.mts","names":[],"sources":["../../../../3-targets/mysql/2-adapter/dist/adapter.d.mts"],"mappings":";;;cAEc,0BAA0B;WAC7B;aACE;aACA;aACA;aACA;aACA;;;;;;cAMC;WACH,cAAc;aACZ;eACE;eACA;eACA;eACA;eACA"}
|
package/dist/adapter.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as mysqlAdapterContractContributions, t as mysqlAdapterCapabilities } from "./adapter-
|
|
2
|
-
import { t as CodecTypes } from "./codec-types-
|
|
3
|
-
import "./codec-types-
|
|
4
|
-
import { n as MysqlControlAdapter, r as buildMysqlSchemaIR, t as MysqlCatalogRows } from "./control-
|
|
5
|
-
import { t as MysqlRuntimeAdapterInstance } from "./runtime-
|
|
1
|
+
import { n as mysqlAdapterContractContributions, t as mysqlAdapterCapabilities } from "./adapter-Dl4Wwz1I.mjs";
|
|
2
|
+
import { t as CodecTypes } from "./codec-types-Bai_CFkk-Blx2GxCH.mjs";
|
|
3
|
+
import "./codec-types-zzVcrnbk.mjs";
|
|
4
|
+
import { n as MysqlControlAdapter, r as buildMysqlSchemaIR, t as MysqlCatalogRows } from "./control-MoPFgSaQ.mjs";
|
|
5
|
+
import { t as MysqlRuntimeAdapterInstance } from "./runtime-ClRDfPiY.mjs";
|
|
6
6
|
export { type CodecTypes, type MysqlCatalogRows, MysqlControlAdapter, type MysqlRuntimeAdapterInstance, buildMysqlSchemaIR, mysqlAdapterCapabilities, mysqlAdapterContractContributions };
|
package/dist/adapter.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as mysqlAdapterContractContributions, t as mysqlAdapterCapabilities } from "./contract-contributions-
|
|
2
|
-
import { n as buildMysqlSchemaIR, t as MysqlControlAdapter } from "./control-
|
|
1
|
+
import { n as mysqlAdapterContractContributions, t as mysqlAdapterCapabilities } from "./contract-contributions-ChiX6W0F-CAng98bZ.mjs";
|
|
2
|
+
import { n as buildMysqlSchemaIR, t as MysqlControlAdapter } from "./control-BBhWaGnH.mjs";
|
|
3
3
|
export { MysqlControlAdapter, buildMysqlSchemaIR, mysqlAdapterCapabilities, mysqlAdapterContractContributions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as mysqlAdapterContractContributions, t as mysqlAdapterCapabilities } from "./adapter-
|
|
1
|
+
import { n as mysqlAdapterContractContributions, t as mysqlAdapterCapabilities } from "./adapter-Dl4Wwz1I.mjs";
|
|
2
2
|
export { mysqlAdapterCapabilities, mysqlAdapterContractContributions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as mysqlAdapterContractContributions, t as mysqlAdapterCapabilities } from "./contract-contributions-
|
|
1
|
+
import { n as mysqlAdapterContractContributions, t as mysqlAdapterCapabilities } from "./contract-contributions-ChiX6W0F-CAng98bZ.mjs";
|
|
2
2
|
export { mysqlAdapterCapabilities, mysqlAdapterContractContributions };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as CodecTypes } from "./codec-types-
|
|
2
|
-
import "./codec-types-
|
|
1
|
+
import { t as CodecTypes } from "./codec-types-Bai_CFkk-Blx2GxCH.mjs";
|
|
2
|
+
import "./codec-types-zzVcrnbk.mjs";
|
|
3
3
|
export type { CodecTypes };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as mysqlAdapterDescriptor, n as MysqlControlAdapter, r as buildMysqlSchemaIR, t as MysqlCatalogRows } from "./control-
|
|
1
|
+
import { i as mysqlAdapterDescriptor, n as MysqlControlAdapter, r as buildMysqlSchemaIR, t as MysqlCatalogRows } from "./control-MoPFgSaQ.mjs";
|
|
2
2
|
export { type MysqlCatalogRows, MysqlControlAdapter, buildMysqlSchemaIR, mysqlAdapterDescriptor as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as buildMysqlSchemaIR, r as mysqlAdapterDescriptor, t as MysqlControlAdapter } from "./control-
|
|
1
|
+
import { n as buildMysqlSchemaIR, r as mysqlAdapterDescriptor, t as MysqlControlAdapter } from "./control-BBhWaGnH.mjs";
|
|
2
2
|
export { MysqlControlAdapter, buildMysqlSchemaIR, mysqlAdapterDescriptor as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as mysqlRuntimeAdapterDescriptor, t as MysqlRuntimeAdapterInstance } from "./runtime-
|
|
1
|
+
import { n as mysqlRuntimeAdapterDescriptor, t as MysqlRuntimeAdapterInstance } from "./runtime-ClRDfPiY.mjs";
|
|
2
2
|
export { type MysqlRuntimeAdapterInstance, mysqlRuntimeAdapterDescriptor as default };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as quoteIdentifier, t as escapeLiteral } from "./sql-utils-
|
|
4
|
-
import { a as mysqlCodecDescriptorRegistry, t as assembleMysqlCodecRegistry } from "./codecs-
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
1
|
+
import { l as MYSQL_INT_CODEC_ID, t as MYSQL_BIGINT_CODEC_ID, u as MYSQL_TEXT_CODEC_ID } from "./codec-ids-CrR9Xi7r-CarpqbNM.mjs";
|
|
2
|
+
import { s as mysqlError } from "./errors-Cng94tYg-D02Eud2d.mjs";
|
|
3
|
+
import { n as quoteIdentifier, t as escapeLiteral } from "./sql-utils-Cmv_TVa8-BetrIUcj.mjs";
|
|
4
|
+
import { a as mysqlCodecDescriptorRegistry, t as assembleMysqlCodecRegistry } from "./codecs-BfiB79-5.mjs";
|
|
5
|
+
import { t as mysqlNowGenerators } from "./date-time-now-generators-DY-8Bodc-DcQ3h4Fg.mjs";
|
|
6
|
+
import { t as tokenizeMysqlSql } from "./sql-utils-bD4SfgX0.mjs";
|
|
7
|
+
import { t as mysqlAdapterCapabilities } from "./contract-contributions-ChiX6W0F-CAng98bZ.mjs";
|
|
8
|
+
import { i as readMarkerResult, n as mysqlAdapterDescriptorMeta } from "./marker-read-Cf80LSbG-CUp3v1e5.mjs";
|
|
8
9
|
import { InternalError, assertNever } from "@prisma/orm-framework/utils/internal-error";
|
|
9
10
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
10
11
|
import { collectOrderedParamRefs, isDdlNode } from "@prisma/orm-family-sql/relational-core/ast";
|
|
11
12
|
import { APP_SPACE_ID } from "@prisma/orm-framework/components/control";
|
|
13
|
+
import { timestampNowRuntimeGenerator } from "@prisma/orm-family-sql/family/runtime";
|
|
12
14
|
//#region ../../../3-targets/mysql/2-adapter/dist/runtime.mjs
|
|
13
15
|
const INT_MIN = -(2 ** 31);
|
|
14
16
|
const INT_MAX = 2 ** 31 - 1;
|
|
@@ -41,6 +43,8 @@ function assertPlaceholdersMatchParams(sql, paramCount) {
|
|
|
41
43
|
}
|
|
42
44
|
});
|
|
43
45
|
}
|
|
46
|
+
/** The name an upsert gives the row it proposes, which its update reads as `new`.`column`; the ORM writes that row as `excluded`, as Postgres names it. */
|
|
47
|
+
const PROPOSED_ROW = "new";
|
|
44
48
|
/**
|
|
45
49
|
* Raises `group_concat_max_len` for this statement only, past any result a connection can send, so an ordered include does not depend on how the driver set up its session. MySQL takes `SET_VAR` only on the outermost `SELECT`.
|
|
46
50
|
*/
|
|
@@ -94,12 +98,68 @@ function renderStatement(ast, ctx) {
|
|
|
94
98
|
switch (ast.kind) {
|
|
95
99
|
case "select": return renderSelect(ast, ctx);
|
|
96
100
|
case "raw-query": return renderParts(ast.parts, ctx);
|
|
97
|
-
case "insert":
|
|
98
|
-
case "update":
|
|
99
|
-
case "delete":
|
|
101
|
+
case "insert": return renderInsert(ast, ctx);
|
|
102
|
+
case "update": return renderUpdate(ast, ctx);
|
|
103
|
+
case "delete": return renderDelete(ast, ctx);
|
|
100
104
|
default: throw new InternalError(`Unsupported AST node kind: ${nodeKind(ast)}`);
|
|
101
105
|
}
|
|
102
106
|
}
|
|
107
|
+
function invalid(node, message) {
|
|
108
|
+
return mysqlError("RUNTIME.AST_INVALID", message, { meta: { node } });
|
|
109
|
+
}
|
|
110
|
+
/** MySQL has no `RETURNING`: the SQL family's ORM reads written rows back with a select when the contract does not report `returning`. */
|
|
111
|
+
function refuseReturning(returning, what) {
|
|
112
|
+
if (returning !== void 0 && returning.length > 0) throw unsupported("returning", `MySQL cannot return the rows ${what} writes; it has no RETURNING`);
|
|
113
|
+
}
|
|
114
|
+
function renderInsertValue(value, ctx) {
|
|
115
|
+
if (value === void 0 || value.kind === "default-value") return "DEFAULT";
|
|
116
|
+
return renderExpr(value, ctx);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* An insert, with the bare table name: MySQL's `INSERT` takes no alias, so a column of the table is qualified by its name. A row without a value for a column gets `DEFAULT`. An upsert names its proposed row `new` and updates the existing row on any duplicate key. MySQL cannot limit `ON DUPLICATE KEY UPDATE` to named conflict columns, so the adapter does not report `insertOnConflictTarget` and an upsert that names them is refused. Skipping a conflicting row is refused: `INSERT IGNORE` also hides foreign-key and `NOT NULL` errors.
|
|
120
|
+
*/
|
|
121
|
+
function renderInsert(ast, ctx) {
|
|
122
|
+
refuseReturning(ast.returning, "an insert");
|
|
123
|
+
if (ast.rows.length === 0) throw invalid("insert", "INSERT requires at least one row");
|
|
124
|
+
const table = qualifyTable(ast.table, ctx);
|
|
125
|
+
const insertCtx = {
|
|
126
|
+
...ctx,
|
|
127
|
+
insertInto: {
|
|
128
|
+
alias: ast.table.alias ?? ast.table.name,
|
|
129
|
+
name: table
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
const columns = [...new Set(ast.rows.flatMap((row) => Object.keys(row)))];
|
|
133
|
+
const values = ast.rows.map((row) => `(${columns.map((column) => renderInsertValue(row[column], insertCtx)).join(", ")})`).join(", ");
|
|
134
|
+
const insert = `INSERT INTO ${table} (${columns.map(quoteIdentifier).join(", ")}) VALUES ${values}`;
|
|
135
|
+
const conflict = ast.onConflict;
|
|
136
|
+
if (conflict === void 0) return insert;
|
|
137
|
+
const action = conflict.action;
|
|
138
|
+
switch (action.kind) {
|
|
139
|
+
case "do-nothing": throw unsupported("insert-on-conflict-skip", "MySQL cannot skip a conflicting row without also hiding other errors: INSERT IGNORE turns foreign-key and NOT NULL errors into warnings");
|
|
140
|
+
case "do-update-set": {
|
|
141
|
+
if (conflict.columns.length > 0) throw unsupported("insert-on-conflict-target", "MySQL cannot limit ON DUPLICATE KEY UPDATE to named conflict columns: it fires on any unique key");
|
|
142
|
+
const assignments = Object.entries(action.set);
|
|
143
|
+
if (assignments.length === 0) throw invalid("insert-on-conflict", "An upsert requires at least one column to update");
|
|
144
|
+
const set = assignments.map(([column, value]) => `${quoteIdentifier(column)} = ${renderExpr(value, insertCtx)}`).join(", ");
|
|
145
|
+
return `${insert} AS ${quoteIdentifier(PROPOSED_ROW)} ON DUPLICATE KEY UPDATE ${set}`;
|
|
146
|
+
}
|
|
147
|
+
default: return assertNever(action, `Unsupported conflict action: ${nodeKind(action)}`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function renderUpdate(ast, ctx) {
|
|
151
|
+
refuseReturning(ast.returning, "an update");
|
|
152
|
+
const assignments = Object.entries(ast.set);
|
|
153
|
+
if (assignments.length === 0) throw invalid("update", "UPDATE requires at least one column to set");
|
|
154
|
+
const set = assignments.map(([column, value]) => `${quoteIdentifier(column)} = ${renderExpr(value, ctx)}`).join(", ");
|
|
155
|
+
const where = ast.where ? ` WHERE ${renderExpr(ast.where, ctx)}` : "";
|
|
156
|
+
return `UPDATE ${renderTableSource(ast.table, ctx)} SET ${set}${where}`;
|
|
157
|
+
}
|
|
158
|
+
function renderDelete(ast, ctx) {
|
|
159
|
+
refuseReturning(ast.returning, "a delete");
|
|
160
|
+
const where = ast.where ? ` WHERE ${renderExpr(ast.where, ctx)}` : "";
|
|
161
|
+
return `DELETE FROM ${renderTableSource(ast.table, ctx)}${where}`;
|
|
162
|
+
}
|
|
103
163
|
function renderLimitOffset(keyword, value, ctx) {
|
|
104
164
|
if (value === void 0) return "";
|
|
105
165
|
if (typeof value === "number") return `${keyword} ${value}`;
|
|
@@ -148,7 +208,7 @@ function renderSource(source, ctx) {
|
|
|
148
208
|
}
|
|
149
209
|
function renderExpr(expr, ctx) {
|
|
150
210
|
switch (expr.kind) {
|
|
151
|
-
case "column-ref": return renderColumn(expr);
|
|
211
|
+
case "column-ref": return renderColumn(expr, ctx);
|
|
152
212
|
case "identifier-ref": return quoteIdentifier(expr.name);
|
|
153
213
|
case "operation": return renderOperation(expr, ctx);
|
|
154
214
|
case "subquery": return renderSubquery(expr, ctx);
|
|
@@ -191,8 +251,14 @@ function renderParts(parts, ctx) {
|
|
|
191
251
|
assertNoDigitAfterParam(parts);
|
|
192
252
|
return parts.map((part) => typeof part === "string" ? part : renderExpr(part, ctx)).join("");
|
|
193
253
|
}
|
|
194
|
-
function renderColumn(ref) {
|
|
195
|
-
|
|
254
|
+
function renderColumn(ref, ctx) {
|
|
255
|
+
const column = quoteIdentifier(ref.column);
|
|
256
|
+
const { insertInto } = ctx;
|
|
257
|
+
if (insertInto !== void 0) {
|
|
258
|
+
if (ref.table === "excluded") return `${quoteIdentifier(PROPOSED_ROW)}.${column}`;
|
|
259
|
+
if (ref.table === insertInto.alias) return `${insertInto.name}.${column}`;
|
|
260
|
+
}
|
|
261
|
+
return `${quoteIdentifier(ref.table)}.${column}`;
|
|
196
262
|
}
|
|
197
263
|
/**
|
|
198
264
|
* A literal the code wrote: a number, a bigint, a boolean or NULL, such as the ORM's `1` and `fns.and(true, …)`. A `LiteralExpr` does not say where its value came from, and no part of Prisma writes a text, date or JSON literal into a MySQL runtime statement, so those are refused: a value of that kind can only be a caller's, which belongs in a param, sent apart from the SQL.
|
|
@@ -368,7 +434,7 @@ function renderJoin(join, ctx) {
|
|
|
368
434
|
return `${join.joinType.toUpperCase()} JOIN ${renderSource(join.source, ctx)} ON ${renderJoinOn(join.on, ctx)}`;
|
|
369
435
|
}
|
|
370
436
|
function renderJoinOn(on, ctx) {
|
|
371
|
-
return on.kind === "eq-col-join-on" ? `${renderColumn(on.left)} = ${renderColumn(on.right)}` : renderExpr(on, ctx);
|
|
437
|
+
return on.kind === "eq-col-join-on" ? `${renderColumn(on.left, ctx)} = ${renderColumn(on.right, ctx)}` : renderExpr(on, ctx);
|
|
372
438
|
}
|
|
373
439
|
function markerQuery(queryable) {
|
|
374
440
|
return { async query(sql, params) {
|
|
@@ -403,9 +469,18 @@ var MysqlAdapterImpl = class {
|
|
|
403
469
|
function createMysqlAdapter(codecs) {
|
|
404
470
|
return Object.freeze(new MysqlAdapterImpl(codecs));
|
|
405
471
|
}
|
|
472
|
+
/** The `now()` generators of the MySQL date and time types: the SQL family's `timestampNow` for a `Date`, and the target's for every other value. */
|
|
473
|
+
function createMysqlMutationDefaultGenerators() {
|
|
474
|
+
return [timestampNowRuntimeGenerator(), ...mysqlNowGenerators.map(({ id, generate }) => ({
|
|
475
|
+
id,
|
|
476
|
+
generate,
|
|
477
|
+
stability: "query"
|
|
478
|
+
}))];
|
|
479
|
+
}
|
|
406
480
|
const mysqlRuntimeAdapterDescriptor = {
|
|
407
481
|
...mysqlAdapterDescriptorMeta,
|
|
408
482
|
codecs: () => Array.from(mysqlCodecDescriptorRegistry.values()),
|
|
483
|
+
mutationDefaultGenerators: createMysqlMutationDefaultGenerators,
|
|
409
484
|
rawCodecInferer: mysqlRawCodecInferer,
|
|
410
485
|
create(stack) {
|
|
411
486
|
return createMysqlAdapter(assembleMysqlCodecRegistry(stack.target, stack.extensions));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter__runtime.mjs","names":["#codecs"],"sources":["../../../../3-targets/mysql/2-adapter/dist/runtime.mjs"],"sourcesContent":["import { n as mysqlAdapterCapabilities } from \"./contract-contributions-B9njRJbt.mjs\";\nimport { o as mysqlAdapterDescriptorMeta, r as readMarkerResult } from \"./marker-read-aEaHihYj.mjs\";\nimport { assembleMysqlCodecRegistry, mysqlCodecDescriptorRegistry } from \"@internal/target-mysql/codecs\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { collectOrderedParamRefs, isDdlNode } from \"@internal/sql-relational-core/ast\";\nimport { mysqlError, mysqlQueryNotYetSupported } from \"@internal/target-mysql/errors\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { escapeLiteral, quoteIdentifier, tokenizeMysqlSql } from \"@internal/target-mysql/sql-utils\";\nimport { MYSQL_BIGINT_CODEC_ID, MYSQL_INT_CODEC_ID, MYSQL_TEXT_CODEC_ID } from \"@internal/target-mysql/codec-ids\";\nimport { InternalError, assertNever } from \"@internal/utils/internal-error\";\n//#region src/core/raw-codec-inferer.ts\nconst INT_MIN = -(2 ** 31);\nconst INT_MAX = 2 ** 31 - 1;\nfunction refuse(value) {\n\tthrow structuredError(\"RUNTIME.RAW_SQL_UNSUPPORTED_INTERPOLATION\", \"MySQL has no codec for this JS value in raw SQL: wrap it in `param(...)` with an explicit codec\", { meta: { valueType: typeof value } });\n}\n/** The codec of a bare value interpolated into `fns.raw` or the raw lane on a MySQL client: integers, bigints and strings. */\nconst mysqlRawCodecInferer = { inferCodec(value) {\n\tswitch (typeof value) {\n\t\tcase \"number\":\n\t\t\tif (!Number.isSafeInteger(value)) return refuse(value);\n\t\t\treturn value >= INT_MIN && value <= INT_MAX ? MYSQL_INT_CODEC_ID : refuse(value);\n\t\tcase \"bigint\": return MYSQL_BIGINT_CODEC_ID;\n\t\tcase \"string\": return MYSQL_TEXT_CODEC_ID;\n\t\tdefault: return refuse(value);\n\t}\n} };\n//#endregion\n//#region src/core/placeholders.ts\n/** Refuses a lowered statement unless every placeholder is a numbered `?N` naming one of its parameters and every parameter has a placeholder. */\nfunction assertPlaceholdersMatchParams(sql, paramCount) {\n\tconst tokens = tokenizeMysqlSql(sql).filter((token) => token.kind === \"placeholder\");\n\tconst placeholders = tokens.map((token) => token.text);\n\tconst numbers = tokens.map((token) => token.number ?? NaN);\n\tif (numbers.every((number) => number >= 1 && number <= paramCount) && new Set(numbers).size === paramCount) return;\n\tthrow structuredError(\"RUNTIME.PARAM_PLACEHOLDER_MISMATCH\", `The lowered MySQL statement writes placeholders ${JSON.stringify(placeholders)} for ${paramCount} parameter(s); each parameter must be written as its own numbered placeholder, and no other placeholder may appear.`, {\n\t\twhy: \"A placeholder that does not match a parameter binds a value to the wrong place in the statement, or leaves a value unbound.\",\n\t\tfix: \"Pass values into raw SQL through interpolation rather than writing a `?` in the SQL text.\",\n\t\tmeta: {\n\t\t\tplaceholders,\n\t\t\tparams: paramCount\n\t\t}\n\t});\n}\n//#endregion\n//#region src/core/sql-renderer.ts\n/**\n* Raises `group_concat_max_len` for this statement only, past any result a connection can send, so an ordered include does not depend on how the driver set up its session. MySQL takes `SET_VAR` only on the outermost `SELECT`.\n*/\nconst GROUP_CONCAT_HINT = \"/*+ SET_VAR(group_concat_max_len = 4294967295) */\";\n/** MySQL's documented way to write an `OFFSET` with no `LIMIT`: the largest row count it takes. */\nconst NO_LIMIT = \"18446744073709551615\";\nfunction nodeKind(value) {\n\treturn typeof value === \"object\" && value !== null && \"kind\" in value ? String(value.kind) : \"unknown\";\n}\nfunction unsupported(feature, message) {\n\treturn mysqlError(\"RUNTIME.AST_UNSUPPORTED\", message, { meta: {\n\t\ttarget: \"mysql\",\n\t\tfeature\n\t} });\n}\n/**\n* Lowers a query AST to MySQL SQL. Each param is written as `?N`, N being its position in `collectOrderedParamRefs`, the order the runtime encodes and middleware edits params in; a param written twice is bound once. The driver fills the placeholders.\n*/\nfunction renderMysqlSql(ast, contract, codecs) {\n\tconst placeholderNumbers = /* @__PURE__ */ new Map();\n\tconst params = collectOrderedParamRefs(ast).map((ref, index) => {\n\t\tplaceholderNumbers.set(ref, index + 1);\n\t\treturn ref.kind === \"prepared-param-ref\" ? {\n\t\t\tkind: \"bind\",\n\t\t\tname: ref.name\n\t\t} : {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: ref.value\n\t\t};\n\t});\n\tconst ctx = {\n\t\tcontract,\n\t\tcodecs,\n\t\tplaceholderNumbers,\n\t\tuses: { groupConcat: false }\n\t};\n\tconst rendered = renderStatement(ast, ctx);\n\tconst sql = ctx.uses.groupConcat ? withGroupConcatHint(ast, rendered) : rendered;\n\tassertPlaceholdersMatchParams(sql, params.length);\n\treturn Object.freeze({\n\t\tsql,\n\t\tparams\n\t});\n}\n/** Puts `GROUP_CONCAT_HINT` on the outermost `SELECT`; a statement without one would leave `GROUP_CONCAT` at the session's limit, which can cut an array after an element and still read as JSON, so it is refused. */\nfunction withGroupConcatHint(ast, rendered) {\n\tif (ast.kind !== \"select\" || !rendered.startsWith(\"SELECT \")) throw unsupported(\"ordered-array-outside-select\", \"MySQL can build an ordered JSON array only in a SELECT statement, whose outermost SELECT carries the hint that raises group_concat_max_len\");\n\treturn `SELECT ${GROUP_CONCAT_HINT} ${rendered.slice(7)}`;\n}\nfunction renderStatement(ast, ctx) {\n\tswitch (ast.kind) {\n\t\tcase \"select\": return renderSelect(ast, ctx);\n\t\tcase \"raw-query\": return renderParts(ast.parts, ctx);\n\t\tcase \"insert\":\n\t\tcase \"update\":\n\t\tcase \"delete\": throw mysqlQueryNotYetSupported(\"Writing rows\");\n\t\tdefault: throw new InternalError(`Unsupported AST node kind: ${nodeKind(ast)}`);\n\t}\n}\nfunction renderLimitOffset(keyword, value, ctx) {\n\tif (value === void 0) return \"\";\n\tif (typeof value === \"number\") return `${keyword} ${value}`;\n\treturn `${keyword} ${value.kind === \"param-ref\" || value.kind === \"prepared-param-ref\" ? placeholder(value, ctx) : renderExpr(value, ctx)}`;\n}\nfunction renderSelect(ast, ctx) {\n\tif (ast.locking !== void 0 && ast.locking.length > 0) throw unsupported(\"locking-clause\", \"Row locks are not supported on MySQL yet, so a select cannot carry a locking clause such as FOR UPDATE\");\n\tif (ast.distinctOn !== void 0 && ast.distinctOn.length > 0) throw unsupported(\"distinct-on\", \"MySQL has no DISTINCT ON\");\n\treturn [\n\t\t`SELECT ${ast.distinct ? \"DISTINCT \" : \"\"}${renderProjection(ast.projection, ctx)}`,\n\t\tast.from === void 0 ? \"\" : `FROM ${renderSource(ast.from, ctx)}`,\n\t\tast.joins?.length ? ast.joins.map((join) => renderJoin(join, ctx)).join(\" \") : \"\",\n\t\tast.where ? `WHERE ${renderExpr(ast.where, ctx)}` : \"\",\n\t\tast.groupBy?.length ? `GROUP BY ${ast.groupBy.map((e) => renderExpr(e, ctx)).join(\", \")}` : \"\",\n\t\tast.having ? `HAVING ${renderExpr(ast.having, ctx)}` : \"\",\n\t\tast.orderBy?.length ? `ORDER BY ${renderOrderByItems(ast.orderBy, ctx)}` : \"\",\n\t\tast.limit === void 0 && ast.offset !== void 0 ? `LIMIT ${NO_LIMIT}` : renderLimitOffset(\"LIMIT\", ast.limit, ctx),\n\t\trenderLimitOffset(\"OFFSET\", ast.offset, ctx)\n\t].filter((part) => part.length > 0).join(\" \");\n}\nfunction renderProjection(projection, ctx) {\n\treturn projection.map((item) => `${renderExpr(item.expr, ctx)} AS ${quoteIdentifier(item.alias)}`).join(\", \");\n}\nfunction qualifyTable(table, ctx) {\n\tif (table.namespaceId === void 0) return quoteIdentifier(table.name);\n\tif (ctx.contract === void 0) throw new InternalError(`Table \"${table.name}\" carries namespace \"${table.namespaceId}\" but no contract was supplied to resolve it`);\n\tconst namespace = ctx.contract.storage.namespaces[table.namespaceId];\n\tif (namespace?.qualifyTable === void 0) throw structuredError(\"RUNTIME.NAMESPACE_UNKNOWN\", `Table \"${table.name}\" references namespace \"${table.namespaceId}\" which the contract does not materialise for SQL rendering`, { meta: {\n\t\ttable: table.name,\n\t\tnamespaceId: table.namespaceId,\n\t\treason: namespace === void 0 ? \"not-present\" : \"not-materialised\"\n\t} });\n\treturn namespace.qualifyTable(table.name);\n}\nfunction renderTableSource(source, ctx) {\n\tconst qualified = qualifyTable(source, ctx);\n\treturn source.alias ? `${qualified} AS ${quoteIdentifier(source.alias)}` : qualified;\n}\nfunction renderSource(source, ctx) {\n\tswitch (source.kind) {\n\t\tcase \"table-source\": return renderTableSource(source, ctx);\n\t\tcase \"derived-table-source\": return `(${renderSelect(source.query, ctx)}) AS ${quoteIdentifier(source.alias)}`;\n\t\tcase \"function-source\": throw unsupported(\"function-source\", `MySQL cannot select from the set-returning function ${source.fn}`);\n\t\tdefault: return assertNever(source, `Unsupported source node kind: ${nodeKind(source)}`);\n\t}\n}\nfunction renderExpr(expr, ctx) {\n\tswitch (expr.kind) {\n\t\tcase \"column-ref\": return renderColumn(expr);\n\t\tcase \"identifier-ref\": return quoteIdentifier(expr.name);\n\t\tcase \"operation\": return renderOperation(expr, ctx);\n\t\tcase \"subquery\": return renderSubquery(expr, ctx);\n\t\tcase \"aggregate\": return renderAggregate(expr, ctx);\n\t\tcase \"window-func\": return renderWindowFunc(expr, ctx);\n\t\tcase \"function-call\": return renderFunctionCall(expr, ctx);\n\t\tcase \"cast\": return renderCast(expr, ctx);\n\t\tcase \"case\": return renderCase(expr, ctx);\n\t\tcase \"json-object\": return renderJsonObject(expr, ctx);\n\t\tcase \"json-array-agg\": return renderJsonArrayAgg(expr, ctx);\n\t\tcase \"binary\": return renderBinary(expr, ctx);\n\t\tcase \"and\": return expr.exprs.length === 0 ? \"TRUE\" : `(${expr.exprs.map((part) => renderExpr(part, ctx)).join(\" AND \")})`;\n\t\tcase \"or\": return expr.exprs.length === 0 ? \"FALSE\" : `(${expr.exprs.map((part) => renderExpr(part, ctx)).join(\" OR \")})`;\n\t\tcase \"exists\": return `${expr.notExists ? \"NOT \" : \"\"}EXISTS (${renderSelect(expr.subquery, ctx)})`;\n\t\tcase \"null-check\": return renderNullCheck(expr, ctx);\n\t\tcase \"not\": return `NOT (${renderExpr(expr.expr, ctx)})`;\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\": return renderParam(expr, ctx);\n\t\tcase \"literal\": return renderLiteral(expr);\n\t\tcase \"list\": return renderList(expr, ctx);\n\t\tcase \"raw-expr\": return renderParts(expr.parts, ctx);\n\t\tdefault: return assertNever(expr, `Unsupported expression node kind: ${nodeKind(expr)}`);\n\t}\n}\n/** Refuses raw SQL text that puts a digit right after an interpolated value: the value's `?N` and the digit would read as one larger placeholder, `?1` and `0` as `?10`. */\nfunction assertNoDigitAfterParam(parts) {\n\tparts.forEach((part, index) => {\n\t\tconst next = parts[index + 1];\n\t\tif (typeof part !== \"string\" && (part.kind === \"param-ref\" || part.kind === \"prepared-param-ref\") && typeof next === \"string\" && /^\\d/.test(next)) throw structuredError(\"RUNTIME.PARAM_PLACEHOLDER_MISMATCH\", \"Raw SQL puts a digit right after an interpolated value, which MySQL lowering would read as part of the value's placeholder\", {\n\t\t\twhy: \"Each value is written as a numbered placeholder, ?N, so a digit that follows it in the SQL text makes a different placeholder: ?1 followed by 0 reads as ?10.\",\n\t\t\tfix: \"Put a space or an operator between the interpolated value and the digit.\",\n\t\t\tmeta: {\n\t\t\t\treason: \"digit-after-value\",\n\t\t\t\tpart: index + 1\n\t\t\t}\n\t\t});\n\t});\n}\nfunction renderParts(parts, ctx) {\n\tassertNoDigitAfterParam(parts);\n\treturn parts.map((part) => typeof part === \"string\" ? part : renderExpr(part, ctx)).join(\"\");\n}\nfunction renderColumn(ref) {\n\treturn `${quoteIdentifier(ref.table)}.${quoteIdentifier(ref.column)}`;\n}\n/**\n* A literal the code wrote: a number, a bigint, a boolean or NULL, such as the ORM's `1` and `fns.and(true, …)`. A `LiteralExpr` does not say where its value came from, and no part of Prisma writes a text, date or JSON literal into a MySQL runtime statement, so those are refused: a value of that kind can only be a caller's, which belongs in a param, sent apart from the SQL.\n*/\nfunction renderLiteral(expr) {\n\tconst { value } = expr;\n\tif (value === null || value === void 0) return \"NULL\";\n\tif (typeof value === \"number\") {\n\t\tif (!Number.isFinite(value)) throw unsupported(\"non-finite-number\", `MySQL has no literal for ${value}`);\n\t\treturn String(value);\n\t}\n\tif (typeof value === \"boolean\") return value ? \"TRUE\" : \"FALSE\";\n\tif (typeof value === \"bigint\") return String(value);\n\tthrow unsupported(\"value-literal\", `MySQL lowering writes only numbers, booleans and NULL as literals; a ${value instanceof Date ? \"date\" : Array.isArray(value) ? \"array\" : typeof value} value must be a param`);\n}\n/** Renders each `{{self}}` and `{{argN}}` where the template writes it. */\nfunction renderOperation(expr, ctx) {\n\treturn expr.lowering.template.replace(/\\{\\{(self|arg(\\d+))\\}\\}/g, (_match, _name, index) => {\n\t\tif (index === void 0) return renderExpr(expr.self, ctx);\n\t\tconst arg = expr.args[Number(index)];\n\t\treturn arg === void 0 ? \"\" : renderExpr(arg, ctx);\n\t});\n}\nfunction renderSubquery(expr, ctx) {\n\tif (expr.query.projection.length !== 1) throw structuredError(\"RUNTIME.AST_INVALID\", \"Subquery expressions must project exactly one column\", { meta: { node: \"subquery\" } });\n\treturn `(${renderSelect(expr.query, ctx)})`;\n}\n/** Whether an operand must be parenthesised before an operator is written after it. A new expression kind fails to compile here until someone decides. */\nfunction needsGrouping(expr) {\n\tswitch (expr.kind) {\n\t\tcase \"operation\":\n\t\tcase \"subquery\": return true;\n\t\tcase \"column-ref\":\n\t\tcase \"identifier-ref\":\n\t\tcase \"aggregate\":\n\t\tcase \"window-func\":\n\t\tcase \"function-call\":\n\t\tcase \"cast\":\n\t\tcase \"case\":\n\t\tcase \"json-object\":\n\t\tcase \"json-array-agg\":\n\t\tcase \"binary\":\n\t\tcase \"and\":\n\t\tcase \"or\":\n\t\tcase \"exists\":\n\t\tcase \"null-check\":\n\t\tcase \"not\":\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\":\n\t\tcase \"literal\":\n\t\tcase \"list\":\n\t\tcase \"raw-expr\": return false;\n\t}\n}\nfunction grouped(expr, ctx) {\n\tconst rendered = renderExpr(expr, ctx);\n\treturn needsGrouping(expr) ? `(${rendered})` : rendered;\n}\nfunction renderNullCheck(expr, ctx) {\n\treturn `${grouped(expr.expr, ctx)} ${expr.isNull ? \"IS NULL\" : \"IS NOT NULL\"}`;\n}\nconst BINARY_OPERATORS = {\n\teq: \"=\",\n\tneq: \"<>\",\n\tisNotDistinctFrom: \"<=>\",\n\tgt: \">\",\n\tlt: \"<\",\n\tgte: \">=\",\n\tlte: \"<=\",\n\tlike: \"LIKE\",\n\tin: \"IN\",\n\tnotIn: \"NOT IN\"\n};\nfunction renderBinary(expr, ctx) {\n\tif (expr.right.kind === \"list\" && expr.right.values.length === 0) {\n\t\tif (expr.op === \"in\") return \"FALSE\";\n\t\tif (expr.op === \"notIn\") return \"TRUE\";\n\t}\n\tconst left = grouped(expr.left, ctx);\n\tconst right = renderExpr(expr.right, ctx);\n\tif (expr.op === \"isDistinctFrom\") return `NOT (${left} <=> ${right})`;\n\treturn `${left} ${BINARY_OPERATORS[expr.op]} ${right}`;\n}\nfunction renderList(expr, ctx) {\n\tif (expr.values.length === 0) return \"(NULL)\";\n\treturn `(${expr.values.map((value) => renderExpr(value, ctx)).join(\", \")})`;\n}\nfunction renderAggregate(expr, ctx) {\n\tconst fn = expr.fn.toUpperCase();\n\treturn expr.expr ? `${fn}(${renderExpr(expr.expr, ctx)})` : `${fn}(*)`;\n}\nfunction renderWindowFunc(expr, ctx) {\n\tconst args = expr.args.map((arg) => renderExpr(arg, ctx)).join(\", \");\n\tconst over = [expr.partitionBy?.length ? `PARTITION BY ${expr.partitionBy.map((e) => renderExpr(e, ctx)).join(\", \")}` : \"\", expr.orderBy?.length ? `ORDER BY ${renderOrderByItems(expr.orderBy, ctx)}` : \"\"].filter((part) => part.length > 0).join(\" \");\n\treturn `${expr.fn.toUpperCase()}(${args}) OVER (${over})`;\n}\nfunction renderFunctionCall(expr, ctx) {\n\treturn `${expr.fn}(${expr.args.map((arg) => renderExpr(arg, ctx)).join(\", \")})`;\n}\nfunction renderCast(expr, ctx) {\n\treturn `CAST(${renderExpr(expr.expr, ctx)} AS ${expr.targetType})`;\n}\nfunction renderCase(expr, ctx) {\n\treturn `CASE ${expr.branches.map((branch) => `WHEN ${renderExpr(branch.condition, ctx)} THEN ${renderExpr(branch.value, ctx)}`).join(\" \")}${expr.elseExpr === void 0 ? \"\" : ` ELSE ${renderExpr(expr.elseExpr, ctx)}`} END`;\n}\nfunction descriptorOf(codec, ctx, use) {\n\tconst descriptor = ctx.codecs.descriptorFor(codec.codecId);\n\tif (descriptor === void 0) throw structuredError(\"RUNTIME.PARAM_REF_MISSING_CODEC\", `MySQL lowering: ${use} carries codecId \"${codec.codecId}\" but the MySQL codec registry has no entry for it. Register the extension pack that contributes this codec.`, { meta: { codecId: codec.codecId } });\n\treturn descriptor;\n}\nfunction placeholder(ref, ctx) {\n\tconst number = ctx.placeholderNumbers.get(ref);\n\tif (number === void 0) throw new InternalError(\"A param was written that the AST does not collect\");\n\treturn `?${number}`;\n}\n/** A param as its numbered placeholder, refusing one whose codec the MySQL registry lacks. */\nfunction renderParam(ref, ctx) {\n\tif (ref.codec !== void 0) descriptorOf(ref.codec, ctx, \"a parameter\");\n\treturn placeholder(ref, ctx);\n}\nfunction projectThroughCodec(value, codec, ctx) {\n\treturn descriptorOf(codec, ctx, \"a JSON projection\").projectJson(value, codec);\n}\nfunction renderJsonValue(projection, ctx) {\n\treturn projection.accept({\n\t\tcodec: ({ value, codec }) => renderExpr(projectThroughCodec(value, codec, ctx), ctx),\n\t\tnative: ({ value }) => renderExpr(value, ctx),\n\t\tdocument: ({ value }) => renderExpr(value, ctx)\n\t});\n}\nfunction renderJsonObject(expr, ctx) {\n\treturn `JSON_OBJECT(${expr.entries.flatMap((entry) => [`'${escapeLiteral(entry.key)}'`, renderJsonValue(entry.value, ctx)]).join(\", \")})`;\n}\n/**\n* The element of an ordered JSON array, as JSON text. A document already is JSON; a scalar goes through `JSON_ARRAY`, so a string arrives quoted and escaped.\n*/\nfunction renderJsonElementText(projection, ctx) {\n\tconst rendered = renderJsonValue(projection, ctx);\n\treturn projection.kind === \"document\" ? rendered : `JSON_EXTRACT(JSON_ARRAY(${rendered}), '$[0]')`;\n}\n/**\n* `JSON_ARRAYAGG` takes no `ORDER BY`, and MySQL drops a derived table's `ORDER BY` when the outer query aggregates, so an ordered array is built as text with `GROUP_CONCAT`, which keeps its own order, and cast to JSON. The statement raises `group_concat_max_len` past any result a connection can send (see `GROUP_CONCAT_HINT`), so `GROUP_CONCAT` never cuts the text short. Text longer than `max_allowed_packet` makes `CONCAT` return NULL with only a warning, which would read as an empty include; so an empty array is written only when there are no rows, and a NULL text with rows is replaced by text that is not JSON, which fails the cast and the statement with MySQL's invalid-JSON error. `JSON_ARRAYAGG` fails on its own when its result exceeds a packet. An empty array is `JSON_ARRAY()`, so the column stays JSON and a nested include stays an array.\n*/\nfunction renderJsonArrayAgg(expr, ctx) {\n\tif (expr.orderBy === void 0) {\n\t\tconst aggregated = `JSON_ARRAYAGG(${renderJsonValue(expr.expr, ctx)})`;\n\t\treturn expr.onEmpty === \"emptyArray\" ? `COALESCE(${aggregated}, JSON_ARRAY())` : aggregated;\n\t}\n\tctx.uses.groupConcat = true;\n\tconst text = `CONCAT('[', GROUP_CONCAT(${renderJsonElementText(expr.expr, ctx)} ORDER BY ${renderOrderByItems(expr.orderBy, ctx)} SEPARATOR ','), ']')`;\n\treturn `CASE WHEN COUNT(*) = 0 THEN ${expr.onEmpty === \"emptyArray\" ? \"JSON_ARRAY()\" : \"NULL\"} ELSE CAST(COALESCE(${text}, ${OVERSIZED_ARRAY_TEXT}) AS JSON) END`;\n}\n/** Text that is not JSON, written in place of an array MySQL could not build because it is larger than a packet, so the cast fails. MySQL's error does not show this text: the user sees `Invalid JSON text in argument 1 to function cast_as_json`, which names neither the include nor the packet size. The text counts the rows only so that MySQL evaluates it when it is reached, not while preparing the statement. */\nconst OVERSIZED_ARRAY_TEXT = \"CONCAT('array larger than max_allowed_packet: ', COUNT(*), ' rows')\";\nconst ORDER_DIRECTION = {\n\tasc: \"ASC\",\n\tdesc: \"DESC\"\n};\n/** A NULLS FIRST or NULLS LAST placement, which MySQL lacks, as a leading `IS NULL` sort key. */\nconst NULLS_KEY_DIRECTION = {\n\tfirst: \"DESC\",\n\tlast: \"ASC\"\n};\nfunction renderOrderByItem(item, ctx) {\n\treturn `${item.nulls === void 0 ? \"\" : `${grouped(item.expr, ctx)} IS NULL ${NULLS_KEY_DIRECTION[item.nulls]}, `}${renderExpr(item.expr, ctx)} ${ORDER_DIRECTION[item.dir]}`;\n}\nfunction renderOrderByItems(items, ctx) {\n\treturn items.map((item) => renderOrderByItem(item, ctx)).join(\", \");\n}\nfunction renderJoin(join, ctx) {\n\tif (join.joinType === \"full\") throw unsupported(\"full-join\", \"MySQL has no FULL JOIN\");\n\tif (join.lateral) throw unsupported(\"lateral-join\", \"LATERAL joins are not supported on MySQL yet\");\n\treturn `${join.joinType.toUpperCase()} JOIN ${renderSource(join.source, ctx)} ON ${renderJoinOn(join.on, ctx)}`;\n}\nfunction renderJoinOn(on, ctx) {\n\treturn on.kind === \"eq-col-join-on\" ? `${renderColumn(on.left)} = ${renderColumn(on.right)}` : renderExpr(on, ctx);\n}\n//#endregion\n//#region src/core/runtime/mysql-adapter.ts\nfunction markerQuery(queryable) {\n\treturn { async query(sql, params) {\n\t\tconst rows = [];\n\t\tfor await (const row of queryable.query({\n\t\t\tsql,\n\t\t\t...params ? { params } : {}\n\t\t})) rows.push(row);\n\t\treturn { rows };\n\t} };\n}\nvar MysqlAdapterImpl = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"mysql\";\n\tprofile;\n\t#codecs;\n\tconstructor(codecs) {\n\t\tthis.#codecs = codecs;\n\t\tthis.profile = Object.freeze({\n\t\t\tid: \"mysql/default@1\",\n\t\t\ttarget: \"mysql\",\n\t\t\tcapabilities: mysqlAdapterCapabilities,\n\t\t\treadMarker: (queryable) => readMarkerResult(markerQuery(queryable), APP_SPACE_ID)\n\t\t});\n\t}\n\tlower(ast, context) {\n\t\tif (isDdlNode(ast)) throw structuredError(\"RUNTIME.DDL_UNSUPPORTED\", \"lower() does not lower DDL on the runtime adapter: DDL lowering belongs to the control adapter.\", { meta: { surface: \"runtime-adapter\" } });\n\t\treturn renderMysqlSql(ast, context.contract, this.#codecs);\n\t}\n};\n/** The MySQL runtime adapter: it lowers queries with the MySQL renderer and reads the marker 2b's control tables hold. */\nfunction createMysqlAdapter(codecs) {\n\treturn Object.freeze(new MysqlAdapterImpl(codecs));\n}\n//#endregion\n//#region src/core/runtime/runtime-adapter.ts\nconst mysqlRuntimeAdapterDescriptor = {\n\t...mysqlAdapterDescriptorMeta,\n\tcodecs: () => Array.from(mysqlCodecDescriptorRegistry.values()),\n\trawCodecInferer: mysqlRawCodecInferer,\n\tcreate(stack) {\n\t\treturn createMysqlAdapter(assembleMysqlCodecRegistry(stack.target, stack.extensions));\n\t}\n};\n//#endregion\nexport { mysqlRuntimeAdapterDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;AAWA,MAAM,UAAU,EAAE,KAAK;AACvB,MAAM,UAAU,KAAK,KAAK;AAC1B,SAAS,OAAO,OAAO;CACtB,MAAM,gBAAgB,6CAA6C,mGAAmG,EAAE,MAAM,EAAE,WAAW,OAAO,MAAM,EAAE,CAAC;AAC5M;;AAEA,MAAM,uBAAuB,EAAE,WAAW,OAAO;CAChD,QAAQ,OAAO,OAAf;EACC,KAAK;GACJ,IAAI,CAAC,OAAO,cAAc,KAAK,GAAG,OAAO,OAAO,KAAK;GACrD,OAAO,SAAS,WAAW,SAAS,UAAU,qBAAqB,OAAO,KAAK;EAChF,KAAK,UAAU,OAAO;EACtB,KAAK,UAAU,OAAO;EACtB,SAAS,OAAO,OAAO,KAAK;CAC7B;AACD,EAAE;;AAIF,SAAS,8BAA8B,KAAK,YAAY;CACvD,M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B,EAAE,CAAC;EAChN,OAAO,eAAe,KAAK,QAAQ,UAAU,KAAKA,OAAO;CAC1D;AACD;;AAEA,SAAS,mBAAmB,QAAQ;CACnC,OAAO,OAAO,OAAO,IAAI,iBAAiB,MAAM,CAAC;AAClD;AAGA,MAAM,gCAAgC;CACrC,GAAG;CACH,cAAc,MAAM,KAAK,6BAA6B,OAAO,CAAC;CAC9D,iBAAiB;CACjB,OAAO,OAAO;EACb,OAAO,mBAAmB,2BAA2B,MAAM,QAAQ,MAAM,UAAU,CAAC;CACrF;AACD"}
|
|
1
|
+
{"version":3,"file":"adapter__runtime.mjs","names":["#codecs"],"sources":["../../../../3-targets/mysql/2-adapter/dist/runtime.mjs"],"sourcesContent":["import { n as mysqlAdapterCapabilities } from \"./contract-contributions-ChiX6W0F.mjs\";\nimport { o as mysqlAdapterDescriptorMeta, r as readMarkerResult } from \"./marker-read-Cf80LSbG.mjs\";\nimport { assembleMysqlCodecRegistry, mysqlCodecDescriptorRegistry } from \"@internal/target-mysql/codecs\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { collectOrderedParamRefs, isDdlNode } from \"@internal/sql-relational-core/ast\";\nimport { mysqlError } from \"@internal/target-mysql/errors\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { escapeLiteral, quoteIdentifier, tokenizeMysqlSql } from \"@internal/target-mysql/sql-utils\";\nimport { timestampNowRuntimeGenerator } from \"@internal/family-sql/runtime\";\nimport { mysqlNowGenerators } from \"@internal/target-mysql/runtime\";\nimport { MYSQL_BIGINT_CODEC_ID, MYSQL_INT_CODEC_ID, MYSQL_TEXT_CODEC_ID } from \"@internal/target-mysql/codec-ids\";\nimport { InternalError, assertNever } from \"@internal/utils/internal-error\";\n//#region src/core/raw-codec-inferer.ts\nconst INT_MIN = -(2 ** 31);\nconst INT_MAX = 2 ** 31 - 1;\nfunction refuse(value) {\n\tthrow structuredError(\"RUNTIME.RAW_SQL_UNSUPPORTED_INTERPOLATION\", \"MySQL has no codec for this JS value in raw SQL: wrap it in `param(...)` with an explicit codec\", { meta: { valueType: typeof value } });\n}\n/** The codec of a bare value interpolated into `fns.raw` or the raw lane on a MySQL client: integers, bigints and strings. */\nconst mysqlRawCodecInferer = { inferCodec(value) {\n\tswitch (typeof value) {\n\t\tcase \"number\":\n\t\t\tif (!Number.isSafeInteger(value)) return refuse(value);\n\t\t\treturn value >= INT_MIN && value <= INT_MAX ? MYSQL_INT_CODEC_ID : refuse(value);\n\t\tcase \"bigint\": return MYSQL_BIGINT_CODEC_ID;\n\t\tcase \"string\": return MYSQL_TEXT_CODEC_ID;\n\t\tdefault: return refuse(value);\n\t}\n} };\n//#endregion\n//#region src/core/placeholders.ts\n/** Refuses a lowered statement unless every placeholder is a numbered `?N` naming one of its parameters and every parameter has a placeholder. */\nfunction assertPlaceholdersMatchParams(sql, paramCount) {\n\tconst tokens = tokenizeMysqlSql(sql).filter((token) => token.kind === \"placeholder\");\n\tconst placeholders = tokens.map((token) => token.text);\n\tconst numbers = tokens.map((token) => token.number ?? NaN);\n\tif (numbers.every((number) => number >= 1 && number <= paramCount) && new Set(numbers).size === paramCount) return;\n\tthrow structuredError(\"RUNTIME.PARAM_PLACEHOLDER_MISMATCH\", `The lowered MySQL statement writes placeholders ${JSON.stringify(placeholders)} for ${paramCount} parameter(s); each parameter must be written as its own numbered placeholder, and no other placeholder may appear.`, {\n\t\twhy: \"A placeholder that does not match a parameter binds a value to the wrong place in the statement, or leaves a value unbound.\",\n\t\tfix: \"Pass values into raw SQL through interpolation rather than writing a `?` in the SQL text.\",\n\t\tmeta: {\n\t\t\tplaceholders,\n\t\t\tparams: paramCount\n\t\t}\n\t});\n}\n//#endregion\n//#region src/core/sql-renderer.ts\n/** The name an upsert gives the row it proposes, which its update reads as `new`.`column`; the ORM writes that row as `excluded`, as Postgres names it. */\nconst PROPOSED_ROW = \"new\";\n/**\n* Raises `group_concat_max_len` for this statement only, past any result a connection can send, so an ordered include does not depend on how the driver set up its session. MySQL takes `SET_VAR` only on the outermost `SELECT`.\n*/\nconst GROUP_CONCAT_HINT = \"/*+ SET_VAR(group_concat_max_len = 4294967295) */\";\n/** MySQL's documented way to write an `OFFSET` with no `LIMIT`: the largest row count it takes. */\nconst NO_LIMIT = \"18446744073709551615\";\nfunction nodeKind(value) {\n\treturn typeof value === \"object\" && value !== null && \"kind\" in value ? String(value.kind) : \"unknown\";\n}\nfunction unsupported(feature, message) {\n\treturn mysqlError(\"RUNTIME.AST_UNSUPPORTED\", message, { meta: {\n\t\ttarget: \"mysql\",\n\t\tfeature\n\t} });\n}\n/**\n* Lowers a query AST to MySQL SQL. Each param is written as `?N`, N being its position in `collectOrderedParamRefs`, the order the runtime encodes and middleware edits params in; a param written twice is bound once. The driver fills the placeholders.\n*/\nfunction renderMysqlSql(ast, contract, codecs) {\n\tconst placeholderNumbers = /* @__PURE__ */ new Map();\n\tconst params = collectOrderedParamRefs(ast).map((ref, index) => {\n\t\tplaceholderNumbers.set(ref, index + 1);\n\t\treturn ref.kind === \"prepared-param-ref\" ? {\n\t\t\tkind: \"bind\",\n\t\t\tname: ref.name\n\t\t} : {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: ref.value\n\t\t};\n\t});\n\tconst ctx = {\n\t\tcontract,\n\t\tcodecs,\n\t\tplaceholderNumbers,\n\t\tuses: { groupConcat: false }\n\t};\n\tconst rendered = renderStatement(ast, ctx);\n\tconst sql = ctx.uses.groupConcat ? withGroupConcatHint(ast, rendered) : rendered;\n\tassertPlaceholdersMatchParams(sql, params.length);\n\treturn Object.freeze({\n\t\tsql,\n\t\tparams\n\t});\n}\n/** Puts `GROUP_CONCAT_HINT` on the outermost `SELECT`; a statement without one would leave `GROUP_CONCAT` at the session's limit, which can cut an array after an element and still read as JSON, so it is refused. */\nfunction withGroupConcatHint(ast, rendered) {\n\tif (ast.kind !== \"select\" || !rendered.startsWith(\"SELECT \")) throw unsupported(\"ordered-array-outside-select\", \"MySQL can build an ordered JSON array only in a SELECT statement, whose outermost SELECT carries the hint that raises group_concat_max_len\");\n\treturn `SELECT ${GROUP_CONCAT_HINT} ${rendered.slice(7)}`;\n}\nfunction renderStatement(ast, ctx) {\n\tswitch (ast.kind) {\n\t\tcase \"select\": return renderSelect(ast, ctx);\n\t\tcase \"raw-query\": return renderParts(ast.parts, ctx);\n\t\tcase \"insert\": return renderInsert(ast, ctx);\n\t\tcase \"update\": return renderUpdate(ast, ctx);\n\t\tcase \"delete\": return renderDelete(ast, ctx);\n\t\tdefault: throw new InternalError(`Unsupported AST node kind: ${nodeKind(ast)}`);\n\t}\n}\nfunction invalid(node, message) {\n\treturn mysqlError(\"RUNTIME.AST_INVALID\", message, { meta: { node } });\n}\n/** MySQL has no `RETURNING`: the SQL family's ORM reads written rows back with a select when the contract does not report `returning`. */\nfunction refuseReturning(returning, what) {\n\tif (returning !== void 0 && returning.length > 0) throw unsupported(\"returning\", `MySQL cannot return the rows ${what} writes; it has no RETURNING`);\n}\nfunction renderInsertValue(value, ctx) {\n\tif (value === void 0 || value.kind === \"default-value\") return \"DEFAULT\";\n\treturn renderExpr(value, ctx);\n}\n/**\n* An insert, with the bare table name: MySQL's `INSERT` takes no alias, so a column of the table is qualified by its name. A row without a value for a column gets `DEFAULT`. An upsert names its proposed row `new` and updates the existing row on any duplicate key. MySQL cannot limit `ON DUPLICATE KEY UPDATE` to named conflict columns, so the adapter does not report `insertOnConflictTarget` and an upsert that names them is refused. Skipping a conflicting row is refused: `INSERT IGNORE` also hides foreign-key and `NOT NULL` errors.\n*/\nfunction renderInsert(ast, ctx) {\n\trefuseReturning(ast.returning, \"an insert\");\n\tif (ast.rows.length === 0) throw invalid(\"insert\", \"INSERT requires at least one row\");\n\tconst table = qualifyTable(ast.table, ctx);\n\tconst insertCtx = {\n\t\t...ctx,\n\t\tinsertInto: {\n\t\t\talias: ast.table.alias ?? ast.table.name,\n\t\t\tname: table\n\t\t}\n\t};\n\tconst columns = [...new Set(ast.rows.flatMap((row) => Object.keys(row)))];\n\tconst values = ast.rows.map((row) => `(${columns.map((column) => renderInsertValue(row[column], insertCtx)).join(\", \")})`).join(\", \");\n\tconst insert = `INSERT INTO ${table} (${columns.map(quoteIdentifier).join(\", \")}) VALUES ${values}`;\n\tconst conflict = ast.onConflict;\n\tif (conflict === void 0) return insert;\n\tconst action = conflict.action;\n\tswitch (action.kind) {\n\t\tcase \"do-nothing\": throw unsupported(\"insert-on-conflict-skip\", \"MySQL cannot skip a conflicting row without also hiding other errors: INSERT IGNORE turns foreign-key and NOT NULL errors into warnings\");\n\t\tcase \"do-update-set\": {\n\t\t\tif (conflict.columns.length > 0) throw unsupported(\"insert-on-conflict-target\", \"MySQL cannot limit ON DUPLICATE KEY UPDATE to named conflict columns: it fires on any unique key\");\n\t\t\tconst assignments = Object.entries(action.set);\n\t\t\tif (assignments.length === 0) throw invalid(\"insert-on-conflict\", \"An upsert requires at least one column to update\");\n\t\t\tconst set = assignments.map(([column, value]) => `${quoteIdentifier(column)} = ${renderExpr(value, insertCtx)}`).join(\", \");\n\t\t\treturn `${insert} AS ${quoteIdentifier(PROPOSED_ROW)} ON DUPLICATE KEY UPDATE ${set}`;\n\t\t}\n\t\tdefault: return assertNever(action, `Unsupported conflict action: ${nodeKind(action)}`);\n\t}\n}\nfunction renderUpdate(ast, ctx) {\n\trefuseReturning(ast.returning, \"an update\");\n\tconst assignments = Object.entries(ast.set);\n\tif (assignments.length === 0) throw invalid(\"update\", \"UPDATE requires at least one column to set\");\n\tconst set = assignments.map(([column, value]) => `${quoteIdentifier(column)} = ${renderExpr(value, ctx)}`).join(\", \");\n\tconst where = ast.where ? ` WHERE ${renderExpr(ast.where, ctx)}` : \"\";\n\treturn `UPDATE ${renderTableSource(ast.table, ctx)} SET ${set}${where}`;\n}\nfunction renderDelete(ast, ctx) {\n\trefuseReturning(ast.returning, \"a delete\");\n\tconst where = ast.where ? ` WHERE ${renderExpr(ast.where, ctx)}` : \"\";\n\treturn `DELETE FROM ${renderTableSource(ast.table, ctx)}${where}`;\n}\nfunction renderLimitOffset(keyword, value, ctx) {\n\tif (value === void 0) return \"\";\n\tif (typeof value === \"number\") return `${keyword} ${value}`;\n\treturn `${keyword} ${value.kind === \"param-ref\" || value.kind === \"prepared-param-ref\" ? placeholder(value, ctx) : renderExpr(value, ctx)}`;\n}\nfunction renderSelect(ast, ctx) {\n\tif (ast.locking !== void 0 && ast.locking.length > 0) throw unsupported(\"locking-clause\", \"Row locks are not supported on MySQL yet, so a select cannot carry a locking clause such as FOR UPDATE\");\n\tif (ast.distinctOn !== void 0 && ast.distinctOn.length > 0) throw unsupported(\"distinct-on\", \"MySQL has no DISTINCT ON\");\n\treturn [\n\t\t`SELECT ${ast.distinct ? \"DISTINCT \" : \"\"}${renderProjection(ast.projection, ctx)}`,\n\t\tast.from === void 0 ? \"\" : `FROM ${renderSource(ast.from, ctx)}`,\n\t\tast.joins?.length ? ast.joins.map((join) => renderJoin(join, ctx)).join(\" \") : \"\",\n\t\tast.where ? `WHERE ${renderExpr(ast.where, ctx)}` : \"\",\n\t\tast.groupBy?.length ? `GROUP BY ${ast.groupBy.map((e) => renderExpr(e, ctx)).join(\", \")}` : \"\",\n\t\tast.having ? `HAVING ${renderExpr(ast.having, ctx)}` : \"\",\n\t\tast.orderBy?.length ? `ORDER BY ${renderOrderByItems(ast.orderBy, ctx)}` : \"\",\n\t\tast.limit === void 0 && ast.offset !== void 0 ? `LIMIT ${NO_LIMIT}` : renderLimitOffset(\"LIMIT\", ast.limit, ctx),\n\t\trenderLimitOffset(\"OFFSET\", ast.offset, ctx)\n\t].filter((part) => part.length > 0).join(\" \");\n}\nfunction renderProjection(projection, ctx) {\n\treturn projection.map((item) => `${renderExpr(item.expr, ctx)} AS ${quoteIdentifier(item.alias)}`).join(\", \");\n}\nfunction qualifyTable(table, ctx) {\n\tif (table.namespaceId === void 0) return quoteIdentifier(table.name);\n\tif (ctx.contract === void 0) throw new InternalError(`Table \"${table.name}\" carries namespace \"${table.namespaceId}\" but no contract was supplied to resolve it`);\n\tconst namespace = ctx.contract.storage.namespaces[table.namespaceId];\n\tif (namespace?.qualifyTable === void 0) throw structuredError(\"RUNTIME.NAMESPACE_UNKNOWN\", `Table \"${table.name}\" references namespace \"${table.namespaceId}\" which the contract does not materialise for SQL rendering`, { meta: {\n\t\ttable: table.name,\n\t\tnamespaceId: table.namespaceId,\n\t\treason: namespace === void 0 ? \"not-present\" : \"not-materialised\"\n\t} });\n\treturn namespace.qualifyTable(table.name);\n}\nfunction renderTableSource(source, ctx) {\n\tconst qualified = qualifyTable(source, ctx);\n\treturn source.alias ? `${qualified} AS ${quoteIdentifier(source.alias)}` : qualified;\n}\nfunction renderSource(source, ctx) {\n\tswitch (source.kind) {\n\t\tcase \"table-source\": return renderTableSource(source, ctx);\n\t\tcase \"derived-table-source\": return `(${renderSelect(source.query, ctx)}) AS ${quoteIdentifier(source.alias)}`;\n\t\tcase \"function-source\": throw unsupported(\"function-source\", `MySQL cannot select from the set-returning function ${source.fn}`);\n\t\tdefault: return assertNever(source, `Unsupported source node kind: ${nodeKind(source)}`);\n\t}\n}\nfunction renderExpr(expr, ctx) {\n\tswitch (expr.kind) {\n\t\tcase \"column-ref\": return renderColumn(expr, ctx);\n\t\tcase \"identifier-ref\": return quoteIdentifier(expr.name);\n\t\tcase \"operation\": return renderOperation(expr, ctx);\n\t\tcase \"subquery\": return renderSubquery(expr, ctx);\n\t\tcase \"aggregate\": return renderAggregate(expr, ctx);\n\t\tcase \"window-func\": return renderWindowFunc(expr, ctx);\n\t\tcase \"function-call\": return renderFunctionCall(expr, ctx);\n\t\tcase \"cast\": return renderCast(expr, ctx);\n\t\tcase \"case\": return renderCase(expr, ctx);\n\t\tcase \"json-object\": return renderJsonObject(expr, ctx);\n\t\tcase \"json-array-agg\": return renderJsonArrayAgg(expr, ctx);\n\t\tcase \"binary\": return renderBinary(expr, ctx);\n\t\tcase \"and\": return expr.exprs.length === 0 ? \"TRUE\" : `(${expr.exprs.map((part) => renderExpr(part, ctx)).join(\" AND \")})`;\n\t\tcase \"or\": return expr.exprs.length === 0 ? \"FALSE\" : `(${expr.exprs.map((part) => renderExpr(part, ctx)).join(\" OR \")})`;\n\t\tcase \"exists\": return `${expr.notExists ? \"NOT \" : \"\"}EXISTS (${renderSelect(expr.subquery, ctx)})`;\n\t\tcase \"null-check\": return renderNullCheck(expr, ctx);\n\t\tcase \"not\": return `NOT (${renderExpr(expr.expr, ctx)})`;\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\": return renderParam(expr, ctx);\n\t\tcase \"literal\": return renderLiteral(expr);\n\t\tcase \"list\": return renderList(expr, ctx);\n\t\tcase \"raw-expr\": return renderParts(expr.parts, ctx);\n\t\tdefault: return assertNever(expr, `Unsupported expression node kind: ${nodeKind(expr)}`);\n\t}\n}\n/** Refuses raw SQL text that puts a digit right after an interpolated value: the value's `?N` and the digit would read as one larger placeholder, `?1` and `0` as `?10`. */\nfunction assertNoDigitAfterParam(parts) {\n\tparts.forEach((part, index) => {\n\t\tconst next = parts[index + 1];\n\t\tif (typeof part !== \"string\" && (part.kind === \"param-ref\" || part.kind === \"prepared-param-ref\") && typeof next === \"string\" && /^\\d/.test(next)) throw structuredError(\"RUNTIME.PARAM_PLACEHOLDER_MISMATCH\", \"Raw SQL puts a digit right after an interpolated value, which MySQL lowering would read as part of the value's placeholder\", {\n\t\t\twhy: \"Each value is written as a numbered placeholder, ?N, so a digit that follows it in the SQL text makes a different placeholder: ?1 followed by 0 reads as ?10.\",\n\t\t\tfix: \"Put a space or an operator between the interpolated value and the digit.\",\n\t\t\tmeta: {\n\t\t\t\treason: \"digit-after-value\",\n\t\t\t\tpart: index + 1\n\t\t\t}\n\t\t});\n\t});\n}\nfunction renderParts(parts, ctx) {\n\tassertNoDigitAfterParam(parts);\n\treturn parts.map((part) => typeof part === \"string\" ? part : renderExpr(part, ctx)).join(\"\");\n}\nfunction renderColumn(ref, ctx) {\n\tconst column = quoteIdentifier(ref.column);\n\tconst { insertInto } = ctx;\n\tif (insertInto !== void 0) {\n\t\tif (ref.table === \"excluded\") return `${quoteIdentifier(PROPOSED_ROW)}.${column}`;\n\t\tif (ref.table === insertInto.alias) return `${insertInto.name}.${column}`;\n\t}\n\treturn `${quoteIdentifier(ref.table)}.${column}`;\n}\n/**\n* A literal the code wrote: a number, a bigint, a boolean or NULL, such as the ORM's `1` and `fns.and(true, …)`. A `LiteralExpr` does not say where its value came from, and no part of Prisma writes a text, date or JSON literal into a MySQL runtime statement, so those are refused: a value of that kind can only be a caller's, which belongs in a param, sent apart from the SQL.\n*/\nfunction renderLiteral(expr) {\n\tconst { value } = expr;\n\tif (value === null || value === void 0) return \"NULL\";\n\tif (typeof value === \"number\") {\n\t\tif (!Number.isFinite(value)) throw unsupported(\"non-finite-number\", `MySQL has no literal for ${value}`);\n\t\treturn String(value);\n\t}\n\tif (typeof value === \"boolean\") return value ? \"TRUE\" : \"FALSE\";\n\tif (typeof value === \"bigint\") return String(value);\n\tthrow unsupported(\"value-literal\", `MySQL lowering writes only numbers, booleans and NULL as literals; a ${value instanceof Date ? \"date\" : Array.isArray(value) ? \"array\" : typeof value} value must be a param`);\n}\n/** Renders each `{{self}}` and `{{argN}}` where the template writes it. */\nfunction renderOperation(expr, ctx) {\n\treturn expr.lowering.template.replace(/\\{\\{(self|arg(\\d+))\\}\\}/g, (_match, _name, index) => {\n\t\tif (index === void 0) return renderExpr(expr.self, ctx);\n\t\tconst arg = expr.args[Number(index)];\n\t\treturn arg === void 0 ? \"\" : renderExpr(arg, ctx);\n\t});\n}\nfunction renderSubquery(expr, ctx) {\n\tif (expr.query.projection.length !== 1) throw structuredError(\"RUNTIME.AST_INVALID\", \"Subquery expressions must project exactly one column\", { meta: { node: \"subquery\" } });\n\treturn `(${renderSelect(expr.query, ctx)})`;\n}\n/** Whether an operand must be parenthesised before an operator is written after it. A new expression kind fails to compile here until someone decides. */\nfunction needsGrouping(expr) {\n\tswitch (expr.kind) {\n\t\tcase \"operation\":\n\t\tcase \"subquery\": return true;\n\t\tcase \"column-ref\":\n\t\tcase \"identifier-ref\":\n\t\tcase \"aggregate\":\n\t\tcase \"window-func\":\n\t\tcase \"function-call\":\n\t\tcase \"cast\":\n\t\tcase \"case\":\n\t\tcase \"json-object\":\n\t\tcase \"json-array-agg\":\n\t\tcase \"binary\":\n\t\tcase \"and\":\n\t\tcase \"or\":\n\t\tcase \"exists\":\n\t\tcase \"null-check\":\n\t\tcase \"not\":\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\":\n\t\tcase \"literal\":\n\t\tcase \"list\":\n\t\tcase \"raw-expr\": return false;\n\t}\n}\nfunction grouped(expr, ctx) {\n\tconst rendered = renderExpr(expr, ctx);\n\treturn needsGrouping(expr) ? `(${rendered})` : rendered;\n}\nfunction renderNullCheck(expr, ctx) {\n\treturn `${grouped(expr.expr, ctx)} ${expr.isNull ? \"IS NULL\" : \"IS NOT NULL\"}`;\n}\nconst BINARY_OPERATORS = {\n\teq: \"=\",\n\tneq: \"<>\",\n\tisNotDistinctFrom: \"<=>\",\n\tgt: \">\",\n\tlt: \"<\",\n\tgte: \">=\",\n\tlte: \"<=\",\n\tlike: \"LIKE\",\n\tin: \"IN\",\n\tnotIn: \"NOT IN\"\n};\nfunction renderBinary(expr, ctx) {\n\tif (expr.right.kind === \"list\" && expr.right.values.length === 0) {\n\t\tif (expr.op === \"in\") return \"FALSE\";\n\t\tif (expr.op === \"notIn\") return \"TRUE\";\n\t}\n\tconst left = grouped(expr.left, ctx);\n\tconst right = renderExpr(expr.right, ctx);\n\tif (expr.op === \"isDistinctFrom\") return `NOT (${left} <=> ${right})`;\n\treturn `${left} ${BINARY_OPERATORS[expr.op]} ${right}`;\n}\nfunction renderList(expr, ctx) {\n\tif (expr.values.length === 0) return \"(NULL)\";\n\treturn `(${expr.values.map((value) => renderExpr(value, ctx)).join(\", \")})`;\n}\nfunction renderAggregate(expr, ctx) {\n\tconst fn = expr.fn.toUpperCase();\n\treturn expr.expr ? `${fn}(${renderExpr(expr.expr, ctx)})` : `${fn}(*)`;\n}\nfunction renderWindowFunc(expr, ctx) {\n\tconst args = expr.args.map((arg) => renderExpr(arg, ctx)).join(\", \");\n\tconst over = [expr.partitionBy?.length ? `PARTITION BY ${expr.partitionBy.map((e) => renderExpr(e, ctx)).join(\", \")}` : \"\", expr.orderBy?.length ? `ORDER BY ${renderOrderByItems(expr.orderBy, ctx)}` : \"\"].filter((part) => part.length > 0).join(\" \");\n\treturn `${expr.fn.toUpperCase()}(${args}) OVER (${over})`;\n}\nfunction renderFunctionCall(expr, ctx) {\n\treturn `${expr.fn}(${expr.args.map((arg) => renderExpr(arg, ctx)).join(\", \")})`;\n}\nfunction renderCast(expr, ctx) {\n\treturn `CAST(${renderExpr(expr.expr, ctx)} AS ${expr.targetType})`;\n}\nfunction renderCase(expr, ctx) {\n\treturn `CASE ${expr.branches.map((branch) => `WHEN ${renderExpr(branch.condition, ctx)} THEN ${renderExpr(branch.value, ctx)}`).join(\" \")}${expr.elseExpr === void 0 ? \"\" : ` ELSE ${renderExpr(expr.elseExpr, ctx)}`} END`;\n}\nfunction descriptorOf(codec, ctx, use) {\n\tconst descriptor = ctx.codecs.descriptorFor(codec.codecId);\n\tif (descriptor === void 0) throw structuredError(\"RUNTIME.PARAM_REF_MISSING_CODEC\", `MySQL lowering: ${use} carries codecId \"${codec.codecId}\" but the MySQL codec registry has no entry for it. Register the extension pack that contributes this codec.`, { meta: { codecId: codec.codecId } });\n\treturn descriptor;\n}\nfunction placeholder(ref, ctx) {\n\tconst number = ctx.placeholderNumbers.get(ref);\n\tif (number === void 0) throw new InternalError(\"A param was written that the AST does not collect\");\n\treturn `?${number}`;\n}\n/** A param as its numbered placeholder, refusing one whose codec the MySQL registry lacks. */\nfunction renderParam(ref, ctx) {\n\tif (ref.codec !== void 0) descriptorOf(ref.codec, ctx, \"a parameter\");\n\treturn placeholder(ref, ctx);\n}\nfunction projectThroughCodec(value, codec, ctx) {\n\treturn descriptorOf(codec, ctx, \"a JSON projection\").projectJson(value, codec);\n}\nfunction renderJsonValue(projection, ctx) {\n\treturn projection.accept({\n\t\tcodec: ({ value, codec }) => renderExpr(projectThroughCodec(value, codec, ctx), ctx),\n\t\tnative: ({ value }) => renderExpr(value, ctx),\n\t\tdocument: ({ value }) => renderExpr(value, ctx)\n\t});\n}\nfunction renderJsonObject(expr, ctx) {\n\treturn `JSON_OBJECT(${expr.entries.flatMap((entry) => [`'${escapeLiteral(entry.key)}'`, renderJsonValue(entry.value, ctx)]).join(\", \")})`;\n}\n/**\n* The element of an ordered JSON array, as JSON text. A document already is JSON; a scalar goes through `JSON_ARRAY`, so a string arrives quoted and escaped.\n*/\nfunction renderJsonElementText(projection, ctx) {\n\tconst rendered = renderJsonValue(projection, ctx);\n\treturn projection.kind === \"document\" ? rendered : `JSON_EXTRACT(JSON_ARRAY(${rendered}), '$[0]')`;\n}\n/**\n* `JSON_ARRAYAGG` takes no `ORDER BY`, and MySQL drops a derived table's `ORDER BY` when the outer query aggregates, so an ordered array is built as text with `GROUP_CONCAT`, which keeps its own order, and cast to JSON. The statement raises `group_concat_max_len` past any result a connection can send (see `GROUP_CONCAT_HINT`), so `GROUP_CONCAT` never cuts the text short. Text longer than `max_allowed_packet` makes `CONCAT` return NULL with only a warning, which would read as an empty include; so an empty array is written only when there are no rows, and a NULL text with rows is replaced by text that is not JSON, which fails the cast and the statement with MySQL's invalid-JSON error. `JSON_ARRAYAGG` fails on its own when its result exceeds a packet. An empty array is `JSON_ARRAY()`, so the column stays JSON and a nested include stays an array.\n*/\nfunction renderJsonArrayAgg(expr, ctx) {\n\tif (expr.orderBy === void 0) {\n\t\tconst aggregated = `JSON_ARRAYAGG(${renderJsonValue(expr.expr, ctx)})`;\n\t\treturn expr.onEmpty === \"emptyArray\" ? `COALESCE(${aggregated}, JSON_ARRAY())` : aggregated;\n\t}\n\tctx.uses.groupConcat = true;\n\tconst text = `CONCAT('[', GROUP_CONCAT(${renderJsonElementText(expr.expr, ctx)} ORDER BY ${renderOrderByItems(expr.orderBy, ctx)} SEPARATOR ','), ']')`;\n\treturn `CASE WHEN COUNT(*) = 0 THEN ${expr.onEmpty === \"emptyArray\" ? \"JSON_ARRAY()\" : \"NULL\"} ELSE CAST(COALESCE(${text}, ${OVERSIZED_ARRAY_TEXT}) AS JSON) END`;\n}\n/** Text that is not JSON, written in place of an array MySQL could not build because it is larger than a packet, so the cast fails. MySQL's error does not show this text: the user sees `Invalid JSON text in argument 1 to function cast_as_json`, which names neither the include nor the packet size. The text counts the rows only so that MySQL evaluates it when it is reached, not while preparing the statement. */\nconst OVERSIZED_ARRAY_TEXT = \"CONCAT('array larger than max_allowed_packet: ', COUNT(*), ' rows')\";\nconst ORDER_DIRECTION = {\n\tasc: \"ASC\",\n\tdesc: \"DESC\"\n};\n/** A NULLS FIRST or NULLS LAST placement, which MySQL lacks, as a leading `IS NULL` sort key. */\nconst NULLS_KEY_DIRECTION = {\n\tfirst: \"DESC\",\n\tlast: \"ASC\"\n};\nfunction renderOrderByItem(item, ctx) {\n\treturn `${item.nulls === void 0 ? \"\" : `${grouped(item.expr, ctx)} IS NULL ${NULLS_KEY_DIRECTION[item.nulls]}, `}${renderExpr(item.expr, ctx)} ${ORDER_DIRECTION[item.dir]}`;\n}\nfunction renderOrderByItems(items, ctx) {\n\treturn items.map((item) => renderOrderByItem(item, ctx)).join(\", \");\n}\nfunction renderJoin(join, ctx) {\n\tif (join.joinType === \"full\") throw unsupported(\"full-join\", \"MySQL has no FULL JOIN\");\n\tif (join.lateral) throw unsupported(\"lateral-join\", \"LATERAL joins are not supported on MySQL yet\");\n\treturn `${join.joinType.toUpperCase()} JOIN ${renderSource(join.source, ctx)} ON ${renderJoinOn(join.on, ctx)}`;\n}\nfunction renderJoinOn(on, ctx) {\n\treturn on.kind === \"eq-col-join-on\" ? `${renderColumn(on.left, ctx)} = ${renderColumn(on.right, ctx)}` : renderExpr(on, ctx);\n}\n//#endregion\n//#region src/core/runtime/mysql-adapter.ts\nfunction markerQuery(queryable) {\n\treturn { async query(sql, params) {\n\t\tconst rows = [];\n\t\tfor await (const row of queryable.query({\n\t\t\tsql,\n\t\t\t...params ? { params } : {}\n\t\t})) rows.push(row);\n\t\treturn { rows };\n\t} };\n}\nvar MysqlAdapterImpl = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"mysql\";\n\tprofile;\n\t#codecs;\n\tconstructor(codecs) {\n\t\tthis.#codecs = codecs;\n\t\tthis.profile = Object.freeze({\n\t\t\tid: \"mysql/default@1\",\n\t\t\ttarget: \"mysql\",\n\t\t\tcapabilities: mysqlAdapterCapabilities,\n\t\t\treadMarker: (queryable) => readMarkerResult(markerQuery(queryable), APP_SPACE_ID)\n\t\t});\n\t}\n\tlower(ast, context) {\n\t\tif (isDdlNode(ast)) throw structuredError(\"RUNTIME.DDL_UNSUPPORTED\", \"lower() does not lower DDL on the runtime adapter: DDL lowering belongs to the control adapter.\", { meta: { surface: \"runtime-adapter\" } });\n\t\treturn renderMysqlSql(ast, context.contract, this.#codecs);\n\t}\n};\n/** The MySQL runtime adapter: it lowers queries with the MySQL renderer and reads the marker 2b's control tables hold. */\nfunction createMysqlAdapter(codecs) {\n\treturn Object.freeze(new MysqlAdapterImpl(codecs));\n}\n//#endregion\n//#region src/core/runtime/runtime-adapter.ts\n/** The `now()` generators of the MySQL date and time types: the SQL family's `timestampNow` for a `Date`, and the target's for every other value. */\nfunction createMysqlMutationDefaultGenerators() {\n\treturn [timestampNowRuntimeGenerator(), ...mysqlNowGenerators.map(({ id, generate }) => ({\n\t\tid,\n\t\tgenerate,\n\t\tstability: \"query\"\n\t}))];\n}\nconst mysqlRuntimeAdapterDescriptor = {\n\t...mysqlAdapterDescriptorMeta,\n\tcodecs: () => Array.from(mysqlCodecDescriptorRegistry.values()),\n\tmutationDefaultGenerators: createMysqlMutationDefaultGenerators,\n\trawCodecInferer: mysqlRawCodecInferer,\n\tcreate(stack) {\n\t\treturn createMysqlAdapter(assembleMysqlCodecRegistry(stack.target, stack.extensions));\n\t}\n};\n//#endregion\nexport { mysqlRuntimeAdap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VLnNzZ8.mjs}
RENAMED
|
@@ -2,7 +2,9 @@ import { CodecDescriptorImpl, validateCodecTypeParams } from "@prisma/orm-framew
|
|
|
2
2
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
3
3
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
4
4
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
5
|
-
//#region ../../../3-targets/mysql/1-target/dist/codec-descriptor-
|
|
5
|
+
//#region ../../../3-targets/mysql/1-target/dist/codec-descriptor-3xp1XvVH.mjs
|
|
6
|
+
/** Projects a column whose JSON form, a number or a string, is what its `fromWire` reads. */
|
|
7
|
+
const identityJsonProjection = (expression) => expression;
|
|
6
8
|
const MYSQL_CODEC_DESCRIPTOR_KIND = "mysql-codec";
|
|
7
9
|
/**
|
|
8
10
|
* 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.
|
|
@@ -88,6 +90,6 @@ function candidateCodecId(value) {
|
|
|
88
90
|
return typeof value === "object" && value !== null && "codecId" in value && typeof value.codecId === "string" ? value.codecId : "<unknown>";
|
|
89
91
|
}
|
|
90
92
|
//#endregion
|
|
91
|
-
export { mysqlCodec as i, buildMysqlCodecDescriptorRegistry as n,
|
|
93
|
+
export { mysqlCodec as a, isMysqlCodecDescriptor as i, buildMysqlCodecDescriptorRegistry as n, identityJsonProjection as r, MysqlCodecDescriptor as t };
|
|
92
94
|
|
|
93
|
-
//# sourceMappingURL=codec-descriptor-
|
|
95
|
+
//# sourceMappingURL=codec-descriptor-3xp1XvVH-yVLnNzZ8.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-descriptor-3xp1XvVH-yVLnNzZ8.mjs","names":["#descriptors"],"sources":["../../../../3-targets/mysql/1-target/dist/codec-descriptor-3xp1XvVH.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\n/** Projects a column whose JSON form, a number or a string, is what its `fromWire` reads. */\nconst identityJsonProjection = (expression) => expression;\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 a, isMysqlCodecDescriptor as i, buildMysqlCodecDescriptorRegistry as n, identityJsonProjection as r, MysqlCodecDescriptor as t };\n\n//# sourceMappingURL=codec-descriptor-3xp1XvVH.mjs.map"],"mappings":";;;;;;AAMA,MAAM,0BAA0B,eAAe;AAC/C,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,KAAK,GAAG,MAAM,IAAI,cAAc,GAAG,WAAW,QAAQ,6GAA6G;EACzM,IAAI,QAAQ,uBAAuB,KAAK,GAAG,KAAK,qBAAqB,QAAQ;CAC9E;CACA,WAAW,WAAW,KAAK,QAAQ,QAAQ,MAAM,KAAK,QAAQ,UAAU,MAAM;CAC9E,eAAe,YAAY,QAAQ;EA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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region ../../../3-targets/mysql/1-target/dist/codec-ids-CrR9Xi7r.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
|
+
const MYSQL_DATETIME_TEMPORAL_CODEC_ID = "mysql/datetime-temporal@1";
|
|
8
|
+
const MYSQL_DATETIME_STRING_CODEC_ID = "mysql/datetime-string@1";
|
|
9
|
+
const MYSQL_TIMESTAMP_DATE_CODEC_ID = "mysql/timestamp-date@1";
|
|
10
|
+
const MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID = "mysql/timestamp-temporal@1";
|
|
11
|
+
const MYSQL_TIMESTAMP_STRING_CODEC_ID = "mysql/timestamp-string@1";
|
|
12
|
+
const MYSQL_DATE_STRING_CODEC_ID = "mysql/date-string@1";
|
|
13
|
+
const MYSQL_DATE_TEMPORAL_CODEC_ID = "mysql/date-temporal@1";
|
|
14
|
+
const MYSQL_TIME_STRING_CODEC_ID = "mysql/time-string@1";
|
|
15
|
+
const MYSQL_TIME_TEMPORAL_CODEC_ID = "mysql/time-temporal@1";
|
|
16
|
+
const MYSQL_DURATION_STRING_CODEC_ID = "mysql/duration-string@1";
|
|
17
|
+
//#endregion
|
|
18
|
+
export { MYSQL_DATE_STRING_CODEC_ID as a, MYSQL_ENUM_CODEC_ID as c, MYSQL_TIMESTAMP_DATE_CODEC_ID as d, MYSQL_TIMESTAMP_STRING_CODEC_ID as f, MYSQL_TIME_TEMPORAL_CODEC_ID as h, MYSQL_DATETIME_TEMPORAL_CODEC_ID as i, MYSQL_INT_CODEC_ID as l, MYSQL_TIME_STRING_CODEC_ID as m, MYSQL_DATETIME_CODEC_ID as n, MYSQL_DATE_TEMPORAL_CODEC_ID as o, MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID as p, MYSQL_DATETIME_STRING_CODEC_ID as r, MYSQL_DURATION_STRING_CODEC_ID as s, MYSQL_BIGINT_CODEC_ID as t, MYSQL_TEXT_CODEC_ID as u };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=codec-ids-CrR9Xi7r-CarpqbNM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-ids-CrR9Xi7r-CarpqbNM.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/codec-ids-CrR9Xi7r.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\";\nconst MYSQL_DATETIME_TEMPORAL_CODEC_ID = \"mysql/datetime-temporal@1\";\nconst MYSQL_DATETIME_STRING_CODEC_ID = \"mysql/datetime-string@1\";\nconst MYSQL_TIMESTAMP_DATE_CODEC_ID = \"mysql/timestamp-date@1\";\nconst MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID = \"mysql/timestamp-temporal@1\";\nconst MYSQL_TIMESTAMP_STRING_CODEC_ID = \"mysql/timestamp-string@1\";\nconst MYSQL_DATE_STRING_CODEC_ID = \"mysql/date-string@1\";\nconst MYSQL_DATE_TEMPORAL_CODEC_ID = \"mysql/date-temporal@1\";\nconst MYSQL_TIME_STRING_CODEC_ID = \"mysql/time-string@1\";\nconst MYSQL_TIME_TEMPORAL_CODEC_ID = \"mysql/time-temporal@1\";\nconst MYSQL_DURATION_STRING_CODEC_ID = \"mysql/duration-string@1\";\n//#endregion\nexport { MYSQL_DATE_STRING_CODEC_ID as a, MYSQL_ENUM_CODEC_ID as c, MYSQL_TIMESTAMP_DATE_CODEC_ID as d, MYSQL_TIMESTAMP_STRING_CODEC_ID as f, MYSQL_TIME_TEMPORAL_CODEC_ID as h, MYSQL_DATETIME_TEMPORAL_CODEC_ID as i, MYSQL_INT_CODEC_ID as l, MYSQL_TIME_STRING_CODEC_ID as m, MYSQL_DATETIME_CODEC_ID as n, MYSQL_DATE_TEMPORAL_CODEC_ID as o, MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID as p, MYSQL_DATETIME_STRING_CODEC_ID as r, MYSQL_DURATION_STRING_CODEC_ID as s, MYSQL_BIGINT_CODEC_ID as t, MYSQL_TEXT_CODEC_ID as u };\n\n//# sourceMappingURL=codec-ids-CrR9Xi7r.mjs.map"],"mappings":";AACA,MAAM,qBAAqB;AAC3B,MAAM,wBAAwB;AAC9B,MAAM,sBAAsB;AAC5B,MAAM,0BAA0B;AAChC,MAAM,sBAAsB;AAC5B,MAAM,mCAAmC;AACzC,MAAM,iCAAiC;AACvC,MAAM,gCAAgC;AACtC,MAAM,oCAAoC;AAC1C,MAAM,kCAAkC;AACxC,MAAM,6BAA6B;AACnC,MAAM,+BAA+B;AACrC,MAAM,6BAA6B;AACnC,MAAM,+BAA+B;AACrC,MAAM,iCAAiC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region ../../../3-targets/mysql/1-target/dist/codec-ids-Dgh5IpML.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
|
+
declare const MYSQL_DATETIME_TEMPORAL_CODEC_ID: "mysql/datetime-temporal@1";
|
|
9
|
+
declare const MYSQL_DATETIME_STRING_CODEC_ID: "mysql/datetime-string@1";
|
|
10
|
+
declare const MYSQL_TIMESTAMP_DATE_CODEC_ID: "mysql/timestamp-date@1";
|
|
11
|
+
declare const MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID: "mysql/timestamp-temporal@1";
|
|
12
|
+
declare const MYSQL_TIMESTAMP_STRING_CODEC_ID: "mysql/timestamp-string@1";
|
|
13
|
+
declare const MYSQL_DATE_STRING_CODEC_ID: "mysql/date-string@1";
|
|
14
|
+
declare const MYSQL_DATE_TEMPORAL_CODEC_ID: "mysql/date-temporal@1";
|
|
15
|
+
declare const MYSQL_TIME_STRING_CODEC_ID: "mysql/time-string@1";
|
|
16
|
+
declare const MYSQL_TIME_TEMPORAL_CODEC_ID: "mysql/time-temporal@1";
|
|
17
|
+
declare const MYSQL_DURATION_STRING_CODEC_ID: "mysql/duration-string@1";
|
|
18
|
+
//#endregion
|
|
19
|
+
export { MYSQL_DATE_STRING_CODEC_ID as a, MYSQL_ENUM_CODEC_ID as c, MYSQL_TIMESTAMP_DATE_CODEC_ID as d, MYSQL_TIMESTAMP_STRING_CODEC_ID as f, MYSQL_TIME_TEMPORAL_CODEC_ID as h, MYSQL_DATETIME_TEMPORAL_CODEC_ID as i, MYSQL_INT_CODEC_ID as l, MYSQL_TIME_STRING_CODEC_ID as m, MYSQL_DATETIME_CODEC_ID as n, MYSQL_DATE_TEMPORAL_CODEC_ID as o, MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID as p, MYSQL_DATETIME_STRING_CODEC_ID as r, MYSQL_DURATION_STRING_CODEC_ID as s, MYSQL_BIGINT_CODEC_ID as t, MYSQL_TEXT_CODEC_ID as u };
|
|
20
|
+
//# sourceMappingURL=codec-ids-Dgh5IpML-76oBMuwK.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-ids-Dgh5IpML-76oBMuwK.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/codec-ids-Dgh5IpML.d.mts"],"mappings":";;cACc;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./codec-types-Bai_CFkk-Blx2GxCH.mjs";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { t as AdaptedMysqlCodecDescriptor } from "./codec-descriptor-DXyubAS6-siA0R8Ow.mjs";
|
|
2
|
+
import "./codec-descriptor-J3TP08l8-ekLvUVxW.mjs";
|
|
3
|
+
import { a as MysqlDatetimeStringDescriptor, c as MysqlEnumDescriptor, d as MysqlTimeStringDescriptor, f as MysqlTimeTemporalDescriptor, h as MysqlTimestampTemporalDescriptor, i as MysqlDatetimeDescriptor, l as MysqlIntDescriptor, m as MysqlTimestampStringDescriptor, n as MysqlDateStringDescriptor, o as MysqlDatetimeTemporalDescriptor, p as MysqlTimestampDateDescriptor, r as MysqlDateTemporalDescriptor, s as MysqlDurationStringDescriptor, t as MysqlBigintDescriptor, u as MysqlTextDescriptor } from "./codecs-BMidk26M-DsKq6wt5.mjs";
|
|
4
|
+
import { ExtractCodecTypes } from "@prisma/orm-family-sql/relational-core/ast";
|
|
5
|
+
//#region ../../../3-targets/mysql/1-target/dist/codec-types-Bai_CFkk.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 'datetime-temporal': MysqlDatetimeTemporalDescriptor;
|
|
16
|
+
readonly 'datetime-string': MysqlDatetimeStringDescriptor;
|
|
17
|
+
readonly 'timestamp-date': MysqlTimestampDateDescriptor;
|
|
18
|
+
readonly 'timestamp-temporal': MysqlTimestampTemporalDescriptor;
|
|
19
|
+
readonly 'timestamp-string': MysqlTimestampStringDescriptor;
|
|
20
|
+
readonly 'date-string': MysqlDateStringDescriptor;
|
|
21
|
+
readonly 'date-temporal': MysqlDateTemporalDescriptor;
|
|
22
|
+
readonly 'time-string': MysqlTimeStringDescriptor;
|
|
23
|
+
readonly 'time-temporal': MysqlTimeTemporalDescriptor;
|
|
24
|
+
readonly 'duration-string': MysqlDurationStringDescriptor;
|
|
25
|
+
readonly enum: MysqlEnumDescriptor;
|
|
26
|
+
};
|
|
27
|
+
type Resolve<T> = { readonly [K in keyof T]: { readonly [P in keyof T[K]]: T[K][P]; }; };
|
|
28
|
+
type CodecTypes = Resolve<ExtractCodecTypes<typeof codecDescriptorMap>>;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { CodecTypes as t };
|
|
31
|
+
//# sourceMappingURL=codec-types-Bai_CFkk-Blx2GxCH.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-types-Bai_CFkk-Blx2GxCH.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/codec-types-Bai_CFkk.d.mts"],"mappings":";;;;;;cAKc;WACH,MAAM,wEAAwE;WAC9E,SAAS,wEAAwE;WACjF,KAAK,wEAAwE;WAC7E,MAAM;WACN,KAAK;WACL,QAAQ;WACR,UAAU;WACV,qBAAqB;WACrB,mBAAmB;WACnB,kBAAkB;WAClB,sBAAsB;WACtB,oBAAoB;WACpB,eAAe;WACf,iBAAiB;WACjB,eAAe;WACf,iBAAiB;WACjB,mBAAmB;WACnB,MAAM;;KAEZ,QAAQ,iBAAiB,WAAW,gBAAgB,WAAW,EAAE,KAAK,EAAE,GAAG;KAC3E,aAAa,QAAQ,yBAAyB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./codec-types-BH5moCD9.mjs";
|