@prisma/query-plan-executor 6.16.2 → 6.16.3-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +125 -76
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -19658,14 +19658,14 @@ var require_pool = __commonJS({
|
|
|
19658
19658
|
* @param {Function} onError - Error callback
|
|
19659
19659
|
* @param {number} timeoutEnd - Timestamp when connection attempt should time out
|
|
19660
19660
|
*/
|
|
19661
|
-
_createPoolConnection(onSuccess,
|
|
19661
|
+
_createPoolConnection(onSuccess, onError, timeoutEnd) {
|
|
19662
19662
|
const minTimeout = timeoutEnd - Date.now();
|
|
19663
19663
|
const connectionOpts = Object.assign({}, this.opts.connOptions, {
|
|
19664
19664
|
connectTimeout: Math.max(1, Math.min(minTimeout, this.opts.connOptions.connectTimeout || Number.MAX_SAFE_INTEGER))
|
|
19665
19665
|
});
|
|
19666
19666
|
const conn = new Connection(connectionOpts);
|
|
19667
19667
|
this._connectionCreationTask = null;
|
|
19668
|
-
conn.connect().then((conn2) => this._prepareNewConnection(conn2, onSuccess,
|
|
19668
|
+
conn.connect().then((conn2) => this._prepareNewConnection(conn2, onSuccess, onError)).catch((err) => this._handleConnectionCreationError(err, onSuccess, onError, timeoutEnd));
|
|
19669
19669
|
}
|
|
19670
19670
|
/**
|
|
19671
19671
|
* Sets up a newly created connection for use in the pool
|
|
@@ -19673,10 +19673,10 @@ var require_pool = __commonJS({
|
|
|
19673
19673
|
* @param {Function} onSuccess - Success callback
|
|
19674
19674
|
* @param {Function} onError - Error callback
|
|
19675
19675
|
*/
|
|
19676
|
-
_prepareNewConnection(conn, onSuccess,
|
|
19676
|
+
_prepareNewConnection(conn, onSuccess, onError) {
|
|
19677
19677
|
if (this.#closed) {
|
|
19678
19678
|
this._cleanupConnection(conn, "pool_closed");
|
|
19679
|
-
|
|
19679
|
+
onError(
|
|
19680
19680
|
new Errors2.createFatalError(
|
|
19681
19681
|
"Cannot create new connection to pool, pool closed",
|
|
19682
19682
|
Errors2.ER_ADD_CONNECTION_CLOSED_POOL
|
|
@@ -19750,7 +19750,7 @@ var require_pool = __commonJS({
|
|
|
19750
19750
|
* @param {Function} onError - Error callback
|
|
19751
19751
|
* @param {number} timeoutEnd - Timestamp when connection attempt should time out
|
|
19752
19752
|
*/
|
|
19753
|
-
_handleConnectionCreationError(err, onSuccess,
|
|
19753
|
+
_handleConnectionCreationError(err, onSuccess, onError, timeoutEnd) {
|
|
19754
19754
|
if (err instanceof AggregateError) {
|
|
19755
19755
|
err = err.errors[0];
|
|
19756
19756
|
}
|
|
@@ -19759,11 +19759,11 @@ var require_pool = __commonJS({
|
|
|
19759
19759
|
if (isFatalError) {
|
|
19760
19760
|
err.message = err.message + this._errorMsgAddon();
|
|
19761
19761
|
this._connectionCreationTask = null;
|
|
19762
|
-
|
|
19762
|
+
onError(err);
|
|
19763
19763
|
return;
|
|
19764
19764
|
}
|
|
19765
19765
|
this._connectionCreationTask = setTimeout(
|
|
19766
|
-
() => this._createPoolConnection(onSuccess,
|
|
19766
|
+
() => this._createPoolConnection(onSuccess, onError, timeoutEnd),
|
|
19767
19767
|
Math.min(500, timeoutEnd - Date.now())
|
|
19768
19768
|
);
|
|
19769
19769
|
}
|
|
@@ -40021,19 +40021,19 @@ var require_dist2 = __commonJS({
|
|
|
40021
40021
|
function cleanup() {
|
|
40022
40022
|
signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", cleanup);
|
|
40023
40023
|
emitter.removeListener(name6, onEvent);
|
|
40024
|
-
emitter.removeListener("error",
|
|
40024
|
+
emitter.removeListener("error", onError);
|
|
40025
40025
|
}
|
|
40026
40026
|
function onEvent(...args) {
|
|
40027
40027
|
cleanup();
|
|
40028
40028
|
resolve(args);
|
|
40029
40029
|
}
|
|
40030
|
-
function
|
|
40030
|
+
function onError(err) {
|
|
40031
40031
|
cleanup();
|
|
40032
40032
|
reject(err);
|
|
40033
40033
|
}
|
|
40034
40034
|
signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", cleanup);
|
|
40035
40035
|
emitter.on(name6, onEvent);
|
|
40036
|
-
emitter.on("error",
|
|
40036
|
+
emitter.on("error", onError);
|
|
40037
40037
|
});
|
|
40038
40038
|
}
|
|
40039
40039
|
exports2.default = once;
|
|
@@ -61846,7 +61846,7 @@ var require_sender = __commonJS({
|
|
|
61846
61846
|
return await new Promise((resolve, reject) => {
|
|
61847
61847
|
const sockets = [];
|
|
61848
61848
|
let errorCount = 0;
|
|
61849
|
-
const
|
|
61849
|
+
const onError = (err) => {
|
|
61850
61850
|
errorCount++;
|
|
61851
61851
|
if (errorCount === addresses.length) {
|
|
61852
61852
|
signal.removeEventListener("abort", onAbort);
|
|
@@ -61865,7 +61865,7 @@ var require_sender = __commonJS({
|
|
|
61865
61865
|
};
|
|
61866
61866
|
const clearSockets = () => {
|
|
61867
61867
|
for (const socket of sockets) {
|
|
61868
|
-
socket.removeListener("error",
|
|
61868
|
+
socket.removeListener("error", onError);
|
|
61869
61869
|
socket.removeListener("message", onMessage);
|
|
61870
61870
|
socket.close();
|
|
61871
61871
|
}
|
|
@@ -61877,7 +61877,7 @@ var require_sender = __commonJS({
|
|
|
61877
61877
|
const udpType = addresses[j2].family === 6 ? "udp6" : "udp4";
|
|
61878
61878
|
const socket = _dgram.default.createSocket(udpType);
|
|
61879
61879
|
sockets.push(socket);
|
|
61880
|
-
socket.on("error",
|
|
61880
|
+
socket.on("error", onError);
|
|
61881
61881
|
socket.on("message", onMessage);
|
|
61882
61882
|
socket.send(request3, 0, request3.length, port, addresses[j2].address);
|
|
61883
61883
|
}
|
|
@@ -69106,12 +69106,12 @@ var require_pipeline = __commonJS({
|
|
|
69106
69106
|
const end = reading || (opts === null || opts === void 0 ? void 0 : opts.end) !== false;
|
|
69107
69107
|
const isLastStream = i2 === streams.length - 1;
|
|
69108
69108
|
if (isNodeStream(stream)) {
|
|
69109
|
-
let
|
|
69109
|
+
let onError2 = function(err) {
|
|
69110
69110
|
if (err && err.name !== "AbortError" && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
|
|
69111
69111
|
finish(err);
|
|
69112
69112
|
}
|
|
69113
69113
|
};
|
|
69114
|
-
var
|
|
69114
|
+
var onError = onError2;
|
|
69115
69115
|
if (end) {
|
|
69116
69116
|
const { destroy: destroy2, cleanup } = destroyer(stream, reading, writing);
|
|
69117
69117
|
destroys.push(destroy2);
|
|
@@ -69119,10 +69119,10 @@ var require_pipeline = __commonJS({
|
|
|
69119
69119
|
lastStreamCleanup.push(cleanup);
|
|
69120
69120
|
}
|
|
69121
69121
|
}
|
|
69122
|
-
stream.on("error",
|
|
69122
|
+
stream.on("error", onError2);
|
|
69123
69123
|
if (isReadable(stream) && isLastStream) {
|
|
69124
69124
|
lastStreamCleanup.push(() => {
|
|
69125
|
-
stream.removeListener("error",
|
|
69125
|
+
stream.removeListener("error", onError2);
|
|
69126
69126
|
});
|
|
69127
69127
|
}
|
|
69128
69128
|
}
|
|
@@ -70800,7 +70800,7 @@ var require_message_io = __commonJS({
|
|
|
70800
70800
|
};
|
|
70801
70801
|
const onSecureConnect = () => {
|
|
70802
70802
|
securePair.encrypted.removeListener("readable", onReadable);
|
|
70803
|
-
securePair.cleartext.removeListener("error",
|
|
70803
|
+
securePair.cleartext.removeListener("error", onError);
|
|
70804
70804
|
securePair.cleartext.removeListener("secureConnect", onSecureConnect);
|
|
70805
70805
|
securePair.cleartext.once("error", (err) => {
|
|
70806
70806
|
this.socket.destroy(err);
|
|
@@ -70820,9 +70820,9 @@ var require_message_io = __commonJS({
|
|
|
70820
70820
|
this.tlsNegotiationComplete = true;
|
|
70821
70821
|
resolve();
|
|
70822
70822
|
};
|
|
70823
|
-
const
|
|
70823
|
+
const onError = (err) => {
|
|
70824
70824
|
securePair.encrypted.removeListener("readable", onReadable);
|
|
70825
|
-
securePair.cleartext.removeListener("error",
|
|
70825
|
+
securePair.cleartext.removeListener("error", onError);
|
|
70826
70826
|
securePair.cleartext.removeListener("secureConnect", onSecureConnect);
|
|
70827
70827
|
securePair.cleartext.destroy();
|
|
70828
70828
|
securePair.encrypted.destroy();
|
|
@@ -70844,9 +70844,9 @@ var require_message_io = __commonJS({
|
|
|
70844
70844
|
for await (const data of response) {
|
|
70845
70845
|
securePair.encrypted.write(data);
|
|
70846
70846
|
}
|
|
70847
|
-
}).catch(
|
|
70847
|
+
}).catch(onError);
|
|
70848
70848
|
};
|
|
70849
|
-
securePair.cleartext.once("error",
|
|
70849
|
+
securePair.cleartext.once("error", onError);
|
|
70850
70850
|
securePair.cleartext.once("secureConnect", onSecureConnect);
|
|
70851
70851
|
securePair.encrypted.once("readable", onReadable);
|
|
70852
70852
|
});
|
|
@@ -87366,9 +87366,9 @@ var require_connector = __commonJS({
|
|
|
87366
87366
|
return await new Promise((resolve, reject) => {
|
|
87367
87367
|
const sockets = new Array(addresses.length);
|
|
87368
87368
|
const errors = [];
|
|
87369
|
-
function
|
|
87369
|
+
function onError(err) {
|
|
87370
87370
|
errors.push(err);
|
|
87371
|
-
this.removeListener("error",
|
|
87371
|
+
this.removeListener("error", onError);
|
|
87372
87372
|
this.removeListener("connect", onConnect);
|
|
87373
87373
|
this.destroy();
|
|
87374
87374
|
if (errors.length === addresses.length) {
|
|
@@ -87383,7 +87383,7 @@ var require_connector = __commonJS({
|
|
|
87383
87383
|
if (this === socket) {
|
|
87384
87384
|
continue;
|
|
87385
87385
|
}
|
|
87386
|
-
socket.removeListener("error",
|
|
87386
|
+
socket.removeListener("error", onError);
|
|
87387
87387
|
socket.removeListener("connect", onConnect);
|
|
87388
87388
|
socket.destroy();
|
|
87389
87389
|
}
|
|
@@ -87392,7 +87392,7 @@ var require_connector = __commonJS({
|
|
|
87392
87392
|
const onAbort = () => {
|
|
87393
87393
|
for (let j2 = 0; j2 < sockets.length; j2++) {
|
|
87394
87394
|
const socket = sockets[j2];
|
|
87395
|
-
socket.removeListener("error",
|
|
87395
|
+
socket.removeListener("error", onError);
|
|
87396
87396
|
socket.removeListener("connect", onConnect);
|
|
87397
87397
|
socket.destroy();
|
|
87398
87398
|
}
|
|
@@ -87404,7 +87404,7 @@ var require_connector = __commonJS({
|
|
|
87404
87404
|
host: addresses[i2].address,
|
|
87405
87405
|
family: addresses[i2].family
|
|
87406
87406
|
});
|
|
87407
|
-
socket.on("error",
|
|
87407
|
+
socket.on("error", onError);
|
|
87408
87408
|
socket.on("connect", onConnect);
|
|
87409
87409
|
}
|
|
87410
87410
|
signal.addEventListener("abort", onAbort, {
|
|
@@ -87427,28 +87427,28 @@ var require_connector = __commonJS({
|
|
|
87427
87427
|
family: address.family
|
|
87428
87428
|
});
|
|
87429
87429
|
const onAbort = () => {
|
|
87430
|
-
socket.removeListener("error",
|
|
87430
|
+
socket.removeListener("error", onError);
|
|
87431
87431
|
socket.removeListener("connect", onConnect);
|
|
87432
87432
|
socket.destroy();
|
|
87433
87433
|
reject(new _abortError.default());
|
|
87434
87434
|
};
|
|
87435
|
-
const
|
|
87435
|
+
const onError = (err) => {
|
|
87436
87436
|
signal.removeEventListener("abort", onAbort);
|
|
87437
|
-
socket.removeListener("error",
|
|
87437
|
+
socket.removeListener("error", onError);
|
|
87438
87438
|
socket.removeListener("connect", onConnect);
|
|
87439
87439
|
socket.destroy();
|
|
87440
87440
|
reject(err);
|
|
87441
87441
|
};
|
|
87442
87442
|
const onConnect = () => {
|
|
87443
87443
|
signal.removeEventListener("abort", onAbort);
|
|
87444
|
-
socket.removeListener("error",
|
|
87444
|
+
socket.removeListener("error", onError);
|
|
87445
87445
|
socket.removeListener("connect", onConnect);
|
|
87446
87446
|
resolve(socket);
|
|
87447
87447
|
};
|
|
87448
87448
|
signal.addEventListener("abort", onAbort, {
|
|
87449
87449
|
once: true
|
|
87450
87450
|
});
|
|
87451
|
-
socket.on("error",
|
|
87451
|
+
socket.on("error", onError);
|
|
87452
87452
|
socket.on("connect", onConnect);
|
|
87453
87453
|
});
|
|
87454
87454
|
} catch (err) {
|
|
@@ -88940,15 +88940,15 @@ var require_connection2 = __commonJS({
|
|
|
88940
88940
|
}
|
|
88941
88941
|
if (connectListener) {
|
|
88942
88942
|
const onConnect = (err) => {
|
|
88943
|
-
this.removeListener("error",
|
|
88943
|
+
this.removeListener("error", onError);
|
|
88944
88944
|
connectListener(err);
|
|
88945
88945
|
};
|
|
88946
|
-
const
|
|
88946
|
+
const onError = (err) => {
|
|
88947
88947
|
this.removeListener("connect", onConnect);
|
|
88948
88948
|
connectListener(err);
|
|
88949
88949
|
};
|
|
88950
88950
|
this.once("connect", onConnect);
|
|
88951
|
-
this.once("error",
|
|
88951
|
+
this.once("error", onError);
|
|
88952
88952
|
}
|
|
88953
88953
|
this.transitionTo(this.STATE.CONNECTING);
|
|
88954
88954
|
}
|
|
@@ -89150,28 +89150,28 @@ var require_connection2 = __commonJS({
|
|
|
89150
89150
|
};
|
|
89151
89151
|
const encryptsocket = tls.connect(encryptOptions);
|
|
89152
89152
|
const onAbort = () => {
|
|
89153
|
-
encryptsocket.removeListener("error",
|
|
89153
|
+
encryptsocket.removeListener("error", onError);
|
|
89154
89154
|
encryptsocket.removeListener("connect", onConnect);
|
|
89155
89155
|
encryptsocket.destroy();
|
|
89156
89156
|
reject(signal.reason);
|
|
89157
89157
|
};
|
|
89158
|
-
const
|
|
89158
|
+
const onError = (err) => {
|
|
89159
89159
|
signal.removeEventListener("abort", onAbort);
|
|
89160
|
-
encryptsocket.removeListener("error",
|
|
89160
|
+
encryptsocket.removeListener("error", onError);
|
|
89161
89161
|
encryptsocket.removeListener("connect", onConnect);
|
|
89162
89162
|
encryptsocket.destroy();
|
|
89163
89163
|
reject(err);
|
|
89164
89164
|
};
|
|
89165
89165
|
const onConnect = () => {
|
|
89166
89166
|
signal.removeEventListener("abort", onAbort);
|
|
89167
|
-
encryptsocket.removeListener("error",
|
|
89167
|
+
encryptsocket.removeListener("error", onError);
|
|
89168
89168
|
encryptsocket.removeListener("connect", onConnect);
|
|
89169
89169
|
resolve(encryptsocket);
|
|
89170
89170
|
};
|
|
89171
89171
|
signal.addEventListener("abort", onAbort, {
|
|
89172
89172
|
once: true
|
|
89173
89173
|
});
|
|
89174
|
-
encryptsocket.on("error",
|
|
89174
|
+
encryptsocket.on("error", onError);
|
|
89175
89175
|
encryptsocket.on("secureConnect", onConnect);
|
|
89176
89176
|
});
|
|
89177
89177
|
}
|
|
@@ -96458,7 +96458,7 @@ var require_pg_pool = __commonJS({
|
|
|
96458
96458
|
return cb(err);
|
|
96459
96459
|
}
|
|
96460
96460
|
let clientReleased = false;
|
|
96461
|
-
const
|
|
96461
|
+
const onError = (err2) => {
|
|
96462
96462
|
if (clientReleased) {
|
|
96463
96463
|
return;
|
|
96464
96464
|
}
|
|
@@ -96466,12 +96466,12 @@ var require_pg_pool = __commonJS({
|
|
|
96466
96466
|
client.release(err2);
|
|
96467
96467
|
cb(err2);
|
|
96468
96468
|
};
|
|
96469
|
-
client.once("error",
|
|
96469
|
+
client.once("error", onError);
|
|
96470
96470
|
this.log("dispatching query");
|
|
96471
96471
|
try {
|
|
96472
96472
|
client.query(text, values, (err2, res) => {
|
|
96473
96473
|
this.log("query dispatched");
|
|
96474
|
-
client.removeListener("error",
|
|
96474
|
+
client.removeListener("error", onError);
|
|
96475
96475
|
if (clientReleased) {
|
|
96476
96476
|
return;
|
|
96477
96477
|
}
|
|
@@ -106984,7 +106984,7 @@ var TransactionManager = class {
|
|
|
106984
106984
|
};
|
|
106985
106985
|
|
|
106986
106986
|
// ../../node_modules/.pnpm/hono@4.9.4/node_modules/hono/dist/compose.js
|
|
106987
|
-
var compose = (middleware,
|
|
106987
|
+
var compose = (middleware, onError, onNotFound) => {
|
|
106988
106988
|
return (context2, next) => {
|
|
106989
106989
|
let index = -1;
|
|
106990
106990
|
return dispatch(0);
|
|
@@ -107006,9 +107006,9 @@ var compose = (middleware, onError2, onNotFound) => {
|
|
|
107006
107006
|
try {
|
|
107007
107007
|
res = await handler(context2, () => dispatch(i2 + 1));
|
|
107008
107008
|
} catch (err) {
|
|
107009
|
-
if (err instanceof Error &&
|
|
107009
|
+
if (err instanceof Error && onError) {
|
|
107010
107010
|
context2.error = err;
|
|
107011
|
-
res = await
|
|
107011
|
+
res = await onError(err, context2);
|
|
107012
107012
|
isError2 = true;
|
|
107013
107013
|
} else {
|
|
107014
107014
|
throw err;
|
|
@@ -108555,7 +108555,7 @@ function isPromiseLike(value) {
|
|
|
108555
108555
|
}
|
|
108556
108556
|
|
|
108557
108557
|
// package.json
|
|
108558
|
-
var version = "6.16.
|
|
108558
|
+
var version = "6.16.3-dev.1";
|
|
108559
108559
|
|
|
108560
108560
|
// src/utils/error.ts
|
|
108561
108561
|
function extractErrorFromUnknown(value) {
|
|
@@ -108882,25 +108882,28 @@ var MariaDbQueryable = class {
|
|
|
108882
108882
|
return await this.client.query(req, values);
|
|
108883
108883
|
} catch (e2) {
|
|
108884
108884
|
const error44 = e2;
|
|
108885
|
-
onError(error44);
|
|
108885
|
+
this.onError(error44);
|
|
108886
108886
|
}
|
|
108887
108887
|
}
|
|
108888
|
+
onError(error44) {
|
|
108889
|
+
debug4("Error in performIO: %O", error44);
|
|
108890
|
+
throw new DriverAdapterError(convertDriverError(error44));
|
|
108891
|
+
}
|
|
108888
108892
|
};
|
|
108889
|
-
function onError(error44) {
|
|
108890
|
-
debug4("Error in performIO: %O", error44);
|
|
108891
|
-
throw new DriverAdapterError(convertDriverError(error44));
|
|
108892
|
-
}
|
|
108893
108893
|
var MariaDbTransaction = class extends MariaDbQueryable {
|
|
108894
|
-
constructor(conn, options) {
|
|
108894
|
+
constructor(conn, options, cleanup) {
|
|
108895
108895
|
super(conn);
|
|
108896
108896
|
this.options = options;
|
|
108897
|
+
this.cleanup = cleanup;
|
|
108897
108898
|
}
|
|
108898
108899
|
async commit() {
|
|
108899
108900
|
debug4(`[js::commit]`);
|
|
108901
|
+
this.cleanup?.();
|
|
108900
108902
|
await this.client.end();
|
|
108901
108903
|
}
|
|
108902
108904
|
async rollback() {
|
|
108903
108905
|
debug4(`[js::rollback]`);
|
|
108906
|
+
this.cleanup?.();
|
|
108904
108907
|
await this.client.end();
|
|
108905
108908
|
}
|
|
108906
108909
|
};
|
|
@@ -108925,13 +108928,17 @@ var PrismaMariaDbAdapter = class extends MariaDbQueryable {
|
|
|
108925
108928
|
};
|
|
108926
108929
|
const tag2 = "[js::startTransaction]";
|
|
108927
108930
|
debug4("%s options: %O", tag2, options);
|
|
108928
|
-
const conn = await this.client.getConnection().catch((error44) => onError(error44));
|
|
108929
|
-
|
|
108931
|
+
const conn = await this.client.getConnection().catch((error44) => this.onError(error44));
|
|
108932
|
+
const onError = (err) => {
|
|
108930
108933
|
debug4(`Error from connection: ${err.message} %O`, err);
|
|
108931
108934
|
this.options?.onConnectionError?.(err);
|
|
108932
|
-
}
|
|
108935
|
+
};
|
|
108936
|
+
conn.on("error", onError);
|
|
108937
|
+
const cleanup = () => {
|
|
108938
|
+
conn.removeListener("error", onError);
|
|
108939
|
+
};
|
|
108933
108940
|
try {
|
|
108934
|
-
const tx = new MariaDbTransaction(conn, options);
|
|
108941
|
+
const tx = new MariaDbTransaction(conn, options, cleanup);
|
|
108935
108942
|
if (isolationLevel) {
|
|
108936
108943
|
await tx.executeRaw({
|
|
108937
108944
|
sql: `SET TRANSACTION ISOLATION LEVEL ${isolationLevel}`,
|
|
@@ -108943,7 +108950,8 @@ var PrismaMariaDbAdapter = class extends MariaDbQueryable {
|
|
|
108943
108950
|
return tx;
|
|
108944
108951
|
} catch (error44) {
|
|
108945
108952
|
await conn.end();
|
|
108946
|
-
|
|
108953
|
+
cleanup();
|
|
108954
|
+
this.onError(error44);
|
|
108947
108955
|
}
|
|
108948
108956
|
}
|
|
108949
108957
|
async dispose() {
|
|
@@ -110504,13 +110512,13 @@ var PrismaPgAdapter = class extends PgQueryable {
|
|
|
110504
110512
|
const tag2 = "[js::startTransaction]";
|
|
110505
110513
|
debug6("%s options: %O", tag2, options);
|
|
110506
110514
|
const conn = await this.client.connect().catch((error44) => this.onError(error44));
|
|
110507
|
-
const
|
|
110515
|
+
const onError = (err) => {
|
|
110508
110516
|
debug6(`Error from pool connection: ${err.message} %O`, err);
|
|
110509
110517
|
this.pgOptions?.onConnectionError?.(err);
|
|
110510
110518
|
};
|
|
110511
|
-
conn.on("error",
|
|
110519
|
+
conn.on("error", onError);
|
|
110512
110520
|
const cleanup = () => {
|
|
110513
|
-
conn.removeListener("error",
|
|
110521
|
+
conn.removeListener("error", onError);
|
|
110514
110522
|
};
|
|
110515
110523
|
try {
|
|
110516
110524
|
const tx = new PgTransaction(conn, options, this.pgOptions, cleanup);
|
|
@@ -110601,24 +110609,65 @@ var PrismaPgAdapterFactory = class {
|
|
|
110601
110609
|
|
|
110602
110610
|
// src/logic/adapter.ts
|
|
110603
110611
|
function createAdapter(url2) {
|
|
110604
|
-
|
|
110605
|
-
|
|
110606
|
-
|
|
110607
|
-
});
|
|
110608
|
-
} else if (url2.startsWith("mysql://") || url2.startsWith("mariadb://")) {
|
|
110609
|
-
return new PrismaMariaDbAdapterFactory(url2);
|
|
110610
|
-
} else if (url2.startsWith("sqlserver://")) {
|
|
110611
|
-
return new PrismaMssqlAdapterFactory(url2);
|
|
110612
|
-
} else {
|
|
110613
|
-
let urlObj;
|
|
110614
|
-
try {
|
|
110615
|
-
urlObj = new URL(url2);
|
|
110616
|
-
} catch {
|
|
110617
|
-
throw new Error("Invalid database URL");
|
|
110612
|
+
for (const factory of factories) {
|
|
110613
|
+
if (factory.protocols.some((protocol) => url2.startsWith(`${protocol}://`))) {
|
|
110614
|
+
return factory.create(url2);
|
|
110618
110615
|
}
|
|
110619
|
-
throw new Error(`Unsupported protocol in database URL: ${urlObj.protocol}`);
|
|
110620
110616
|
}
|
|
110617
|
+
let urlObj;
|
|
110618
|
+
try {
|
|
110619
|
+
urlObj = new URL(url2);
|
|
110620
|
+
} catch {
|
|
110621
|
+
throw new Error("Invalid database URL");
|
|
110622
|
+
}
|
|
110623
|
+
throw new Error(`Unsupported protocol in database URL: ${urlObj.protocol}`);
|
|
110621
110624
|
}
|
|
110625
|
+
var factories = [
|
|
110626
|
+
{
|
|
110627
|
+
protocols: ["postgres", "postgresql"],
|
|
110628
|
+
create(connectionString) {
|
|
110629
|
+
const url2 = new URL(connectionString);
|
|
110630
|
+
if (["sslcert", "sslkey", "sslrootcert"].some((param) => url2.searchParams.has(param))) {
|
|
110631
|
+
throw new Error(
|
|
110632
|
+
"Unsupported parameters in connection string: uploading and using custom TLS certificates is not currently supported"
|
|
110633
|
+
);
|
|
110634
|
+
}
|
|
110635
|
+
let sslmode = url2.searchParams.get("sslmode");
|
|
110636
|
+
if (sslmode === null && url2.searchParams.get("ssl") === "true") {
|
|
110637
|
+
sslmode = "require";
|
|
110638
|
+
}
|
|
110639
|
+
const ssl = (() => {
|
|
110640
|
+
switch (sslmode) {
|
|
110641
|
+
case null:
|
|
110642
|
+
case "disable":
|
|
110643
|
+
return false;
|
|
110644
|
+
case "prefer":
|
|
110645
|
+
case "require":
|
|
110646
|
+
case "no-verify":
|
|
110647
|
+
return { rejectUnauthorized: false };
|
|
110648
|
+
case "verify-ca":
|
|
110649
|
+
case "verify-full":
|
|
110650
|
+
return true;
|
|
110651
|
+
default:
|
|
110652
|
+
throw new Error(`Unsupported sslmode: ${sslmode}`);
|
|
110653
|
+
}
|
|
110654
|
+
})();
|
|
110655
|
+
return new PrismaPgAdapterFactory({ connectionString, ssl });
|
|
110656
|
+
}
|
|
110657
|
+
},
|
|
110658
|
+
{
|
|
110659
|
+
protocols: ["mysql", "mariadb"],
|
|
110660
|
+
create(url2) {
|
|
110661
|
+
return new PrismaMariaDbAdapterFactory(url2);
|
|
110662
|
+
}
|
|
110663
|
+
},
|
|
110664
|
+
{
|
|
110665
|
+
protocols: ["sqlserver"],
|
|
110666
|
+
create(url2) {
|
|
110667
|
+
return new PrismaMssqlAdapterFactory(url2);
|
|
110668
|
+
}
|
|
110669
|
+
}
|
|
110670
|
+
];
|
|
110622
110671
|
|
|
110623
110672
|
// src/logic/resource-limits.ts
|
|
110624
110673
|
var ResourceLimitError = class extends Error {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/query-plan-executor",
|
|
3
|
-
"version": "6.16.
|
|
3
|
+
"version": "6.16.3-dev.1",
|
|
4
4
|
"description": "This package is intended for Prisma's internal use",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"temporal-polyfill": "0.3.0",
|
|
21
21
|
"vitest": "3.2.4",
|
|
22
22
|
"zod": "4.1.3",
|
|
23
|
-
"@prisma/adapter-
|
|
24
|
-
"@prisma/
|
|
25
|
-
"@prisma/
|
|
26
|
-
"@prisma/adapter-
|
|
27
|
-
"@prisma/
|
|
23
|
+
"@prisma/adapter-mariadb": "6.16.3-dev.1",
|
|
24
|
+
"@prisma/client-engine-runtime": "6.16.3-dev.1",
|
|
25
|
+
"@prisma/driver-adapter-utils": "6.16.3-dev.1",
|
|
26
|
+
"@prisma/adapter-pg": "6.16.3-dev.1",
|
|
27
|
+
"@prisma/adapter-mssql": "6.16.3-dev.1"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"dist"
|