@prisma/orm-target-mysql 8.0.0-rc.22-dev.10 → 8.0.0-rc.22-dev.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{adapter-_WBomuTw.d.mts → adapter-Dl4Wwz1I.d.mts} +4 -2
- package/dist/adapter-Dl4Wwz1I.d.mts.map +1 -0
- package/dist/adapter.d.mts +1 -1
- package/dist/adapter.mjs +2 -2
- package/dist/adapter__adapter.d.mts +1 -1
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__control.mjs +1 -1
- package/dist/adapter__runtime.mjs +74 -10
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/{contract-contributions-B9njRJbt-ClEtrK2L.mjs → contract-contributions-ChiX6W0F-CAng98bZ.mjs} +5 -4
- package/dist/contract-contributions-ChiX6W0F-CAng98bZ.mjs.map +1 -0
- package/dist/{control-6wRZXIJ7.mjs → control-CgeXsxCR.mjs} +2 -2
- package/dist/{control-6wRZXIJ7.mjs.map → control-CgeXsxCR.mjs.map} +1 -1
- package/dist/{control-WTY7Jpxk.mjs → control-H2sjKXXS.mjs} +2 -2
- package/dist/{control-WTY7Jpxk.mjs.map → control-H2sjKXXS.mjs.map} +1 -1
- package/dist/{descriptor-meta-BurjcSiU-Cbk2L1jf.mjs → descriptor-meta-D7tc0iue-C4W7o0Av.mjs} +3 -3
- package/dist/{descriptor-meta-BurjcSiU-Cbk2L1jf.mjs.map → descriptor-meta-D7tc0iue-C4W7o0Av.mjs.map} +1 -1
- package/dist/{descriptor-meta-runtime-Bk_00UrX-BLN4Ahpj.mjs → descriptor-meta-runtime-Cur6umHo-C_4rsCGC.mjs} +7 -4
- package/dist/descriptor-meta-runtime-Cur6umHo-C_4rsCGC.mjs.map +1 -0
- package/dist/driver.mjs +1 -1
- package/dist/driver__control.mjs +1 -1
- package/dist/driver__runtime.mjs +275 -126
- package/dist/driver__runtime.mjs.map +1 -1
- package/dist/{marker-read-aEaHihYj-Cyg16yn1.mjs → marker-read-Cf80LSbG-BZaJ8Ll6.mjs} +3 -3
- package/dist/{marker-read-aEaHihYj-Cyg16yn1.mjs.map → marker-read-Cf80LSbG-BZaJ8Ll6.mjs.map} +1 -1
- package/dist/{pack-YVG-iBMQ.d.mts → pack-DXsOvRJn.d.mts} +2 -1
- package/dist/{pack-YVG-iBMQ.d.mts.map → pack-DXsOvRJn.d.mts.map} +1 -1
- package/dist/{statement-kfMRMKIt-D6cAOKys.mjs → statement-DC62oiSx-DTx1JaP7.mjs} +17 -11
- package/dist/statement-DC62oiSx-DTx1JaP7.mjs.map +1 -0
- package/dist/target.d.mts +1 -1
- package/dist/target__control.mjs +1 -1
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__runtime.mjs +1 -1
- package/dist/target__runtime.mjs.map +1 -1
- package/package.json +9 -9
- package/dist/adapter-_WBomuTw.d.mts.map +0 -1
- package/dist/contract-contributions-B9njRJbt-ClEtrK2L.mjs.map +0 -1
- package/dist/descriptor-meta-runtime-Bk_00UrX-BLN4Ahpj.mjs.map +0 -1
- package/dist/statement-kfMRMKIt-D6cAOKys.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver__runtime.mjs","names":["#streamRows","#runReleasing","#interruptAndEnd","#stopEarly","#onRelease","#released","#count","#idle","#fail","#options","#sessionSettings","#state","#interrupt","#inUse"],"sources":["../../../../3-targets/mysql/3-driver/dist/runtime.mjs"],"sourcesContent":["import { a as connectingCannotSucceed, c as isFatal, d as DEFAULT_CONNECT_TIMEOUT_MILLIS, f as mysqlConnectionOptions, l as normalizeMysqlError, m as acquireClientQueryLock, n as SessionSettingsGuard, p as mysqlPoolOptions, t as statementFor, u as mysqlDriverDescriptorMeta } from \"./statement-kfMRMKIt.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/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}\nfunction affectedRows(result) {\n\treturn typeof result === \"object\" && result !== null && \"affectedRows\" in result && typeof result.affectedRows === \"number\" ? result.affectedRows : 0;\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/** Reads and drops the rest of `rows` and settles once it has ended or failed. A caller that abandoned its loop over the stream leaves the loop's `'readable'` listener behind, which would keep the stream paused, so it is removed. */\nasync function dropRest(rows) {\n\trows.close?.();\n\trows.removeAllListeners(\"readable\");\n\trows.resume();\n\tawait finished(rows);\n}\n/** The package can report an error on a stream after the caller stopped reading it, such as the one for a connection destroyed mid-result; the generator has already settled by then. */\nfunction ignoreAfterStop() {}\n/** Waiting for a statement to end needs only that it settled; its own caller handles how. */\nfunction settledEither() {}\n/** Waits for `work` to settle, but no longer than `ms`. */\nasync function settledWithin(work, ms) {\n\tlet timer;\n\tconst elapsed = new Promise((resolve) => {\n\t\ttimer = setTimeout(resolve, ms);\n\t});\n\ttry {\n\t\tawait Promise.race([work.then(settledEither, settledEither), elapsed]);\n\t} finally {\n\t\tclearTimeout(timer);\n\t}\n}\nfunction noConnection() {}\n/** The server may have run a `KILL` whose reply was lost, so the statement may still end; the caller waits for it either way. */\nfunction killReplyLost() {}\n/**\n* Sends `KILL QUERY` for the statement running on the connection with id `threadId`, over a short-lived connection of its own, because MySQL cannot interrupt a statement from the connection that runs it. That connection waits for the reply no longer than it waits to connect. Resolves `true` once the `KILL` was sent, whatever the reply, and `false` when the connection could not be opened. Never rejects.\n*\n* The package does the same when it destroys a connection with a statement still running, but leaves a failure of its `KILL` unhandled, which ends a Node.js process. So the driver interrupts the statement itself and destroys the connection only once the statement has ended, when the package has nothing left to interrupt.\n*/\nasync function interruptStatement(options, threadId) {\n\tconst connection = await createConnection({\n\t\t...options,\n\t\t...ifDefined(\"socketTimeout\", options.connectTimeout)\n\t}).catch(noConnection);\n\tif (connection === void 0) return false;\n\tawait connection.query(\"KILL QUERY ?\", [threadId]).catch(killReplyLost);\n\tconnection.destroy();\n\treturn true;\n}\nvar MysqlQueryable = class {\n\tstreams;\n\t/** Called with each stream when it starts and with `undefined` when it ends, so a held connection can end a stream its caller abandoned. */\n\tstreamChanged(_rows) {}\n\t/** Called with each buffered statement as it starts, so a held connection can wait for it to end. */\n\tstatementRunning(_running) {}\n\tconstructor(streams) {\n\t\tthis.streams = streams;\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 { affectedRows: affectedRows(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 acquireClientQueryLock(client);\n\t\t\ttry {\n\t\t\t\tconst running = run(client, request);\n\t\t\t\tthis.statementRunning(running);\n\t\t\t\treturn await running;\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}, or by {@link MysqlQueryable.#interruptAndEnd} for a pooled client whose result is still arriving, which then gives the client back in the background. 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\tconst releaseLock = await acquireClientQueryLock(client);\n\t\tlet ending;\n\t\ttry {\n\t\t\tconst rows = startStream(client, request, outcome);\n\t\t\trows.on(\"error\", ignoreAfterStop);\n\t\t\tthis.streamChanged(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.holdsClient && !resultReceived(rows)) {\n\t\t\t\t\toutcome.destroy = true;\n\t\t\t\t\tending = this.#interruptAndEnd(client, rows);\n\t\t\t\t} else if (!settled) await this.#stopEarly(rows, outcome);\n\t\t\t\tif (outcome.destroy && ending === void 0) rows.destroy();\n\t\t\t\tthis.streamChanged(void 0);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (ending === void 0) {\n\t\t\t\treleaseLock();\n\t\t\t\tawait this.releaseClient(client, outcome);\n\t\t\t} else ending.then(() => {\n\t\t\t\treleaseLock();\n\t\t\t\treturn this.releaseClient(client, outcome);\n\t\t\t}).catch(ignoreAfterStop);\n\t\t}\n\t}\n\t/** Ends a stream the caller stopped reading early whose client survives it: a held client, whose session must survive, or a pooled one whose whole result has arrived. The rest is read and dropped. */\n\tasync #stopEarly(rows, outcome) {\n\t\tawait dropRest(rows).catch((error) => {\n\t\t\tif (isFatal(error)) outcome.destroy = true;\n\t\t});\n\t}\n\t/**\n\t* Ends a stream the caller stopped reading early on a pooled client whose result is still arriving. The client is destroyed rather than kept, so a large result is not downloaded only to be thrown away, since MySQL does not say how many rows remain; before that, its statement is interrupted and the rest of the result dropped, so the package finds nothing left to interrupt. Settles once the result has ended or the wait for it is over.\n\t*/\n\tasync #interruptAndEnd(client, rows) {\n\t\tawait this.endStatement(client, dropRest(rows).catch(ignoreAfterStop));\n\t\trows.destroy();\n\t}\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\tend;\n\tholdsClient = true;\n\tconstructor(client, held, streams, end) {\n\t\tsuper(streams);\n\t\tthis.client = client;\n\t\tthis.held = held;\n\t\tthis.end = end;\n\t}\n\tendStatement(client, ended) {\n\t\treturn this.end(client, ended);\n\t}\n\tstreamChanged(rows) {\n\t\tthis.held.stream = rows;\n\t}\n\tstatementRunning(running) {\n\t\tconst settled = running.then(settledEither, settledEither);\n\t\tthis.held.statements.add(settled);\n\t\tsettled.then(() => this.held.statements.delete(settled));\n\t}\n\tasync acquireClient() {\n\t\tthis.held.running += 1;\n\t\treturn this.client;\n\t}\n\tasync releaseClient() {\n\t\tthis.held.running -= 1;\n\t}\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\ttry {\n\t\t\tconst releaseLock = await acquireClientQueryLock(client);\n\t\t\ttry {\n\t\t\t\tawait call();\n\t\t\t} finally {\n\t\t\t\treleaseLock();\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthrow normalizeMysqlError(error);\n\t\t} finally {\n\t\t\tawait this.releaseClient();\n\t\t}\n\t}\n};\nvar MysqlConnectionImpl = class extends MysqlHeldQueryable {\n\t#onRelease;\n\tconstructor(client, streams, end, onRelease) {\n\t\tsuper(client, {\n\t\t\trunning: 0,\n\t\t\tstream: void 0,\n\t\t\tstatements: /* @__PURE__ */ new Set()\n\t\t}, streams, end);\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, this.end);\n\t}\n\t/**\n\t* Returns the connection to the pool, as the Postgres driver's `release()` does. A connection with a statement still running, such as a stream the caller dropped, is destroyed instead: the package's release sends `ROLLBACK` behind that statement and waits for it, which would never finish, where `pg`'s release does not wait on the server.\n\t*/\n\tasync release() {\n\t\tif (this.held.running > 0) return this.destroy();\n\t\ttry {\n\t\t\tawait this.client.release();\n\t\t} finally {\n\t\t\tthis.#released();\n\t\t}\n\t}\n\t/** Destroys the connection. A statement still running on it, buffered or a stream its caller abandoned, is interrupted first, and the connection destroyed once it has ended; see {@link interruptStatement}. */\n\tasync destroy(_reason) {\n\t\tif (this.held.running > 0) {\n\t\t\tconst stream = this.held.stream;\n\t\t\tconst ended = Promise.all([...stream === void 0 ? [] : [dropRest(stream).catch(ignoreAfterStop)], ...this.held.statements]);\n\t\t\tawait this.endStatement(this.client, ended);\n\t\t}\n\t\tthis.client.destroy();\n\t\tthis.#released();\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/** The options of the short-lived connection that interrupts a statement, and how long to wait for an interrupted statement to end: as long as a connection may take to open, or the default when `connectionTimeoutMillis` is 0, which the package reads as no limit. Set by `connect()` and kept through `close()`, which waits for statements still ending. */\n\t#interrupt;\n\t#inUse = new ClientsInUse();\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\tconst connectionTimeout = this.#options.poolOptions?.connectionTimeoutMillis;\n\t\tconst interruptTimeoutMs = connectionTimeout !== void 0 && connectionTimeout > 0 ? connectionTimeout : DEFAULT_CONNECT_TIMEOUT_MILLIS;\n\t\tthis.#interrupt = {\n\t\t\toptions: mysqlConnectionOptions(binding.url, { connectTimeoutMs: interruptTimeoutMs }),\n\t\t\twaitMs: interruptTimeoutMs\n\t\t};\n\t\tthis.#state = {\n\t\t\tkind: \"connected\",\n\t\t\tpool,\n\t\t\twaiting\n\t\t};\n\t}\n\t/** See {@link EndStatement}. When the `KILL` cannot be sent at all, there is no wait: the client is destroyed at once, and the package interrupts the statement itself. */\n\tasync endStatement(client, ended) {\n\t\tconst settled = ended.then(settledEither, settledEither);\n\t\tconst interrupt = this.#interrupt;\n\t\tif (interrupt === void 0 || client.threadId === null) return;\n\t\tif (await interruptStatement(interrupt.options, client.threadId)) await settledWithin(settled, interrupt.waitMs);\n\t}\n\tasync acquireConnection() {\n\t\treturn new MysqlConnectionImpl(await this.acquireClient(), this.streams, (held, ended) => this.endStatement(held, ended), () => 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 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\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}\n};\n//#endregion\nexport { mysqlRuntimeDriverDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,aAAa,SAAS;CAC9B,OAAO,aAAa,wBAAwB,SAAS,EAAE,KAAK,yFAAyF,CAAC;AACvJ;;AAEA,eAAe,IAAI,QAAQ,SAAS;CACnC,MAAM,EAAE,KAAK,WAAW,aAAa,QAAQ,QAAQ,KAAK,QAAQ,UAAU,CAAC,CAAC;CAC9E,OAAO,OAAO,MAAM,KAAK,MAAM;AAChC;;AAEA,SAAS,YAAY,QAAQ,SAAS,SAAS;CAC9C,IAAI;EACH,MAAM,EAAE,KAAK,WAAW,aAAa,QAAQ,QAAQ,KAAK,QAAQ,UAAU,CAAC,CAAC;EAC9E,OAAO,OAAO,YAAY,KAAK,MAAM;CACtC,SAAS,OAAO;EACf,MAAM,OAAO,OAAO,OAAO;CAC5B;AACD;AACA,SAAS,aAAa,QAAQ;CAC7B,OAAO,OAAO,WAAW,YAAY,WAAW,QAAQ,kBAAkB,UAAU,OAAO,OAAO,iBAAiB,WAAW,OAAO,eAAe;AACrJ;;AAEA,SAAS,OAAO,OAAO,SAAS;CAC/B,IAAI,QAAQ,KAAK,GAAG,QAAQ,UAAU;CACtC,OAAO,oBAAoB,KAAK;AACjC;;;;AAIA,SAAS,eAAe,MAAM;CAC7B,MAAM,QAAQ,QAAQ,IAAI,MAAM,gBAAgB;CAChD,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,WAAW,SAAS,MAAM,UAAU;AAC3F;;AAEA,eAAe,SAAS,MAAM;CAC7B,KAAK,QAAQ;CACb,KAAK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;EAC/B,KAAKE,OAAO,SAAS;EACrB,MAAM,UAAU,KAAK,cAAc;EACnC,IAAI;EACJ,IAAI;GACH,SAAS,MAAM,QAAQ,KAAK,OAAO;EACpC,SAAS,OAAO;GACf,YAAY,OAAO;GACnB,KAAKA,OAAO,SAAS;GACrB,MAAM,oBAAoB,KAAK;EAChC;EACA,IAAI;GACH,MAAM,KAAKH,iBAAiB,OAAO,MAAM;EAC1C,SAAS,OAAO;GACf,OAAO,QAAQ;GACf,KAAKG,OAAO,SAAS;GACrB,MAAM,oBAAoB,KAAK;EAChC;EACA,OAAO;CACR;CACA,MAAM,cAAc,QAAQ,EAAE,WAAW;EACxC,IAAI;GACH,IAAI,SAAS,OAAO,QAAQ;QACvB,MAAM,OAAO,QAAQ;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
|
+
{"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}\n};\n//#endregion\nexport { mysqlRuntimeDriverDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;AASA,MAAM,wBAAwB;AAC9B,SAAS,QAAQ,QAAQ;CACxB,IAAI;CACJ,OAAO;EACN,SAAS,IAAI,SAAS,YAAY;GACjC,QAAQ,iBAAiB,QAAQ,SAAS,GAAG,MAAM;EACpD,CAAC;EACD,aAAa,aAAa,KAAK;CAChC;AACD;;;;AAIA,IAAI,YAAY,MAAM;CACrB;CACA;CACA;CACA,2BAA2B,IAAI,QAAQ;CACvC,UAAU;CACV;CACA,YAAY,KAAK,mBAAmB;EACnC,KAAKA,OAAO;EACZ,KAAKC,qBAAqB;CAC3B;;CAEA,MAAM,OAAO,UAAU,WAAW,OAAO;EACxC,IAAI,KAAKC,WAAW,aAAa,MAAM,OAAO;EAC9C,aAAa,KAAKC,UAAU;EAC5B,MAAM,UAAU,KAAKC,eAAe,KAAKC,MAAM;EAC/C,KAAKD,cAAc;EACnB,MAAM,aAAa,MAAM;EACzB,IAAI,eAAe,KAAK,GAAG;GAC1B,KAAKE,UAAU,OAAO;GACtB,OAAO;EACR;EACA,IAAI,CAAC,WAAW,QAAQ,GAAG;GAC1B,KAAKA,UAAU,OAAO;GACtB,OAAO,WAAW,WAAW,KAAK,OAAO,UAAU,IAAI;EACxD;EACA,KAAKC,SAAS,IAAI,YAAY,KAAKC,WAAW,UAAU,I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C,SAAS,OAAO;GACf,YAAY,OAAO;GACnB,KAAKA,OAAO,SAAS;GACrB,MAAM,oBAAoB,KAAK;EAChC;EACA,IAAI;GACH,MAAM,KAAKF,iBAAiB,OAAO,MAAM;EAC1C,SAAS,OAAO;GACf,OAAO,QAAQ;GACf,KAAKE,OAAO,SAAS;GACrB,MAAM,oBAAoB,KAAK;EAChC;EACA,OAAO;CACR;;;;CAIA,MAAM,cAAc,QAAQ,EAAE,WAAW;EACxC,IAAI;GACH,IAAI,SAAS,OAAO,QAAQ;QACvB,MAAM,OAAO,QAAQ;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,11 +1,11 @@
|
|
|
1
1
|
import { n as quoteIdentifier } from "./sql-utils-Db0IQO_B-PaULnfrE.mjs";
|
|
2
2
|
import { o as mysqlCodecRegistry, r as decodeMysqlDatetime } from "./codecs-C00kjHgh.mjs";
|
|
3
3
|
import { r as MARKER_TABLE_NAME } from "./control-tables-CcQ77JE7-CxTQYoQJ.mjs";
|
|
4
|
-
import { n as mysqlAdapterContractContributions } from "./contract-contributions-
|
|
4
|
+
import { n as mysqlAdapterContractContributions } from "./contract-contributions-ChiX6W0F-CAng98bZ.mjs";
|
|
5
5
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
6
6
|
import { withMarkerReadErrorHandling } from "@prisma/orm-framework/errors/execution";
|
|
7
7
|
import { parseContractMarkerRow } from "@prisma/orm-family-sql/family/verify";
|
|
8
|
-
//#region ../../../3-targets/mysql/2-adapter/dist/marker-read-
|
|
8
|
+
//#region ../../../3-targets/mysql/2-adapter/dist/marker-read-Cf80LSbG.mjs
|
|
9
9
|
const mysqlAdapterDescriptorMeta = {
|
|
10
10
|
kind: "adapter",
|
|
11
11
|
familyId: "sql",
|
|
@@ -75,4 +75,4 @@ async function readMarkerResult(driver, space) {
|
|
|
75
75
|
//#endregion
|
|
76
76
|
export { readMarkerRows as a, readMarkerResult as i, mysqlAdapterDescriptorMeta as n, tableExists as o, parseJsonColumn as r, decodeMysqlMarkerRow as t };
|
|
77
77
|
|
|
78
|
-
//# sourceMappingURL=marker-read-
|
|
78
|
+
//# sourceMappingURL=marker-read-Cf80LSbG-BZaJ8Ll6.mjs.map
|
package/dist/{marker-read-aEaHihYj-Cyg16yn1.mjs.map → marker-read-Cf80LSbG-BZaJ8Ll6.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marker-read-
|
|
1
|
+
{"version":3,"file":"marker-read-Cf80LSbG-BZaJ8Ll6.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"}
|
|
@@ -1056,6 +1056,7 @@ declare const mysqlTargetDescriptorMetaBase: {
|
|
|
1056
1056
|
readonly dataTypes: readonly import("@prisma/orm-framework/components/codec").DataType[];
|
|
1057
1057
|
readonly sessionSettings: {
|
|
1058
1058
|
readonly time_zone: "+00:00";
|
|
1059
|
+
readonly transaction_isolation: "READ-COMMITTED";
|
|
1059
1060
|
};
|
|
1060
1061
|
readonly __codecTypes?: CodecTypes;
|
|
1061
1062
|
};
|
|
@@ -1070,4 +1071,4 @@ declare const mysqlTargetDescriptorMeta: typeof mysqlTargetDescriptorMetaBase &
|
|
|
1070
1071
|
};
|
|
1071
1072
|
//#endregion
|
|
1072
1073
|
export { mysqlTargetDescriptorMeta as t };
|
|
1073
|
-
//# sourceMappingURL=pack-
|
|
1074
|
+
//# sourceMappingURL=pack-DXsOvRJn.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack-
|
|
1
|
+
{"version":3,"file":"pack-DXsOvRJn.d.mts","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/pack.d.mts"],"mappings":";;;;;;;;;;;KAWK;UACK;WACC,MAAM;WACN;;;;;KAKN;;;UAGK;WACC;WACA,MAAM;WACN;;UAED;WACC;WACA,MAAM;WACN,UAAU,cAAc;WACxB;;KAEN,eAAe,YAAY;;;;;;;;;;cAUlB,uBAAuB;WAC1B,OAAO;WACP,MAAM;WACN;WACA;WACA,QAAQ;;WAER;EACT,YAAY,OAAO,YAAY,gBAAgB,QAAQ,YAAY;MAC/D;MACA;;EAEJ,SAAS;EACT,UAAU;;MAEN,sBAAsB;;MAEtB,sBAAsB;;MAEtB,aAAa;;MAEb,aAAa;;KAEd,gBAAgB,aAAa;cACpB;;UAEJ;SACD,QAAQ;SACR,OAAO,OAAO,cAAc;SAC5B,QAAQ,MAAM,aAAa,OAAO,cAAc;MACnD;MACA;EACJ,cAAc;EACd,eAAe;;cAEH;;WAEH,OAAO;WACP;WACA,QAAQ;;WAER;EACT,YAAY,OAAO,WAAW,gBAAgB,QAAQ,wBAAwB;EAC9E,QAAQ,gBAAgB;MACpB,QAAQ;MACR;MACA;;EAEJ,SAAS;EACT,UAAU;MACN,cAAc;MACd,aAAa;MACb,eAAe;MACf,eAAe;;MAEf,sBAAsB;;MAEtB,sBAAsB;;MAEtB,cAAc;;MAEd,aAAa;EACjB,YAAY,SAAS;EACrB,cAAc,SAAS;EACvB,QAAQ;EACR,aAAa,SAAS;;EAEtB,aAAa,GAAG,OAAO,MAAM,eAAe,gBAAgB;EAC5D,eAAe,SAAS;EACxB,UAAU,SAAS;;;;;EAKnB,cAAc,iBAAiB;;;;;;EAM/B,gBAAgB,eAAe,cAAc;;;;UAIrC;WACC;WACA;;UAED;WACC,OAAO;WACP,KAAK;;cAEF;;EAEZ,YAAY,kBAAkB;MAC1B;MACA;MACA;MACA;EACJ;EACA,gBAAg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WACA,OAAO;;UAER;WACC;WACA;WACA,WAAW;;UAEZ;WACC;WACA;WACA;;KAEN,YAAY,cAAc,sBAAsB,kBAAkB,cAAc,kBAAkB,cAAc;KAChH,aAAa;WACP;WACA,QAAQ;;WAER;WACA,QAAQ;;WAER;WACA,QAAQ;;WAER;WACA,QAAQ;;WAER;WACA,QAAQ;;WAER;;WAEA;WACA;;UAED;EACR,eAAe,MAAM,aAAa;EAClC,cAAc,MAAM,aAAa;EACjC,QAAQ,MAAM,aAAa;;;;cAIf;WACH;WACA;WACA;WACA;aACE;eACE;iBACE;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;;eAMV;iBACE;iBACA;iBACA;mBACE;mBACA;qBACE;;;;eAIN;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;mBACA;qBACE;;;;;aAKR,WAAW,SAAS,kEAAkE;aACtF,uEAAuE;;WAEzE;aACE;aACA,YAAY,8DAA8D;eACxE;eACA;iBACE;iBACA,MAAM,uBAAuB,cAAc,eAAe;iBAC1D;;;aAGJ;;aAEA;aACA,YAAY,8DAA8D;eACxE;eACA;iBACE;iBACA,MAAM,WAAW;iBACjB;;;aAGJ;;aAEA;aACA,YAAY,8DAA8D;eACxE;eACA;iBACE;iBACA,MAAM,wBAAwB,cAAc,gBAAgB;iBAC5D;;;aAGJ;;aAEA;aACA,wEAAwE;4DACzB;WACjD;aACE,yBAAyB;aACzB,gFAAgF;;WAElF;WACA;WACA;WACA;WACA;WACA;WACA,mEAAmE;WACnE;aACE;aACA;;WAEF,eAAe;;cAEZ,kCAAkC;WACrC,eAAe;WACf;aACE;eACE;eACA"}
|
|
@@ -7,7 +7,7 @@ import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
|
7
7
|
import { readFileSync } from "node:fs";
|
|
8
8
|
import { SqlConnectionError, SqlQueryError } from "@prisma/orm-family-sql/errors";
|
|
9
9
|
import { assertDefined } from "@prisma/orm-framework/utils/assertions";
|
|
10
|
-
//#region ../../../3-targets/mysql/3-driver/dist/statement-
|
|
10
|
+
//#region ../../../3-targets/mysql/3-driver/dist/statement-DC62oiSx.mjs
|
|
11
11
|
var AsyncMutex = class {
|
|
12
12
|
#queue = Promise.resolve();
|
|
13
13
|
async lock() {
|
|
@@ -35,14 +35,16 @@ function acquireClientQueryLock(client) {
|
|
|
35
35
|
}
|
|
36
36
|
return mutex.lock();
|
|
37
37
|
}
|
|
38
|
-
/**
|
|
39
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Removes the `sql_mode` entries the MySQL target does not support, `NO_BACKSLASH_ESCAPES` and `ANSI_QUOTES`, and the combination mode `ANSI`, which MySQL lists beside its parts and which would set `ANSI_QUOTES` again; no other combination mode includes either. It adds `NO_AUTO_VALUE_ON_ZERO`, so an explicit 0 in an auto-increment column is stored as 0, as Postgres stores it, rather than replaced with a generated value. Leaves no empty entry between two commas.
|
|
40
|
+
*/
|
|
41
|
+
const SET_SQL_MODE = "SET SESSION sql_mode = TRIM(LEADING ',' FROM CONCAT(REPLACE(REPLACE(REPLACE(REPLACE(CONCAT(',', @@SESSION.sql_mode, ','), ',NO_BACKSLASH_ESCAPES,', ','), ',ANSI_QUOTES,', ','), ',ANSI,', ','), ',NO_AUTO_VALUE_ON_ZERO,', ','), 'NO_AUTO_VALUE_ON_ZERO'))";
|
|
40
42
|
/** Makes MySQL read each statement, and the package write it, as utf8mb4. */
|
|
41
43
|
const SET_UTF8MB4 = "SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci";
|
|
42
44
|
/**
|
|
43
|
-
* The statements every new connection runs once, before any other. The lexer that finds placeholders reads a backslash as an escape and `"…"` as a string, so the session clears NO_BACKSLASH_ESCAPES and ANSI_QUOTES and MySQL reads quoted text the same way; and it reads each statement as utf8mb4. These hold no value, so they run through the package's `initSql`; the target's session settings, which do, are set afterwards.
|
|
45
|
+
* The statements every new connection runs once, before any other. The lexer that finds placeholders reads a backslash as an escape and `"…"` as a string, so the session clears NO_BACKSLASH_ESCAPES and ANSI_QUOTES and MySQL reads quoted text the same way, and sets NO_AUTO_VALUE_ON_ZERO; and it reads each statement as utf8mb4. These hold no value, so they run through the package's `initSql`; the target's session settings, which do, are set afterwards.
|
|
44
46
|
*/
|
|
45
|
-
const SESSION_SETUP = [
|
|
47
|
+
const SESSION_SETUP = [SET_SQL_MODE, SET_UTF8MB4];
|
|
46
48
|
/** MySQL's `binary` collation, which marks a string or blob column that holds bytes. */
|
|
47
49
|
const BINARY_COLLATION = 63;
|
|
48
50
|
/** The column types whose value is text, or bytes when the column's collation is binary. */
|
|
@@ -192,7 +194,7 @@ function connectionOptions(parsed, parameters, connectTimeoutMs) {
|
|
|
192
194
|
database: decodeURIComponent(parsed.pathname.slice(1)),
|
|
193
195
|
...ifDefined("ssl", tlsOptions(parameters)),
|
|
194
196
|
allowPublicKeyRetrieval: parameters.allowPublicKeyRetrieval ?? false,
|
|
195
|
-
connectTimeout: connectTimeoutMs ??
|
|
197
|
+
connectTimeout: connectTimeoutMs ?? DEFAULT_CONNECT_TIMEOUT_MILLIS,
|
|
196
198
|
initSql: [...SESSION_SETUP],
|
|
197
199
|
...FIXED_OPTIONS
|
|
198
200
|
};
|
|
@@ -202,17 +204,21 @@ function mysqlConnectionOptions(url, settings) {
|
|
|
202
204
|
const { parsed, parameters } = readUrl(url);
|
|
203
205
|
return connectionOptions(parsed, parameters, settings?.connectTimeoutMs);
|
|
204
206
|
}
|
|
207
|
+
/** How long a connection may stay idle before the pool, and the driver's cancel connection, close it. */
|
|
208
|
+
function mysqlPoolIdleTimeoutMillis(poolOptions) {
|
|
209
|
+
return poolOptions?.idleTimeoutMillis ?? DEFAULT_IDLE_TIMEOUT_MILLIS;
|
|
210
|
+
}
|
|
205
211
|
/**
|
|
206
212
|
* The `mariadb` pool options for a `mysql://` URL, sized and timed as the Postgres driver's `pg.Pool`: it opens a connection only when one is needed (`minimumIdle: 0`), closes one idle for `idleTimeoutMillis`, and waits `connectionTimeoutMillis` both to open a connection and for a pooled one to come free.
|
|
207
213
|
*/
|
|
208
214
|
function mysqlPoolOptions(url, poolOptions) {
|
|
209
215
|
const { parsed, parameters } = readUrl(url);
|
|
210
|
-
const timeoutMs = poolOptions?.connectionTimeoutMillis ??
|
|
216
|
+
const timeoutMs = poolOptions?.connectionTimeoutMillis ?? DEFAULT_CONNECT_TIMEOUT_MILLIS;
|
|
211
217
|
return {
|
|
212
218
|
...connectionOptions(parsed, parameters, timeoutMs),
|
|
213
219
|
acquireTimeout: timeoutMs,
|
|
214
220
|
minimumIdle: 0,
|
|
215
|
-
idleTimeout: Math.ceil((poolOptions
|
|
221
|
+
idleTimeout: Math.ceil(mysqlPoolIdleTimeoutMillis(poolOptions) / 1e3),
|
|
216
222
|
...ifDefined("connectionLimit", poolOptions?.max)
|
|
217
223
|
};
|
|
218
224
|
}
|
|
@@ -438,7 +444,7 @@ const NO_BACKSLASH_ESCAPES = 512;
|
|
|
438
444
|
function noBackslashEscapesRefusal(params) {
|
|
439
445
|
return mysqlError("RUNTIME.SQL_MODE_UNSUPPORTED", "MySQL reports NO_BACKSLASH_ESCAPES in this connection's sql_mode, which the MySQL target does not support, so the driver does not send a statement with values", {
|
|
440
446
|
why: "In this mode MySQL ends a string at a backslash and a quote, while the mariadb package, which writes the values into the statement, finds its placeholders as if the backslash escaped the quote, so a value could land outside its string literal and run as SQL. The driver removes the mode on every connection it opens, so a statement on this connection made MySQL report it: a raw SET sql_mode that set it, which stays until the connection closes or a statement clears it, or a stored procedure that set it inside itself, after which MySQL restores the mode the connection had, which may be off, but keeps reporting this one until a statement sets sql_mode again.",
|
|
441
|
-
fix: `Do not set NO_BACKSLASH_ESCAPES on a connection Prisma uses, in raw SQL, a stored procedure or a trigger. A raw SET run outside a transaction stays on whichever pooled connection ran it; restart the client to close that connection. A statement that needs the mode must run in a transaction or on a connection you hold, which must set the mode back before it is released, with ${
|
|
447
|
+
fix: `Do not set NO_BACKSLASH_ESCAPES on a connection Prisma uses, in raw SQL, a stored procedure or a trigger. A raw SET run outside a transaction stays on whichever pooled connection ran it; restart the client to close that connection. A statement that needs the mode must run in a transaction or on a connection you hold, which must set the mode back before it is released, with ${SET_SQL_MODE}. A statement without values still runs.`,
|
|
442
448
|
meta: {
|
|
443
449
|
sqlMode: "NO_BACKSLASH_ESCAPES",
|
|
444
450
|
params
|
|
@@ -478,6 +484,6 @@ function statementFor(connection, sql, params) {
|
|
|
478
484
|
};
|
|
479
485
|
}
|
|
480
486
|
//#endregion
|
|
481
|
-
export {
|
|
487
|
+
export { connectionFix as a, mysqlConnectionOptions as c, mysqlPoolOptions as d, normalizeMysqlError as f, connectingCannotSucceed as i, mysqlDriverDescriptorMeta as l, statementFor as m, acquireClientQueryLock as n, connectionLost as o, sessionSettingsStatement as p, applySessionSettings as r, isFatal as s, SessionSettingsGuard as t, mysqlPoolIdleTimeoutMillis as u };
|
|
482
488
|
|
|
483
|
-
//# sourceMappingURL=statement-
|
|
489
|
+
//# sourceMappingURL=statement-DC62oiSx-DTx1JaP7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statement-DC62oiSx-DTx1JaP7.mjs","names":["#queue","#statement","#ensured"],"sources":["../../../../3-targets/mysql/3-driver/dist/statement-DC62oiSx.mjs"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { type } from \"arktype\";\nimport { SqlConnectionError, SqlQueryError } from \"@internal/sql-errors\";\nimport { quoteIdentifier, tokenizeMysqlSql } from \"@internal/target-mysql/sql-utils\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { mysqlError } from \"@internal/target-mysql/errors\";\n//#region src/core/client-query-lock.ts\nvar AsyncMutex = class {\n\t#queue = Promise.resolve();\n\tasync lock() {\n\t\tconst previous = this.#queue;\n\t\tlet releaseLock;\n\t\tthis.#queue = new Promise((resolve) => {\n\t\t\treleaseLock = resolve;\n\t\t});\n\t\tawait previous;\n\t\treturn () => {\n\t\t\treleaseLock?.();\n\t\t\treleaseLock = void 0;\n\t\t};\n\t}\n};\n/**\n* One statement at a time on each client, in the order sent, as the Postgres driver's per-client lock runs them, on the runtime and the control driver alike. The lock is held until the statement settles, or for a stream's whole life, so a statement sent while a stream is open waits for it.\n*/\nconst clientQueryLocks = /* @__PURE__ */ new WeakMap();\nfunction acquireClientQueryLock(client) {\n\tlet mutex = clientQueryLocks.get(client);\n\tif (mutex === void 0) {\n\t\tmutex = new AsyncMutex();\n\t\tclientQueryLocks.set(client, mutex);\n\t}\n\treturn mutex.lock();\n}\n//#endregion\n//#region src/core/session-setup.ts\n/**\n* Removes the `sql_mode` entries the MySQL target does not support, `NO_BACKSLASH_ESCAPES` and `ANSI_QUOTES`, and the combination mode `ANSI`, which MySQL lists beside its parts and which would set `ANSI_QUOTES` again; no other combination mode includes either. It adds `NO_AUTO_VALUE_ON_ZERO`, so an explicit 0 in an auto-increment column is stored as 0, as Postgres stores it, rather than replaced with a generated value. Leaves no empty entry between two commas.\n*/\nconst SET_SQL_MODE = \"SET SESSION sql_mode = TRIM(LEADING ',' FROM CONCAT(REPLACE(REPLACE(REPLACE(REPLACE(CONCAT(',', @@SESSION.sql_mode, ','), ',NO_BACKSLASH_ESCAPES,', ','), ',ANSI_QUOTES,', ','), ',ANSI,', ','), ',NO_AUTO_VALUE_ON_ZERO,', ','), 'NO_AUTO_VALUE_ON_ZERO'))\";\n/** Makes MySQL read each statement, and the package write it, as utf8mb4. */\nconst SET_UTF8MB4 = \"SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci\";\n/**\n* The statements every new connection runs once, before any other. The lexer that finds placeholders reads a backslash as an escape and `\"…\"` as a string, so the session clears NO_BACKSLASH_ESCAPES and ANSI_QUOTES and MySQL reads quoted text the same way, and sets NO_AUTO_VALUE_ON_ZERO; and it reads each statement as utf8mb4. These hold no value, so they run through the package's `initSql`; the target's session settings, which do, are set afterwards.\n*/\nconst SESSION_SETUP = [SET_SQL_MODE, SET_UTF8MB4];\n//#endregion\n//#region src/core/text-or-bytes.ts\n/** MySQL's `binary` collation, which marks a string or blob column that holds bytes. */\nconst BINARY_COLLATION = 63;\n/** The column types whose value is text, or bytes when the column's collation is binary. */\nconst CHARACTER_OR_BLOB_TYPES = /* @__PURE__ */ new Set([\n\t\"VARCHAR\",\n\t\"VAR_STRING\",\n\t\"STRING\",\n\t\"TINY_BLOB\",\n\t\"MEDIUM_BLOB\",\n\t\"LONG_BLOB\",\n\t\"BLOB\"\n]);\n/** The column types whose value MySQL sends as text. A type outside this list, such as BIT, GEOMETRY or one the package has no name for, is read as bytes. */\nconst TEXT_TYPES = /* @__PURE__ */ new Set([\n\t...CHARACTER_OR_BLOB_TYPES,\n\t\"DECIMAL\",\n\t\"NEWDECIMAL\",\n\t\"FLOAT\",\n\t\"DOUBLE\",\n\t\"TINY\",\n\t\"SHORT\",\n\t\"INT\",\n\t\"INT24\",\n\t\"BIGINT\",\n\t\"YEAR\",\n\t\"DATE\",\n\t\"NEWDATE\",\n\t\"TIME\",\n\t\"TIME2\",\n\t\"DATETIME\",\n\t\"DATETIME2\",\n\t\"TIMESTAMP\",\n\t\"TIMESTAMP2\",\n\t\"JSON\",\n\t\"ENUM\",\n\t\"SET\",\n\t\"NULL\"\n]);\n/**\n* Reads each column as the row value ADR 155 sets at the driver boundary: a binary string or blob, BIT, GEOMETRY and a column of a type the package does not know as its bytes, every other column as text, and NULL as `null`. Bytes are a plain `Uint8Array`, not the package's `Buffer`.\n*/\nconst readTextOrBytes = (field) => {\n\tif (!TEXT_TYPES.has(field.type) || CHARACTER_OR_BLOB_TYPES.has(field.type) && field.collation.index === BINARY_COLLATION) {\n\t\tconst bytes = field.buffer();\n\t\treturn bytes === null ? null : new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n\t}\n\treturn field.string();\n};\n//#endregion\n//#region src/core/connection-options.ts\nconst DEFAULT_CONNECT_TIMEOUT_MILLIS = 2e4;\nconst DEFAULT_IDLE_TIMEOUT_MILLIS = 3e4;\nconst urlParameters = type({\n\t\"ssl?\": type(\"'true' | '1' | 'false' | '0'\").pipe((text) => text === \"true\" || text === \"1\"),\n\t\"sslmode?\": \"'disable' | 'prefer' | 'require' | 'verify-ca' | 'verify-full' | 'no-verify'\",\n\t\"sslcert?\": \"string > 0\",\n\t\"sslkey?\": \"string > 0\",\n\t\"sslrootcert?\": \"string > 0\",\n\t\"allowPublicKeyRetrieval?\": type(\"'true' | 'false'\").pipe((text) => text === \"true\")\n});\n/** The form each URL parameter's value must take, for the refusal of a value. */\nconst PARAMETER_FORMS = {\n\tssl: \"true, 1, false or 0\",\n\tsslmode: \"disable, prefer, require, verify-ca, verify-full or no-verify\",\n\tsslcert: \"the path of a PEM file\",\n\tsslkey: \"the path of a PEM file\",\n\tsslrootcert: \"the path of a PEM file\",\n\tallowPublicKeyRetrieval: \"true or false\"\n};\nfunction isParameterName(name) {\n\treturn Object.hasOwn(PARAMETER_FORMS, name);\n}\n/**\n* Options the URL cannot change. The package writes each value into its statement at a bare `?`; every option that would change where or how it writes one (named placeholders, an object written as `SET` entries, several statements in one) stays off, and `logParam` keeps values out of error messages. `permitRedirect` stays off, so a server cannot send the client, with its credentials, to another host, which `pg` never does. `typeCast` reads every column as text or bytes, so no column reaches a codec as a value the package parsed. `foundRows` makes an UPDATE count the rows it matched, as Postgres's row count does. The connection is utf8mb4: the driver reads each statement as utf8mb4 to find its placeholders, and MySQL must read it the same way.\n*/\nconst FIXED_OPTIONS = {\n\tcollation: \"UTF8MB4_UNICODE_CI\",\n\tmultipleStatements: false,\n\tnamedPlaceholders: false,\n\tpermitSetMultiParamEntries: false,\n\tpermitLocalInfile: false,\n\tlogParam: false,\n\tpermitRedirect: false,\n\tfoundRows: true,\n\ttypeCast: readTextOrBytes\n};\n/** Refuses the URL. `parameters` names the parameters at fault; no value from the URL goes into the error, because a URL carries the password. */\nfunction invalidBinding(reason, parameters) {\n\treturn structuredError(\"RUNTIME.BINDING_INVALID\", `MySQL connection URL: ${reason}`, { meta: {\n\t\treceived: parameters.join(\", \"),\n\t\treason\n\t} });\n}\n/** Parses `url` as the Postgres facade does, refusing it without the parser's error, which carries the whole URL. */\nfunction parseUrl(url) {\n\ttry {\n\t\treturn new URL(url);\n\t} catch {\n\t\tthrow invalidBinding(\"the URL cannot be parsed\", []);\n\t}\n}\nfunction readUrl(url) {\n\tconst parsed = parseUrl(url);\n\tif (parsed.searchParams.has(\"charset\")) throw invalidBinding(\"the driver always uses utf8mb4, because it reads each statement as utf8mb4 to find its placeholders; remove the charset parameter\", [\"charset\"]);\n\tconst names = [...new Set(parsed.searchParams.keys())].filter(isParameterName);\n\tconst parameters = urlParameters(Object.fromEntries([...parsed.searchParams].filter(([name]) => isParameterName(name))));\n\tif (parameters instanceof type.errors) {\n\t\tconst invalid = names.filter((name) => parameters.some((error) => error.path[0] === name));\n\t\tthrow invalidBinding(invalid.map((name) => `${name} must be ${PARAMETER_FORMS[name]}`).join(\"; \"), invalid);\n\t}\n\tif (parameters.sslcert !== void 0 && parameters.sslkey === void 0) throw invalidBinding(\"sslcert names the client's certificate and needs sslkey; to check the server's certificate against a CA file, as sslcert did in Prisma 7, use sslrootcert\", [\"sslcert\"]);\n\treturn {\n\t\tparsed,\n\t\tparameters\n\t};\n}\nfunction readPem(parameter, path) {\n\ttry {\n\t\treturn readFileSync(path, \"utf8\");\n\t} catch {\n\t\tthrow invalidBinding(`the file ${parameter} names cannot be read`, [parameter]);\n\t}\n}\n/**\n* The TLS settings the URL gives, read as `pg-connection-string` reads them for the Postgres driver: `ssl=true` turns TLS on and `ssl=false` off; `sslcert`, `sslkey`, `sslrootcert` or `sslmode` turn it on, with the certificate, key and CA read from the files they name. `sslmode=disable` turns it off; `no-verify` accepts any server certificate; every other mode verifies the certificate and the host name, as `verify-full` does.\n*/\nfunction tlsOptions(parameters) {\n\tconst { sslcert, sslkey, sslrootcert, sslmode } = parameters;\n\tif ([\n\t\tsslcert,\n\t\tsslkey,\n\t\tsslrootcert,\n\t\tsslmode\n\t].every((value) => value === void 0)) return parameters.ssl;\n\tif (sslmode === \"disable\") return false;\n\treturn {\n\t\t...ifDefined(\"cert\", sslcert === void 0 ? void 0 : readPem(\"sslcert\", sslcert)),\n\t\t...ifDefined(\"key\", sslkey === void 0 ? void 0 : readPem(\"sslkey\", sslkey)),\n\t\t...ifDefined(\"ca\", sslrootcert === void 0 ? void 0 : readPem(\"sslrootcert\", sslrootcert)),\n\t\t...sslmode === \"no-verify\" ? { rejectUnauthorized: false } : {}\n\t};\n}\nfunction connectionOptions(parsed, parameters, connectTimeoutMs) {\n\treturn {\n\t\thost: decodeURIComponent(parsed.hostname).replace(/^\\[(.*)\\]$/, \"$1\"),\n\t\t...ifDefined(\"port\", parsed.port === \"\" ? void 0 : Number(parsed.port)),\n\t\tuser: decodeURIComponent(parsed.username),\n\t\tpassword: decodeURIComponent(parsed.password),\n\t\tdatabase: decodeURIComponent(parsed.pathname.slice(1)),\n\t\t...ifDefined(\"ssl\", tlsOptions(parameters)),\n\t\tallowPublicKeyRetrieval: parameters.allowPublicKeyRetrieval ?? false,\n\t\tconnectTimeout: connectTimeoutMs ?? DEFAULT_CONNECT_TIMEOUT_MILLIS,\n\t\tinitSql: [...SESSION_SETUP],\n\t\t...FIXED_OPTIONS\n\t};\n}\n/** The `mariadb` options for one connection to the server a `mysql://` URL names. Ignores a URL parameter the driver does not read, as `pg` does, and refuses a charset. */\nfunction mysqlConnectionOptions(url, settings) {\n\tconst { parsed, parameters } = readUrl(url);\n\treturn connectionOptions(parsed, parameters, settings?.connectTimeoutMs);\n}\n/** How long a connection may stay idle before the pool, and the driver's cancel connection, close it. */\nfunction mysqlPoolIdleTimeoutMillis(poolOptions) {\n\treturn poolOptions?.idleTimeoutMillis ?? DEFAULT_IDLE_TIMEOUT_MILLIS;\n}\n/**\n* The `mariadb` pool options for a `mysql://` URL, sized and timed as the Postgres driver's `pg.Pool`: it opens a connection only when one is needed (`minimumIdle: 0`), closes one idle for `idleTimeoutMillis`, and waits `connectionTimeoutMillis` both to open a connection and for a pooled one to come free.\n*/\nfunction mysqlPoolOptions(url, poolOptions) {\n\tconst { parsed, parameters } = readUrl(url);\n\tconst timeoutMs = poolOptions?.connectionTimeoutMillis ?? DEFAULT_CONNECT_TIMEOUT_MILLIS;\n\treturn {\n\t\t...connectionOptions(parsed, parameters, timeoutMs),\n\t\tacquireTimeout: timeoutMs,\n\t\tminimumIdle: 0,\n\t\tidleTimeout: Math.ceil(mysqlPoolIdleTimeoutMillis(poolOptions) / 1e3),\n\t\t...ifDefined(\"connectionLimit\", poolOptions?.max)\n\t};\n}\n//#endregion\n//#region src/core/descriptor-meta.ts\nconst mysqlDriverDescriptorMeta = {\n\tkind: \"driver\",\n\tfamilyId: \"sql\",\n\ttargetId: \"mysql\",\n\tid: \"mysql\",\n\tversion: \"0.0.1\",\n\tcapabilities: {}\n};\n//#endregion\n//#region src/core/normalize-error.ts\nfunction isMariadbError(error) {\n\treturn error instanceof Error && \"errno\" in error && typeof error.errno === \"number\";\n}\n/** Whether `error` left its connection unusable: the package marks a lost socket, and a server error of SQLSTATE class 08, as fatal. */\nfunction isFatal(error) {\n\treturn error instanceof Error && \"fatal\" in error && error.fatal === true;\n}\nfunction serverMessage(error) {\n\treturn isMariadbError(error) ? error.sqlMessage ?? error.message : error.message;\n}\n/** The error a statement ends with when its connection is lost or closed under it: a `SqlConnectionError` a retry on a new connection can get past, as on Postgres. */\nfunction connectionLost(cause) {\n\treturn new SqlConnectionError(serverMessage(cause), {\n\t\tcause,\n\t\ttransient: true,\n\t\t...ifDefined(\"sqlState\", isMariadbError(cause) ? cause.sqlState ?? void 0 : void 0)\n\t});\n}\n/** Node's socket and DNS error codes, and whether a retry can succeed after each, as the Postgres driver classifies them. */\nconst NODE_CONNECTION_CODES = /* @__PURE__ */ new Map([\n\t[\"ECONNRESET\", true],\n\t[\"ETIMEDOUT\", true],\n\t[\"EPIPE\", true],\n\t[\"EAI_AGAIN\", true],\n\t[\"ECONNREFUSED\", false],\n\t[\"ENOTFOUND\", false],\n\t[\"EHOSTUNREACH\", false]\n]);\n/** Whether a retry can succeed after `error`, for a Node socket or DNS error; undefined for any other. */\nfunction nodeConnectionTransience(error) {\n\treturn error instanceof Error && \"code\" in error && typeof error.code === \"string\" ? NODE_CONNECTION_CODES.get(error.code) : void 0;\n}\nconst ER_GET_CONNECTION_TIMEOUT = 45028;\nconst ER_INITIAL_SQL_ERROR = 45030;\nconst ER_CANNOT_RETRIEVE_RSA_KEY = 45044;\n/** The errors MySQL refuses a sign-in with: access denied, access denied for a socket-authenticated account, and an authentication plugin the server has not loaded. Another attempt with the same URL fails the same way. */\nconst SIGN_IN_REFUSED = /* @__PURE__ */ new Set([\n\t1045,\n\t1698,\n\t1524\n]);\n/** Whether `error` is one another attempt to connect with the same settings cannot get past: a refused connection, an unknown or unreachable host, a refused sign-in, a sign-in that needs the server's public key, or session setup MySQL refuses. */\nfunction connectingCannotSucceed(error) {\n\tif (nodeConnectionTransience(error) === false) return true;\n\treturn isMariadbError(error) && (SIGN_IN_REFUSED.has(error.errno) || error.errno === ER_CANNOT_RETRIEVE_RSA_KEY || error.errno === ER_INITIAL_SQL_ERROR);\n}\nconst UNIQUE_VIOLATION = \"23505\";\nconst FOREIGN_KEY_VIOLATION = \"23503\";\n/** The SQLSTATE Postgres sends for each constraint MySQL reports under a shared SQLSTATE, as the SQLite driver maps its own codes, so a consumer such as `isUniqueConstraintViolation` reads them alike. */\nconst CONSTRAINT_SQLSTATES = /* @__PURE__ */ new Map([\n\t[1062, UNIQUE_VIOLATION],\n\t[1586, UNIQUE_VIOLATION],\n\t[1216, FOREIGN_KEY_VIOLATION],\n\t[1217, FOREIGN_KEY_VIOLATION],\n\t[1451, FOREIGN_KEY_VIOLATION],\n\t[1452, FOREIGN_KEY_VIOLATION],\n\t[1048, \"23502\"],\n\t[3819, \"23514\"]\n]);\nconst PUBLIC_KEY_FIX = \"Add allowPublicKeyRetrieval=true to the URL, or connect over TLS with sslmode or ssl=true in the URL. Fetching the key over plain TCP lets a machine between the client and the server pose as the server and read the password; TLS does not.\";\n/** The fix for a failed connection when the package's error names its cause, such as a sign-in that needs the server's public key. */\nfunction connectionFix(error) {\n\treturn isMariadbError(error) && error.errno === ER_CANNOT_RETRIEVE_RSA_KEY ? PUBLIC_KEY_FIX : void 0;\n}\nfunction publicKeyNeeded(error) {\n\treturn new SqlConnectionError(`MySQL sign-in needs the server's public key: the account signs in with caching_sha2_password or sha256_password over a connection without TLS. ${PUBLIC_KEY_FIX}`, {\n\t\tcause: error,\n\t\ttransient: false\n\t});\n}\nfunction poolTimedOut(error) {\n\tconst cause = error.cause;\n\tif (connectingCannotSucceed(cause)) return normalizeMysqlError(cause);\n\treturn new SqlConnectionError(cause instanceof Error ? `Timed out waiting for a pooled MySQL connection; the pool could not open one: ${serverMessage(cause)}` : \"Timed out waiting for a pooled MySQL connection; every connection in the pool was in use.\", {\n\t\tcause: error,\n\t\ttransient: true\n\t});\n}\n/**\n* An error from the `mariadb` package as the driver reports it, in the family's types as the Postgres driver reports its own: a Node socket or DNS error as a `SqlConnectionError`, transient as the Postgres driver's table says; a lost connection and a pool that gave no connection in time as a transient `SqlConnectionError`; a sign-in that needs the server's public key, and session setup that fails, as a `SqlConnectionError` that is not transient; a sign-in MySQL refuses, as Postgres's 28P01, and an error MySQL reported about a statement as `SqlQueryError` with its SQLSTATE, a constraint violation with the SQLSTATE Postgres sends; and any other error unchanged. A pool that timed out because it could not connect in a way no retry can get past reports that error.\n*/\nfunction normalizeMysqlError(error) {\n\tconst transient = nodeConnectionTransience(error);\n\tif (transient !== void 0 && error instanceof Error) return new SqlConnectionError(error.message, {\n\t\tcause: error,\n\t\ttransient\n\t});\n\tif (!isMariadbError(error)) return error;\n\tif (error.errno === ER_CANNOT_RETRIEVE_RSA_KEY) return publicKeyNeeded(error);\n\tif (error.errno === ER_INITIAL_SQL_ERROR) return new SqlConnectionError(serverMessage(error), {\n\t\tcause: error,\n\t\ttransient: false\n\t});\n\tif (isFatal(error) && !SIGN_IN_REFUSED.has(error.errno)) return connectionLost(error);\n\tif (error.errno === ER_GET_CONNECTION_TIMEOUT) return poolTimedOut(error);\n\tif (typeof error.sqlState !== \"string\") return error;\n\treturn new SqlQueryError(error.sqlMessage ?? error.message, {\n\t\tcause: error,\n\t\tsqlState: CONSTRAINT_SQLSTATES.get(error.errno) ?? error.sqlState\n\t});\n}\n//#endregion\n//#region src/core/session-settings.ts\nconst DECIMAL_INTEGER = /^-?\\d+$/;\n/** A setting's value as MySQL takes it: decimal integer text as a whole number, because MySQL refuses text for an integer variable, and any other text as it is. */\nfunction settingValue(value) {\n\treturn DECIMAL_INTEGER.test(value) ? BigInt(value) : value;\n}\n/** The one statement that sets `sessionSettings`: each name a quoted identifier, each value a parameter. Undefined when there is nothing to set. */\nfunction sessionSettingsStatement(sessionSettings) {\n\tconst entries = Object.entries(sessionSettings);\n\tif (entries.length === 0) return void 0;\n\treturn {\n\t\tsql: `SET SESSION ${entries.map(([name]) => `${quoteIdentifier(name)} = ?`).join(\", \")}`,\n\t\tvalues: entries.map(([, value]) => settingValue(value))\n\t};\n}\n/** Sets the session settings on `connection`, the package writing each value into the statement. Throws the package's error as it is. */\nasync function applySessionSettings(connection, statement) {\n\tawait connection.query(statement.sql, [...statement.values]);\n}\n/**\n* Ensures the session settings a target declares on each physical connection the runtime driver gets from its pool, once, as the Postgres driver's `SessionSettingsGuard` does for a pool it did not start the sessions of. The package hands out a new wrapper for each `getConnection`, so a connection is known by its `info`, which belongs to the physical connection.\n*/\nvar SessionSettingsGuard = class {\n\t#statement;\n\t#ensured = /* @__PURE__ */ new WeakSet();\n\tconstructor(sessionSettings) {\n\t\tthis.#statement = sessionSettingsStatement(sessionSettings);\n\t}\n\tasync ensure(connection) {\n\t\tconst key = connection.info;\n\t\tassertDefined(key, \"the package gives every connection its info when it creates it\");\n\t\tif (this.#statement === void 0 || this.#ensured.has(key)) return;\n\t\tawait applySessionSettings(connection, this.#statement);\n\t\tthis.#ensured.add(key);\n\t}\n};\n//#endregion\n//#region src/core/parameter-values.ts\nfunction unsendable(message, paramIndex, received) {\n\treturn mysqlError(\"RUNTIME.ENCODE_FAILED\", message, { meta: {\n\t\ttarget: \"mysql\",\n\t\tparamIndex,\n\t\treceived\n\t} });\n}\nconst BIGINT_MIN = -(2n ** 63n);\nconst BIGINT_MAX = 2n ** 63n - 1n;\nconst LONE_SURROGATE = /\\p{Surrogate}/u;\nfunction withinBigint(value) {\n\treturn value >= BIGINT_MIN && value <= BIGINT_MAX;\n}\nfunction receivedKind(value) {\n\tif (value instanceof Date) return \"Date\";\n\tif (Array.isArray(value)) return \"array\";\n\treturn typeof value;\n}\n/**\n* The value the `mariadb` package writes into the statement for a parameter. A finite number or a bigint goes as it is, and the package writes its digits. A non-finite number is refused, because the package would write `NaN` or `Infinity` into the SQL. A bigint must fit a signed BIGINT, so a parameter's type never depends on its value. A `Uint8Array` goes as a Buffer over the same bytes, because the package writes any other `Uint8Array` as JSON text. A `Date` is refused: the package writes it in the process's local time zone, and the MySQL codecs send dates as text. So is text with a lone UTF-16 surrogate, which the package writes as `?` or U+FFFD depending on the text's length.\n*/\nfunction bindValue(value, index) {\n\tif (value === null || value === void 0) return null;\n\tif (typeof value === \"number\") {\n\t\tif (!Number.isFinite(value)) throw unsendable(`Parameter ${index + 1} is ${value}, which MySQL cannot store`, index, String(value));\n\t\treturn value;\n\t}\n\tif (typeof value === \"bigint\") {\n\t\tif (withinBigint(value)) return value;\n\t\tthrow unsendable(`Parameter ${index + 1} is an integer outside MySQL's signed 64-bit BIGINT`, index, \"bigint\");\n\t}\n\tif (Buffer.isBuffer(value)) return value;\n\tif (value instanceof Uint8Array) return Buffer.from(value.buffer, value.byteOffset, value.byteLength);\n\tif (typeof value === \"string\") {\n\t\tif (!LONE_SURROGATE.test(value)) return value;\n\t\tthrow unsendable(`Parameter ${index + 1} is text with a lone UTF-16 surrogate, which is not a character and has no utf8mb4 form; the mariadb package would store it as ? or as U+FFFD, depending on the length of the text`, index, \"string\");\n\t}\n\tif (typeof value === \"boolean\") return value;\n\tconst received = receivedKind(value);\n\tthrow unsendable(`Parameter ${index + 1} is of type ${received}; a MySQL parameter must be text, a number, a bigint, a boolean, bytes or null, and a Date is sent as text by its codec`, index, received);\n}\n//#endregion\n//#region src/core/positional-params.ts\nfunction placeholderMismatch(placeholders, values) {\n\treturn structuredError(\"RUNTIME.PARAM_PLACEHOLDER_MISMATCH\", `The MySQL statement writes placeholders ${JSON.stringify(placeholders)} for ${values} parameter value(s); write each value as a numbered ?N, or every value as a bare ? in order, and no other placeholder.`, {\n\t\twhy: \"A placeholder that does not match a value binds a value to the wrong place in the statement, or leaves a value unbound.\",\n\t\tfix: \"Pass values into raw SQL through interpolation rather than writing a `?` in the SQL text.\",\n\t\tmeta: {\n\t\t\tplaceholders,\n\t\t\tparams: values\n\t\t}\n\t});\n}\n/** The index into `values` each placeholder takes: `?N` takes value N, and bare `?`s take the values in order. */\nfunction valueIndexes(placeholders, values) {\n\tconst texts = placeholders.map((placeholder) => placeholder.text);\n\tif (texts.every((text) => text === \"?\")) {\n\t\tif (placeholders.length !== values) throw placeholderMismatch(texts, values);\n\t\treturn placeholders.map((_, index) => index);\n\t}\n\tconst indexes = placeholders.map((placeholder) => (placeholder.number ?? 0) - 1);\n\tif (!(indexes.every((index) => index >= 0 && index < values) && new Set(indexes).size === values)) throw placeholderMismatch(texts, values);\n\treturn indexes;\n}\n/**\n* The statement with each placeholder written as MySQL's positional `?`, and its values in that order. The adapter writes numbered `?N` placeholders, a value written as often as its `?N` appears; the control plane writes bare `?`s, which take the values in order. `tokenizeMysqlSql` reads the statement as MySQL's lexer does, so a `?` inside a quoted string, a backtick identifier or a comment stays text. Refuses a statement that mixes the two forms, or whose placeholders and values do not match.\n*/\nfunction positionalParams(sql, values) {\n\tconst tokens = tokenizeMysqlSql(sql);\n\tconst indexes = valueIndexes(tokens.filter((token) => token.kind === \"placeholder\"), values.length);\n\treturn {\n\t\tsql: tokens.map((token) => token.kind === \"placeholder\" ? \"?\" : token.text).join(\"\"),\n\t\tvalues: indexes.map((index) => bindValue(values[index], index))\n\t};\n}\n//#endregion\n//#region src/core/statement.ts\n/** The server status flag MySQL sets in every reply while it reports `NO_BACKSLASH_ESCAPES` in the session's `sql_mode`. */\nconst NO_BACKSLASH_ESCAPES = 512;\nfunction noBackslashEscapesRefusal(params) {\n\treturn mysqlError(\"RUNTIME.SQL_MODE_UNSUPPORTED\", \"MySQL reports NO_BACKSLASH_ESCAPES in this connection's sql_mode, which the MySQL target does not support, so the driver does not send a statement with values\", {\n\t\twhy: \"In this mode MySQL ends a string at a backslash and a quote, while the mariadb package, which writes the values into the statement, finds its placeholders as if the backslash escaped the quote, so a value could land outside its string literal and run as SQL. The driver removes the mode on every connection it opens, so a statement on this connection made MySQL report it: a raw SET sql_mode that set it, which stays until the connection closes or a statement clears it, or a stored procedure that set it inside itself, after which MySQL restores the mode the connection had, which may be off, but keeps reporting this one until a statement sets sql_mode again.\",\n\t\tfix: `Do not set NO_BACKSLASH_ESCAPES on a connection Prisma uses, in raw SQL, a stored procedure or a trigger. A raw SET run outside a transaction stays on whichever pooled connection ran it; restart the client to close that connection. A statement that needs the mode must run in a transaction or on a connection you hold, which must set the mode back before it is released, with ${SET_SQL_MODE}. A statement without values still runs.`,\n\t\tmeta: {\n\t\t\tsqlMode: \"NO_BACKSLASH_ESCAPES\",\n\t\t\tparams\n\t\t}\n\t});\n}\n/** The character set MySQL last reported for the statements the connection sends, as the package records it: utf8mb3 and utf8mb4 both as `utf8`, told apart by their longest character. */\nfunction reportedCharacterSet(collation) {\n\tif (typeof collation === \"object\" && collation !== null && \"charset\" in collation && \"maxLength\" in collation) return collation.charset === \"utf8\" ? `utf8mb${String(collation.maxLength)}` : String(collation.charset);\n\treturn \"unknown\";\n}\nfunction characterSetRefusal(characterSet, params) {\n\treturn mysqlError(\"RUNTIME.CHARACTER_SET_UNSUPPORTED\", `The driver could not confirm that MySQL reads this connection's statements as utf8mb4: the character set the mariadb package last recorded for it is ${characterSet}. The MySQL target supports only utf8mb4, so the driver does not send a statement with values`, {\n\t\twhy: \"The mariadb package, which writes the values into the statement, encodes the statement in the character set it last recorded and finds its placeholders byte by byte. In a character set such as sjis, cp932, big5 or gbk, the second byte of some characters is a backslash, so the package can read the end of a string literal in the SQL differently from MySQL, and a value could run as SQL. The package records the character set from the server greeting and from MySQL's report of changed session variables. Two causes are known: a statement on this connection changed character_set_client, such as a raw SET NAMES; or the server does not report character_set_client in session_track_system_variables, so the package never saw the driver set utf8mb4 and still holds the default character set from the greeting.\",\n\t\tfix: `If a statement changed the character set: do not change it on a connection Prisma uses. A raw SET run outside a transaction stays on whichever pooled connection ran it; restart the client to close that connection. A statement that needs another character set must run in a transaction or on a connection you hold, which must set it back before it is released, with ${SET_UTF8MB4}. If no statement changed it: add character_set_client back to the server's session_track_system_variables, as in MySQL's default, and restart the client. A statement without values still runs.`,\n\t\tmeta: {\n\t\t\tcharacterSet,\n\t\t\tparams\n\t\t}\n\t});\n}\n/**\n* The statement to hand to `connection`: `sql` with its placeholders written as `?` and the values in their order, for the package to write in. A statement without values comes back as written with no values, so the package sends it without searching it for placeholders. Refuses a statement with values while the server last reported `NO_BACKSLASH_ESCAPES` on, or while the package's record of the character set is not utf8mb4, which a statement the application sends or a server that does not report `character_set_client` can cause. A statement without values still runs, so the setting can be put back; the driver's lexer still reads a backslash as an escape then, so at worst it refuses such a statement for a `?` it reads outside a string.\n*/\nfunction statementFor(connection, sql, params) {\n\tconst { info } = connection;\n\tassertDefined(info, \"the package gives every connection its info when it creates it\");\n\tif (params.length > 0) {\n\t\tif ((info.status & NO_BACKSLASH_ESCAPES) !== 0) throw noBackslashEscapesRefusal(params.length);\n\t\tconst characterSet = reportedCharacterSet(info.collation);\n\t\tif (characterSet !== \"utf8mb4\") throw characterSetRefusal(characterSet, params.length);\n\t}\n\tconst statement = positionalParams(sql, params);\n\treturn params.length > 0 ? statement : {\n\t\tsql,\n\t\tvalues: void 0\n\t};\n}\n//#endregion\nexport { connectingCannotSucceed as a, isFatal as c, mysqlConnectionOptions as d, mysqlPoolIdleTimeoutMillis as f, sessionSettingsStatement as i, normalizeMysqlError as l, acquireClientQueryLock as m, SessionSettingsGuard as n, connectionFix as o, mysqlPoolOptions as p, applySessionSettings as r, connectionLost as s, statementFor as t, mysqlDriverDescriptorMeta as u };\n\n//# sourceMappingURL=statement-DC62oiSx.mjs.map"],"mappings":";;;;;;;;;;AASA,IAAI,aAAa,MAAM;CACtB,SAAS,QAAQ,QAAQ;CACzB,MAAM,OAAO;EACZ,MAAM,WAAW,KAAKA;EACtB,IAAI;EACJ,KAAKA,SAAS,IAAI,SAAS,YAAY;GACtC,cAAc;EACf,CAAC;EACD,MAAM;EACN,aAAa;GACZ,cAAc;GACd,cAAc,KAAK;EACpB;CACD;AACD;;;;AAIA,MAAM,mCAAmC,IAAI,QAAQ;AACrD,SAAS,uBAAuB,QAAQ;CACvC,IAAI,QAAQ,iBAAiB,IAAI,MAAM;CACvC,IAAI,UAAU,KAAK,GAAG;EACrB,QAAQ,IAAI,WAAW;EACvB,iBAAiB,IAAI,QAAQ,KAAK;CACnC;CACA,OAAO,MAAM,KAAK;AACnB;;;;AAMA,MAAM,eAAe;;AAErB,MAAM,cAAc;;;;AAIpB,MAAM,gBAAgB,CAAC,cAAc,WAAW;;AAIhD,MAAM,mBAAmB;;AAEzB,MAAM,0CAA0C,IAAI,IAAI;CACvD;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;;AAED,MAAM,6BAA6B,IAAI,IAAI;CAC1C,GAAG;CACH;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAC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AA0B,OAAO,MAAM;EAC7F,MAAM,eAAe,qBAAqB,KAAK,SAAS;EACxD,IAAI,iBAAiB,WAAW,MAAM,oBAAoB,cAAc,OAAO,MAAM;CACtF;CACA,MAAM,YAAY,iBAAiB,KAAK,MAAM;CAC9C,OAAO,OAAO,SAAS,IAAI,YAAY;EACtC;EACA,QAAQ,KAAK;CACd;AACD"}
|
package/dist/target.d.mts
CHANGED
|
@@ -18,7 +18,7 @@ import { n as mysqlResolveDefault, r as readMysqlDefault, t as MysqlReportedDefa
|
|
|
18
18
|
import { n as mysqlQueryNotYetSupported, t as mysqlError } from "./errors-BYhjQT7y.mjs";
|
|
19
19
|
import { i as withMarkerLock, n as acquireMarkerLock, r as releaseMarkerLock, t as MARKER_LOCK_TIMEOUT_SECONDS } from "./marker-lock-su6IxinO.mjs";
|
|
20
20
|
import { C as lit, D as sql, E as rawSql, O as unique, S as fn, T as primaryKey, _ as RawSqlCall, a as CreateTableCall, b as createMysqlMigrationPlanner, c as DropIndexCall, d as MigrationCLI, f as MysqlMigration, g as MysqlPlanResult, h as MysqlOpFactoryCall, i as CreateIndexCall, l as DropTableCall, m as MysqlMigrationPlanner, n as AddForeignKeyCall, o as DropColumnCall, p as MysqlMigrationDestinationInfo, r as AddUniqueCall, s as DropForeignKeyCall, t as AddColumnCall, u as DropUniqueCall, v as TypeScriptRenderableMysqlMigration, w as placeholder, x as createMysqlMigrationRunner, y as col } from "./migration-DmlblTTw.mjs";
|
|
21
|
-
import "./pack-
|
|
21
|
+
import "./pack-DXsOvRJn.mjs";
|
|
22
22
|
import { n as MysqlRuntimeTargetInstance, t as MysqlContractSerializer } from "./runtime-Cl0BbTZq.mjs";
|
|
23
23
|
import { a as quoteLiteral, i as quoteIdentifier, n as MysqlSqlToken, o as tokenizeMysqlSql, r as escapeLiteral, t as MysqlPlaceholderToken } from "./sql-utils-BOS1c2QT.mjs";
|
|
24
24
|
export { type AdaptedMysqlCodecDescriptor, AddColumnCall, AddForeignKeyCall, AddUniqueCall, type AnyMysqlCodecDescriptor, type AnyMysqlDdlNode, CONTROL_TABLE_NAMES, CodecTypes, CreateIndexCall, CreateTableCall, DropColumnCall, DropForeignKeyCall, DropIndexCall, DropTableCall, DropUniqueCall, LEDGER_TABLE_NAME, MARKER_LOCK_TIMEOUT_SECONDS, MARKER_TABLE_NAME, MYSQL_BIGINT_CODEC_ID, MYSQL_DATETIME_CODEC_ID, MYSQL_ENUM_CODEC_ID, MYSQL_INT_CODEC_ID, MYSQL_TEXT_CODEC_ID, MysqlMigration as Migration, MigrationCLI, MysqlCodecDescriptor, type MysqlCodecDescriptorRegistry, type MysqlCodecOptions, type MysqlCodecRegistry, MysqlContractSerializer, MysqlCreateTable, MysqlDatabase, MysqlDdlNode, type MysqlDdlVisitor, type MysqlMigrationDestinationInfo, MysqlMigrationPlanner, type MysqlOpFactoryCall, type MysqlPlaceholderToken, type MysqlPlanResult, type MysqlPlanTargetDetails, type MysqlReportedDefault, type MysqlRuntimeTargetInstance, type MysqlSqlToken, RawSqlCall, SQL_CHAR_CODEC_ID, SQL_RAW_CODEC_ID, SQL_VARCHAR_CODEC_ID, TypeScriptRenderableMysqlMigration, acquireMarkerLock, assembleMysqlCodecRegistry, buildControlTableBootstrapQueries, buildMysqlCodecDescriptorRegistry, buildSignMarkerBootstrapQueries, col, createMysqlBuiltinCodecLookup, createMysqlMigrationPlanner, createMysqlMigrationRunner, createTable, decodeMysqlDatetime, encodeMysqlDatetime, escapeLiteral, fn, isMysqlCodecDescriptor, lit, mysqlBigint, mysqlChar, mysqlCharParams, mysqlCodec, mysqlCodecDescriptorRegistry, mysqlCodecRegistry, mysqlCreateNamespace, mysqlDataTypeEntries, mysqlDataTypes, mysqlDatetime, mysqlDatetimeParams, mysqlDatetimeText, mysqlEnum, mysqlEnumParams, mysqlError, mysqlInt, mysqlQueryNotYetSupported, mysqlResolveDefault, mysqlText, mysqlTextDataTypes, mysqlVarchar, mysqlVarcharParams, placeholder, primaryKey, quoteIdentifier, quoteLiteral, rawSql, readMysqlDefault, releaseMarkerLock, renderMysqlEnumType, sql, tokenizeMysqlSql, unique, withMarkerLock };
|
package/dist/target__control.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as mysqlError } from "./errors-rvH_F2Yj-BQrO_--u.mjs";
|
|
2
|
-
import { t as mysqlTargetDescriptorMeta } from "./descriptor-meta-
|
|
2
|
+
import { t as mysqlTargetDescriptorMeta } from "./descriptor-meta-D7tc0iue-C4W7o0Av.mjs";
|
|
3
3
|
import { n as MysqlDatabase, r as mysqlCreateNamespace, t as MysqlContractSerializer } from "./mysql-contract-serializer-DLv0uW_f-Cg4A43Ry.mjs";
|
|
4
4
|
import { _ as diffMysqlSchema, g as createMysqlMigrationRunner, h as createMysqlMigrationPlanner, v as mysqlContractToSchema } from "./runner-BaBQoXiU-C7ln-4b2.mjs";
|
|
5
5
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"target__control.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/control.mjs"],"sourcesContent":["import { t as mysqlError } from \"./errors-rvH_F2Yj.mjs\";\nimport { t as mysqlTargetDescriptorMeta } from \"./descriptor-meta-
|
|
1
|
+
{"version":3,"file":"target__control.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/control.mjs"],"sourcesContent":["import { t as mysqlError } from \"./errors-rvH_F2Yj.mjs\";\nimport { t as mysqlTargetDescriptorMeta } from \"./descriptor-meta-D7tc0iue.mjs\";\nimport { n as MysqlDatabase, r as mysqlCreateNamespace, t as MysqlContractSerializer } from \"./mysql-contract-serializer-DLv0uW_f.mjs\";\nimport { r as createMysqlMigrationPlanner, t as createMysqlMigrationRunner, v as diffMysqlSchema, y as mysqlContractToSchema } from \"./runner-BaBQoXiU.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { sqlTypeLookupsOf } from \"@internal/family-sql/control\";\nimport { SqlStorage } from \"@internal/sql-contract/types\";\nimport { relationalNodeEntityKind, relationalNodeGranularity } from \"@internal/sql-schema-ir/types\";\nimport { SqlSchemaVerifierBase } from \"@internal/family-sql/ir\";\n//#region src/core/migrations/mysql-schema-verifier.ts\n/** The MySQL `SchemaVerifier`. Verification runs through `diffSchema`; these hooks add nothing, as on the other SQL targets. */\nvar MysqlSchemaVerifier = class extends SqlSchemaVerifierBase {\n\tverifyCommonSqlSchema(_options) {\n\t\treturn [];\n\t}\n\tverifyTargetExtensions(_options) {\n\t\treturn [];\n\t}\n};\n//#endregion\n//#region src/core/migrations/control-target.ts\nfunction isSqlContract(contract) {\n\treturn contract === null || contract.storage instanceof SqlStorage;\n}\nconst mysqlControlTargetDescriptor = {\n\t...mysqlTargetDescriptorMeta,\n\tcontractSerializer: new MysqlContractSerializer(),\n\tschemaVerifier: new MysqlSchemaVerifier(),\n\tdiffSchema: diffMysqlSchema,\n\tclassifySubjectGranularity: relationalNodeGranularity,\n\tclassifyEntityKind: relationalNodeEntityKind,\n\tmigrations: {\n\t\tcreatePlanner(adapter) {\n\t\t\treturn createMysqlMigrationPlanner(adapter);\n\t\t},\n\t\tcreateRunner(family) {\n\t\t\treturn blindCast(createMysqlMigrationRunner(family));\n\t\t},\n\t\tcontractToSchema(contract, frameworkComponents) {\n\t\t\tif (!isSqlContract(contract)) throw mysqlError(\"CONTRACT.TARGET_MISMATCH\", \"The MySQL target received a contract that is not a SQL contract.\");\n\t\t\treturn mysqlContractToSchema(contract, sqlTypeLookupsOf(frameworkComponents));\n\t\t}\n\t},\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"mysql\"\n\t\t};\n\t},\n\tcreatePlanner(adapter) {\n\t\treturn createMysqlMigrationPlanner(adapter);\n\t},\n\tcreateRunner(family) {\n\t\treturn createMysqlMigrationRunner(family);\n\t}\n};\n//#endregion\nexport { MysqlDatabase, mysqlControlTargetDescriptor as default, mysqlCreateNamespace };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;AAWA,IAAI,sBAAsB,cAAc,sBAAsB;CAC7D,sBAAsB,UAAU;EAC/B,OAAO,CAAC;CACT;CACA,uBAAuB,UAAU;EAChC,OAAO,CAAC;CACT;AACD;AAGA,SAAS,cAAc,UAAU;CAChC,OAAO,aAAa,QAAQ,SAAS,mBAAmB;AACzD;AACA,MAAM,+BAA+B;CACpC,GAAG;CACH,oBAAoB,IAAI,wBAAwB;CAChD,gBAAgB,IAAI,oBAAoB;CACxC,YAAY;CACZ,4BAA4B;CAC5B,oBAAoB;CACpB,YAAY;EACX,cAAc,SAAS;GACtB,OAAO,4BAA4B,OAAO;EAC3C;EACA,aAAa,QAAQ;GACpB,OAAO,UAAU,2BAA2B,MAAM,CAAC;EACpD;EACA,iBAAiB,UAAU,qBAAqB;GAC/C,IAAI,CAAC,cAAc,QAAQ,GAAG,MAAM,WAAW,4BAA4B,kEAAkE;GAC7I,OAAO,sBAAsB,UAAU,iBAAiB,mBAAmB,CAAC;EAC7E;CACD;CACA,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;CACA,cAAc,SAAS;EACtB,OAAO,4BAA4B,OAAO;CAC3C;CACA,aAAa,QAAQ;EACpB,OAAO,2BAA2B,MAAM;CACzC;AACD"}
|
package/dist/target__pack.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as mysqlTargetDescriptorMeta } from "./pack-
|
|
1
|
+
import { t as mysqlTargetDescriptorMeta } from "./pack-DXsOvRJn.mjs";
|
|
2
2
|
export { mysqlTargetDescriptorMeta as default };
|
package/dist/target__pack.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as mysqlTargetDescriptorMeta } from "./descriptor-meta-
|
|
1
|
+
import { t as mysqlTargetDescriptorMeta } from "./descriptor-meta-D7tc0iue-C4W7o0Av.mjs";
|
|
2
2
|
export { mysqlTargetDescriptorMeta as default };
|
package/dist/target__runtime.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as mysqlTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-
|
|
1
|
+
import { t as mysqlTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-Cur6umHo-C_4rsCGC.mjs";
|
|
2
2
|
import { t as MysqlContractSerializer } from "./mysql-contract-serializer-DLv0uW_f-Cg4A43Ry.mjs";
|
|
3
3
|
//#region ../../../3-targets/mysql/1-target/dist/runtime.mjs
|
|
4
4
|
const mysqlRuntimeTargetDescriptor = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"target__runtime.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/runtime.mjs"],"sourcesContent":["import { t as mysqlTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-
|
|
1
|
+
{"version":3,"file":"target__runtime.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/runtime.mjs"],"sourcesContent":["import { t as mysqlTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-Cur6umHo.mjs\";\nimport { t as MysqlContractSerializer } from \"./mysql-contract-serializer-DLv0uW_f.mjs\";\n//#region src/core/runtime/runtime-target.ts\nconst mysqlRuntimeTargetDescriptor = {\n\t...mysqlTargetDescriptorMetaRuntime,\n\tcodecs: () => [],\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"mysql\"\n\t\t};\n\t}\n};\n//#endregion\nexport { MysqlContractSerializer, mysqlRuntimeTargetDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;AAGA,MAAM,+BAA+B;CACpC,GAAG;CACH,cAAc,CAAC;CACf,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-target-mysql",
|
|
3
|
-
"version": "8.0.0-rc.22-dev.
|
|
3
|
+
"version": "8.0.0-rc.22-dev.11",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@prisma/orm-family-sql": "8.0.0-rc.22-dev.
|
|
13
|
-
"@prisma/orm-framework": "8.0.0-rc.22-dev.
|
|
14
|
-
"@prisma/orm-toolchain": "8.0.0-rc.22-dev.
|
|
12
|
+
"@prisma/orm-family-sql": "8.0.0-rc.22-dev.11",
|
|
13
|
+
"@prisma/orm-framework": "8.0.0-rc.22-dev.11",
|
|
14
|
+
"@prisma/orm-toolchain": "8.0.0-rc.22-dev.11",
|
|
15
15
|
"@standard-schema/spec": "1.1.0",
|
|
16
16
|
"arktype": "^2.2.2",
|
|
17
17
|
"mariadb": "3.5.4"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@internal/adapter-mysql": "8.0.0-rc.22-dev.
|
|
21
|
-
"@internal/driver-mysql": "8.0.0-rc.22-dev.
|
|
22
|
-
"@internal/target-mysql": "8.0.0-rc.22-dev.
|
|
23
|
-
"@repo/tsconfig": "8.0.0-rc.22-dev.
|
|
24
|
-
"@repo/tsdown": "8.0.0-rc.22-dev.
|
|
20
|
+
"@internal/adapter-mysql": "8.0.0-rc.22-dev.11",
|
|
21
|
+
"@internal/driver-mysql": "8.0.0-rc.22-dev.11",
|
|
22
|
+
"@internal/target-mysql": "8.0.0-rc.22-dev.11",
|
|
23
|
+
"@repo/tsconfig": "8.0.0-rc.22-dev.11",
|
|
24
|
+
"@repo/tsdown": "8.0.0-rc.22-dev.11",
|
|
25
25
|
"tsdown": "0.22.14",
|
|
26
26
|
"typescript": "5.9.3"
|
|
27
27
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-_WBomuTw.d.mts","names":[],"sources":["../../../../3-targets/mysql/2-adapter/dist/adapter.d.mts"],"mappings":";;;cAEc,0BAA0B;WAC7B;aACE;aACA;aACA;aACA;;;;;;cAMC;WACH,cAAc;aACZ;eACE;eACA;eACA;eACA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contract-contributions-B9njRJbt-ClEtrK2L.mjs","names":[],"sources":["../../../../3-targets/mysql/2-adapter/dist/contract-contributions-B9njRJbt.mjs"],"sourcesContent":["//#region src/core/capabilities.ts\n/** What a MySQL 8.4 server does that the SQL family asks about. `RETURNING`, `LATERAL` and conflict targets are not among them. */\nconst mysqlAdapterCapabilities = Object.freeze({ sql: {\n\torderBy: true,\n\tlimit: true,\n\tforeignKeys: true,\n\tenums: true\n} });\n//#endregion\n//#region src/core/contract-contributions.ts\n/** What this adapter adds to every contract it runs: its capabilities. `prisma contract emit` reads them through the adapter's descriptor, and the TypeScript `defineContract` passes them to the contract build. */\nconst mysqlAdapterContractContributions = { capabilities: mysqlAdapterCapabilities };\n//#endregion\nexport { mysqlAdapterCapabilities as n, mysqlAdapterContractContributions as t };\n\n//# sourceMappingURL=contract-contributions-B9njRJbt.mjs.map"],"mappings":";;AAEA,MAAM,2BAA2B,OAAO,OAAO,EAAE,KAAK;CACrD,SAAS;CACT,OAAO;CACP,aAAa;CACb,OAAO;AACR,EAAE,CAAC;;AAIH,MAAM,oCAAoC,EAAE,cAAc,yBAAyB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-runtime-Bk_00UrX-BLN4Ahpj.mjs","names":[],"sources":["../../../../3-targets/mysql/1-target/dist/descriptor-meta-runtime-Bk_00UrX.mjs"],"sourcesContent":["import { i as mysqlDataTypes } from \"./data-types-Dv9gwVRV.mjs\";\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. */\nconst mysqlTargetDescriptorMetaRuntime = {\n\tkind: \"target\",\n\tfamilyId: \"sql\",\n\ttargetId: \"mysql\",\n\tid: \"mysql\",\n\tversion: \"0.0.1\",\n\tcapabilities: {},\n\tdataTypes: mysqlDataTypes,\n\tsessionSettings: { time_zone: \"+00:00\" }\n};\n//#endregion\nexport { mysqlTargetDescriptorMetaRuntime as t };\n\n//# sourceMappingURL=descriptor-meta-runtime-Bk_00UrX.mjs.map"],"mappings":";;;AAEA,MAAM,mCAAmC;CACxC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,CAAC;CACf,WAAW;CACX,iBAAiB,EAAE,WAAW,SAAS;AACxC"}
|