@prisma/query-plan-executor 7.5.0-dev.4 → 7.5.0-dev.41

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 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.4";
101328
+ var version = "7.5.0-dev.41";
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.3/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.3/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.3/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.3/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.3/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.3/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\-]+\=([^;]+))*$/;
@@ -106528,7 +106530,7 @@ var validator = (target, validationFunc) => {
106528
106530
  throw new HTTPException(400, { message });
106529
106531
  }
106530
106532
  }
106531
- const form = {};
106533
+ const form = /* @__PURE__ */ Object.create(null);
106532
106534
  formData.forEach((value2, key) => {
106533
106535
  if (key.endsWith("[]")) {
106534
106536
  ;
@@ -106536,7 +106538,7 @@ var validator = (target, validationFunc) => {
106536
106538
  } else if (Array.isArray(form[key])) {
106537
106539
  ;
106538
106540
  form[key].push(value2);
106539
- } else if (key in form) {
106541
+ } else if (Object.hasOwn(form, key)) {
106540
106542
  form[key] = [form[key], value2];
106541
106543
  } else {
106542
106544
  form[key] = value2;
@@ -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.3_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) => {
@@ -106735,20 +106737,20 @@ var PrismaClientValidationError = class extends Error {
106735
106737
  };
106736
106738
  setClassName(PrismaClientValidationError, "PrismaClientValidationError");
106737
106739
  var secret = Symbol();
106738
- var representations = /* @__PURE__ */ new WeakMap();
106739
106740
  var ObjectEnumValue = class {
106741
+ #representation;
106740
106742
  constructor(arg) {
106741
106743
  if (arg === secret) {
106742
- representations.set(this, `Prisma.${this._getName()}`);
106744
+ this.#representation = `Prisma.${this._getName()}`;
106743
106745
  } else {
106744
- representations.set(this, `new Prisma.${this._getNamespace()}.${this._getName()}()`);
106746
+ this.#representation = `new Prisma.${this._getNamespace()}.${this._getName()}()`;
106745
106747
  }
106746
106748
  }
106747
106749
  _getName() {
106748
106750
  return this.constructor.name;
106749
106751
  }
106750
106752
  toString() {
106751
- return representations.get(this);
106753
+ return this.#representation;
106752
106754
  }
106753
106755
  };
106754
106756
  function setClassName2(classObject, name6) {
@@ -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.3/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.3/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.3/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.3/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.3/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.3/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
  /**
@@ -112496,12 +112686,12 @@ var Context = class {
112496
112686
  * ```
112497
112687
  */
112498
112688
  notFound = () => {
112499
- this.#notFoundHandler ??= () => new Response();
112689
+ this.#notFoundHandler ??= () => createResponseInstance();
112500
112690
  return this.#notFoundHandler(this);
112501
112691
  };
112502
112692
  };
112503
112693
 
112504
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router.js
112694
+ // ../../node_modules/.pnpm/hono@4.12.3/node_modules/hono/dist/router.js
112505
112695
  var METHOD_NAME_ALL = "ALL";
112506
112696
  var METHOD_NAME_ALL_LOWERCASE = "all";
112507
112697
  var METHODS = ["get", "post", "put", "delete", "options", "patch"];
@@ -112509,10 +112699,10 @@ var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is
112509
112699
  var UnsupportedPathError = class extends Error {
112510
112700
  };
112511
112701
 
112512
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/utils/constants.js
112702
+ // ../../node_modules/.pnpm/hono@4.12.3/node_modules/hono/dist/utils/constants.js
112513
112703
  var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
112514
112704
 
112515
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/hono-base.js
112705
+ // ../../node_modules/.pnpm/hono@4.12.3/node_modules/hono/dist/hono-base.js
112516
112706
  var notFoundHandler = (c2) => {
112517
112707
  return c2.text("404 Not Found", 404);
112518
112708
  };
@@ -112883,7 +113073,7 @@ var Hono = class _Hono {
112883
113073
  };
112884
113074
  };
112885
113075
 
112886
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router/reg-exp-router/matcher.js
113076
+ // ../../node_modules/.pnpm/hono@4.12.3/node_modules/hono/dist/router/reg-exp-router/matcher.js
112887
113077
  var emptyParam = [];
112888
113078
  function match(method, path3) {
112889
113079
  const matchers = this.buildAllMatchers();
@@ -112904,7 +113094,7 @@ function match(method, path3) {
112904
113094
  return match2(method, path3);
112905
113095
  }
112906
113096
 
112907
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router/reg-exp-router/node.js
113097
+ // ../../node_modules/.pnpm/hono@4.12.3/node_modules/hono/dist/router/reg-exp-router/node.js
112908
113098
  var LABEL_REG_EXP_STR = "[^/]+";
112909
113099
  var ONLY_WILDCARD_REG_EXP_STR = ".*";
112910
113100
  var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
@@ -113012,7 +113202,7 @@ var Node = class _Node {
113012
113202
  }
113013
113203
  };
113014
113204
 
113015
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router/reg-exp-router/trie.js
113205
+ // ../../node_modules/.pnpm/hono@4.12.3/node_modules/hono/dist/router/reg-exp-router/trie.js
113016
113206
  var Trie = class {
113017
113207
  #context = { varIndex: 0 };
113018
113208
  #root = new Node();
@@ -113068,7 +113258,7 @@ var Trie = class {
113068
113258
  }
113069
113259
  };
113070
113260
 
113071
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router/reg-exp-router/router.js
113261
+ // ../../node_modules/.pnpm/hono@4.12.3/node_modules/hono/dist/router/reg-exp-router/router.js
113072
113262
  var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)];
113073
113263
  var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
113074
113264
  function buildWildcardRegExp(path3) {
@@ -113247,7 +113437,7 @@ var RegExpRouter = class {
113247
113437
  }
113248
113438
  };
113249
113439
 
113250
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router/smart-router/router.js
113440
+ // ../../node_modules/.pnpm/hono@4.12.3/node_modules/hono/dist/router/smart-router/router.js
113251
113441
  var SmartRouter = class {
113252
113442
  name = "SmartRouter";
113253
113443
  #routers = [];
@@ -113302,8 +113492,14 @@ var SmartRouter = class {
113302
113492
  }
113303
113493
  };
113304
113494
 
113305
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router/trie-router/node.js
113495
+ // ../../node_modules/.pnpm/hono@4.12.3/node_modules/hono/dist/router/trie-router/node.js
113306
113496
  var emptyParams = /* @__PURE__ */ Object.create(null);
113497
+ var hasChildren = (children) => {
113498
+ for (const _3 in children) {
113499
+ return true;
113500
+ }
113501
+ return false;
113502
+ };
113307
113503
  var Node2 = class _Node2 {
113308
113504
  #methods;
113309
113505
  #children;
@@ -113353,8 +113549,7 @@ var Node2 = class _Node2 {
113353
113549
  });
113354
113550
  return curNode;
113355
113551
  }
