@prisma/query-plan-executor 7.2.0-integration-fix-enums-mapped-types-v7.2 → 7.2.0

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.
Files changed (2) hide show
  1. package/dist/index.js +36 -79
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -97773,7 +97773,7 @@ __export(index_exports, {
97773
97773
  module.exports = __toCommonJS(index_exports);
97774
97774
 
97775
97775
  // package.json
97776
- var version = "7.2.0-integration-fix-enums-mapped-types-v7.2";
97776
+ var version = "7.2.0";
97777
97777
 
97778
97778
  // ../../node_modules/.pnpm/temporal-polyfill@0.3.0/node_modules/temporal-polyfill/chunks/internal.js
97779
97779
  function clampProp(e2, n2, t2, o2, r2) {
@@ -106490,7 +106490,7 @@ function mapValue(value, columnName, scalarType, enums) {
106490
106490
  throw new DataMapperError(`Expected a boolean in column '${columnName}', got ${typeof value}: ${value}`);
106491
106491
  }
106492
106492
  }
106493
- if (Array.isArray(value)) {
106493
+ if (Array.isArray(value) || value instanceof Uint8Array) {
106494
106494
  for (const byte of value) {
106495
106495
  if (byte !== 0) return true;
106496
106496
  }
@@ -107161,17 +107161,6 @@ function serializeRawValue(value, type2) {
107161
107161
  throw new Error(`Cannot serialize value of type ${typeof value} as JsonArray`);
107162
107162
  }
107163
107163
  return value.map((v2) => serializeRawValue(v2, ColumnTypeEnum.Json));
107164
- case ColumnTypeEnum.Bytes:
107165
- if (Array.isArray(value)) {
107166
- return new Uint8Array(value);
107167
- } else {
107168
- throw new Error(`Cannot serialize value of type ${typeof value} as Bytes`);
107169
- }
107170
- case ColumnTypeEnum.BytesArray:
107171
- if (!Array.isArray(value)) {
107172
- throw new Error(`Cannot serialize value of type ${typeof value} as BytesArray`);
107173
- }
107174
- return value.map((v2) => serializeRawValue(v2, ColumnTypeEnum.Bytes));
107175
107164
  case ColumnTypeEnum.Boolean:
107176
107165
  switch (typeof value) {
107177
107166
  case "boolean":
@@ -109472,7 +109461,7 @@ var SpanProxy = class {
109472
109461
  parentId,
109473
109462
  attributes,
109474
109463
  links,
109475
- name: `prisma:engine:${this.#name}`,
109464
+ name: `prisma:accelerate:${this.#name}`,
109476
109465
  kind: serializeSpanKind(this.#kind),
109477
109466
  startTime: this.#startTime,
109478
109467
  endTime: instantToHrTime(endTime)
@@ -109723,9 +109712,6 @@ function mapArg(arg, argType) {
109723
109712
  if (typeof arg === "string" && argType.scalarType === "bytes") {
109724
109713
  return Buffer.from(arg, "base64");
109725
109714
  }
109726
- if (Array.isArray(arg) && argType.scalarType === "bytes") {
109727
- return Buffer.from(arg);
109728
- }
109729
109715
  if (ArrayBuffer.isView(arg)) {
109730
109716
  return Buffer.from(arg.buffer, arg.byteOffset, arg.byteLength);
109731
109717
  }
@@ -109744,9 +109730,6 @@ function mapRow(row, fields) {
109744
109730
  case "DATETIME2":
109745
109731
  return (/* @__PURE__ */ new Date(`${value}Z`)).toISOString().replace(/(\.000)?Z$/, "+00:00");
109746
109732
  }
109747
- if (Buffer.isBuffer(value)) {
109748
- return Array.from(value);
109749
- }
109750
109733
  if (typeof value === "bigint") {
109751
109734
  return value.toString();
109752
109735
  }
@@ -109888,7 +109871,8 @@ function mapDriverError(error44) {
109888
109871
  kind: "mysql",
109889
109872
  code: error44.errno,
109890
109873
  message: error44.sqlMessage ?? "N/A",
109891
- state: error44.sqlState ?? "N/A"
109874
+ state: error44.sqlState ?? "N/A",
109875
+ cause: error44.cause?.message ?? void 0
109892
109876
  };
109893
109877
  }
109894
109878
  }
@@ -110627,9 +110611,6 @@ function mapArg2(arg, argType) {
110627
110611
  if (typeof arg === "string" && argType.scalarType === "bytes") {
110628
110612
  return Buffer.from(arg, "base64");
110629
110613
  }
110630
- if (Array.isArray(arg) && argType.scalarType === "bytes") {
110631
- return Buffer.from(arg);
110632
- }
110633
110614
  if (ArrayBuffer.isView(arg)) {
110634
110615
  return Buffer.from(arg.buffer, arg.byteOffset, arg.byteLength);
110635
110616
  }
@@ -110653,9 +110634,6 @@ function mapRow2(row, columns) {
110653
110634
  }
110654
110635
  return value;
110655
110636
  }
110656
- if (Buffer.isBuffer(value)) {
110657
- return Array.from(value);
110658
- }
110659
110637
  if (typeof value === "string" && type2 === import_mssql3.default.UniqueIdentifier) {
110660
110638
  return value.toLowerCase();
110661
110639
  }
@@ -111300,18 +111278,10 @@ function normalize_xml(xml) {
111300
111278
  function toJson(json2) {
111301
111279
  return json2;
111302
111280
  }
111303
- function encodeBuffer(buffer) {
111304
- return Array.from(new Uint8Array(buffer));
111305
- }
111306
111281
  var parsePgBytes = getTypeParser(ScalarColumnType.BYTEA);
111307
- var parseBytesArray = getTypeParser(ArrayColumnType.BYTEA_ARRAY);
111308
- function normalizeByteaArray(serializedBytesArray) {
111309
- const buffers = parseBytesArray(serializedBytesArray);
111310
- return buffers.map((buf) => buf ? encodeBuffer(buf) : null);
111311
- }
111282
+ var normalizeByteaArray = getTypeParser(ArrayColumnType.BYTEA_ARRAY);
111312
111283
  function convertBytes(serializedBytes) {
111313
- const buffer = parsePgBytes(serializedBytes);
111314
- return encodeBuffer(buffer);
111284
+ return parsePgBytes(serializedBytes);
111315
111285
  }
111316
111286
  function normalizeBit(bit) {
111317
111287
  return bit;
@@ -111364,11 +111334,8 @@ function mapArg3(arg, argType) {
111364
111334
  if (typeof arg === "string" && argType.scalarType === "bytes") {
111365
111335
  return Buffer.from(arg, "base64");
111366
111336
  }
111367
- if (Array.isArray(arg) && argType.scalarType === "bytes") {
111368
- return Buffer.from(arg);
111369
- }
111370
111337
  if (ArrayBuffer.isView(arg)) {
111371
- return Buffer.from(arg.buffer, arg.byteOffset, arg.byteLength);
111338
+ return new Uint8Array(arg.buffer, arg.byteOffset, arg.byteLength);
111372
111339
  }
111373
111340
  return arg;
111374
111341
  }
@@ -111897,59 +111864,49 @@ var App = class _App {
111897
111864
  * @param transactionId - Transaction ID if running within a transaction
111898
111865
  */
111899
111866
  async query(queryPlan, placeholderValues, comments, resourceLimits, transactionId) {
111900
- return await this.#tracingHandler.runInChildSpan("query", async () => {
111901
- const queryable = transactionId !== null ? await this.#transactionManager.getTransaction({ id: transactionId }, "query") : this.#db;
111902
- const sqlCommenter = comments && Object.keys(comments).length > 0 ? {
111903
- plugins: [() => comments],
111904
- // For pre-computed comments, we use a placeholder queryInfo since the actual
111905
- // query info was already used on the client side to compute the comments
111906
- queryInfo: { type: "single", action: "queryRaw", query: {} }
111907
- } : void 0;
111908
- const queryInterpreter = QueryInterpreter.forSql({
111909
- placeholderValues,
111910
- tracingHelper: this.#tracingHandler,
111911
- transactionManager: transactionId === null ? { enabled: true, manager: this.#transactionManager } : { enabled: false },
111912
- onQuery: logQuery,
111913
- sqlCommenter
111914
- });
111915
- const result = await Promise.race([
111916
- queryInterpreter.run(queryPlan, queryable),
111917
- import_promises3.default.setTimeout(resourceLimits.queryTimeout.total("milliseconds"), void 0, { ref: false }).then(() => {
111918
- throw new ResourceLimitError("Query timeout exceeded");
111919
- })
111920
- ]);
111921
- return normalizeJsonProtocolValues(result);
111867
+ const queryable = transactionId !== null ? await this.#transactionManager.getTransaction({ id: transactionId }, "query") : this.#db;
111868
+ const sqlCommenter = comments && Object.keys(comments).length > 0 ? {
111869
+ plugins: [() => comments],
111870
+ // For pre-computed comments, we use a placeholder queryInfo since the actual
111871
+ // query info was already used on the client side to compute the comments
111872
+ queryInfo: { type: "single", action: "queryRaw", query: {} }
111873
+ } : void 0;
111874
+ const queryInterpreter = QueryInterpreter.forSql({
111875
+ placeholderValues,
111876
+ tracingHelper: this.#tracingHandler,
111877
+ transactionManager: transactionId === null ? { enabled: true, manager: this.#transactionManager } : { enabled: false },
111878
+ onQuery: logQuery,
111879
+ sqlCommenter
111922
111880
  });
111881
+ const result = await Promise.race([
111882
+ queryInterpreter.run(queryPlan, queryable),
111883
+ import_promises3.default.setTimeout(resourceLimits.queryTimeout.total("milliseconds"), void 0, { ref: false }).then(() => {
111884
+ throw new ResourceLimitError("Query timeout exceeded");
111885
+ })
111886
+ ]);
111887
+ return normalizeJsonProtocolValues(result);
111923
111888
  }
111924
111889
  /**
111925
111890
  * Starts a new transaction.
111926
111891
  */
111927
111892
  async startTransaction(options, resourceLimits) {
111928
- return await this.#tracingHandler.runInChildSpan("start_transaction", () => {
111929
- const timeout = Math.min(options.timeout ?? Infinity, resourceLimits.maxTransactionTimeout.total("milliseconds"));
111930
- return this.#transactionManager.startTransaction({
111931
- ...options,
111932
- timeout
111933
- });
111893
+ const timeout = Math.min(options.timeout ?? Infinity, resourceLimits.maxTransactionTimeout.total("milliseconds"));
111894
+ return this.#transactionManager.startTransaction({
111895
+ ...options,
111896
+ timeout
111934
111897
  });
111935
111898
  }
111936
111899
  /**
111937
111900
  * Commits a transaction.
111938
111901
  */
111939
- async commitTransaction(transactionId) {
111940
- return await this.#tracingHandler.runInChildSpan(
111941
- "commit_transaction",
111942
- () => this.#transactionManager.commitTransaction(transactionId)
111943
- );
111902
+ commitTransaction(transactionId) {
111903
+ return this.#transactionManager.commitTransaction(transactionId);
111944
111904
  }
111945
111905
  /**
111946
111906
  * Rolls back a transaction.
111947
111907
  */
111948
- async rollbackTransaction(transactionId) {
111949
- return await this.#tracingHandler.runInChildSpan(
111950
- "rollback_transaction",
111951
- () => this.#transactionManager.rollbackTransaction(transactionId)
111952
- );
111908
+ rollbackTransaction(transactionId) {
111909
+ return this.#transactionManager.rollbackTransaction(transactionId);
111953
111910
  }
111954
111911
  /**
111955
111912
  * Retrieves connection information necessary for building the queries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/query-plan-executor",
3
- "version": "7.2.0-integration-fix-enums-mapped-types-v7.2",
3
+ "version": "7.2.0",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,11 +20,11 @@
20
20
  "temporal-polyfill": "0.3.0",
21
21
  "vitest": "3.2.4",
22
22
  "zod": "4.1.3",
23
- "@prisma/adapter-pg": "7.2.0-integration-fix-enums-mapped-types-v7.2",
24
- "@prisma/adapter-mssql": "7.2.0-integration-fix-enums-mapped-types-v7.2",
25
- "@prisma/client-engine-runtime": "7.2.0-integration-fix-enums-mapped-types-v7.2",
26
- "@prisma/adapter-mariadb": "7.2.0-integration-fix-enums-mapped-types-v7.2",
27
- "@prisma/driver-adapter-utils": "7.2.0-integration-fix-enums-mapped-types-v7.2"
23
+ "@prisma/adapter-pg": "7.2.0",
24
+ "@prisma/adapter-mariadb": "7.2.0",
25
+ "@prisma/adapter-mssql": "7.2.0",
26
+ "@prisma/client-engine-runtime": "7.2.0",
27
+ "@prisma/driver-adapter-utils": "7.2.0"
28
28
  },
29
29
  "files": [
30
30
  "dist"