@prisma/query-plan-executor 6.18.0-dev.2 → 6.18.0-dev.21
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 +17 -2
- package/dist/index.js +62 -27
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Temporal } from 'temporal-spec';
|
|
2
|
+
import { version } from '../package.json';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* An interface that exposes some basic information about the
|
|
@@ -255,6 +256,11 @@ declare type ConnectionInfo = {
|
|
|
255
256
|
supportsRelationJoins: boolean;
|
|
256
257
|
};
|
|
257
258
|
|
|
259
|
+
/**
|
|
260
|
+
* Log level options accepted by the console logger.
|
|
261
|
+
*/
|
|
262
|
+
export declare type ConsoleLogLevel = LogLevel | 'off';
|
|
263
|
+
|
|
258
264
|
declare type ContentfulStatusCode = Exclude<StatusCode, ContentlessStatusCode>;
|
|
259
265
|
|
|
260
266
|
declare type ContentlessStatusCode = 101 | 204 | 205 | 304;
|
|
@@ -587,8 +593,9 @@ declare interface ContextVariableMap {
|
|
|
587
593
|
/**
|
|
588
594
|
* Creates a logger that keeps log events with a level greater than or equal
|
|
589
595
|
* to {@link logLevel} and outputs them to console using format {@link logFormat}.
|
|
596
|
+
* When `logLevel` is `'off'`, all log events are dropped.
|
|
590
597
|
*/
|
|
591
|
-
export declare function createConsoleLogger(logFormat: LogFormat, logLevel: LogLevel): Logger;
|
|
598
|
+
export declare function createConsoleLogger(logFormat: LogFormat, logLevel: LogLevel | 'off'): Logger;
|
|
592
599
|
|
|
593
600
|
declare function createHonoServer(app: App, options: Options): Hono< {
|
|
594
601
|
Variables: {
|
|
@@ -2455,7 +2462,7 @@ export declare type LogLevel = (typeof validLogLevels)[number];
|
|
|
2455
2462
|
*/
|
|
2456
2463
|
export declare interface LogOptions {
|
|
2457
2464
|
/** Minimum log level to output */
|
|
2458
|
-
logLevel:
|
|
2465
|
+
logLevel: ConsoleLogLevel;
|
|
2459
2466
|
/** Format of log output */
|
|
2460
2467
|
logFormat: LogFormat;
|
|
2461
2468
|
}
|
|
@@ -5135,6 +5142,12 @@ export declare class TransactionManager {
|
|
|
5135
5142
|
onQuery?: (event: QueryEvent) => void;
|
|
5136
5143
|
provider?: SchemaProvider;
|
|
5137
5144
|
});
|
|
5145
|
+
/**
|
|
5146
|
+
* Starts an internal transaction. The difference to `startTransaction` is that it does not
|
|
5147
|
+
* use the default transaction options from the `TransactionManager`, which in practice means
|
|
5148
|
+
* that it does not apply the default timeouts.
|
|
5149
|
+
*/
|
|
5150
|
+
startInternalTransaction(options?: TransactionOptions_2): Promise<TransactionInfo>;
|
|
5138
5151
|
startTransaction(options?: TransactionOptions_2): Promise<TransactionInfo>;
|
|
5139
5152
|
commitTransaction(transactionId: string): Promise<void>;
|
|
5140
5153
|
rollbackTransaction(transactionId: string): Promise<void>;
|
|
@@ -5230,6 +5243,8 @@ declare const validLogLevels: readonly ["debug", "query", "info", "warn", "error
|
|
|
5230
5243
|
|
|
5231
5244
|
declare type Variables = object;
|
|
5232
5245
|
|
|
5246
|
+
export { version }
|
|
5247
|
+
|
|
5233
5248
|
/**
|
|
5234
5249
|
* Logs a warning message using the active logger.
|
|
5235
5250
|
*
|
package/dist/index.js
CHANGED
|
@@ -97606,10 +97606,14 @@ __export(index_exports, {
|
|
|
97606
97606
|
parseLogFormat: () => parseLogFormat,
|
|
97607
97607
|
parseLogLevel: () => parseLogLevel,
|
|
97608
97608
|
parseSize: () => parseSize,
|
|
97609
|
+
version: () => version,
|
|
97609
97610
|
withActiveLogger: () => withActiveLogger
|
|
97610
97611
|
});
|
|
97611
97612
|
module.exports = __toCommonJS(index_exports);
|
|
97612
97613
|
|
|
97614
|
+
// package.json
|
|
97615
|
+
var version = "6.18.0-dev.21";
|
|
97616
|
+
|
|
97613
97617
|
// ../../node_modules/.pnpm/temporal-polyfill@0.3.0/node_modules/temporal-polyfill/chunks/internal.js
|
|
97614
97618
|
function clampProp(e2, n2, t2, o2, r2) {
|
|
97615
97619
|
return clampEntity(n2, ((e3, n3) => {
|
|
@@ -102437,6 +102441,10 @@ var CapturingSink = class {
|
|
|
102437
102441
|
return this.events.map((event) => event.export());
|
|
102438
102442
|
}
|
|
102439
102443
|
};
|
|
102444
|
+
var DroppingSink = class {
|
|
102445
|
+
write(_3) {
|
|
102446
|
+
}
|
|
102447
|
+
};
|
|
102440
102448
|
var CompositeSink = class {
|
|
102441
102449
|
#downstream;
|
|
102442
102450
|
constructor(...sinks) {
|
|
@@ -102464,7 +102472,8 @@ var FilteringSink = class {
|
|
|
102464
102472
|
|
|
102465
102473
|
// src/log/factory.ts
|
|
102466
102474
|
function createConsoleLogger(logFormat, logLevel) {
|
|
102467
|
-
|
|
102475
|
+
const sink = logLevel === "off" ? new DroppingSink() : new FilteringSink(new ConsoleSink(createLogFormatter(logFormat)), thresholdLogFilter(logLevel));
|
|
102476
|
+
return new Logger(sink);
|
|
102468
102477
|
}
|
|
102469
102478
|
|
|
102470
102479
|
// ../../node_modules/.pnpm/hono@4.9.4/node_modules/hono/dist/utils/url.js
|
|
@@ -106146,12 +106155,12 @@ function mapValue(value, columnName, scalarType, enums) {
|
|
|
106146
106155
|
}
|
|
106147
106156
|
var TIME_TZ_PATTERN = /\d{2}:\d{2}:\d{2}(?:\.\d+)?(Z|[+-]\d{2}(:?\d{2})?)?$/;
|
|
106148
106157
|
function normalizeDateTime(dt2) {
|
|
106149
|
-
const
|
|
106150
|
-
if (
|
|
106151
|
-
return `${dt2}
|
|
106158
|
+
const timeTzMatches = TIME_TZ_PATTERN.exec(dt2);
|
|
106159
|
+
if (timeTzMatches === null) {
|
|
106160
|
+
return `${dt2}T00:00:00Z`;
|
|
106152
106161
|
}
|
|
106153
106162
|
let dtWithTz = dt2;
|
|
106154
|
-
const [timeTz, tz, tzMinuteOffset] =
|
|
106163
|
+
const [timeTz, tz, tzMinuteOffset] = timeTzMatches;
|
|
106155
106164
|
if (tz !== void 0 && tz !== "Z" && tzMinuteOffset === void 0) {
|
|
106156
106165
|
dtWithTz = `${dt2}:00`;
|
|
106157
106166
|
} else if (tz === void 0) {
|
|
@@ -106160,6 +106169,10 @@ function normalizeDateTime(dt2) {
|
|
|
106160
106169
|
if (timeTz.length === dt2.length) {
|
|
106161
106170
|
return `1970-01-01T${dtWithTz}`;
|
|
106162
106171
|
}
|
|
106172
|
+
const timeSeparatorIndex = timeTzMatches.index - 1;
|
|
106173
|
+
if (dtWithTz[timeSeparatorIndex] === " ") {
|
|
106174
|
+
dtWithTz = `${dtWithTz.slice(0, timeSeparatorIndex)}T${dtWithTz.slice(timeSeparatorIndex + 1)}`;
|
|
106175
|
+
}
|
|
106163
106176
|
return dtWithTz;
|
|
106164
106177
|
}
|
|
106165
106178
|
function providerToOtelSystem(provider) {
|
|
@@ -107054,7 +107067,7 @@ var QueryInterpreter = class _QueryInterpreter {
|
|
|
107054
107067
|
return this.interpretNode(node.args, queryable, scope, generators);
|
|
107055
107068
|
}
|
|
107056
107069
|
const transactionManager = this.#transactionManager.manager;
|
|
107057
|
-
const transactionInfo = await transactionManager.
|
|
107070
|
+
const transactionInfo = await transactionManager.startInternalTransaction();
|
|
107058
107071
|
const transaction = await transactionManager.getTransaction(transactionInfo, "query");
|
|
107059
107072
|
try {
|
|
107060
107073
|
const value = await this.interpretNode(node.args, transaction, scope, generators);
|
|
@@ -107344,24 +107357,39 @@ var TransactionManager = class {
|
|
|
107344
107357
|
this.#onQuery = onQuery;
|
|
107345
107358
|
this.#provider = provider;
|
|
107346
107359
|
}
|
|
107360
|
+
/**
|
|
107361
|
+
* Starts an internal transaction. The difference to `startTransaction` is that it does not
|
|
107362
|
+
* use the default transaction options from the `TransactionManager`, which in practice means
|
|
107363
|
+
* that it does not apply the default timeouts.
|
|
107364
|
+
*/
|
|
107365
|
+
async startInternalTransaction(options) {
|
|
107366
|
+
const validatedOptions = options !== void 0 ? this.#validateOptions(options) : {};
|
|
107367
|
+
return await this.tracingHelper.runInChildSpan(
|
|
107368
|
+
"start_transaction",
|
|
107369
|
+
() => this.#startTransactionImpl(validatedOptions)
|
|
107370
|
+
);
|
|
107371
|
+
}
|
|
107347
107372
|
async startTransaction(options) {
|
|
107348
|
-
|
|
107373
|
+
const validatedOptions = options !== void 0 ? this.#validateOptions(options) : this.transactionOptions;
|
|
107374
|
+
return await this.tracingHelper.runInChildSpan(
|
|
107375
|
+
"start_transaction",
|
|
107376
|
+
() => this.#startTransactionImpl(validatedOptions)
|
|
107377
|
+
);
|
|
107349
107378
|
}
|
|
107350
107379
|
async #startTransactionImpl(options) {
|
|
107351
|
-
const validatedOptions = options !== void 0 ? this.#validateOptions(options) : this.transactionOptions;
|
|
107352
107380
|
const transaction = {
|
|
107353
107381
|
id: await randomUUID2(),
|
|
107354
107382
|
status: "waiting",
|
|
107355
107383
|
timer: void 0,
|
|
107356
|
-
timeout:
|
|
107384
|
+
timeout: options.timeout,
|
|
107357
107385
|
startedAt: Date.now(),
|
|
107358
107386
|
transaction: void 0
|
|
107359
107387
|
};
|
|
107360
107388
|
this.transactions.set(transaction.id, transaction);
|
|
107361
107389
|
let hasTimedOut = false;
|
|
107362
|
-
const startTimer =
|
|
107363
|
-
startTimer
|
|
107364
|
-
transaction.transaction = await this.driverAdapter.startTransaction(
|
|
107390
|
+
const startTimer = createTimeoutIfDefined(() => hasTimedOut = true, options.maxWait);
|
|
107391
|
+
startTimer?.unref?.();
|
|
107392
|
+
transaction.transaction = await this.driverAdapter.startTransaction(options.isolationLevel).catch(rethrowAsUserFacing);
|
|
107365
107393
|
clearTimeout(startTimer);
|
|
107366
107394
|
switch (transaction.status) {
|
|
107367
107395
|
case "waiting":
|
|
@@ -107370,7 +107398,7 @@ var TransactionManager = class {
|
|
|
107370
107398
|
throw new TransactionStartTimeoutError();
|
|
107371
107399
|
}
|
|
107372
107400
|
transaction.status = "running";
|
|
107373
|
-
transaction.timer = this.#startTransactionTimeout(transaction.id,
|
|
107401
|
+
transaction.timer = this.#startTransactionTimeout(transaction.id, options.timeout);
|
|
107374
107402
|
return { id: transaction.id };
|
|
107375
107403
|
case "timed_out":
|
|
107376
107404
|
case "running":
|
|
@@ -107440,7 +107468,7 @@ var TransactionManager = class {
|
|
|
107440
107468
|
}
|
|
107441
107469
|
#startTransactionTimeout(transactionId, timeout) {
|
|
107442
107470
|
const timeoutStartedAt = Date.now();
|
|
107443
|
-
const timer =
|
|
107471
|
+
const timer = createTimeoutIfDefined(async () => {
|
|
107444
107472
|
debug3("Transaction timed out.", { transactionId, timeoutStartedAt, timeout });
|
|
107445
107473
|
const tx = this.transactions.get(transactionId);
|
|
107446
107474
|
if (tx && ["running", "waiting"].includes(tx.status)) {
|
|
@@ -107449,7 +107477,7 @@ var TransactionManager = class {
|
|
|
107449
107477
|
debug3("Transaction already committed or rolled back when timeout happened.", transactionId);
|
|
107450
107478
|
}
|
|
107451
107479
|
}, timeout);
|
|
107452
|
-
timer
|
|
107480
|
+
timer?.unref?.();
|
|
107453
107481
|
return timer;
|
|
107454
107482
|
}
|
|
107455
107483
|
async #closeTransaction(tx, status) {
|
|
@@ -107519,6 +107547,9 @@ var TransactionManager = class {
|
|
|
107519
107547
|
});
|
|
107520
107548
|
}
|
|
107521
107549
|
};
|
|
107550
|
+
function createTimeoutIfDefined(cb, ms) {
|
|
107551
|
+
return ms !== void 0 ? setTimeout(cb, ms) : void 0;
|
|
107552
|
+
}
|
|
107522
107553
|
|
|
107523
107554
|
// ../../node_modules/.pnpm/hono@4.9.4/node_modules/hono/dist/compose.js
|
|
107524
107555
|
var compose = (middleware, onError, onNotFound) => {
|
|
@@ -109091,9 +109122,6 @@ function isPromiseLike(value) {
|
|
|
109091
109122
|
return value != null && typeof value["then"] === "function";
|
|
109092
109123
|
}
|
|
109093
109124
|
|
|
109094
|
-
// package.json
|
|
109095
|
-
var version = "6.18.0-dev.2";
|
|
109096
|
-
|
|
109097
109125
|
// src/utils/error.ts
|
|
109098
109126
|
function extractErrorFromUnknown(value) {
|
|
109099
109127
|
if (value instanceof Error) {
|
|
@@ -109247,11 +109275,11 @@ var typeCast = (field, next) => {
|
|
|
109247
109275
|
function formatDateTime(date5) {
|
|
109248
109276
|
const pad2 = (n2, z2 = 2) => String(n2).padStart(z2, "0");
|
|
109249
109277
|
const ms = date5.getUTCMilliseconds();
|
|
109250
|
-
return date5.getUTCFullYear() + "-" + pad2(date5.getUTCMonth() + 1) + "-" + pad2(date5.getUTCDate()) + " " + pad2(date5.getUTCHours()) + ":" + pad2(date5.getUTCMinutes()) + ":" + pad2(date5.getUTCSeconds()) + (ms ? "." + String(ms).padStart(3, "0") : "");
|
|
109278
|
+
return pad2(date5.getUTCFullYear(), 4) + "-" + pad2(date5.getUTCMonth() + 1) + "-" + pad2(date5.getUTCDate()) + " " + pad2(date5.getUTCHours()) + ":" + pad2(date5.getUTCMinutes()) + ":" + pad2(date5.getUTCSeconds()) + (ms ? "." + String(ms).padStart(3, "0") : "");
|
|
109251
109279
|
}
|
|
109252
109280
|
function formatDate(date5) {
|
|
109253
109281
|
const pad2 = (n2, z2 = 2) => String(n2).padStart(z2, "0");
|
|
109254
|
-
return date5.getUTCFullYear() + "-" + pad2(date5.getUTCMonth() + 1) + "-" + pad2(date5.getUTCDate());
|
|
109282
|
+
return pad2(date5.getUTCFullYear(), 4) + "-" + pad2(date5.getUTCMonth() + 1) + "-" + pad2(date5.getUTCDate());
|
|
109255
109283
|
}
|
|
109256
109284
|
function formatTime(date5) {
|
|
109257
109285
|
const pad2 = (n2, z2 = 2) => String(n2).padStart(z2, "0");
|
|
@@ -109850,6 +109878,11 @@ function parseConnectionString(connectionString) {
|
|
|
109850
109878
|
config3.options = config3.options || {};
|
|
109851
109879
|
config3.options.trustServerCertificate = trustServerCertificate.toLowerCase() === "true";
|
|
109852
109880
|
}
|
|
109881
|
+
const multiSubnetFailover = firstKey(parameters, "multiSubnetFailover");
|
|
109882
|
+
if (multiSubnetFailover !== null) {
|
|
109883
|
+
config3.options = config3.options || {};
|
|
109884
|
+
config3.options.multiSubnetFailover = multiSubnetFailover.toLowerCase() === "true";
|
|
109885
|
+
}
|
|
109853
109886
|
const connectionLimit = firstKey(parameters, "connectionLimit");
|
|
109854
109887
|
if (connectionLimit !== null) {
|
|
109855
109888
|
config3.pool = config3.pool || {};
|
|
@@ -109999,6 +110032,7 @@ var handledParameters = [
|
|
|
109999
110032
|
"initial catalog",
|
|
110000
110033
|
"isolationLevel",
|
|
110001
110034
|
"loginTimeout",
|
|
110035
|
+
"multiSubnetFailover",
|
|
110002
110036
|
"password",
|
|
110003
110037
|
"poolTimeout",
|
|
110004
110038
|
"pwd",
|
|
@@ -110147,11 +110181,11 @@ function mapRow2(row, columns) {
|
|
|
110147
110181
|
function formatDateTime2(date5) {
|
|
110148
110182
|
const pad2 = (n2, z2 = 2) => String(n2).padStart(z2, "0");
|
|
110149
110183
|
const ms = date5.getUTCMilliseconds();
|
|
110150
|
-
return date5.getUTCFullYear() + "-" + pad2(date5.getUTCMonth() + 1) + "-" + pad2(date5.getUTCDate()) + " " + pad2(date5.getUTCHours()) + ":" + pad2(date5.getUTCMinutes()) + ":" + pad2(date5.getUTCSeconds()) + (ms ? "." + String(ms).padStart(3, "0") : "");
|
|
110184
|
+
return pad2(date5.getUTCFullYear(), 4) + "-" + pad2(date5.getUTCMonth() + 1) + "-" + pad2(date5.getUTCDate()) + " " + pad2(date5.getUTCHours()) + ":" + pad2(date5.getUTCMinutes()) + ":" + pad2(date5.getUTCSeconds()) + (ms ? "." + String(ms).padStart(3, "0") : "");
|
|
110151
110185
|
}
|
|
110152
110186
|
function formatDate2(date5) {
|
|
110153
110187
|
const pad2 = (n2, z2 = 2) => String(n2).padStart(z2, "0");
|
|
110154
|
-
return date5.getUTCFullYear() + "-" + pad2(date5.getUTCMonth() + 1) + "-" + pad2(date5.getUTCDate());
|
|
110188
|
+
return pad2(date5.getUTCFullYear(), 4) + "-" + pad2(date5.getUTCMonth() + 1) + "-" + pad2(date5.getUTCDate());
|
|
110155
110189
|
}
|
|
110156
110190
|
function formatTime2(date5) {
|
|
110157
110191
|
const pad2 = (n2, z2 = 2) => String(n2).padStart(z2, "0");
|
|
@@ -110742,10 +110776,10 @@ function normalize_date(date5) {
|
|
|
110742
110776
|
return date5;
|
|
110743
110777
|
}
|
|
110744
110778
|
function normalize_timestamp(time3) {
|
|
110745
|
-
return
|
|
110779
|
+
return `${time3.replace(" ", "T")}+00:00`;
|
|
110746
110780
|
}
|
|
110747
|
-
function
|
|
110748
|
-
return
|
|
110781
|
+
function normalize_timestamptz(time3) {
|
|
110782
|
+
return time3.replace(" ", "T").replace(/[+-]\d{2}(:\d{2})?$/, "+00:00");
|
|
110749
110783
|
}
|
|
110750
110784
|
function normalize_time(time3) {
|
|
110751
110785
|
return time3;
|
|
@@ -110788,8 +110822,8 @@ var customParsers = {
|
|
|
110788
110822
|
[ArrayColumnType.DATE_ARRAY]: normalize_array(normalize_date),
|
|
110789
110823
|
[ScalarColumnType.TIMESTAMP]: normalize_timestamp,
|
|
110790
110824
|
[ArrayColumnType.TIMESTAMP_ARRAY]: normalize_array(normalize_timestamp),
|
|
110791
|
-
[ScalarColumnType.TIMESTAMPTZ]:
|
|
110792
|
-
[ArrayColumnType.TIMESTAMPTZ_ARRAY]: normalize_array(
|
|
110825
|
+
[ScalarColumnType.TIMESTAMPTZ]: normalize_timestamptz,
|
|
110826
|
+
[ArrayColumnType.TIMESTAMPTZ_ARRAY]: normalize_array(normalize_timestamptz),
|
|
110793
110827
|
[ScalarColumnType.MONEY]: normalize_money,
|
|
110794
110828
|
[ArrayColumnType.MONEY_ARRAY]: normalize_array(normalize_money),
|
|
110795
110829
|
[ScalarColumnType.JSON]: toJson,
|
|
@@ -123691,6 +123725,7 @@ function getErrorResponse(error44, ctx) {
|
|
|
123691
123725
|
parseLogFormat,
|
|
123692
123726
|
parseLogLevel,
|
|
123693
123727
|
parseSize,
|
|
123728
|
+
version,
|
|
123694
123729
|
withActiveLogger
|
|
123695
123730
|
});
|
|
123696
123731
|
/*! Bundled license information:
|
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.21",
|
|
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",
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
"@hono/node-server": "1.19.0",
|
|
15
15
|
"@hono/zod-validator": "0.7.2",
|
|
16
16
|
"@opentelemetry/api": "1.9.0",
|
|
17
|
-
"@opentelemetry/context-async-hooks": "2.0
|
|
18
|
-
"@opentelemetry/sdk-trace-base": "2.0
|
|
17
|
+
"@opentelemetry/context-async-hooks": "2.1.0",
|
|
18
|
+
"@opentelemetry/sdk-trace-base": "2.1.0",
|
|
19
19
|
"hono": "4.9.4",
|
|
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/
|
|
25
|
-
"@prisma/adapter-
|
|
26
|
-
"@prisma/
|
|
27
|
-
"@prisma/
|
|
23
|
+
"@prisma/adapter-pg": "6.18.0-dev.21",
|
|
24
|
+
"@prisma/client-engine-runtime": "6.18.0-dev.21",
|
|
25
|
+
"@prisma/adapter-mariadb": "6.18.0-dev.21",
|
|
26
|
+
"@prisma/adapter-mssql": "6.18.0-dev.21",
|
|
27
|
+
"@prisma/driver-adapter-utils": "6.18.0-dev.21"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"dist"
|