@prisma/query-plan-executor 6.18.0-dev.1 → 6.18.0-dev.10
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.d.ts +14 -2
- package/dist/index.js +35 -12
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -255,6 +255,11 @@ declare type ConnectionInfo = {
|
|
|
255
255
|
supportsRelationJoins: boolean;
|
|
256
256
|
};
|
|
257
257
|
|
|
258
|
+
/**
|
|
259
|
+
* Log level options accepted by the console logger.
|
|
260
|
+
*/
|
|
261
|
+
export declare type ConsoleLogLevel = LogLevel | 'off';
|
|
262
|
+
|
|
258
263
|
declare type ContentfulStatusCode = Exclude<StatusCode, ContentlessStatusCode>;
|
|
259
264
|
|
|
260
265
|
declare type ContentlessStatusCode = 101 | 204 | 205 | 304;
|
|
@@ -587,8 +592,9 @@ declare interface ContextVariableMap {
|
|
|
587
592
|
/**
|
|
588
593
|
* Creates a logger that keeps log events with a level greater than or equal
|
|
589
594
|
* to {@link logLevel} and outputs them to console using format {@link logFormat}.
|
|
595
|
+
* When `logLevel` is `'off'`, all log events are dropped.
|
|
590
596
|
*/
|
|
591
|
-
export declare function createConsoleLogger(logFormat: LogFormat, logLevel: LogLevel): Logger;
|
|
597
|
+
export declare function createConsoleLogger(logFormat: LogFormat, logLevel: LogLevel | 'off'): Logger;
|
|
592
598
|
|
|
593
599
|
declare function createHonoServer(app: App, options: Options): Hono< {
|
|
594
600
|
Variables: {
|
|
@@ -2455,7 +2461,7 @@ export declare type LogLevel = (typeof validLogLevels)[number];
|
|
|
2455
2461
|
*/
|
|
2456
2462
|
export declare interface LogOptions {
|
|
2457
2463
|
/** Minimum log level to output */
|
|
2458
|
-
logLevel:
|
|
2464
|
+
logLevel: ConsoleLogLevel;
|
|
2459
2465
|
/** Format of log output */
|
|
2460
2466
|
logFormat: LogFormat;
|
|
2461
2467
|
}
|
|
@@ -5135,6 +5141,12 @@ export declare class TransactionManager {
|
|
|
5135
5141
|
onQuery?: (event: QueryEvent) => void;
|
|
5136
5142
|
provider?: SchemaProvider;
|
|
5137
5143
|
});
|
|
5144
|
+
/**
|
|
5145
|
+
* Starts an internal transaction. The difference to `startTransaction` is that it does not
|
|
5146
|
+
* use the default transaction options from the `TransactionManager`, which in practice means
|
|
5147
|
+
* that it does not apply the default timeouts.
|
|
5148
|
+
*/
|
|
5149
|
+
startInternalTransaction(options?: TransactionOptions_2): Promise<TransactionInfo>;
|
|
5138
5150
|
startTransaction(options?: TransactionOptions_2): Promise<TransactionInfo>;
|
|
5139
5151
|
commitTransaction(transactionId: string): Promise<void>;
|
|
5140
5152
|
rollbackTransaction(transactionId: string): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -102437,6 +102437,10 @@ var CapturingSink = class {
|
|
|
102437
102437
|
return this.events.map((event) => event.export());
|
|
102438
102438
|
}
|
|
102439
102439
|
};
|
|
102440
|
+
var DroppingSink = class {
|
|
102441
|
+
write(_3) {
|
|
102442
|
+
}
|
|
102443
|
+
};
|
|
102440
102444
|
var CompositeSink = class {
|
|
102441
102445
|
#downstream;
|
|
102442
102446
|
constructor(...sinks) {
|
|
@@ -102464,7 +102468,8 @@ var FilteringSink = class {
|
|
|
102464
102468
|
|
|
102465
102469
|
// src/log/factory.ts
|
|
102466
102470
|
function createConsoleLogger(logFormat, logLevel) {
|
|
102467
|
-
|
|
102471
|
+
const sink = logLevel === "off" ? new DroppingSink() : new FilteringSink(new ConsoleSink(createLogFormatter(logFormat)), thresholdLogFilter(logLevel));
|
|
102472
|
+
return new Logger(sink);
|
|
102468
102473
|
}
|
|
102469
102474
|
|
|
102470
102475
|
// ../../node_modules/.pnpm/hono@4.9.4/node_modules/hono/dist/utils/url.js
|
|
@@ -107054,7 +107059,7 @@ var QueryInterpreter = class _QueryInterpreter {
|
|
|
107054
107059
|
return this.interpretNode(node.args, queryable, scope, generators);
|
|
107055
107060
|
}
|
|
107056
107061
|
const transactionManager = this.#transactionManager.manager;
|
|
107057
|
-
const transactionInfo = await transactionManager.
|
|
107062
|
+
const transactionInfo = await transactionManager.startInternalTransaction();
|
|
107058
107063
|
const transaction = await transactionManager.getTransaction(transactionInfo, "query");
|
|
107059
107064
|
try {
|
|
107060
107065
|
const value = await this.interpretNode(node.args, transaction, scope, generators);
|
|
@@ -107344,24 +107349,39 @@ var TransactionManager = class {
|
|
|
107344
107349
|
this.#onQuery = onQuery;
|
|
107345
107350
|
this.#provider = provider;
|
|
107346
107351
|
}
|
|
107352
|
+
/**
|
|
107353
|
+
* Starts an internal transaction. The difference to `startTransaction` is that it does not
|
|
107354
|
+
* use the default transaction options from the `TransactionManager`, which in practice means
|
|
107355
|
+
* that it does not apply the default timeouts.
|
|
107356
|
+
*/
|
|
107357
|
+
async startInternalTransaction(options) {
|
|
107358
|
+
const validatedOptions = options !== void 0 ? this.#validateOptions(options) : {};
|
|
107359
|
+
return await this.tracingHelper.runInChildSpan(
|
|
107360
|
+
"start_transaction",
|
|
107361
|
+
() => this.#startTransactionImpl(validatedOptions)
|
|
107362
|
+
);
|
|
107363
|
+
}
|
|
107347
107364
|
async startTransaction(options) {
|
|
107348
|
-
|
|
107365
|
+
const validatedOptions = options !== void 0 ? this.#validateOptions(options) : this.transactionOptions;
|
|
107366
|
+
return await this.tracingHelper.runInChildSpan(
|
|
107367
|
+
"start_transaction",
|
|
107368
|
+
() => this.#startTransactionImpl(validatedOptions)
|
|
107369
|
+
);
|
|
107349
107370
|
}
|
|
107350
107371
|
async #startTransactionImpl(options) {
|
|
107351
|
-
const validatedOptions = options !== void 0 ? this.#validateOptions(options) : this.transactionOptions;
|
|
107352
107372
|
const transaction = {
|
|
107353
107373
|
id: await randomUUID2(),
|
|
107354
107374
|
status: "waiting",
|
|
107355
107375
|
timer: void 0,
|
|
107356
|
-
timeout:
|
|
107376
|
+
timeout: options.timeout,
|
|
107357
107377
|
startedAt: Date.now(),
|
|
107358
107378
|
transaction: void 0
|
|
107359
107379
|
};
|
|
107360
107380
|
this.transactions.set(transaction.id, transaction);
|
|
107361
107381
|
let hasTimedOut = false;
|
|
107362
|
-
const startTimer =
|
|
107363
|
-
startTimer
|
|
107364
|
-
transaction.transaction = await this.driverAdapter.startTransaction(
|
|
107382
|
+
const startTimer = createTimeoutIfDefined(() => hasTimedOut = true, options.maxWait);
|
|
107383
|
+
startTimer?.unref?.();
|
|
107384
|
+
transaction.transaction = await this.driverAdapter.startTransaction(options.isolationLevel).catch(rethrowAsUserFacing);
|
|
107365
107385
|
clearTimeout(startTimer);
|
|
107366
107386
|
switch (transaction.status) {
|
|
107367
107387
|
case "waiting":
|
|
@@ -107370,7 +107390,7 @@ var TransactionManager = class {
|
|
|
107370
107390
|
throw new TransactionStartTimeoutError();
|
|
107371
107391
|
}
|
|
107372
107392
|
transaction.status = "running";
|
|
107373
|
-
transaction.timer = this.#startTransactionTimeout(transaction.id,
|
|
107393
|
+
transaction.timer = this.#startTransactionTimeout(transaction.id, options.timeout);
|
|
107374
107394
|
return { id: transaction.id };
|
|
107375
107395
|
case "timed_out":
|
|
107376
107396
|
case "running":
|
|
@@ -107440,7 +107460,7 @@ var TransactionManager = class {
|
|
|
107440
107460
|
}
|
|
107441
107461
|
#startTransactionTimeout(transactionId, timeout) {
|
|
107442
107462
|
const timeoutStartedAt = Date.now();
|
|
107443
|
-
const timer =
|
|
107463
|
+
const timer = createTimeoutIfDefined(async () => {
|
|
107444
107464
|
debug3("Transaction timed out.", { transactionId, timeoutStartedAt, timeout });
|
|
107445
107465
|
const tx = this.transactions.get(transactionId);
|
|
107446
107466
|
if (tx && ["running", "waiting"].includes(tx.status)) {
|
|
@@ -107449,7 +107469,7 @@ var TransactionManager = class {
|
|
|
107449
107469
|
debug3("Transaction already committed or rolled back when timeout happened.", transactionId);
|
|
107450
107470
|
}
|
|
107451
107471
|
}, timeout);
|
|
107452
|
-
timer
|
|
107472
|
+
timer?.unref?.();
|
|
107453
107473
|
return timer;
|
|
107454
107474
|
}
|
|
107455
107475
|
async #closeTransaction(tx, status) {
|
|
@@ -107519,6 +107539,9 @@ var TransactionManager = class {
|
|
|
107519
107539
|
});
|
|
107520
107540
|
}
|
|
107521
107541
|
};
|
|
107542
|
+
function createTimeoutIfDefined(cb, ms) {
|
|
107543
|
+
return ms !== void 0 ? setTimeout(cb, ms) : void 0;
|
|
107544
|
+
}
|
|
107522
107545
|
|
|
107523
107546
|
// ../../node_modules/.pnpm/hono@4.9.4/node_modules/hono/dist/compose.js
|
|
107524
107547
|
var compose = (middleware, onError, onNotFound) => {
|
|
@@ -109092,7 +109115,7 @@ function isPromiseLike(value) {
|
|
|
109092
109115
|
}
|
|
109093
109116
|
|
|
109094
109117
|
// package.json
|
|
109095
|
-
var version = "6.18.0-dev.
|
|
109118
|
+
var version = "6.18.0-dev.10";
|
|
109096
109119
|
|
|
109097
109120
|
// src/utils/error.ts
|
|
109098
109121
|
function extractErrorFromUnknown(value) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/query-plan-executor",
|
|
3
|
-
"version": "6.18.0-dev.
|
|
3
|
+
"version": "6.18.0-dev.10",
|
|
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-pg": "6.18.0-dev.
|
|
24
|
-
"@prisma/adapter-mariadb": "6.18.0-dev.
|
|
25
|
-
"@prisma/client-engine-runtime": "6.18.0-dev.
|
|
26
|
-
"@prisma/
|
|
27
|
-
"@prisma/adapter-
|
|
23
|
+
"@prisma/adapter-pg": "6.18.0-dev.10",
|
|
24
|
+
"@prisma/adapter-mariadb": "6.18.0-dev.10",
|
|
25
|
+
"@prisma/client-engine-runtime": "6.18.0-dev.10",
|
|
26
|
+
"@prisma/adapter-mssql": "6.18.0-dev.10",
|
|
27
|
+
"@prisma/driver-adapter-utils": "6.18.0-dev.10"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"dist"
|