@prisma/query-plan-executor 7.5.0-dev.3 → 7.5.0-dev.31

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 CHANGED
@@ -668,6 +668,7 @@ json: {
668
668
  timeout?: number | undefined;
669
669
  maxWait?: number | undefined;
670
670
  isolationLevel?: "READ UNCOMMITTED" | "READ COMMITTED" | "REPEATABLE READ" | "SNAPSHOT" | "SERIALIZABLE" | undefined;
671
+ newTxId?: string | undefined;
671
672
  };
672
673
  };
673
674
  output: {
@@ -844,6 +845,10 @@ declare interface ExecutionContext {
844
845
  * For compatibility with Wrangler 4.x.
845
846
  */
846
847
  props: any;
848
+ /**
849
+ * For compatibility with Wrangler 4.x.
850
+ */
851
+ exports?: any;
847
852
  }
848
853
 
849
854
  /**
@@ -955,6 +960,9 @@ declare type Fragment = {
955
960
  type: 'parameter';
956
961
  } | {
957
962
  type: 'parameterTuple';
963
+ itemPrefix: string;
964
+ itemSeparator: string;
965
+ itemSuffix: string;
958
966
  } | {
959
967
  type: 'parameterTupleList';
960
968
  itemPrefix: string;
@@ -2406,7 +2414,7 @@ declare interface Queryable<Query, Result> extends AdapterInfo {
2406
2414
  declare type QueryEvent = {
2407
2415
  timestamp: Date;
2408
2416
  query: string;
2409
- params: unknown[];
2417
+ params: readonly unknown[];
2410
2418
  duration: number;
2411
2419
  };
2412
2420
 
@@ -2477,6 +2485,7 @@ declare type QueryPlanNode = {
2477
2485
  args: {
2478
2486
  parent: QueryPlanNode;
2479
2487
  children: JoinExpression[];
2488
+ canAssumeStrictEquality: boolean;
2480
2489
  };
2481
2490
  } | {
2482
2491
  type: 'mapField';
@@ -3248,6 +3257,18 @@ declare interface Transaction extends AdapterInfo, SqlQueryable {
3248
3257
  * Roll back the transaction.
3249
3258
  */
3250
3259
  rollback(): Promise<void>;
3260
+ /**
3261
+ * Creates a savepoint within the currently running transaction.
3262
+ */
3263
+ createSavepoint?(name: string): Promise<void>;
3264
+ /**
3265
+ * Rolls back transaction state to a previously created savepoint.
3266
+ */
3267
+ rollbackToSavepoint?(name: string): Promise<void>;
3268
+ /**
3269
+ * Releases a previously created savepoint. Optional because not every connector supports this operation.
3270
+ */
3271
+ releaseSavepoint?(name: string): Promise<void>;
3251
3272
  }
3252
3273
 
