@prisma/orm-target-mysql 8.0.0-rc.22-dev.10 → 8.0.0-rc.22-dev.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/{adapter-_WBomuTw.d.mts → adapter-Dl4Wwz1I.d.mts} +4 -2
- package/dist/adapter-Dl4Wwz1I.d.mts.map +1 -0
- package/dist/adapter.d.mts +5 -5
- package/dist/adapter.mjs +2 -2
- package/dist/adapter__adapter.d.mts +1 -1
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__codec-types.d.mts +2 -2
- package/dist/adapter__control.d.mts +1 -1
- package/dist/adapter__control.mjs +1 -1
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +89 -14
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/{codec-descriptor-Du6DSz-3-ytBCu_mq.mjs → codec-descriptor-3xp1XvVH-yVLnNzZ8.mjs} +5 -3
- package/dist/codec-descriptor-3xp1XvVH-yVLnNzZ8.mjs.map +1 -0
- package/dist/codec-ids-CrR9Xi7r-CarpqbNM.mjs +20 -0
- package/dist/codec-ids-CrR9Xi7r-CarpqbNM.mjs.map +1 -0
- package/dist/codec-ids-Dgh5IpML-76oBMuwK.d.mts +20 -0
- package/dist/codec-ids-Dgh5IpML-76oBMuwK.d.mts.map +1 -0
- package/dist/codec-types-BH5moCD9.d.mts +1 -0
- package/dist/codec-types-Bai_CFkk-Blx2GxCH.d.mts +31 -0
- package/dist/codec-types-Bai_CFkk-Blx2GxCH.d.mts.map +1 -0
- package/dist/codec-types-zzVcrnbk.d.mts +1 -0
- package/dist/codecs-BMidk26M-DsKq6wt5.d.mts +282 -0
- package/dist/codecs-BMidk26M-DsKq6wt5.d.mts.map +1 -0
- package/dist/codecs-BfiB79-5.mjs +750 -0
- package/dist/codecs-BfiB79-5.mjs.map +1 -0
- package/dist/codecs-C_twedMx.d.mts +36 -0
- package/dist/codecs-C_twedMx.d.mts.map +1 -0
- package/dist/{contract-contributions-B9njRJbt-ClEtrK2L.mjs → contract-contributions-ChiX6W0F-CAng98bZ.mjs} +5 -4
- package/dist/contract-contributions-ChiX6W0F-CAng98bZ.mjs.map +1 -0
- package/dist/{control-6wRZXIJ7.mjs → control-5eVF1TXc.mjs} +2 -2
- package/dist/{control-6wRZXIJ7.mjs.map → control-5eVF1TXc.mjs.map} +1 -1
- package/dist/{control-WTY7Jpxk.mjs → control-BBhWaGnH.mjs} +24 -13
- package/dist/control-BBhWaGnH.mjs.map +1 -0
- package/dist/control-BvSM7mGR.d.mts +396 -0
- package/dist/control-BvSM7mGR.d.mts.map +1 -0
- package/dist/{control-Ez_PtlFI.d.mts → control-MoPFgSaQ.d.mts} +2 -2
- package/dist/{control-Ez_PtlFI.d.mts.map → control-MoPFgSaQ.d.mts.map} +1 -1
- package/dist/data-type-entries-C7VH2IHc-D1d5I8zF.mjs +59 -0
- package/dist/data-type-entries-C7VH2IHc-D1d5I8zF.mjs.map +1 -0
- package/dist/{data-types-SXrh0Lou.d.mts → data-types-C-rfxpgB.d.mts} +2 -2
- package/dist/data-types-C-rfxpgB.d.mts.map +1 -0
- package/dist/data-types-D2HAT-Qf-CRI506c0.d.mts +88 -0
- package/dist/data-types-D2HAT-Qf-CRI506c0.d.mts.map +1 -0
- package/dist/data-types-DOaaPS93-DBkMJyh1.mjs +289 -0
- package/dist/data-types-DOaaPS93-DBkMJyh1.mjs.map +1 -0
- package/dist/date-time-now-generators-DY-8Bodc-DcQ3h4Fg.mjs +72 -0
- package/dist/date-time-now-generators-DY-8Bodc-DcQ3h4Fg.mjs.map +1 -0
- package/dist/{default-normalizer-BDUgHXUn-Xk7HQJuI.mjs → default-normalizer-C8pc7SbL-CKgOEnGl.mjs} +22 -12
- package/dist/default-normalizer-C8pc7SbL-CKgOEnGl.mjs.map +1 -0
- package/dist/{default-normalizer-BBhGpw7r.d.mts → default-normalizer-CGIwQiKB.d.mts} +4 -4
- package/dist/{default-normalizer-BBhGpw7r.d.mts.map → default-normalizer-CGIwQiKB.d.mts.map} +1 -1
- package/dist/descriptor-meta-CsMPRsxp-DhK87vlc.mjs +352 -0
- package/dist/descriptor-meta-CsMPRsxp-DhK87vlc.mjs.map +1 -0
- package/dist/driver.mjs +1 -1
- package/dist/driver__control.mjs +1 -1
- package/dist/driver__runtime.mjs +275 -126
- package/dist/driver__runtime.mjs.map +1 -1
- package/dist/errors-Cng94tYg-D02Eud2d.mjs +87 -0
- package/dist/errors-Cng94tYg-D02Eud2d.mjs.map +1 -0
- package/dist/{errors-BYhjQT7y.d.mts → errors-DfrC_yfG.d.mts} +2 -2
- package/dist/{errors-BYhjQT7y.d.mts.map → errors-DfrC_yfG.d.mts.map} +1 -1
- package/dist/{marker-lock-CmGvN4hw-Com29AtQ.mjs → marker-lock-Bwew7cAs-CZ20Y_tA.mjs} +3 -3
- package/dist/{marker-lock-CmGvN4hw-Com29AtQ.mjs.map → marker-lock-Bwew7cAs-CZ20Y_tA.mjs.map} +1 -1
- package/dist/{marker-read-aEaHihYj-Cyg16yn1.mjs → marker-read-Cf80LSbG-CUp3v1e5.mjs} +5 -5
- package/dist/{marker-read-aEaHihYj-Cyg16yn1.mjs.map → marker-read-Cf80LSbG-CUp3v1e5.mjs.map} +1 -1
- package/dist/mysql-contract-serializer-BnTKRSsN-B2O3EreV.mjs +35 -0
- package/dist/mysql-contract-serializer-BnTKRSsN-B2O3EreV.mjs.map +1 -0
- package/dist/{mysql-contract-serializer-DLv0uW_f-Cg4A43Ry.mjs → mysql-database-CHl9-oSL-CWZLDXt6.mjs} +39 -40
- package/dist/mysql-database-CHl9-oSL-CWZLDXt6.mjs.map +1 -0
- package/dist/now-expression-DVD18CUc-00buJUto.mjs +38 -0
- package/dist/now-expression-DVD18CUc-00buJUto.mjs.map +1 -0
- package/dist/{pack-YVG-iBMQ.d.mts → pack-BXvLVBWP.d.mts} +395 -14
- package/dist/{pack-YVG-iBMQ.d.mts.map → pack-BXvLVBWP.d.mts.map} +1 -1
- package/dist/require-temporal-DeDQhbTn-Bxc65WbA.mjs +16 -0
- package/dist/require-temporal-DeDQhbTn-Bxc65WbA.mjs.map +1 -0
- package/dist/{runner-BaBQoXiU-C7ln-4b2.mjs → runner-C39AEe6--BVG3xPYw.mjs} +7 -7
- package/dist/{runner-BaBQoXiU-C7ln-4b2.mjs.map → runner-C39AEe6--BVG3xPYw.mjs.map} +1 -1
- package/dist/{runtime-CeuRr9nE.d.mts → runtime-ClRDfPiY.d.mts} +2 -2
- package/dist/{runtime-CeuRr9nE.d.mts.map → runtime-ClRDfPiY.d.mts.map} +1 -1
- package/dist/runtime-CrB5DXx4.d.mts +54 -0
- package/dist/runtime-CrB5DXx4.d.mts.map +1 -0
- package/dist/{sql-utils-Db0IQO_B-PaULnfrE.mjs → sql-utils-Cmv_TVa8-BetrIUcj.mjs} +3 -3
- package/dist/{sql-utils-Db0IQO_B-PaULnfrE.mjs.map → sql-utils-Cmv_TVa8-BetrIUcj.mjs.map} +1 -1
- package/dist/{sql-utils-RW0vJvDl.mjs → sql-utils-bD4SfgX0.mjs} +2 -2
- package/dist/{sql-utils-RW0vJvDl.mjs.map → sql-utils-bD4SfgX0.mjs.map} +1 -1
- package/dist/{statement-kfMRMKIt-D6cAOKys.mjs → statement-DC62oiSx-Buzptbpk.mjs} +21 -15
- package/dist/statement-DC62oiSx-Buzptbpk.mjs.map +1 -0
- package/dist/target.d.mts +14 -13
- package/dist/target.mjs +17 -13
- package/dist/target__codec-descriptor.mjs +1 -1
- package/dist/target__codec-ids.d.mts +2 -2
- package/dist/target__codec-ids.mjs +2 -2
- package/dist/target__codec-types.d.mts +2 -2
- package/dist/target__codecs.d.mts +3 -3
- package/dist/target__codecs.mjs +3 -2
- package/dist/target__control.d.mts +2 -2
- package/dist/target__control.mjs +38 -32
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__data-types.d.mts +3 -3
- package/dist/target__data-types.mjs +3 -3
- package/dist/target__default-normalizer.d.mts +1 -1
- package/dist/target__default-normalizer.mjs +1 -1
- package/dist/target__errors.d.mts +1 -1
- package/dist/target__errors.mjs +1 -1
- package/dist/target__marker-lock.mjs +1 -1
- package/dist/target__migration.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__runtime.d.mts +2 -2
- package/dist/target__runtime.mjs +3 -3
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/target__sql-utils.mjs +2 -2
- package/dist/target__types.d.mts +2 -0
- package/dist/target__types.mjs +2 -0
- package/dist/{control-_4epnrIW.d.mts → types-CgrFHUdk.d.mts} +3 -8
- package/dist/types-CgrFHUdk.d.mts.map +1 -0
- package/package.json +18 -12
- package/dist/adapter-_WBomuTw.d.mts.map +0 -1
- package/dist/codec-descriptor-Du6DSz-3-ytBCu_mq.mjs.map +0 -1
- package/dist/codec-ids-cjxtOcLM-vFeQhgPm.mjs +0 -10
- package/dist/codec-ids-cjxtOcLM-vFeQhgPm.mjs.map +0 -1
- package/dist/codec-ids-sMOU8F-B-BQbCq2dr.d.mts +0 -10
- package/dist/codec-ids-sMOU8F-B-BQbCq2dr.d.mts.map +0 -1
- package/dist/codec-types-Bd7DL1Mr-CZWNfnp9.d.mts +0 -21
- package/dist/codec-types-Bd7DL1Mr-CZWNfnp9.d.mts.map +0 -1
- package/dist/codec-types-Bo3Jfilx.d.mts +0 -1
- package/dist/codec-types-Ja2kLzLS.d.mts +0 -1
- package/dist/codecs-C00kjHgh.mjs +0 -282
- package/dist/codecs-C00kjHgh.mjs.map +0 -1
- package/dist/codecs-CO_VNEYU-CwAnKzRs.d.mts +0 -102
- package/dist/codecs-CO_VNEYU-CwAnKzRs.d.mts.map +0 -1
- package/dist/codecs-DM61agRr.d.mts +0 -21
- package/dist/codecs-DM61agRr.d.mts.map +0 -1
- package/dist/contract-contributions-B9njRJbt-ClEtrK2L.mjs.map +0 -1
- package/dist/control-WTY7Jpxk.mjs.map +0 -1
- package/dist/control-_4epnrIW.d.mts.map +0 -1
- package/dist/data-type-entries-B0AoBozh-f9AEUIUQ.mjs +0 -42
- package/dist/data-type-entries-B0AoBozh-f9AEUIUQ.mjs.map +0 -1
- package/dist/data-types-BpihGKoK-BMW-m4EN.d.mts +0 -52
- package/dist/data-types-BpihGKoK-BMW-m4EN.d.mts.map +0 -1
- package/dist/data-types-Dv9gwVRV-BZPzCWZk.mjs +0 -181
- package/dist/data-types-Dv9gwVRV-BZPzCWZk.mjs.map +0 -1
- package/dist/data-types-SXrh0Lou.d.mts.map +0 -1
- package/dist/default-normalizer-BDUgHXUn-Xk7HQJuI.mjs.map +0 -1
- package/dist/descriptor-meta-BurjcSiU-Cbk2L1jf.mjs +0 -82
- package/dist/descriptor-meta-BurjcSiU-Cbk2L1jf.mjs.map +0 -1
- package/dist/descriptor-meta-runtime-Bk_00UrX-BLN4Ahpj.mjs +0 -17
- package/dist/descriptor-meta-runtime-Bk_00UrX-BLN4Ahpj.mjs.map +0 -1
- package/dist/errors-rvH_F2Yj-BQrO_--u.mjs +0 -20
- package/dist/errors-rvH_F2Yj-BQrO_--u.mjs.map +0 -1
- package/dist/mysql-contract-serializer-DLv0uW_f-Cg4A43Ry.mjs.map +0 -1
- package/dist/runtime-Cl0BbTZq.d.mts +0 -22
- package/dist/runtime-Cl0BbTZq.d.mts.map +0 -1
- package/dist/statement-kfMRMKIt-D6cAOKys.mjs.map +0 -1
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
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-CarpqbNM.mjs";
|
|
2
|
+
import { _ as mysqlInt, y as mysqlTextDataTypes } from "./data-types-DOaaPS93-DBkMJyh1.mjs";
|
|
3
|
+
import { t as mysqlDataTypeEntries } from "./data-type-entries-C7VH2IHc-D1d5I8zF.mjs";
|
|
4
|
+
import { n as mysqlTargetDescriptorMetaRuntime, t as mysqlNowGenerators } from "./date-time-now-generators-DY-8Bodc-DcQ3h4Fg.mjs";
|
|
5
|
+
import { SQL_VARCHAR_CODEC_ID } from "@prisma/orm-family-sql/relational-core/ast";
|
|
6
|
+
import { 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 "@prisma/orm-framework/type-implementations/now";
|
|
7
|
+
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
8
|
+
import { idGeneratorFunctionBindings, sqlIntegerArgumentGeneratorFunctions, sqlTargetTypeConstructors } from "@prisma/orm-family-sql/family/pack";
|
|
9
|
+
import { TIMESTAMP_NOW_GENERATOR_ID, temporalTypeAliases } from "@prisma/orm-framework/components/authoring";
|
|
10
|
+
import { singleGeneratorBinding } from "@prisma/orm-framework/components/components";
|
|
11
|
+
//#region ../../../3-targets/mysql/1-target/dist/descriptor-meta-CsMPRsxp.mjs
|
|
12
|
+
/** 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`. */
|
|
13
|
+
const mysqlAuthoringTypes = {
|
|
14
|
+
.../* @__PURE__ */ sqlTargetTypeConstructors({ sizeType: "mysql/int" }),
|
|
15
|
+
temporal: /* @__PURE__ */ temporalTypeAliases({
|
|
16
|
+
codecId: MYSQL_DATETIME_CODEC_ID,
|
|
17
|
+
typeParams: { precision: 3 }
|
|
18
|
+
}, "a JavaScript Date")
|
|
19
|
+
};
|
|
20
|
+
/** The "now" generator for each codec that has one. The `now` generator function binds it. */
|
|
21
|
+
const mysqlNowGeneratorIds = {
|
|
22
|
+
[MYSQL_DATETIME_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,
|
|
23
|
+
[MYSQL_DATETIME_TEMPORAL_CODEC_ID]: INSTANT_NOW_GENERATOR_ID,
|
|
24
|
+
[MYSQL_DATETIME_STRING_CODEC_ID]: INSTANT_STRING_NOW_GENERATOR_ID,
|
|
25
|
+
[MYSQL_TIMESTAMP_DATE_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,
|
|
26
|
+
[MYSQL_TIMESTAMP_TEMPORAL_CODEC_ID]: INSTANT_NOW_GENERATOR_ID,
|
|
27
|
+
[MYSQL_TIMESTAMP_STRING_CODEC_ID]: INSTANT_STRING_NOW_GENERATOR_ID,
|
|
28
|
+
[MYSQL_DATE_STRING_CODEC_ID]: DATE_STRING_NOW_GENERATOR_ID,
|
|
29
|
+
[MYSQL_DATE_TEMPORAL_CODEC_ID]: PLAIN_DATE_NOW_GENERATOR_ID,
|
|
30
|
+
[MYSQL_TIME_STRING_CODEC_ID]: TIME_STRING_NOW_GENERATOR_ID,
|
|
31
|
+
[MYSQL_TIME_TEMPORAL_CODEC_ID]: PLAIN_TIME_NOW_GENERATOR_ID
|
|
32
|
+
};
|
|
33
|
+
/** The generators that round down to the column's fraction digits, 0 for a bare type. */
|
|
34
|
+
const takesPrecision = /* @__PURE__ */ new Set([
|
|
35
|
+
INSTANT_NOW_GENERATOR_ID,
|
|
36
|
+
INSTANT_STRING_NOW_GENERATOR_ID,
|
|
37
|
+
PLAIN_TIME_NOW_GENERATOR_ID,
|
|
38
|
+
TIME_STRING_NOW_GENERATOR_ID
|
|
39
|
+
]);
|
|
40
|
+
/** 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. */
|
|
41
|
+
const DATE_FRACTION_DIGITS = 3;
|
|
42
|
+
function nowParams(generatorId, typeParams) {
|
|
43
|
+
const written = typeParams?.["precision"];
|
|
44
|
+
const precision = typeof written === "number" ? written : 0;
|
|
45
|
+
if (takesPrecision.has(generatorId)) return { precision };
|
|
46
|
+
if (generatorId === TIMESTAMP_NOW_GENERATOR_ID && precision < DATE_FRACTION_DIGITS) return { precision };
|
|
47
|
+
}
|
|
48
|
+
const mysqlGeneratorFunctions = [
|
|
49
|
+
...sqlIntegerArgumentGeneratorFunctions({ integer: mysqlInt.id }),
|
|
50
|
+
{
|
|
51
|
+
name: "now",
|
|
52
|
+
bindings: Object.entries(mysqlNowGeneratorIds).map(([codecId, generatorId]) => singleGeneratorBinding({
|
|
53
|
+
codecIds: [codecId],
|
|
54
|
+
generatorId,
|
|
55
|
+
paramsFromField: (column) => nowParams(generatorId, column.typeParams)
|
|
56
|
+
}))
|
|
57
|
+
},
|
|
58
|
+
...idGeneratorFunctionBindings({ text: [MYSQL_TEXT_CODEC_ID] })
|
|
59
|
+
];
|
|
60
|
+
/** The `now` generators MySQL binds. The SQL family registers the identifier generators. */
|
|
61
|
+
const mysqlGeneratorDescriptors = [{ id: TIMESTAMP_NOW_GENERATOR_ID }, ...mysqlNowGenerators.map(({ id }) => ({ id }))];
|
|
62
|
+
/**
|
|
63
|
+
* 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.
|
|
64
|
+
*/
|
|
65
|
+
const mysqlScalarAuthoringTypes = {
|
|
66
|
+
String: {
|
|
67
|
+
kind: "typeConstructor",
|
|
68
|
+
documentation: `Text of at most 191 characters, stored as MySQL varchar(191) so that it can be indexed.`,
|
|
69
|
+
output: {
|
|
70
|
+
codecId: SQL_VARCHAR_CODEC_ID,
|
|
71
|
+
typeParams: { length: 191 }
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
Int: {
|
|
75
|
+
kind: "typeConstructor",
|
|
76
|
+
inferred: true,
|
|
77
|
+
documentation: "A signed 32-bit integer stored as MySQL int and represented as a JavaScript number.",
|
|
78
|
+
output: { codecId: MYSQL_INT_CODEC_ID }
|
|
79
|
+
},
|
|
80
|
+
BigInt: {
|
|
81
|
+
kind: "typeConstructor",
|
|
82
|
+
inferred: true,
|
|
83
|
+
documentation: "A signed 64-bit integer stored as MySQL bigint and represented as a JavaScript bigint.",
|
|
84
|
+
output: { codecId: MYSQL_BIGINT_CODEC_ID }
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
const precision = {
|
|
88
|
+
kind: "value",
|
|
89
|
+
dataType: "mysql/int",
|
|
90
|
+
name: "precision",
|
|
91
|
+
optional: true
|
|
92
|
+
};
|
|
93
|
+
/** 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. */
|
|
94
|
+
function withPrecision(codecId, documentation) {
|
|
95
|
+
return {
|
|
96
|
+
kind: "typeConstructor",
|
|
97
|
+
documentation,
|
|
98
|
+
args: [precision],
|
|
99
|
+
output: {
|
|
100
|
+
codecId,
|
|
101
|
+
typeParams: { precision: {
|
|
102
|
+
kind: "arg",
|
|
103
|
+
index: 0
|
|
104
|
+
} }
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* 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.
|
|
110
|
+
*/
|
|
111
|
+
const mysqlDateTimeTypeConstructors = {
|
|
112
|
+
DatetimeJsDate: {
|
|
113
|
+
...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."),
|
|
114
|
+
inferred: true
|
|
115
|
+
},
|
|
116
|
+
DatetimeTemporal: 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."),
|
|
117
|
+
DatetimeString: 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."),
|
|
118
|
+
TimestampJsDate: {
|
|
119
|
+
...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."),
|
|
120
|
+
inferred: true
|
|
121
|
+
},
|
|
122
|
+
TimestampTemporal: 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."),
|
|
123
|
+
TimestampString: 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."),
|
|
124
|
+
DateString: {
|
|
125
|
+
kind: "typeConstructor",
|
|
126
|
+
inferred: true,
|
|
127
|
+
documentation: "A calendar date stored as MySQL date and represented as ISO 8601 text, such as 2024-02-29.",
|
|
128
|
+
output: { codecId: MYSQL_DATE_STRING_CODEC_ID }
|
|
129
|
+
},
|
|
130
|
+
DateTemporal: {
|
|
131
|
+
kind: "typeConstructor",
|
|
132
|
+
documentation: "A calendar date stored as MySQL date and represented as Temporal.PlainDate.",
|
|
133
|
+
output: { codecId: MYSQL_DATE_TEMPORAL_CODEC_ID }
|
|
134
|
+
},
|
|
135
|
+
TimeString: {
|
|
136
|
+
...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."),
|
|
137
|
+
inferred: true
|
|
138
|
+
},
|
|
139
|
+
TimeTemporal: 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."),
|
|
140
|
+
DurationString: {
|
|
141
|
+
kind: "typeConstructor",
|
|
142
|
+
inferred: true,
|
|
143
|
+
documentation: `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.`,
|
|
144
|
+
output: {
|
|
145
|
+
codecId: MYSQL_DURATION_STRING_CODEC_ID,
|
|
146
|
+
typeParams: { length: 191 }
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
const MICROSECONDS = { precision: 6 };
|
|
151
|
+
const MILLISECONDS = { precision: 3 };
|
|
152
|
+
/**
|
|
153
|
+
* 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.
|
|
154
|
+
*/
|
|
155
|
+
const mysqlConvenienceDateTimeTypes = {
|
|
156
|
+
DateTime: {
|
|
157
|
+
kind: "typeChoice",
|
|
158
|
+
documentation: "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.",
|
|
159
|
+
args: [
|
|
160
|
+
{
|
|
161
|
+
kind: "option",
|
|
162
|
+
name: "as",
|
|
163
|
+
values: [
|
|
164
|
+
"jsDate",
|
|
165
|
+
"temporal",
|
|
166
|
+
"string"
|
|
167
|
+
],
|
|
168
|
+
default: "jsDate",
|
|
169
|
+
optional: true
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
kind: "option",
|
|
173
|
+
name: "storage",
|
|
174
|
+
values: ["datetime", "timestamp"],
|
|
175
|
+
default: "datetime",
|
|
176
|
+
optional: true
|
|
177
|
+
},
|
|
178
|
+
precision
|
|
179
|
+
],
|
|
180
|
+
choices: [
|
|
181
|
+
{
|
|
182
|
+
when: {
|
|
183
|
+
as: "jsDate",
|
|
184
|
+
storage: "datetime"
|
|
185
|
+
},
|
|
186
|
+
type: "DatetimeJsDate",
|
|
187
|
+
defaults: MILLISECONDS
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
when: {
|
|
191
|
+
as: "temporal",
|
|
192
|
+
storage: "datetime"
|
|
193
|
+
},
|
|
194
|
+
type: "DatetimeTemporal",
|
|
195
|
+
defaults: MICROSECONDS
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
when: {
|
|
199
|
+
as: "string",
|
|
200
|
+
storage: "datetime"
|
|
201
|
+
},
|
|
202
|
+
type: "DatetimeString",
|
|
203
|
+
defaults: MICROSECONDS
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
when: {
|
|
207
|
+
as: "jsDate",
|
|
208
|
+
storage: "timestamp"
|
|
209
|
+
},
|
|
210
|
+
type: "TimestampJsDate",
|
|
211
|
+
defaults: MILLISECONDS
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
when: {
|
|
215
|
+
as: "temporal",
|
|
216
|
+
storage: "timestamp"
|
|
217
|
+
},
|
|
218
|
+
type: "TimestampTemporal",
|
|
219
|
+
defaults: MICROSECONDS
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
when: {
|
|
223
|
+
as: "string",
|
|
224
|
+
storage: "timestamp"
|
|
225
|
+
},
|
|
226
|
+
type: "TimestampString",
|
|
227
|
+
defaults: MICROSECONDS
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
Date: {
|
|
232
|
+
kind: "typeChoice",
|
|
233
|
+
documentation: "A calendar date. `as` is what the application reads: string, such as \"2024-02-29\", or temporal (Temporal.PlainDate).",
|
|
234
|
+
args: [{
|
|
235
|
+
kind: "option",
|
|
236
|
+
name: "as",
|
|
237
|
+
values: ["string", "temporal"],
|
|
238
|
+
default: "string",
|
|
239
|
+
optional: true
|
|
240
|
+
}, {
|
|
241
|
+
kind: "option",
|
|
242
|
+
name: "storage",
|
|
243
|
+
values: ["date"],
|
|
244
|
+
default: "date",
|
|
245
|
+
optional: true
|
|
246
|
+
}],
|
|
247
|
+
choices: [{
|
|
248
|
+
when: {
|
|
249
|
+
as: "string",
|
|
250
|
+
storage: "date"
|
|
251
|
+
},
|
|
252
|
+
type: "DateString"
|
|
253
|
+
}, {
|
|
254
|
+
when: {
|
|
255
|
+
as: "temporal",
|
|
256
|
+
storage: "date"
|
|
257
|
+
},
|
|
258
|
+
type: "DateTemporal"
|
|
259
|
+
}]
|
|
260
|
+
},
|
|
261
|
+
Time: {
|
|
262
|
+
kind: "typeChoice",
|
|
263
|
+
documentation: "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).",
|
|
264
|
+
args: [
|
|
265
|
+
{
|
|
266
|
+
kind: "option",
|
|
267
|
+
name: "as",
|
|
268
|
+
values: ["string", "temporal"],
|
|
269
|
+
default: "string",
|
|
270
|
+
optional: true
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
kind: "option",
|
|
274
|
+
name: "storage",
|
|
275
|
+
values: ["time"],
|
|
276
|
+
default: "time",
|
|
277
|
+
optional: true
|
|
278
|
+
},
|
|
279
|
+
precision
|
|
280
|
+
],
|
|
281
|
+
choices: [{
|
|
282
|
+
when: {
|
|
283
|
+
as: "string",
|
|
284
|
+
storage: "time"
|
|
285
|
+
},
|
|
286
|
+
type: "TimeString",
|
|
287
|
+
defaults: MICROSECONDS
|
|
288
|
+
}, {
|
|
289
|
+
when: {
|
|
290
|
+
as: "temporal",
|
|
291
|
+
storage: "time"
|
|
292
|
+
},
|
|
293
|
+
type: "TimeTemporal",
|
|
294
|
+
defaults: MICROSECONDS
|
|
295
|
+
}]
|
|
296
|
+
},
|
|
297
|
+
Duration: {
|
|
298
|
+
kind: "typeChoice",
|
|
299
|
+
documentation: `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".`,
|
|
300
|
+
args: [{
|
|
301
|
+
kind: "option",
|
|
302
|
+
name: "as",
|
|
303
|
+
values: ["string"],
|
|
304
|
+
default: "string",
|
|
305
|
+
optional: true
|
|
306
|
+
}, {
|
|
307
|
+
kind: "option",
|
|
308
|
+
name: "storage",
|
|
309
|
+
values: ["varchar"],
|
|
310
|
+
default: "varchar",
|
|
311
|
+
optional: true
|
|
312
|
+
}],
|
|
313
|
+
choices: [{
|
|
314
|
+
when: {
|
|
315
|
+
as: "string",
|
|
316
|
+
storage: "varchar"
|
|
317
|
+
},
|
|
318
|
+
type: "DurationString"
|
|
319
|
+
}]
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* 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.
|
|
324
|
+
*/
|
|
325
|
+
const mysqlScalarTypeConstructors = {
|
|
326
|
+
...mysqlScalarAuthoringTypes,
|
|
327
|
+
...mysqlDateTimeTypeConstructors,
|
|
328
|
+
...mysqlConvenienceDateTimeTypes
|
|
329
|
+
};
|
|
330
|
+
const mysqlTargetDescriptorMeta = {
|
|
331
|
+
...mysqlTargetDescriptorMetaRuntime,
|
|
332
|
+
defaultNamespaceId: UNBOUND_NAMESPACE_ID,
|
|
333
|
+
supportsNamespaces: false,
|
|
334
|
+
displayName: "MySQL",
|
|
335
|
+
authoring: {
|
|
336
|
+
type: {
|
|
337
|
+
...mysqlScalarTypeConstructors,
|
|
338
|
+
...mysqlAuthoringTypes
|
|
339
|
+
},
|
|
340
|
+
dataTypes: mysqlDataTypeEntries(),
|
|
341
|
+
textDataTypes: mysqlTextDataTypes
|
|
342
|
+
},
|
|
343
|
+
generatorFunctions: mysqlGeneratorFunctions,
|
|
344
|
+
controlMutationDefaults: {
|
|
345
|
+
defaultFunctionRegistry: /* @__PURE__ */ new Map(),
|
|
346
|
+
generatorDescriptors: mysqlGeneratorDescriptors
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
//#endregion
|
|
350
|
+
export { mysqlTargetDescriptorMeta as n, mysqlScalarTypeConstructors as t };
|
|
351
|
+
|
|
352
|
+
//# sourceMappingURL=descriptor-meta-CsMPRsxp-DhK87vlc.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptor-meta-CsMPRsxp-DhK87vlc.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/descriptor-meta-CsMPRsxp.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-DY-8Bodc.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-CsMPRsxp.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,sBAAsB;CAC3B,GAAmB,0CAA0B,EAAE,UAAU,YAAY,CAAC;CACtE,UAA0B,oCAAoB;EAC7C,SAAS;EACT,YAAY,EAAE,WAAW,EAAE;CAC5B,GAAG,mBAAmB;AACvB;;AAIA,MAAM,uBAAuB;EAC3B,0BAA0B;EAC1B,mCAAmC;EACnC,iCAAiC;EACjC,gCAAgC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M;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"}
|
package/dist/driver.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as MysqlControlDriver } from "./control-
|
|
1
|
+
import { t as MysqlControlDriver } from "./control-5eVF1TXc.mjs";
|
|
2
2
|
export { MysqlControlDriver };
|
package/dist/driver__control.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as mysqlDriverDescriptor, t as MysqlControlDriver } from "./control-
|
|
1
|
+
import { n as mysqlDriverDescriptor, t as MysqlControlDriver } from "./control-5eVF1TXc.mjs";
|
|
2
2
|
export { MysqlControlDriver, mysqlDriverDescriptor as default };
|