@prisma/orm-target-mysql 8.0.0-rc.24-dev.28 → 8.0.0-rc.24-dev.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter-D4QpAe2i.d.mts +374 -0
- package/dist/adapter-D4QpAe2i.d.mts.map +1 -0
- package/dist/adapter.d.mts +8 -6
- package/dist/adapter.mjs +5 -3
- package/dist/adapter__adapter.d.mts +1 -1
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__codec-types.d.mts +2 -2
- package/dist/adapter__control.d.mts +1 -1
- package/dist/adapter__control.mjs +1 -1
- package/dist/adapter__runtime.d.mts +2 -2
- package/dist/adapter__runtime.mjs +2 -501
- package/dist/adapter__sql-renderer.d.mts +3 -0
- package/dist/adapter__sql-renderer.mjs +2 -0
- package/dist/aggregates-BK8qyA2x.d.mts +164 -0
- package/dist/aggregates-BK8qyA2x.d.mts.map +1 -0
- package/dist/aggregates-Bk6CCgQ-.mjs +145 -0
- package/dist/aggregates-Bk6CCgQ-.mjs.map +1 -0
- package/dist/codec-descriptor-B1fMmxOK-D59zKJws.d.mts +1 -0
- package/dist/{codec-descriptor-3xp1XvVH-DfPKpYeP.mjs → codec-descriptor-ByN7iIha-48yW7oDN.mjs} +23 -16
- package/dist/codec-descriptor-ByN7iIha-48yW7oDN.mjs.map +1 -0
- package/dist/codec-descriptor-CqM_hQjY.d.mts +2 -0
- package/dist/{codec-descriptor-DXyubAS6-XDBj6Yet.d.mts → codec-descriptor-DXsJwUng-D4abEAFs.d.mts} +10 -5
- package/dist/codec-descriptor-DXsJwUng-D4abEAFs.d.mts.map +1 -0
- package/dist/codec-ids-DHeJ2SMJ-Uz1FAFmQ.d.mts +26 -0
- package/dist/codec-ids-DHeJ2SMJ-Uz1FAFmQ.d.mts.map +1 -0
- package/dist/codec-ids-DuWt4aOn-DiyLf9dW.mjs +26 -0
- package/dist/codec-ids-DuWt4aOn-DiyLf9dW.mjs.map +1 -0
- package/dist/codec-types-BQBBUlf_.d.mts +1 -0
- package/dist/{codec-types-Bai_CFkk-DmZ74URd.d.mts → codec-types-C4Q_JJgX-CUPkvPDx.d.mts} +11 -5
- package/dist/codec-types-C4Q_JJgX-CUPkvPDx.d.mts.map +1 -0
- package/dist/codec-types-DxSSgcpB.d.mts +1 -0
- package/dist/{codecs-BMidk26M-B_iWNti6.d.mts → codecs-D35fqdXJ-BZwilYUu.d.mts} +115 -7
- package/dist/codecs-D35fqdXJ-BZwilYUu.d.mts.map +1 -0
- package/dist/{codecs-CIJRyUd3.d.mts → codecs-DTfUoamS.d.mts} +3 -3
- package/dist/{codecs-CIJRyUd3.d.mts.map → codecs-DTfUoamS.d.mts.map} +1 -1
- package/dist/{codecs-wVJlFapM.mjs → codecs-DVX-3El1.mjs} +429 -12
- package/dist/codecs-DVX-3El1.mjs.map +1 -0
- package/dist/{control-Dj8nIA1M.d.mts → control-B7v7zc3l.d.mts} +272 -13
- package/dist/control-B7v7zc3l.d.mts.map +1 -0
- package/dist/{control-D7_IpeiU.d.mts → control-BFe8NrSk.d.mts} +22 -5
- package/dist/control-BFe8NrSk.d.mts.map +1 -0
- package/dist/{control-CTfV1Zag.mjs → control-CZSBblPm.mjs} +26 -19
- package/dist/control-CZSBblPm.mjs.map +1 -0
- package/dist/{control-BiZaCqna.mjs → control-DDYbRiZF.mjs} +28 -13
- package/dist/control-DDYbRiZF.mjs.map +1 -0
- package/dist/{control-WNuLF2Wh.d.mts → control-DqJJGh-5.d.mts} +3 -3
- package/dist/control-DqJJGh-5.d.mts.map +1 -0
- package/dist/{control-RYDTbndD.mjs → control-DtXS4WsY.mjs} +9 -14
- package/dist/control-DtXS4WsY.mjs.map +1 -0
- package/dist/data-type-entries-DlbQ1Bvl-BFkHeHVz.mjs +108 -0
- package/dist/data-type-entries-DlbQ1Bvl-BFkHeHVz.mjs.map +1 -0
- package/dist/{data-types-65iVc7q1.d.mts → data-types-COQT9bVG.d.mts} +2 -2
- package/dist/data-types-COQT9bVG.d.mts.map +1 -0
- package/dist/data-types-CU_43cNv-CQ8eHx3H.mjs +461 -0
- package/dist/data-types-CU_43cNv-CQ8eHx3H.mjs.map +1 -0
- package/dist/{data-types-D2HAT-Qf-CSdDz1Pk.d.mts → data-types-C_vInIbm-Gt1XINav.d.mts} +58 -4
- package/dist/data-types-C_vInIbm-Gt1XINav.d.mts.map +1 -0
- package/dist/{date-time-now-generators-BKakW3gd-CIFPuRdM.mjs → date-time-now-generators-Cx_aQTSw-ay1tlvw6.mjs} +4 -15
- package/dist/date-time-now-generators-Cx_aQTSw-ay1tlvw6.mjs.map +1 -0
- package/dist/default-normalizer-C9c043DP-DPhwJOC4.mjs +175 -0
- package/dist/default-normalizer-C9c043DP-DPhwJOC4.mjs.map +1 -0
- package/dist/default-normalizer-zXWtDBp_.d.mts +31 -0
- package/dist/default-normalizer-zXWtDBp_.d.mts.map +1 -0
- package/dist/{descriptor-meta-e29H69KN-t-S8_DYh.mjs → descriptor-meta-BFQUMwkh-Bc3o-ZMV.mjs} +19 -12
- package/dist/descriptor-meta-BFQUMwkh-Bc3o-ZMV.mjs.map +1 -0
- package/dist/{descriptor-meta-BF6YvSag-ChHHvlHc.mjs → descriptor-meta-BHSEcFWR-41BcRcOy.mjs} +219 -25
- package/dist/descriptor-meta-BHSEcFWR-41BcRcOy.mjs.map +1 -0
- package/dist/descriptor-meta-runtime-BaIF7fOE-BX9t3rkk.mjs +17 -0
- package/dist/descriptor-meta-runtime-BaIF7fOE-BX9t3rkk.mjs.map +1 -0
- package/dist/descriptor-meta-runtime-DEKunXiL.d.mts +22 -0
- package/dist/descriptor-meta-runtime-DEKunXiL.d.mts.map +1 -0
- package/dist/driver.d.mts +3 -3
- package/dist/driver.mjs +2 -2
- package/dist/driver__control.d.mts +2 -2
- package/dist/driver__control.mjs +1 -1
- package/dist/driver__runtime.d.mts +2 -2
- package/dist/driver__runtime.mjs +1 -1
- package/dist/{errors-DjCkC9IM.d.mts → errors-B81Qeu5_.d.mts} +3 -2
- package/dist/errors-B81Qeu5_.d.mts.map +1 -0
- package/dist/{errors-Cng94tYg-DTH51xWG.mjs → errors-CWtFTnst-xBLJ-9Lp.mjs} +43 -17
- package/dist/errors-CWtFTnst-xBLJ-9Lp.mjs.map +1 -0
- package/dist/{marker-lock-Bwew7cAs-ElLxlCQp.mjs → marker-lock-B7CyXf2F-CakjZnQP.mjs} +3 -3
- package/dist/{marker-lock-Bwew7cAs-ElLxlCQp.mjs.map → marker-lock-B7CyXf2F-CakjZnQP.mjs.map} +1 -1
- package/dist/{marker-read-D1hp62hF-3-4fEgDD.mjs → marker-read-D1hp62hF-BSXs2TVo.mjs} +3 -3
- package/dist/{marker-read-D1hp62hF-3-4fEgDD.mjs.map → marker-read-D1hp62hF-BSXs2TVo.mjs.map} +1 -1
- package/dist/{migration-DILkj7kB.d.mts → migration-O-3NHVlW.d.mts} +2 -5
- package/dist/migration-O-3NHVlW.d.mts.map +1 -0
- package/dist/{mysql-contract-serializer-BnTKRSsN-BnV7fdYd.mjs → mysql-contract-serializer-D7NjmI2L-gTs-kAW1.mjs} +4 -4
- package/dist/{mysql-contract-serializer-BnTKRSsN-BnV7fdYd.mjs.map → mysql-contract-serializer-D7NjmI2L-gTs-kAW1.mjs.map} +1 -1
- package/dist/{mysql-database-CHl9-oSL-B1arvq6Q.mjs → mysql-database-ByniOtau-BKBIGgSm.mjs} +45 -17
- package/dist/mysql-database-ByniOtau-BKBIGgSm.mjs.map +1 -0
- package/dist/{now-expression-DVD18CUc-DJqdZY96.mjs → now-expression-DDHpZL6o-Ixs-vg-B.mjs} +3 -3
- package/dist/{now-expression-DVD18CUc-DJqdZY96.mjs.map → now-expression-DDHpZL6o-Ixs-vg-B.mjs.map} +1 -1
- package/dist/{pack-CqULIal0.d.mts → pack-C5_g-3YX.d.mts} +272 -11
- package/dist/{pack-CqULIal0.d.mts.map → pack-C5_g-3YX.d.mts.map} +1 -1
- package/dist/{require-temporal-DeDQhbTn-CdpjEWCB.mjs → require-temporal-DDdrgVtL-VOKxTqhD.mjs} +3 -3
- package/dist/{require-temporal-DeDQhbTn-CdpjEWCB.mjs.map → require-temporal-DDdrgVtL-VOKxTqhD.mjs.map} +1 -1
- package/dist/{runner-DEKKxDyw-Cdo1Ysod.mjs → runner-IjNtlp_v-DLCqpSh5.mjs} +68 -72
- package/dist/runner-IjNtlp_v-DLCqpSh5.mjs.map +1 -0
- package/dist/runtime-Bw6vKz9t.mjs +96 -0
- package/dist/runtime-Bw6vKz9t.mjs.map +1 -0
- package/dist/{runtime-DN20lWEg.d.mts → runtime-CQ1V-8Yh.d.mts} +11 -4
- package/dist/runtime-CQ1V-8Yh.d.mts.map +1 -0
- package/dist/{runtime-CbqytTbM.d.mts → runtime-Ci3hPz1j.d.mts} +16 -5
- package/dist/runtime-Ci3hPz1j.d.mts.map +1 -0
- package/dist/{runtime-DB0w8R7i.mjs → runtime-GFrdQjfS.mjs} +66 -46
- package/dist/runtime-GFrdQjfS.mjs.map +1 -0
- package/dist/{runtime-DUDdsFyy.mjs → runtime-_c_DZuYR.mjs} +18 -13
- package/dist/runtime-_c_DZuYR.mjs.map +1 -0
- package/dist/runtime-dn4-kzZV.d.mts +43 -0
- package/dist/runtime-dn4-kzZV.d.mts.map +1 -0
- package/dist/sql-renderer-CrnJ8cCo.d.mts +1 -0
- package/dist/sql-renderer-DfPaqPkD-DFaweHvr.mjs +501 -0
- package/dist/sql-renderer-DfPaqPkD-DFaweHvr.mjs.map +1 -0
- package/dist/sql-renderer-fnDhRUHs-CcsyIaZ4.d.mts +95 -0
- package/dist/sql-renderer-fnDhRUHs-CcsyIaZ4.d.mts.map +1 -0
- package/dist/{sql-utils-Cmv_TVa8-CNW3UmfQ.mjs → sql-utils-CveZhawQ-B2QmUlY0.mjs} +3 -3
- package/dist/{sql-utils-Cmv_TVa8-CNW3UmfQ.mjs.map → sql-utils-CveZhawQ-B2QmUlY0.mjs.map} +1 -1
- package/dist/{sql-utils-BE8tDXHs.mjs → sql-utils-DVH8boEI.mjs} +3 -6
- package/dist/sql-utils-DVH8boEI.mjs.map +1 -0
- package/dist/{statement-CT5tB4uX-CHqHFM3z.mjs → statement-TYj15jxs-CVLylCdl.mjs} +78 -72
- package/dist/statement-TYj15jxs-CVLylCdl.mjs.map +1 -0
- package/dist/target.d.mts +18 -16
- package/dist/target.mjs +21 -19
- package/dist/target__aggregates.d.mts +2 -0
- package/dist/target__aggregates.mjs +2 -0
- package/dist/target__codec-descriptor.d.mts +2 -2
- package/dist/target__codec-descriptor.mjs +1 -1
- package/dist/target__codec-ids.d.mts +2 -2
- package/dist/target__codec-ids.mjs +2 -2
- package/dist/target__codec-types.d.mts +2 -2
- package/dist/target__codecs.d.mts +2 -2
- package/dist/target__codecs.mjs +2 -2
- package/dist/target__control.d.mts +1 -1
- package/dist/target__control.mjs +2 -2
- package/dist/target__data-types.d.mts +3 -3
- package/dist/target__data-types.mjs +3 -3
- package/dist/target__default-normalizer.d.mts +2 -2
- package/dist/target__default-normalizer.mjs +2 -2
- package/dist/target__descriptor-meta-runtime.d.mts +2 -0
- package/dist/target__descriptor-meta-runtime.mjs +2 -0
- package/dist/target__errors.d.mts +1 -1
- package/dist/target__errors.mjs +1 -1
- package/dist/target__marker-lock.mjs +1 -1
- package/dist/target__migration.d.mts +1 -1
- package/dist/target__migration.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__runtime.d.mts +2 -2
- package/dist/target__runtime.mjs +4 -4
- package/dist/target__sql-utils.mjs +2 -2
- package/dist/target__types.mjs +1 -1
- package/package.json +16 -13
- package/dist/adapter-1Kd67Gfa.d.mts +0 -66
- package/dist/adapter-1Kd67Gfa.d.mts.map +0 -1
- package/dist/adapter__runtime.mjs.map +0 -1
- package/dist/codec-descriptor-3xp1XvVH-DfPKpYeP.mjs.map +0 -1
- package/dist/codec-descriptor-BRcKIX3h.d.mts +0 -2
- package/dist/codec-descriptor-DXyubAS6-XDBj6Yet.d.mts.map +0 -1
- package/dist/codec-descriptor-J3TP08l8-BmdgkIU6.d.mts +0 -1
- package/dist/codec-ids-CrR9Xi7r-CjbGCS3o.mjs +0 -20
- package/dist/codec-ids-CrR9Xi7r-CjbGCS3o.mjs.map +0 -1
- package/dist/codec-ids-Dgh5IpML-DGXIq6j8.d.mts +0 -20
- package/dist/codec-ids-Dgh5IpML-DGXIq6j8.d.mts.map +0 -1
- package/dist/codec-types-BS-lWfda.d.mts +0 -1
- package/dist/codec-types-Bai_CFkk-DmZ74URd.d.mts.map +0 -1
- package/dist/codec-types-Dk2h5dBB.d.mts +0 -1
- package/dist/codecs-BMidk26M-B_iWNti6.d.mts.map +0 -1
- package/dist/codecs-wVJlFapM.mjs.map +0 -1
- package/dist/control-BiZaCqna.mjs.map +0 -1
- package/dist/control-CTfV1Zag.mjs.map +0 -1
- package/dist/control-D7_IpeiU.d.mts.map +0 -1
- package/dist/control-Dj8nIA1M.d.mts.map +0 -1
- package/dist/control-RYDTbndD.mjs.map +0 -1
- package/dist/control-WNuLF2Wh.d.mts.map +0 -1
- package/dist/data-type-entries-C7VH2IHc-DM6TbTaz.mjs +0 -59
- package/dist/data-type-entries-C7VH2IHc-DM6TbTaz.mjs.map +0 -1
- package/dist/data-types-65iVc7q1.d.mts.map +0 -1
- package/dist/data-types-D2HAT-Qf-CSdDz1Pk.d.mts.map +0 -1
- package/dist/data-types-DOaaPS93-lycGybNk.mjs +0 -289
- package/dist/data-types-DOaaPS93-lycGybNk.mjs.map +0 -1
- package/dist/date-time-now-generators-BKakW3gd-CIFPuRdM.mjs.map +0 -1
- package/dist/default-normalizer-C8pc7SbL-BXd70q02.mjs +0 -100
- package/dist/default-normalizer-C8pc7SbL-BXd70q02.mjs.map +0 -1
- package/dist/default-normalizer-D-8Ii0df.d.mts +0 -27
- package/dist/default-normalizer-D-8Ii0df.d.mts.map +0 -1
- package/dist/descriptor-meta-BF6YvSag-ChHHvlHc.mjs.map +0 -1
- package/dist/descriptor-meta-e29H69KN-t-S8_DYh.mjs.map +0 -1
- package/dist/errors-Cng94tYg-DTH51xWG.mjs.map +0 -1
- package/dist/errors-DjCkC9IM.d.mts.map +0 -1
- package/dist/migration-DILkj7kB.d.mts.map +0 -1
- package/dist/mysql-database-CHl9-oSL-B1arvq6Q.mjs.map +0 -1
- package/dist/runner-DEKKxDyw-Cdo1Ysod.mjs.map +0 -1
- package/dist/runtime-CbqytTbM.d.mts.map +0 -1
- package/dist/runtime-Cm-T3hbP.d.mts +0 -29
- package/dist/runtime-Cm-T3hbP.d.mts.map +0 -1
- package/dist/runtime-DB0w8R7i.mjs.map +0 -1
- package/dist/runtime-DN20lWEg.d.mts.map +0 -1
- package/dist/runtime-DUDdsFyy.mjs.map +0 -1
- package/dist/sql-utils-BE8tDXHs.mjs.map +0 -1
- package/dist/statement-CT5tB4uX-CHqHFM3z.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregates-BK8qyA2x.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/aggregates.d.mts"],"mappings":";;;;;;;;cAOc;WACH;WACA;aACE;;WAEF;aACE;aACA;;WAEF;WACA;;WAEA;WACA;aACE;;WAEF;aACE;aACA;;WAEF;WACA;WACA,OAAO;;WAEP;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA,OAAO;WACP;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA,OAAO;WACP;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;aACA,aAAa,OAAO,yBAAyB;;WAE/C"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { _ as MYSQL_TIMESTAMP_DATE_CODEC_ID, a as MYSQL_DATETIME_STRING_CODEC_ID, b as MYSQL_TIME_STRING_CODEC_ID, c as MYSQL_DATE_TEMPORAL_CODEC_ID, i as MYSQL_DATETIME_CODEC_ID, l as MYSQL_DECIMAL_CODEC_ID, n as MYSQL_BIGINT_NUMBER_CODEC_ID, o as MYSQL_DATETIME_TEMPORAL_CODEC_ID, p as MYSQL_INT_CODEC_ID, s as MYSQL_DATE_STRING_CODEC_ID, t as MYSQL_BIGINT_CODEC_ID, u as MYSQL_DOUBLE_CODEC_ID, v as MYSQL_TIMESTAMP_STRING_CODEC_ID, x as MYSQL_TIME_TEMPORAL_CODEC_ID, y as MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID } from "./codec-ids-DuWt4aOn-DiyLf9dW.mjs";
|
|
2
|
+
import { _ as mysqlDecimal, r as MYSQL_WIDEST_DECIMAL, y as mysqlDecimalColumnOfReference } from "./data-types-CU_43cNv-CQ8eHx3H.mjs";
|
|
3
|
+
import { dataTypeParams } from "@prisma/orm-framework/components/codec";
|
|
4
|
+
import { AggregateExpr, CastExpr, OperationExpr } from "@prisma/orm-family-sql/relational-core/ast";
|
|
5
|
+
//#region ../../../3-targets/mysql/1-mysql/1-target/dist/aggregates.mjs
|
|
6
|
+
const preservesInput = (operation, input) => ({
|
|
7
|
+
operation,
|
|
8
|
+
input,
|
|
9
|
+
output: { kind: "self" },
|
|
10
|
+
nullable: true
|
|
11
|
+
});
|
|
12
|
+
const produces = (operation, input, codecId) => ({
|
|
13
|
+
operation,
|
|
14
|
+
input,
|
|
15
|
+
output: {
|
|
16
|
+
kind: "codec",
|
|
17
|
+
codecId
|
|
18
|
+
},
|
|
19
|
+
nullable: true
|
|
20
|
+
});
|
|
21
|
+
const producesVia = (operation, input, codecId, lower) => ({
|
|
22
|
+
...produces(operation, input, codecId),
|
|
23
|
+
lower
|
|
24
|
+
});
|
|
25
|
+
const computedWith = (fn) => ({ expr }) => new AggregateExpr(fn, expr);
|
|
26
|
+
const meanAsDouble = ({ expr }) => new OperationExpr({
|
|
27
|
+
method: "avg",
|
|
28
|
+
self: CastExpr.as(new AggregateExpr("sum", expr), "DOUBLE"),
|
|
29
|
+
args: [new AggregateExpr("count", expr)],
|
|
30
|
+
returns: {
|
|
31
|
+
codecId: MYSQL_DOUBLE_CODEC_ID,
|
|
32
|
+
nullable: true
|
|
33
|
+
},
|
|
34
|
+
lowering: {
|
|
35
|
+
targetFamily: "sql",
|
|
36
|
+
template: "{{self}} / {{arg0}}"
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
/** The 22 digits before the point that `sum` adds to a `decimal` column's precision, up to the widest decimal. */
|
|
40
|
+
const DECIMAL_SUM_EXTRA_DIGITS = 22;
|
|
41
|
+
/** The precision and scale of the total of a `decimal` column; a reference without a precision is of no column, and so is its total. */
|
|
42
|
+
const decimalSumParams = (input) => {
|
|
43
|
+
const column = mysqlDecimalColumnOfReference(dataTypeParams(mysqlDecimal, input?.typeParams));
|
|
44
|
+
if (column === void 0) return void 0;
|
|
45
|
+
return {
|
|
46
|
+
precision: Math.min(MYSQL_WIDEST_DECIMAL.precision, column.precision + DECIMAL_SUM_EXTRA_DIGITS),
|
|
47
|
+
scale: column.scale
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
const INTEGER_CODECS = [
|
|
51
|
+
MYSQL_INT_CODEC_ID,
|
|
52
|
+
MYSQL_BIGINT_CODEC_ID,
|
|
53
|
+
MYSQL_BIGINT_NUMBER_CODEC_ID
|
|
54
|
+
];
|
|
55
|
+
const MIN_MAX_PRESERVING_CODECS = [
|
|
56
|
+
MYSQL_DATETIME_CODEC_ID,
|
|
57
|
+
MYSQL_DATETIME_TEMPORAL_CODEC_ID,
|
|
58
|
+
MYSQL_DATETIME_STRING_CODEC_ID,
|
|
59
|
+
MYSQL_TIMESTAMP_DATE_CODEC_ID,
|
|
60
|
+
MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID,
|
|
61
|
+
MYSQL_TIMESTAMP_STRING_CODEC_ID,
|
|
62
|
+
MYSQL_DATE_STRING_CODEC_ID,
|
|
63
|
+
MYSQL_DATE_TEMPORAL_CODEC_ID,
|
|
64
|
+
MYSQL_TIME_STRING_CODEC_ID,
|
|
65
|
+
MYSQL_TIME_TEMPORAL_CODEC_ID
|
|
66
|
+
];
|
|
67
|
+
const orderingDescriptors = (operation) => [
|
|
68
|
+
preservesInput(operation, {
|
|
69
|
+
kind: "trait",
|
|
70
|
+
trait: "numeric"
|
|
71
|
+
}),
|
|
72
|
+
preservesInput(operation, {
|
|
73
|
+
kind: "trait",
|
|
74
|
+
trait: "textual"
|
|
75
|
+
}),
|
|
76
|
+
...MIN_MAX_PRESERVING_CODECS.map((codecId) => preservesInput(operation, {
|
|
77
|
+
kind: "codec",
|
|
78
|
+
codecId
|
|
79
|
+
}))
|
|
80
|
+
];
|
|
81
|
+
/**
|
|
82
|
+
* Every aggregate overload the MySQL target contributes. The adapter lists these on `types.aggregateDescriptors`, from where emission derives result types and the runtime builds its resolution registry.
|
|
83
|
+
*/
|
|
84
|
+
const mysqlAggregateDescriptors = [
|
|
85
|
+
{
|
|
86
|
+
operation: "count",
|
|
87
|
+
input: { kind: "any" },
|
|
88
|
+
output: {
|
|
89
|
+
kind: "codec",
|
|
90
|
+
codecId: MYSQL_BIGINT_NUMBER_CODEC_ID
|
|
91
|
+
},
|
|
92
|
+
nullable: false,
|
|
93
|
+
emptyResultWire: "0"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
operation: "countBigInt",
|
|
97
|
+
input: { kind: "any" },
|
|
98
|
+
output: {
|
|
99
|
+
kind: "codec",
|
|
100
|
+
codecId: MYSQL_BIGINT_CODEC_ID
|
|
101
|
+
},
|
|
102
|
+
nullable: false,
|
|
103
|
+
emptyResultWire: "0",
|
|
104
|
+
lower: computedWith("count")
|
|
105
|
+
},
|
|
106
|
+
...INTEGER_CODECS.map((codecId) => produces("sum", {
|
|
107
|
+
kind: "codec",
|
|
108
|
+
codecId
|
|
109
|
+
}, MYSQL_BIGINT_NUMBER_CODEC_ID)),
|
|
110
|
+
...INTEGER_CODECS.map((codecId) => producesVia("sumBigInt", {
|
|
111
|
+
kind: "codec",
|
|
112
|
+
codecId
|
|
113
|
+
}, MYSQL_BIGINT_CODEC_ID, computedWith("sum"))),
|
|
114
|
+
...INTEGER_CODECS.map((codecId) => producesVia("avg", {
|
|
115
|
+
kind: "codec",
|
|
116
|
+
codecId
|
|
117
|
+
}, MYSQL_DOUBLE_CODEC_ID, meanAsDouble)),
|
|
118
|
+
produces("sum", {
|
|
119
|
+
kind: "codec",
|
|
120
|
+
codecId: MYSQL_DOUBLE_CODEC_ID
|
|
121
|
+
}, MYSQL_DOUBLE_CODEC_ID),
|
|
122
|
+
produces("avg", {
|
|
123
|
+
kind: "codec",
|
|
124
|
+
codecId: MYSQL_DOUBLE_CODEC_ID
|
|
125
|
+
}, MYSQL_DOUBLE_CODEC_ID),
|
|
126
|
+
{
|
|
127
|
+
operation: "sum",
|
|
128
|
+
input: {
|
|
129
|
+
kind: "codec",
|
|
130
|
+
codecId: MYSQL_DECIMAL_CODEC_ID
|
|
131
|
+
},
|
|
132
|
+
output: {
|
|
133
|
+
kind: "codec",
|
|
134
|
+
codecId: MYSQL_DECIMAL_CODEC_ID,
|
|
135
|
+
typeParams: decimalSumParams
|
|
136
|
+
},
|
|
137
|
+
nullable: true
|
|
138
|
+
},
|
|
139
|
+
...orderingDescriptors("min"),
|
|
140
|
+
...orderingDescriptors("max")
|
|
141
|
+
];
|
|
142
|
+
//#endregion
|
|
143
|
+
export { mysqlAggregateDescriptors as t };
|
|
144
|
+
|
|
145
|
+
//# sourceMappingURL=aggregates-Bk6CCgQ-.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregates-Bk6CCgQ-.mjs","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/aggregates.mjs"],"sourcesContent":["import { _ as MYSQL_TIMESTAMP_DATE_CODEC_ID, a as MYSQL_DATETIME_STRING_CODEC_ID, b as MYSQL_TIME_STRING_CODEC_ID, c as MYSQL_DATE_TEMPORAL_CODEC_ID, i as MYSQL_DATETIME_CODEC_ID, l as MYSQL_DECIMAL_CODEC_ID, n as MYSQL_BIGINT_NUMBER_CODEC_ID, o as MYSQL_DATETIME_TEMPORAL_CODEC_ID, p as MYSQL_INT_CODEC_ID, s as MYSQL_DATE_STRING_CODEC_ID, t as MYSQL_BIGINT_CODEC_ID, u as MYSQL_DOUBLE_CODEC_ID, v as MYSQL_TIMESTAMP_STRING_CODEC_ID, x as MYSQL_TIME_TEMPORAL_CODEC_ID, y as MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID } from \"./codec-ids-DuWt4aOn.mjs\";\nimport { _ as mysqlDecimal, r as MYSQL_WIDEST_DECIMAL, y as mysqlDecimalColumnOfReference } from \"./data-types-CU_43cNv.mjs\";\nimport { dataTypeParams } from \"@internal/framework-components/codec\";\nimport { AggregateExpr, CastExpr, OperationExpr } from \"@internal/sql-relational-core/ast\";\n//#region src/core/aggregates.ts\nconst preservesInput = (operation, input) => ({\n\toperation,\n\tinput,\n\toutput: { kind: \"self\" },\n\tnullable: true\n});\nconst produces = (operation, input, codecId) => ({\n\toperation,\n\tinput,\n\toutput: {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t},\n\tnullable: true\n});\nconst producesVia = (operation, input, codecId, lower) => ({\n\t...produces(operation, input, codecId),\n\tlower\n});\nconst computedWith = (fn) => ({ expr }) => new AggregateExpr(fn, expr);\nconst meanAsDouble = ({ expr }) => new OperationExpr({\n\tmethod: \"avg\",\n\tself: CastExpr.as(new AggregateExpr(\"sum\", expr), \"DOUBLE\"),\n\targs: [new AggregateExpr(\"count\", expr)],\n\treturns: {\n\t\tcodecId: MYSQL_DOUBLE_CODEC_ID,\n\t\tnullable: true\n\t},\n\tlowering: {\n\t\ttargetFamily: \"sql\",\n\t\ttemplate: \"{{self}} / {{arg0}}\"\n\t}\n});\n/** The 22 digits before the point that `sum` adds to a `decimal` column's precision, up to the widest decimal. */\nconst DECIMAL_SUM_EXTRA_DIGITS = 22;\n/** The precision and scale of the total of a `decimal` column; a reference without a precision is of no column, and so is its total. */\nconst decimalSumParams = (input) => {\n\tconst column = mysqlDecimalColumnOfReference(dataTypeParams(mysqlDecimal, input?.typeParams));\n\tif (column === void 0) return void 0;\n\treturn {\n\t\tprecision: Math.min(MYSQL_WIDEST_DECIMAL.precision, column.precision + DECIMAL_SUM_EXTRA_DIGITS),\n\t\tscale: column.scale\n\t};\n};\nconst INTEGER_CODECS = [\n\tMYSQL_INT_CODEC_ID,\n\tMYSQL_BIGINT_CODEC_ID,\n\tMYSQL_BIGINT_NUMBER_CODEC_ID\n];\nconst MIN_MAX_PRESERVING_CODECS = [\n\tMYSQL_DATETIME_CODEC_ID,\n\tMYSQL_DATETIME_TEMPORAL_CODEC_ID,\n\tMYSQL_DATETIME_STRING_CODEC_ID,\n\tMYSQL_TIMESTAMP_DATE_CODEC_ID,\n\tMYSQL_TIMESTAMP_TEMPORAL_CODEC_ID,\n\tMYSQL_TIMESTAMP_STRING_CODEC_ID,\n\tMYSQL_DATE_STRING_CODEC_ID,\n\tMYSQL_DATE_TEMPORAL_CODEC_ID,\n\tMYSQL_TIME_STRING_CODEC_ID,\n\tMYSQL_TIME_TEMPORAL_CODEC_ID\n];\nconst orderingDescriptors = (operation) => [\n\tpreservesInput(operation, {\n\t\tkind: \"trait\",\n\t\ttrait: \"numeric\"\n\t}),\n\tpreservesInput(operation, {\n\t\tkind: \"trait\",\n\t\ttrait: \"textual\"\n\t}),\n\t...MIN_MAX_PRESERVING_CODECS.map((codecId) => preservesInput(operation, {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t}))\n];\n/**\n* Every aggregate overload the MySQL target contributes. The adapter lists these on `types.aggregateDescriptors`, from where emission derives result types and the runtime builds its resolution registry.\n*/\nconst mysqlAggregateDescriptors = [\n\t{\n\t\toperation: \"count\",\n\t\tinput: { kind: \"any\" },\n\t\toutput: {\n\t\t\tkind: \"codec\",\n\t\t\tcodecId: MYSQL_BIGINT_NUMBER_CODEC_ID\n\t\t},\n\t\tnullable: false,\n\t\temptyResultWire: \"0\"\n\t},\n\t{\n\t\toperation: \"countBigInt\",\n\t\tinput: { kind: \"any\" },\n\t\toutput: {\n\t\t\tkind: \"codec\",\n\t\t\tcodecId: MYSQL_BIGINT_CODEC_ID\n\t\t},\n\t\tnullable: false,\n\t\temptyResultWire: \"0\",\n\t\tlower: computedWith(\"count\")\n\t},\n\t...INTEGER_CODECS.map((codecId) => produces(\"sum\", {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t}, MYSQL_BIGINT_NUMBER_CODEC_ID)),\n\t...INTEGER_CODECS.map((codecId) => producesVia(\"sumBigInt\", {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t}, MYSQL_BIGINT_CODEC_ID, computedWith(\"sum\"))),\n\t...INTEGER_CODECS.map((codecId) => producesVia(\"avg\", {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t}, MYSQL_DOUBLE_CODEC_ID, meanAsDouble)),\n\tproduces(\"sum\", {\n\t\tkind: \"codec\",\n\t\tcodecId: MYSQL_DOUBLE_CODEC_ID\n\t}, MYSQL_DOUBLE_CODEC_ID),\n\tproduces(\"avg\", {\n\t\tkind: \"codec\",\n\t\tcodecId: MYSQL_DOUBLE_CODEC_ID\n\t}, MYSQL_DOUBLE_CODEC_ID),\n\t{\n\t\toperation: \"sum\",\n\t\tinput: {\n\t\t\tkind: \"codec\",\n\t\t\tcodecId: MYSQL_DECIMAL_CODEC_ID\n\t\t},\n\t\toutput: {\n\t\t\tkind: \"codec\",\n\t\t\tcodecId: MYSQL_DECIMAL_CODEC_ID,\n\t\t\ttypeParams: decimalSumParams\n\t\t},\n\t\tnullable: true\n\t},\n\t...orderingDescriptors(\"min\"),\n\t...orderingDescriptors(\"max\")\n];\n//#endregion\nexport { mysqlAggregateDescriptors };\n\n//# sourceMappingURL=aggregates.mjs.map"],"mappings":";;;;;AAKA,MAAM,kBAAkB,WAAW,WAAW;CAC7C;CACA;CACA,QAAQ,EAAE,MAAM,OAAO;CACvB,UAAU;AACX;AACA,MAAM,YAAY,WAAW,OAAO,aAAa;CAChD;CACA;CACA,QAAQ;EACP,MAAM;EACN;CACD;CACA,UAAU;AACX;AACA,MAAM,eAAe,WAAW,OAAO,SAAS,WAAW;CAC1D,GAAG,SAAS,WAAW,OAAO,OAAO;CACrC;AACD;AACA,MAAM,gBAAgB,QAAQ,EAAE,WAAW,IAAI,cAAc,IAAI,IAAI;AACrE,MAAM,gBAAgB,EAAE,WAAW,IAAI,cAAc;CACpD,QAAQ;CACR,MAAM,SAAS,GAAG,IAAI,cAAc,OAAO,IAAI,GAAG,QAAQ;CAC1D,MAAM,CAAC,IAAI,cAAc,SAAS,IAAI,CAAC;CACvC,SAAS;EACR,SAAS;EACT,UAAU;CACX;CACA,UAAU;EACT,cAAc;EACd,UAAU;CACX;AACD,CAAC;;AAED,MAAM,2BAA2B;;AAEjC,MAAM,oBAAoB,UAAU;CACnC,MAAM,SAAS,8BAA8B,eAAe,cAAc,OAAO,UAAU,CAAC;CAC5F,IAAI,WAAW,KAAK,GAAG,OAAO,KAAK;CACnC,OAAO;EACN,WAAW,KAAK,IAAI,qBAAqB,WAAW,OAAO,YAAY,wBAAwB;EAC/F,OAAO,OAAO;CACf;AACD;AACA,MAAM,iBAAiB;CACtB;CACA;CACA;AACD;AACA,MAAM,4BAA4B;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AACA,MAAM,uBAAuB,cAAc;CAC1C,eAAe,WAAW;EACzB,MAAM;EACN,OAAO;CACR,CAAC;CACD,eAAe,WAAW;EACzB,MAAM;EACN,OAAO;CACR,CAAC;CACD,GAAG,0BAA0B,KAAK,YAAY,eAAe,WAAW;EACvE,MAAM;EACN;CACD,CAAC,CAAC;AACH;;;;AAIA,MAAM,4BAA4B;CACjC;EACC,WAAW;EACX,OAAO,EAAE,MAAM,MAAM;EACrB,QAAQ;GACP,MAAM;GACN,SAAS;EACV;EACA,UAAU;EACV,iBAAiB;CAClB;CACA;EACC,WAAW;EACX,OAAO,EAAE,MAAM,MAAM;EACrB,QAAQ;GACP,MAAM;GACN,SAAS;EACV;EACA,UAAU;EACV,iBAAiB;EACjB,OAAO,aAAa,OAAO;CAC5B;CACA,GAAG,eAAe,KAAK,YAAY,SAAS,OAAO;EAClD,MAAM;EACN;CACD,GAAG,4BAA4B,CAAC;CAChC,GAAG,eAAe,KAAK,YAAY,YAAY,aAAa;EAC3D,MAAM;EACN;CACD,GAAG,uBAAuB,aAAa,KAAK,CAAC,CAAC;CAC9C,GAAG,eAAe,KAAK,YAAY,YAAY,OAAO;EACrD,MAAM;EACN;CACD,GAAG,uBAAuB,YAAY,CAAC;CACvC,SAAS,OAAO;EACf,MAAM;EACN,SAAS;CACV,GAAG,qBAAqB;CACxB,SAAS,OAAO;EACf,MAAM;EACN,SAAS;CACV,GAAG,qBAAqB;CACxB;EACC,WAAW;EACX,OAAO;GACN,MAAM;GACN,SAAS;EACV;EACA,QAAQ;GACP,MAAM;GACN,SAAS;GACT,YAAY;EACb;EACA,UAAU;CACX;CACA,GAAG,oBAAoB,KAAK;CAC5B,GAAG,oBAAoB,KAAK;AAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./codec-descriptor-DXsJwUng-D4abEAFs.mjs";
|
package/dist/{codec-descriptor-3xp1XvVH-DfPKpYeP.mjs → codec-descriptor-ByN7iIha-48yW7oDN.mjs}
RENAMED
|
@@ -1,23 +1,33 @@
|
|
|
1
|
+
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
1
2
|
import { CodecDescriptorImpl, validateCodecTypeParams } from "@prisma/orm-framework/components/codec";
|
|
2
3
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
3
4
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
4
|
-
|
|
5
|
-
//#region ../../../3-targets/mysql/1-mysql/1-target/dist/codec-descriptor-3xp1XvVH.mjs
|
|
5
|
+
//#region ../../../3-targets/mysql/1-mysql/1-target/dist/codec-descriptor-ByN7iIha.mjs
|
|
6
6
|
/** Projects a column whose JSON form, a number or a string, is what its `fromWire` reads. */
|
|
7
7
|
const identityJsonProjection = (expression) => expression;
|
|
8
8
|
const MYSQL_CODEC_DESCRIPTOR_KIND = "mysql-codec";
|
|
9
9
|
/**
|
|
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.
|
|
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, and `wrappedParameter` is the expression a parameter of the codec is written as in a statement.
|
|
11
11
|
*/
|
|
12
12
|
var MysqlCodecDescriptor = class extends CodecDescriptorImpl {
|
|
13
13
|
descriptorKind = MYSQL_CODEC_DESCRIPTOR_KIND;
|
|
14
|
+
/** The expression a parameter of this codec is written as, such as a cast around it: the parameter itself, unless the server would compare the value it carries in another type than the column's. It holds the parameter exactly once. */
|
|
15
|
+
wrappedParameter(parameter, _params) {
|
|
16
|
+
return parameter;
|
|
17
|
+
}
|
|
18
|
+
wrapParameter(parameter, ref) {
|
|
19
|
+
return this.wrappedParameter(parameter, this.paramsOf(ref));
|
|
20
|
+
}
|
|
14
21
|
projectJson(expression, ref) {
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
return this.jsonProjection(expression, this.paramsOf(ref));
|
|
23
|
+
}
|
|
24
|
+
paramsOf(ref) {
|
|
25
|
+
if (ref.many === true) throw structuredError("RUNTIME.CODEC_DESCRIPTOR_ARRAY_UNSUPPORTED", `Codec '${ref.codecId}' uses CodecRef.many, but MySQL and MariaDB have no stored scalar arrays.`, {
|
|
26
|
+
why: "The codec descriptors MySQL and MariaDB share project scalar values only.",
|
|
17
27
|
fix: "Use a scalar CodecRef.",
|
|
18
28
|
meta: { codecId: ref.codecId }
|
|
19
29
|
});
|
|
20
|
-
return
|
|
30
|
+
return blindCast(validateCodecTypeParams(this, ref));
|
|
21
31
|
}
|
|
22
32
|
};
|
|
23
33
|
var MysqlCodecDescriptorAdapter = class extends MysqlCodecDescriptor {
|
|
@@ -47,7 +57,7 @@ function mysqlCodec(descriptor, options) {
|
|
|
47
57
|
return blindCast(new MysqlCodecDescriptorAdapter(descriptor, options));
|
|
48
58
|
}
|
|
49
59
|
function isMysqlCodecDescriptor(value) {
|
|
50
|
-
return 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";
|
|
60
|
+
return 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" && "wrapParameter" in value && typeof value.wrapParameter === "function";
|
|
51
61
|
}
|
|
52
62
|
var MysqlCodecDescriptorRegistryImpl = class {
|
|
53
63
|
#descriptors;
|
|
@@ -68,19 +78,16 @@ function buildMysqlCodecDescriptorRegistry(descriptors) {
|
|
|
68
78
|
for (const descriptor of descriptors) {
|
|
69
79
|
if (!isMysqlCodecDescriptor(descriptor)) {
|
|
70
80
|
const codecId = candidateCodecId(descriptor);
|
|
71
|
-
throw structuredError("RUNTIME.CODEC_DESCRIPTOR_INVALID", `Codec descriptor '${codecId}' is not a
|
|
72
|
-
why: "
|
|
81
|
+
throw structuredError("RUNTIME.CODEC_DESCRIPTOR_INVALID", `Codec descriptor '${codecId}' is not a codec descriptor of the MySQL and MariaDB targets.`, {
|
|
82
|
+
why: "The codec registries of MySQL and MariaDB require the mysql-codec discriminant and the methods of MysqlCodecDescriptor.",
|
|
73
83
|
fix: "Extend MysqlCodecDescriptor or adapt a family descriptor with mysqlCodec().",
|
|
74
84
|
meta: { codecId }
|
|
75
85
|
});
|
|
76
86
|
}
|
|
77
|
-
if (byId.has(descriptor.codecId)) throw structuredError("RUNTIME.DUPLICATE_CODEC", `Duplicate
|
|
78
|
-
why: "Each codecId must resolve to exactly one
|
|
87
|
+
if (byId.has(descriptor.codecId)) throw structuredError("RUNTIME.DUPLICATE_CODEC", `Duplicate codec descriptor id '${descriptor.codecId}' in a MySQL or MariaDB codec registry.`, {
|
|
88
|
+
why: "Each codecId must resolve to exactly one descriptor during registry composition.",
|
|
79
89
|
fix: "Remove the duplicate target, adapter, or extension contribution.",
|
|
80
|
-
meta: {
|
|
81
|
-
codecId: descriptor.codecId,
|
|
82
|
-
target: "mysql"
|
|
83
|
-
}
|
|
90
|
+
meta: { codecId: descriptor.codecId }
|
|
84
91
|
});
|
|
85
92
|
byId.set(descriptor.codecId, descriptor);
|
|
86
93
|
}
|
|
@@ -92,4 +99,4 @@ function candidateCodecId(value) {
|
|
|
92
99
|
//#endregion
|
|
93
100
|
export { mysqlCodec as a, isMysqlCodecDescriptor as i, buildMysqlCodecDescriptorRegistry as n, identityJsonProjection as r, MysqlCodecDescriptor as t };
|
|
94
101
|
|
|
95
|
-
//# sourceMappingURL=codec-descriptor-
|
|
102
|
+
//# sourceMappingURL=codec-descriptor-ByN7iIha-48yW7oDN.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-descriptor-ByN7iIha-48yW7oDN.mjs","names":["#descriptors"],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/codec-descriptor-ByN7iIha.mjs"],"sourcesContent":["import { CodecDescriptorImpl, validateCodecTypeParams } from \"@internal/framework-components/codec\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-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, and `wrappedParameter` is the expression a parameter of the codec is written as in a statement.\n*/\nvar MysqlCodecDescriptor = class extends CodecDescriptorImpl {\n\tdescriptorKind = MYSQL_CODEC_DESCRIPTOR_KIND;\n\t/** The expression a parameter of this codec is written as, such as a cast around it: the parameter itself, unless the server would compare the value it carries in another type than the column's. It holds the parameter exactly once. */\n\twrappedParameter(parameter, _params) {\n\t\treturn parameter;\n\t}\n\twrapParameter(parameter, ref) {\n\t\treturn this.wrappedParameter(parameter, this.paramsOf(ref));\n\t}\n\tprojectJson(expression, ref) {\n\t\treturn this.jsonProjection(expression, this.paramsOf(ref));\n\t}\n\tparamsOf(ref) {\n\t\tif (ref.many === true) throw structuredError(\"RUNTIME.CODEC_DESCRIPTOR_ARRAY_UNSUPPORTED\", `Codec '${ref.codecId}' uses CodecRef.many, but MySQL and MariaDB have no stored scalar arrays.`, {\n\t\t\twhy: \"The codec descriptors MySQL and MariaDB share 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 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\" && \"wrapParameter\" in value && typeof value.wrapParameter === \"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 codec descriptor of the MySQL and MariaDB targets.`, {\n\t\t\t\twhy: \"The codec registries of MySQL and MariaDB require the mysql-codec discriminant and the methods of MysqlCodecDescriptor.\",\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 codec descriptor id '${descriptor.codecId}' in a MySQL or MariaDB codec registry.`, {\n\t\t\twhy: \"Each codecId must resolve to exactly one descriptor during registry composition.\",\n\t\t\tfix: \"Remove the duplicate target, adapter, or extension contribution.\",\n\t\t\tmeta: { codecId: descriptor.codecId }\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-ByN7iIha.mjs.map"],"mappings":";;;;;;AAMA,MAAM,0BAA0B,eAAe;AAC/C,MAAM,8BAA8B;;;;AAIpC,IAAI,uBAAuB,cAAc,oBAAoB;CAC5D,iBAAiB;;CAEjB,iBAAiB,WAAW,SAAS;EACpC,OAAO;CACR;CACA,cAAc,WAAW,KAAK;EAC7B,OAAO,KAAK,iBAAiB,WAAW,KAAK,SAAS,GAAG,CAAC;CAC3D;CACA,YAAY,YAAY,KAAK;EAC5B,OAAO,KAAK,eAAe,YAAY,KAAK,SAAS,GAAG,CAAC;CAC1D;CACA,SAAS,KAAK;EACb,IAAI,IAAI,SAAS,MAAM,MAAM,gBAAgB,8CAA8C,UAAU,IAAI,QAAQ,4EAA4E;GAC5L,KAAK;GACL,KAAK;GACL,MAAM,EAAE,SAAS,IAAI,QAAQ;EAC9B,CAAC;EACD,OAAO,UAAU,wBAAwB,MAAM,GAAG,CAAC;CACpD;AACD;AACA,IAAI,8BAA8B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,iBAAiB,UAAU;GAC3C,MAAM,gBAAgB,oCAAoC,qBAAqB,QAAQ,gEAAgE;IACtJ,KAAK;IACL,KAAK;IACL,MAAM,EAAE,QAAQ;GACjB,CAAC;EACF;EACA,IAAI,KAAK,IAAI,WAAW,OAAO,GAAG,MAAM,gBAAgB,2BAA2B,kCAAkC,WAAW,QAAQ,0CAA0C;GACjL,KAAK;GACL,KAAK;GACL,MAAM,EAAE,SAAS,WAAW,QAAQ;EACrC,CAAC;EACD,KAAK,IAAI,WAAW,SAAS,UAAU;CACxC;CACA,OAAO,IAAI,iCAAiC,IAAI;AACjD;AACA,SAAS,iBAAiB,OAAO;CAChC,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,aAAa,SAAS,OAAO,MAAM,YAAY,WAAW,MAAM,UAAU;AACjI"}
|
package/dist/{codec-descriptor-DXyubAS6-XDBj6Yet.d.mts → codec-descriptor-DXsJwUng-D4abEAFs.d.mts}
RENAMED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import { AnyCodecDescriptor, AnyCodecDescriptorTemplate, Codec, CodecDescriptor, CodecDescriptorImpl, CodecDescriptorTemplate, CodecInstanceContext, CodecRef, CodecTrait, DataType } from "@prisma/orm-framework/components/codec";
|
|
2
|
-
import { ProjectionExpr } from "@prisma/orm-family-sql/relational-core/ast";
|
|
2
|
+
import { AnyExpression, AnyParamRef, ProjectionExpr } from "@prisma/orm-family-sql/relational-core/ast";
|
|
3
3
|
import { JsonValue } from "@prisma/orm-framework/contract/types";
|
|
4
|
-
//#region ../../../3-targets/mysql/1-mysql/1-target/dist/codec-descriptor-
|
|
4
|
+
//#region ../../../3-targets/mysql/1-mysql/1-target/dist/codec-descriptor-DXsJwUng.d.mts
|
|
5
5
|
//#region src/core/codec-descriptor.d.ts
|
|
6
6
|
declare const MYSQL_CODEC_DESCRIPTOR_KIND: "mysql-codec";
|
|
7
7
|
interface AnyMysqlCodecDescriptor extends AnyCodecDescriptor {
|
|
8
8
|
readonly descriptorKind: typeof MYSQL_CODEC_DESCRIPTOR_KIND;
|
|
9
9
|
projectJson(expression: ProjectionExpr, ref: CodecRef): ProjectionExpr;
|
|
10
|
+
wrapParameter(parameter: AnyParamRef, ref: CodecRef): AnyExpression;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
|
-
* 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.
|
|
13
|
+
* 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, and `wrappedParameter` is the expression a parameter of the codec is written as in a statement.
|
|
13
14
|
*/
|
|
14
15
|
declare abstract class MysqlCodecDescriptor<P = void> extends CodecDescriptorImpl<P> implements AnyMysqlCodecDescriptor {
|
|
15
16
|
readonly descriptorKind: "mysql-codec";
|
|
16
17
|
protected abstract jsonProjection(expression: ProjectionExpr, params: P): ProjectionExpr;
|
|
18
|
+
/** The expression a parameter of this codec is written as, such as a cast around it: the parameter itself, unless the server would compare the value it carries in another type than the column's. It holds the parameter exactly once. */
|
|
19
|
+
protected wrappedParameter(parameter: AnyParamRef, _params: P): AnyExpression;
|
|
20
|
+
wrapParameter(parameter: AnyParamRef, ref: CodecRef): AnyExpression;
|
|
17
21
|
projectJson(expression: ProjectionExpr, ref: CodecRef): ProjectionExpr;
|
|
22
|
+
private paramsOf;
|
|
18
23
|
}
|
|
19
24
|
type DescriptorParams<D extends AnyCodecDescriptorTemplate> = D extends CodecDescriptorTemplate<infer P> ? P : never;
|
|
20
25
|
type DescriptorCodec<D extends AnyCodecDescriptorTemplate> = ReturnType<ReturnType<D['factory']>>;
|
|
@@ -28,7 +33,7 @@ interface MysqlCodecOptions<P, C extends Codec<string, readonly CodecTrait[], un
|
|
|
28
33
|
/** Builds the codec of the family template, constructed with `dataType` and the column's parameters. */
|
|
29
34
|
readonly factory: (descriptor: MysqlCodecDescriptor<P>, dataType: DataType, params: P) => (ctx: CodecInstanceContext) => C;
|
|
30
35
|
}
|
|
31
|
-
type AdaptedMysqlCodecDescriptor<D extends AnyCodecDescriptorTemplate> = Pick<D, keyof CodecDescriptorTemplate<DescriptorParams<D>>> & Pick<CodecDescriptor, 'dataType'> & Pick<AnyMysqlCodecDescriptor, 'descriptorKind' | 'projectJson'>;
|
|
36
|
+
type AdaptedMysqlCodecDescriptor<D extends AnyCodecDescriptorTemplate> = Pick<D, keyof CodecDescriptorTemplate<DescriptorParams<D>>> & Pick<CodecDescriptor, 'dataType'> & Pick<AnyMysqlCodecDescriptor, 'descriptorKind' | 'projectJson' | 'wrapParameter'>;
|
|
32
37
|
/** Adapts a family codec template to MySQL, naming the MySQL data type it represents. */
|
|
33
38
|
declare function mysqlCodec<D extends AnyCodecDescriptorTemplate>(descriptor: D, options: MysqlCodecOptions<DescriptorParams<D>, DescriptorCodec<D>>): AdaptedMysqlCodecDescriptor<D>;
|
|
34
39
|
declare function isMysqlCodecDescriptor(value: unknown): value is AnyMysqlCodecDescriptor;
|
|
@@ -40,4 +45,4 @@ interface MysqlCodecDescriptorRegistry {
|
|
|
40
45
|
declare function buildMysqlCodecDescriptorRegistry(descriptors: ReadonlyArray<unknown>): MysqlCodecDescriptorRegistry;
|
|
41
46
|
//#endregion
|
|
42
47
|
export { MysqlCodecOptions as a, mysqlCodec as c, MysqlCodecDescriptorRegistry as i, AnyMysqlCodecDescriptor as n, buildMysqlCodecDescriptorRegistry as o, MysqlCodecDescriptor as r, isMysqlCodecDescriptor as s, AdaptedMysqlCodecDescriptor as t };
|
|
43
|
-
//# sourceMappingURL=codec-descriptor-
|
|
48
|
+
//# sourceMappingURL=codec-descriptor-DXsJwUng-D4abEAFs.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-descriptor-DXsJwUng-D4abEAFs.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/codec-descriptor-DXsJwUng.d.mts"],"mappings":";;;;;cAIc;UACJ,gCAAgC;WAC/B,uBAAuB;EAChC,YAAY,YAAY,gBAAgB,KAAK,WAAW;EACxD,cAAc,WAAW,aAAa,KAAK,WAAW;;;;;uBAKjC,qBAAqB,kBAAkB,oBAAoB,cAAc;WACrF;qBACU,eAAe,YAAY,gBAAgB,QAAQ,IAAI;;YAEhE,iBAAiB,WAAW,aAAa,SAAS,IAAI;EAChE,cAAc,WAAW,aAAa,KAAK,WAAW;EACtD,YAAY,YAAY,gBAAgB,KAAK,WAAW;UAChD;;KAEL,iBAAiB,UAAU,8BAA8B,UAAU,8BAA8B,KAAK;KACtG,gBAAgB,UAAU,8BAA8B,WAAW,WAAW;UACzE,kBAAkB,GAAG,UAAU,uBAAuB,kCAAkC,uBAAuB;;WAE9G,UAAU;;WAEV,sBAAsB,OAAO,WAAW;;WAExC,iBAAiB,YAAY,gBAAgB,QAAQ,MAAM;;WAE3D,UAAU,YAAY,qBAAqB,IAAI,UAAU,UAAU,QAAQ,OAAO,KAAK,yBAAyB;;KAEtH,4BAA4B,UAAU,8BAA8B,KAAK,SAAS,wBAAwB,iBAAiB,OAAO,KAAK,+BAA+B,KAAK;;iBAE/J,WAAW,UAAU,4BAA4B,YAAY,GAAG,SAAS,kBAAkB,iBAAiB,IAAI,gBAAgB,MAAM,4BAA4B;iBAClK,uBAAuB,iBAAiB,SAAS;UACxD;EACR,cAAc,kBAAkB;EAChC,UAAU,iBAAiB;;;iBAGZ,kCAAkC,aAAa,yBAAyB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region ../../../3-targets/mysql/1-mysql/1-target/dist/codec-ids-DHeJ2SMJ.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_BIGINT_NUMBER_CODEC_ID: "mysql/bigintnumber@1";
|
|
6
|
+
declare const MYSQL_DOUBLE_CODEC_ID: "mysql/double@1";
|
|
7
|
+
declare const MYSQL_DECIMAL_CODEC_ID: "mysql/decimal@1";
|
|
8
|
+
declare const MYSQL_TEXT_CODEC_ID: "mysql/text@1";
|
|
9
|
+
declare const MYSQL_BOOLEAN_CODEC_ID: "mysql/boolean@1";
|
|
10
|
+
declare const MYSQL_LONGBLOB_CODEC_ID: "mysql/longblob@1";
|
|
11
|
+
declare const MYSQL_JSON_CODEC_ID: "mysql/json@1";
|
|
12
|
+
declare const MYSQL_DATETIME_CODEC_ID: "mysql/datetime@1";
|
|
13
|
+
declare const MYSQL_ENUM_CODEC_ID: "mysql/enum@1";
|
|
14
|
+
declare const MYSQL_DATETIME_TEMPORAL_CODEC_ID: "mysql/datetime-temporal@1";
|
|
15
|
+
declare const MYSQL_DATETIME_STRING_CODEC_ID: "mysql/datetime-string@1";
|
|
16
|
+
declare const MYSQL_TIMESTAMP_DATE_CODEC_ID: "mysql/timestamp-date@1";
|
|
17
|
+
declare const MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID: "mysql/timestamp-temporal@1";
|
|
18
|
+
declare const MYSQL_TIMESTAMP_STRING_CODEC_ID: "mysql/timestamp-string@1";
|
|
19
|
+
declare const MYSQL_DATE_STRING_CODEC_ID: "mysql/date-string@1";
|
|
20
|
+
declare const MYSQL_DATE_TEMPORAL_CODEC_ID: "mysql/date-temporal@1";
|
|
21
|
+
declare const MYSQL_TIME_STRING_CODEC_ID: "mysql/time-string@1";
|
|
22
|
+
declare const MYSQL_TIME_TEMPORAL_CODEC_ID: "mysql/time-temporal@1";
|
|
23
|
+
declare const MYSQL_DURATION_STRING_CODEC_ID: "mysql/duration-string@1";
|
|
24
|
+
//#endregion
|
|
25
|
+
export { MYSQL_TIMESTAMP_DATE_CODEC_ID as _, MYSQL_DATETIME_STRING_CODEC_ID as a, MYSQL_TIME_STRING_CODEC_ID as b, MYSQL_DATE_TEMPORAL_CODEC_ID as c, MYSQL_DURATION_STRING_CODEC_ID as d, MYSQL_ENUM_CODEC_ID as f, MYSQL_TEXT_CODEC_ID as g, MYSQL_LONGBLOB_CODEC_ID as h, MYSQL_DATETIME_CODEC_ID as i, MYSQL_DECIMAL_CODEC_ID as l, MYSQL_JSON_CODEC_ID as m, MYSQL_BIGINT_NUMBER_CODEC_ID as n, MYSQL_DATETIME_TEMPORAL_CODEC_ID as o, MYSQL_INT_CODEC_ID as p, MYSQL_BOOLEAN_CODEC_ID as r, MYSQL_DATE_STRING_CODEC_ID as s, MYSQL_BIGINT_CODEC_ID as t, MYSQL_DOUBLE_CODEC_ID as u, MYSQL_TIMESTAMP_STRING_CODEC_ID as v, MYSQL_TIME_TEMPORAL_CODEC_ID as x, MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID as y };
|
|
26
|
+
//# sourceMappingURL=codec-ids-DHeJ2SMJ-Uz1FAFmQ.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-ids-DHeJ2SMJ-Uz1FAFmQ.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/codec-ids-DHeJ2SMJ.d.mts"],"mappings":";;cACc;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region ../../../3-targets/mysql/1-mysql/1-target/dist/codec-ids-DuWt4aOn.mjs
|
|
2
|
+
const MYSQL_INT_CODEC_ID = "mysql/int@1";
|
|
3
|
+
const MYSQL_BIGINT_CODEC_ID = "mysql/bigint@1";
|
|
4
|
+
const MYSQL_BIGINT_NUMBER_CODEC_ID = "mysql/bigintnumber@1";
|
|
5
|
+
const MYSQL_DOUBLE_CODEC_ID = "mysql/double@1";
|
|
6
|
+
const MYSQL_DECIMAL_CODEC_ID = "mysql/decimal@1";
|
|
7
|
+
const MYSQL_TEXT_CODEC_ID = "mysql/text@1";
|
|
8
|
+
const MYSQL_BOOLEAN_CODEC_ID = "mysql/boolean@1";
|
|
9
|
+
const MYSQL_LONGBLOB_CODEC_ID = "mysql/longblob@1";
|
|
10
|
+
const MYSQL_JSON_CODEC_ID = "mysql/json@1";
|
|
11
|
+
const MYSQL_DATETIME_CODEC_ID = "mysql/datetime@1";
|
|
12
|
+
const MYSQL_ENUM_CODEC_ID = "mysql/enum@1";
|
|
13
|
+
const MYSQL_DATETIME_TEMPORAL_CODEC_ID = "mysql/datetime-temporal@1";
|
|
14
|
+
const MYSQL_DATETIME_STRING_CODEC_ID = "mysql/datetime-string@1";
|
|
15
|
+
const MYSQL_TIMESTAMP_DATE_CODEC_ID = "mysql/timestamp-date@1";
|
|
16
|
+
const MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID = "mysql/timestamp-temporal@1";
|
|
17
|
+
const MYSQL_TIMESTAMP_STRING_CODEC_ID = "mysql/timestamp-string@1";
|
|
18
|
+
const MYSQL_DATE_STRING_CODEC_ID = "mysql/date-string@1";
|
|
19
|
+
const MYSQL_DATE_TEMPORAL_CODEC_ID = "mysql/date-temporal@1";
|
|
20
|
+
const MYSQL_TIME_STRING_CODEC_ID = "mysql/time-string@1";
|
|
21
|
+
const MYSQL_TIME_TEMPORAL_CODEC_ID = "mysql/time-temporal@1";
|
|
22
|
+
const MYSQL_DURATION_STRING_CODEC_ID = "mysql/duration-string@1";
|
|
23
|
+
//#endregion
|
|
24
|
+
export { MYSQL_TIMESTAMP_DATE_CODEC_ID as _, MYSQL_DATETIME_STRING_CODEC_ID as a, MYSQL_TIME_STRING_CODEC_ID as b, MYSQL_DATE_TEMPORAL_CODEC_ID as c, MYSQL_DURATION_STRING_CODEC_ID as d, MYSQL_ENUM_CODEC_ID as f, MYSQL_TEXT_CODEC_ID as g, MYSQL_LONGBLOB_CODEC_ID as h, MYSQL_DATETIME_CODEC_ID as i, MYSQL_DECIMAL_CODEC_ID as l, MYSQL_JSON_CODEC_ID as m, MYSQL_BIGINT_NUMBER_CODEC_ID as n, MYSQL_DATETIME_TEMPORAL_CODEC_ID as o, MYSQL_INT_CODEC_ID as p, MYSQL_BOOLEAN_CODEC_ID as r, MYSQL_DATE_STRING_CODEC_ID as s, MYSQL_BIGINT_CODEC_ID as t, MYSQL_DOUBLE_CODEC_ID as u, MYSQL_TIMESTAMP_STRING_CODEC_ID as v, MYSQL_TIME_TEMPORAL_CODEC_ID as x, MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID as y };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=codec-ids-DuWt4aOn-DiyLf9dW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-ids-DuWt4aOn-DiyLf9dW.mjs","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/codec-ids-DuWt4aOn.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_BIGINT_NUMBER_CODEC_ID = \"mysql/bigintnumber@1\";\nconst MYSQL_DOUBLE_CODEC_ID = \"mysql/double@1\";\nconst MYSQL_DECIMAL_CODEC_ID = \"mysql/decimal@1\";\nconst MYSQL_TEXT_CODEC_ID = \"mysql/text@1\";\nconst MYSQL_BOOLEAN_CODEC_ID = \"mysql/boolean@1\";\nconst MYSQL_LONGBLOB_CODEC_ID = \"mysql/longblob@1\";\nconst MYSQL_JSON_CODEC_ID = \"mysql/json@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_TIMESTAMP_DATE_CODEC_ID as _, MYSQL_DATETIME_STRING_CODEC_ID as a, MYSQL_TIME_STRING_CODEC_ID as b, MYSQL_DATE_TEMPORAL_CODEC_ID as c, MYSQL_DURATION_STRING_CODEC_ID as d, MYSQL_ENUM_CODEC_ID as f, MYSQL_TEXT_CODEC_ID as g, MYSQL_LONGBLOB_CODEC_ID as h, MYSQL_DATETIME_CODEC_ID as i, MYSQL_DECIMAL_CODEC_ID as l, MYSQL_JSON_CODEC_ID as m, MYSQL_BIGINT_NUMBER_CODEC_ID as n, MYSQL_DATETIME_TEMPORAL_CODEC_ID as o, MYSQL_INT_CODEC_ID as p, MYSQL_BOOLEAN_CODEC_ID as r, MYSQL_DATE_STRING_CODEC_ID as s, MYSQL_BIGINT_CODEC_ID as t, MYSQL_DOUBLE_CODEC_ID as u, MYSQL_TIMESTAMP_STRING_CODEC_ID as v, MYSQL_TIME_TEMPORAL_CODEC_ID as x, MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID as y };\n\n//# sourceMappingURL=codec-ids-DuWt4aOn.mjs.map"],"mappings":";AACA,MAAM,qBAAqB;AAC3B,MAAM,wBAAwB;AAC9B,MAAM,+BAA+B;AACrC,MAAM,wBAAwB;AAC9B,MAAM,yBAAyB;AAC/B,MAAM,sBAAsB;AAC5B,MAAM,yBAAyB;AAC/B,MAAM,0BAA0B;AAChC,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 @@
|
|
|
1
|
+
import "./codec-types-DxSSgcpB.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as AdaptedMysqlCodecDescriptor } from "./codec-descriptor-
|
|
2
|
-
import "./codec-descriptor-
|
|
3
|
-
import { a as
|
|
1
|
+
import { t as AdaptedMysqlCodecDescriptor } from "./codec-descriptor-DXsJwUng-D4abEAFs.mjs";
|
|
2
|
+
import "./codec-descriptor-B1fMmxOK-D59zKJws.mjs";
|
|
3
|
+
import { _ as MysqlTimeStringDescriptor, a as MysqlDateTemporalDescriptor, b as MysqlTimestampStringDescriptor, c as MysqlDatetimeTemporalDescriptor, d as MysqlDurationStringDescriptor, f as MysqlEnumDescriptor, g as MysqlTextDescriptor, h as MysqlLongblobDescriptor, i as MysqlDateStringDescriptor, l as MysqlDecimalDescriptor, m as MysqlJsonDescriptor, n as MysqlBigintNumberDescriptor, o as MysqlDatetimeDescriptor, p as MysqlIntDescriptor, r as MysqlBooleanDescriptor, s as MysqlDatetimeStringDescriptor, t as MysqlBigintDescriptor, u as MysqlDoubleDescriptor, v as MysqlTimeTemporalDescriptor, x as MysqlTimestampTemporalDescriptor, y as MysqlTimestampDateDescriptor } from "./codecs-D35fqdXJ-BZwilYUu.mjs";
|
|
4
4
|
import { ExtractCodecTypes } from "@prisma/orm-family-sql/relational-core/ast";
|
|
5
|
-
//#region ../../../3-targets/mysql/1-mysql/1-target/dist/codec-types-
|
|
5
|
+
//#region ../../../3-targets/mysql/1-mysql/1-target/dist/codec-types-C4Q_JJgX.d.mts
|
|
6
6
|
//#region src/exports/codec-types.d.ts
|
|
7
7
|
declare const codecDescriptorMap: {
|
|
8
8
|
readonly char: AdaptedMysqlCodecDescriptor<import("@prisma/orm-family-sql/relational-core/ast").SqlCharDescriptor>;
|
|
@@ -11,6 +11,12 @@ declare const codecDescriptorMap: {
|
|
|
11
11
|
readonly text: MysqlTextDescriptor;
|
|
12
12
|
readonly int: MysqlIntDescriptor;
|
|
13
13
|
readonly bigint: MysqlBigintDescriptor;
|
|
14
|
+
readonly bigintnumber: MysqlBigintNumberDescriptor;
|
|
15
|
+
readonly double: MysqlDoubleDescriptor;
|
|
16
|
+
readonly decimal: MysqlDecimalDescriptor;
|
|
17
|
+
readonly boolean: MysqlBooleanDescriptor;
|
|
18
|
+
readonly longblob: MysqlLongblobDescriptor;
|
|
19
|
+
readonly json: MysqlJsonDescriptor;
|
|
14
20
|
readonly datetime: MysqlDatetimeDescriptor;
|
|
15
21
|
readonly 'datetime-temporal': MysqlDatetimeTemporalDescriptor;
|
|
16
22
|
readonly 'datetime-string': MysqlDatetimeStringDescriptor;
|
|
@@ -28,4 +34,4 @@ type Resolve<T> = { readonly [K in keyof T]: { readonly [P in keyof T[K]]: T[K][
|
|
|
28
34
|
type CodecTypes = Resolve<ExtractCodecTypes<typeof codecDescriptorMap>>;
|
|
29
35
|
//#endregion
|
|
30
36
|
export { CodecTypes as t };
|
|
31
|
-
//# sourceMappingURL=codec-types-
|
|
37
|
+
//# sourceMappingURL=codec-types-C4Q_JJgX-CUPkvPDx.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-types-C4Q_JJgX-CUPkvPDx.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/codec-types-C4Q_JJgX.d.mts"],"mappings":";;;;;;cAKc;WACH,MAAM,wEAAwE;WAC9E,SAAS,wEAAwE;WACjF,KAAK,wEAAwE;WAC7E,MAAM;WACN,KAAK;WACL,QAAQ;WACR,cAAc;WACd,QAAQ;WACR,SAAS;WACT,SAAS;WACT,UAAU;WACV,MAAM;WACN,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-C4Q_JJgX-CUPkvPDx.mjs";
|
|
@@ -1,11 +1,87 @@
|
|
|
1
|
-
import { r as MysqlCodecDescriptor } from "./codec-descriptor-
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
1
|
+
import { r as MysqlCodecDescriptor } from "./codec-descriptor-DXsJwUng-D4abEAFs.mjs";
|
|
2
|
+
import { _ as MYSQL_TIMESTAMP_DATE_CODEC_ID, a as MYSQL_DATETIME_STRING_CODEC_ID, b as MYSQL_TIME_STRING_CODEC_ID, c as MYSQL_DATE_TEMPORAL_CODEC_ID, d as MYSQL_DURATION_STRING_CODEC_ID, f as MYSQL_ENUM_CODEC_ID, g as MYSQL_TEXT_CODEC_ID, h as MYSQL_LONGBLOB_CODEC_ID, i as MYSQL_DATETIME_CODEC_ID, l as MYSQL_DECIMAL_CODEC_ID, m as MYSQL_JSON_CODEC_ID, n as MYSQL_BIGINT_NUMBER_CODEC_ID, o as MYSQL_DATETIME_TEMPORAL_CODEC_ID, p as MYSQL_INT_CODEC_ID, r as MYSQL_BOOLEAN_CODEC_ID, s as MYSQL_DATE_STRING_CODEC_ID, t as MYSQL_BIGINT_CODEC_ID, u as MYSQL_DOUBLE_CODEC_ID, v as MYSQL_TIMESTAMP_STRING_CODEC_ID, x as MYSQL_TIME_TEMPORAL_CODEC_ID, y as MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID } from "./codec-ids-DHeJ2SMJ-Uz1FAFmQ.mjs";
|
|
3
|
+
import { D as mysqlEnumParams, b as mysqlDecimalParams, h as mysqlDatetimeParams, w as mysqlDurationParams } from "./data-types-C_vInIbm-Gt1XINav.mjs";
|
|
4
4
|
import { CodecCallContext, CodecImpl, CodecInstanceContext, DataTypeValue } from "@prisma/orm-framework/components/codec";
|
|
5
|
-
import { ProjectionExpr } from "@prisma/orm-family-sql/relational-core/ast";
|
|
5
|
+
import { AnyExpression, AnyParamRef, ProjectionExpr, SqlCodecCallContext } from "@prisma/orm-family-sql/relational-core/ast";
|
|
6
6
|
import { JsonValue } from "@prisma/orm-framework/contract/types";
|
|
7
7
|
import { Temporal } from "temporal-spec";
|
|
8
|
-
//#region ../../../3-targets/mysql/1-mysql/1-target/dist/codecs-
|
|
8
|
+
//#region ../../../3-targets/mysql/1-mysql/1-target/dist/codecs-D35fqdXJ.d.mts
|
|
9
|
+
//#region src/core/decimal-codec.d.ts
|
|
10
|
+
type DecimalParams = typeof mysqlDecimalParams.infer;
|
|
11
|
+
declare class MysqlDecimalCodec extends CodecImpl<typeof MYSQL_DECIMAL_CODEC_ID, readonly ['equality', 'order', 'numeric'], string, string> {
|
|
12
|
+
toWire(value: string, ctx: SqlCodecCallContext): Promise<string>;
|
|
13
|
+
fromWire(wire: string, ctx: SqlCodecCallContext): Promise<string>;
|
|
14
|
+
/** The value, refused unless the column holds it. A default is checked before the target writes the parameters the server gives a column written without them, so parameters without a precision are checked as the `decimal(10,0)` the server makes. */
|
|
15
|
+
fromDataTypeValue(value: DataTypeValue<string>): string;
|
|
16
|
+
toDataTypeValue(input: string): DataTypeValue;
|
|
17
|
+
}
|
|
18
|
+
declare class MysqlDecimalDescriptor extends MysqlCodecDescriptor<DecimalParams> {
|
|
19
|
+
readonly dataType: import("@prisma/orm-framework/components/codec").DataTypeId;
|
|
20
|
+
readonly codecId: "mysql/decimal@1";
|
|
21
|
+
readonly traits: readonly ["equality", "order", "numeric"];
|
|
22
|
+
readonly keepsWrittenForm: true;
|
|
23
|
+
readonly paramsSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
24
|
+
precision?: number;
|
|
25
|
+
scale?: number;
|
|
26
|
+
}, {}>;
|
|
27
|
+
protected wrappedParameter(parameter: AnyParamRef, params: DecimalParams | undefined): AnyExpression;
|
|
28
|
+
/** The decimal text: a JSON number would lose every digit past a double's precision when the include is parsed. */
|
|
29
|
+
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
30
|
+
factory(params: DecimalParams): (ctx: CodecInstanceContext) => MysqlDecimalCodec;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/core/boolean-codec.d.ts
|
|
34
|
+
/** A row carries the stored integer as decimal text, and an include's JSON as a number. */
|
|
35
|
+
declare class MysqlBooleanCodec extends CodecImpl<typeof MYSQL_BOOLEAN_CODEC_ID, readonly ['equality', 'boolean'], string | number, boolean> {
|
|
36
|
+
toWire(value: boolean, ctx: SqlCodecCallContext): Promise<number>;
|
|
37
|
+
fromWire(wire: string | number, ctx: SqlCodecCallContext): Promise<boolean>;
|
|
38
|
+
fromDataTypeValue(value: DataTypeValue<boolean>): boolean;
|
|
39
|
+
toDataTypeValue(input: boolean): DataTypeValue;
|
|
40
|
+
}
|
|
41
|
+
declare class MysqlBooleanDescriptor extends MysqlCodecDescriptor<void> {
|
|
42
|
+
readonly dataType: import("@prisma/orm-framework/components/codec").DataTypeId;
|
|
43
|
+
readonly codecId: "mysql/boolean@1";
|
|
44
|
+
readonly traits: readonly ["equality", "boolean"];
|
|
45
|
+
readonly paramsSchema: undefined;
|
|
46
|
+
renderValueLiteral(value: JsonValue): string | undefined;
|
|
47
|
+
/** The stored integer as a JSON number, which the codec checks as it checks a row. */
|
|
48
|
+
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
49
|
+
factory(): (ctx: CodecInstanceContext) => MysqlBooleanCodec;
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/core/longblob-codec.d.ts
|
|
53
|
+
declare class MysqlLongblobCodec extends CodecImpl<typeof MYSQL_LONGBLOB_CODEC_ID, readonly ['equality', 'order'], Uint8Array | string, Uint8Array> {
|
|
54
|
+
toWire(value: Uint8Array, ctx: SqlCodecCallContext): Promise<Uint8Array>;
|
|
55
|
+
fromWire(wire: Uint8Array | string, ctx: SqlCodecCallContext): Promise<Uint8Array>;
|
|
56
|
+
fromDataTypeValue(value: DataTypeValue<string>): Uint8Array;
|
|
57
|
+
toDataTypeValue(input: Uint8Array): DataTypeValue;
|
|
58
|
+
}
|
|
59
|
+
declare class MysqlLongblobDescriptor extends MysqlCodecDescriptor<void> {
|
|
60
|
+
readonly dataType: import("@prisma/orm-framework/components/codec").DataTypeId;
|
|
61
|
+
readonly codecId: "mysql/longblob@1";
|
|
62
|
+
readonly traits: readonly ["equality", "order"];
|
|
63
|
+
readonly paramsSchema: undefined;
|
|
64
|
+
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
65
|
+
factory(): (ctx: CodecInstanceContext) => MysqlLongblobCodec;
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/core/json-codec.d.ts
|
|
69
|
+
declare class MysqlJsonCodec extends CodecImpl<typeof MYSQL_JSON_CODEC_ID, readonly [], string, JsonValue> {
|
|
70
|
+
toWire(value: JsonValue, ctx: SqlCodecCallContext): Promise<string>;
|
|
71
|
+
fromWire(wire: string, ctx: SqlCodecCallContext): Promise<JsonValue>;
|
|
72
|
+
fromDataTypeValue(value: DataTypeValue<JsonValue>): JsonValue;
|
|
73
|
+
toDataTypeValue(input: JsonValue): DataTypeValue;
|
|
74
|
+
}
|
|
75
|
+
declare class MysqlJsonDescriptor extends MysqlCodecDescriptor<void> {
|
|
76
|
+
readonly dataType: import("@prisma/orm-framework/components/codec").DataTypeId;
|
|
77
|
+
readonly codecId: "mysql/json@1";
|
|
78
|
+
readonly traits: readonly [];
|
|
79
|
+
readonly paramsSchema: undefined;
|
|
80
|
+
/** The document's JSON text, which the codec reads as it reads a row. Nested as a document, a JSON string such as `"12"` would reach the codec as the text `12`, which it could not tell from a row's number. */
|
|
81
|
+
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
82
|
+
factory(): (ctx: CodecInstanceContext) => MysqlJsonCodec;
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
9
85
|
//#region src/core/date-time-codecs.d.ts
|
|
10
86
|
type PrecisionParams = typeof mysqlDatetimeParams.infer;
|
|
11
87
|
/** A MySQL `timestamp` as a JavaScript `Date`, read and written in UTC. */
|
|
@@ -234,6 +310,38 @@ declare class MysqlBigintDescriptor extends MysqlCodecDescriptor<void> {
|
|
|
234
310
|
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
235
311
|
factory(): (ctx: CodecInstanceContext) => MysqlBigintCodec;
|
|
236
312
|
}
|
|
313
|
+
/** A MySQL `bigint`, or an integral `DECIMAL` such as a `SUM` of integers, as a JavaScript number. Both directions refuse a value outside ±(2^53 − 1) rather than round it, naming the column where the read knows it. A row and an include's JSON carry it as decimal text, so the range is checked before any digit is lost. */
|
|
314
|
+
declare class MysqlBigintNumberCodec extends CodecImpl<typeof MYSQL_BIGINT_NUMBER_CODEC_ID, readonly ['equality', 'order', 'numeric'], string | number, number> {
|
|
315
|
+
toWire(value: number, ctx: SqlCodecCallContext): Promise<number>;
|
|
316
|
+
fromWire(wire: string | number, ctx: SqlCodecCallContext): Promise<number>;
|
|
317
|
+
fromDataTypeValue(value: DataTypeValue<string>): number;
|
|
318
|
+
toDataTypeValue(input: number): DataTypeValue;
|
|
319
|
+
}
|
|
320
|
+
declare class MysqlBigintNumberDescriptor extends MysqlCodecDescriptor<void> {
|
|
321
|
+
readonly dataType: import("@prisma/orm-framework/components/codec").DataTypeId;
|
|
322
|
+
readonly codecId: "mysql/bigintnumber@1";
|
|
323
|
+
readonly traits: readonly ["equality", "order", "numeric"];
|
|
324
|
+
readonly paramsSchema: undefined;
|
|
325
|
+
renderValueLiteral(value: JsonValue): string | undefined;
|
|
326
|
+
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
327
|
+
factory(): (ctx: CodecInstanceContext) => MysqlBigintNumberCodec;
|
|
328
|
+
}
|
|
329
|
+
/** A MySQL `double` as a JavaScript number. A row carries it as the text MySQL prints, `1.5` or `9.007199254740992e15`, and an include's JSON as a number. MySQL and MariaDB hold no NaN or infinity, so the codec refuses to write one. */
|
|
330
|
+
declare class MysqlDoubleCodec extends CodecImpl<typeof MYSQL_DOUBLE_CODEC_ID, readonly ['equality', 'order', 'numeric'], string | number, number> {
|
|
331
|
+
toWire(value: number, ctx: SqlCodecCallContext): Promise<number>;
|
|
332
|
+
fromWire(wire: string | number, ctx: SqlCodecCallContext): Promise<number>;
|
|
333
|
+
fromDataTypeValue(value: DataTypeValue<number>): number;
|
|
334
|
+
toDataTypeValue(input: number): DataTypeValue;
|
|
335
|
+
}
|
|
336
|
+
declare class MysqlDoubleDescriptor extends MysqlCodecDescriptor<void> {
|
|
337
|
+
readonly dataType: import("@prisma/orm-framework/components/codec").DataTypeId;
|
|
338
|
+
readonly codecId: "mysql/double@1";
|
|
339
|
+
readonly traits: readonly ["equality", "order", "numeric"];
|
|
340
|
+
readonly paramsSchema: undefined;
|
|
341
|
+
renderValueLiteral(value: JsonValue): string | undefined;
|
|
342
|
+
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
343
|
+
factory(): (ctx: CodecInstanceContext) => MysqlDoubleCodec;
|
|
344
|
+
}
|
|
237
345
|
/**
|
|
238
346
|
* Reads the text MySQL sends for a `datetime` as the instant it names in UTC: the codec writes every value in UTC, so the column holds no time zone of its own.
|
|
239
347
|
*/
|
|
@@ -278,5 +386,5 @@ declare class MysqlEnumDescriptor extends MysqlCodecDescriptor<EnumParams> {
|
|
|
278
386
|
factory(params: EnumParams): (ctx: CodecInstanceContext) => MysqlEnumCodec;
|
|
279
387
|
}
|
|
280
388
|
//#endregion
|
|
281
|
-
export { encodeMysqlDatetime as _,
|
|
282
|
-
//# sourceMappingURL=codecs-
|
|
389
|
+
export { encodeMysqlDatetime as C, decodeMysqlDatetime as S, MysqlTimeStringDescriptor as _, MysqlDateTemporalDescriptor as a, MysqlTimestampStringDescriptor as b, MysqlDatetimeTemporalDescriptor as c, MysqlDurationStringDescriptor as d, MysqlEnumDescriptor as f, MysqlTextDescriptor as g, MysqlLongblobDescriptor as h, MysqlDateStringDescriptor as i, MysqlDecimalDescriptor as l, MysqlJsonDescriptor as m, MysqlBigintNumberDescriptor as n, MysqlDatetimeDescriptor as o, MysqlIntDescriptor as p, MysqlBooleanDescriptor as r, MysqlDatetimeStringDescriptor as s, MysqlBigintDescriptor as t, MysqlDoubleDescriptor as u, MysqlTimeTemporalDescriptor as v, MysqlTimestampTemporalDescriptor as x, MysqlTimestampDateDescriptor as y };
|
|
390
|
+
//# sourceMappingURL=codecs-D35fqdXJ-BZwilYUu.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs-D35fqdXJ-BZwilYUu.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/codecs-D35fqdXJ.d.mts"],"mappings":";;;;;;;;;KAQK,uBAAuB,mBAAmB;cACjC,0BAA0B,iBAAiB;EACvD,OAAO,eAAe,KAAK,sBAAsB;EACjD,SAAS,cAAc,KAAK,sBAAsB;;EAElD,kBAAkB,OAAO;EACzB,gBAAgB,gBAAgB;;cAEpB,+BAA+B,qBAAqB;WACvD,yDAAyD;WACzD;WACA;WACA;WACA,4DAA4D;IACnE;IACA;;YAEQ,iBAAiB,WAAW,aAAa,QAAQ,4BAA4B;;YAE7E,eAAe,YAAY,iBAAiB;EACtD,QAAQ,QAAQ,iBAAiB,KAAK,yBAAyB;;;;;cAKnD,0BAA0B,iBAAiB;EACvD,OAAO,gBAAgB,KAAK,sBAAsB;EAClD,SAAS,uBAAuB,KAAK,sBAAsB;EAC3D,kBAAkB,OAAO;EACzB,gBAAgB,iBAAiB;;cAErB,+BAA+B;WAClC,yDAAyD;WACzD;WACA;WACA;EACT,mBA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B;EAC3D,kBAAkB,OAAO;EACzB,gBAAgB,gBAAgB;;cAEpB,8BAA8B;WACjC,yDAAyD;WACzD;WACA;WACA;EACT,mBAAmB,OAAO;YAChB,eAAe,YAAY,iBAAiB;EACtD,YAAY,KAAK,yBAAyB;;;;;iBAK3B,oBAAoB,eAAe;;iBAEnC,oBAAoB,OAAO;;cAE9B,2BAA2B,iBAAiB,iEAAiE;EACzH,OAAO,OAAO,MAAM,MAAM,mBAAmB;EAC7C,SAAS,cAAc,MAAM,mBAAmB,QAAQ;EACxD,kBAAkB,OAAO,wBAAwB;EACjD,gBAAgB,OAAO,OAAO;;KAE3B,wBAAwB,oBAAoB;cACnC,gCAAgC,qBAAqB;WACxD,yDAAyD;WACzD;WACA;WACA,4DAA4D;IACnE;;YAEQ,eAAe,YAAY,iBAAiB;EACtD,QAAQ,QAAQ,kBAAkB,KAAK,yBAAyB;;;cAGpD,uBAAuB,iBAAiB;EACpD,OAAO,eAAe,MAAM,mBAAmB;EAC/C,SAAS,cAAc,MAAM,mBAAmB;EAChD,kBAAkB,OAAO;EACzB,gBAAgB,gBAAgB;;KAE7B,oBAAoB,gBAAgB;cAC3B,4BAA4B,qBAAqB;WACpD,yDAAyD;WACzD;WACA;WACA,4DAA4D;IACnE;;EAEF,mBAAmB,OAAO;YAChB,eAAe,YAAY,iBAAiB;EACtD,QAAQ,QAAQ,cAAc,KAAK,yBAAyB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as MysqlCodecDescriptorRegistry } from "./codec-descriptor-
|
|
2
|
-
import "./codecs-
|
|
1
|
+
import { i as MysqlCodecDescriptorRegistry } from "./codec-descriptor-DXsJwUng-D4abEAFs.mjs";
|
|
2
|
+
import "./codecs-D35fqdXJ-BZwilYUu.mjs";
|
|
3
3
|
import { CodecRegistry } from "@prisma/orm-framework/components/codec";
|
|
4
4
|
import { ComponentMetadata } from "@prisma/orm-framework/components/components";
|
|
5
5
|
import { CodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/query-lane-context";
|
|
@@ -33,4 +33,4 @@ declare const mysqlCodecRegistry: CodecDescriptorRegistry;
|
|
|
33
33
|
declare const mysqlCodecDescriptorRegistry: MysqlCodecDescriptorRegistry;
|
|
34
34
|
//#endregion
|
|
35
35
|
export { assembleMysqlCodecRegistry as a, mysqlCodecRegistry as c, MysqlCodecRegistry as i, mysqlCurrentValueFor as l, MYSQL_INSTANT_NOW as n, createMysqlBuiltinCodecLookup as o, MYSQL_TIME_NOW as r, mysqlCodecDescriptorRegistry as s, MYSQL_DATE_NOW as t, mysqlNowExpression as u };
|
|
36
|
-
//# sourceMappingURL=codecs-
|
|
36
|
+
//# sourceMappingURL=codecs-DTfUoamS.d.mts.map
|