@prisma/client-engine-runtime 6.11.0-dev.9 → 6.11.0-integration-upgrade-mcp-sdk.1

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.
@@ -59,7 +59,7 @@ export type ResultNode = {
59
59
  } | {
60
60
  type: 'Object';
61
61
  fields: Record<string, ResultNode>;
62
- flattened: boolean;
62
+ serializedName: string | null;
63
63
  } | {
64
64
  type: 'Value';
65
65
  dbName: string;
package/dist/index.d.mts CHANGED
@@ -336,7 +336,7 @@ export declare type ResultNode = {
336
336
  } | {
337
337
  type: 'Object';
338
338
  fields: Record<string, ResultNode>;
339
- flattened: boolean;
339
+ serializedName: string | null;
340
340
  } | {
341
341
  type: 'Value';
342
342
  dbName: string;
package/dist/index.d.ts CHANGED
@@ -336,7 +336,7 @@ export declare type ResultNode = {
336
336
  } | {
337
337
  type: 'Object';
338
338
  fields: Record<string, ResultNode>;
339
- flattened: boolean;
339
+ serializedName: string | null;
340
340
  } | {
341
341
  type: 'Value';
342
342
  dbName: string;
package/dist/index.js CHANGED
@@ -140,12 +140,12 @@ function mapObject(data, fields, enums) {
140
140
  throw new DataMapperError(`Unexpected 'AffectedRows' node in data mapping for field '${name}'`);
141
141
  }
142
142
  case "Object": {
143
- if (!node.flattened && !Object.hasOwn(data, name)) {
143
+ if (node.serializedName !== null && !Object.hasOwn(data, node.serializedName)) {
144
144
  throw new DataMapperError(
145
145
  `Missing data field (Object): '${name}'; node: ${JSON.stringify(node)}; data: ${JSON.stringify(data)}`
146
146
  );
147
147
  }
148
- const target = node.flattened ? data : data[name];
148
+ const target = node.serializedName !== null ? data[node.serializedName] : data;
149
149
  result[name] = mapArrayOrObject(target, node.fields, enums);
150
150
  break;
151
151
  }
@@ -230,6 +230,12 @@ function mapValue(value, columnName, resultType, enums) {
230
230
  throw new DataMapperError(`Expected a boolean in column '${columnName}', got ${typeof value}: ${value}`);
231
231
  }
232
232
  }
233
+ if (value instanceof Uint8Array) {
234
+ for (const byte of value) {
235
+ if (byte !== 0) return true;
236
+ }
237
+ return false;
238
+ }
233
239
  throw new DataMapperError(`Expected a boolean in column '${columnName}', got ${typeof value}: ${value}`);
234
240
  }
235
241
  case "Decimal":
@@ -471,7 +477,7 @@ function renderErrorMessage(err) {
471
477
  case "NullConstraintViolation":
472
478
  return `Null constraint violation on the ${renderConstraint(err.cause.constraint)}`;
473
479
  case "ValueOutOfRange":
474
- return `Value out of range for the type. ${err.cause.cause}`;
480
+ return `Value out of range for the type: ${err.cause.cause}`;
475
481
  case "TableDoesNotExist": {
476
482
  const table = err.cause.table ?? "(not available)";
477
483
  return `The table \`${table}\` does not exist in the current database.`;
@@ -798,6 +804,8 @@ function serializeRawSql(resultSet) {
798
804
  const types = resultSet.columnTypes.map((type) => serializeColumnType(type));
799
805
  const mappers = types.map((type) => {
800
806
  switch (type) {
807
+ case "bytes":
808
+ return (value) => Array.isArray(value) ? new Uint8Array(value) : value;
801
809
  case "int":
802
810
  return (value) => value === null ? null : typeof value === "number" ? value : parseInt(`${value}`, 10);
803
811
  case "bigint":
@@ -1435,17 +1443,16 @@ var TransactionManager = class {
1435
1443
  transaction: void 0
1436
1444
  };
1437
1445
  this.transactions.set(transaction.id, transaction);
1438
- transaction.timer = this.startTransactionTimeout(transaction.id, validatedOptions.maxWait);
1439
- const startedTransaction = await this.driverAdapter.startTransaction(validatedOptions.isolationLevel);
1446
+ const startTimer = setTimeout(() => transaction.status = "timed_out", validatedOptions.maxWait);
1447
+ transaction.transaction = await this.driverAdapter.startTransaction(validatedOptions.isolationLevel);
1448
+ clearTimeout(startTimer);
1440
1449
  switch (transaction.status) {
1441
1450
  case "waiting":
1442
- transaction.transaction = startedTransaction;
1443
- clearTimeout(transaction.timer);
1444
- transaction.timer = void 0;
1445
1451
  transaction.status = "running";
1446
1452
  transaction.timer = this.startTransactionTimeout(transaction.id, validatedOptions.timeout);
1447
1453
  return { id: transaction.id };
1448
1454
  case "timed_out":
1455
+ await this.closeTransaction(transaction, "timed_out");
1449
1456
  throw new TransactionStartTimeoutError();
1450
1457
  case "running":
1451
1458
  case "committed":
package/dist/index.mjs CHANGED
@@ -92,12 +92,12 @@ function mapObject(data, fields, enums) {
92
92
  throw new DataMapperError(`Unexpected 'AffectedRows' node in data mapping for field '${name}'`);
93
93
  }
94
94
  case "Object": {
95
- if (!node.flattened && !Object.hasOwn(data, name)) {
95
+ if (node.serializedName !== null && !Object.hasOwn(data, node.serializedName)) {
96
96
  throw new DataMapperError(
97
97
  `Missing data field (Object): '${name}'; node: ${JSON.stringify(node)}; data: ${JSON.stringify(data)}`
98
98
  );
99
99
  }
100
- const target = node.flattened ? data : data[name];
100
+ const target = node.serializedName !== null ? data[node.serializedName] : data;
101
101
  result[name] = mapArrayOrObject(target, node.fields, enums);
102
102
  break;
103
103
  }
@@ -182,6 +182,12 @@ function mapValue(value, columnName, resultType, enums) {
182
182
  throw new DataMapperError(`Expected a boolean in column '${columnName}', got ${typeof value}: ${value}`);
183
183
  }
184
184
  }
185
+ if (value instanceof Uint8Array) {
186
+ for (const byte of value) {
187
+ if (byte !== 0) return true;
188
+ }
189
+ return false;
190
+ }
185
191
  throw new DataMapperError(`Expected a boolean in column '${columnName}', got ${typeof value}: ${value}`);
186
192
  }
187
193
  case "Decimal":
@@ -423,7 +429,7 @@ function renderErrorMessage(err) {
423
429
  case "NullConstraintViolation":
424
430
  return `Null constraint violation on the ${renderConstraint(err.cause.constraint)}`;
425
431
  case "ValueOutOfRange":
426
- return `Value out of range for the type. ${err.cause.cause}`;
432
+ return `Value out of range for the type: ${err.cause.cause}`;
427
433
  case "TableDoesNotExist": {
428
434
  const table = err.cause.table ?? "(not available)";
429
435
  return `The table \`${table}\` does not exist in the current database.`;
@@ -750,6 +756,8 @@ function serializeRawSql(resultSet) {
750
756
  const types = resultSet.columnTypes.map((type) => serializeColumnType(type));
751
757
  const mappers = types.map((type) => {
752
758
  switch (type) {
759
+ case "bytes":
760
+ return (value) => Array.isArray(value) ? new Uint8Array(value) : value;
753
761
  case "int":
754
762
  return (value) => value === null ? null : typeof value === "number" ? value : parseInt(`${value}`, 10);
755
763
  case "bigint":
@@ -1387,17 +1395,16 @@ var TransactionManager = class {
1387
1395
  transaction: void 0
1388
1396
  };
1389
1397
  this.transactions.set(transaction.id, transaction);
1390
- transaction.timer = this.startTransactionTimeout(transaction.id, validatedOptions.maxWait);
1391
- const startedTransaction = await this.driverAdapter.startTransaction(validatedOptions.isolationLevel);
1398
+ const startTimer = setTimeout(() => transaction.status = "timed_out", validatedOptions.maxWait);
1399
+ transaction.transaction = await this.driverAdapter.startTransaction(validatedOptions.isolationLevel);
1400
+ clearTimeout(startTimer);
1392
1401
  switch (transaction.status) {
1393
1402
  case "waiting":
1394
- transaction.transaction = startedTransaction;
1395
- clearTimeout(transaction.timer);
1396
- transaction.timer = void 0;
1397
1403
  transaction.status = "running";
1398
1404
  transaction.timer = this.startTransactionTimeout(transaction.id, validatedOptions.timeout);
1399
1405
  return { id: transaction.id };
1400
1406
  case "timed_out":
1407
+ await this.closeTransaction(transaction, "timed_out");
1401
1408
  throw new TransactionStartTimeoutError();
1402
1409
  case "running":
1403
1410
  case "committed":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-engine-runtime",
3
- "version": "6.11.0-dev.9",
3
+ "version": "6.11.0-integration-upgrade-mcp-sdk.1",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -31,8 +31,8 @@
31
31
  "nanoid": "5.1.5",
32
32
  "ulid": "3.0.0",
33
33
  "uuid": "11.1.0",
34
- "@prisma/debug": "6.11.0-dev.9",
35
- "@prisma/driver-adapter-utils": "6.11.0-dev.9"
34
+ "@prisma/debug": "6.11.0-integration-upgrade-mcp-sdk.1",
35
+ "@prisma/driver-adapter-utils": "6.11.0-integration-upgrade-mcp-sdk.1"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/jest": "29.5.14",