@prisma/orm-target-mysql 8.0.0-rc.23-dev.7 → 8.0.0-rc.23-dev.9
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-D0qXT1lj.d.mts +57 -0
- package/dist/adapter-D0qXT1lj.d.mts.map +1 -0
- package/dist/adapter.d.mts +6 -6
- package/dist/adapter.mjs +3 -3
- package/dist/adapter__adapter.d.mts +2 -2
- package/dist/adapter__adapter.mjs +2 -2
- package/dist/adapter__codec-types.d.mts +2 -2
- package/dist/adapter__control.d.mts +2 -2
- package/dist/adapter__control.mjs +2 -2
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +19 -10
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/{codec-descriptor-3xp1XvVH-yVLnNzZ8.mjs → codec-descriptor-3xp1XvVH-DfPKpYeP.mjs} +2 -2
- package/dist/codec-descriptor-3xp1XvVH-DfPKpYeP.mjs.map +1 -0
- package/dist/codec-descriptor-BRcKIX3h.d.mts +2 -0
- package/dist/{codec-descriptor-DXyubAS6-siA0R8Ow.d.mts → codec-descriptor-DXyubAS6-XDBj6Yet.d.mts} +2 -2
- package/dist/codec-descriptor-DXyubAS6-XDBj6Yet.d.mts.map +1 -0
- package/dist/codec-descriptor-J3TP08l8-BmdgkIU6.d.mts +1 -0
- package/dist/{codec-ids-CrR9Xi7r-CarpqbNM.mjs → codec-ids-CrR9Xi7r-CjbGCS3o.mjs} +2 -2
- package/dist/codec-ids-CrR9Xi7r-CjbGCS3o.mjs.map +1 -0
- package/dist/{codec-ids-Dgh5IpML-76oBMuwK.d.mts → codec-ids-Dgh5IpML-DGXIq6j8.d.mts} +2 -2
- package/dist/codec-ids-Dgh5IpML-DGXIq6j8.d.mts.map +1 -0
- package/dist/codec-types-BS-lWfda.d.mts +1 -0
- package/dist/{codec-types-Bai_CFkk-Blx2GxCH.d.mts → codec-types-Bai_CFkk-DmZ74URd.d.mts} +5 -5
- package/dist/codec-types-Bai_CFkk-DmZ74URd.d.mts.map +1 -0
- package/dist/codec-types-Dk2h5dBB.d.mts +1 -0
- package/dist/{codecs-BMidk26M-DsKq6wt5.d.mts → codecs-BMidk26M-B_iWNti6.d.mts} +5 -5
- package/dist/codecs-BMidk26M-B_iWNti6.d.mts.map +1 -0
- package/dist/{codecs-C_twedMx.d.mts → codecs-CIJRyUd3.d.mts} +4 -4
- package/dist/codecs-CIJRyUd3.d.mts.map +1 -0
- package/dist/{codecs-BfiB79-5.mjs → codecs-wVJlFapM.mjs} +7 -7
- package/dist/codecs-wVJlFapM.mjs.map +1 -0
- package/dist/{contract-free-Cw9Mjcro.d.mts → contract-free-BnJBWENn.d.mts} +3 -3
- package/dist/contract-free-BnJBWENn.d.mts.map +1 -0
- package/dist/{contract-free-BvCdx_Ee.mjs → contract-free-DekbHRyr.mjs} +4 -4
- package/dist/contract-free-DekbHRyr.mjs.map +1 -0
- package/dist/control-BBuy6yt5.mjs +73 -0
- package/dist/control-BBuy6yt5.mjs.map +1 -0
- package/dist/control-BiZaCqna.mjs +89 -0
- package/dist/control-BiZaCqna.mjs.map +1 -0
- package/dist/{control-BBhWaGnH.mjs → control-CyGJDPay.mjs} +102 -77
- package/dist/control-CyGJDPay.mjs.map +1 -0
- package/dist/control-D7_IpeiU.d.mts +31 -0
- package/dist/control-D7_IpeiU.d.mts.map +1 -0
- package/dist/{control-BvSM7mGR.d.mts → control-Dj8nIA1M.d.mts} +13 -4
- package/dist/control-Dj8nIA1M.d.mts.map +1 -0
- package/dist/{control-MoPFgSaQ.d.mts → control-WNuLF2Wh.d.mts} +29 -56
- package/dist/control-WNuLF2Wh.d.mts.map +1 -0
- package/dist/{control-tables-CHw2F-rg.d.mts → control-tables-CWJyQ3dZ.d.mts} +2 -2
- package/dist/control-tables-CWJyQ3dZ.d.mts.map +1 -0
- package/dist/{control-tables-CcQ77JE7-CxTQYoQJ.mjs → control-tables-CcQ77JE7-DKb3ubVU.mjs} +2 -2
- package/dist/control-tables-CcQ77JE7-DKb3ubVU.mjs.map +1 -0
- package/dist/{data-type-entries-C7VH2IHc-D1d5I8zF.mjs → data-type-entries-C7VH2IHc-DM6TbTaz.mjs} +3 -3
- package/dist/data-type-entries-C7VH2IHc-DM6TbTaz.mjs.map +1 -0
- package/dist/{data-types-C-rfxpgB.d.mts → data-types-65iVc7q1.d.mts} +3 -3
- package/dist/data-types-65iVc7q1.d.mts.map +1 -0
- package/dist/{data-types-D2HAT-Qf-CRI506c0.d.mts → data-types-D2HAT-Qf-CSdDz1Pk.d.mts} +2 -2
- package/dist/data-types-D2HAT-Qf-CSdDz1Pk.d.mts.map +1 -0
- package/dist/{data-types-DOaaPS93-DBkMJyh1.mjs → data-types-DOaaPS93-lycGybNk.mjs} +4 -4
- package/dist/data-types-DOaaPS93-lycGybNk.mjs.map +1 -0
- package/dist/{date-time-now-generators-DY-8Bodc-DcQ3h4Fg.mjs → date-time-now-generators-DY-8Bodc-DpQ5Se1u.mjs} +4 -4
- package/dist/date-time-now-generators-DY-8Bodc-DpQ5Se1u.mjs.map +1 -0
- package/dist/ddl-Bobm-S7I.d.mts +1 -0
- package/dist/{ddl-DDmMHyA_-Bb8sXoS0.mjs → ddl-DDmMHyA_-grdUmU3J.mjs} +3 -3
- package/dist/ddl-DDmMHyA_-grdUmU3J.mjs.map +1 -0
- package/dist/{default-normalizer-C8pc7SbL-CKgOEnGl.mjs → default-normalizer-C8pc7SbL-BXd70q02.mjs} +3 -3
- package/dist/default-normalizer-C8pc7SbL-BXd70q02.mjs.map +1 -0
- package/dist/{default-normalizer-CGIwQiKB.d.mts → default-normalizer-D-8Ii0df.d.mts} +2 -2
- package/dist/default-normalizer-D-8Ii0df.d.mts.map +1 -0
- package/dist/{descriptor-meta-CsMPRsxp-DhK87vlc.mjs → descriptor-meta-CsMPRsxp-QVV7vNY8.mjs} +6 -6
- package/dist/descriptor-meta-CsMPRsxp-QVV7vNY8.mjs.map +1 -0
- package/dist/descriptor-meta-pVdZBI-g-BJN4T_on.mjs +32 -0
- package/dist/descriptor-meta-pVdZBI-g-BJN4T_on.mjs.map +1 -0
- package/dist/driver.d.mts +3 -3
- package/dist/driver.mjs +3 -2
- package/dist/driver__control.d.mts +2 -2
- package/dist/driver__control.mjs +2 -2
- package/dist/driver__runtime.d.mts +2 -2
- package/dist/driver__runtime.mjs +2 -564
- package/dist/{errors-Cng94tYg-D02Eud2d.mjs → errors-Cng94tYg-DTH51xWG.mjs} +2 -2
- package/dist/errors-Cng94tYg-DTH51xWG.mjs.map +1 -0
- package/dist/{errors-DfrC_yfG.d.mts → errors-DjCkC9IM.d.mts} +2 -2
- package/dist/errors-DjCkC9IM.d.mts.map +1 -0
- package/dist/{marker-lock-Bwew7cAs-CZ20Y_tA.mjs → marker-lock-Bwew7cAs-ElLxlCQp.mjs} +3 -3
- package/dist/marker-lock-Bwew7cAs-ElLxlCQp.mjs.map +1 -0
- package/dist/{marker-lock-su6IxinO.d.mts → marker-lock-Px2qK06F.d.mts} +2 -2
- package/dist/marker-lock-Px2qK06F.d.mts.map +1 -0
- package/dist/{marker-read-Cf80LSbG-CUp3v1e5.mjs → marker-read-D1hp62hF-3-4fEgDD.mjs} +6 -23
- package/dist/marker-read-D1hp62hF-3-4fEgDD.mjs.map +1 -0
- package/dist/{migration-DmlblTTw.d.mts → migration-DILkj7kB.d.mts} +41 -29
- package/dist/migration-DILkj7kB.d.mts.map +1 -0
- package/dist/{mysql-contract-serializer-BnTKRSsN-B2O3EreV.mjs → mysql-contract-serializer-BnTKRSsN-BnV7fdYd.mjs} +4 -4
- package/dist/mysql-contract-serializer-BnTKRSsN-BnV7fdYd.mjs.map +1 -0
- package/dist/{mysql-database-CHl9-oSL-CWZLDXt6.mjs → mysql-database-CHl9-oSL-B1arvq6Q.mjs} +5 -5
- package/dist/mysql-database-CHl9-oSL-B1arvq6Q.mjs.map +1 -0
- package/dist/{nodes-CvcX47ot-B-ZaUYRj.mjs → nodes-CvcX47ot-CcCy0Oh4.mjs} +2 -2
- package/dist/nodes-CvcX47ot-CcCy0Oh4.mjs.map +1 -0
- package/dist/{nodes-xc0cR0_c-2YbhgEjb.d.mts → nodes-xc0cR0_c-CLET35o0.d.mts} +2 -2
- package/dist/nodes-xc0cR0_c-CLET35o0.d.mts.map +1 -0
- package/dist/{now-expression-DVD18CUc-00buJUto.mjs → now-expression-DVD18CUc-DJqdZY96.mjs} +3 -3
- package/dist/now-expression-DVD18CUc-DJqdZY96.mjs.map +1 -0
- package/dist/{pack-BXvLVBWP.d.mts → pack-COnjX17N.d.mts} +6 -6
- package/dist/pack-COnjX17N.d.mts.map +1 -0
- package/dist/{planner-target-details-D6g2uSp--C5NKHmCc.d.mts → planner-target-details-D6g2uSp--6VJKSGxe.d.mts} +2 -2
- package/dist/planner-target-details-D6g2uSp--6VJKSGxe.d.mts.map +1 -0
- package/dist/{require-temporal-DeDQhbTn-Bxc65WbA.mjs → require-temporal-DeDQhbTn-CdpjEWCB.mjs} +3 -3
- package/dist/require-temporal-DeDQhbTn-CdpjEWCB.mjs.map +1 -0
- package/dist/{runner-C39AEe6--BVG3xPYw.mjs → runner-BIjAWX-E-BgTmrD8f.mjs} +146 -124
- package/dist/runner-BIjAWX-E-BgTmrD8f.mjs.map +1 -0
- package/dist/runtime-BGF0cSIt.mjs +569 -0
- package/dist/runtime-BGF0cSIt.mjs.map +1 -0
- package/dist/{runtime-ClRDfPiY.d.mts → runtime-Cm-T3hbP.d.mts} +4 -4
- package/dist/runtime-Cm-T3hbP.d.mts.map +1 -0
- package/dist/{runtime-BGyTXcQH.d.mts → runtime-DN20lWEg.d.mts} +7 -5
- package/dist/runtime-DN20lWEg.d.mts.map +1 -0
- package/dist/{runtime-CrB5DXx4.d.mts → runtime-sPIp-JgC.d.mts} +2 -2
- package/dist/runtime-sPIp-JgC.d.mts.map +1 -0
- package/dist/{sql-utils-bD4SfgX0.mjs → sql-utils-BE8tDXHs.mjs} +3 -3
- package/dist/sql-utils-BE8tDXHs.mjs.map +1 -0
- package/dist/{sql-utils-Cmv_TVa8-BetrIUcj.mjs → sql-utils-Cmv_TVa8-CNW3UmfQ.mjs} +3 -3
- package/dist/sql-utils-Cmv_TVa8-CNW3UmfQ.mjs.map +1 -0
- package/dist/{sql-utils-BOS1c2QT.d.mts → sql-utils-DBvre8Ar.d.mts} +2 -2
- package/dist/sql-utils-DBvre8Ar.d.mts.map +1 -0
- package/dist/{statement-DC62oiSx-Buzptbpk.mjs → statement-CT5tB4uX-CHqHFM3z.mjs} +17 -14
- package/dist/statement-CT5tB4uX-CHqHFM3z.mjs.map +1 -0
- package/dist/target.d.mts +24 -24
- package/dist/target.mjs +22 -21
- package/dist/target__codec-descriptor.d.mts +2 -2
- package/dist/target__codec-descriptor.mjs +1 -1
- package/dist/target__codec-ids.d.mts +1 -1
- package/dist/target__codec-ids.mjs +1 -1
- 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__contract-free.d.mts +1 -1
- package/dist/target__contract-free.mjs +2 -2
- package/dist/target__control-tables.d.mts +1 -1
- package/dist/target__control-tables.mjs +1 -1
- package/dist/target__control.d.mts +3 -3
- package/dist/target__control.mjs +3 -64
- package/dist/target__data-types.d.mts +2 -2
- package/dist/target__data-types.mjs +2 -2
- package/dist/target__ddl.d.mts +2 -2
- package/dist/target__ddl.mjs +1 -1
- 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.d.mts +1 -1
- package/dist/target__marker-lock.mjs +1 -1
- package/dist/target__migration.d.mts +2 -2
- package/dist/target__migration.mjs +2 -2
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__runtime.d.mts +1 -1
- package/dist/target__runtime.mjs +3 -3
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/target__sql-utils.d.mts +1 -1
- package/dist/target__sql-utils.mjs +2 -2
- package/dist/target__types.d.mts +1 -1
- package/dist/target__types.mjs +1 -1
- package/dist/{types-CgrFHUdk.d.mts → types-gXYDzQXs.d.mts} +2 -2
- package/dist/types-gXYDzQXs.d.mts.map +1 -0
- package/package.json +10 -10
- package/dist/adapter-Dl4Wwz1I.d.mts +0 -29
- package/dist/adapter-Dl4Wwz1I.d.mts.map +0 -1
- package/dist/codec-descriptor-3xp1XvVH-yVLnNzZ8.mjs.map +0 -1
- package/dist/codec-descriptor-DXyubAS6-siA0R8Ow.d.mts.map +0 -1
- package/dist/codec-descriptor-J3TP08l8-ekLvUVxW.d.mts +0 -1
- package/dist/codec-descriptor-oLRh9E29.d.mts +0 -2
- package/dist/codec-ids-CrR9Xi7r-CarpqbNM.mjs.map +0 -1
- package/dist/codec-ids-Dgh5IpML-76oBMuwK.d.mts.map +0 -1
- package/dist/codec-types-BH5moCD9.d.mts +0 -1
- package/dist/codec-types-Bai_CFkk-Blx2GxCH.d.mts.map +0 -1
- package/dist/codec-types-zzVcrnbk.d.mts +0 -1
- package/dist/codecs-BMidk26M-DsKq6wt5.d.mts.map +0 -1
- package/dist/codecs-BfiB79-5.mjs.map +0 -1
- package/dist/codecs-C_twedMx.d.mts.map +0 -1
- package/dist/contract-contributions-ChiX6W0F-CAng98bZ.mjs +0 -15
- package/dist/contract-contributions-ChiX6W0F-CAng98bZ.mjs.map +0 -1
- package/dist/contract-free-BvCdx_Ee.mjs.map +0 -1
- package/dist/contract-free-Cw9Mjcro.d.mts.map +0 -1
- package/dist/control-5eVF1TXc.mjs +0 -74
- package/dist/control-5eVF1TXc.mjs.map +0 -1
- package/dist/control-BBhWaGnH.mjs.map +0 -1
- package/dist/control-BvSM7mGR.d.mts.map +0 -1
- package/dist/control-DHkZbo58.d.mts +0 -25
- package/dist/control-DHkZbo58.d.mts.map +0 -1
- package/dist/control-MoPFgSaQ.d.mts.map +0 -1
- package/dist/control-tables-CHw2F-rg.d.mts.map +0 -1
- package/dist/control-tables-CcQ77JE7-CxTQYoQJ.mjs.map +0 -1
- package/dist/data-type-entries-C7VH2IHc-D1d5I8zF.mjs.map +0 -1
- package/dist/data-types-C-rfxpgB.d.mts.map +0 -1
- package/dist/data-types-D2HAT-Qf-CRI506c0.d.mts.map +0 -1
- package/dist/data-types-DOaaPS93-DBkMJyh1.mjs.map +0 -1
- package/dist/date-time-now-generators-DY-8Bodc-DcQ3h4Fg.mjs.map +0 -1
- package/dist/ddl-CT6DPEqg.d.mts +0 -1
- package/dist/ddl-DDmMHyA_-Bb8sXoS0.mjs.map +0 -1
- package/dist/default-normalizer-C8pc7SbL-CKgOEnGl.mjs.map +0 -1
- package/dist/default-normalizer-CGIwQiKB.d.mts.map +0 -1
- package/dist/descriptor-meta-CsMPRsxp-DhK87vlc.mjs.map +0 -1
- package/dist/driver__runtime.mjs.map +0 -1
- package/dist/errors-Cng94tYg-D02Eud2d.mjs.map +0 -1
- package/dist/errors-DfrC_yfG.d.mts.map +0 -1
- package/dist/marker-lock-Bwew7cAs-CZ20Y_tA.mjs.map +0 -1
- package/dist/marker-lock-su6IxinO.d.mts.map +0 -1
- package/dist/marker-read-Cf80LSbG-CUp3v1e5.mjs.map +0 -1
- package/dist/migration-DmlblTTw.d.mts.map +0 -1
- package/dist/mysql-contract-serializer-BnTKRSsN-B2O3EreV.mjs.map +0 -1
- package/dist/mysql-database-CHl9-oSL-CWZLDXt6.mjs.map +0 -1
- package/dist/nodes-CvcX47ot-B-ZaUYRj.mjs.map +0 -1
- package/dist/nodes-xc0cR0_c-2YbhgEjb.d.mts.map +0 -1
- package/dist/now-expression-DVD18CUc-00buJUto.mjs.map +0 -1
- package/dist/pack-BXvLVBWP.d.mts.map +0 -1
- package/dist/planner-target-details-D6g2uSp--C5NKHmCc.d.mts.map +0 -1
- package/dist/require-temporal-DeDQhbTn-Bxc65WbA.mjs.map +0 -1
- package/dist/runner-C39AEe6--BVG3xPYw.mjs.map +0 -1
- package/dist/runtime-BGyTXcQH.d.mts.map +0 -1
- package/dist/runtime-ClRDfPiY.d.mts.map +0 -1
- package/dist/runtime-CrB5DXx4.d.mts.map +0 -1
- package/dist/sql-utils-BOS1c2QT.d.mts.map +0 -1
- package/dist/sql-utils-Cmv_TVa8-BetrIUcj.mjs.map +0 -1
- package/dist/sql-utils-bD4SfgX0.mjs.map +0 -1
- package/dist/statement-DC62oiSx-Buzptbpk.mjs.map +0 -1
- package/dist/target__control.mjs.map +0 -1
- package/dist/types-CgrFHUdk.d.mts.map +0 -1
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { a as connectionFix, c as mysqlConnectionOptions, f as normalizeMysqlError, l as mysqlDriverDescriptorMeta, m as statementFor, n as acquireClientQueryLock, o as connectionLost, p as sessionSettingsStatement, r as applySessionSettings, s as isFatal } from "./statement-DC62oiSx-Buzptbpk.mjs";
|
|
2
|
-
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
3
|
-
import { errorRuntime } from "@prisma/orm-framework/errors/execution";
|
|
4
|
-
import { redactDatabaseUrl } from "@prisma/orm-framework/utils/redact-db-url";
|
|
5
|
-
import { createConnection } from "mariadb";
|
|
6
|
-
//#region ../../../3-targets/mysql/3-driver/dist/control.mjs
|
|
7
|
-
/**
|
|
8
|
-
* A MySQL connection for the control plane. It runs every statement as the runtime driver does, a user's `rawSql` migration step included: in one round trip over the text protocol, the package writing its values into it, one at a time in the order sent, under the runtime driver's per-client lock.
|
|
9
|
-
*/
|
|
10
|
-
var MysqlControlDriver = class {
|
|
11
|
-
connection;
|
|
12
|
-
familyId = "sql";
|
|
13
|
-
targetId = "mysql";
|
|
14
|
-
#lost;
|
|
15
|
-
constructor(connection) {
|
|
16
|
-
this.connection = connection;
|
|
17
|
-
connection.on("error", (error) => {
|
|
18
|
-
this.#lost = error;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
/** Runs `sql` and returns its rows, every column as text and a binary column as bytes. */
|
|
22
|
-
async query(sql, params) {
|
|
23
|
-
const releaseLock = await acquireClientQueryLock(this.connection);
|
|
24
|
-
try {
|
|
25
|
-
if (this.#lost !== void 0) throw connectionLost(this.#lost);
|
|
26
|
-
const statement = statementFor(this.connection, sql, params ?? []);
|
|
27
|
-
const result = await this.connection.query(statement.sql, statement.values);
|
|
28
|
-
return { rows: Array.isArray(result) ? blindCast([...result]) : [] };
|
|
29
|
-
} catch (error) {
|
|
30
|
-
if (error instanceof Error && isFatal(error)) {
|
|
31
|
-
this.#lost = error;
|
|
32
|
-
throw connectionLost(error);
|
|
33
|
-
}
|
|
34
|
-
throw normalizeMysqlError(error);
|
|
35
|
-
} finally {
|
|
36
|
-
releaseLock();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
async databaseName() {
|
|
40
|
-
const { rows } = await this.query("SELECT DATABASE() AS name");
|
|
41
|
-
const name = rows[0]?.name;
|
|
42
|
-
return typeof name === "string" && name.length > 0 ? name : void 0;
|
|
43
|
-
}
|
|
44
|
-
async close() {
|
|
45
|
-
await this.connection.end().catch(() => {});
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
const mysqlDriverDescriptor = {
|
|
49
|
-
...mysqlDriverDescriptorMeta,
|
|
50
|
-
async create(url, options) {
|
|
51
|
-
const connectionOptions = mysqlConnectionOptions(url, { connectTimeoutMs: options?.connectTimeoutMs });
|
|
52
|
-
const settings = sessionSettingsStatement(options?.sessionSettings ?? {});
|
|
53
|
-
try {
|
|
54
|
-
const connection = await createConnection(connectionOptions);
|
|
55
|
-
if (settings !== void 0) await applySessionSettings(connection, settings).catch(async (error) => {
|
|
56
|
-
await connection.end().catch(() => {});
|
|
57
|
-
throw error;
|
|
58
|
-
});
|
|
59
|
-
return new MysqlControlDriver(connection);
|
|
60
|
-
} catch (error) {
|
|
61
|
-
const normalized = normalizeMysqlError(error);
|
|
62
|
-
throw errorRuntime("DRIVER.CONNECTION_FAILED", "Database connection failed", {
|
|
63
|
-
why: normalized instanceof Error ? normalized.message : String(normalized),
|
|
64
|
-
fix: connectionFix(error) ?? "Verify the database URL, ensure the database is reachable, and confirm credentials/permissions",
|
|
65
|
-
meta: { ...redactDatabaseUrl(url) },
|
|
66
|
-
cause: error
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
//#endregion
|
|
72
|
-
export { mysqlDriverDescriptor as n, MysqlControlDriver as t };
|
|
73
|
-
|
|
74
|
-
//# sourceMappingURL=control-5eVF1TXc.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-5eVF1TXc.mjs","names":["#lost"],"sources":["../../../../3-targets/mysql/3-driver/dist/control.mjs"],"sourcesContent":["import { c as isFatal, d as mysqlConnectionOptions, i as sessionSettingsStatement, l as normalizeMysqlError, m as acquireClientQueryLock, o as connectionFix, r as applySessionSettings, s as connectionLost, t as statementFor, u as mysqlDriverDescriptorMeta } from \"./statement-DC62oiSx.mjs\";\nimport { errorRuntime } from \"@internal/errors/execution\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { redactDatabaseUrl } from \"@internal/utils/redact-db-url\";\nimport { createConnection } from \"mariadb\";\n//#region src/core/migrations/control-driver.ts\n/**\n* A MySQL connection for the control plane. It runs every statement as the runtime driver does, a user's `rawSql` migration step included: in one round trip over the text protocol, the package writing its values into it, one at a time in the order sent, under the runtime driver's per-client lock.\n*/\nvar MysqlControlDriver = class {\n\tconnection;\n\tfamilyId = \"sql\";\n\ttargetId = \"mysql\";\n\t#lost;\n\tconstructor(connection) {\n\t\tthis.connection = connection;\n\t\tconnection.on(\"error\", (error) => {\n\t\t\tthis.#lost = error;\n\t\t});\n\t}\n\t/** Runs `sql` and returns its rows, every column as text and a binary column as bytes. */\n\tasync query(sql, params) {\n\t\tconst releaseLock = await acquireClientQueryLock(this.connection);\n\t\ttry {\n\t\t\tif (this.#lost !== void 0) throw connectionLost(this.#lost);\n\t\t\tconst statement = statementFor(this.connection, sql, params ?? []);\n\t\t\tconst result = await this.connection.query(statement.sql, statement.values);\n\t\t\treturn { rows: Array.isArray(result) ? blindCast([...result]) : [] };\n\t\t} catch (error) {\n\t\t\tif (error instanceof Error && isFatal(error)) {\n\t\t\t\tthis.#lost = error;\n\t\t\t\tthrow connectionLost(error);\n\t\t\t}\n\t\t\tthrow normalizeMysqlError(error);\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t}\n\t}\n\tasync databaseName() {\n\t\tconst { rows } = await this.query(\"SELECT DATABASE() AS name\");\n\t\tconst name = rows[0]?.name;\n\t\treturn typeof name === \"string\" && name.length > 0 ? name : void 0;\n\t}\n\tasync close() {\n\t\tawait this.connection.end().catch(() => {});\n\t}\n};\nconst mysqlDriverDescriptor = {\n\t...mysqlDriverDescriptorMeta,\n\tasync create(url, options) {\n\t\tconst connectionOptions = mysqlConnectionOptions(url, { connectTimeoutMs: options?.connectTimeoutMs });\n\t\tconst settings = sessionSettingsStatement(options?.sessionSettings ?? {});\n\t\ttry {\n\t\t\tconst connection = await createConnection(connectionOptions);\n\t\t\tif (settings !== void 0) await applySessionSettings(connection, settings).catch(async (error) => {\n\t\t\t\tawait connection.end().catch(() => {});\n\t\t\t\tthrow error;\n\t\t\t});\n\t\t\treturn new MysqlControlDriver(connection);\n\t\t} catch (error) {\n\t\t\tconst normalized = normalizeMysqlError(error);\n\t\t\tthrow errorRuntime(\"DRIVER.CONNECTION_FAILED\", \"Database connection failed\", {\n\t\t\t\twhy: normalized instanceof Error ? normalized.message : String(normalized),\n\t\t\t\tfix: connectionFix(error) ?? \"Verify the database URL, ensure the database is reachable, and confirm credentials/permissions\",\n\t\t\t\tmeta: { ...redactDatabaseUrl(url) },\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t}\n};\n//#endregion\nexport { MysqlControlDriver, mysqlDriverDescriptor as default };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;AASA,IAAI,qBAAqB,MAAM;CAC9B;CACA,WAAW;CACX,WAAW;CACX;CACA,YAAY,YAAY;EACvB,KAAK,aA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C,CAAC,YAAY,CAAC,CAAC;IACrC,MAAM;GACP,CAAC;GACD,OAAO,IAAI,mBAAmB,UAAU;EACzC,SAAS,OAAO;GACf,MAAM,aAAa,oBAAoB,KAAK;GAC5C,MAAM,aAAa,4BAA4B,8BAA8B;IAC5E,KAAK,sBAAsB,QAAQ,WAAW,UAAU,OAAO,UAAU;IACzE,KAAK,cAAc,KAAK,KAAK;IAC7B,MAAM,EAAE,GAAG,kBAAkB,GAAG,EAAE;IAClC,OAAO;GACR,CAAC;EACF;CACD;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-BBhWaGnH.mjs","names":["#inTransaction"],"sources":["../../../../3-targets/mysql/2-adapter/dist/control.mjs"],"sourcesContent":["import { a as tableExists, i as readMarkerRows, n as parseJsonColumn, o as mysqlAdapterDescriptorMeta, r as readMarkerResult, t as decodeMysqlMarkerRow } from \"./marker-read-Cf80LSbG.mjs\";\nimport { checkSqlDefaultText, contractColumns, readColumnDefault, sqlDefaultFunctions } from \"@internal/family-sql/control\";\nimport { assembleMysqlCodecRegistry, decodeMysqlDatetime, encodeMysqlDatetime, mysqlCurrentValueFor, mysqlNowExpression } from \"@internal/target-mysql/codecs\";\nimport { parseMarkerRowSafely, withMarkerReadErrorHandling } from \"@internal/errors/execution\";\nimport { codecForRef } from \"@internal/framework-components/codec\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { encodeLiteralDefault, isDdlNode, renderOpaqueSql } from \"@internal/sql-relational-core/ast\";\nimport { buildControlTableBootstrapQueries, buildSignMarkerBootstrapQueries } from \"@internal/target-mysql/contract-free\";\nimport { CONTROL_TABLE_NAMES, LEDGER_TABLE_NAME, MARKER_TABLE_NAME } from \"@internal/target-mysql/control-tables\";\nimport { mysqlQueryNotYetSupported } from \"@internal/target-mysql/errors\";\nimport { withMarkerLock } from \"@internal/target-mysql/marker-lock\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { quoteIdentifier, quoteLiteral } from \"@internal/target-mysql/sql-utils\";\nimport { REFERENTIAL_ACTION_SQL } from \"@internal/sql-contract/referential-action-sql\";\nimport { resolveIntrospectedColumnType } from \"@internal/family-sql/control-adapter\";\nimport { RelationalSchemaNodeKind, SqlSchemaIR, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { readMysqlDefault } from \"@internal/target-mysql/default-normalizer\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { ledgerOriginFromStored } from \"@internal/migration-tools/ledger-origin\";\n//#region src/core/migrations/ddl-renderer.ts\n/** Column types MySQL gives a default only when it is written as an expression in parentheses. */\nconst EXPRESSION_DEFAULT_ONLY = /^(?:(?:tiny|medium|long)?(?:text|blob)|json|geometry)\\b/i;\nconst FRACTIONAL_SECONDS = /^(?:datetime|timestamp|time)\\((\\d)\\)$/i;\nfunction refusedDefault(where, why) {\n\tthrow structuredError(\"CONTRACT.DEFAULT_INVALID\", `Column \"${where.table}\".\"${where.column}\" has a default MySQL cannot store: ${why}`, { meta: {\n\t\ttable: where.table,\n\t\tcolumn: where.column\n\t} });\n}\n/** A wire value as the SQL literal MySQL reads for it. */\nfunction mysqlInlineLiteral(wire, where) {\n\tif (wire === null) return \"NULL\";\n\tif (typeof wire === \"boolean\") return wire ? \"1\" : \"0\";\n\tif (typeof wire === \"number\") {\n\t\tif (!Number.isFinite(wire)) return refusedDefault(where, `${wire} is not a finite number`);\n\t\treturn String(wire);\n\t}\n\tif (typeof wire === \"bigint\") return String(wire);\n\tif (typeof wire === \"string\") return quoteLiteral(wire);\n\tif (wire instanceof Date) return quoteLiteral(encodeMysqlDatetime(wire));\n\tif (wire instanceof Uint8Array) return `X'${Buffer.from(wire).toString(\"hex\")}'`;\n\tif (typeof wire === \"object\") return quoteLiteral(JSON.stringify(wire));\n\treturn refusedDefault(where, `a ${typeof wire} has no SQL literal`);\n}\nfunction withinParentheses(columnType, literal) {\n\treturn EXPRESSION_DEFAULT_ONLY.test(columnType.trim()) ? `(${literal})` : literal;\n}\n/**\n* The expression a `now()` default is written as: the current value the column's data type holds, `CURRENT_TIMESTAMP`, `CURRENT_DATE` or `CURRENT_TIME`, with the column's fractional-second precision, which MySQL requires to match. A column of a data type that holds no date or time is refused.\n*/\nfunction nowExpressionFor(columnType, codecLookup, codecRef, where) {\n\tconst dataType = codecRef === void 0 ? void 0 : codecLookup.descriptorFor(codecRef.codecId)?.dataType;\n\tconst current = mysqlCurrentValueFor(dataType);\n\tif (current === void 0) throw structuredError(\"CONTRACT.DEFAULT_INVALID\", `The column \"${where.table}\".\"${where.column}\" has a now() default, but its data type ${dataType} stores no date or time, so there is no current value to write. Remove the default, or give the field a date or time type.`, { meta: {\n\t\ttable: where.table,\n\t\tcolumn: where.column,\n\t\tdataType,\n\t\treason: \"now-default-not-date-or-time\"\n\t} });\n\tconst precision = FRACTIONAL_SECONDS.exec(columnType.trim())?.[1];\n\treturn mysqlNowExpression(current, precision === void 0 ? void 0 : Number(precision));\n}\n/**\n* The `DEFAULT …` clause of a column, or `''` for an `autoincrement()` default, which a column writes as `AUTO_INCREMENT` instead. A literal is read by the column's codec, and a text or blob column's literal is written as an expression, as MySQL requires.\n*/\nasync function renderMysqlColumnDefault(def, columnType, codecLookup, codecRef, where) {\n\tif (def.kind === \"function\") {\n\t\tconst text = def.expression.text;\n\t\tif (text === \"autoincrement()\") return \"\";\n\t\tif (text === \"now()\") return `DEFAULT (${nowExpressionFor(columnType, codecLookup, codecRef, where)})`;\n\t\tif (checkSqlDefaultText(text) !== void 0) throw structuredError(\"CONTRACT.DEFAULT_INVALID\", `Unsafe default expression in contract: \"${text}\". Default expressions must not contain semicolons, SQL comment tokens, dollar-quoting, or subqueries.`, { meta: { expression: text } });\n\t\treturn `DEFAULT (${renderOpaqueSql(def.expression)})`;\n\t}\n\tconst encoded = codecRef === void 0 ? void 0 : await encodeLiteralDefault(codecLookup, codecRef, def.value, where);\n\tif (encoded?.kind === \"sql-null\") return \"DEFAULT NULL\";\n\treturn `DEFAULT ${withinParentheses(columnType, mysqlInlineLiteral(encoded === void 0 ? def.value : encoded.wire, where))}`;\n}\nfunction isAutoincrement(column) {\n\treturn column.default?.kind === \"function\" && column.default.expression.text === \"autoincrement()\";\n}\nasync function renderColumn(column, codecLookup, table) {\n\tconst parts = [quoteIdentifier(column.name), column.type];\n\tif (column.notNull) parts.push(\"NOT NULL\");\n\tif (column.default !== void 0) {\n\t\tconst clause = await renderMysqlColumnDefault(column.default, column.type, codecLookup, column.codecRef, {\n\t\t\ttable,\n\t\t\tcolumn: column.name\n\t\t});\n\t\tif (clause.length > 0) parts.push(clause);\n\t}\n\tif (isAutoincrement(column)) parts.push(\"AUTO_INCREMENT\");\n\tif (column.primaryKey) parts.push(\"PRIMARY KEY\");\n\treturn parts.join(\" \");\n}\nfunction columnList(columns) {\n\treturn columns.map(quoteIdentifier).join(\", \");\n}\nfunction named(name, body) {\n\treturn name === void 0 ? body : `CONSTRAINT ${quoteIdentifier(name)} ${body}`;\n}\nfunction renderConstraint(constraint) {\n\tswitch (constraint.kind) {\n\t\tcase \"primary-key\": return named(constraint.name, `PRIMARY KEY (${columnList(constraint.columns)})`);\n\t\tcase \"unique\": return named(constraint.name, `UNIQUE (${columnList(constraint.columns)})`);\n\t\tcase \"foreign-key\": {\n\t\t\tconst actions = [constraint.onDelete === void 0 ? void 0 : `ON DELETE ${REFERENTIAL_ACTION_SQL[constraint.onDelete]}`, constraint.onUpdate === void 0 ? void 0 : `ON UPDATE ${REFERENTIAL_ACTION_SQL[constraint.onUpdate]}`].filter((action) => action !== void 0);\n\t\t\treturn named(constraint.name, [`FOREIGN KEY (${columnList(constraint.columns)}) REFERENCES ${quoteIdentifier(constraint.refTable)} (${columnList(constraint.refColumns)})`, ...actions].join(\" \"));\n\t\t}\n\t\tcase \"check-expression\": throw structuredError(\"CONTRACT.CONSTRAINT_INVALID\", `The MySQL target does not write CHECK constraints yet (constraint \"${constraint.name}\").`, { meta: { constraintName: constraint.name } });\n\t}\n}\n/** The `CREATE TABLE` statement of a MySQL DDL node. */\nasync function renderMysqlCreateTable(node, codecLookup) {\n\tconst definitions = [...await Promise.all(node.columns.map((column) => renderColumn(column, codecLookup, node.table))), ...(node.constraints ?? []).map(renderConstraint)];\n\treturn {\n\t\tsql: `CREATE TABLE ${node.ifNotExists === true ? \"IF NOT EXISTS \" : \"\"}${quoteIdentifier(node.table)} (\\n ${definitions.join(\",\\n \")}\\n)`,\n\t\tparams: []\n\t};\n}\n//#endregion\n//#region src/core/migrations/declared-indexes.ts\nfunction isLoose(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\nfunction child(value, key) {\n\tconst found = isLoose(value) ? value[key] : void 0;\n\treturn isLoose(found) ? found : void 0;\n}\nfunction tableIndexKey(tableName, indexName) {\n\treturn JSON.stringify([tableName, indexName]);\n}\n/** The indexes the contract handed to introspection declares, read from every contract space it holds. */\nfunction declaredIndexes(contract) {\n\tconst contracts = isLoose(contract) && Array.isArray(contract[\"contracts\"]) ? contract[\"contracts\"] : [contract];\n\tconst declared = /* @__PURE__ */ new Set();\n\tconst declaredUnique = /* @__PURE__ */ new Set();\n\tfor (const space of contracts) for (const namespace of Object.values(child(child(space, \"storage\"), \"namespaces\") ?? {})) for (const [tableName, table] of Object.entries(child(child(namespace, \"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) || typeof index[\"name\"] !== \"string\") continue;\n\t\t\tconst key = tableIndexKey(tableName, index[\"name\"]);\n\t\t\tdeclared.add(key);\n\t\t\tif (index[\"unique\"] === true) declaredUnique.add(key);\n\t\t}\n\t}\n\treturn {\n\t\tdeclaresIndex: (tableName, indexName) => declared.has(tableIndexKey(tableName, indexName)),\n\t\tdeclaresUniqueIndex: (tableName, indexName) => declaredUnique.has(tableIndexKey(tableName, indexName))\n\t};\n}\n//#endregion\n//#region src/core/migrations/introspection.ts\nconst NOTHING_DECLARED = {\n\tdeclaresIndex: () => false,\n\tdeclaresUniqueIndex: () => false\n};\nconst PRIMARY_INDEX = \"PRIMARY\";\nconst REFERENTIAL_ACTIONS = {\n\tRESTRICT: \"restrict\",\n\tCASCADE: \"cascade\",\n\t\"SET NULL\": \"setNull\",\n\t\"SET DEFAULT\": \"setDefault\"\n};\n/** A rule `REFERENTIAL_CONSTRAINTS` reports, with `NO ACTION`, MySQL's default, as no action at all. */\nfunction referentialAction(rule) {\n\tconst normalized = rule.toUpperCase();\n\tif (normalized === \"NO ACTION\") return void 0;\n\tconst action = REFERENTIAL_ACTIONS[normalized];\n\tif (action === void 0) throw structuredError(\"CONTRACT.INTROSPECTION_UNSUPPORTED\", `Unknown MySQL referential action rule: \"${rule}\". Expected one of: NO ACTION, RESTRICT, CASCADE, SET NULL, SET DEFAULT.`, { meta: { rule } });\n\treturn action;\n}\nfunction tableDependsOn(tableName) {\n\treturn [{\n\t\tnodeKind: RelationalSchemaNodeKind.schema,\n\t\tid: \"database\"\n\t}, {\n\t\tnodeKind: RelationalSchemaNodeKind.table,\n\t\tid: tableName\n\t}];\n}\nfunction columnDependsOn(tableName, columns) {\n\treturn columns.map((column) => [...tableDependsOn(tableName), {\n\t\tnodeKind: RelationalSchemaNodeKind.column,\n\t\tid: `column:${column}`\n\t}]);\n}\nfunction groupBy(rows, key) {\n\tconst groups = /* @__PURE__ */ new Map();\n\tfor (const row of rows) {\n\t\tconst group = groups.get(key(row));\n\t\tif (group === void 0) groups.set(key(row), [row]);\n\t\telse group.push(row);\n\t}\n\treturn groups;\n}\nfunction byPosition(position) {\n\treturn (a, b) => Number(position(a)) - Number(position(b));\n}\nasync function columnOf(row, dataTypes, readLiteralDefault) {\n\tconst reported = readMysqlDefault(row.column_default, row.extra);\n\tconst readDefault = reported === void 0 ? {} : reported.kind === \"function\" ? { resolvedDefault: reported } : await readLiteralDefault(row.table_name, row.column_name, reported.literal.body);\n\tconst reportedType = {\n\t\ttext: row.column_type,\n\t\tkind: void 0,\n\t\tschema: void 0,\n\t\tname: void 0\n\t};\n\treturn {\n\t\tname: row.column_name,\n\t\ttypeText: row.column_type,\n\t\tnullable: row.is_nullable === \"YES\",\n\t\t...ifDefined(\"default\", row.column_default ?? void 0),\n\t\t...readDefault,\n\t\treportedType,\n\t\t...resolveIntrospectedColumnType(reportedType, dataTypes)\n\t};\n}\nfunction indexesOf(rows) {\n\treturn [...groupBy(rows, (row) => row.index_name).entries()].map(([name, parts]) => {\n\t\tconst ordered = [...parts].sort(byPosition((part) => part.seq_in_index));\n\t\tconst expressions = ordered.flatMap((part) => part.expression === null ? [] : [part.expression]);\n\t\treturn {\n\t\t\tname,\n\t\t\tunique: ordered[0]?.non_unique === \"0\",\n\t\t\tcolumns: ordered.flatMap((part) => part.column_name === null ? [] : [part.column_name]),\n\t\t\texpression: expressions.length === 0 ? void 0 : expressions.join(\", \")\n\t\t};\n\t});\n}\nfunction sameColumns(a, b) {\n\treturn a.length === b.length && a.every((column, index) => column === b[index]);\n}\nfunction foreignKeysOf(tableName, rows) {\n\treturn [...groupBy(rows, (row) => row.constraint_name).entries()].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([name, parts]) => {\n\t\tconst ordered = [...parts].sort(byPosition((part) => part.ordinal_position));\n\t\tconst [first] = ordered;\n\t\tconst columns = ordered.map((part) => part.column_name);\n\t\tconst referencedTable = first?.referenced_table_name ?? \"\";\n\t\tconst referencedSchema = first?.referenced_table_schema ?? void 0;\n\t\treturn {\n\t\t\tcolumns,\n\t\t\treferencedTable,\n\t\t\treferencedColumns: ordered.map((part) => part.referenced_column_name),\n\t\t\t...ifDefined(\"referencedSchema\", referencedSchema),\n\t\t\tname,\n\t\t\t...ifDefined(\"onDelete\", first === void 0 ? void 0 : referentialAction(first.delete_rule)),\n\t\t\t...ifDefined(\"onUpdate\", first === void 0 ? void 0 : referentialAction(first.update_rule)),\n\t\t\tdependsOn: [...referencedSchema === void 0 ? [tableDependsOn(referencedTable)] : [], ...columnDependsOn(tableName, columns)]\n\t\t};\n\t});\n}\n/**\n* The index InnoDB creates for a foreign key that no index already serves: it carries the key's name and exactly the key's columns. Introspection leaves it out, because the contract describes the key, not that index. An explicit index can look the same, so one the contract declares is kept.\n*/\nfunction isForeignKeyIndex(tableName, index, foreignKeys, declared) {\n\tif (declared.declaresIndex(tableName, index.name)) return false;\n\treturn foreignKeys.some((fk) => fk.name === index.name && index.expression === void 0 && sameColumns(fk.columns, index.columns));\n}\nasync function tableOf(tableName, rows, dataTypes, readLiteralDefault, declared) {\n\tconst columns = {};\n\tfor (const row of [...rows.columns].sort(byPosition((column) => column.ordinal_position))) columns[row.column_name] = await columnOf(row, dataTypes, readLiteralDefault);\n\tconst foreignKeys = foreignKeysOf(tableName, rows.foreignKeys);\n\tconst indexes = indexesOf(rows.indexes);\n\tconst expressionIndexNames = new Set(indexes.filter((index) => index.expression !== void 0).map((index) => index.name));\n\tconst uniqueConstraintNames = new Set(rows.constraints.filter((constraint) => constraint.constraint_type === \"UNIQUE\" && !expressionIndexNames.has(constraint.constraint_name) && !declared.declaresUniqueIndex(tableName, constraint.constraint_name)).map((constraint) => constraint.constraint_name));\n\tconst primary = indexes.find((index) => index.name === PRIMARY_INDEX);\n\tconst primaryKey = primary === void 0 ? void 0 : {\n\t\tcolumns: primary.columns,\n\t\tdependsOn: columnDependsOn(tableName, primary.columns)\n\t};\n\tconst uniques = indexes.filter((index) => uniqueConstraintNames.has(index.name)).map((index) => ({\n\t\tcolumns: index.columns,\n\t\tname: index.name,\n\t\tdependsOn: columnDependsOn(tableName, index.columns)\n\t}));\n\tconst plainIndexes = indexes.filter((index) => index.name !== PRIMARY_INDEX && !uniqueConstraintNames.has(index.name) && !isForeignKeyIndex(tableName, index, foreignKeys, declared)).map((index) => {\n\t\tconst base = {\n\t\t\tnaming: {\n\t\t\t\tkind: \"exact\",\n\t\t\t\tname: index.name\n\t\t\t},\n\t\t\twhere: void 0,\n\t\t\tunique: index.unique,\n\t\t\tpartial: false,\n\t\t\ttype: void 0,\n\t\t\toptions: void 0,\n\t\t\tannotations: void 0,\n\t\t\tdependsOn: columnDependsOn(tableName, index.columns)\n\t\t};\n\t\treturn index.expression === void 0 ? {\n\t\t\t...base,\n\t\t\tcolumns: index.columns\n\t\t} : {\n\t\t\t...base,\n\t\t\texpression: index.expression\n\t\t};\n\t});\n\treturn new SqlTableIR({\n\t\tname: tableName,\n\t\tcolumns,\n\t\t...ifDefined(\"primaryKey\", primaryKey),\n\t\tforeignKeys,\n\t\tuniques,\n\t\tindexes: plainIndexes\n\t});\n}\n/**\n* The schema IR of the database the rows describe: one flat tree of its tables. MySQL lists every unique index as a UNIQUE constraint, so one is reported as a unique constraint unless the contract declares a unique index of that name on the table, or it indexes an expression. The index InnoDB creates for a foreign key is left out, unless the contract declares an index of that name on the table.\n*/\nasync function buildMysqlSchemaIR(rows, dataTypes, readLiteralDefault, declared = NOTHING_DECLARED) {\n\tconst columnsByTable = groupBy(rows.columns, (row) => row.table_name);\n\tconst indexesByTable = groupBy(rows.indexes, (row) => row.table_name);\n\tconst constraintsByTable = groupBy(rows.constraints, (row) => row.table_name);\n\tconst foreignKeysByTable = groupBy(rows.foreignKeys, (row) => row.table_name);\n\tconst tables = {};\n\tfor (const tableName of rows.tables) tables[tableName] = await tableOf(tableName, {\n\t\tcolumns: columnsByTable.get(tableName) ?? [],\n\t\tindexes: indexesByTable.get(tableName) ?? [],\n\t\tconstraints: constraintsByTable.get(tableName) ?? [],\n\t\tforeignKeys: foreignKeysByTable.get(tableName) ?? []\n\t}, dataTypes, readLiteralDefault, declared);\n\treturn new SqlSchemaIR({ tables });\n}\n//#endregion\n//#region src/core/migrations/introspection-queries.ts\nconst TABLES = `SELECT TABLE_NAME AS table_name\n FROM information_schema.TABLES\n WHERE TABLE_SCHEMA = DATABASE() AND TABLE_TYPE = 'BASE TABLE'\n ORDER BY TABLE_NAME`;\nconst COLUMNS = `SELECT TABLE_NAME AS table_name, COLUMN_NAME AS column_name,\n ORDINAL_POSITION AS ordinal_position, COLUMN_DEFAULT AS column_default,\n IS_NULLABLE AS is_nullable, COLUMN_TYPE AS column_type, EXTRA AS extra\n FROM information_schema.COLUMNS\n WHERE TABLE_SCHEMA = DATABASE()\n ORDER BY TABLE_NAME, ORDINAL_POSITION`;\nconst INDEXES = `SELECT TABLE_NAME AS table_name, INDEX_NAME AS index_name,\n NON_UNIQUE AS non_unique, SEQ_IN_INDEX AS seq_in_index,\n COLUMN_NAME AS column_name, EXPRESSION AS expression\n FROM information_schema.STATISTICS\n WHERE TABLE_SCHEMA = DATABASE()\n ORDER BY TABLE_NAME, INDEX_NAME, SEQ_IN_INDEX`;\nconst CONSTRAINTS = `SELECT TABLE_NAME AS table_name, CONSTRAINT_NAME AS constraint_name,\n CONSTRAINT_TYPE AS constraint_type\n FROM information_schema.TABLE_CONSTRAINTS\n WHERE TABLE_SCHEMA = DATABASE()`;\nconst FOREIGN_KEYS = `SELECT k.TABLE_NAME AS table_name, k.CONSTRAINT_NAME AS constraint_name,\n k.COLUMN_NAME AS column_name, k.ORDINAL_POSITION AS ordinal_position,\n NULLIF(k.REFERENCED_TABLE_SCHEMA, k.TABLE_SCHEMA) AS referenced_table_schema,\n k.REFERENCED_TABLE_NAME AS referenced_table_name,\n k.REFERENCED_COLUMN_NAME AS referenced_column_name,\n r.UPDATE_RULE AS update_rule, r.DELETE_RULE AS delete_rule\n FROM information_schema.KEY_COLUMN_USAGE k\n JOIN information_schema.REFERENTIAL_CONSTRAINTS r\n ON r.CONSTRAINT_SCHEMA = k.CONSTRAINT_SCHEMA\n AND r.TABLE_NAME = k.TABLE_NAME\n AND r.CONSTRAINT_NAME = k.CONSTRAINT_NAME\n WHERE k.TABLE_SCHEMA = DATABASE() AND k.REFERENCED_TABLE_NAME IS NOT NULL\n ORDER BY k.TABLE_NAME, k.CONSTRAINT_NAME, k.ORDINAL_POSITION`;\n/** Reads the catalog rows of the connection's database, leaving out the runner's control tables. */\nasync function readMysqlCatalog(driver) {\n\tconst keep = (rows) => rows.filter((row) => !CONTROL_TABLE_NAMES.has(row.table_name));\n\tconst tables = await driver.query(TABLES);\n\tconst columns = await driver.query(COLUMNS);\n\tconst indexes = await driver.query(INDEXES);\n\tconst constraints = await driver.query(CONSTRAINTS);\n\tconst foreignKeys = await driver.query(FOREIGN_KEYS);\n\treturn {\n\t\ttables: keep(tables.rows).map((row) => row.table_name),\n\t\tcolumns: keep(columns.rows),\n\t\tindexes: keep(indexes.rows),\n\t\tconstraints: keep(constraints.rows),\n\t\tforeignKeys: keep(foreignKeys.rows)\n\t};\n}\n//#endregion\n//#region src/core/migrations/marker-ledger.ts\nconst LEDGER_COLUMNS = \"space, migration_name, migration_hash, origin_core_hash, destination_core_hash, operations, created_at\";\nfunction operationCount(operations) {\n\tconst parsed = typeof operations === \"string\" ? parseOperations(operations) : operations;\n\treturn Array.isArray(parsed) ? parsed.length : 0;\n}\nfunction parseOperations(text) {\n\ttry {\n\t\treturn JSON.parse(text);\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction text(row, column) {\n\tconst value = row[column];\n\treturn typeof value === \"string\" ? value : String(value);\n}\n/** The ledger's entries for `space`, or for every space, in the order they were applied. */\nasync function readLedgerEntries(driver, space) {\n\tif (!await tableExists(driver, LEDGER_TABLE_NAME)) return [];\n\tconst select = `SELECT ${LEDGER_COLUMNS} FROM ${quoteIdentifier(LEDGER_TABLE_NAME)}`;\n\tconst { rows } = space === void 0 ? await driver.query(`${select} ORDER BY id`) : await driver.query(`${select} WHERE space = ? ORDER BY id`, [space]);\n\treturn rows.map((row) => {\n\t\tconst origin = row[\"origin_core_hash\"];\n\t\treturn {\n\t\t\tspace: text(row, \"space\"),\n\t\t\tmigrationName: text(row, \"migration_name\"),\n\t\t\tmigrationHash: text(row, \"migration_hash\"),\n\t\t\tfrom: ledgerOriginFromStored(typeof origin === \"string\" ? origin : null),\n\t\t\tto: text(row, \"destination_core_hash\"),\n\t\t\tappliedAt: decodeMysqlDatetime(text(row, \"created_at\")),\n\t\t\toperationCount: operationCount(row[\"operations\"])\n\t\t};\n\t});\n}\nconst MARKER_INSERT = `INSERT INTO ${quoteIdentifier(MARKER_TABLE_NAME)} (space, core_hash, profile_hash, contract_json, canonical_version, updated_at, app_tag, meta, invariants) VALUES (?, ?, ?, NULL, NULL, CURRENT_TIMESTAMP(3), NULL, '{}', ?)`;\nfunction markerInsertParams(space, destination) {\n\treturn [\n\t\tspace,\n\t\tdestination.storageHash,\n\t\tdestination.profileHash,\n\t\tJSON.stringify(destination.invariants ?? [])\n\t];\n}\n/** Inserts the marker row of `space`; fails when the space already has one. */\nasync function insertMarkerRow(driver, space, destination) {\n\tawait driver.query(MARKER_INSERT, markerInsertParams(space, destination));\n}\n/** Writes the marker row of `space`, replacing the row the space already has. */\nasync function upsertMarkerRow(driver, space, destination) {\n\tawait driver.query(`${MARKER_INSERT} AS incoming ON DUPLICATE KEY UPDATE core_hash = incoming.core_hash, profile_hash = incoming.profile_hash, contract_json = incoming.contract_json, canonical_version = incoming.canonical_version, updated_at = CURRENT_TIMESTAMP(3), app_tag = incoming.app_tag, meta = incoming.meta, invariants = incoming.invariants`, markerInsertParams(space, destination));\n}\nfunction invariantsOf(text) {\n\tconst parsed = parseJsonColumn(\"invariants\", text);\n\treturn Array.isArray(parsed) ? parsed.filter((item) => typeof item === \"string\") : [];\n}\n/**\n* Advances the marker row of `space` from `expectedFrom` to `destination`, and says whether it did. MySQL has no `RETURNING`, so the row is read and locked with `FOR UPDATE` first, inside the transaction the caller holds, and written only when it still holds `expectedFrom`. Supplied invariants are merged with the stored ones.\n*/\nasync function compareAndSwapMarkerRow(driver, space, expectedFrom, destination) {\n\tconst { rows } = await driver.query(`SELECT core_hash, invariants FROM ${quoteIdentifier(MARKER_TABLE_NAME)} WHERE space = ? FOR UPDATE`, [space]);\n\tconst [row] = rows;\n\tif (row === void 0 || row[\"core_hash\"] !== expectedFrom) return false;\n\tconst invariants = destination.invariants === void 0 ? void 0 : [.../* @__PURE__ */ new Set([...invariantsOf(row[\"invariants\"]), ...destination.invariants])].sort();\n\tawait driver.query(`UPDATE ${quoteIdentifier(MARKER_TABLE_NAME)} SET core_hash = ?, profile_hash = ?, updated_at = CURRENT_TIMESTAMP(3)${invariants === void 0 ? \"\" : \", invariants = ?\"} WHERE space = ? AND core_hash = ?`, [\n\t\tdestination.storageHash,\n\t\tdestination.profileHash,\n\t\t...invariants === void 0 ? [] : [JSON.stringify(invariants)],\n\t\tspace,\n\t\texpectedFrom\n\t]);\n\treturn true;\n}\n/** Appends a ledger entry for `space`. */\nasync function insertLedgerRow(driver, space, entry) {\n\tawait driver.query(`INSERT INTO ${quoteIdentifier(LEDGER_TABLE_NAME)} (space, migration_name, migration_hash, origin_core_hash, destination_core_hash, operations) VALUES (?, ?, ?, ?, ?, ?)`, [\n\t\tspace,\n\t\tentry.migrationName,\n\t\tentry.migrationHash,\n\t\tentry.from,\n\t\tentry.to,\n\t\tJSON.stringify(entry.operations)\n\t]);\n}\n//#endregion\n//#region src/core/migrations/control-adapter.ts\n/** A DDL node MySQL does not build, such as one another target's visitor accepts. */\nfunction unsupportedDdl(ast) {\n\treturn structuredError(\"RUNTIME.DDL_UNSUPPORTED\", `The MySQL control adapter cannot lower the DDL node \"${ast.kind}\".`, { meta: {\n\t\tsurface: \"control-adapter\",\n\t\tkind: ast.kind\n\t} });\n}\n/**\n* The MySQL control adapter. It introspects the connection's database from `information_schema`, creates, reads and writes the marker and ledger tables, takes the marker lock, and runs work in a transaction. Query lowering refuses with `RUNTIME.AST_UNSUPPORTED`.\n*/\nvar MysqlControlAdapter = class {\n\tcodecRegistry;\n\tdeclaredDataTypes;\n\tfamilyId = \"sql\";\n\ttargetId = \"mysql\";\n\tmarkerLocation = MARKER_TABLE_NAME;\n\t/** `declaredDataTypes` are the stack's data types, which introspection resolves each column's reported type over. */\n\tconstructor(codecRegistry, declaredDataTypes) {\n\t\tthis.codecRegistry = codecRegistry;\n\t\tthis.declaredDataTypes = declaredDataTypes;\n\t}\n\tbootstrapControlTableQueries() {\n\t\treturn buildControlTableBootstrapQueries();\n\t}\n\tbootstrapSignMarkerQueries() {\n\t\treturn buildSignMarkerBootstrapQueries();\n\t}\n\tlower(ast) {\n\t\tif (isDdlNode(ast)) throw structuredError(\"RUNTIME.DDL_UNSUPPORTED\", \"lower() cannot lower DDL: DDL default literals require inline codec encoding, which is async. Use lowerToExecuteRequest().\", { meta: { surface: \"control-adapter\" } });\n\t\tthrow mysqlQueryNotYetSupported(\"Lowering queries\");\n\t}\n\tasync lowerToExecuteRequest(ast) {\n\t\tif (!isDdlNode(ast)) throw mysqlQueryNotYetSupported(\"Lowering queries\");\n\t\tif (typeof ast.accept !== \"function\") throw unsupportedDdl(ast);\n\t\treturn ast.accept(new Proxy({ createTable: (node) => renderMysqlCreateTable(node, this.codecRegistry) }, { get: (target, method) => Reflect.get(target, method) ?? (() => Promise.reject(unsupportedDdl(ast))) }));\n\t}\n\tasync renderColumnDefault(column, table) {\n\t\tif (column.default === void 0) return \"\";\n\t\treturn renderMysqlColumnDefault(column.default, column.type, this.codecRegistry, column.codecRef, {\n\t\t\ttable,\n\t\t\tcolumn: column.name\n\t\t});\n\t}\n\tasync readMarker(driver, space) {\n\t\tconst result = await readMarkerResult(driver, space);\n\t\treturn result.kind === \"present\" ? result.record : null;\n\t}\n\tasync readAllMarkers(driver) {\n\t\treturn withMarkerReadErrorHandling(async () => {\n\t\t\tconst markers = /* @__PURE__ */ new Map();\n\t\t\tfor (const row of await readMarkerRows(driver, void 0) ?? []) {\n\t\t\t\tconst space = String(row[\"space\"]);\n\t\t\t\tmarkers.set(space, parseMarkerRowSafely(row, () => decodeMysqlMarkerRow(row), {\n\t\t\t\t\tspace,\n\t\t\t\t\tmarkerLocation: MARKER_TABLE_NAME\n\t\t\t\t}));\n\t\t\t}\n\t\t\treturn markers;\n\t\t}, {\n\t\t\tspace: APP_SPACE_ID,\n\t\t\tmarkerLocation: MARKER_TABLE_NAME\n\t\t});\n\t}\n\tasync readLedger(driver, space) {\n\t\treturn withMarkerReadErrorHandling(() => readLedgerEntries(driver, space), {\n\t\t\tspace: space ?? \"*\",\n\t\t\tmarkerLocation: LEDGER_TABLE_NAME\n\t\t});\n\t}\n\tasync insertMarker(driver, space, destination) {\n\t\tawait insertMarkerRow(driver, space, destination);\n\t}\n\tasync initMarker(driver, space, destination) {\n\t\tawait upsertMarkerRow(driver, space, destination);\n\t}\n\tasync updateMarker(driver, space, expectedFrom, destination) {\n\t\treturn compareAndSwapMarkerRow(driver, space, expectedFrom, destination);\n\t}\n\tasync writeLedgerEntry(driver, space, entry) {\n\t\tawait insertLedgerRow(driver, space, entry);\n\t}\n\t/** Takes no lock: MySQL's `GET_LOCK` lives for the session, not the transaction, so {@link holdMarkerLock} takes it around the transaction instead. */\n\tasync lockMarker(_driver) {}\n\t/** Takes `GET_LOCK` before `work` runs and releases it when `work` ends, so `db sign` creates the marker table, whose DDL would end a transaction, under the lock. */\n\tasync holdMarkerLock(driver, work) {\n\t\treturn withMarkerLock(driver, work);\n\t}\n\tasync withTransaction(driver, fn) {\n\t\treturn this.#inTransaction(driver, fn);\n\t}\n\tasync #inTransaction(driver, fn) {\n\t\tawait driver.query(\"START TRANSACTION\");\n\t\tlet result;\n\t\ttry {\n\t\t\tresult = await fn();\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\tawait driver.query(\"ROLLBACK\");\n\t\t\t} catch (rollbackError) {\n\t\t\t\tif (error instanceof Error && error.cause === void 0) error.cause = rollbackError;\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t\tawait driver.query(\"COMMIT\");\n\t\treturn result;\n\t}\n\tasync introspect(driver, contract) {\n\t\tconst columns = contractColumns(contract);\n\t\treturn buildMysqlSchemaIR(await readMysqlCatalog(driver), this.declaredDataTypes, async (tableName, columnName, rawDefault) => {\n\t\t\tconst column = columns.columnOf(void 0, tableName, columnName);\n\t\t\tconst codec = column === void 0 ? void 0 : codecForRef(this.codecRegistry, column.codecRef);\n\t\t\tif (codec === void 0) return {};\n\t\t\treturn readColumnDefault(codec, {\n\t\t\t\tliteral: {\n\t\t\t\t\tkind: \"value\",\n\t\t\t\t\tbody: rawDefault\n\t\t\t\t},\n\t\t\t\traw: rawDefault\n\t\t\t}, void 0);\n\t\t}, declaredIndexes(contract));\n\t}\n};\n//#endregion\n//#region src/exports/control.ts\nconst mysqlAdapterDescriptor = {\n\t...mysqlAdapterDescriptorMeta,\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: new Map(Object.entries(sqlDefaultFunctions())),\n\t\tgeneratorDescriptors: []\n\t},\n\tcreate(stack) {\n\t\treturn new MysqlControlAdapter(assembleMysqlCodecRegistry(stack.target, stack.extensions), stack.declaredDataTypes.map(({ type }) => type));\n\t}\n};\n//#endregion\nexport { MysqlControlAdapter, buildMysqlSchemaIR, mysqlAdapterDescriptor as default };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,0BAA0B;AAChC,MAAM,qBAAqB;AAC3B,SAAS,eAAe,OAAO,KAAK;CACnC,MAAM,gBAAgB,4BAA4B,WAAW,MAAM,MAAM,KAAK,MAAM,OAAO,sCAAsC,OAAO,EAAE,MAAM;EAC/I,OAAO,MAAM;EACb,QAAQ,MAAM;CACf,EAAE,CAAC;AACJ;;AAEA,SAAS,mBAAmB,MAAM,OAAO;CACxC,IAAI,SAAS,MAAM,OAAO;CAC1B,IAAI,OAAO,SAAS,WAAW,OAAO,OAAO,MAAM;CACnD,IAAI,OAAO,SAAS,UAAU;EAC7B,IAAI,CAAC,OAAO,SAAS,IAAI,GAAG,OAAO,eAAe,OAAO,GAAG,KAAK,wBAAwB;EACzF,OAAO,OAAO,IAAI;CACnB;CACA,IAAI,OAAO,SAAS,UAAU,OAAO,OAAO,IAAI;CAChD,IAAI,OAAO,SAAS,UAAU,OAAO,aAAa,IAAI;CACtD,IAAI,gBAAgB,MAAM,OAAO,aAAa,oBAAoB,IAAI,CAAC;CACvE,IAAI,gBAAgB,YAAY,OAAO,KAAK,OAA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IACP;IACA,KAAK;GACN,GAAG,KAAK,CAAC;EACV,GAAG,gBAAgB,QAAQ,CAAC;CAC7B;AACD;AAGA,MAAM,yBAAyB;CAC9B,GAAG;CACH,yBAAyB;EACxB,yBAAyB,IAAI,IAAI,OAAO,QAAQ,oBAAoB,CAAC,CAAC;EACtE,sBAAsB,CAAC;CACxB;CACA,OAAO,OAAO;EACb,OAAO,IAAI,oBAAoB,2BAA2B,MAAM,QAAQ,MAAM,UAAU,GAAG,MAAM,kBAAkB,KAAK,EAAE,WAAW,IAAI,CAAC;CAC3I;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-BvSM7mGR.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/control.d.mts"],"mappings":";;;;;;cAKc,8BAA8B,oCAAoC,wBAAwB,SAAS;;;;;;cAMnG;WACH;aACE;aACA;aACA;eACE;eACA;eACA;eACA;eACA;;eAEA;eACA;eACA;eACA;eACA;;eAEA;eACA;eACA;eACA;;aAEF;eACE;iBACE;iBACA;;eAEF;eACA;iBACE;;;eAGF;iBACE;iBACA;;eAEF;eACA;iBACE;;;eAGF;iBACE;iBACA;;eAEF;eACA;iBACE;;;eAGF;iBACE;iBACA;;eAEF;eACA;iBACE;;;eAGF;iBACE;iBACA;;eAEF;eACA;iBACE;;;eAGF;iBACE;iBACA;;eAEF;eACA;iBACE;;;;WAIN;aACE;aACA;aACA;eACE;eACA;eACA;eACA;eACA;;eAEA;eACA;eACA;eACA;eACA;;aAEF;eACE;iBACE;iBACA;;eAEF;;eAEA;iBACE;iBACA;;eAEF;;;WAGJ;aACE;aACA;aACA;eACE;eACA;eACA;eACA;eACA;;eAEA;eACA;eACA;eACA;eACA;;eAEA;eACA;eACA;eACA;;aAEF;eACE;iBACE;iBACA;;eAEF;eACA;iBACE;;;eAGF;iBACE;iBACA;;eAEF;eACA;iBACE;;;;WAIN;aACE;aACA;aACA;eACE;eACA;eACA;eACA;eACA;;eAEA;eACA;eACA;eACA;eACA;;aAEF;eACE;iBACE;iBACA;;eAEF;;;WAGJ;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;aACA;eACE;eACA;iBACE;;;;WAIN;aACE;aACA;aACA;eACE;eACA;iBACE;;;;WAIN;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ControlDriverDescriptor } from "@prisma/orm-framework/components/control";
|
|
2
|
-
import { SqlControlDriverInstance } from "@prisma/orm-family-sql/contract/types";
|
|
3
|
-
import { Connection } from "mariadb";
|
|
4
|
-
//#region ../../../3-targets/mysql/3-driver/dist/control.d.mts
|
|
5
|
-
//#region src/core/migrations/control-driver.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* A MySQL connection for the control plane. It runs every statement as the runtime driver does, a user's `rawSql` migration step included: in one round trip over the text protocol, the package writing its values into it, one at a time in the order sent, under the runtime driver's per-client lock.
|
|
8
|
-
*/
|
|
9
|
-
declare class MysqlControlDriver implements SqlControlDriverInstance<'mysql'> {
|
|
10
|
-
#private;
|
|
11
|
-
private readonly connection;
|
|
12
|
-
readonly familyId: "sql";
|
|
13
|
-
readonly targetId: "mysql";
|
|
14
|
-
constructor(connection: Connection);
|
|
15
|
-
/** Runs `sql` and returns its rows, every column as text and a binary column as bytes. */
|
|
16
|
-
query<Row = Record<string, unknown>>(sql: string, params?: readonly unknown[]): Promise<{
|
|
17
|
-
readonly rows: Row[];
|
|
18
|
-
}>;
|
|
19
|
-
databaseName(): Promise<string | undefined>;
|
|
20
|
-
close(): Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
declare const mysqlDriverDescriptor: ControlDriverDescriptor<'sql', 'mysql', MysqlControlDriver>;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { mysqlDriverDescriptor as n, MysqlControlDriver as t };
|
|
25
|
-
//# sourceMappingURL=control-DHkZbo58.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-DHkZbo58.d.mts","names":[],"sources":["../../../../3-targets/mysql/3-driver/dist/control.d.mts"],"mappings":";;;;;;;;cAOc,8BAA8B;;mBAEzB;WACR;WACA;EACT,YAAY,YAAY;;EAExB,MAAM,MAAM,yBAAyB,aAAa,8BAA8B;aACrE,MAAM;;EAEjB,gBAAgB;EAChB,SAAS;;cAEG,uBAAuB,wCAAwC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-MoPFgSaQ.d.mts","names":[],"sources":["../../../../3-targets/mysql/2-adapter/dist/control.d.mts"],"mappings":";;;;;;;;;;;;UAUU;WACC;WACA;WACA;;;;KAIN,SAAS;;;;cAIA,+BAA+B;;mBAE1B;mBACA;WACR;WACA;WACA;;EAET,YAAY,eAAe,oBAAoB,4BAA4B;EAC3E,yCAAyC;EACzC,uCAAuC;EACv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,qBAAqB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-tables-CcQ77JE7-CxTQYoQJ.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/control-tables-CcQ77JE7.mjs"],"sourcesContent":["//#region src/core/control-tables.ts\nconst MARKER_TABLE_NAME = \"_prisma_marker\";\nconst LEDGER_TABLE_NAME = \"_prisma_ledger\";\n/** The tables the migration runner owns, which introspection leaves out and the planner never drops. MySQL has no schema inside a database to hold them, so they sit beside the application's tables. */\nconst CONTROL_TABLE_NAMES = /* @__PURE__ */ new Set([MARKER_TABLE_NAME, LEDGER_TABLE_NAME]);\n//#endregion\nexport { LEDGER_TABLE_NAME as n, MARKER_TABLE_NAME as r, CONTROL_TABLE_NAMES as t };\n\n//# sourceMappingURL=control-tables-CcQ77JE7.mjs.map"],"mappings":";AACA,MAAM,oBAAoB;AAC1B,MAAM,oBAAoB;;AAE1B,MAAM,sCAAsC,IAAI,IAAI,CAAC,mBAAmB,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-type-entries-C7VH2IHc-D1d5I8zF.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/data-type-entries-C7VH2IHc.mjs"],"sourcesContent":["import { C as mysqlTimestampText, S as mysqlTimestamp, _ as mysqlInt, b as mysqlTime, c as mysqlDateText, d as mysqlDatetimeText, f as mysqlDuration, l as mysqlDatetime, m as mysqlDurationText, r as mysqlBigint, s as mysqlDate, v as mysqlText, x as mysqlTimeText } from \"./data-types-DOaaPS93.mjs\";\nimport { createNumberClassifier, numeralText, signedRange } from \"@internal/framework-components/codec\";\n//#region src/core/data-type-entries.ts\nconst classifyMysqlNumber = createNumberClassifier({ integers: [{\n\ttype: mysqlInt.id,\n\tform: \"number\",\n\t...signedRange(32)\n}, {\n\ttype: mysqlBigint.id,\n\tform: \"text\",\n\t...signedRange(64)\n}] });\n/** A tag whose body is a date, time or duration in ISO 8601, read into the value its type stores. */\nfunction storedTextTag(tag, parse, documentation) {\n\treturn {\n\t\twritten: {\n\t\t\tkind: \"tag\",\n\t\t\ttag,\n\t\t\tparse\n\t\t},\n\t\tprint: (value) => String(value),\n\t\tdocumentation\n\t};\n}\nfunction printNumber(value) {\n\treturn typeof value === \"number\" ? numeralText(value) : String(value);\n}\nfunction mysqlDataTypeEntries() {\n\treturn {\n\t\t[mysqlText.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"string\",\n\t\t\t\tparse: (text) => text\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"Text.\"\n\t\t},\n\t\t[mysqlBigint.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"number\",\n\t\t\t\ttypes: [mysqlInt.id, mysqlBigint.id],\n\t\t\t\tclassify: classifyMysqlNumber\n\t\t\t},\n\t\t\tprint: printNumber,\n\t\t\tdocumentation: \"A whole number, whose type is the narrowest MySQL integer type that holds it.\"\n\t\t},\n\t\t[mysqlDatetime.id]: storedTextTag(\"datetime\", mysqlDatetimeText, \"A date and time in UTC without an offset, as in datetime`2024-01-01T00:00:00`, in the years 1000 to 9999.\"),\n\t\t[mysqlTimestamp.id]: storedTextTag(\"timestamp\", mysqlTimestampText, \"A date and time in UTC without an offset, as in timestamp`2024-01-01T00:00:00`, from 1970-01-01T00:00:01 to 2038-01-19T03:14:07.999999.\"),\n\t\t[mysqlDate.id]: storedTextTag(\"date\", mysqlDateText, \"A calendar date, as in date`2024-02-29`, in the years 1000 to 9999.\"),\n\t\t[mysqlTime.id]: storedTextTag(\"time\", mysqlTimeText, \"A time of day without a UTC offset, as in time`09:30:00`, from 00:00:00 to 23:59:59.999999.\"),\n\t\t[mysqlDuration.id]: storedTextTag(\"duration\", mysqlDurationText, \"A length of time, as in duration`PT1H30M`. Reads an ISO 8601 duration and stores it as written.\")\n\t};\n}\n//#endregion\nexport { mysqlDataTypeEntries as t };\n\n//# sourceMappingURL=data-type-entries-C7VH2IHc.mjs.map"],"mappings":";;;AAGA,MAAM,sBAAsB,uBAAuB,EAAE,UAAU,CAAC;CAC/D,MAAM,SAAS;CACf,MAAM;CACN,GAAG,YAAY,EAAE;AAClB,GAAG;CACF,MAAM,YAAY;CAClB,MAAM;CACN,GAAG,YAAY,EAAE;AAClB,CAAC,EAAE,CAAC;;AAEJ,SAAS,cAAc,KAAK,OAAO,eAAe;CACjD,OAAO;EACN,SAAS;GACR,MAAM;GACN;GACA;EACD;EACA,QAAQ,UAAU,OAAO,KAAK;EAC9B;CACD;AACD;AACA,SAAS,YAAY,OAAO;CAC3B,OAAO,OAAO,UAAU,WAAW,YAAY,KAAK,IAAI,OAAO,KAAK;AACrE;AACA,SAAS,uBAAuB;CAC/B,OAAO;GACL,UAAU,KAAK;GACf,SAAS;IACR,MAAM;IACN,QAAQ;IACR,QAAQ,SAAS;GAClB;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,YAAY,KAAK;GACjB,SAAS;IACR,MAAM;IACN,QAAQ;IACR,OAAO,CAAC,SAAS,IAAI,YAAY,EAAE;IACnC,UAAU;GACX;GACA,OAAO;GACP,eAAe;EAChB;GACC,cAAc,KAAK,cAAc,YAAY,mBAAmB,2GAA2G;GAC3K,eAAe,KAAK,cAAc,aAAa,oBAAoB,yIAAyI;GAC5M,UAAU,KAAK,cAAc,QAAQ,eAAe,qEAAqE;GACzH,UAAU,KAAK,cAAc,QAAQ,eAAe,6FAA6F;GACjJ,cAAc,KAAK,cAAc,YAAY,mBAAmB,iGAAiG;CACnK;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-types-C-rfxpgB.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/data-types.d.mts"],"mappings":";;;;iBAGiB,wBAAwB,SAAS,eAAe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-types-D2HAT-Qf-CRI506c0.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/data-types-D2HAT-Qf.d.mts"],"mappings":";;;cAEc,sDAAsD,YAAY,SAAS;;cAE3E,qDAAqD,YAAY,SAAS;;cAE1E,wDAAwD,YAAY,SAAS;;cAE7E,kEAAkE;EAC9E;;cAEY,yDAAyD;EACrE;;;cAGY,+DAA+D;EAC3E;;cAEY,sDAAsD;EAClE;;;cAGY,mEAAmE;EAC/E;;;cAGY;WACH;WACA;;;cAGG;WACH;WACA;;;;;iBAKM,kBAAkB;;;;iBAIlB,mBAAmB;;iBAEnB,cAAc;;;;iBAId,cAAc;;iBAEd,kBAAkB;cACrB,0DAA0D;EACtE;;;cAGY,2DAA2D;EACvE;;cAEY,sDAAsD,YAAY,SAAS;cAC3E,sDAAsD;EAClE;;;cAGY,mEAAmE;EAC/E;;;cAGY,0DAA0D,YAAY,SAAS;;cAE/E,+DAA+D;EAC3E;;;iBAGe,oBAAoB;;;;cAIvB,sDAAsD;EAClE;;;cAGY,yBAAyB;;cAEzB,6BAA6B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-types-DOaaPS93-DBkMJyh1.mjs","names":[],"sources":["../../../../3-targets/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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Y-8Bodc-DcQ3h4Fg.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/date-time-now-generators-DY-8Bodc.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\";\n/** The runtime-safe part of the MySQL target's metadata: it leaves out `authoring`, which only contract construction reads. Every session runs in UTC, because the datetime codec reads and writes UTC, and at READ COMMITTED, as Postgres does, so a read inside a transaction sees rows other sessions committed. Transaction isolation controls will replace the setting. */\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: {\n\t\ttime_zone: \"+00:00\",\n\t\ttransaction_isolation: \"READ-COMMITTED\"\n\t}\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-DY-8Bodc.mjs.map"],"mappings":";;;;;;AAKA,MAAM,mCAAmC;CACxC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,CAAC;CACf,WAAW;CACX,iBAAiB;EAChB,WAAW;EACX,uBAAuB;CACxB;AACD;;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"}
|
package/dist/ddl-CT6DPEqg.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./nodes-xc0cR0_c-2YbhgEjb.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ddl-DDmMHyA_-Bb8sXoS0.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/ddl-DDmMHyA_.mjs"],"sourcesContent":["import { t as MysqlCreateTable } from \"./nodes-CvcX47ot.mjs\";\n//#region src/contract-free/ddl.ts\n/**\n* A MySQL `CREATE TABLE` node. Identifiers and column types are written as given, so callers pass trusted values such as the control tables' names; string literal defaults are escaped by the renderer.\n*/\nfunction createTable(options) {\n\treturn new MysqlCreateTable(options);\n}\n//#endregion\nexport { createTable as t };\n\n//# sourceMappingURL=ddl-DDmMHyA_.mjs.map"],"mappings":";;;;;AAKA,SAAS,YAAY,SAAS;CAC7B,OAAO,IAAI,iBAAiB,OAAO;AACpC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-normalizer-C8pc7SbL-CKgOEnGl.mjs","names":[],"sources":["../../../../3-targets/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,QAAQ,OAAO,QAAQ,KAAK,QAAQ,SAAS,GAAG;EACxD,MAAM,OAAO,KAAK,OAAO,KAAK;EAC9B,IAAI,SAAS,MAAM;GAClB,SAAS;GACT,MAAM,UAAU,KAAK,OAAO,KAAK;GACjC,QAAQ,YAAY,OAA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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-normalizer-CGIwQiKB.d.mts","names":[],"sources":["../../../../3-targets/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-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;EAChC,oCAAoC;EACpC,kCAAkC;EAClC,6BAA6B;EAC7B,+BAA+B;EAC/B,6BAA6B;EAC7B,+BAA+B;AACjC;;AAEA,MAAM,iCAAiC,IAAI,IAAI;CAC9C;CACA;CACA;CAC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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":"driver__runtime.mjs","names":["#url","#idleTimeoutMillis","#closed","#idleTimer","#connection","#open","#setAside","#pending","#pendingOn","#idleLater","#streamRows","#runReleasing","#stopEarly","#refuseIfUnusable","#onRelease","#cancelRunning","#runningSettled","#close","#released","#count","#idle","#fail","#canceller","#options","#sessionSettings","#state","#inUse"],"sources":["../../../../3-targets/mysql/3-driver/dist/runtime.mjs"],"sourcesContent":["import { a as connectingCannotSucceed, c as isFatal, d as mysqlConnectionOptions, f as mysqlPoolIdleTimeoutMillis, l as normalizeMysqlError, m as acquireClientQueryLock, n as SessionSettingsGuard, p as mysqlPoolOptions, t as statementFor, u as mysqlDriverDescriptorMeta } from \"./statement-DC62oiSx.mjs\";\nimport { errorRuntime } from \"@internal/errors/execution\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { createConnection, createPool } from \"mariadb\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { EventEmitter } from \"node:events\";\nimport { finished } from \"node:stream/promises\";\n//#region src/core/runtime/canceller.ts\n/** How long the canceller waits to open its connection, and for MySQL to answer a `KILL QUERY`. */\nconst CANCEL_TIMEOUT_MILLIS = 2e3;\nfunction timeout(millis) {\n\tlet timer;\n\treturn {\n\t\texpired: new Promise((resolve) => {\n\t\t\ttimer = setTimeout(() => resolve(\"expired\"), millis);\n\t\t}),\n\t\tclear: () => clearTimeout(timer)\n\t};\n}\n/**\n* Cancels statements with `KILL QUERY`, which MySQL takes only from another connection. It keeps one connection of its own, outside the pool, so a cancel neither waits for a pooled connection nor normally opens one; it opens it on first need, and ends it once it has been idle for the pool's idle timeout, as the pool ends its own; with a timeout of 0 it keeps it open, as the pool keeps its own. Opening it and each `KILL QUERY` are bounded by two seconds. The connection is never destroyed: the package's `destroy()` sends a `KILL` of its own whose failure it does not handle (`mariadb` 3.5.4). A connection that stops answering is set aside and ended with `end()` once its statement settles.\n*/\nvar Canceller = class {\n\t#url;\n\t#idleTimeoutMillis;\n\t#connection;\n\t#pending = /* @__PURE__ */ new WeakMap();\n\t#closed = false;\n\t#idleTimer;\n\tconstructor(url, idleTimeoutMillis) {\n\t\tthis.#url = url;\n\t\tthis.#idleTimeoutMillis = idleTimeoutMillis;\n\t}\n\t/** Sends `KILL QUERY` for `threadId`. Never rejects. A kept connection that is no longer valid is replaced once. */\n\tasync cancel(threadId, replaced = false) {\n\t\tif (this.#closed || threadId === null) return \"unsent\";\n\t\tclearTimeout(this.#idleTimer);\n\t\tconst opening = this.#connection ?? this.#open();\n\t\tthis.#connection = opening;\n\t\tconst connection = await opening;\n\t\tif (connection === void 0) {\n\t\t\tthis.#setAside(opening);\n\t\t\treturn \"unsent\";\n\t\t}\n\t\tif (!connection.isValid()) {\n\t\t\tthis.#setAside(opening);\n\t\t\treturn replaced ? \"unsent\" : this.cancel(threadId, true);\n\t\t}\n\t\tthis.#pending.set(connection, this.#pendingOn(connection) + 1);\n\t\tconst killing = connection.query(\"KILL QUERY ?\", [threadId]).then(() => \"sent\", (error) => isFatal(error) ? \"unconfirmed\" : \"unsent\");\n\t\tkilling.then(() => {\n\t\t\tthis.#pending.set(connection, this.#pendingOn(connection) - 1);\n\t\t\tthis.#idleLater(opening, connection);\n\t\t});\n\t\tconst limit = timeout(CANCEL_TIMEOUT_MILLIS);\n\t\tconst result = await Promise.race([killing, limit.expired]);\n\t\tlimit.clear();\n\t\tif (result === \"sent\" || result === \"unsent\") return result;\n\t\tthis.#setAside(opening);\n\t\tconnection.end().catch(() => void 0);\n\t\treturn \"unconfirmed\";\n\t}\n\t/** Ends the connection: `end()` sends `QUIT` once any `KILL QUERY` on it settles. Waits for that only when no `KILL QUERY` is pending on it, so a connection that stopped answering cannot hold `close()` up. */\n\tasync close() {\n\t\tthis.#closed = true;\n\t\tclearTimeout(this.#idleTimer);\n\t\tconst connection = await this.#connection;\n\t\tthis.#connection = void 0;\n\t\tif (connection === void 0) return;\n\t\tconst ending = connection.end().catch(() => void 0);\n\t\tif (this.#pendingOn(connection) === 0) await ending;\n\t}\n\t#idleLater(opening, connection) {\n\t\tif (this.#idleTimeoutMillis === 0 || this.#pendingOn(connection) > 0 || this.#connection !== opening) return;\n\t\tclearTimeout(this.#idleTimer);\n\t\tthis.#idleTimer = setTimeout(() => {\n\t\t\tif (this.#pendingOn(connection) > 0 || this.#connection !== opening) return;\n\t\t\tthis.#connection = void 0;\n\t\t\tconnection.end().catch(() => void 0);\n\t\t}, this.#idleTimeoutMillis);\n\t\tthis.#idleTimer.unref();\n\t}\n\t#pendingOn(connection) {\n\t\treturn this.#pending.get(connection) ?? 0;\n\t}\n\t#setAside(opening) {\n\t\tif (this.#connection === opening) this.#connection = void 0;\n\t}\n\tasync #open() {\n\t\ttry {\n\t\t\tconst connection = await createConnection(mysqlConnectionOptions(this.#url, { connectTimeoutMs: CANCEL_TIMEOUT_MILLIS }));\n\t\t\tconnection.on(\"error\", () => void 0);\n\t\t\tif (this.#closed) {\n\t\t\t\tawait connection.end().catch(() => void 0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn connection;\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n};\n//#endregion\n//#region src/core/runtime/mysql-driver.ts\nfunction notConnected(message) {\n\treturn errorRuntime(\"DRIVER.NOT_CONNECTED\", message, { fix: \"Call connect(binding) before running queries, and do not use the driver after close().\" });\n}\n/** Runs `request` on `client` in one round trip and returns its result: its `?N` placeholders written as `?`, and its values handed to the package, which writes them into the statement. Throws the package's error as it is. */\nasync function run(client, request) {\n\tconst { sql, values } = statementFor(client, request.sql, request.params ?? []);\n\treturn client.query(sql, values);\n}\n/** Starts streaming the rows of `request` on `client`, sent as {@link run} sends it. Throws the error to report, after noting in `outcome` whether it left the client unusable. */\nfunction startStream(client, request, outcome) {\n\ttry {\n\t\tconst { sql, values } = statementFor(client, request.sql, request.params ?? []);\n\t\treturn client.queryStream(sql, values);\n\t} catch (error) {\n\t\tthrow settle(error, outcome);\n\t}\n}\n/** What a statement's result reports: the rows it changed, and, when it changed one row, the value MySQL numbered for it. MySQL reports 0 when it numbered none. */\nfunction statementStats(result) {\n\tif (typeof result !== \"object\" || result === null) return { affectedRows: 0 };\n\tconst affectedRows = \"affectedRows\" in result && typeof result.affectedRows === \"number\" ? result.affectedRows : 0;\n\tconst insertId = \"insertId\" in result ? result.insertId : void 0;\n\treturn affectedRows === 1 && (typeof insertId === \"bigint\" || typeof insertId === \"number\") && insertId > 0 ? {\n\t\taffectedRows,\n\t\tinsertId: String(insertId)\n\t} : { affectedRows };\n}\n/** The error to report for `error`, after noting in `outcome` whether it left the client unusable. */\nfunction settle(error, outcome) {\n\tif (isFatal(error)) outcome.destroy = true;\n\treturn normalizeMysqlError(error);\n}\n/**\n* Whether the package has received the end of the result, so that any rows the caller has not read are already in the stream's buffer. The package pushes the end of the stream when MySQL's last packet arrives; Node records that in `_readableState.ended`, and its public API reports the end only after the caller has read every row.\n*/\nfunction resultReceived(rows) {\n\tconst state = Reflect.get(rows, \"_readableState\");\n\treturn typeof state === \"object\" && state !== null && \"ended\" in state && state.ended === true;\n}\n/**\n* Reads and drops what is left of a stream's result. The package's `close()` stops it keeping new rows; the rows already buffered are read here with `read()`, which works whether or not the caller's iterator is still attached to the stream, so an iterator the caller abandoned cannot hold the drain up.\n*/\nasync function dropRest(rows) {\n\trows.close?.();\n\tconst drain = () => {\n\t\twhile (rows.read() !== null);\n\t};\n\trows.on(\"readable\", drain);\n\ttry {\n\t\tdrain();\n\t\tawait finished(rows);\n\t} finally {\n\t\trows.off(\"readable\", drain);\n\t}\n}\nfunction cancelNotConfirmed() {\n\treturn errorRuntime(\"DRIVER.NOT_CONNECTED\", \"A cancel on this MySQL connection could not be confirmed, so the connection can no longer be used\", {\n\t\twhy: \"The driver cancelled a stream the caller stopped early, and MySQL did not answer the KILL QUERY in time. It may still arrive and would interrupt whatever statement the connection runs then.\",\n\t\tfix: \"Release the connection, which closes it; MySQL rolls back an open transaction on it. Acquire another connection and run the work again.\"\n\t});\n}\nfunction connectionReleased() {\n\treturn errorRuntime(\"DRIVER.NOT_CONNECTED\", \"MySQL connection was released\", { fix: \"Send statements on a connection only until you release it, and await each one before release().\" });\n}\n/** The package can report an error on a stream after the caller stopped reading it, such as MySQL's for a statement the driver cancelled; the generator has already settled by then. */\nfunction ignoreAfterStop() {}\n/** MySQL's error for a statement `KILL QUERY` cancelled (`ER_QUERY_INTERRUPTED`). The package marks it fatal when it arrives in the middle of a result, but the connection stays usable. */\nfunction isQueryInterrupted(error) {\n\treturn error instanceof Error && \"errno\" in error && error.errno === 1317;\n}\nvar MysqlQueryable = class {\n\tstreams;\n\tconstructor(streams) {\n\t\tthis.streams = streams;\n\t}\n\t/** Records a stream that is open, and returns the call that records its end. */\n\tstreamOpened(_rows) {\n\t\treturn () => {};\n\t}\n\t/** Takes the client's lock, which keeps statements on it one at a time in the order sent. */\n\tlockClient(client) {\n\t\treturn acquireClientQueryLock(client);\n\t}\n\t/** Runs one statement that is not a stream, under the client's lock. */\n\trunStatement(work) {\n\t\treturn work();\n\t}\n\t/** Whether the client went back to the pool under this queryable, so it must send nothing more on it. */\n\tget handedBack() {\n\t\treturn false;\n\t}\n\tasync *query(request) {\n\t\tif (this.streams) {\n\t\t\tyield* this.#streamRows(request);\n\t\t\treturn;\n\t\t}\n\t\tconst result = await this.#runReleasing(request);\n\t\tfor (const row of Array.isArray(result) ? result : []) yield blindCast(row);\n\t}\n\tasync execute(request) {\n\t\treturn statementStats(await this.#runReleasing(request));\n\t}\n\tasync #runReleasing(request) {\n\t\tconst client = await this.acquireClient();\n\t\tconst outcome = { destroy: false };\n\t\ttry {\n\t\t\tconst releaseLock = await this.lockClient(client);\n\t\t\ttry {\n\t\t\t\treturn await this.runStatement(() => run(client, request));\n\t\t\t} finally {\n\t\t\t\treleaseLock();\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthrow settle(error, outcome);\n\t\t} finally {\n\t\t\tawait this.releaseClient(client, outcome);\n\t\t}\n\t}\n\t/**\n\t* Streams the rows of `request` as they arrive; the package pauses the socket while the caller is busy. A caller that stops reading early is handled by {@link MysqlQueryable.#stopEarly}. A fatal error, such as a lost connection, destroys the client.\n\t*/\n\tasync *#streamRows(request) {\n\t\tconst client = await this.acquireClient();\n\t\tconst outcome = { destroy: false };\n\t\tlet releaseLock;\n\t\ttry {\n\t\t\treleaseLock = await this.lockClient(client);\n\t\t} catch (error) {\n\t\t\tawait this.releaseClient(client, outcome);\n\t\t\tthrow error;\n\t\t}\n\t\ttry {\n\t\t\tconst rows = startStream(client, request, outcome);\n\t\t\trows.on(\"error\", ignoreAfterStop);\n\t\t\tconst streamClosed = this.streamOpened(rows);\n\t\t\tlet settled = false;\n\t\t\ttry {\n\t\t\t\tfor await (const row of rows.iterator({ destroyOnReturn: false })) yield blindCast(row);\n\t\t\t\tsettled = true;\n\t\t\t} catch (error) {\n\t\t\t\tsettled = true;\n\t\t\t\tthrow settle(error, outcome);\n\t\t\t} finally {\n\t\t\t\tif (!settled && !this.handedBack) await this.#stopEarly(client, rows, outcome);\n\t\t\t\tif (outcome.destroy) rows.destroy();\n\t\t\t\tstreamClosed();\n\t\t\t}\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t\tawait this.releaseClient(client, outcome);\n\t\t}\n\t}\n\t/**\n\t* Ends a stream the caller stopped reading early, and keeps the client usable. While its result is still arriving, the statement is first cancelled with `KILL QUERY`, so a large result is not downloaded only to be thrown away; MySQL does not say how many rows remain. On a held connection or in a transaction, as on a pooled one: `KILL QUERY` ends only the statement, the session survives, and in a transaction MySQL rolls back only that statement. The rest of the result is then read and dropped, MySQL's error for the cancelled statement among it. The client is never destroyed while its statement runs: the package's `destroy()` would send `KILL` itself, on a connection whose failure it does not handle.\n\t*/\n\tasync #stopEarly(client, rows, outcome) {\n\t\tconst cancel = resultReceived(rows) ? \"unsent\" : await this.cancelStatement(client.threadId);\n\t\tawait dropRest(rows).catch((error) => {\n\t\t\tif (isFatal(error) && !(cancel !== \"unsent\" && isQueryInterrupted(error))) outcome.destroy = true;\n\t\t});\n\t\tif (cancel === \"unconfirmed\") this.cancelUnconfirmed(outcome);\n\t}\n\t/**\n\t* A cancel that went out without an answer may still reach MySQL and interrupt the next statement on the client, so the client must not serve another caller. Once its rest has been read, nothing is receiving on it, so closing it sends no `KILL` of the package's own; a late `KILL QUERY` then finds no thread.\n\t*/\n\tcancelUnconfirmed(outcome) {\n\t\toutcome.destroy = true;\n\t}\n};\nfunction handedBackState() {\n\tlet refuse = () => {};\n\tconst signal = new Promise((_, reject) => {\n\t\trefuse = () => reject(connectionReleased());\n\t});\n\tsignal.catch(() => void 0);\n\tconst state = {\n\t\tdone: false,\n\t\tsignal,\n\t\trefuse: () => {\n\t\t\tstate.done = true;\n\t\t\trefuse();\n\t\t}\n\t};\n\treturn state;\n}\n/**\n* A queryable on a connection the caller holds, whose statements all run on the same session, in the order they are sent, under the client's lock. A statement sent while a stream on the connection is open waits for that stream to end; one awaited inside the stream's own loop never finishes, as on Postgres with a cursor.\n*/\nvar MysqlHeldQueryable = class extends MysqlQueryable {\n\tclient;\n\theld;\n\tholdsClient = true;\n\tget cancelStatement() {\n\t\treturn this.held.cancel;\n\t}\n\tstreamOpened(rows) {\n\t\tthis.held.streams.add(rows);\n\t\treturn () => this.held.streams.delete(rows);\n\t}\n\tget handedBack() {\n\t\treturn this.held.handedBack.done;\n\t}\n\tcancelUnconfirmed() {\n\t\tthis.held.cancelUnconfirmed = true;\n\t}\n\t/** Takes the client's lock, or fails once the connection is handed back, whether the statement was sent after that or was still waiting for the lock. A lock taken after that is given straight back. */\n\tasync lockClient(client) {\n\t\tthis.#refuseIfUnusable();\n\t\tconst locking = acquireClientQueryLock(client);\n\t\ttry {\n\t\t\tconst releaseLock = await Promise.race([locking, this.held.handedBack.signal]);\n\t\t\tif (!this.held.handedBack.done && !this.held.cancelUnconfirmed) return releaseLock;\n\t\t\treleaseLock();\n\t\t} catch {\n\t\t\tlocking.then((releaseLock) => releaseLock());\n\t\t}\n\t\tthis.#refuseIfUnusable();\n\t\tthrow connectionReleased();\n\t}\n\t/** Refuses a statement on a connection that was handed back, or whose cancel went out without an answer: a late `KILL QUERY` would interrupt it. */\n\t#refuseIfUnusable() {\n\t\tif (this.held.handedBack.done) throw connectionReleased();\n\t\tif (this.held.cancelUnconfirmed) throw cancelNotConfirmed();\n\t}\n\trunStatement(work) {\n\t\tconst running = work();\n\t\tthis.held.running.add(running);\n\t\trunning.then(() => this.held.running.delete(running), () => this.held.running.delete(running));\n\t\treturn running;\n\t}\n\tconstructor(client, held, streams) {\n\t\tsuper(streams);\n\t\tthis.client = client;\n\t\tthis.held = held;\n\t}\n\tasync acquireClient() {\n\t\tthis.#refuseIfUnusable();\n\t\treturn this.client;\n\t}\n\tasync releaseClient() {}\n\t/** Runs one of the package's transaction calls under the client's lock, taken as a statement takes it, so it keeps its place among the statements sent. */\n\tasync underLock(call) {\n\t\tconst client = await this.acquireClient();\n\t\tconst releaseLock = await this.lockClient(client);\n\t\ttry {\n\t\t\tawait this.runStatement(call);\n\t\t} catch (error) {\n\t\t\tthrow normalizeMysqlError(error);\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t}\n\t}\n};\nvar MysqlConnectionImpl = class extends MysqlHeldQueryable {\n\t#onRelease;\n\tconstructor(client, streams, cancel, onRelease) {\n\t\tsuper(client, {\n\t\t\tstreams: /* @__PURE__ */ new Set(),\n\t\t\tcancelUnconfirmed: false,\n\t\t\trunning: /* @__PURE__ */ new Set(),\n\t\t\tcancel,\n\t\t\thandedBack: handedBackState()\n\t\t}, streams);\n\t\tthis.#onRelease = onRelease;\n\t}\n\t#released() {\n\t\tconst onRelease = this.#onRelease;\n\t\tthis.#onRelease = void 0;\n\t\tonRelease?.();\n\t}\n\tasync beginTransaction() {\n\t\tawait this.underLock(() => this.client.beginTransaction());\n\t\treturn new MysqlTransactionImpl(this.client, this.held, this.streams);\n\t}\n\t/**\n\t* Returns the connection to the pool, as the Postgres driver's `release()` does. From then on the connection refuses every statement, those still waiting for its lock included, so none runs later in another caller's session. A statement that is not a stream and is already running finishes, as on Postgres. A stream still open, such as one the caller dropped, is cancelled and read to its end by the driver: the package's release sends `ROLLBACK` behind that statement and waits for it, which would otherwise never finish, where `pg`'s release does not wait on the server.\n\t*/\n\tasync release() {\n\t\tif (this.held.handedBack.done) return;\n\t\tthis.held.handedBack.refuse();\n\t\ttry {\n\t\t\tif (this.held.streams.size > 0) await this.#cancelRunning();\n\t\t\tawait this.#runningSettled();\n\t\t\tif (this.held.cancelUnconfirmed) await this.#close();\n\t\t\telse await this.client.release();\n\t\t} finally {\n\t\t\tthis.#released();\n\t\t}\n\t}\n\t/** Closes the connection instead of returning it. It refuses every statement from then on, cancels whatever still runs and waits for it to end, so the package's `destroy()` never sends a `KILL` of its own. */\n\tasync destroy(_reason) {\n\t\tif (this.held.handedBack.done) return;\n\t\tthis.held.handedBack.refuse();\n\t\ttry {\n\t\t\tif (this.held.streams.size > 0 || this.held.running.size > 0) await this.#cancelRunning();\n\t\t\tawait this.#runningSettled();\n\t\t\tawait this.#close();\n\t\t} finally {\n\t\t\tthis.#released();\n\t\t}\n\t}\n\t/** Closes the client once the `ping` queued behind anything left on it has answered, so nothing is receiving and the package's `destroy()` sends no `KILL` of its own. */\n\tasync #close() {\n\t\tawait this.client.ping().catch(() => void 0);\n\t\tthis.client.destroy();\n\t}\n\tasync #cancelRunning() {\n\t\tif (await this.held.cancel(this.client.threadId) === \"unconfirmed\") this.held.cancelUnconfirmed = true;\n\t\tawait Promise.all([...this.held.streams].map((rows) => dropRest(rows).catch(() => void 0)));\n\t}\n\tasync #runningSettled() {\n\t\tawait Promise.allSettled([...this.held.running]);\n\t}\n};\nvar MysqlTransactionImpl = class extends MysqlHeldQueryable {\n\tasync commit() {\n\t\tawait this.underLock(() => this.client.commit());\n\t}\n\tasync rollback() {\n\t\tawait this.underLock(() => this.client.rollback());\n\t}\n};\n/** How many clients the driver has handed out and not had back, a held connection or one lent to a single statement, so `close()` can wait until every one is back. */\nvar ClientsInUse = class {\n\t#count = 0;\n\t#idle = [];\n\tacquired() {\n\t\tthis.#count += 1;\n\t}\n\treleased() {\n\t\tthis.#count -= 1;\n\t\tif (this.#count === 0) for (const resolve of this.#idle.splice(0)) resolve();\n\t}\n\tnone() {\n\t\treturn this.#count === 0 ? Promise.resolve() : new Promise((resolve) => this.#idle.push(resolve));\n\t}\n};\n/** The pool reports a connection it failed to open on its `'error'` event, and again as the cause of a `getConnection` that times out; the driver reports it there. */\nfunction ignoreConnectionFailure() {}\n/**\n* The statements waiting for a connection from the pool. The pool keeps retrying a connection it cannot open, with a growing pause between attempts, and fails a waiting `getConnection` only when `connectionTimeoutMillis` ends; the package reports each failure to its `logger.error` as it happens, together with every failed statement. `pg.Pool` instead rejects a pending connect whose connection fails, at once. So the driver fails the waiting statements at once with a failure no retry can get past. It keeps no failure: a later statement waits for the pool's next attempt.\n*/\nvar WaitingForConnection = class {\n\t#fail = /* @__PURE__ */ new Set();\n\tasync race(getting) {\n\t\tlet fail = () => {};\n\t\tconst failed = new Promise((_, reject) => {\n\t\t\tfail = reject;\n\t\t});\n\t\tthis.#fail.add(fail);\n\t\ttry {\n\t\t\treturn await Promise.race([getting, failed]);\n\t\t} finally {\n\t\t\tthis.#fail.delete(fail);\n\t\t}\n\t}\n\t/** Reacts to an error the package reports: only a failure to connect, which the package marks fatal, that no retry can get past. A statement can fail with the same error number, such as 1524 for a missing authentication plugin, but not fatally. */\n\treported(error) {\n\t\tif (!isFatal(error) || !connectingCannotSucceed(error)) return;\n\t\tfor (const fail of this.#fail) fail(error);\n\t\tthis.#fail.clear();\n\t}\n};\n/** Gives a connection the pool hands over after its statement stopped waiting back to the pool. */\nfunction releaseLate(getting) {\n\tgetting.then((late) => late.release(), ignoreConnectionFailure).catch(ignoreConnectionFailure);\n}\n/**\n* The MySQL runtime driver: a `mariadb` pool. Every statement takes one round trip over the text protocol, the package writing its values into it. A query reads its whole result before the first row unless `stream` is set. The pool runs the session setup once on each physical connection, and the driver then sets the target's session settings on it; a connection goes back to the pool after each statement as it is; a broken connection is destroyed. `close()` waits for every connection and stream it has handed out before it ends the pool.\n*/\nvar MysqlDriver = class extends MysqlQueryable {\n\tfamilyId = \"sql\";\n\ttargetId = \"mysql\";\n\tholdsClient = false;\n\t#state = { kind: \"unbound\" };\n\t#inUse = new ClientsInUse();\n\t#canceller;\n\tcancelStatement = (threadId) => this.#canceller?.cancel(threadId) ?? Promise.resolve(\"unsent\");\n\t#options;\n\t#sessionSettings;\n\tconstructor(options = {}) {\n\t\tsuper(options.stream ?? false);\n\t\tthis.#options = options;\n\t\tthis.#sessionSettings = new SessionSettingsGuard(options.sessionSettings ?? {});\n\t}\n\tget state() {\n\t\treturn this.#state.kind;\n\t}\n\tasync connect(binding) {\n\t\tif (this.#state.kind === \"connected\") throw errorRuntime(\"DRIVER.ALREADY_CONNECTED\", \"MySQL driver already connected\", { fix: \"Call close() before connecting again.\" });\n\t\tconst waiting = new WaitingForConnection();\n\t\tconst pool = createPool({\n\t\t\t...mysqlPoolOptions(binding.url, this.#options.poolOptions),\n\t\t\tlogger: { error: (error) => waiting.reported(error) }\n\t\t});\n\t\tif (pool instanceof EventEmitter) pool.on(\"error\", ignoreConnectionFailure);\n\t\tthis.#state = {\n\t\t\tkind: \"connected\",\n\t\t\tpool,\n\t\t\twaiting\n\t\t};\n\t\tthis.#canceller = new Canceller(binding.url, mysqlPoolIdleTimeoutMillis(this.#options.poolOptions));\n\t}\n\tasync acquireConnection() {\n\t\treturn new MysqlConnectionImpl(await this.acquireClient(), this.streams, this.cancelStatement, () => this.#inUse.released());\n\t}\n\tasync close() {\n\t\tif (this.#state.kind !== \"connected\") return;\n\t\tconst { pool } = this.#state;\n\t\tthis.#state = { kind: \"closed\" };\n\t\tawait this.#inUse.none();\n\t\tawait this.#canceller?.close();\n\t\tthis.#canceller = void 0;\n\t\tawait pool.end();\n\t}\n\tasync acquireClient() {\n\t\tif (this.#state.kind !== \"connected\") throw notConnected(this.#state.kind === \"closed\" ? \"MySQL driver is closed\" : \"MySQL driver not connected\");\n\t\tconst { pool, waiting } = this.#state;\n\t\tthis.#inUse.acquired();\n\t\tconst getting = pool.getConnection();\n\t\tlet client;\n\t\ttry {\n\t\t\tclient = await waiting.race(getting);\n\t\t} catch (error) {\n\t\t\treleaseLate(getting);\n\t\t\tthis.#inUse.released();\n\t\t\tthrow normalizeMysqlError(error);\n\t\t}\n\t\ttry {\n\t\t\tawait this.#sessionSettings.ensure(client);\n\t\t} catch (error) {\n\t\t\tclient.destroy();\n\t\t\tthis.#inUse.released();\n\t\t\tthrow normalizeMysqlError(error);\n\t\t}\n\t\treturn client;\n\t}\n\t/**\n\t* Destroys a client only after an error the package marks fatal, or after a cancel that went out without an answer once the rest of its result was read (`cancelUnconfirmed`). The package marks an error fatal when the connection's socket is gone or can no longer be trusted, and it has then already set the connection closed and failed every command on it (`fatalError` in its `connection.js`), so no command is receiving and its `destroy()` sends no `KILL`. A statement the caller stopped early is cancelled and read to its end instead (`#stopEarly`).\n\t*/\n\tasync releaseClient(client, { destroy }) {\n\t\ttry {\n\t\t\tif (destroy) client.destroy();\n\t\t\telse await client.release();\n\t\t} finally {\n\t\t\tthis.#inUse.released();\n\t\t}\n\t}\n};\n//#endregion\n//#region src/core/runtime/runtime-driver.ts\nconst mysqlRuntimeDriverDescriptor = {\n\t...mysqlDriverDescriptorMeta,\n\tcreate(options, sessionSettings) {\n\t\treturn new MysqlDriver({\n\t\t\t...options,\n\t\t\t...ifDefined(\"sessionSettings\", sessionSettings)\n\t\t});\n\t}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AQ;EAC3B,UAAU;GACT,KAAKA,OAAO,SAAS;EACtB;CACD;AACD;AAGA,MAAM,+BAA+B;CACpC,GAAG;CACH,OAAO,SAAS,iBAAiB;EAChC,OAAO,IAAI,YAAY;GACtB,GAAG;GACH,GAAG,UAAU,mBAAmB,eAAe;EAChD,CAAC;CACF;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors-Cng94tYg-D02Eud2d.mjs","names":[],"sources":["../../../../3-targets/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-DfrC_yfG.d.mts","names":[],"sources":["../../../../3-targets/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":"marker-lock-Bwew7cAs-CZ20Y_tA.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/marker-lock-Bwew7cAs.mjs"],"sourcesContent":["import { s as mysqlError } from \"./errors-Cng94tYg.mjs\";\n//#region src/core/marker-lock.ts\n/** How long a migration runner or `db sign` waits for another one to release the marker lock. */\nconst MARKER_LOCK_TIMEOUT_SECONDS = 60;\n/** `GET_LOCK` names are global to the server, so the name carries a hash of the connection's database: two databases on one server never wait on each other. */\nconst LOCK_NAME = \"CONCAT('prisma_marker_', LEFT(SHA2(DATABASE(), 256), 50))\";\nfunction lockResult(rows) {\n\tconst value = rows[0]?.[\"acquired\"];\n\treturn value === null || value === void 0 ? void 0 : String(value);\n}\n/**\n* Takes the marker lock on the connection `driver` holds. MySQL holds a `GET_LOCK` lock for the session, not for a transaction, so the caller releases it with {@link releaseMarkerLock} on the same connection when the work it guards ends.\n*/\nasync function acquireMarkerLock(driver, timeoutSeconds = 60) {\n\tconst { rows } = await driver.query(`SELECT GET_LOCK(${LOCK_NAME}, ?) AS acquired`, [timeoutSeconds]);\n\tif (lockResult(rows) !== \"1\") throw mysqlError(\"MIGRATION.MARKER_LOCK_TIMEOUT\", `Another process held the migration marker lock for ${timeoutSeconds} seconds.`, {\n\t\twhy: \"A migration or db sign on this database is still running, and they write the contract markers one at a time.\",\n\t\tfix: \"Wait for the other process to finish, then run the command again.\",\n\t\tmeta: { timeoutSeconds }\n\t});\n}\n/** Releases the marker lock {@link acquireMarkerLock} took on this connection. */\nasync function releaseMarkerLock(driver) {\n\tawait driver.query(`SELECT RELEASE_LOCK(${LOCK_NAME}) AS released`);\n}\n/**\n* Releases the marker lock after work that failed, keeping that failure: a release that fails too is dropped. MySQL frees a session's locks when the session ends, which is the usual reason a release fails.\n*/\nasync function releaseMarkerLockAfterFailure(driver) {\n\tawait releaseMarkerLock(driver).catch(() => void 0);\n}\n/**\n* The one way MySQL holds the marker lock: takes it on the connection `driver` holds, runs `work`, and releases it on the same connection when `work` ends. A failed release is reported only when `work` succeeded; when `work` throws, or `succeeded` says its result is a failure, that outcome is what comes back.\n*/\nasync function withMarkerLock(driver, work, succeeded = () => true) {\n\tawait acquireMarkerLock(driver);\n\tlet result;\n\ttry {\n\t\tresult = await work();\n\t} catch (error) {\n\t\tawait releaseMarkerLockAfterFailure(driver);\n\t\tthrow error;\n\t}\n\tif (succeeded(result)) await releaseMarkerLock(driver);\n\telse await releaseMarkerLockAfterFailure(driver);\n\treturn result;\n}\n//#endregion\nexport { withMarkerLock as i, acquireMarkerLock as n, releaseMarkerLock as r, MARKER_LOCK_TIMEOUT_SECONDS as t };\n\n//# sourceMappingURL=marker-lock-Bwew7cAs.mjs.map"],"mappings":";;;AAGA,MAAM,8BAA8B;;AAEpC,MAAM,YAAY;AAClB,SAAS,WAAW,MAAM;CACzB,MAAM,QAAQ,KAAK,EAAE,GAAG;CACxB,OAAO,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,OAAO,KAAK;AAClE;;;;AAIA,eAAe,kBAAkB,QAAQ,iBAAiB,IAAI;CAC7D,MAAM,EAAE,SAAS,MAAM,OAAO,MAAM,mBAAmB,UAAU,mBAAmB,CAAC,cAAc,CAAC;CACpG,IAAI,WAAW,IAAI,MAAM,KAAK,MAAM,WAAW,iCAAiC,sDAAsD,eAAe,YAAY;EAChK,KAAK;EACL,KAAK;EACL,MAAM,EAAE,eAAe;CACxB,CAAC;AACF;;AAEA,eAAe,kBAAkB,QAAQ;CACxC,MAAM,OAAO,MAAM,uBAAuB,UAAU,cAAc;AACnE;;;;AAIA,eAAe,8BAA8B,QAAQ;CACpD,MAAM,kBAAkB,MAAM,CAAC,CAAC,YAAY,KAAK,CAAC;AACnD;;;;AAIA,eAAe,eAAe,QAAQ,MAAM,kBAAkB,MAAM;CACnE,MAAM,kBAAkB,MAAM;CAC9B,IAAI;CACJ,IAAI;EACH,SAAS,MAAM,KAAK;CACrB,SAAS,OAAO;EACf,MAAM,8BAA8B,MAAM;EAC1C,MAAM;CACP;CACA,IAAI,UAAU,MAAM,GAAG,MAAM,kBAAkB,MAAM;MAChD,MAAM,8BAA8B,MAAM;CAC/C,OAAO;AACR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"marker-lock-su6IxinO.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/marker-lock.d.mts"],"mappings":";;;;cAGc;;;;iBAIG,kBAAkB,QAAQ,kCAAkC,0BAA0B;;iBAEtF,kBAAkB,QAAQ,mCAAmC;;;;iBAI7D,eAAe,GAAG,QAAQ,kCAAkC,YAAY,QAAQ,IAAI,aAAa,QAAQ,gBAAgB,QAAQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"marker-read-Cf80LSbG-CUp3v1e5.mjs","names":[],"sources":["../../../../3-targets/mysql/2-adapter/dist/marker-read-Cf80LSbG.mjs"],"sourcesContent":["import { t as mysqlAdapterContractContributions } from \"./contract-contributions-ChiX6W0F.mjs\";\nimport { decodeMysqlDatetime, mysqlCodecRegistry } from \"@internal/target-mysql/codecs\";\nimport { withMarkerReadErrorHandling } from \"@internal/errors/execution\";\nimport { MARKER_TABLE_NAME } from \"@internal/target-mysql/control-tables\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { parseContractMarkerRow } from \"@internal/family-sql/verify\";\nimport { quoteIdentifier } from \"@internal/target-mysql/sql-utils\";\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\n//#region src/core/marker-read.ts\nconst MARKER_COLUMNS = \"space, core_hash, profile_hash, contract_json, canonical_version, updated_at, app_tag, meta, invariants\";\n/** Whether the connection's database has the table `name`. */\nasync function tableExists(driver, name) {\n\tconst { rows } = await driver.query(\"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = ?\", [name]);\n\treturn rows.length > 0;\n}\nfunction parseJsonColumn(column, text) {\n\tif (typeof text !== \"string\") return text;\n\ttry {\n\t\treturn JSON.parse(text);\n\t} catch (error) {\n\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\tthrow structuredError(\"CONTRACT.MARKER_ROW_CORRUPT\", `Invalid contract marker row: ${column} is not valid JSON: ${detail}`, {\n\t\t\tmeta: { detail },\n\t\t\tcause: error\n\t\t});\n\t}\n}\n/** A marker row as MySQL's text arrives, in the shape the family's marker parser reads. */\nfunction decodeMysqlMarkerRow(row) {\n\tconst canonicalVersion = row[\"canonical_version\"];\n\tconst updatedAt = row[\"updated_at\"];\n\treturn parseContractMarkerRow({\n\t\t...row,\n\t\tcanonical_version: typeof canonicalVersion === \"string\" ? Number(canonicalVersion) : canonicalVersion,\n\t\tupdated_at: typeof updatedAt === \"string\" ? decodeMysqlDatetime(updatedAt) : updatedAt,\n\t\tinvariants: parseJsonColumn(\"invariants\", row[\"invariants\"])\n\t});\n}\nasync function readMarkerRows(driver, space) {\n\tif (!await tableExists(driver, MARKER_TABLE_NAME)) return void 0;\n\tconst select = `SELECT ${MARKER_COLUMNS} FROM ${quoteIdentifier(MARKER_TABLE_NAME)}`;\n\tconst { rows } = space === void 0 ? await driver.query(select) : await driver.query(`${select} WHERE space = ?`, [space]);\n\treturn rows;\n}\n/** The marker of `space`, or whether the marker table or the space's row is missing. */\nasync function readMarkerResult(driver, space) {\n\treturn withMarkerReadErrorHandling(async () => {\n\t\tconst rows = await readMarkerRows(driver, space);\n\t\tif (rows === void 0) return { kind: \"no-table\" };\n\t\tconst [row] = rows;\n\t\treturn row === void 0 ? { kind: \"absent\" } : {\n\t\t\tkind: \"present\",\n\t\t\trecord: decodeMysqlMarkerRow(row)\n\t\t};\n\t}, {\n\t\tspace,\n\t\tmarkerLocation: MARKER_TABLE_NAME\n\t});\n}\n//#endregion\nexport { tableExists as a, readMarkerRows as i, parseJsonColumn as n, mysqlAdapterDescriptorMeta as o, readMarkerResult as r, decodeMysqlMarkerRow as t };\n\n//# sourceMappingURL=marker-read-Cf80LSbG.mjs.map"],"mappings":";;;;;;;;AAQA,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;AAGA,MAAM,iBAAiB;;AAEvB,eAAe,YAAY,QAAQ,MAAM;CACxC,MAAM,EAAE,SAAS,MAAM,OAAO,MAAM,uGAAuG,CAAC,IAAI,CAAC;CACjJ,OAAO,KAAK,SAAS;AACtB;AACA,SAAS,gBAAgB,QAAQ,MAAM;CACtC,IAAI,OAAO,SAAS,UAAU,OAAO;CACrC,IAAI;EACH,OAAO,KAAK,MAAM,IAAI;CACvB,SAAS,OAAO;EACf,MAAM,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EACpE,MAAM,gBAAgB,+BAA+B,gCAAgC,OAAO,sBAAsB,UAAU;GAC3H,MAAM,EAAE,OAAO;GACf,OAAO;EACR,CAAC;CACF;AACD;;AAEA,SAAS,qBAAqB,KAAK;CAClC,MAAM,mBAAmB,IAAI;CAC7B,MAAM,YAAY,IAAI;CACtB,OAAO,uBAAuB;EAC7B,GAAG;EACH,mBAAmB,OAAO,qBAAqB,WAAW,OAAO,gBAAgB,IAAI;EACrF,YAAY,OAAO,cAAc,WAAW,oBAAoB,SAAS,IAAI;EAC7E,YAAY,gBAAgB,cAAc,IAAI,aAAa;CAC5D,CAAC;AACF;AACA,eAAe,eAAe,QAAQ,OAAO;CAC5C,IAAI,CAAC,MAAM,YAAY,QAAA,gBAAyB,GAAG,OAAO,KAAK;CAC/D,MAAM,SAAS,UAAU,eAAe,QAAQ,gBAAgB,iBAAiB;CACjF,MAAM,EAAE,SAAS,UAAU,KAAK,IAAI,MAAM,OAAO,MAAM,MAAM,IAAI,MAAM,OAAO,MAAM,GAAG,OAAO,mBAAmB,CAAC,KAAK,CAAC;CACxH,OAAO;AACR;;AAEA,eAAe,iBAAiB,QAAQ,OAAO;CAC9C,OAAO,4BAA4B,YAAY;EAC9C,MAAM,OAAO,MAAM,eAAe,QAAQ,KAAK;EAC/C,IAAI,SAAS,KAAK,GAAG,OAAO,EAAE,MAAM,WAAW;EAC/C,MAAM,CAAC,OAAO;EACd,OAAO,QAAQ,KAAK,IAAI,EAAE,MAAM,SAAS,IAAI;GAC5C,MAAM;GACN,QAAQ,qBAAqB,GAAG;EACjC;CACD,GAAG;EACF;EACA,gBAAgB;CACjB,CAAC;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migration-DmlblTTw.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/migration.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;KAiBK,KAAK,0BAA0B;;iBAEnB,OAAO,IAAI,KAAK;;;;;;uBAMV,eAAe,cAAc,SAAS,cAAc,SAAS,aAAa,YAAY,SAAS,cAAc,SAAS,qBAAqB,UAAU,iCAAiC,OAAO;WACzM;qBACU,gBAAgB;EACnC,YAAY,QAAQ;UACZ;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;aACA;MACP;YACM,WAAW;aACV;aACA;MACP;YACM,cAAc;aACb;aACA;a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AAmB;EAC/B,QAAQ;EACR;;;cAGY,mBAAmB;WACtB,IAAI;WACJ;WACA,gBAAgB;WAChB;EACT,YAAY,IAAI;EAChB,QAAQ;EACR;EACA,+BAA+B;;KAE5B,qBAAqB,kBAAkB,gBAAgB,gBAAgB,iBAAiB,kBAAkB,gBAAgB,gBAAgB,iBAAiB,oBAAoB,qBAAqB;;;UAG/L;WACC;WACA;;;cAGG,2CAA2C,0BAA0B;;EAEjF,YAAY;aACD,gBAAgB;aAChB,MAAM;aACN;aACA;aACA,cAAc;aACd,UAAU;;MAEjB,wBAAwB,KAAK,QAAQ;EACzC,YAAY;MACR,eAAe;MACf;EACJ,iBAAiB,wBAAwB;;;;KAItC;WACM;WACA,MAAM;WACN;WACA,mBAAmB;WACnB,wBAAwB;WACxB,0BAA0B;IACjC;;;;cAIU,iCAAiC,oBAAoB,yBAAyB;;EAE1F,YAAY,SAAS;EACrB,KAAK;aACM;aACA;aACA,QAAQ;aACR,cAAc;aACd,QAAQ;aACR,qBAAqB;aACrB,qBAAqB,cAAc;aACnC;aACA,YAAY;aACZ;MACP;EACJ,eAAe,SAAS,0BAA0B,kBAAkB;;iBAErD,4BAA4B,SAAS,wBAAwB;;;iBAG7D,2BAA2B,QAAQ,2BAA2B,mBAAmB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mysql-contract-serializer-BnTKRSsN-B2O3EreV.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/mysql-contract-serializer-BnTKRSsN.mjs"],"sourcesContent":["import { o as mysqlDataTypes } from \"./data-types-DOaaPS93.mjs\";\nimport { n as mysqlCreateNamespace } from \"./mysql-database-CHl9-oSL.mjs\";\nimport { createDataTypeLookup } from \"@internal/framework-components/codec\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { SqlContractSerializerBase } from \"@internal/family-sql/ir\";\n//#region src/core/mysql-contract-serializer.ts\n/** The MySQL target's contract serializer: the SQL family's, with each namespace built as a `MysqlDatabase`. */\nvar MysqlContractSerializer = class extends SqlContractSerializerBase {\n\tconstructor() {\n\t\tsuper(/* @__PURE__ */ new Map(), [], createDataTypeLookup(mysqlDataTypes));\n\t}\n\thydrateSqlNamespaceEntry(nsId, raw) {\n\t\treturn mysqlCreateNamespace(blindCast(super.hydrateSqlNamespaceEntry(nsId, raw)));\n\t}\n\tserializeContract(contract) {\n\t\tconst { storage, ...rest } = contract;\n\t\tconst namespacesJson = {};\n\t\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) namespacesJson[nsId] = {\n\t\t\tid: ns.id,\n\t\t\tentries: this.serializeNamespaceEntries(ns.entries)\n\t\t};\n\t\treturn blindCast({\n\t\t\t...rest,\n\t\t\tstorage: {\n\t\t\t\tstorageHash: String(storage.storageHash),\n\t\t\t\tnamespaces: namespacesJson,\n\t\t\t\t...storage.types !== void 0 ? { types: this.serializeJsonObject(storage.types) } : {}\n\t\t\t}\n\t\t});\n\t}\n};\n//#endregion\nexport { MysqlContractSerializer as t };\n\n//# sourceMappingURL=mysql-contract-serializer-BnTKRSsN.mjs.map"],"mappings":";;;;;;;AAOA,IAAI,0BAA0B,cAAc,0BAA0B;CACrE,cAAc;EACb,sBAAsB,IAAI,IAAI,GAAG,CAAC,GAAG,qBAAqB,cAAc,CAAC;CAC1E;CACA,yBAAyB,MAAM,KAAK;EACnC,OAAO,qBAAqB,UAAU,MAAM,yBAAyB,MAAM,GAAG,CAAC,CAAC;CACjF;CACA,kBAAkB,UAAU;EAC3B,MAAM,EAAE,SAAS,GAAG,SAAS;EAC7B,MAAM,iBAAiB,CAAC;EACxB,KAAK,MAAM,CAAC,MAAM,OAAO,OAAO,QAAQ,QAAQ,UAAU,GAAG,eAAe,QAAQ;GACnF,IAAI,GAAG;GACP,SAAS,KAAK,0BAA0B,GAAG,OAAO;EACnD;EACA,OAAO,UAAU;GAChB,GAAG;GACH,SAAS;IACR,aAAa,OAAO,QAAQ,WAAW;IACvC,YAAY;IACZ,GAAG,QAAQ,UAAU,KAAK,IAAI,EAAE,OAAO,KAAK,oBAAoB,QAAQ,KAAK,EAAE,IAAI,CAAC;GACrF;EACD,CAAC;CACF;AACD"}
|