@prisma/orm-target-mysql 8.0.0-rc.24-dev.27 → 8.0.0-rc.24-dev.29
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-BiZaCqna.mjs → control-BTolgwH5.mjs} +28 -13
- package/dist/control-BTolgwH5.mjs.map +1 -0
- package/dist/{control-CTfV1Zag.mjs → control-CZSBblPm.mjs} +26 -19
- package/dist/control-CZSBblPm.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-DB0w8R7i.mjs → runtime-CHWztV6c.mjs} +66 -46
- package/dist/runtime-CHWztV6c.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-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-a2Eekpu6-BDJa255m.mjs} +73 -67
- package/dist/statement-a2Eekpu6-BDJa255m.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 +13 -10
- 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
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
import { s as mysqlError } from "./errors-Cng94tYg-DTH51xWG.mjs";
|
|
2
|
-
import { r as quoteLiteral } from "./sql-utils-Cmv_TVa8-CNW3UmfQ.mjs";
|
|
3
|
-
import { INT32_RANGE, INT64_RANGE, dateTimeStoredText, numeralText, readJsonInteger, readJsonIntegerText, readJsonString, refuseJsonValue } from "@prisma/orm-framework/components/codec";
|
|
4
|
-
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
5
|
-
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
6
|
-
import { sqlDataType, sqlRawDataType } from "@prisma/orm-family-sql/contract/data-type";
|
|
7
|
-
import { ISO_DURATION_AS_WRITTEN } from "@prisma/orm-framework/type-implementations/duration";
|
|
8
|
-
import { type } from "arktype";
|
|
9
|
-
//#region ../../../3-targets/mysql/1-mysql/1-target/dist/data-types-DOaaPS93.mjs
|
|
10
|
-
const unchanged = (value) => value;
|
|
11
|
-
function wrongShape(value, expected) {
|
|
12
|
-
throw structuredError("CONTRACT.CAST_REFUSED", `Expected ${expected}, got ${JSON.stringify(value)}.`, {
|
|
13
|
-
why: "A cast reads the stored form of the type it takes values of.",
|
|
14
|
-
fix: "Hand the cast a value in the shape its source type stores."
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
const asNumeralText = (value) => typeof value === "number" ? numeralText(value) : wrongShape(value, "a number");
|
|
18
|
-
function integerParam(params, name) {
|
|
19
|
-
const value = params[name];
|
|
20
|
-
return typeof value === "number" ? value : void 0;
|
|
21
|
-
}
|
|
22
|
-
/** Text of at most `length` characters, counted as code points, as MySQL counts characters. */
|
|
23
|
-
function readTextOfLength(owner, json, length) {
|
|
24
|
-
const text = readJsonString(owner, json);
|
|
25
|
-
if (length !== void 0 && [...text].length > length) return refuseJsonValue(owner, `a string of at most ${length} ${length === 1 ? "character" : "characters"}`, json);
|
|
26
|
-
return json;
|
|
27
|
-
}
|
|
28
|
-
const mysqlText = sqlDataType("mysql/text", {
|
|
29
|
-
texts: [{
|
|
30
|
-
text: "text",
|
|
31
|
-
written: true,
|
|
32
|
-
catalog: true
|
|
33
|
-
}],
|
|
34
|
-
read: (json) => readJsonString("mysql/text", json),
|
|
35
|
-
casts: {}
|
|
36
|
-
});
|
|
37
|
-
const fromText = { [mysqlText.id]: unchanged };
|
|
38
|
-
/** A signed 32-bit integer, stored as a JSON number. */
|
|
39
|
-
const mysqlInt = sqlDataType("mysql/int", {
|
|
40
|
-
texts: [{
|
|
41
|
-
text: "int",
|
|
42
|
-
written: true,
|
|
43
|
-
catalog: true
|
|
44
|
-
}, { text: "integer" }],
|
|
45
|
-
read: (json) => readJsonInteger("mysql/int", json, INT32_RANGE),
|
|
46
|
-
casts: {}
|
|
47
|
-
});
|
|
48
|
-
/** A signed 64-bit integer, stored as digit text so that no digit is lost. */
|
|
49
|
-
const mysqlBigint = sqlDataType("mysql/bigint", {
|
|
50
|
-
texts: [{
|
|
51
|
-
text: "bigint",
|
|
52
|
-
written: true,
|
|
53
|
-
catalog: true
|
|
54
|
-
}],
|
|
55
|
-
read: (json) => {
|
|
56
|
-
readJsonIntegerText("mysql/bigint", json, INT64_RANGE);
|
|
57
|
-
return json;
|
|
58
|
-
},
|
|
59
|
-
casts: { [mysqlInt.id]: asNumeralText }
|
|
60
|
-
});
|
|
61
|
-
/** The length of `varchar`, which MySQL requires, up to the largest it accepts. */
|
|
62
|
-
const mysqlVarcharParams = type({ length: "number.integer >= 1 & number.integer <= 65535" });
|
|
63
|
-
const mysqlVarchar = sqlDataType("mysql/varchar", {
|
|
64
|
-
params: mysqlVarcharParams,
|
|
65
|
-
texts: [{
|
|
66
|
-
text: "varchar({length})",
|
|
67
|
-
written: true,
|
|
68
|
-
catalog: true
|
|
69
|
-
}],
|
|
70
|
-
read: (json, params) => readTextOfLength("mysql/varchar", json, integerParam(params, "length")),
|
|
71
|
-
casts: fromText
|
|
72
|
-
});
|
|
73
|
-
/** The length of `char`, at most 255; a bare `char` is `char(1)`. */
|
|
74
|
-
const mysqlCharParams = type({ "length?": "number.integer >= 1 & number.integer <= 255" });
|
|
75
|
-
const mysqlChar = sqlDataType("mysql/char", {
|
|
76
|
-
params: mysqlCharParams,
|
|
77
|
-
texts: [{
|
|
78
|
-
text: "char",
|
|
79
|
-
written: true
|
|
80
|
-
}, {
|
|
81
|
-
text: "char({length})",
|
|
82
|
-
written: true,
|
|
83
|
-
catalog: true
|
|
84
|
-
}],
|
|
85
|
-
read: (json, params) => readTextOfLength("mysql/char", json, integerParam(params, "length") ?? 1),
|
|
86
|
-
normalize: (params) => params.length === void 0 ? {
|
|
87
|
-
...params,
|
|
88
|
-
length: 1
|
|
89
|
-
} : params,
|
|
90
|
-
casts: fromText
|
|
91
|
-
});
|
|
92
|
-
/** The fractional-second precision of `datetime`, `timestamp` and `time`, 0 to 6; MySQL prints a precision of 0 as the bare type. */
|
|
93
|
-
const mysqlDatetimeParams = type({ "precision?": "number.integer >= 0 & number.integer <= 6" });
|
|
94
|
-
/** The years MySQL holds in a `datetime` and a `date`. */
|
|
95
|
-
const MYSQL_DATETIME_RANGE = {
|
|
96
|
-
earliest: "1000-01-01T00:00:00",
|
|
97
|
-
latest: "9999-12-31T23:59:59.999999"
|
|
98
|
-
};
|
|
99
|
-
/** The instants MySQL holds in a `timestamp`, in UTC. */
|
|
100
|
-
const MYSQL_TIMESTAMP_RANGE = {
|
|
101
|
-
earliest: "1970-01-01T00:00:01",
|
|
102
|
-
latest: "2038-01-19T03:14:07.999999"
|
|
103
|
-
};
|
|
104
|
-
const MYSQL_DATE_RANGE = {
|
|
105
|
-
earliest: "1000-01-01",
|
|
106
|
-
latest: "9999-12-31"
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* The value of `mysql/datetime`: a date and time without a time zone, ISO 8601 text with a `T` and no trailing zeros in the fraction, within MySQL's range. Throws `CONTRACT.CAST_REFUSED` for text that names no such date and time.
|
|
110
|
-
*/
|
|
111
|
-
function mysqlDatetimeText(text) {
|
|
112
|
-
return dateTimeStoredText(text, {
|
|
113
|
-
shape: "dateTime",
|
|
114
|
-
ownerId: "mysql/datetime",
|
|
115
|
-
range: MYSQL_DATETIME_RANGE
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* The value of `mysql/timestamp`: the UTC date and time of an instant from 1970-01-01T00:00:01 to 2038-01-19T03:14:07.999999, in the form `mysql/datetime` stores. Throws `CONTRACT.CAST_REFUSED` for text that names no such date and time.
|
|
120
|
-
*/
|
|
121
|
-
function mysqlTimestampText(text) {
|
|
122
|
-
return dateTimeStoredText(text, {
|
|
123
|
-
shape: "dateTime",
|
|
124
|
-
ownerId: "mysql/timestamp",
|
|
125
|
-
range: MYSQL_TIMESTAMP_RANGE
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
/** The value of `mysql/date`: a calendar date as ISO 8601 text, `2024-02-29`, in the years 1000 to 9999. Throws `CONTRACT.CAST_REFUSED` for other text. */
|
|
129
|
-
function mysqlDateText(text) {
|
|
130
|
-
return dateTimeStoredText(text, {
|
|
131
|
-
shape: "date",
|
|
132
|
-
ownerId: "mysql/date",
|
|
133
|
-
range: MYSQL_DATE_RANGE
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* The value of `mysql/time`: a time of day from 00:00:00 to 23:59:59.999999, ISO 8601 text with no trailing zeros in the fraction. MySQL's `time` also holds a negative time and hours past 23, which name no time of day, so they are refused. Throws `CONTRACT.CAST_REFUSED` for other text.
|
|
138
|
-
*/
|
|
139
|
-
function mysqlTimeText(text) {
|
|
140
|
-
return dateTimeStoredText(text, {
|
|
141
|
-
shape: "time",
|
|
142
|
-
ownerId: "mysql/time"
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
/** The value of `mysql/duration`: an ISO 8601 duration, stored as written. Throws `CONTRACT.CAST_REFUSED` for other text. */
|
|
146
|
-
function mysqlDurationText(text) {
|
|
147
|
-
if (ISO_DURATION_AS_WRITTEN.test(text)) return text;
|
|
148
|
-
throw structuredError("CONTRACT.CAST_REFUSED", `mysql/duration cannot read "${text}". Write an ISO 8601 duration, as in "PT1H30M".`, {
|
|
149
|
-
why: "mysql/duration holds an ISO 8601 duration as Temporal.Duration writes it: an optional sign, P, then years, months, weeks and days, then T and hours, minutes and seconds. A sign on each component instead is read too.",
|
|
150
|
-
fix: "Write the duration in ISO 8601, as in \"P1Y2M3DT4H5M6.5S\"."
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
/** What `stored` writes for `text`, or `undefined` when `stored` refuses it. */
|
|
154
|
-
function storedOrUndefined(stored, text) {
|
|
155
|
-
try {
|
|
156
|
-
return stored(text);
|
|
157
|
-
} catch {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
function readStored(id, stored, expected) {
|
|
162
|
-
return (json) => typeof json === "string" && storedOrUndefined(stored, json) !== void 0 ? json : refuseJsonValue(id, expected, json);
|
|
163
|
-
}
|
|
164
|
-
function spellStored(stored) {
|
|
165
|
-
return (json) => typeof json === "string" ? storedOrUndefined(stored, json) ?? json : json;
|
|
166
|
-
}
|
|
167
|
-
const withoutZeroPrecision = ({ precision, ...rest }) => precision === 0 ? rest : {
|
|
168
|
-
...rest,
|
|
169
|
-
...ifDefined("precision", precision)
|
|
170
|
-
};
|
|
171
|
-
const mysqlDatetime = sqlDataType("mysql/datetime", {
|
|
172
|
-
params: mysqlDatetimeParams,
|
|
173
|
-
texts: [{
|
|
174
|
-
text: "datetime",
|
|
175
|
-
written: true,
|
|
176
|
-
catalog: true
|
|
177
|
-
}, {
|
|
178
|
-
text: "datetime({precision})",
|
|
179
|
-
written: true,
|
|
180
|
-
catalog: true
|
|
181
|
-
}],
|
|
182
|
-
read: readStored("mysql/datetime", mysqlDatetimeText, "ISO 8601 date and time text without a UTC offset, as in \"2024-01-01T00:00:00\""),
|
|
183
|
-
spell: spellStored(mysqlDatetimeText),
|
|
184
|
-
normalize: withoutZeroPrecision,
|
|
185
|
-
casts: {}
|
|
186
|
-
});
|
|
187
|
-
/** An instant from 1970 to 2038, which MySQL converts between the session's time zone and UTC; every session runs in UTC. */
|
|
188
|
-
const mysqlTimestamp = sqlDataType("mysql/timestamp", {
|
|
189
|
-
params: mysqlDatetimeParams,
|
|
190
|
-
texts: [{
|
|
191
|
-
text: "timestamp",
|
|
192
|
-
written: true,
|
|
193
|
-
catalog: true
|
|
194
|
-
}, {
|
|
195
|
-
text: "timestamp({precision})",
|
|
196
|
-
written: true,
|
|
197
|
-
catalog: true
|
|
198
|
-
}],
|
|
199
|
-
read: readStored("mysql/timestamp", mysqlTimestampText, "ISO 8601 date and time text in UTC without a UTC offset, from 1970-01-01T00:00:01 to 2038-01-19T03:14:07.999999"),
|
|
200
|
-
spell: spellStored(mysqlTimestampText),
|
|
201
|
-
normalize: withoutZeroPrecision,
|
|
202
|
-
casts: {}
|
|
203
|
-
});
|
|
204
|
-
const mysqlDate = sqlDataType("mysql/date", {
|
|
205
|
-
texts: [{
|
|
206
|
-
text: "date",
|
|
207
|
-
written: true,
|
|
208
|
-
catalog: true
|
|
209
|
-
}],
|
|
210
|
-
read: readStored("mysql/date", mysqlDateText, "ISO 8601 date text, as in \"2024-02-29\""),
|
|
211
|
-
spell: spellStored(mysqlDateText),
|
|
212
|
-
casts: {}
|
|
213
|
-
});
|
|
214
|
-
const mysqlTime = sqlDataType("mysql/time", {
|
|
215
|
-
params: mysqlDatetimeParams,
|
|
216
|
-
texts: [{
|
|
217
|
-
text: "time",
|
|
218
|
-
written: true,
|
|
219
|
-
catalog: true
|
|
220
|
-
}, {
|
|
221
|
-
text: "time({precision})",
|
|
222
|
-
written: true,
|
|
223
|
-
catalog: true
|
|
224
|
-
}],
|
|
225
|
-
read: readStored("mysql/time", mysqlTimeText, "ISO 8601 time of day text from 00:00:00 to 23:59:59.999999, as in \"09:30:00\""),
|
|
226
|
-
spell: spellStored(mysqlTimeText),
|
|
227
|
-
normalize: withoutZeroPrecision,
|
|
228
|
-
casts: {}
|
|
229
|
-
});
|
|
230
|
-
/** The length of the `varchar` a duration column is stored in. A codec reference with none, as a raw parameter writes, reads and writes the same values. */
|
|
231
|
-
const mysqlDurationParams = type({ "length?": "number.integer >= 1 & number.integer <= 65535" });
|
|
232
|
-
/** A length of time, stored in a `varchar` column as the ISO 8601 duration it was written as, `PT1H30M`, so that MySQL can index it. MySQL has no interval type, and equal durations can be written differently, `P1D` and `PT24H`, so a duration keeps its spelling. ADR 315. */
|
|
233
|
-
const mysqlDuration = sqlDataType("mysql/duration", {
|
|
234
|
-
storedAs: mysqlVarchar.id,
|
|
235
|
-
read: readStored("mysql/duration", mysqlDurationText, "an ISO 8601 duration, as in \"PT1H30M\""),
|
|
236
|
-
casts: {}
|
|
237
|
-
});
|
|
238
|
-
/** The members of a native enum column, in the order they are declared. */
|
|
239
|
-
const mysqlEnumParams = type({ "values?": "string[]" });
|
|
240
|
-
/** `enum('A','B')`, the text MySQL's catalog prints for the column type, with each member a quoted literal. */
|
|
241
|
-
function renderMysqlEnumType(values) {
|
|
242
|
-
if (values === void 0 || values.length === 0) throw mysqlError("CONTRACT.TYPE_PARAMS_INVALID", "A MySQL enum column type needs at least one member.", {
|
|
243
|
-
why: "A native enum column is written with its members, and this column has none.",
|
|
244
|
-
fix: "Type the column with a PSL enum or an enumType() that declares its members.",
|
|
245
|
-
meta: { dataType: "mysql/enum" }
|
|
246
|
-
});
|
|
247
|
-
return `enum(${values.map(quoteLiteral).join(",")})`;
|
|
248
|
-
}
|
|
249
|
-
const readEnumMember = (json, params) => {
|
|
250
|
-
const member = readJsonString("mysql/enum", json);
|
|
251
|
-
const values = params["values"];
|
|
252
|
-
if (Array.isArray(values) && !values.includes(member)) return refuseJsonValue("mysql/enum", `one of the members ${values.join(", ")}`, json);
|
|
253
|
-
return json;
|
|
254
|
-
};
|
|
255
|
-
/**
|
|
256
|
-
* A native MySQL enum. Its name is the catalog text `enum('A','B')`, so `db verify` compares the members and their order with what MySQL reports (ADR 273). A column's members are its value set's, written into its parameters by the target's namespace (see `mysql-database.ts`).
|
|
257
|
-
*/
|
|
258
|
-
const mysqlEnum = sqlDataType("mysql/enum", {
|
|
259
|
-
params: mysqlEnumParams,
|
|
260
|
-
nameIsCatalogText: true,
|
|
261
|
-
render: ({ values }) => renderMysqlEnumType(values),
|
|
262
|
-
read: readEnumMember,
|
|
263
|
-
casts: fromText
|
|
264
|
-
});
|
|
265
|
-
/** Every data type this target registers. */
|
|
266
|
-
const mysqlDataTypes = [
|
|
267
|
-
mysqlText,
|
|
268
|
-
mysqlInt,
|
|
269
|
-
mysqlBigint,
|
|
270
|
-
mysqlVarchar,
|
|
271
|
-
mysqlChar,
|
|
272
|
-
mysqlDatetime,
|
|
273
|
-
mysqlTimestamp,
|
|
274
|
-
mysqlDate,
|
|
275
|
-
mysqlTime,
|
|
276
|
-
mysqlDuration,
|
|
277
|
-
mysqlEnum,
|
|
278
|
-
sqlRawDataType
|
|
279
|
-
];
|
|
280
|
-
/** MySQL's text data types, which a SQL discriminator column may have. */
|
|
281
|
-
const mysqlTextDataTypes = [
|
|
282
|
-
mysqlText.id,
|
|
283
|
-
mysqlVarchar.id,
|
|
284
|
-
mysqlChar.id
|
|
285
|
-
];
|
|
286
|
-
//#endregion
|
|
287
|
-
export { mysqlTimestampText as C, renderMysqlEnumType as E, mysqlTimestamp as S, mysqlVarcharParams as T, mysqlInt as _, mysqlCharParams as a, mysqlTime as b, mysqlDateText as c, mysqlDatetimeText as d, mysqlDuration as f, mysqlEnumParams as g, mysqlEnum as h, mysqlChar as i, mysqlDatetime as l, mysqlDurationText as m, MYSQL_TIMESTAMP_RANGE as n, mysqlDataTypes as o, mysqlDurationParams as p, mysqlBigint as r, mysqlDate as s, MYSQL_DATETIME_RANGE as t, mysqlDatetimeParams as u, mysqlText as v, mysqlVarchar as w, mysqlTimeText as x, mysqlTextDataTypes as y };
|
|
288
|
-
|
|
289
|
-
//# sourceMappingURL=data-types-DOaaPS93-lycGybNk.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-types-DOaaPS93-lycGybNk.mjs","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/data-types-DOaaPS93.mjs"],"sourcesContent":["import { s as mysqlError } from \"./errors-Cng94tYg.mjs\";\nimport { r as quoteLiteral } from \"./sql-utils-Cmv_TVa8.mjs\";\nimport { INT32_RANGE, INT64_RANGE, dateTimeStoredText, numeralText, readJsonInteger, readJsonIntegerText, readJsonString, refuseJsonValue } from \"@internal/framework-components/codec\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { sqlDataType, sqlRawDataType } from \"@internal/sql-contract/data-type\";\nimport { ISO_DURATION_AS_WRITTEN } from \"@internal/type-implementations/duration\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { type } from \"arktype\";\n//#region src/core/data-types.ts\nconst unchanged = (value) => value;\nfunction wrongShape(value, expected) {\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `Expected ${expected}, got ${JSON.stringify(value)}.`, {\n\t\twhy: \"A cast reads the stored form of the type it takes values of.\",\n\t\tfix: \"Hand the cast a value in the shape its source type stores.\"\n\t});\n}\nconst asNumeralText = (value) => typeof value === \"number\" ? numeralText(value) : wrongShape(value, \"a number\");\nfunction integerParam(params, name) {\n\tconst value = params[name];\n\treturn typeof value === \"number\" ? value : void 0;\n}\n/** Text of at most `length` characters, counted as code points, as MySQL counts characters. */\nfunction readTextOfLength(owner, json, length) {\n\tconst text = readJsonString(owner, json);\n\tif (length !== void 0 && [...text].length > length) return refuseJsonValue(owner, `a string of at most ${length} ${length === 1 ? \"character\" : \"characters\"}`, json);\n\treturn json;\n}\nconst mysqlText = sqlDataType(\"mysql/text\", {\n\ttexts: [{\n\t\ttext: \"text\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread: (json) => readJsonString(\"mysql/text\", json),\n\tcasts: {}\n});\nconst fromText = { [mysqlText.id]: unchanged };\n/** A signed 32-bit integer, stored as a JSON number. */\nconst mysqlInt = sqlDataType(\"mysql/int\", {\n\ttexts: [{\n\t\ttext: \"int\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}, { text: \"integer\" }],\n\tread: (json) => readJsonInteger(\"mysql/int\", json, INT32_RANGE),\n\tcasts: {}\n});\n/** A signed 64-bit integer, stored as digit text so that no digit is lost. */\nconst mysqlBigint = sqlDataType(\"mysql/bigint\", {\n\ttexts: [{\n\t\ttext: \"bigint\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread: (json) => {\n\t\treadJsonIntegerText(\"mysql/bigint\", json, INT64_RANGE);\n\t\treturn json;\n\t},\n\tcasts: { [mysqlInt.id]: asNumeralText }\n});\n/** The length of `varchar`, which MySQL requires, up to the largest it accepts. */\nconst mysqlVarcharParams = type({ length: \"number.integer >= 1 & number.integer <= 65535\" });\nconst mysqlVarchar = sqlDataType(\"mysql/varchar\", {\n\tparams: mysqlVarcharParams,\n\ttexts: [{\n\t\ttext: \"varchar({length})\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread: (json, params) => readTextOfLength(\"mysql/varchar\", json, integerParam(params, \"length\")),\n\tcasts: fromText\n});\n/** The length of `char`, at most 255; a bare `char` is `char(1)`. */\nconst mysqlCharParams = type({ \"length?\": \"number.integer >= 1 & number.integer <= 255\" });\nconst mysqlChar = sqlDataType(\"mysql/char\", {\n\tparams: mysqlCharParams,\n\ttexts: [{\n\t\ttext: \"char\",\n\t\twritten: true\n\t}, {\n\t\ttext: \"char({length})\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread: (json, params) => readTextOfLength(\"mysql/char\", json, integerParam(params, \"length\") ?? 1),\n\tnormalize: (params) => params.length === void 0 ? {\n\t\t...params,\n\t\tlength: 1\n\t} : params,\n\tcasts: fromText\n});\n/** The fractional-second precision of `datetime`, `timestamp` and `time`, 0 to 6; MySQL prints a precision of 0 as the bare type. */\nconst mysqlDatetimeParams = type({ \"precision?\": \"number.integer >= 0 & number.integer <= 6\" });\n/** The years MySQL holds in a `datetime` and a `date`. */\nconst MYSQL_DATETIME_RANGE = {\n\tearliest: \"1000-01-01T00:00:00\",\n\tlatest: \"9999-12-31T23:59:59.999999\"\n};\n/** The instants MySQL holds in a `timestamp`, in UTC. */\nconst MYSQL_TIMESTAMP_RANGE = {\n\tearliest: \"1970-01-01T00:00:01\",\n\tlatest: \"2038-01-19T03:14:07.999999\"\n};\nconst MYSQL_DATE_RANGE = {\n\tearliest: \"1000-01-01\",\n\tlatest: \"9999-12-31\"\n};\n/**\n* The value of `mysql/datetime`: a date and time without a time zone, ISO 8601 text with a `T` and no trailing zeros in the fraction, within MySQL's range. Throws `CONTRACT.CAST_REFUSED` for text that names no such date and time.\n*/\nfunction mysqlDatetimeText(text) {\n\treturn dateTimeStoredText(text, {\n\t\tshape: \"dateTime\",\n\t\townerId: \"mysql/datetime\",\n\t\trange: MYSQL_DATETIME_RANGE\n\t});\n}\n/**\n* The value of `mysql/timestamp`: the UTC date and time of an instant from 1970-01-01T00:00:01 to 2038-01-19T03:14:07.999999, in the form `mysql/datetime` stores. Throws `CONTRACT.CAST_REFUSED` for text that names no such date and time.\n*/\nfunction mysqlTimestampText(text) {\n\treturn dateTimeStoredText(text, {\n\t\tshape: \"dateTime\",\n\t\townerId: \"mysql/timestamp\",\n\t\trange: MYSQL_TIMESTAMP_RANGE\n\t});\n}\n/** The value of `mysql/date`: a calendar date as ISO 8601 text, `2024-02-29`, in the years 1000 to 9999. Throws `CONTRACT.CAST_REFUSED` for other text. */\nfunction mysqlDateText(text) {\n\treturn dateTimeStoredText(text, {\n\t\tshape: \"date\",\n\t\townerId: \"mysql/date\",\n\t\trange: MYSQL_DATE_RANGE\n\t});\n}\n/**\n* The value of `mysql/time`: a time of day from 00:00:00 to 23:59:59.999999, ISO 8601 text with no trailing zeros in the fraction. MySQL's `time` also holds a negative time and hours past 23, which name no time of day, so they are refused. Throws `CONTRACT.CAST_REFUSED` for other text.\n*/\nfunction mysqlTimeText(text) {\n\treturn dateTimeStoredText(text, {\n\t\tshape: \"time\",\n\t\townerId: \"mysql/time\"\n\t});\n}\n/** The value of `mysql/duration`: an ISO 8601 duration, stored as written. Throws `CONTRACT.CAST_REFUSED` for other text. */\nfunction mysqlDurationText(text) {\n\tif (ISO_DURATION_AS_WRITTEN.test(text)) return text;\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `mysql/duration cannot read \"${text}\". Write an ISO 8601 duration, as in \"PT1H30M\".`, {\n\t\twhy: \"mysql/duration holds an ISO 8601 duration as Temporal.Duration writes it: an optional sign, P, then years, months, weeks and days, then T and hours, minutes and seconds. A sign on each component instead is read too.\",\n\t\tfix: \"Write the duration in ISO 8601, as in \\\"P1Y2M3DT4H5M6.5S\\\".\"\n\t});\n}\n/** What `stored` writes for `text`, or `undefined` when `stored` refuses it. */\nfunction storedOrUndefined(stored, text) {\n\ttry {\n\t\treturn stored(text);\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction readStored(id, stored, expected) {\n\treturn (json) => typeof json === \"string\" && storedOrUndefined(stored, json) !== void 0 ? json : refuseJsonValue(id, expected, json);\n}\nfunction spellStored(stored) {\n\treturn (json) => typeof json === \"string\" ? storedOrUndefined(stored, json) ?? json : json;\n}\nconst withoutZeroPrecision = ({ precision, ...rest }) => precision === 0 ? rest : {\n\t...rest,\n\t...ifDefined(\"precision\", precision)\n};\nconst mysqlDatetime = sqlDataType(\"mysql/datetime\", {\n\tparams: mysqlDatetimeParams,\n\ttexts: [{\n\t\ttext: \"datetime\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}, {\n\t\ttext: \"datetime({precision})\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread: readStored(\"mysql/datetime\", mysqlDatetimeText, \"ISO 8601 date and time text without a UTC offset, as in \\\"2024-01-01T00:00:00\\\"\"),\n\tspell: spellStored(mysqlDatetimeText),\n\tnormalize: withoutZeroPrecision,\n\tcasts: {}\n});\n/** An instant from 1970 to 2038, which MySQL converts between the session's time zone and UTC; every session runs in UTC. */\nconst mysqlTimestamp = sqlDataType(\"mysql/timestamp\", {\n\tparams: mysqlDatetimeParams,\n\ttexts: [{\n\t\ttext: \"timestamp\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}, {\n\t\ttext: \"timestamp({precision})\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread: readStored(\"mysql/timestamp\", mysqlTimestampText, \"ISO 8601 date and time text in UTC without a UTC offset, from 1970-01-01T00:00:01 to 2038-01-19T03:14:07.999999\"),\n\tspell: spellStored(mysqlTimestampText),\n\tnormalize: withoutZeroPrecision,\n\tcasts: {}\n});\nconst mysqlDate = sqlDataType(\"mysql/date\", {\n\ttexts: [{\n\t\ttext: \"date\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread: readStored(\"mysql/date\", mysqlDateText, \"ISO 8601 date text, as in \\\"2024-02-29\\\"\"),\n\tspell: spellStored(mysqlDateText),\n\tcasts: {}\n});\nconst mysqlTime = sqlDataType(\"mysql/time\", {\n\tparams: mysqlDatetimeParams,\n\ttexts: [{\n\t\ttext: \"time\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}, {\n\t\ttext: \"time({precision})\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread: readStored(\"mysql/time\", mysqlTimeText, \"ISO 8601 time of day text from 00:00:00 to 23:59:59.999999, as in \\\"09:30:00\\\"\"),\n\tspell: spellStored(mysqlTimeText),\n\tnormalize: withoutZeroPrecision,\n\tcasts: {}\n});\n/** The length of the `varchar` a duration column is stored in. A codec reference with none, as a raw parameter writes, reads and writes the same values. */\nconst mysqlDurationParams = type({ \"length?\": \"number.integer >= 1 & number.integer <= 65535\" });\n/** A length of time, stored in a `varchar` column as the ISO 8601 duration it was written as, `PT1H30M`, so that MySQL can index it. MySQL has no interval type, and equal durations can be written differently, `P1D` and `PT24H`, so a duration keeps its spelling. ADR 315. */\nconst mysqlDuration = sqlDataType(\"mysql/duration\", {\n\tstoredAs: mysqlVarchar.id,\n\tread: readStored(\"mysql/duration\", mysqlDurationText, \"an ISO 8601 duration, as in \\\"PT1H30M\\\"\"),\n\tcasts: {}\n});\n/** The members of a native enum column, in the order they are declared. */\nconst mysqlEnumParams = type({ \"values?\": \"string[]\" });\n/** `enum('A','B')`, the text MySQL's catalog prints for the column type, with each member a quoted literal. */\nfunction renderMysqlEnumType(values) {\n\tif (values === void 0 || values.length === 0) throw mysqlError(\"CONTRACT.TYPE_PARAMS_INVALID\", \"A MySQL enum column type needs at least one member.\", {\n\t\twhy: \"A native enum column is written with its members, and this column has none.\",\n\t\tfix: \"Type the column with a PSL enum or an enumType() that declares its members.\",\n\t\tmeta: { dataType: \"mysql/enum\" }\n\t});\n\treturn `enum(${values.map(quoteLiteral).join(\",\")})`;\n}\nconst readEnumMember = (json, params) => {\n\tconst member = readJsonString(\"mysql/enum\", json);\n\tconst values = params[\"values\"];\n\tif (Array.isArray(values) && !values.includes(member)) return refuseJsonValue(\"mysql/enum\", `one of the members ${values.join(\", \")}`, json);\n\treturn json;\n};\n/**\n* A native MySQL enum. Its name is the catalog text `enum('A','B')`, so `db verify` compares the members and their order with what MySQL reports (ADR 273). A column's members are its value set's, written into its parameters by the target's namespace (see `mysql-database.ts`).\n*/\nconst mysqlEnum = sqlDataType(\"mysql/enum\", {\n\tparams: mysqlEnumParams,\n\tnameIsCatalogText: true,\n\trender: ({ values }) => renderMysqlEnumType(values),\n\tread: readEnumMember,\n\tcasts: fromText\n});\n/** Every data type this target registers. */\nconst mysqlDataTypes = [\n\tmysqlText,\n\tmysqlInt,\n\tmysqlBigint,\n\tmysqlVarchar,\n\tmysqlChar,\n\tmysqlDatetime,\n\tmysqlTimestamp,\n\tmysqlDate,\n\tmysqlTime,\n\tmysqlDuration,\n\tmysqlEnum,\n\tsqlRawDataType\n];\n/** MySQL's text data types, which a SQL discriminator column may have. */\nconst mysqlTextDataTypes = [\n\tmysqlText.id,\n\tmysqlVarchar.id,\n\tmysqlChar.id\n];\n//#endregion\nexport { mysqlTimestampText as C, renderMysqlEnumType as E, mysqlTimestamp as S, mysqlVarcharParams as T, mysqlInt as _, mysqlCharParams as a, mysqlTime as b, mysqlDateText as c, mysqlDatetimeText as d, mysqlDuration as f, mysqlEnumParams as g, mysqlEnum as h, mysqlChar as i, mysqlDatetime as l, mysqlDurationText as m, MYSQL_TIMESTAMP_RANGE as n, mysqlDataTypes as o, mysqlDurationParams as p, mysqlBigint as r, mysqlDate as s, MYSQL_DATETIME_RANGE as t, mysqlDatetimeParams as u, mysqlText as v, mysqlVarchar as w, mysqlTimeText as x, mysqlTextDataTypes as y };\n\n//# sourceMappingURL=data-types-DOaaPS93.mjs.map"],"mappings":";;;;;;;;;AASA,MAAM,aAAa,UAAU;AAC7B,SAAS,WAAW,OAAO,UAAU;CACpC,MAAM,gBAAgB,yBAAyB,YAAY,SAAS,QAAQ,KAAK,UAAU,KAAK,EAAE,IAAI;EACrG,KAAK;EACL,KAAK;CACN,CAAC;AACF;AACA,MAAM,iBAAiB,UAAU,OAAO,UAAU,WAAW,YAAY,KAAK,IAAI,WAAW,OAAO,UAAU;AAC9G,SAA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O,YAAY,aAAa;CAChC,WAAW;CACX,OAAO,CAAC;AACT,CAAC;;AAED,MAAM,sBAAsB,KAAK,EAAE,WAAW,gDAAgD,CAAC;;AAE/F,MAAM,gBAAgB,YAAY,kBAAkB;CACnD,UAAU,aAAa;CACvB,MAAM,WAAW,kBAAkB,mBAAmB,yCAAyC;CAC/F,OAAO,CAAC;AACT,CAAC;;AAED,MAAM,kBAAkB,KAAK,EAAE,WAAW,WAAW,CAAC;;AAEtD,SAAS,oBAAoB,QAAQ;CACpC,IAAI,WAAW,KAAK,KAAK,OAAO,WAAW,GAAG,MAAM,WAAW,gCAAgC,uDAAuD;EACrJ,KAAK;EACL,KAAK;EACL,MAAM,EAAE,UAAU,aAAa;CAChC,CAAC;CACD,OAAO,QAAQ,OAAO,IAAI,YAAY,CAAC,CAAC,KAAK,GAAG,EAAE;AACnD;AACA,MAAM,kBAAkB,MAAM,WAAW;CACxC,MAAM,SAAS,eAAe,cAAc,IAAI;CAChD,MAAM,SAAS,OAAO;CACtB,IAAI,MAAM,QAAQ,MAAM,KAAK,CAAC,OAAO,SAAS,MAAM,GAAG,OAAO,gBAAgB,cAAc,sBAAsB,OAAO,KAAK,IAAI,KAAK,IAAI;CAC3I,OAAO;AACR;;;;AAIA,MAAM,YAAY,YAAY,cAAc;CAC3C,QAAQ;CACR,mBAAmB;CACnB,SAAS,EAAE,aAAa,oBAAoB,MAAM;CAClD,MAAM;CACN,OAAO;AACR,CAAC;;AAED,MAAM,iBAAiB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,qBAAqB;CAC1B,UAAU;CACV,aAAa;CACb,UAAU;AACX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-time-now-generators-BKakW3gd-CIFPuRdM.mjs","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/date-time-now-generators-BKakW3gd.mjs"],"sourcesContent":["import { o as mysqlDataTypes } from \"./data-types-DOaaPS93.mjs\";\nimport { t as requireTemporal } from \"./require-temporal-DeDQhbTn.mjs\";\nimport * as nowValues from \"@internal/type-implementations/now\";\nimport { DATE_STRING_NOW_GENERATOR_ID, INSTANT_NOW_GENERATOR_ID, INSTANT_STRING_NOW_GENERATOR_ID, PLAIN_DATE_NOW_GENERATOR_ID, PLAIN_TIME_NOW_GENERATOR_ID, TIME_STRING_NOW_GENERATOR_ID, fractionDigitsOf } from \"@internal/type-implementations/now\";\nconst mysqlTargetDescriptorMetaRuntime = {\n\tkind: \"target\",\n\tfamilyId: \"sql\",\n\ttargetId: \"mysql\",\n\tid: \"mysql\",\n\tversion: \"0.0.1\",\n\tcapabilities: {},\n\tdataTypes: mysqlDataTypes,\n\tsessionSettings: { time_zone: \"+00:00\" }\n};\n//#endregion\n//#region src/core/date-time-now-generators.ts\n/** The fraction digits of a bare `datetime`, `timestamp` or `time`. */\nconst BARE_TYPE_FRACTION_DIGITS = 0;\nfunction fractionDigits(params) {\n\treturn fractionDigitsOf(params, BARE_TYPE_FRACTION_DIGITS);\n}\nfunction instantNow(params) {\n\treturn nowValues.instantNow(requireTemporal({ generatorId: INSTANT_NOW_GENERATOR_ID }), fractionDigits(params));\n}\nfunction plainDateNow() {\n\treturn nowValues.plainDateNow(requireTemporal({ generatorId: PLAIN_DATE_NOW_GENERATOR_ID }));\n}\nfunction plainTimeNow(params) {\n\treturn nowValues.plainTimeNow(requireTemporal({ generatorId: PLAIN_TIME_NOW_GENERATOR_ID }), fractionDigits(params));\n}\nfunction instantStringNow(params) {\n\treturn nowValues.instantStringNow(fractionDigits(params), \"trimmed\");\n}\nfunction timeStringNow(params) {\n\treturn nowValues.timeStringNow(fractionDigits(params), \"trimmed\");\n}\n/**\n* The MySQL \"now\" generators, one per date and time codec except `mysql/datetime@1` and `mysql/timestamp-date@1`, which use the SQL family's `timestampNow`. All read the clock through `Date.now()` and write UTC. Each rounds down to the column's `precision` param, so MySQL, which rounds a value to the column's fraction digits, stores the value the client holds rather than rounding it up. The string generators write the text their codec reads, with no trailing zeros in the fraction.\n*/\nconst mysqlNowGenerators = [\n\t{\n\t\tid: INSTANT_NOW_GENERATOR_ID,\n\t\tgenerate: instantNow\n\t},\n\t{\n\t\tid: PLAIN_DATE_NOW_GENERATOR_ID,\n\t\tgenerate: plainDateNow\n\t},\n\t{\n\t\tid: PLAIN_TIME_NOW_GENERATOR_ID,\n\t\tgenerate: plainTimeNow\n\t},\n\t{\n\t\tid: INSTANT_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: instantStringNow\n\t},\n\t{\n\t\tid: DATE_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: nowValues.dateStringNow\n\t},\n\t{\n\t\tid: TIME_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: timeStringNow\n\t}\n];\n//#endregion\nexport { mysqlTargetDescriptorMetaRuntime as n, mysqlNowGenerators as t };\n\n//# sourceMappingURL=date-time-now-generators-BKakW3gd.mjs.map"],"mappings":";;;;;AAIA,MAAM,mCAAmC;CACxC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,CAAC;CACf,WAAW;CACX,iBAAiB,EAAE,WAAW,SAAS;AACxC;;AAIA,MAAM,4BAA4B;AAClC,SAAS,eAAe,QAAQ;CAC/B,OAAO,iBAAiB,QAAQ,yBAAyB;AAC1D;AACA,SAAS,WAAW,QAAQ;CAC3B,OAAO,UAAU,WAAW,gBAAgB,EAAE,aAAa,yBAAyB,CAAC,GAAG,eAAe,MAAM,CAAC;AAC/G;AACA,SAAS,eAAe;CACvB,OAAO,UAAU,aAAa,gBAAgB,EAAE,aAAa,4BAA4B,CAAC,CAAC;AAC5F;AACA,SAAS,aAAa,QAAQ;CAC7B,OAAO,UAAU,aAAa,gBAAgB,EAAE,aAAa,4BAA4B,CAAC,GAAG,eAAe,MAAM,CAAC;AACpH;AACA,SAAS,iBAAiB,QAAQ;CACjC,OAAO,UAAU,iBAAiB,eAAe,MAAM,GAAG,SAAS;AACpE;AACA,SAAS,cAAc,QAAQ;CAC9B,OAAO,UAAU,cAAc,eAAe,MAAM,GAAG,SAAS;AACjE;;;;AAIA,MAAM,qBAAqB;CAC1B;EACC,IAAI;EACJ,UAAU;CACX;CACA;EACC,IAAI;EACJ,UAAU;CACX;CACA;EACC,IAAI;EACJ,UAAU;CACX;CACA;EACC,IAAI;EACJ,UAAU;CACX;CACA;EACC,IAAI;EACJ,UAAU,UAAU;CACrB;CACA;EACC,IAAI;EACJ,UAAU;CACX;AACD"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { i as mysqlCurrentValueFor, n as MYSQL_INSTANT_NOW, r as MYSQL_TIME_NOW, t as MYSQL_DATE_NOW } from "./now-expression-DVD18CUc-DJqdZY96.mjs";
|
|
2
|
-
//#region ../../../3-targets/mysql/1-mysql/1-target/dist/default-normalizer-C8pc7SbL.mjs
|
|
3
|
-
const AUTOINCREMENT = {
|
|
4
|
-
kind: "function",
|
|
5
|
-
expression: "autoincrement()"
|
|
6
|
-
};
|
|
7
|
-
const CURRENT_TIMESTAMP = /^(?:current_timestamp|now|localtime|localtimestamp)(?:\s*\(\s*\d*\s*\))?$/i;
|
|
8
|
-
const CURRENT_DATE = /^(?:curdate|current_date)(?:\s*\(\s*\))?$/i;
|
|
9
|
-
const CURRENT_TIME = /^(?:curtime|current_time)(?:\s*\(\s*\d*\s*\))?$/i;
|
|
10
|
-
/** The name of the current value `expression` writes: `now()` for the current instant, and its own name for the current date and the current time of day, which hold different values. `undefined` for any other expression. */
|
|
11
|
-
function currentValueNamed(expression) {
|
|
12
|
-
if (CURRENT_TIMESTAMP.test(expression)) return MYSQL_INSTANT_NOW;
|
|
13
|
-
if (CURRENT_DATE.test(expression)) return MYSQL_DATE_NOW;
|
|
14
|
-
if (CURRENT_TIME.test(expression)) return MYSQL_TIME_NOW;
|
|
15
|
-
}
|
|
16
|
-
const SQL_ESCAPES = {
|
|
17
|
-
"0": "\0",
|
|
18
|
-
b: "\b",
|
|
19
|
-
n: "\n",
|
|
20
|
-
r: "\r",
|
|
21
|
-
t: " ",
|
|
22
|
-
Z: ""
|
|
23
|
-
};
|
|
24
|
-
const INTRODUCED_STRING = /^_[A-Za-z0-9]+'/;
|
|
25
|
-
function withoutBackslashEscapes(text) {
|
|
26
|
-
return text.replace(/\\(.)/gs, "$1");
|
|
27
|
-
}
|
|
28
|
-
/** The text of a MySQL string literal whose opening quote ends `start`, when the literal runs to the end of `text`. */
|
|
29
|
-
function stringLiteralBody(text, start) {
|
|
30
|
-
let body = "";
|
|
31
|
-
for (let index = start; index < text.length; index += 1) {
|
|
32
|
-
const char = text.charAt(index);
|
|
33
|
-
if (char === "\\") {
|
|
34
|
-
index += 1;
|
|
35
|
-
const escaped = text.charAt(index);
|
|
36
|
-
body += escaped === "%" || escaped === "_" ? `\\${escaped}` : SQL_ESCAPES[escaped] ?? escaped;
|
|
37
|
-
} else if (char === "'" && text.charAt(index + 1) === "'") {
|
|
38
|
-
body += "'";
|
|
39
|
-
index += 1;
|
|
40
|
-
} else if (char === "'") return index === text.length - 1 ? body : void 0;
|
|
41
|
-
else body += char;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* The value of a default MySQL reports as a string with a character set introducer, such as `_utf8mb4\'abc\'`: the form a literal default on a text, blob or JSON column takes, because MySQL writes it as an expression. `undefined` for any other expression.
|
|
46
|
-
*/
|
|
47
|
-
function introducedStringValue(reported) {
|
|
48
|
-
const expression = withoutBackslashEscapes(reported.trim());
|
|
49
|
-
const opening = INTRODUCED_STRING.exec(expression);
|
|
50
|
-
return opening === null ? void 0 : stringLiteralBody(expression, opening[0].length);
|
|
51
|
-
}
|
|
52
|
-
function extraFlags(extra) {
|
|
53
|
-
return extra.toLowerCase().split(/\s+/);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Reads a column's reported default from `COLUMN_DEFAULT` and `EXTRA`. `auto_increment` is `autoincrement()`; a string with a character set introducer, the form MySQL reports for a literal default on a text, blob or JSON column, is that literal; an expression default that writes the current instant, such as `CURRENT_TIMESTAMP(3)`, is `now()`, and one that writes the current date or time of day, `curdate()` or `curtime(6)`, is `CURRENT_DATE` or `CURRENT_TIME`; any other expression default is a function default kept as reported; and anything else is a literal. `undefined` when the column has no default.
|
|
57
|
-
*/
|
|
58
|
-
function readMysqlDefault(columnDefault, extra) {
|
|
59
|
-
const flags = extraFlags(extra);
|
|
60
|
-
if (flags.includes("auto_increment")) return AUTOINCREMENT;
|
|
61
|
-
if (columnDefault === null) return void 0;
|
|
62
|
-
if (flags.includes("default_generated")) {
|
|
63
|
-
const introduced = introducedStringValue(columnDefault);
|
|
64
|
-
if (introduced !== void 0) return {
|
|
65
|
-
kind: "literal",
|
|
66
|
-
literal: {
|
|
67
|
-
kind: "value",
|
|
68
|
-
body: introduced
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
const expression = columnDefault.trim();
|
|
72
|
-
return {
|
|
73
|
-
kind: "function",
|
|
74
|
-
expression: currentValueNamed(expression) ?? expression
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
return {
|
|
78
|
-
kind: "literal",
|
|
79
|
-
literal: {
|
|
80
|
-
kind: "value",
|
|
81
|
-
body: columnDefault
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Names a contract's expression default the way {@link readMysqlDefault} names the same function in the database, so `` sql`CURRENT_TIMESTAMP(3)` `` and the database's `now()` compare equal. A `now()` default is named as the current value its column's data type writes, so a `now()` on a `date` column and one on a `datetime` column differ, as the values they write do. Every other default passes through unchanged.
|
|
87
|
-
*/
|
|
88
|
-
function mysqlResolveDefault(def, column) {
|
|
89
|
-
if (def.kind !== "function") return def;
|
|
90
|
-
const expression = def.expression.trim();
|
|
91
|
-
const named = expression === "now()" ? mysqlCurrentValueFor(column.dataTypeId) : currentValueNamed(expression);
|
|
92
|
-
return named === void 0 ? def : {
|
|
93
|
-
kind: "function",
|
|
94
|
-
expression: named
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
export { readMysqlDefault as n, mysqlResolveDefault as t };
|
|
99
|
-
|
|
100
|
-
//# sourceMappingURL=default-normalizer-C8pc7SbL-BXd70q02.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-normalizer-C8pc7SbL-BXd70q02.mjs","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/default-normalizer-C8pc7SbL.mjs"],"sourcesContent":["import { i as mysqlCurrentValueFor, n as MYSQL_INSTANT_NOW, r as MYSQL_TIME_NOW, t as MYSQL_DATE_NOW } from \"./now-expression-DVD18CUc.mjs\";\n//#region src/core/default-normalizer.ts\nconst AUTOINCREMENT = {\n\tkind: \"function\",\n\texpression: \"autoincrement()\"\n};\nconst CURRENT_TIMESTAMP = /^(?:current_timestamp|now|localtime|localtimestamp)(?:\\s*\\(\\s*\\d*\\s*\\))?$/i;\nconst CURRENT_DATE = /^(?:curdate|current_date)(?:\\s*\\(\\s*\\))?$/i;\nconst CURRENT_TIME = /^(?:curtime|current_time)(?:\\s*\\(\\s*\\d*\\s*\\))?$/i;\n/** The name of the current value `expression` writes: `now()` for the current instant, and its own name for the current date and the current time of day, which hold different values. `undefined` for any other expression. */\nfunction currentValueNamed(expression) {\n\tif (CURRENT_TIMESTAMP.test(expression)) return MYSQL_INSTANT_NOW;\n\tif (CURRENT_DATE.test(expression)) return MYSQL_DATE_NOW;\n\tif (CURRENT_TIME.test(expression)) return MYSQL_TIME_NOW;\n}\nconst SQL_ESCAPES = {\n\t\"0\": \"\\0\",\n\tb: \"\\b\",\n\tn: \"\\n\",\n\tr: \"\\r\",\n\tt: \"\t\",\n\tZ: \"\u001a\"\n};\nconst INTRODUCED_STRING = /^_[A-Za-z0-9]+'/;\nfunction withoutBackslashEscapes(text) {\n\treturn text.replace(/\\\\(.)/gs, \"$1\");\n}\n/** The text of a MySQL string literal whose opening quote ends `start`, when the literal runs to the end of `text`. */\nfunction stringLiteralBody(text, start) {\n\tlet body = \"\";\n\tfor (let index = start; index < text.length; index += 1) {\n\t\tconst char = text.charAt(index);\n\t\tif (char === \"\\\\\") {\n\t\t\tindex += 1;\n\t\t\tconst escaped = text.charAt(index);\n\t\t\tbody += escaped === \"%\" || escaped === \"_\" ? `\\\\${escaped}` : SQL_ESCAPES[escaped] ?? escaped;\n\t\t} else if (char === \"'\" && text.charAt(index + 1) === \"'\") {\n\t\t\tbody += \"'\";\n\t\t\tindex += 1;\n\t\t} else if (char === \"'\") return index === text.length - 1 ? body : void 0;\n\t\telse body += char;\n\t}\n}\n/**\n* The value of a default MySQL reports as a string with a character set introducer, such as `_utf8mb4\\'abc\\'`: the form a literal default on a text, blob or JSON column takes, because MySQL writes it as an expression. `undefined` for any other expression.\n*/\nfunction introducedStringValue(reported) {\n\tconst expression = withoutBackslashEscapes(reported.trim());\n\tconst opening = INTRODUCED_STRING.exec(expression);\n\treturn opening === null ? void 0 : stringLiteralBody(expression, opening[0].length);\n}\nfunction extraFlags(extra) {\n\treturn extra.toLowerCase().split(/\\s+/);\n}\n/**\n* Reads a column's reported default from `COLUMN_DEFAULT` and `EXTRA`. `auto_increment` is `autoincrement()`; a string with a character set introducer, the form MySQL reports for a literal default on a text, blob or JSON column, is that literal; an expression default that writes the current instant, such as `CURRENT_TIMESTAMP(3)`, is `now()`, and one that writes the current date or time of day, `curdate()` or `curtime(6)`, is `CURRENT_DATE` or `CURRENT_TIME`; any other expression default is a function default kept as reported; and anything else is a literal. `undefined` when the column has no default.\n*/\nfunction readMysqlDefault(columnDefault, extra) {\n\tconst flags = extraFlags(extra);\n\tif (flags.includes(\"auto_increment\")) return AUTOINCREMENT;\n\tif (columnDefault === null) return void 0;\n\tif (flags.includes(\"default_generated\")) {\n\t\tconst introduced = introducedStringValue(columnDefault);\n\t\tif (introduced !== void 0) return {\n\t\t\tkind: \"literal\",\n\t\t\tliteral: {\n\t\t\t\tkind: \"value\",\n\t\t\t\tbody: introduced\n\t\t\t}\n\t\t};\n\t\tconst expression = columnDefault.trim();\n\t\treturn {\n\t\t\tkind: \"function\",\n\t\t\texpression: currentValueNamed(expression) ?? expression\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"literal\",\n\t\tliteral: {\n\t\t\tkind: \"value\",\n\t\t\tbody: columnDefault\n\t\t}\n\t};\n}\n/**\n* Names a contract's expression default the way {@link readMysqlDefault} names the same function in the database, so `` sql`CURRENT_TIMESTAMP(3)` `` and the database's `now()` compare equal. A `now()` default is named as the current value its column's data type writes, so a `now()` on a `date` column and one on a `datetime` column differ, as the values they write do. Every other default passes through unchanged.\n*/\nfunction mysqlResolveDefault(def, column) {\n\tif (def.kind !== \"function\") return def;\n\tconst expression = def.expression.trim();\n\tconst named = expression === \"now()\" ? mysqlCurrentValueFor(column.dataTypeId) : currentValueNamed(expression);\n\treturn named === void 0 ? def : {\n\t\tkind: \"function\",\n\t\texpression: named\n\t};\n}\n//#endregion\nexport { readMysqlDefault as n, mysqlResolveDefault as t };\n\n//# sourceMappingURL=default-normalizer-C8pc7SbL.mjs.map"],"mappings":";;AAEA,MAAM,gBAAgB;CACrB,MAAM;CACN,YAAY;AACb;AACA,MAAM,oBAAoB;AAC1B,MAAM,eAAe;AACrB,MAAM,eAAe;;AAErB,SAAS,kBAAkB,YAAY;CACtC,IAAI,kBAAkB,KAAK,UAAU,GAAG,OAAO;CAC/C,IAAI,aAAa,KAAK,UAAU,GAAG,OAAO;CAC1C,IAAI,aAAa,KAAK,UAAU,GAAG,OAAO;AAC3C;AACA,MAAM,cAAc;CACnB,KAAK;CACL,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACJ;AACA,MAAM,oBAAoB;AAC1B,SAAS,wBAAwB,MAAM;CACtC,OAAO,KAAK,QAAQ,WAAW,IAAI;AACpC;;AAEA,SAAS,kBAAkB,MAAM,OAAO;CACvC,IAAI,OAAO;CACX,KAAK,IAAI,QAA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AAM,aAAa,IAAI,WAAW,KAAK;CACvC,MAAM,QAAQ,eAAe,UAAU,qBAAqB,OAAO,UAAU,IAAI,kBAAkB,UAAU;CAC7G,OAAO,UAAU,KAAK,IAAI,MAAM;EAC/B,MAAM;EACN,YAAY;CACb;AACD"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { DefaultResolverColumn, ReportedLiteralDefault } from "@prisma/orm-family-sql/family/control";
|
|
2
|
-
import { ColumnDefault } from "@prisma/orm-framework/contract/types";
|
|
3
|
-
//#region ../../../3-targets/mysql/1-mysql/1-target/dist/default-normalizer.d.mts
|
|
4
|
-
//#region src/core/default-normalizer.d.ts
|
|
5
|
-
/** What a column's reported default is: a function, or a literal the column's codec reads. */
|
|
6
|
-
type MysqlReportedDefault = {
|
|
7
|
-
readonly kind: 'function';
|
|
8
|
-
readonly expression: string;
|
|
9
|
-
} | {
|
|
10
|
-
readonly kind: 'literal';
|
|
11
|
-
readonly literal: Extract<ReportedLiteralDefault, {
|
|
12
|
-
readonly kind: 'value';
|
|
13
|
-
}> & {
|
|
14
|
-
readonly body: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Reads a column's reported default from `COLUMN_DEFAULT` and `EXTRA`. `auto_increment` is `autoincrement()`; a string with a character set introducer, the form MySQL reports for a literal default on a text, blob or JSON column, is that literal; an expression default that writes the current instant, such as `CURRENT_TIMESTAMP(3)`, is `now()`, and one that writes the current date or time of day, `curdate()` or `curtime(6)`, is `CURRENT_DATE` or `CURRENT_TIME`; any other expression default is a function default kept as reported; and anything else is a literal. `undefined` when the column has no default.
|
|
19
|
-
*/
|
|
20
|
-
declare function readMysqlDefault(columnDefault: string | null, extra: string): MysqlReportedDefault | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Names a contract's expression default the way {@link readMysqlDefault} names the same function in the database, so `` sql`CURRENT_TIMESTAMP(3)` `` and the database's `now()` compare equal. A `now()` default is named as the current value its column's data type writes, so a `now()` on a `date` column and one on a `datetime` column differ, as the values they write do. Every other default passes through unchanged.
|
|
23
|
-
*/
|
|
24
|
-
declare function mysqlResolveDefault(def: ColumnDefault, column: DefaultResolverColumn): ColumnDefault;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { mysqlResolveDefault as n, readMysqlDefault as r, MysqlReportedDefault as t };
|
|
27
|
-
//# sourceMappingURL=default-normalizer-D-8Ii0df.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-normalizer-D-8Ii0df.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/default-normalizer.d.mts"],"mappings":";;;;;KAIK;WACM;WACA;;WAEA;WACA,SAAS,QAAQ;aACf;;aAEA;;;;;;iBAMI,iBAAiB,8BAA8B,gBAAgB;;;;iBAI/D,oBAAoB,KAAK,eAAe,QAAQ,wBAAwB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-BF6YvSag-ChHHvlHc.mjs","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/descriptor-meta-BF6YvSag.mjs"],"sourcesContent":["import { a as MYSQL_DATE_STRING_CODEC_ID, d as MYSQL_TIMESTAMP_DATE_CODEC_ID, f as MYSQL_TIMESTAMP_STRING_CODEC_ID, h as MYSQL_TIME_TEMPORAL_CODEC_ID, i as MYSQL_DATETIME_TEMPORAL_CODEC_ID, l as MYSQL_INT_CODEC_ID, m as MYSQL_TIME_STRING_CODEC_ID, n as MYSQL_DATETIME_CODEC_ID, o as MYSQL_DATE_TEMPORAL_CODEC_ID, p as MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID, r as MYSQL_DATETIME_STRING_CODEC_ID, s as MYSQL_DURATION_STRING_CODEC_ID, t as MYSQL_BIGINT_CODEC_ID, u as MYSQL_TEXT_CODEC_ID } from \"./codec-ids-CrR9Xi7r.mjs\";\nimport { _ as mysqlInt, y as mysqlTextDataTypes } from \"./data-types-DOaaPS93.mjs\";\nimport { t as mysqlDataTypeEntries } from \"./data-type-entries-C7VH2IHc.mjs\";\nimport { n as mysqlTargetDescriptorMetaRuntime, t as mysqlNowGenerators } from \"./date-time-now-generators-BKakW3gd.mjs\";\nimport { SQL_VARCHAR_CODEC_ID } from \"@internal/sql-relational-core/ast\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { idGeneratorFunctionBindings, sqlIntegerArgumentGeneratorFunctions, sqlTargetTypeConstructors } from \"@internal/family-sql/pack\";\nimport { TIMESTAMP_NOW_GENERATOR_ID, temporalTypeAliases } from \"@internal/framework-components/authoring\";\nimport { singleGeneratorBinding } from \"@internal/framework-components/components\";\nimport { DATE_STRING_NOW_GENERATOR_ID, INSTANT_NOW_GENERATOR_ID, INSTANT_STRING_NOW_GENERATOR_ID, PLAIN_DATE_NOW_GENERATOR_ID, PLAIN_TIME_NOW_GENERATOR_ID, TIME_STRING_NOW_GENERATOR_ID } from \"@internal/type-implementations/now\";\n//#region src/core/authoring.ts\n/** The type constructors whose arguments are sizes, which take values of `mysql/int`, and the created-at and updated-at aliases on the type a bare `DateTime` becomes: a `datetime(3)` column read as a JavaScript `Date`. */\nconst mysqlAuthoringTypes = {\n\t.../* @__PURE__ */ sqlTargetTypeConstructors({ sizeType: \"mysql/int\" }),\n\ttemporal: /* @__PURE__ */ temporalTypeAliases({\n\t\tcodecId: MYSQL_DATETIME_CODEC_ID,\n\t\ttypeParams: { precision: 3 }\n\t}, \"a JavaScript Date\")\n};\n//#endregion\n//#region src/core/generator-functions.ts\n/** The \"now\" generator for each codec that has one. The `now` generator function binds it. */\nconst mysqlNowGeneratorIds = {\n\t[MYSQL_DATETIME_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,\n\t[MYSQL_DATETIME_TEMPORAL_CODEC_ID]: INSTANT_NOW_GENERATOR_ID,\n\t[MYSQL_DATETIME_STRING_CODEC_ID]: INSTANT_STRING_NOW_GENERATOR_ID,\n\t[MYSQL_TIMESTAMP_DATE_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,\n\t[MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID]: INSTANT_NOW_GENERATOR_ID,\n\t[MYSQL_TIMESTAMP_STRING_CODEC_ID]: INSTANT_STRING_NOW_GENERATOR_ID,\n\t[MYSQL_DATE_STRING_CODEC_ID]: DATE_STRING_NOW_GENERATOR_ID,\n\t[MYSQL_DATE_TEMPORAL_CODEC_ID]: PLAIN_DATE_NOW_GENERATOR_ID,\n\t[MYSQL_TIME_STRING_CODEC_ID]: TIME_STRING_NOW_GENERATOR_ID,\n\t[MYSQL_TIME_TEMPORAL_CODEC_ID]: PLAIN_TIME_NOW_GENERATOR_ID\n};\n/** The generators that round down to the column's fraction digits, 0 for a bare type. */\nconst takesPrecision = /* @__PURE__ */ new Set([\n\tINSTANT_NOW_GENERATOR_ID,\n\tINSTANT_STRING_NOW_GENERATOR_ID,\n\tPLAIN_TIME_NOW_GENERATOR_ID,\n\tTIME_STRING_NOW_GENERATOR_ID\n]);\n/** The fraction digits a `Date` holds: `timestampNow` takes a precision only below them, so a column of 3 or more, such as a bare `DateTime`, keeps a contract with no generator params. */\nconst DATE_FRACTION_DIGITS = 3;\nfunction nowParams(generatorId, typeParams) {\n\tconst written = typeParams?.[\"precision\"];\n\tconst precision = typeof written === \"number\" ? written : 0;\n\tif (takesPrecision.has(generatorId)) return { precision };\n\tif (generatorId === TIMESTAMP_NOW_GENERATOR_ID && precision < DATE_FRACTION_DIGITS) return { precision };\n}\nconst mysqlGeneratorFunctions = [\n\t...sqlIntegerArgumentGeneratorFunctions({ integer: mysqlInt.id }),\n\t{\n\t\tname: \"now\",\n\t\tbindings: Object.entries(mysqlNowGeneratorIds).map(([codecId, generatorId]) => singleGeneratorBinding({\n\t\t\tcodecIds: [codecId],\n\t\t\tgeneratorId,\n\t\t\tparamsFromField: (column) => nowParams(generatorId, column.typeParams)\n\t\t}))\n\t},\n\t...idGeneratorFunctionBindings({ text: [MYSQL_TEXT_CODEC_ID] })\n];\n/** The `now` generators MySQL binds. The SQL family registers the identifier generators. */\nconst mysqlGeneratorDescriptors = [{ id: TIMESTAMP_NOW_GENERATOR_ID }, ...mysqlNowGenerators.map(({ id }) => ({ id }))];\n/**\n* The base PSL scalars other than the date and time types, as zero-arg type constructors. Each names a codec; the column's database type is its data type's. The target contributes them, so PSL and the TypeScript builder's `type.*` see the same names.\n*/\nconst mysqlScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: `Text of at most 191 characters, stored as MySQL varchar(191) so that it can be indexed.`,\n\t\toutput: {\n\t\t\tcodecId: SQL_VARCHAR_CODEC_ID,\n\t\t\ttypeParams: { length: 191 }\n\t\t}\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"A signed 32-bit integer stored as MySQL int and represented as a JavaScript number.\",\n\t\toutput: { codecId: MYSQL_INT_CODEC_ID }\n\t},\n\tBigInt: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"A signed 64-bit integer stored as MySQL bigint and represented as a JavaScript bigint.\",\n\t\toutput: { codecId: MYSQL_BIGINT_CODEC_ID }\n\t}\n};\nconst precision = {\n\tkind: \"value\",\n\tdataType: \"mysql/int\",\n\tname: \"precision\",\n\toptional: true\n};\n/** The explicit type `codecId`, whose `precision` argument is the number of fraction digits its column holds, 0 to 6; MySQL holds 0 when none is written. */\nfunction withPrecision(codecId, documentation) {\n\treturn {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation,\n\t\targs: [precision],\n\t\toutput: {\n\t\t\tcodecId,\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t};\n}\n/**\n* The explicit date and time types. Each is named after its MySQL column type, with a suffix for the value the application reads; `DurationString` is stored as `varchar`, since MySQL has no interval type. ADR 315.\n*/\nconst mysqlDateTimeTypeConstructors = {\n\tDatetimeJsDate: {\n\t\t...withPrecision(MYSQL_DATETIME_CODEC_ID, \"An instant stored as MySQL datetime in UTC and represented as a JavaScript Date. `precision` is the fraction digits the column holds, 0 to 6.\"),\n\t\tinferred: true\n\t},\n\tDatetimeTemporal: withPrecision(MYSQL_DATETIME_TEMPORAL_CODEC_ID, \"An instant stored as MySQL datetime in UTC and represented as Temporal.Instant. `precision` is the fraction digits the column holds, 0 to 6.\"),\n\tDatetimeString: withPrecision(MYSQL_DATETIME_STRING_CODEC_ID, \"An instant stored as MySQL datetime in UTC and represented as ISO 8601 text in UTC, such as 2024-01-01T00:00:00.5Z. `precision` is the fraction digits the column holds, 0 to 6.\"),\n\tTimestampJsDate: {\n\t\t...withPrecision(MYSQL_TIMESTAMP_DATE_CODEC_ID, \"An instant from 1970 to 2038 stored as MySQL timestamp and represented as a JavaScript Date. `precision` is the fraction digits the column holds, 0 to 6.\"),\n\t\tinferred: true\n\t},\n\tTimestampTemporal: withPrecision(MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID, \"An instant from 1970 to 2038 stored as MySQL timestamp and represented as Temporal.Instant. `precision` is the fraction digits the column holds, 0 to 6.\"),\n\tTimestampString: withPrecision(MYSQL_TIMESTAMP_STRING_CODEC_ID, \"An instant from 1970 to 2038 stored as MySQL timestamp and represented as ISO 8601 text in UTC, such as 2024-01-01T00:00:00.5Z. `precision` is the fraction digits the column holds, 0 to 6.\"),\n\tDateString: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"A calendar date stored as MySQL date and represented as ISO 8601 text, such as 2024-02-29.\",\n\t\toutput: { codecId: MYSQL_DATE_STRING_CODEC_ID }\n\t},\n\tDateTemporal: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A calendar date stored as MySQL date and represented as Temporal.PlainDate.\",\n\t\toutput: { codecId: MYSQL_DATE_TEMPORAL_CODEC_ID }\n\t},\n\tTimeString: {\n\t\t...withPrecision(MYSQL_TIME_STRING_CODEC_ID, \"A time of day stored as MySQL time and represented as ISO 8601 text, such as 09:30:00. `precision` is the fraction digits the column holds, 0 to 6.\"),\n\t\tinferred: true\n\t},\n\tTimeTemporal: withPrecision(MYSQL_TIME_TEMPORAL_CODEC_ID, \"A time of day stored as MySQL time and represented as Temporal.PlainTime. `precision` is the fraction digits the column holds, 0 to 6.\"),\n\tDurationString: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: `A length of time stored as MySQL varchar(191), so that it can be indexed, and represented as the ISO 8601 duration it was written as, such as PT1H30M.`,\n\t\toutput: {\n\t\t\tcodecId: MYSQL_DURATION_STRING_CODEC_ID,\n\t\t\ttypeParams: { length: 191 }\n\t\t}\n\t}\n};\nconst MICROSECONDS = { precision: 6 };\nconst MILLISECONDS = { precision: 3 };\n/**\n* The convenience date and time types. Each is a type choice: its `as` and `storage` arguments choose the explicit type it becomes, and `precision` is passed on to that type. MySQL holds no fraction of a second in a bare `datetime`, `timestamp` or `time`, so a row that reads a `Date` defaults to milliseconds, which a `Date` holds, and every other row to microseconds, as PostgreSQL's bare types hold. ADR 279, ADR 315.\n*/\nconst mysqlConvenienceDateTimeTypes = {\n\tDateTime: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"A moment in time, read and written in UTC. `as` is what the application reads: jsDate (a JavaScript Date), temporal (Temporal.Instant) or string, such as \\\"2024-01-01T00:00:00Z\\\". `storage` is datetime, or timestamp, which holds 1970 to 2038.\",\n\t\targs: [\n\t\t\t{\n\t\t\t\tkind: \"option\",\n\t\t\t\tname: \"as\",\n\t\t\t\tvalues: [\n\t\t\t\t\t\"jsDate\",\n\t\t\t\t\t\"temporal\",\n\t\t\t\t\t\"string\"\n\t\t\t\t],\n\t\t\t\tdefault: \"jsDate\",\n\t\t\t\toptional: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"option\",\n\t\t\t\tname: \"storage\",\n\t\t\t\tvalues: [\"datetime\", \"timestamp\"],\n\t\t\t\tdefault: \"datetime\",\n\t\t\t\toptional: true\n\t\t\t},\n\t\t\tprecision\n\t\t],\n\t\tchoices: [\n\t\t\t{\n\t\t\t\twhen: {\n\t\t\t\t\tas: \"jsDate\",\n\t\t\t\t\tstorage: \"datetime\"\n\t\t\t\t},\n\t\t\t\ttype: \"DatetimeJsDate\",\n\t\t\t\tdefaults: MILLISECONDS\n\t\t\t},\n\t\t\t{\n\t\t\t\twhen: {\n\t\t\t\t\tas: \"temporal\",\n\t\t\t\t\tstorage: \"datetime\"\n\t\t\t\t},\n\t\t\t\ttype: \"DatetimeTemporal\",\n\t\t\t\tdefaults: MICROSECONDS\n\t\t\t},\n\t\t\t{\n\t\t\t\twhen: {\n\t\t\t\t\tas: \"string\",\n\t\t\t\t\tstorage: \"datetime\"\n\t\t\t\t},\n\t\t\t\ttype: \"DatetimeString\",\n\t\t\t\tdefaults: MICROSECONDS\n\t\t\t},\n\t\t\t{\n\t\t\t\twhen: {\n\t\t\t\t\tas: \"jsDate\",\n\t\t\t\t\tstorage: \"timestamp\"\n\t\t\t\t},\n\t\t\t\ttype: \"TimestampJsDate\",\n\t\t\t\tdefaults: MILLISECONDS\n\t\t\t},\n\t\t\t{\n\t\t\t\twhen: {\n\t\t\t\t\tas: \"temporal\",\n\t\t\t\t\tstorage: \"timestamp\"\n\t\t\t\t},\n\t\t\t\ttype: \"TimestampTemporal\",\n\t\t\t\tdefaults: MICROSECONDS\n\t\t\t},\n\t\t\t{\n\t\t\t\twhen: {\n\t\t\t\t\tas: \"string\",\n\t\t\t\t\tstorage: \"timestamp\"\n\t\t\t\t},\n\t\t\t\ttype: \"TimestampString\",\n\t\t\t\tdefaults: MICROSECONDS\n\t\t\t}\n\t\t]\n\t},\n\tDate: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"A calendar date. `as` is what the application reads: string, such as \\\"2024-02-29\\\", or temporal (Temporal.PlainDate).\",\n\t\targs: [{\n\t\t\tkind: \"option\",\n\t\t\tname: \"as\",\n\t\t\tvalues: [\"string\", \"temporal\"],\n\t\t\tdefault: \"string\",\n\t\t\toptional: true\n\t\t}, {\n\t\t\tkind: \"option\",\n\t\t\tname: \"storage\",\n\t\t\tvalues: [\"date\"],\n\t\t\tdefault: \"date\",\n\t\t\toptional: true\n\t\t}],\n\t\tchoices: [{\n\t\t\twhen: {\n\t\t\t\tas: \"string\",\n\t\t\t\tstorage: \"date\"\n\t\t\t},\n\t\t\ttype: \"DateString\"\n\t\t}, {\n\t\t\twhen: {\n\t\t\t\tas: \"temporal\",\n\t\t\t\tstorage: \"date\"\n\t\t\t},\n\t\t\ttype: \"DateTemporal\"\n\t\t}]\n\t},\n\tTime: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"A time of day, from 00:00:00 to 23:59:59.999999. `as` is what the application reads: string, such as \\\"09:30:00\\\", or temporal (Temporal.PlainTime).\",\n\t\targs: [\n\t\t\t{\n\t\t\t\tkind: \"option\",\n\t\t\t\tname: \"as\",\n\t\t\t\tvalues: [\"string\", \"temporal\"],\n\t\t\t\tdefault: \"string\",\n\t\t\t\toptional: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"option\",\n\t\t\t\tname: \"storage\",\n\t\t\t\tvalues: [\"time\"],\n\t\t\t\tdefault: \"time\",\n\t\t\t\toptional: true\n\t\t\t},\n\t\t\tprecision\n\t\t],\n\t\tchoices: [{\n\t\t\twhen: {\n\t\t\t\tas: \"string\",\n\t\t\t\tstorage: \"time\"\n\t\t\t},\n\t\t\ttype: \"TimeString\",\n\t\t\tdefaults: MICROSECONDS\n\t\t}, {\n\t\t\twhen: {\n\t\t\t\tas: \"temporal\",\n\t\t\t\tstorage: \"time\"\n\t\t\t},\n\t\t\ttype: \"TimeTemporal\",\n\t\t\tdefaults: MICROSECONDS\n\t\t}]\n\t},\n\tDuration: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: `A length of time, stored as MySQL varchar(191), since MySQL has no interval type. \\`as\\` is what the application reads: string, an ISO 8601 duration such as \"PT1H30M\".`,\n\t\targs: [{\n\t\t\tkind: \"option\",\n\t\t\tname: \"as\",\n\t\t\tvalues: [\"string\"],\n\t\t\tdefault: \"string\",\n\t\t\toptional: true\n\t\t}, {\n\t\t\tkind: \"option\",\n\t\t\tname: \"storage\",\n\t\t\tvalues: [\"varchar\"],\n\t\t\tdefault: \"varchar\",\n\t\t\toptional: true\n\t\t}],\n\t\tchoices: [{\n\t\t\twhen: {\n\t\t\t\tas: \"string\",\n\t\t\t\tstorage: \"varchar\"\n\t\t\t},\n\t\t\ttype: \"DurationString\"\n\t\t}]\n\t}\n};\n/**\n* The base scalars, the explicit date and time types and the convenience date and time types as type constructors. The target contributes them, so PSL and the TypeScript builder's `type.*` see the same names.\n*/\nconst mysqlScalarTypeConstructors = {\n\t...mysqlScalarAuthoringTypes,\n\t...mysqlDateTimeTypeConstructors,\n\t...mysqlConvenienceDateTimeTypes\n};\nconst mysqlTargetDescriptorMeta = {\n\t...mysqlTargetDescriptorMetaRuntime,\n\tdefaultNamespaceId: UNBOUND_NAMESPACE_ID,\n\tsupportsNamespaces: false,\n\tdisplayName: \"MySQL\",\n\tauthoring: {\n\t\ttype: {\n\t\t\t...mysqlScalarTypeConstructors,\n\t\t\t...mysqlAuthoringTypes\n\t\t},\n\t\tdataTypes: mysqlDataTypeEntries(),\n\t\ttextDataTypes: mysqlTextDataTypes\n\t},\n\tgeneratorFunctions: mysqlGeneratorFunctions,\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: /* @__PURE__ */ new Map(),\n\t\tgeneratorDescriptors: mysqlGeneratorDescriptors\n\t}\n};\n//#endregion\nexport { mysqlScalarTypeConstructors as n, mysqlTargetDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-BF6YvSag.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,sBAAsB;CAC3B,GAAmB,0CAA0B,EAAE,UAAU,YAAY,CAAC;CACtE,UAA0B,oCAAoB;EAC7C,SAAS;EACT,YAAY,EAAE,W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S;IACT,UAAU;GACX;GACA;EACD;EACA,SAAS;GACR;IACC,MAAM;KACL,IAAI;KACJ,SAAS;IACV;IACA,MAAM;IACN,UAAU;GACX;GACA;IACC,MAAM;KACL,IAAI;KACJ,SAAS;IACV;IACA,MAAM;IACN,UAAU;GACX;GACA;IACC,MAAM;KACL,IAAI;KACJ,SAAS;IACV;IACA,MAAM;IACN,UAAU;GACX;GACA;IACC,MAAM;KACL,IAAI;KACJ,SAAS;IACV;IACA,MAAM;IACN,UAAU;GACX;GACA;IACC,MAAM;KACL,IAAI;KACJ,SAAS;IACV;IACA,MAAM;IACN,UAAU;GACX;GACA;IACC,MAAM;KACL,IAAI;KACJ,SAAS;IACV;IACA,MAAM;IACN,UAAU;GACX;EACD;CACD;CACA,MAAM;EACL,MAAM;EACN,eAAe;EACf,MAAM,CAAC;GACN,MAAM;GACN,MAAM;GACN,QAAQ,CAAC,UAAU,UAAU;GAC7B,SAAS;GACT,UAAU;EACX,GAAG;GACF,MAAM;GACN,MAAM;GACN,QAAQ,CAAC,MAAM;GACf,SAAS;GACT,UAAU;EACX,CAAC;EACD,SAAS,CAAC;GACT,MAAM;IACL,IAAI;IACJ,SAAS;GACV;GACA,MAAM;EACP,GAAG;GACF,MAAM;IACL,IAAI;IACJ,SAAS;GACV;GACA,MAAM;EACP,CAAC;CACF;CACA,MAAM;EACL,MAAM;EACN,eAAe;EACf,MAAM;GACL;IACC,MAAM;IACN,MAAM;IACN,QAAQ,CAAC,UAAU,UAAU;IAC7B,SAAS;IACT,UAAU;GACX;GACA;IACC,MAAM;IACN,MAAM;IACN,QAAQ,CAAC,MAAM;IACf,SAAS;IACT,UAAU;GACX;GACA;EACD;EACA,SAAS,CAAC;GACT,MAAM;IACL,IAAI;IACJ,SAAS;GACV;GACA,MAAM;GACN,UAAU;EACX,GAAG;GACF,MAAM;IACL,IAAI;IACJ,SAAS;GACV;GACA,MAAM;GACN,UAAU;EACX,CAAC;CACF;CACA,UAAU;EACT,MAAM;EACN,eAAe;EACf,MAAM,CAAC;GACN,MAAM;GACN,MAAM;GACN,QAAQ,CAAC,QAAQ;GACjB,SAAS;GACT,UAAU;EACX,GAAG;GACF,MAAM;GACN,MAAM;GACN,QAAQ,CAAC,SAAS;GAClB,SAAS;GACT,UAAU;EACX,CAAC;EACD,SAAS,CAAC;GACT,MAAM;IACL,IAAI;IACJ,SAAS;GACV;GACA,MAAM;EACP,CAAC;CACF;AACD;;;;AAIA,MAAM,8BAA8B;CACnC,GAAG;CACH,GAAG;CACH,GAAG;AACJ;AACA,MAAM,4BAA4B;CACjC,GAAG;CACH,oBAAoB;CACpB,oBAAoB;CACpB,aAAa;CACb,WAAW;EACV,MAAM;GACL,GAAG;GACH,GAAG;EACJ;EACA,WAAW,qBAAqB;EAChC,eAAe;CAChB;CACA,oBAAoB;CACpB,yBAAyB;EACxB,yCAAyC,IAAI,IAAI;EACjD,sBAAsB;CACvB;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-e29H69KN-t-S8_DYh.mjs","names":[],"sources":["../../../../3-targets/mysql/1-mysql/2-adapter/dist/descriptor-meta-e29H69KN.mjs"],"sourcesContent":["import { mysqlCodecRegistry } from \"@internal/target-mysql/codecs\";\n//#region src/core/capabilities.ts\n/** What a MySQL 8.4 server does that the SQL family asks about. `RETURNING`, `LATERAL` and conflict targets are not among them: `ON DUPLICATE KEY UPDATE` fires on any unique key. */\nconst mysqlAdapterCapabilities = Object.freeze({ sql: {\n\torderBy: true,\n\tlimit: true,\n\tforeignKeys: true,\n\tenums: true,\n\tdefaultInInsert: true,\n\tjsonAgg: true,\n\touterReferencesInDerivedTables: true,\n\tjsonAggWithoutTruncation: true\n} });\n//#endregion\n//#region src/core/contract-contributions.ts\n/** What this adapter adds to every contract it runs: its capabilities. `prisma contract emit` reads them through the adapter's descriptor, and the TypeScript `defineContract` passes them to the contract build. */\nconst mysqlAdapterContractContributions = { capabilities: mysqlAdapterCapabilities };\n//#endregion\n//#region src/core/descriptor-meta.ts\nconst mysqlAdapterDescriptorMeta = {\n\tkind: \"adapter\",\n\tfamilyId: \"sql\",\n\ttargetId: \"mysql\",\n\tid: \"mysql\",\n\tversion: \"0.0.1\",\n\tcapabilities: mysqlAdapterContractContributions.capabilities,\n\ttypes: { codecTypes: {\n\t\tcodecDescriptors: Array.from(mysqlCodecRegistry.values()),\n\t\timport: {\n\t\t\tpackage: \"@internal/adapter-mysql/codec-types\",\n\t\t\tnamed: \"CodecTypes\",\n\t\t\talias: \"MysqlTypes\"\n\t\t}\n\t} }\n};\n//#endregion\nexport { mysqlAdapterContractContributions as n, mysqlAdapterCapabilities as r, mysqlAdapterDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-e29H69KN.mjs.map"],"mappings":";;;AAGA,MAAM,2BAA2B,OAAO,OAAO,EAAE,KAAK;CACrD,SAAS;CACT,OAAO;CACP,aAAa;CACb,OAAO;CACP,iBAAiB;CACjB,SAAS;CACT,gCAAgC;CAChC,0BAA0B;AAC3B,EAAE,CAAC;;AAIH,MAAM,oCAAoC,EAAE,cAAc,yBAAyB;AAGnF,MAAM,6BAA6B;CAClC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,kCAAkC;CAChD,OAAO,EAAE,YAAY;EACpB,kBAAkB,MAAM,KAAK,mBAAmB,OAAO,CAAC;EACxD,QAAQ;GACP,SAAS;GACT,OAAO;GACP,OAAO;EACR;CACD,EAAE;AACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors-Cng94tYg-DTH51xWG.mjs","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/errors-Cng94tYg.mjs"],"sourcesContent":["import { structuredError } from \"@internal/utils/structured-error\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/core/errors.ts\nfunction mysqlError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n/** The refusal of a query a later slice of the MySQL target can render: `what` names the feature, as in `Lowering queries`. */\nfunction mysqlQueryNotYetSupported(what) {\n\treturn mysqlError(\"RUNTIME.AST_UNSUPPORTED\", `${what} is not yet supported on MySQL.`, {\n\t\twhy: \"The MySQL target renders reads; writes and some query forms are not built yet.\",\n\t\tfix: \"Use a Postgres or SQLite target for this query until the MySQL target supports it.\",\n\t\tmeta: {\n\t\t\ttarget: \"mysql\",\n\t\t\tfeature: what\n\t\t}\n\t});\n}\nconst TEMPORAL_UNAVAILABLE_FIX = \"Run on a runtime with Temporal available, install a Temporal polyfill before creating the client, or write the column as a convenience type at its default, which needs no Temporal: `DateTime` reads a JavaScript `Date`, and `Date`, `Time` and `Duration` read ISO 8601 strings.\";\nfunction errorTemporalUnavailable(codecId, operation) {\n\treturn mysqlError(\"RUNTIME.TEMPORAL_UNAVAILABLE\", `Codec '${codecId}' cannot ${operation} a value because this runtime has no global Temporal implementation.`, {\n\t\twhy: \"Temporal-backed codecs read and write their values through the global Temporal API, which this runtime does not provide.\",\n\t\tfix: TEMPORAL_UNAVAILABLE_FIX,\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\toperation\n\t\t}\n\t});\n}\nfunction errorTemporalUnavailableForDefault(generatorId) {\n\treturn mysqlError(\"RUNTIME.TEMPORAL_UNAVAILABLE\", `Mutation default generator '${generatorId}' cannot produce a value because this runtime has no global Temporal implementation.`, {\n\t\twhy: \"The generator answers a Temporal-backed column, so the value it produces is a Temporal value, which this runtime cannot construct.\",\n\t\tfix: TEMPORAL_UNAVAILABLE_FIX,\n\t\tmeta: { generatorId }\n\t});\n}\nfunction errorTemporalWrongType(codecId, temporalTag, stringType, received) {\n\treturn mysqlError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' encodes a ${temporalTag}, but received ${received}.`, {\n\t\twhy: \"The codec writes the Temporal value's own ISO 8601 text. A value of another type has no text the column holds.\",\n\t\tfix: `Pass a ${temporalTag}, or author the column with its ${stringType} type to write ISO 8601 text.`,\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\ttemporalTag,\n\t\t\tstringType,\n\t\t\treceived\n\t\t}\n\t});\n}\nfunction errorTemporalNonIsoCalendar(codecId, calendarId) {\n\treturn mysqlError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' accepts only the iso8601 calendar, but the value carries '${calendarId}'.`, {\n\t\twhy: \"MySQL stores no calendar alongside a date, so a non-ISO calendar would be discarded on write and the value would read back as a different date than the one authored.\",\n\t\tfix: \"Convert the value with .withCalendar(\\\"iso8601\\\") before writing if the ISO projection is what you mean to store.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\tcalendarId\n\t\t}\n\t});\n}\n/** A date or time codec read a value from MySQL that is not a value of its type, such as a zero date or a `time` that is no time of day, or that `Temporal` cannot hold. */\nfunction errorDateTimeUnreadable(options) {\n\tconst { codecId, value, detail } = options;\n\treturn mysqlError(\"RUNTIME.DECODE_FAILED\", `Codec '${codecId}' cannot read the value MySQL returned: ${JSON.stringify(value)}. ${detail}`, {\n\t\twhy: \"MySQL can hold values the column's type does not, such as the zero date 0000-00-00 or a time of 838:59:59, when a row is written outside Prisma.\",\n\t\tfix: \"Rewrite the row with a value the column type holds, or read the column with a type that holds its text, such as String.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\tvalue: value.slice(0, 100)\n\t\t},\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\n/** A date or time codec was given a value its column does not hold, such as a date before the year 1000 or text with digits below a microsecond. */\nfunction errorDateTimeUnwritable(options) {\n\tconst { codecId, received, detail } = options;\n\treturn mysqlError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' cannot write ${received}. ${detail}`, {\n\t\twhy: \"The codec refuses a value its column does not hold before it reaches MySQL.\",\n\t\tfix: \"Write a value the column holds, as the message shows.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\treceived: received.slice(0, 100)\n\t\t},\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\n//#endregion\nexport { errorTemporalUnavailableForDefault as a, mysqlQueryNotYetSupported as c, errorTemporalUnavailable as i, errorDateTimeUnwritable as n, errorTemporalWrongType as o, errorTemporalNonIsoCalendar as r, mysqlError as s, errorDateTimeUnreadable as t };\n\n//# sourceMappingURL=errors-Cng94tYg.mjs.map"],"mappings":";;;AAGA,SAAS,WAAW,MAAM,SAAS,SAAS;CAC3C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;;AAEA,SAAS,0BAA0B,MAAM;CACxC,OAAO,WAAW,2BAA2B,GAAG,KAAK,kCAAkC;EACtF,KAAK;EACL,KAAK;EACL,MAAM;GACL,QAAQ;GACR,SAAS;EACV;CACD,CAAC;AACF;AACA,MAAM,2BAA2B;AACjC,SAAS,yBAAyB,SAAS,WAAW;CACrD,OAAO,WAAW,gCAAgC,UAAU,QAAQ,WAAW,UAAU,uEAAuE;EAC/J,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,mCAAmC,aAAa;CACxD,OAAO,WAAW,gCAAgC,+BAA+B,YAAY,uFAAuF;EACnL,KAAK;EACL,KAAK;EACL,MAAM,EAAE,YAAY;CACrB,CAAC;AACF;AACA,SAAS,uBAAuB,SAAS,aAAa,YAAY,UAAU;CAC3E,OAAO,WAAW,yBAAyB,UAAU,QAAQ,cAAc,YAAY,iBAAiB,SAAS,IAAI;EACpH,KAAK;EACL,KAAK,UAAU,YAAY,kCAAkC,WAAW;EACxE,MAAM;GACL;GACA;GACA;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,4BAA4B,SAAS,YAAY;CACzD,OAAO,WAAW,yBAAyB,UAAU,QAAQ,8DAA8D,WAAW,KAAK;EAC1I,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;;AAEA,SAAS,wBAAwB,SAAS;CACzC,MAAM,EAAE,SAAS,OAAO,WAAW;CACnC,OAAO,WAAW,yBAAyB,UAAU,QAAQ,0CAA0C,KAAK,UAAU,KAAK,EAAE,IAAI,UAAU;EAC1I,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA,OAAO,MAAM,MAAM,GAAG,GAAG;EAC1B;EACA,GAAG,UAAU,SAAS,QAAQ,KAAK;CACpC,CAAC;AACF;;AAEA,SAAS,wBAAwB,SAAS;CACzC,MAAM,EAAE,SAAS,UAAU,WAAW;CACtC,OAAO,WAAW,yBAAyB,UAAU,QAAQ,iBAAiB,SAAS,IAAI,UAAU;EACpG,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA,UAAU,SAAS,MAAM,GAAG,GAAG;EAChC;EACA,GAAG,UAAU,SAAS,QAAQ,KAAK;CACpC,CAAC;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors-DjCkC9IM.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/errors.d.mts"],"mappings":";;;KAEK;iBACY,WAAW,MAAM,sBAAsB,iBAAiB,UAAU,yBAAyB;;iBAE3F,0BAA0B,eAAe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migration-DILkj7kB.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/migration.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;KAiBK,KAAK,0BAA0B;;iBAEnB,OAAO,IAAI,KAAK;;;;;;uBAMV,mBAAmB,yBAAyB,cAAc,SAAS,cAAc,SAAS,aAAa,YAAY,SAAS,cAAc,SAAS,qBAAqB,UAAU,wBAAwB,UAAU,OAAO;oBAC9N,UAAU;qBACT,gBAAgB,kBAAkB;EACrD,YAAY,QAAQ,oBAAoB;UAChC;YACE,YAAY;aACX;aACA,kBAAkB;aAClB,uBAAuB;MAC9B,QAAQ;YACF,UAAU;aACT;MACP;YACM,UAAU;aACT;aACA,QAAQ;MACf,QAAQ;YACF,WAAW;aACV;aACA;MACP;YACM,YAAY;aACX;aACA;aACA;aACA;MACP;YACM,UAAU;aACT;aACA;MACP;YACM,UAAU;aACT;aACA;a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kBAAkB,mCAAmC;;iBAExF,4BAA4B,yBAAyB,SAAS,uBAAuB,QAAQ,qBAAqB,YAAY,sBAAsB;;;iBAGpJ,2BAA2B,QAAQ,2BAA2B,mBAAmB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mysql-database-CHl9-oSL-B1arvq6Q.mjs","names":[],"sources":["../../../../3-targets/mysql/1-mysql/1-target/dist/mysql-database-CHl9-oSL.mjs"],"sourcesContent":["import \"./codec-ids-CrR9Xi7r.mjs\";\nimport { s as mysqlError } from \"./errors-Cng94tYg.mjs\";\nimport { n as quoteIdentifier } from \"./sql-utils-Cmv_TVa8.mjs\";\nimport { S as mysqlTimestamp, b as mysqlTime, l as mysqlDatetime } from \"./data-types-DOaaPS93.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { SqlNamespaceBase } from \"@internal/sql-contract/types\";\nimport { UNBOUND_NAMESPACE_ID, freezeNode, hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { tableEntityKind } from \"@internal/sql-contract/entity-kinds\";\n//#region src/core/mysql-database.ts\nconst MYSQL_NAMESPACE_KIND = \"mysql-namespace\";\n/**\n* The MySQL database a connection uses, as the contract's one namespace. Tables are addressed unqualified, so the contract runs against whichever database the connection names.\n*/\nvar MysqlDatabase = class extends SqlNamespaceBase {\n\tid;\n\tentries;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.id = input.id;\n\t\tconst dispatched = hydrateNamespaceEntities(input.entries, /* @__PURE__ */ new Map([[\"table\", tableEntityKind]]), \"carry\");\n\t\tthis.entries = Object.freeze(blindCast(dispatched));\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: MYSQL_NAMESPACE_KIND,\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t\tfreezeNode(this);\n\t}\n\tget table() {\n\t\treturn this.entries.table ?? Object.freeze({});\n\t}\n\tqualifier() {\n\t\treturn \"\";\n\t}\n\tqualifyTable(tableName) {\n\t\treturn quoteIdentifier(tableName);\n\t}\n};\nfunction isLoose(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\nfunction enumMembersOf(namespace, tableName, columnName, column) {\n\tconst subject = `Column \"${tableName}\".\"${columnName}\"`;\n\tconst ref = column[\"valueSet\"];\n\tconst valueSetName = isLoose(ref) && ref[\"namespaceId\"] === namespace.id ? ref[\"entityName\"] : void 0;\n\tconst valueSet = typeof valueSetName === \"string\" ? namespace.entries[\"valueSet\"]?.[valueSetName] : void 0;\n\tconst values = isLoose(valueSet) ? valueSet[\"values\"] : void 0;\n\tif (!Array.isArray(values) || !values.every((value) => typeof value === \"string\")) throw mysqlError(\"CONTRACT.TYPE_PARAMS_INVALID\", `${subject} is a MySQL enum but has no enum whose text members it can list.`, {\n\t\twhy: \"A native MySQL enum column is written with its members, which come from the enum that types the column.\",\n\t\tfix: \"Type the column with a PSL enum or an enumType() whose members are text.\",\n\t\tmeta: {\n\t\t\ttable: tableName,\n\t\t\tcolumn: columnName\n\t\t}\n\t});\n\treturn values;\n}\nfunction isEnumColumn(column) {\n\treturn isLoose(column) && column[\"codecId\"] === \"mysql/enum@1\";\n}\nfunction sameMembers(left, right) {\n\treturn left.length === right.length && left.every((value, index) => value === right[index]);\n}\nfunction enumColumnWithMembers(namespace, tableName, columnName, column) {\n\tconst typeParams = isLoose(column[\"typeParams\"]) ? column[\"typeParams\"] : {};\n\tconst values = enumMembersOf(namespace, tableName, columnName, column);\n\tconst listed = typeParams[\"values\"];\n\tif (listed !== void 0 && !(Array.isArray(listed) && sameMembers(listed, values))) throw mysqlError(\"CONTRACT.TYPE_PARAMS_INVALID\", `Column \"${tableName}\".\"${columnName}\" lists enum members that differ from the members of the enum that types it.`, {\n\t\twhy: \"A MySQL enum column takes its members from its enum, in the order the enum declares them, so the database and the contract enforce the same members.\",\n\t\tfix: \"Remove the column’s own members, or make them equal the enum’s members in the same order.\",\n\t\tmeta: {\n\t\t\ttable: tableName,\n\t\t\tcolumn: columnName,\n\t\t\tcolumnValues: listed,\n\t\t\tvalueSetValues: values\n\t\t}\n\t});\n\treturn {\n\t\t...column,\n\t\ttypeParams: {\n\t\t\t...typeParams,\n\t\t\tvalues\n\t\t}\n\t};\n}\n/** The data types whose bare column type holds whole seconds. */\nconst PRECISION_DATA_TYPES = /* @__PURE__ */ new Set([\n\tmysqlDatetime.id,\n\tmysqlTimestamp.id,\n\tmysqlTime.id\n]);\nfunction isUnwrittenPrecisionColumn(column) {\n\tif (!isLoose(column) || !PRECISION_DATA_TYPES.has(column[\"dataType\"])) return false;\n\tconst typeParams = column[\"typeParams\"];\n\treturn !isLoose(typeParams) || typeParams[\"precision\"] === void 0;\n}\n/** A `datetime`, `timestamp` or `time` column with no precision written records 0, the fraction digits MySQL gives the bare type, so its codec writes a value MySQL does not round; a codec reference with no precision is a raw parameter's, which is written whole. */\nfunction withZeroPrecision(column) {\n\tconst typeParams = isLoose(column[\"typeParams\"]) ? column[\"typeParams\"] : {};\n\treturn {\n\t\t...column,\n\t\ttypeParams: {\n\t\t\t...typeParams,\n\t\t\tprecision: 0\n\t\t}\n\t};\n}\nfunction withFilledTypeParams(namespace, tableName, table) {\n\tif (!isLoose(table)) return table;\n\tconst columns = table[\"columns\"];\n\tif (!isLoose(columns) || !Object.values(columns).some((column) => isEnumColumn(column) || isUnwrittenPrecisionColumn(column))) return table;\n\tconst filled = Object.fromEntries(Object.entries(columns).map(([columnName, column]) => {\n\t\tif (isEnumColumn(column)) return [columnName, enumColumnWithMembers(namespace, tableName, columnName, column)];\n\t\tif (isUnwrittenPrecisionColumn(column)) return [columnName, withZeroPrecision(column)];\n\t\treturn [columnName, column];\n\t}));\n\treturn {\n\t\t...table,\n\t\tcolumns: filled\n\t};\n}\n/**\n* Writes the type parameters MySQL gives a column that the authored schema leaves out. Each MySQL enum column's members, from the value set the column names, go into its type parameters in the order the enum declares them, and a column whose own members differ from them is refused; the column's type is then `enum('A','B')`, so the database enforces the members and `db verify` sees a change to them as a change of the column's type. A `datetime`, `timestamp` or `time` column with no precision records precision 0.\n*/\nfunction fillTypeParams(input) {\n\tconst tables = input.entries[\"table\"];\n\tif (tables === void 0) return input;\n\treturn {\n\t\t...input,\n\t\tentries: {\n\t\t\t...input.entries,\n\t\t\ttable: Object.fromEntries(Object.entries(tables).map(([tableName, table]) => [tableName, withFilledTypeParams(input, tableName, table)]))\n\t\t}\n\t};\n}\n/**\n* The MySQL target's refusal of expression and partial indexes, which it neither writes nor introspects yet.\n*/\nfunction rejectSqlBodyIndexes(input) {\n\tfor (const [tableName, table] of Object.entries(input.entries[\"table\"] ?? {})) {\n\t\tconst indexes = isLoose(table) ? table[\"indexes\"] : void 0;\n\t\tfor (const index of Array.isArray(indexes) ? indexes : []) {\n\t\t\tif (!isLoose(index)) continue;\n\t\t\tif (index[\"expression\"] !== void 0 || index[\"where\"] !== void 0) throw mysqlError(\"CONTRACT.ARGUMENT_INVALID\", `MySQL does not support expression or partial indexes yet: index \"${String(index[\"name\"] ?? \"<unnamed>\")}\" on table \"${tableName}\" declares ${index[\"expression\"] !== void 0 ? \"an expression\" : \"a where predicate\"}. Use a fields-only index.`, { meta: { table: tableName } });\n\t\t}\n\t}\n}\n/**\n* The namespace factory the MySQL target hands `defineContract` and the PSL interpreter. MySQL has one namespace per connection, the framework's unbound slot.\n*/\nfunction mysqlCreateNamespace(input) {\n\tif (input.id !== UNBOUND_NAMESPACE_ID) throw mysqlError(\"CONTRACT.NAMESPACE_INVALID\", `The MySQL target has one namespace, \"${UNBOUND_NAMESPACE_ID}\"; it received \"${input.id}\".`, { meta: { received: input.id } });\n\trejectSqlBodyIndexes(input);\n\treturn new MysqlDatabase(fillTypeParams(input));\n}\n//#endregion\nexport { mysqlCreateNamespace as n, MysqlDatabase as t };\n\n//# sourceMappingURL=mysql-database-CHl9-oSL.mjs.map"],"mappings":";;;;;;;;AASA,MAAM,uBAAuB;;;;AAI7B,IAAI,gBAAgB,cAAc,iBAAiB;CAClD;CACA;CACA,YAAY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