3253
3274
  declare type TransactionInfo = {
@@ -3289,6 +3310,7 @@ declare type TransactionOptions_2 = {
3289
3310
  maxWait?: number;
3290
3311
  timeout?: number;
3291
3312
  isolationLevel?: IsolationLevel;
3313
+ newTxId?: string;
3292
3314
  };
3293
3315
 
3294
3316
  declare type TypedResponse<T = unknown, U extends StatusCode = StatusCode, F extends ResponseFormat = T extends string ? 'text' : T extends JSONValue ? 'json' : ResponseFormat> = {
@@ -3312,14 +3334,14 @@ declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) e
3312
3334
  declare type UnofficialStatusCode = -1;
3313
3335
 
3314
3336
  declare type ValidationError = {
3315
- error_identifier: 'RELATION_VIOLATION';
3337
+ errorIdentifier: 'RELATION_VIOLATION';
3316
3338
  context: {
3317
3339
  relation: string;
3318
3340
  modelA: string;
3319
3341
  modelB: string;
3320
3342
  };
3321
3343
  } | {
3322
- error_identifier: 'MISSING_RELATED_RECORD';
3344
+ errorIdentifier: 'MISSING_RELATED_RECORD';
3323
3345
  context: {
3324
3346
  model: string;
3325
3347
  relation: string;
@@ -3328,24 +3350,24 @@ declare type ValidationError = {
3328
3350
  neededFor?: string;
3329
3351
  };
3330
3352
  } | {
3331
- error_identifier: 'MISSING_RECORD';
3353
+ errorIdentifier: 'MISSING_RECORD';
3332
3354
  context: {
3333
3355
  operation: string;
3334
3356
  };
3335
3357
  } | {
3336
- error_identifier: 'INCOMPLETE_CONNECT_INPUT';
3358
+ errorIdentifier: 'INCOMPLETE_CONNECT_INPUT';
3337
3359
  context: {
3338
3360
  expectedRows: number;
3339
3361
  };
3340
3362
  } | {
3341
- error_identifier: 'INCOMPLETE_CONNECT_OUTPUT';
3363
+ errorIdentifier: 'INCOMPLETE_CONNECT_OUTPUT';
3342
3364
  context: {
3343
3365
  expectedRows: number;
3344
3366
  relation: string;
3345
3367
  relationType: string;
3346
3368
  };
3347
3369
  } | {
3348
- error_identifier: 'RECORDS_NOT_CONNECTED';
3370
+ errorIdentifier: 'RECORDS_NOT_CONNECTED';
3349
3371
  context: {
3350
3372
  relation: string;
3351
3373
  parent: string;
package/dist/index.js CHANGED
@@ -101325,7 +101325,7 @@ __export(index_exports, {
101325
101325
  module.exports = __toCommonJS(index_exports);
101326
101326
 
101327
101327
  // package.json
101328
- var version = "7.5.0-dev.3";
101328
+ var version = "7.5.0-dev.31";
101329
101329
 
101330
101330
  // ../../node_modules/.pnpm/temporal-polyfill@0.3.0/node_modules/temporal-polyfill/chunks/internal.js
101331
101331
  function clampProp(e2, n2, t2, o2, r2) {
@@ -106189,7 +106189,7 @@ function createConsoleLogger(logFormat, logLevel) {
106189
106189
  return new Logger(sink);
106190
106190
  }
106191
106191
 
106192
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/utils/url.js
106192
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/utils/url.js
106193
106193
  var splitPath = (path3) => {
106194
106194
  const paths = path3.split("/");
106195
106195
  if (paths[0] === "") {
@@ -106264,9 +106264,11 @@ var getPath = (request3) => {
106264
106264
  const charCode = url2.charCodeAt(i2);
106265
106265
  if (charCode === 37) {
106266
106266
  const queryIndex = url2.indexOf("?", i2);
106267
- const path3 = url2.slice(start, queryIndex === -1 ? void 0 : queryIndex);
106267
+ const hashIndex = url2.indexOf("#", i2);
106268
+ const end = queryIndex === -1 ? hashIndex === -1 ? void 0 : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex);
106269
+ const path3 = url2.slice(start, end);
106268
106270
  return tryDecodeURI(path3.includes("%25") ? path3.replace(/%25/g, "%2525") : path3);
106269
- } else if (charCode === 63) {
106271
+ } else if (charCode === 63 || charCode === 35) {
106270
106272
  break;
106271
106273
  }
106272
106274
  }
@@ -106391,7 +106393,7 @@ var getQueryParams = (url2, key) => {
106391
106393
  };
106392
106394
  var decodeURIComponent_ = decodeURIComponent;
106393
106395
 
106394
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/utils/cookie.js
106396
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/utils/cookie.js
106395
106397
  var validCookieNameRegEx = /^[\w!#$%&'*.^`|~+-]+$/;
106396
106398
  var validCookieValueRegEx = /^[ !#-:<-[\]-~]*$/;
106397
106399
  var parse = (cookie, name6) => {
@@ -106424,7 +106426,7 @@ var parse = (cookie, name6) => {
106424
106426
  return parsedCookie;
106425
106427
  };
106426
106428
 
106427
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/helper/cookie/index.js
106429
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/helper/cookie/index.js
106428
106430
  var getCookie = (c2, key, prefix) => {
106429
106431
  const cookie = c2.req.raw.headers.get("Cookie");
106430
106432
  if (typeof key === "string") {
@@ -106447,7 +106449,7 @@ var getCookie = (c2, key, prefix) => {
106447
106449
  return obj;
106448
106450
  };
106449
106451
 
106450
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/http-exception.js
106452
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/http-exception.js
106451
106453
  var HTTPException = class extends Error {
106452
106454
  res;
106453
106455
  status;
@@ -106480,7 +106482,7 @@ var HTTPException = class extends Error {
106480
106482
  }
106481
106483
  };
106482
106484
 
106483
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/utils/buffer.js
106485
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/utils/buffer.js
106484
106486
  var bufferToFormData = (arrayBuffer, contentType) => {
106485
106487
  const response = new Response(arrayBuffer, {
106486
106488
  headers: {
@@ -106490,7 +106492,7 @@ var bufferToFormData = (arrayBuffer, contentType) => {
106490
106492
  return response.formData();
106491
106493
  };
106492
106494
 
106493
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/validator/validator.js
106495
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/validator/validator.js
106494
106496
  var jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/;
106495
106497
  var multipartRegex = /^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/;
106496
106498
  var urlencodedRegex = /^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/;
@@ -106571,7 +106573,7 @@ var validator = (target, validationFunc) => {
106571
106573
  };
106572
106574
  };
106573
106575
 
106574
- // ../../node_modules/.pnpm/@hono+zod-validator@0.7.2_hono@4.11.7_zod@4.1.3/node_modules/@hono/zod-validator/dist/index.js
106576
+ // ../../node_modules/.pnpm/@hono+zod-validator@0.7.2_hono@4.12.0_zod@4.1.3/node_modules/@hono/zod-validator/dist/index.js
106575
106577
  var zValidator = (target, schema, hook, options) => (
106576
106578
  // @ts-expect-error not typed well
106577
106579
  validator(target, async (value, c2) => {
@@ -109757,7 +109759,10 @@ function normalizeJsonProtocolValues(result) {
109757
109759
  function isTaggedValue(value) {
109758
109760
  return value !== null && typeof value == "object" && typeof value["$type"] === "string";
109759
109761
  }
109760
- function normalizeTaggedValue({ $type, value }) {
109762
+ function normalizeTaggedValue({
109763
+ $type,
109764
+ value
109765
+ }) {
109761
109766
  switch ($type) {
109762
109767
  case "BigInt":
109763
109768
  return { $type, value: String(value) };
@@ -109769,6 +109774,12 @@ function normalizeTaggedValue({ $type, value }) {
109769
109774
  return { $type, value: String(new Decimal(value)) };
109770
109775
  case "Json":
109771
109776
  return { $type, value: JSON.stringify(JSON.parse(value)) };
109777
+ case "Raw":
109778
+ return { $type, value };
109779
+ case "FieldRef":
109780
+ return { $type, value };
109781
+ case "Enum":
109782
+ return { $type, value };
109772
109783
  default:
109773
109784
  assertNever(value, "Unknown tagged value");
109774
109785
  }
@@ -110487,8 +110498,11 @@ function paginateSingleList(list, { cursor, skip, take }) {
110487
110498
  const end = take !== null ? start + take : list.length;
110488
110499
  return list.slice(start, end);
110489
110500
  }
110490
- function getRecordKey(record2, fields) {
110491
- return JSON.stringify(fields.map((field) => record2[field]));
110501
+ function getRecordKey(record2, fields, mappers) {
110502
+ const array2 = fields.map(
110503
+ (field, index) => mappers?.[index] ? record2[field] !== null ? mappers[index](record2[field]) : null : record2[field]
110504
+ );
110505
+ return JSON.stringify(array2);
110492
110506
  }
110493
110507
  function isPrismaValuePlaceholder(value) {
110494
110508
  return typeof value === "object" && value !== null && value["prisma__type"] === "param";
@@ -110579,7 +110593,10 @@ function renderFragment(fragment, placeholderFormat, ctx) {
110579
110593
  case "stringChunk":
110580
110594
  return fragment.chunk;
110581
110595
  case "parameterTuple": {
110582
- const placeholders = fragment.value.length == 0 ? "NULL" : fragment.value.map(() => formatPlaceholder(placeholderFormat, ctx.placeholderNumber++)).join(",");
110596
+ const placeholders = fragment.value.length == 0 ? "NULL" : fragment.value.map(() => {
110597
+ const item = formatPlaceholder(placeholderFormat, ctx.placeholderNumber++);
110598
+ return `${fragment.itemPrefix}${item}${fragment.itemSuffix}`;
110599
+ }).join(fragment.itemSeparator);
110583
110600
  return `(${placeholders})`;
110584
110601
  }
110585
110602
  case "parameterTupleList": {
@@ -110933,7 +110950,7 @@ function doesSatisfyRule(data, rule) {
110933
110950
  }
110934
110951
  }
110935
110952
  function renderMessage(data, error44) {
110936
- switch (error44.error_identifier) {
110953
+ switch (error44.errorIdentifier) {
110937
110954
  case "RELATION_VIOLATION":
110938
110955
  return `The change you are trying to make would violate the required relation '${error44.context.relation}' between the \`${error44.context.modelA}\` and \`${error44.context.modelB}\` models.`;
110939
110956
  case "MISSING_RECORD":
@@ -110953,7 +110970,7 @@ function renderMessage(data, error44) {
110953
110970
  }
110954
110971
  }
110955
110972
  function getErrorCode2(error44) {
110956
- switch (error44.error_identifier) {
110973
+ switch (error44.errorIdentifier) {
110957
110974
  case "RELATION_VIOLATION":
110958
110975
  return "P2014";
110959
110976
  case "RECORDS_NOT_CONNECTED":
@@ -111066,7 +111083,7 @@ var QueryInterpreter = class _QueryInterpreter {
111066
111083
  sum2 += await this.#withQuerySpanAndEvent(
111067
111084
  commentedQuery,
111068
111085
  context2.queryable,
111069
- () => context2.queryable.executeRaw(commentedQuery).catch(
111086
+ () => context2.queryable.executeRaw(cloneObject(commentedQuery)).catch(
111070
111087
  (err) => node.args.type === "rawSql" ? rethrowAsUserFacingRawError(err) : rethrowAsUserFacing(err)
111071
111088
  )
111072
111089
  );
@@ -111081,7 +111098,7 @@ var QueryInterpreter = class _QueryInterpreter {
111081
111098
  const result = await this.#withQuerySpanAndEvent(
111082
111099
  commentedQuery,
111083
111100
  context2.queryable,
111084
- () => context2.queryable.queryRaw(commentedQuery).catch(
111101
+ () => context2.queryable.queryRaw(cloneObject(commentedQuery)).catch(
111085
111102
  (err) => node.args.type === "rawSql" ? rethrowAsUserFacingRawError(err) : rethrowAsUserFacing(err)
111086
111103
  )
111087
111104
  );
@@ -111133,7 +111150,7 @@ var QueryInterpreter = class _QueryInterpreter {
111133
111150
  childRecords: (await this.interpretNode(joinExpr.child, context2)).value
111134
111151
  }))
111135
111152
  );
111136
- return { value: attachChildrenToParents(parent, children), lastInsertId };
111153
+ return { value: attachChildrenToParents(parent, children, node.args.canAssumeStrictEquality), lastInsertId };
111137
111154
  }
111138
111155
  case "transaction": {
111139
111156
  if (!context2.transactionManager.enabled) {
@@ -111180,8 +111197,9 @@ var QueryInterpreter = class _QueryInterpreter {
111180
111197
  }
111181
111198
  case "process": {
111182
111199
  const { value, lastInsertId } = await this.interpretNode(node.args.expr, context2);
111183
- evaluateProcessingParameters(node.args.operations, context2.scope, context2.generators);
111184
- return { value: processRecords(value, node.args.operations), lastInsertId };
111200
+ const ops = cloneObject(node.args.operations);
111201
+ evaluateProcessingParameters(ops, context2.scope, context2.generators);
111202
+ return { value: processRecords(value, ops), lastInsertId };
111185
111203
  }
111186
111204
  case "initializeRecord": {
111187
111205
  const { lastInsertId } = await this.interpretNode(node.args.expr, context2);
@@ -111274,12 +111292,13 @@ function mapField2(value, field) {
111274
111292
  }
111275
111293
  return value;
111276
111294
  }
111277
- function attachChildrenToParents(parentRecords, children) {
111295
+ function attachChildrenToParents(parentRecords, children, canAssumeStrictEquality) {
111278
111296
  for (const { joinExpr, childRecords } of children) {
111279
111297
  const parentKeys = joinExpr.on.map(([k2]) => k2);
111280
111298
  const childKeys = joinExpr.on.map(([, k2]) => k2);
111281
111299
  const parentMap = {};
111282
- for (const parent of Array.isArray(parentRecords) ? parentRecords : [parentRecords]) {
111300
+ const parentArray = Array.isArray(parentRecords) ? parentRecords : [parentRecords];
111301
+ for (const parent of parentArray) {
111283
111302
  const parentRecord = asRecord(parent);
111284
111303
  const key = getRecordKey(parentRecord, parentKeys);
111285
111304
  if (!parentMap[key]) {
@@ -111292,11 +111311,12 @@ function attachChildrenToParents(parentRecords, children) {
111292
111311
  parentRecord[joinExpr.parentField] = [];
111293
111312
  }
111294
111313
  }
111314
+ const mappers = canAssumeStrictEquality ? void 0 : inferKeyCasts(parentArray, parentKeys);
111295
111315
  for (const childRecord of Array.isArray(childRecords) ? childRecords : [childRecords]) {
111296
111316
  if (childRecord === null) {
111297
111317
  continue;
111298
111318
  }
111299
- const key = getRecordKey(asRecord(childRecord), childKeys);
111319
+ const key = getRecordKey(asRecord(childRecord), childKeys, mappers);
111300
111320
  for (const parentRecord of parentMap[key] ?? []) {
111301
111321
  if (joinExpr.isRelationUnique) {
111302
111322
  parentRecord[joinExpr.parentField] = childRecord;
@@ -111308,6 +111328,40 @@ function attachChildrenToParents(parentRecords, children) {
111308
111328
  }
111309
111329
  return parentRecords;
111310
111330
  }
111331
+ function inferKeyCasts(rows, keys) {
111332
+ function getKeyCast(type2) {
111333
+ switch (type2) {
111334
+ case "number":
111335
+ return Number;
111336
+ case "string":
111337
+ return String;
111338
+ case "boolean":
111339
+ return Boolean;
111340
+ case "bigint":
111341
+ return BigInt;
111342
+ default:
111343
+ return;
111344
+ }
111345
+ }
111346
+ const keyCasts = Array.from({ length: keys.length });
111347
+ let keysFound = 0;
111348
+ for (const parent of rows) {
111349
+ const parentRecord = asRecord(parent);
111350
+ for (const [i2, key] of keys.entries()) {
111351
+ if (parentRecord[key] !== null && keyCasts[i2] === void 0) {
111352
+ const keyCast = getKeyCast(typeof parentRecord[key]);
111353
+ if (keyCast !== void 0) {
111354
+ keyCasts[i2] = keyCast;
111355
+ }
111356
+ keysFound++;
111357
+ }
111358
+ }
111359
+ if (keysFound === keys.length) {
111360
+ break;
111361
+ }
111362
+ }
111363
+ return keyCasts;
111364
+ }
111311
111365
  function evalFieldInitializer(initializer3, lastInsertId, scope, generators) {
111312
111366
  switch (initializer3.type) {
111313
111367
  case "value":
@@ -111367,6 +111421,9 @@ function evaluateProcessingParameters(ops, scope, generators) {
111367
111421
  evaluateProcessingParameters(nested, scope, generators);
111368
111422
  }
111369
111423
  }
111424
+ function cloneObject(value) {
111425
+ return klona(value);
111426
+ }
111370
111427
  async function getCrypto() {
111371
111428
  return globalThis.crypto ?? await import("node:crypto");
111372
111429
  }
@@ -111483,13 +111540,42 @@ var TransactionManager = class {
111483
111540
  );
111484
111541
  }
111485
111542
  async #startTransactionImpl(options) {
111543
+ if (options.newTxId) {
111544
+ return await this.#withActiveTransactionLock(options.newTxId, "start", async (existing) => {
111545
+ if (existing.status !== "running") {
111546
+ throw new TransactionInternalConsistencyError(
111547
+ `Transaction in invalid state ${existing.status} when starting a nested transaction.`
111548
+ );
111549
+ }
111550
+ if (!existing.transaction) {
111551
+ throw new TransactionInternalConsistencyError(
111552
+ `Transaction missing underlying driver transaction when starting a nested transaction.`
111553
+ );
111554
+ }
111555
+ existing.depth += 1;
111556
+ const savepointName = this.#nextSavepointName(existing);
111557
+ existing.savepoints.push(savepointName);
111558
+ try {
111559
+ await this.#requiredCreateSavepoint(existing.transaction)(savepointName);
111560
+ } catch (e2) {
111561
+ existing.depth -= 1;
111562
+ existing.savepoints.pop();
111563
+ throw e2;
111564
+ }
111565
+ return { id: existing.id };
111566
+ });
111567
+ }
111486
111568
  const transaction = {
111487
111569
  id: await randomUUID2(),
111488
111570
  status: "waiting",
111489
111571
  timer: void 0,
111490
111572
  timeout: options.timeout,
111491
111573
  startedAt: Date.now(),
111492
- transaction: void 0
111574
+ transaction: void 0,
111575
+ operationQueue: Promise.resolve(),
111576
+ depth: 1,
111577
+ savepoints: [],
111578
+ savepointCounter: 0
111493
111579
  };
111494
111580
  const abortController = new AbortController();
111495
111581
  const startTimer = createTimeoutIfDefined(() => abortController.abort(), options.maxWait);
@@ -111523,14 +111609,49 @@ var TransactionManager = class {
111523
111609
  }
111524
111610
  async commitTransaction(transactionId) {
111525
111611
  return await this.tracingHelper.runInChildSpan("commit_transaction", async () => {
111526
- const txw = this.#getActiveOrClosingTransaction(transactionId, "commit");
111527
- await this.#closeTransaction(txw, "committed");
111612
+ await this.#withActiveTransactionLock(transactionId, "commit", async (txw) => {
111613
+ if (txw.depth > 1) {
111614
+ if (!txw.transaction) throw new TransactionNotFoundError();
111615
+ const savepointName = txw.savepoints.at(-1);
111616
+ if (!savepointName) {
111617
+ throw new TransactionInternalConsistencyError(
111618
+ `Missing savepoint for nested commit. Depth: ${txw.depth}, transactionId: ${txw.id}`
111619
+ );
111620
+ }
111621
+ try {
111622
+ await this.#releaseSavepoint(txw.transaction, savepointName);
111623
+ } finally {
111624
+ txw.savepoints.pop();
111625
+ txw.depth -= 1;
111626
+ }
111627
+ return;
111628
+ }
111629
+ await this.#closeTransaction(txw, "committed");
111630
+ });
111528
111631
  });
111529
111632
  }
111530
111633
  async rollbackTransaction(transactionId) {
111531
111634
  return await this.tracingHelper.runInChildSpan("rollback_transaction", async () => {
111532
- const txw = this.#getActiveOrClosingTransaction(transactionId, "rollback");
111533
- await this.#closeTransaction(txw, "rolled_back");
111635
+ await this.#withActiveTransactionLock(transactionId, "rollback", async (txw) => {
111636
+ if (txw.depth > 1) {
111637
+ if (!txw.transaction) throw new TransactionNotFoundError();
111638
+ const savepointName = txw.savepoints.at(-1);
111639
+ if (!savepointName) {
111640
+ throw new TransactionInternalConsistencyError(
111641
+ `Missing savepoint for nested rollback. Depth: ${txw.depth}, transactionId: ${txw.id}`
111642
+ );
111643
+ }
111644
+ try {
111645
+ await this.#requiredRollbackToSavepoint(txw.transaction)(savepointName);
111646
+ await this.#releaseSavepoint(txw.transaction, savepointName);
111647
+ } finally {
111648
+ txw.savepoints.pop();
111649
+ txw.depth -= 1;
111650
+ }
111651
+ return;
111652
+ }
111653
+ await this.#closeTransaction(txw, "rolled_back");
111654
+ });
111534
111655
  });
111535
111656
  }
111536
111657
  async getTransaction(txInfo, operation) {
@@ -111574,22 +111695,90 @@ var TransactionManager = class {
111574
111695
  return transaction;
111575
111696
  }
111576
111697
  async cancelAllTransactions() {
111577
- await Promise.allSettled([...this.transactions.values()].map((tx) => this.#closeTransaction(tx, "rolled_back")));
111698
+ await Promise.allSettled(
111699
+ [...this.transactions.values()].map(
111700
+ (tx) => this.#runSerialized(tx, async () => {
111701
+ const current = this.transactions.get(tx.id);
111702
+ if (current) {
111703
+ await this.#closeTransaction(current, "rolled_back");
111704
+ }
111705
+ })
111706
+ )
111707
+ );
111708
+ }
111709
+ #nextSavepointName(transaction) {
111710
+ return `prisma_sp_${transaction.savepointCounter++}`;
111711
+ }
111712
+ #requiredCreateSavepoint(transaction) {
111713
+ if (transaction.createSavepoint) {
111714
+ return transaction.createSavepoint.bind(transaction);
111715
+ }
111716
+ throw new TransactionManagerError(
111717
+ `Nested transactions are not supported by adapter "${transaction.adapterName}" (${transaction.provider}): createSavepoint is not implemented.`
111718
+ );
111719
+ }
111720
+ #requiredRollbackToSavepoint(transaction) {
111721
+ if (transaction.rollbackToSavepoint) {
111722
+ return transaction.rollbackToSavepoint.bind(transaction);
111723
+ }
111724
+ throw new TransactionManagerError(
111725
+ `Nested transactions are not supported by adapter "${transaction.adapterName}" (${transaction.provider}): rollbackToSavepoint is not implemented.`
111726
+ );
111727
+ }
111728
+ async #releaseSavepoint(transaction, name6) {
111729
+ if (transaction.releaseSavepoint) {
111730
+ await transaction.releaseSavepoint(name6);
111731
+ }
111732
+ }
111733
+ #debugTransactionAlreadyClosedOnTimeout(transactionId) {
111734
+ debug3("Transaction already committed or rolled back when timeout happened.", transactionId);
111578
111735
  }
111579
111736
  #startTransactionTimeout(transactionId, timeout) {
111580
111737
  const timeoutStartedAt = Date.now();
111581
111738
  const timer = createTimeoutIfDefined(async () => {
111582
111739
  debug3("Transaction timed out.", { transactionId, timeoutStartedAt, timeout });
111583
111740
  const tx = this.transactions.get(transactionId);
111584
- if (tx && ["running", "waiting"].includes(tx.status)) {
111585
- await this.#closeTransaction(tx, "timed_out");
111586
- } else {
111587
- debug3("Transaction already committed or rolled back when timeout happened.", transactionId);
111741
+ if (!tx) {
111742
+ this.#debugTransactionAlreadyClosedOnTimeout(transactionId);
111743
+ return;
111588
111744
  }
111745
+ await this.#runSerialized(tx, async () => {
111746
+ const current = this.transactions.get(transactionId);
111747
+ if (current && ["running", "waiting"].includes(current.status)) {
111748
+ await this.#closeTransaction(current, "timed_out");
111749
+ } else {
111750
+ this.#debugTransactionAlreadyClosedOnTimeout(transactionId);
111751
+ }
111752
+ });
111589
111753
  }, timeout);
111590
111754
  timer?.unref?.();
111591
111755
  return timer;
111592
111756
  }
111757
+ // Any operation that mutates or closes a transaction must run through this lock so
111758
+ // status/savepoint/depth checks and updates happen against a stable view of state.
111759
+ async #withActiveTransactionLock(transactionId, operation, callback) {
111760
+ const tx = this.#getActiveOrClosingTransaction(transactionId, operation);
111761
+ return await this.#runSerialized(tx, async () => {
111762
+ const current = this.#getActiveOrClosingTransaction(transactionId, operation);
111763
+ return await callback(current);
111764
+ });
111765
+ }
111766
+ // Serializes operations per transaction id to prevent interleaving across awaits.
111767
+ // This avoids races where one operation mutates savepoint/depth state while another
111768
+ // operation is suspended, which could otherwise corrupt cleanup logic.
111769
+ async #runSerialized(tx, callback) {
111770
+ const previousOperation = tx.operationQueue;
111771
+ let releaseOperationLock;
111772
+ tx.operationQueue = new Promise((resolve) => {
111773
+ releaseOperationLock = resolve;
111774
+ });
111775
+ await previousOperation;
111776
+ try {
111777
+ return await callback();
111778
+ } finally {
111779
+ releaseOperationLock();
111780
+ }
111781
+ }
111593
111782
  async #closeTransaction(tx, status) {
111594
111783
  const createClosingPromise = async () => {
111595
111784
  debug3("Closing transaction.", { transactionId: tx.id, status });
@@ -111669,7 +111858,7 @@ function createTimeoutIfDefined(cb, ms) {
111669
111858
  return ms !== void 0 ? setTimeout(cb, ms) : void 0;
111670
111859
  }
111671
111860
 
111672
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/compose.js
111861
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/compose.js
111673
111862
  var compose = (middleware, onError, onNotFound) => {
111674
111863
  return (context2, next) => {
111675
111864
  let index = -1;
@@ -111713,10 +111902,10 @@ var compose = (middleware, onError, onNotFound) => {
111713
111902
  };
111714
111903
  };
111715
111904
 
111716
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/request/constants.js
111905
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/request/constants.js
111717
111906
  var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
111718
111907
 
111719
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/utils/body.js
111908
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/utils/body.js
111720
111909
  var parseBody = async (request3, options = /* @__PURE__ */ Object.create(null)) => {
111721
111910
  const { all = false, dot = false } = options;
111722
111911
  const headers = request3 instanceof HonoRequest ? request3.raw.headers : request3.headers;
@@ -111785,7 +111974,7 @@ var handleParsingNestedValues = (form, key, value) => {
111785
111974
  });
111786
111975
  };
111787
111976
 
111788
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/request.js
111977
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/request.js
111789
111978
  var tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_);
111790
111979
  var HonoRequest = class {
111791
111980
  /**
@@ -112053,7 +112242,7 @@ var HonoRequest = class {
112053
112242
  }
112054
112243
  };
112055
112244
 
112056
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/utils/html.js
112245
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/utils/html.js
112057
112246
  var HtmlEscapedCallbackPhase = {
112058
112247
  Stringify: 1,
112059
112248
  BeforeStream: 2,
@@ -112095,7 +112284,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context2, buffer) =>
112095
112284
  }
112096
112285
  };
112097
112286
 
112098
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/context.js
112287
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/context.js
112099
112288
  var TEXT_PLAIN = "text/plain; charset=UTF-8";
112100
112289
  var setDefaultContentType = (contentType, headers) => {
112101
112290
  return {
@@ -112103,6 +112292,7 @@ var setDefaultContentType = (contentType, headers) => {
112103
112292
  ...headers
112104
112293
  };
112105
112294
  };
112295
+ var createResponseInstance = (body, init3) => new Response(body, init3);
112106
112296
  var Context = class {
112107
112297
  #rawRequest;
112108
112298
  #req;
@@ -112201,7 +112391,7 @@ var Context = class {
112201
112391
  * The Response object for the current request.
112202
112392
  */
112203
112393
  get res() {
112204
- return this.#res ||= new Response(null, {
112394
+ return this.#res ||= createResponseInstance(null, {
112205
112395
  headers: this.#preparedHeaders ??= new Headers()
112206
112396
  });
112207
112397
  }
@@ -112212,7 +112402,7 @@ var Context = class {
112212
112402
  */
112213
112403
  set res(_res) {
112214
112404
  if (this.#res && _res) {
112215
- _res = new Response(_res.body, _res);
112405
+ _res = createResponseInstance(_res.body, _res);
112216
112406
  for (const [k2, v2] of this.#res.headers.entries()) {
112217
112407
  if (k2 === "content-type") {
112218
112408
  continue;
@@ -112302,7 +112492,7 @@ var Context = class {
112302
112492
  */
112303
112493
  header = (name6, value, options) => {
112304
112494
  if (this.finalized) {
112305
- this.#res = new Response(this.#res.body, this.#res);
112495
+ this.#res = createResponseInstance(this.#res.body, this.#res);
112306
112496
  }
112307
112497
  const headers = this.#res ? this.#res.headers : this.#preparedHeaders ??= new Headers();
112308
112498
  if (value === void 0) {
@@ -112391,7 +112581,7 @@ var Context = class {
112391
112581
  }
112392
112582
  }
112393
112583
  const status = typeof arg === "number" ? arg : arg?.status ?? this.#status;
112394
- return new Response(data, { status, headers: responseHeaders });
112584
+ return createResponseInstance(data, { status, headers: responseHeaders });
112395
112585
  }
112396
112586
  newResponse = (...args) => this.#newResponse(...args);
112397
112587
  /**
@@ -112416,6 +112606,9 @@ var Context = class {
112416
112606
  * ```
112417
112607
  */
112418
112608
  body = (data, arg, headers) => this.#newResponse(data, arg, headers);
112609
+ #useFastPath() {
112610
+ return !this.#preparedHeaders && !this.#status && !this.finalized;
112611
+ }
112419
112612
  /**
112420
112613
  * `.text()` can render text as `Content-Type:text/plain`.
112421
112614
  *
@@ -112429,7 +112622,7 @@ var Context = class {
112429
112622
  * ```
112430
112623
  */
112431
112624
  text = (text, arg, headers) => {
112432
- return !this.#preparedHeaders && !this.#status && !arg && !headers && !this.finalized ? new Response(text) : this.#newResponse(
112625
+ return this.#useFastPath() && !arg && !headers ? createResponseInstance(text) : this.#newResponse(
112433
112626
  text,
112434
112627
  arg,
112435
112628
  setDefaultContentType(TEXT_PLAIN, headers)
@@ -112448,7 +112641,7 @@ var Context = class {
112448
112641
  * ```
112449
112642
  */
112450
112643
  json = (object2, arg, headers) => {
112451
- return this.#newResponse(
112644
+ return this.#useFastPath() && !arg && !headers ? Response.json(object2) : this.#newResponse(
112452
112645
  JSON.stringify(object2),
112453
112646
  arg,
112454
112647
  setDefaultContentType("application/json", headers)
@@ -112496,12 +112689,12 @@ var Context = class {
112496
112689
  * ```
112497
112690
  */
112498
112691
  notFound = () => {
112499
- this.#notFoundHandler ??= () => new Response();
112692
+ this.#notFoundHandler ??= () => createResponseInstance();
112500
112693
  return this.#notFoundHandler(this);
112501
112694
  };
112502
112695
  };
112503
112696
 
112504
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router.js
112697
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/router.js
112505
112698
  var METHOD_NAME_ALL = "ALL";
112506
112699
  var METHOD_NAME_ALL_LOWERCASE = "all";
112507
112700
  var METHODS = ["get", "post", "put", "delete", "options", "patch"];
@@ -112509,10 +112702,10 @@ var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is
112509
112702
  var UnsupportedPathError = class extends Error {
112510
112703
  };
112511
112704
 
112512
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/utils/constants.js
112705
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/utils/constants.js
112513
112706
  var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
112514
112707
 
112515
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/hono-base.js
112708
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/hono-base.js
112516
112709
  var notFoundHandler = (c2) => {
112517
112710
  return c2.text("404 Not Found", 404);
112518
112711
  };
@@ -112883,7 +113076,7 @@ var Hono = class _Hono {
112883
113076
  };
112884
113077
  };
112885
113078
 
112886
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router/reg-exp-router/matcher.js
113079
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/router/reg-exp-router/matcher.js
112887
113080
  var emptyParam = [];
112888
113081
  function match(method, path3) {
112889
113082
  const matchers = this.buildAllMatchers();
@@ -112904,7 +113097,7 @@ function match(method, path3) {
112904
113097
  return match2(method, path3);
112905
113098
  }
112906
113099
 
112907
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router/reg-exp-router/node.js
113100
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/router/reg-exp-router/node.js
112908
113101
  var LABEL_REG_EXP_STR = "[^/]+";
112909
113102
  var ONLY_WILDCARD_REG_EXP_STR = ".*";
112910
113103
  var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
@@ -113012,7 +113205,7 @@ var Node = class _Node {
113012
113205
  }
113013
113206
  };
113014
113207
 
113015
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router/reg-exp-router/trie.js
113208
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/router/reg-exp-router/trie.js
113016
113209
  var Trie = class {
113017
113210
  #context = { varIndex: 0 };
113018
113211
  #root = new Node();
@@ -113068,7 +113261,7 @@ var Trie = class {
113068
113261
  }
113069
113262
  };
113070
113263
 
113071
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router/reg-exp-router/router.js
113264
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/router/reg-exp-router/router.js
113072
113265
  var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)];
113073
113266
  var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
113074
113267
  function buildWildcardRegExp(path3) {
@@ -113247,7 +113440,7 @@ var RegExpRouter = class {
113247
113440
  }
113248
113441
  };
113249
113442
 
113250
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router/smart-router/router.js
113443
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/router/smart-router/router.js
113251
113444
  var SmartRouter = class {
113252
113445
  name = "SmartRouter";
113253
113446
  #routers = [];
@@ -113302,8 +113495,14 @@ var SmartRouter = class {
113302
113495
  }
113303
113496
  };
113304
113497
 
113305
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router/trie-router/node.js
113498
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/router/trie-router/node.js
113306
113499
  var emptyParams = /* @__PURE__ */ Object.create(null);
113500
+ var hasChildren = (children) => {
113501
+ for (const _3 in children) {
113502
+ return true;
113503
+ }
113504
+ return false;
113505
+ };
113307
113506
  var Node2 = class _Node2 {
113308
113507
  #methods;
113309
113508
  #children;
@@ -113353,8 +113552,7 @@ var Node2 = class _Node2 {
113353
113552
  });
113354
113553
  return curNode;
113355
113554
  }
113356
- #getHandlerSets(node, method, nodeParams, params) {
113357
- const handlerSets = [];
113555
+ #pushHandlerSets(handlerSets, node, method, nodeParams, params) {
113358
113556
  for (let i2 = 0, len = node.#methods.length; i2 < len; i2++) {
113359
113557
  const m2 = node.#methods[i2];
113360
113558
  const handlerSet = m2[method] || m2[METHOD_NAME_ALL];
@@ -113372,7 +113570,6 @@ var Node2 = class _Node2 {
113372
113570
  }
113373
113571
  }
113374
113572
  }
113375
- return handlerSets;
113376
113573
  }
113377
113574
  search(method, path3) {
113378
113575
  const handlerSets = [];
@@ -113381,7 +113578,9 @@ var Node2 = class _Node2 {
113381
113578
  let curNodes = [curNode];
113382
113579
  const parts = splitPath(path3);
113383
113580
  const curNodesQueue = [];
113384
- for (let i2 = 0, len = parts.length; i2 < len; i2++) {
113581
+ const len = parts.length;
113582
+ let partOffsets = null;
113583
+ for (let i2 = 0; i2 < len; i2++) {
113385
113584
  const part = parts[i2];
113386
113585
  const isLast = i2 === len - 1;
113387
113586
  const tempNodes = [];
@@ -113392,11 +113591,9 @@ var Node2 = class _Node2 {
113392
113591
  nextNode.#params = node.#params;
113393
113592
  if (isLast) {
113394
113593
  if (nextNode.#children["*"]) {
113395
- handlerSets.push(
113396
- ...this.#getHandlerSets(nextNode.#children["*"], method, node.#params)
113397
- );
113594
+ this.#pushHandlerSets(handlerSets, nextNode.#children["*"], method, node.#params);
113398
113595
  }
113399
- handlerSets.push(...this.#getHandlerSets(nextNode, method, node.#params));
113596
+ this.#pushHandlerSets(handlerSets, nextNode, method, node.#params);
113400
113597
  } else {
113401
113598
  tempNodes.push(nextNode);
113402
113599
  }
@@ -113407,7 +113604,7 @@ var Node2 = class _Node2 {
113407
113604
  if (pattern === "*") {
113408
113605
  const astNode = node.#children["*"];
113409
113606
  if (astNode) {
113410
- handlerSets.push(...this.#getHandlerSets(astNode, method, node.#params));
113607
+ this.#pushHandlerSets(handlerSets, astNode, method, node.#params);
113411
113608
  astNode.#params = params;
113412
113609
  tempNodes.push(astNode);
113413
113610
  }
@@ -113418,13 +113615,21 @@ var Node2 = class _Node2 {
113418
113615
  continue;
113419
113616
  }
113420
113617
  const child = node.#children[key];
113421
- const restPathString = parts.slice(i2).join("/");
113422
113618
  if (matcher instanceof RegExp) {
113619
+ if (partOffsets === null) {
113620
+ partOffsets = new Array(len);
113621
+ let offset = path3[0] === "/" ? 1 : 0;
113622
+ for (let p2 = 0; p2 < len; p2++) {
113623
+ partOffsets[p2] = offset;
113624
+ offset += parts[p2].length + 1;
113625
+ }
113626
+ }
113627
+ const restPathString = path3.substring(partOffsets[i2]);
113423
113628
  const m2 = matcher.exec(restPathString);
113424
113629
  if (m2) {
113425
113630
  params[name6] = m2[0];
113426
- handlerSets.push(...this.#getHandlerSets(child, method, node.#params, params));
113427
- if (Object.keys(child.#children).length) {
113631
+ this.#pushHandlerSets(handlerSets, child, method, node.#params, params);
113632
+ if (hasChildren(child.#children)) {
113428
113633
  child.#params = params;
113429
113634
  const componentCount = m2[0].match(/\//)?.length ?? 0;
113430
113635
  const targetCurNodes = curNodesQueue[componentCount] ||= [];
@@ -113436,10 +113641,14 @@ var Node2 = class _Node2 {
113436
113641
  if (matcher === true || matcher.test(part)) {
113437
113642
  params[name6] = part;
113438
113643
  if (isLast) {
113439
- handlerSets.push(...this.#getHandlerSets(child, method, params, node.#params));
113644
+ this.#pushHandlerSets(handlerSets, child, method, params, node.#params);
113440
113645
  if (child.#children["*"]) {
113441
- handlerSets.push(
113442
- ...this.#getHandlerSets(child.#children["*"], method, params, node.#params)
113646
+ this.#pushHandlerSets(
113647
+ handlerSets,
113648
+ child.#children["*"],
113649
+ method,
113650
+ params,
113651
+ node.#params
113443
113652
  );
113444
113653
  }
113445
113654
  } else {
@@ -113449,7 +113658,8 @@ var Node2 = class _Node2 {
113449
113658
  }
113450
113659
  }
113451
113660
  }
113452
- curNodes = tempNodes.concat(curNodesQueue.shift() ?? []);
113661
+ const shifted = curNodesQueue.shift();
113662
+ curNodes = shifted ? tempNodes.concat(shifted) : tempNodes;
113453
113663
  }
113454
113664
  if (handlerSets.length > 1) {
113455
113665
  handlerSets.sort((a2, b2) => {
@@ -113460,7 +113670,7 @@ var Node2 = class _Node2 {
113460
113670
  }
113461
113671
  };
113462
113672
 
113463
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router/trie-router/router.js
113673
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/router/trie-router/router.js
113464
113674
  var TrieRouter = class {
113465
113675
  name = "TrieRouter";
113466
113676
  #node;
@@ -113482,7 +113692,7 @@ var TrieRouter = class {
113482
113692
  }
113483
113693
  };
113484
113694
 
113485
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/hono.js
113695
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/hono.js
113486
113696
  var Hono2 = class extends Hono {
113487
113697
  /**
113488
113698
  * Creates an instance of the Hono class.
@@ -113806,7 +114016,7 @@ function runInActiveSpan(nameOrOptions, fn2) {
113806
114016
  var mariadb = __toESM(require_promise(), 1);
113807
114017
  var name = "@prisma/adapter-mariadb";
113808
114018
  var UNSIGNED_FLAG = 1 << 5;
113809
- var BINARY_FLAG = 1 << 7;
114019
+ var BINARY_COLLATION_INDEX = 63;
113810
114020
  function mapColumnType(field) {
113811
114021
  switch (field.type) {
113812
114022
  case "TINY":
@@ -113849,7 +114059,7 @@ function mapColumnType(field) {
113849
114059
  case "LONG_BLOB":
113850
114060
  if (field["dataTypeFormat"] === "json") {
113851
114061
  return ColumnTypeEnum.Json;
113852
- } else if (field.flags.valueOf() & BINARY_FLAG) {
114062
+ } else if (field.collation.index === BINARY_COLLATION_INDEX) {
113853
114063
  return ColumnTypeEnum.Bytes;
113854
114064
  } else {
113855
114065
  return ColumnTypeEnum.Text;
@@ -114128,6 +114338,15 @@ var MariaDbTransaction = class extends MariaDbQueryable {
114128
114338
  this.cleanup?.();
114129
114339
  await this.client.end();
114130
114340
  }
114341
+ async createSavepoint(name22) {
114342
+ await this.executeRaw({ sql: `SAVEPOINT ${name22}`, args: [], argTypes: [] });
114343
+ }
114344
+ async rollbackToSavepoint(name22) {
114345
+ await this.executeRaw({ sql: `ROLLBACK TO ${name22}`, args: [], argTypes: [] });
114346
+ }
114347
+ async releaseSavepoint(name22) {
114348
+ await this.executeRaw({ sql: `RELEASE SAVEPOINT ${name22}`, args: [], argTypes: [] });
114349
+ }
114131
114350
  };
114132
114351
  var PrismaMariaDbAdapter = class extends MariaDbQueryable {
114133
114352
  constructor(client, capabilities, options) {
@@ -114235,7 +114454,7 @@ function inferCapabilities(version5) {
114235
114454
  const [versionStr, suffix] = version5.split("-");
114236
114455
  const [major2, minor, patch] = versionStr.split(".").map((n2) => parseInt(n2, 10));
114237
114456
  const isMariaDB = suffix?.toLowerCase()?.includes("mariadb") ?? false;
114238
- const supportsRelationJoins = !isMariaDB && (major2 > 8 || major2 === 8 && minor >= 0 && patch >= 13);
114457
+ const supportsRelationJoins = !isMariaDB && (major2 > 8 || major2 === 8 && (minor > 0 || minor === 0 && patch >= 13));
114239
114458
  return { supportsRelationJoins };
114240
114459
  }
114241
114460
  function rewriteConnectionString(config3) {
@@ -115156,6 +115375,12 @@ var MssqlTransaction = class extends MssqlQueryable {
115156
115375
  release2();
115157
115376
  }
115158
115377
  }
115378
+ async createSavepoint(name22) {
115379
+ await this.executeRaw({ sql: `SAVE TRANSACTION ${name22}`, args: [], argTypes: [] });
115380
+ }
115381
+ async rollbackToSavepoint(name22) {
115382
+ await this.executeRaw({ sql: `ROLLBACK TRANSACTION ${name22}`, args: [], argTypes: [] });
115383
+ }
115159
115384
  };
115160
115385
  var PrismaMssqlAdapter = class extends MssqlQueryable {
115161
115386
  constructor(pool2, options) {
@@ -115898,6 +116123,15 @@ var PgTransaction = class extends PgQueryable {
115898
116123
  this.cleanup?.();
115899
116124
  this.client.release();
115900
116125
  }
116126
+ async createSavepoint(name22) {
116127
+ await this.executeRaw({ sql: `SAVEPOINT ${name22}`, args: [], argTypes: [] });
116128
+ }
116129
+ async rollbackToSavepoint(name22) {
116130
+ await this.executeRaw({ sql: `ROLLBACK TO SAVEPOINT ${name22}`, args: [], argTypes: [] });
116131
+ }
116132
+ async releaseSavepoint(name22) {
116133
+ await this.executeRaw({ sql: `RELEASE SAVEPOINT ${name22}`, args: [], argTypes: [] });
116134
+ }
115901
116135
  };
115902
116136
  var PrismaPgAdapter = class extends PgQueryable {
115903
116137
  constructor(client, pgOptions, release2) {
@@ -116094,13 +116328,15 @@ function createConnectionStringRegex(protocols) {
116094
116328
  }
116095
116329
  function wrapFactory(protocols, factory) {
116096
116330
  return {
116097
- ...factory,
116331
+ adapterName: factory.adapterName,
116332
+ provider: factory.provider,
116098
116333
  connect: () => factory.connect().then(wrapAdapter.bind(null, protocols), rethrowSanitizedError.bind(null, protocols))
116099
116334
  };
116100
116335
  }
116101
116336
  function wrapAdapter(protocols, adapter) {
116102
116337
  return {
116103
- ...adapter,
116338
+ adapterName: adapter.adapterName,
116339
+ provider: adapter.provider,
116104
116340
  dispose: () => adapter.dispose().catch(rethrowSanitizedError.bind(null, protocols)),
116105
116341
  executeRaw: (query2) => adapter.executeRaw(query2).catch(rethrowSanitizedError.bind(null, protocols)),
116106
116342
  queryRaw: (query2) => adapter.queryRaw(query2).catch(rethrowSanitizedError.bind(null, protocols)),
@@ -116111,11 +116347,16 @@ function wrapAdapter(protocols, adapter) {
116111
116347
  }
116112
116348
  function wrapTransaction(protocols, tx) {
116113
116349
  return {
116114
- ...tx,
116350
+ adapterName: tx.adapterName,
116351
+ provider: tx.provider,
116352
+ options: tx.options,
116115
116353
  commit: () => tx.commit().catch(rethrowSanitizedError.bind(null, protocols)),
116116
116354
  rollback: () => tx.rollback().catch(rethrowSanitizedError.bind(null, protocols)),
116117
116355
  executeRaw: (query2) => tx.executeRaw(query2).catch(rethrowSanitizedError.bind(null, protocols)),
116118
- queryRaw: (query2) => tx.queryRaw(query2).catch(rethrowSanitizedError.bind(null, protocols))
116356
+ queryRaw: (query2) => tx.queryRaw(query2).catch(rethrowSanitizedError.bind(null, protocols)),
116357
+ createSavepoint: tx.createSavepoint ? (name6) => tx.createSavepoint(name6).catch(rethrowSanitizedError.bind(null, protocols)) : void 0,
116358
+ rollbackToSavepoint: tx.rollbackToSavepoint ? (name6) => tx.rollbackToSavepoint(name6).catch(rethrowSanitizedError.bind(null, protocols)) : void 0,
116359
+ releaseSavepoint: tx.releaseSavepoint ? (name6) => tx.releaseSavepoint(name6).catch(rethrowSanitizedError.bind(null, protocols)) : void 0
116119
116360
  };
116120
116361
  }
116121
116362
 
@@ -116238,7 +116479,7 @@ function logQuery(event) {
116238
116479
  });
116239
116480
  }
116240
116481
 
116241
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/helper/factory/index.js
116482
+ // ../../node_modules/.pnpm/hono@4.12.0/node_modules/hono/dist/helper/factory/index.js
116242
116483
  var createMiddleware = (middleware) => middleware;
116243
116484
 
116244
116485
  // src/server/middleware/client-telemetry.ts
@@ -128420,7 +128661,8 @@ var QueryRequestBody = external_exports.object({
128420
128661
  var TransactionStartRequestBody = external_exports.object({
128421
128662
  timeout: external_exports.number().optional(),
128422
128663
  maxWait: external_exports.number().optional(),
128423
- isolationLevel: external_exports.enum(["READ UNCOMMITTED", "READ COMMITTED", "REPEATABLE READ", "SNAPSHOT", "SERIALIZABLE"]).optional()
128664
+ isolationLevel: external_exports.enum(["READ UNCOMMITTED", "READ COMMITTED", "REPEATABLE READ", "SNAPSHOT", "SERIALIZABLE"]).optional(),
128665
+ newTxId: external_exports.string().optional()
128424
128666
  });
128425
128667
 
128426
128668
  // src/server/server.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/query-plan-executor",
3
- "version": "7.5.0-dev.3",
3
+ "version": "7.5.0-dev.31",
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",
@@ -18,13 +18,12 @@
18
18
  "@opentelemetry/sdk-trace-base": "2.1.0",
19
19
  "hono": "4.11.7",
20
20
  "temporal-polyfill": "0.3.0",
21
- "vitest": "3.2.4",
22
21
  "zod": "4.1.3",
23
- "@prisma/adapter-pg": "7.5.0-dev.3",
24
- "@prisma/adapter-mariadb": "7.5.0-dev.3",
25
- "@prisma/adapter-mssql": "7.5.0-dev.3",
26
- "@prisma/driver-adapter-utils": "7.5.0-dev.3",
27
- "@prisma/client-engine-runtime": "7.5.0-dev.3"
22
+ "@prisma/adapter-pg": "7.5.0-dev.31",
23
+ "@prisma/adapter-mariadb": "7.5.0-dev.31",
24
+ "@prisma/adapter-mssql": "7.5.0-dev.31",
25
+ "@prisma/driver-adapter-utils": "7.5.0-dev.31",
26
+ "@prisma/client-engine-runtime": "7.5.0-dev.31"
28
27
  },
29
28
  "files": [
30
29
  "dist"