@prisma/client-engine-runtime 6.10.0-dev.3 → 6.10.0-dev.30

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.
@@ -81,13 +81,17 @@ export type QueryPlanDbQuery = {
81
81
  };
82
82
  export type Fragment = {
83
83
  type: 'stringChunk';
84
- value: string;
84
+ chunk: string;
85
85
  } | {
86
86
  type: 'parameter';
87
87
  } | {
88
88
  type: 'parameterTuple';
89
89
  } | {
90
90
  type: 'parameterTupleList';
91
+ itemPrefix: string;
92
+ itemSeparator: string;
93
+ itemSuffix: string;
94
+ groupSeparator: string;
91
95
  };
92
96
  export interface PlaceholderFormat {
93
97
  prefix: string;
package/dist/index.d.mts CHANGED
@@ -61,13 +61,17 @@ export declare type FieldOperation = {
61
61
 
62
62
  export declare type Fragment = {
63
63
  type: 'stringChunk';
64
- value: string;
64
+ chunk: string;
65
65
  } | {
66
66
  type: 'parameter';
67
67
  } | {
68
68
  type: 'parameterTuple';
69
69
  } | {
70
70
  type: 'parameterTupleList';
71
+ itemPrefix: string;
72
+ itemSeparator: string;
73
+ itemSuffix: string;
74
+ groupSeparator: string;
71
75
  };
72
76
 
73
77
  /**
package/dist/index.d.ts CHANGED
@@ -61,13 +61,17 @@ export declare type FieldOperation = {
61
61
 
62
62
  export declare type Fragment = {
63
63
  type: 'stringChunk';
64
- value: string;
64
+ chunk: string;
65
65
  } | {
66
66
  type: 'parameter';
67
67
  } | {
68
68
  type: 'parameterTuple';
69
69
  } | {
70
70
  type: 'parameterTupleList';
71
+ itemPrefix: string;
72
+ itemSeparator: string;
73
+ itemSuffix: string;
74
+ groupSeparator: string;
71
75
  };
72
76
 
73
77
  /**
package/dist/index.js CHANGED
@@ -311,6 +311,8 @@ function providerToOtelSystem(provider) {
311
311
  return "mysql";
312
312
  case "sqlite":
313
313
  return "sqlite";
314
+ case "sqlserver":
315
+ return "mssql";
314
316
  default:
315
317
  assertNever(provider, `Unknown provider: ${provider}`);
316
318
  }
@@ -393,6 +395,8 @@ function getErrorCode(err) {
393
395
  return "P1009";
394
396
  case "DatabaseAccessDenied":
395
397
  return "P1010";
398
+ case "TransactionAlreadyClosed":
399
+ return "P1018";
396
400
  case "LengthMismatch":
397
401
  return "P2000";
398
402
  case "UniqueConstraintViolation":
@@ -403,12 +407,17 @@ function getErrorCode(err) {
403
407
  return "P2010";
404
408
  case "NullConstraintViolation":
405
409
  return "P2011";
410
+ case "ValueOutOfRange":
411
+ return "P2020";
406
412
  case "TableDoesNotExist":
407
413
  return "P2021";
408
414
  case "ColumnNotFound":
409
415
  return "P2022";
410
416
  case "InvalidIsolationLevel":
417
+ case "InconsistentColumnData":
411
418
  return "P2023";
419
+ case "MissingFullTextSearchIndex":
420
+ return "P2030";
412
421
  case "TransactionWriteConflict":
413
422
  return "P2034";
414
423
  case "GenericJs":
@@ -418,6 +427,7 @@ function getErrorCode(err) {
418
427
  case "postgres":
419
428
  case "sqlite":
420
429
  case "mysql":
430
+ case "mssql":
421
431
  return;
422
432
  default:
423
433
  assertNever(err.cause, `Unknown error: ${err.cause}`);
@@ -443,18 +453,22 @@ function renderErrorMessage(err) {
443
453
  const db = err.cause.db ?? "(not available)";
444
454
  return `User was denied access on the database \`${db}\``;
445
455
  }
456
+ case "TransactionAlreadyClosed":
457
+ return err.cause.cause;
446
458
  case "LengthMismatch": {
447
459
  const column = err.cause.column ?? "(not available)";
448
460
  return `The provided value for the column is too long for the column's type. Column: ${column}`;
449
461
  }
450
462
  case "UniqueConstraintViolation":
451
- return `Unique constraint failed on the ${renderConstraint({ fields: err.cause.fields })}`;
463
+ return `Unique constraint failed on the ${renderConstraint(err.cause.constraint)}`;
452
464
  case "ForeignKeyConstraintViolation":
453
465
  return `Foreign key constraint violated on the ${renderConstraint(err.cause.constraint)}`;
454
466
  case "UnsupportedNativeDataType":
455
467
  return `Failed to deserialize column of type '${err.cause.type}'. If you're using $queryRaw and this column is explicitly marked as \`Unsupported\` in your Prisma schema, try casting this column to any supported Prisma type such as \`String\`.`;
456
468
  case "NullConstraintViolation":
457
- return `Null constraint violation on the ${renderConstraint({ fields: err.cause.fields })}`;
469
+ return `Null constraint violation on the ${renderConstraint(err.cause.constraint)}`;
470
+ case "ValueOutOfRange":
471
+ return `Value out of range for the type. ${err.cause.cause}`;
458
472
  case "TableDoesNotExist": {
459
473
  const table = err.cause.table ?? "(not available)";
460
474
  return `The table \`${table}\` does not exist in the current database.`;
@@ -465,6 +479,10 @@ function renderErrorMessage(err) {
465
479
  }
466
480
  case "InvalidIsolationLevel":
467
481
  return `Invalid isolation level \`${err.cause.level}\``;
482
+ case "InconsistentColumnData":
483
+ return `Inconsistent column data: ${err.cause.cause}`;
484
+ case "MissingFullTextSearchIndex":
485
+ return "Cannot find a fulltext index to use for the native search, try adding a @@fulltext([Fields...]) to your schema";
468
486
  case "TransactionWriteConflict":
469
487
  return `Transaction failed due to a write conflict or a deadlock. Please retry your transaction`;
470
488
  case "GenericJs":
@@ -474,6 +492,7 @@ function renderErrorMessage(err) {
474
492
  case "sqlite":
475
493
  case "postgres":
476
494
  case "mysql":
495
+ case "mssql":
477
496
  return;
478
497
  default:
479
498
  assertNever(err.cause, `Unknown error: ${err.cause}`);
@@ -667,7 +686,7 @@ function renderTemplateSql(fragments, placeholderFormat, params) {
667
686
  flattenedParams.push(params[paramIndex++]);
668
687
  return formatPlaceholder(placeholderFormat, placeholderNumber++);
669
688
  case "stringChunk":
670
- return fragment.value;
689
+ return fragment.chunk;
671
690
  case "parameterTuple": {
672
691
  if (paramIndex >= params.length) {
673
692
  throw new Error(`Malformed query template. Fragments attempt to read over ${params.length} parameters.`);
@@ -698,9 +717,9 @@ function renderTemplateSql(fragments, placeholderFormat, params) {
698
717
  const elements = tuple.map((value) => {
699
718
  flattenedParams.push(value);
700
719
  return formatPlaceholder(placeholderFormat, placeholderNumber++);
701
- }).join(",");
702
- return `(${elements})`;
703
- }).join(",");
720
+ }).join(fragment.itemSeparator);
721
+ return `${fragment.itemPrefix}${elements}${fragment.itemSuffix}`;
722
+ }).join(fragment.groupSeparator);
704
723
  return tupleList;
705
724
  }
706
725
  default:
package/dist/index.mjs CHANGED
@@ -263,6 +263,8 @@ function providerToOtelSystem(provider) {
263
263
  return "mysql";
264
264
  case "sqlite":
265
265
  return "sqlite";
266
+ case "sqlserver":
267
+ return "mssql";
266
268
  default:
267
269
  assertNever(provider, `Unknown provider: ${provider}`);
268
270
  }
@@ -345,6 +347,8 @@ function getErrorCode(err) {
345
347
  return "P1009";
346
348
  case "DatabaseAccessDenied":
347
349
  return "P1010";
350
+ case "TransactionAlreadyClosed":
351
+ return "P1018";
348
352
  case "LengthMismatch":
349
353
  return "P2000";
350
354
  case "UniqueConstraintViolation":
@@ -355,12 +359,17 @@ function getErrorCode(err) {
355
359
  return "P2010";
356
360
  case "NullConstraintViolation":
357
361
  return "P2011";
362
+ case "ValueOutOfRange":
363
+ return "P2020";
358
364
  case "TableDoesNotExist":
359
365
  return "P2021";
360
366
  case "ColumnNotFound":
361
367
  return "P2022";
362
368
  case "InvalidIsolationLevel":
369
+ case "InconsistentColumnData":
363
370
  return "P2023";
371
+ case "MissingFullTextSearchIndex":
372
+ return "P2030";
364
373
  case "TransactionWriteConflict":
365
374
  return "P2034";
366
375
  case "GenericJs":
@@ -370,6 +379,7 @@ function getErrorCode(err) {
370
379
  case "postgres":
371
380
  case "sqlite":
372
381
  case "mysql":
382
+ case "mssql":
373
383
  return;
374
384
  default:
375
385
  assertNever(err.cause, `Unknown error: ${err.cause}`);
@@ -395,18 +405,22 @@ function renderErrorMessage(err) {
395
405
  const db = err.cause.db ?? "(not available)";
396
406
  return `User was denied access on the database \`${db}\``;
397
407
  }
408
+ case "TransactionAlreadyClosed":
409
+ return err.cause.cause;
398
410
  case "LengthMismatch": {
399
411
  const column = err.cause.column ?? "(not available)";
400
412
  return `The provided value for the column is too long for the column's type. Column: ${column}`;
401
413
  }
402
414
  case "UniqueConstraintViolation":
403
- return `Unique constraint failed on the ${renderConstraint({ fields: err.cause.fields })}`;
415
+ return `Unique constraint failed on the ${renderConstraint(err.cause.constraint)}`;
404
416
  case "ForeignKeyConstraintViolation":
405
417
  return `Foreign key constraint violated on the ${renderConstraint(err.cause.constraint)}`;
406
418
  case "UnsupportedNativeDataType":
407
419
  return `Failed to deserialize column of type '${err.cause.type}'. If you're using $queryRaw and this column is explicitly marked as \`Unsupported\` in your Prisma schema, try casting this column to any supported Prisma type such as \`String\`.`;
408
420
  case "NullConstraintViolation":
409
- return `Null constraint violation on the ${renderConstraint({ fields: err.cause.fields })}`;
421
+ return `Null constraint violation on the ${renderConstraint(err.cause.constraint)}`;
422
+ case "ValueOutOfRange":
423
+ return `Value out of range for the type. ${err.cause.cause}`;
410
424
  case "TableDoesNotExist": {
411
425
  const table = err.cause.table ?? "(not available)";
412
426
  return `The table \`${table}\` does not exist in the current database.`;
@@ -417,6 +431,10 @@ function renderErrorMessage(err) {
417
431
  }
418
432
  case "InvalidIsolationLevel":
419
433
  return `Invalid isolation level \`${err.cause.level}\``;
434
+ case "InconsistentColumnData":
435
+ return `Inconsistent column data: ${err.cause.cause}`;
436
+ case "MissingFullTextSearchIndex":
437
+ return "Cannot find a fulltext index to use for the native search, try adding a @@fulltext([Fields...]) to your schema";
420
438
  case "TransactionWriteConflict":
421
439
  return `Transaction failed due to a write conflict or a deadlock. Please retry your transaction`;
422
440
  case "GenericJs":
@@ -426,6 +444,7 @@ function renderErrorMessage(err) {
426
444
  case "sqlite":
427
445
  case "postgres":
428
446
  case "mysql":
447
+ case "mssql":
429
448
  return;
430
449
  default:
431
450
  assertNever(err.cause, `Unknown error: ${err.cause}`);
@@ -619,7 +638,7 @@ function renderTemplateSql(fragments, placeholderFormat, params) {
619
638
  flattenedParams.push(params[paramIndex++]);
620
639
  return formatPlaceholder(placeholderFormat, placeholderNumber++);
621
640
  case "stringChunk":
622
- return fragment.value;
641
+ return fragment.chunk;
623
642
  case "parameterTuple": {
624
643
  if (paramIndex >= params.length) {
625
644
  throw new Error(`Malformed query template. Fragments attempt to read over ${params.length} parameters.`);
@@ -650,9 +669,9 @@ function renderTemplateSql(fragments, placeholderFormat, params) {
650
669
  const elements = tuple.map((value) => {
651
670
  flattenedParams.push(value);
652
671
  return formatPlaceholder(placeholderFormat, placeholderNumber++);
653
- }).join(",");
654
- return `(${elements})`;
655
- }).join(",");
672
+ }).join(fragment.itemSeparator);
673
+ return `${fragment.itemPrefix}${elements}${fragment.itemSuffix}`;
674
+ }).join(fragment.groupSeparator);
656
675
  return tupleList;
657
676
  }
658
677
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-engine-runtime",
3
- "version": "6.10.0-dev.3",
3
+ "version": "6.10.0-dev.30",
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.10.0-dev.3",
35
- "@prisma/driver-adapter-utils": "6.10.0-dev.3"
34
+ "@prisma/debug": "6.10.0-dev.30",
35
+ "@prisma/driver-adapter-utils": "6.10.0-dev.30"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/jest": "29.5.14",