113356
- #getHandlerSets(node, method, nodeParams, params) {
113357
- const handlerSets = [];
113552
+ #pushHandlerSets(handlerSets, node, method, nodeParams, params) {
113358
113553
  for (let i2 = 0, len = node.#methods.length; i2 < len; i2++) {
113359
113554
  const m2 = node.#methods[i2];
113360
113555
  const handlerSet = m2[method] || m2[METHOD_NAME_ALL];
@@ -113372,7 +113567,6 @@ var Node2 = class _Node2 {
113372
113567
  }
113373
113568
  }
113374
113569
  }
113375
- return handlerSets;
113376
113570
  }
113377
113571
  search(method, path3) {
113378
113572
  const handlerSets = [];
@@ -113381,7 +113575,9 @@ var Node2 = class _Node2 {
113381
113575
  let curNodes = [curNode];
113382
113576
  const parts = splitPath(path3);
113383
113577
  const curNodesQueue = [];
113384
- for (let i2 = 0, len = parts.length; i2 < len; i2++) {
113578
+ const len = parts.length;
113579
+ let partOffsets = null;
113580
+ for (let i2 = 0; i2 < len; i2++) {
113385
113581
  const part = parts[i2];
113386
113582
  const isLast = i2 === len - 1;
113387
113583
  const tempNodes = [];
@@ -113392,11 +113588,9 @@ var Node2 = class _Node2 {
113392
113588
  nextNode.#params = node.#params;
113393
113589
  if (isLast) {
113394
113590
  if (nextNode.#children["*"]) {
113395
- handlerSets.push(
113396
- ...this.#getHandlerSets(nextNode.#children["*"], method, node.#params)
113397
- );
113591
+ this.#pushHandlerSets(handlerSets, nextNode.#children["*"], method, node.#params);
113398
113592
  }
113399
- handlerSets.push(...this.#getHandlerSets(nextNode, method, node.#params));
113593
+ this.#pushHandlerSets(handlerSets, nextNode, method, node.#params);
113400
113594
  } else {
113401
113595
  tempNodes.push(nextNode);
113402
113596
  }
@@ -113407,7 +113601,7 @@ var Node2 = class _Node2 {
113407
113601
  if (pattern === "*") {
113408
113602
  const astNode = node.#children["*"];
113409
113603
  if (astNode) {
113410
- handlerSets.push(...this.#getHandlerSets(astNode, method, node.#params));
113604
+ this.#pushHandlerSets(handlerSets, astNode, method, node.#params);
113411
113605
  astNode.#params = params;
113412
113606
  tempNodes.push(astNode);
113413
113607
  }
@@ -113418,13 +113612,21 @@ var Node2 = class _Node2 {
113418
113612
  continue;
113419
113613
  }
113420
113614
  const child = node.#children[key];
113421
- const restPathString = parts.slice(i2).join("/");
113422
113615
  if (matcher instanceof RegExp) {
113616
+ if (partOffsets === null) {
113617
+ partOffsets = new Array(len);
113618
+ let offset = path3[0] === "/" ? 1 : 0;
113619
+ for (let p2 = 0; p2 < len; p2++) {
113620
+ partOffsets[p2] = offset;
113621
+ offset += parts[p2].length + 1;
113622
+ }
113623
+ }
113624
+ const restPathString = path3.substring(partOffsets[i2]);
113423
113625
  const m2 = matcher.exec(restPathString);
113424
113626
  if (m2) {
113425
113627
  params[name6] = m2[0];
113426
- handlerSets.push(...this.#getHandlerSets(child, method, node.#params, params));
113427
- if (Object.keys(child.#children).length) {
113628
+ this.#pushHandlerSets(handlerSets, child, method, node.#params, params);
113629
+ if (hasChildren(child.#children)) {
113428
113630
  child.#params = params;
113429
113631
  const componentCount = m2[0].match(/\//)?.length ?? 0;
113430
113632
  const targetCurNodes = curNodesQueue[componentCount] ||= [];
@@ -113436,10 +113638,14 @@ var Node2 = class _Node2 {
113436
113638
  if (matcher === true || matcher.test(part)) {
113437
113639
  params[name6] = part;
113438
113640
  if (isLast) {
113439
- handlerSets.push(...this.#getHandlerSets(child, method, params, node.#params));
113641
+ this.#pushHandlerSets(handlerSets, child, method, params, node.#params);
113440
113642
  if (child.#children["*"]) {
113441
- handlerSets.push(
113442
- ...this.#getHandlerSets(child.#children["*"], method, params, node.#params)
113643
+ this.#pushHandlerSets(
113644
+ handlerSets,
113645
+ child.#children["*"],
113646
+ method,
113647
+ params,
113648
+ node.#params
113443
113649
  );
113444
113650
  }
113445
113651
  } else {
@@ -113449,7 +113655,8 @@ var Node2 = class _Node2 {
113449
113655
  }
113450
113656
  }
113451
113657
  }
113452
- curNodes = tempNodes.concat(curNodesQueue.shift() ?? []);
113658
+ const shifted = curNodesQueue.shift();
113659
+ curNodes = shifted ? tempNodes.concat(shifted) : tempNodes;
113453
113660
  }
113454
113661
  if (handlerSets.length > 1) {
113455
113662
  handlerSets.sort((a2, b2) => {
@@ -113460,7 +113667,7 @@ var Node2 = class _Node2 {
113460
113667
  }
113461
113668
  };
113462
113669
 
113463
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router/trie-router/router.js
113670
+ // ../../node_modules/.pnpm/hono@4.12.3/node_modules/hono/dist/router/trie-router/router.js
113464
113671
  var TrieRouter = class {
113465
113672
  name = "TrieRouter";
113466
113673
  #node;
@@ -113482,7 +113689,7 @@ var TrieRouter = class {
113482
113689
  }
113483
113690
  };
113484
113691
 
113485
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/hono.js
113692
+ // ../../node_modules/.pnpm/hono@4.12.3/node_modules/hono/dist/hono.js
113486
113693
  var Hono2 = class extends Hono {
113487
113694
  /**
113488
113695
  * Creates an instance of the Hono class.
@@ -113806,7 +114013,7 @@ function runInActiveSpan(nameOrOptions, fn2) {
113806
114013
  var mariadb = __toESM(require_promise(), 1);
113807
114014
  var name = "@prisma/adapter-mariadb";
113808
114015
  var UNSIGNED_FLAG = 1 << 5;
113809
- var BINARY_FLAG = 1 << 7;
114016
+ var BINARY_COLLATION_INDEX = 63;
113810
114017
  function mapColumnType(field) {
113811
114018
  switch (field.type) {
113812
114019
  case "TINY":
@@ -113849,7 +114056,7 @@ function mapColumnType(field) {
113849
114056
  case "LONG_BLOB":
113850
114057
  if (field["dataTypeFormat"] === "json") {
113851
114058
  return ColumnTypeEnum.Json;
113852
- } else if (field.flags.valueOf() & BINARY_FLAG) {
114059
+ } else if (field.collation.index === BINARY_COLLATION_INDEX) {
113853
114060
  return ColumnTypeEnum.Bytes;
113854
114061
  } else {
113855
114062
  return ColumnTypeEnum.Text;
@@ -114101,7 +114308,7 @@ var MariaDbQueryable = class {
114101
114308
  typeCast
114102
114309
  };
114103
114310
  const values = args.map((arg, i2) => mapArg(arg, query2.argTypes[i2]));
114104
- return await this.client.query(req, values);
114311
+ return await this.client.execute(req, values);
114105
114312
  } catch (e2) {
114106
114313
  const error44 = e2;
114107
114314
  this.onError(error44);
@@ -114115,18 +114322,40 @@ var MariaDbQueryable = class {
114115
114322
  var MariaDbTransaction = class extends MariaDbQueryable {
114116
114323
  constructor(conn, options, cleanup) {
114117
114324
  super(conn);
114325
+ this.conn = conn;
114118
114326
  this.options = options;
114119
114327
  this.cleanup = cleanup;
114120
114328
  }
114121
114329
  async commit() {
114122
114330
  debug4(`[js::commit]`);
114123
- this.cleanup?.();
114124
- await this.client.end();
114331
+ try {
114332
+ await this.client.query({ sql: "COMMIT" });
114333
+ } catch (err) {
114334
+ this.onError(err);
114335
+ } finally {
114336
+ this.cleanup?.();
114337
+ await this.client.end();
114338
+ }
114125
114339
  }
114126
114340
  async rollback() {
114127
114341
  debug4(`[js::rollback]`);
114128
- this.cleanup?.();
114129
- await this.client.end();
114342
+ try {
114343
+ await this.client.query({ sql: "ROLLBACK" });
114344
+ } catch (err) {
114345
+ this.onError(err);
114346
+ } finally {
114347
+ this.cleanup?.();
114348
+ await this.client.end();
114349
+ }
114350
+ }
114351
+ async createSavepoint(name22) {
114352
+ await this.client.query({ sql: `SAVEPOINT ${name22}` }).catch(this.onError.bind(this));
114353
+ }
114354
+ async rollbackToSavepoint(name22) {
114355
+ await this.client.query({ sql: `ROLLBACK TO ${name22}` }).catch(this.onError.bind(this));
114356
+ }
114357
+ async releaseSavepoint(name22) {
114358
+ await this.client.query({ sql: `RELEASE SAVEPOINT ${name22}` }).catch(this.onError.bind(this));
114130
114359
  }
114131
114360
  };
114132
114361
  var PrismaMariaDbAdapter = class extends MariaDbQueryable {
@@ -114146,7 +114375,7 @@ var PrismaMariaDbAdapter = class extends MariaDbQueryable {
114146
114375
  }
114147
114376
  async startTransaction(isolationLevel) {
114148
114377
  const options = {
114149
- usePhantomQuery: false
114378
+ usePhantomQuery: true
114150
114379
  };
114151
114380
  const tag2 = "[js::startTransaction]";
114152
114381
  debug4("%s options: %O", tag2, options);
@@ -114168,7 +114397,7 @@ var PrismaMariaDbAdapter = class extends MariaDbQueryable {
114168
114397
  argTypes: []
114169
114398
  });
114170
114399
  }
114171
- await tx.executeRaw({ sql: "BEGIN", args: [], argTypes: [] });
114400
+ await tx.conn.query({ sql: "BEGIN" }).catch(this.onError.bind(this));
114172
114401
  return tx;
114173
114402
  } catch (error44) {
114174
114403
  await conn.end();
@@ -114235,7 +114464,7 @@ function inferCapabilities(version5) {
114235
114464
  const [versionStr, suffix] = version5.split("-");
114236
114465
  const [major2, minor, patch] = versionStr.split(".").map((n2) => parseInt(n2, 10));
114237
114466
  const isMariaDB = suffix?.toLowerCase()?.includes("mariadb") ?? false;
114238
- const supportsRelationJoins = !isMariaDB && (major2 > 8 || major2 === 8 && minor >= 0 && patch >= 13);
114467
+ const supportsRelationJoins = !isMariaDB && (major2 > 8 || major2 === 8 && (minor > 0 || minor === 0 && patch >= 13));
114239
114468
  return { supportsRelationJoins };
114240
114469
  }
114241
114470
  function rewriteConnectionString(config3) {
@@ -115156,6 +115385,12 @@ var MssqlTransaction = class extends MssqlQueryable {
115156
115385
  release2();
115157
115386
  }
115158
115387
  }
115388
+ async createSavepoint(name22) {
115389
+ await this.executeRaw({ sql: `SAVE TRANSACTION ${name22}`, args: [], argTypes: [] });
115390
+ }
115391
+ async rollbackToSavepoint(name22) {
115392
+ await this.executeRaw({ sql: `ROLLBACK TRANSACTION ${name22}`, args: [], argTypes: [] });
115393
+ }
115159
115394
  };
115160
115395
  var PrismaMssqlAdapter = class extends MssqlQueryable {
115161
115396
  constructor(pool2, options) {
@@ -115898,6 +116133,15 @@ var PgTransaction = class extends PgQueryable {
115898
116133
  this.cleanup?.();
115899
116134
  this.client.release();
115900
116135
  }
116136
+ async createSavepoint(name22) {
116137
+ await this.executeRaw({ sql: `SAVEPOINT ${name22}`, args: [], argTypes: [] });
116138
+ }
116139
+ async rollbackToSavepoint(name22) {
116140
+ await this.executeRaw({ sql: `ROLLBACK TO SAVEPOINT ${name22}`, args: [], argTypes: [] });
116141
+ }
116142
+ async releaseSavepoint(name22) {
116143
+ await this.executeRaw({ sql: `RELEASE SAVEPOINT ${name22}`, args: [], argTypes: [] });
116144
+ }
115901
116145
  };
115902
116146
  var PrismaPgAdapter = class extends PgQueryable {
115903
116147
  constructor(client, pgOptions, release2) {
@@ -116094,13 +116338,15 @@ function createConnectionStringRegex(protocols) {
116094
116338
  }
116095
116339
  function wrapFactory(protocols, factory) {
116096
116340
  return {
116097
- ...factory,
116341
+ adapterName: factory.adapterName,
116342
+ provider: factory.provider,
116098
116343
  connect: () => factory.connect().then(wrapAdapter.bind(null, protocols), rethrowSanitizedError.bind(null, protocols))
116099
116344
  };
116100
116345
  }
116101
116346
  function wrapAdapter(protocols, adapter) {
116102
116347
  return {
116103
- ...adapter,
116348
+ adapterName: adapter.adapterName,
116349
+ provider: adapter.provider,
116104
116350
  dispose: () => adapter.dispose().catch(rethrowSanitizedError.bind(null, protocols)),
116105
116351
  executeRaw: (query2) => adapter.executeRaw(query2).catch(rethrowSanitizedError.bind(null, protocols)),
116106
116352
  queryRaw: (query2) => adapter.queryRaw(query2).catch(rethrowSanitizedError.bind(null, protocols)),
@@ -116111,11 +116357,16 @@ function wrapAdapter(protocols, adapter) {
116111
116357
  }
116112
116358
  function wrapTransaction(protocols, tx) {
116113
116359
  return {
116114
- ...tx,
116360
+ adapterName: tx.adapterName,
116361
+ provider: tx.provider,
116362
+ options: tx.options,
116115
116363
  commit: () => tx.commit().catch(rethrowSanitizedError.bind(null, protocols)),
116116
116364
  rollback: () => tx.rollback().catch(rethrowSanitizedError.bind(null, protocols)),
116117
116365
  executeRaw: (query2) => tx.executeRaw(query2).catch(rethrowSanitizedError.bind(null, protocols)),
116118
- queryRaw: (query2) => tx.queryRaw(query2).catch(rethrowSanitizedError.bind(null, protocols))
116366
+ queryRaw: (query2) => tx.queryRaw(query2).catch(rethrowSanitizedError.bind(null, protocols)),
116367
+ createSavepoint: tx.createSavepoint ? (name6) => tx.createSavepoint(name6).catch(rethrowSanitizedError.bind(null, protocols)) : void 0,
116368
+ rollbackToSavepoint: tx.rollbackToSavepoint ? (name6) => tx.rollbackToSavepoint(name6).catch(rethrowSanitizedError.bind(null, protocols)) : void 0,
116369
+ releaseSavepoint: tx.releaseSavepoint ? (name6) => tx.releaseSavepoint(name6).catch(rethrowSanitizedError.bind(null, protocols)) : void 0
116119
116370
  };
116120
116371
  }
116121
116372
 
@@ -116238,7 +116489,7 @@ function logQuery(event) {
116238
116489
  });
116239
116490
  }
116240
116491
 
116241
- // ../../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/helper/factory/index.js
116492
+ // ../../node_modules/.pnpm/hono@4.12.3/node_modules/hono/dist/helper/factory/index.js
116242
116493
  var createMiddleware = (middleware) => middleware;
116243
116494
 
116244
116495
  // src/server/middleware/client-telemetry.ts
@@ -128420,7 +128671,8 @@ var QueryRequestBody = external_exports.object({
128420
128671
  var TransactionStartRequestBody = external_exports.object({
128421
128672
  timeout: external_exports.number().optional(),
128422
128673
  maxWait: external_exports.number().optional(),
128423
- isolationLevel: external_exports.enum(["READ UNCOMMITTED", "READ COMMITTED", "REPEATABLE READ", "SNAPSHOT", "SERIALIZABLE"]).optional()
128674
+ isolationLevel: external_exports.enum(["READ UNCOMMITTED", "READ COMMITTED", "REPEATABLE READ", "SNAPSHOT", "SERIALIZABLE"]).optional(),
128675
+ newTxId: external_exports.string().optional()
128424
128676
  });
128425
128677
 
128426
128678
  // src/server/server.ts