@prisma/client-engine-runtime 6.9.0-dev.14 → 6.9.0-dev.16
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/QueryPlan.d.ts +16 -1
- package/dist/index.d.mts +18 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.js +15 -3
- package/dist/index.mjs +14 -3
- package/package.json +3 -3
package/dist/QueryPlan.d.ts
CHANGED
|
@@ -19,7 +19,12 @@ export type PrismaValueBytes = {
|
|
|
19
19
|
prisma__value: string;
|
|
20
20
|
};
|
|
21
21
|
export declare function isPrismaValueBytes(value: unknown): value is PrismaValueBytes;
|
|
22
|
-
export type
|
|
22
|
+
export type PrismaValueBigInt = {
|
|
23
|
+
prisma__type: 'bigint';
|
|
24
|
+
prisma__value: string;
|
|
25
|
+
};
|
|
26
|
+
export declare function isPrismaValueBigInt(value: unknown): value is PrismaValueBigInt;
|
|
27
|
+
export type PrismaValue = string | boolean | number | PrismaValue[] | null | Record<string, unknown> | PrismaValuePlaceholder | PrismaValueGenerator | PrismaValueBytes | PrismaValueBigInt;
|
|
23
28
|
export type PrismaValueType = {
|
|
24
29
|
type: 'Any';
|
|
25
30
|
} | {
|
|
@@ -195,6 +200,9 @@ export type DataRule = {
|
|
|
195
200
|
} | {
|
|
196
201
|
type: 'rowCountNeq';
|
|
197
202
|
args: number;
|
|
203
|
+
} | {
|
|
204
|
+
type: 'affectedRowCountEq';
|
|
205
|
+
args: number;
|
|
198
206
|
} | {
|
|
199
207
|
type: 'never';
|
|
200
208
|
};
|
|
@@ -224,6 +232,13 @@ export type ValidationError = {
|
|
|
224
232
|
context: {
|
|
225
233
|
expectedRows: number;
|
|
226
234
|
};
|
|
235
|
+
} | {
|
|
236
|
+
error_identifier: 'INCOMPLETE_CONNECT_OUTPUT';
|
|
237
|
+
context: {
|
|
238
|
+
expectedRows: number;
|
|
239
|
+
relation: string;
|
|
240
|
+
relationType: string;
|
|
241
|
+
};
|
|
227
242
|
} | {
|
|
228
243
|
error_identifier: 'RECORDS_NOT_CONNECTED';
|
|
229
244
|
context: {
|
package/dist/index.d.mts
CHANGED
|
@@ -17,6 +17,9 @@ export declare type DataRule = {
|
|
|
17
17
|
} | {
|
|
18
18
|
type: 'rowCountNeq';
|
|
19
19
|
args: number;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'affectedRowCountEq';
|
|
22
|
+
args: number;
|
|
20
23
|
} | {
|
|
21
24
|
type: 'never';
|
|
22
25
|
};
|
|
@@ -41,6 +44,8 @@ export declare type Fragment = {
|
|
|
41
44
|
*/
|
|
42
45
|
export declare function isDeepStrictEqual(a: unknown, b: unknown): boolean;
|
|
43
46
|
|
|
47
|
+
export declare function isPrismaValueBigInt(value: unknown): value is PrismaValueBigInt;
|
|
48
|
+
|
|
44
49
|
export declare function isPrismaValueBytes(value: unknown): value is PrismaValueBytes;
|
|
45
50
|
|
|
46
51
|
export declare function isPrismaValueGenerator(value: unknown): value is PrismaValueGenerator;
|
|
@@ -68,7 +73,12 @@ export declare interface PlaceholderFormat {
|
|
|
68
73
|
hasNumbering: boolean;
|
|
69
74
|
}
|
|
70
75
|
|
|
71
|
-
export declare type PrismaValue = string | boolean | number | PrismaValue[] | null | Record<string, unknown> | PrismaValuePlaceholder | PrismaValueGenerator | PrismaValueBytes;
|
|
76
|
+
export declare type PrismaValue = string | boolean | number | PrismaValue[] | null | Record<string, unknown> | PrismaValuePlaceholder | PrismaValueGenerator | PrismaValueBytes | PrismaValueBigInt;
|
|
77
|
+
|
|
78
|
+
export declare type PrismaValueBigInt = {
|
|
79
|
+
prisma__type: 'bigint';
|
|
80
|
+
prisma__value: string;
|
|
81
|
+
};
|
|
72
82
|
|
|
73
83
|
export declare type PrismaValueBytes = {
|
|
74
84
|
prisma__type: 'bytes';
|
|
@@ -360,6 +370,13 @@ export declare type ValidationError = {
|
|
|
360
370
|
context: {
|
|
361
371
|
expectedRows: number;
|
|
362
372
|
};
|
|
373
|
+
} | {
|
|
374
|
+
error_identifier: 'INCOMPLETE_CONNECT_OUTPUT';
|
|
375
|
+
context: {
|
|
376
|
+
expectedRows: number;
|
|
377
|
+
relation: string;
|
|
378
|
+
relationType: string;
|
|
379
|
+
};
|
|
363
380
|
} | {
|
|
364
381
|
error_identifier: 'RECORDS_NOT_CONNECTED';
|
|
365
382
|
context: {
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,9 @@ export declare type DataRule = {
|
|
|
17
17
|
} | {
|
|
18
18
|
type: 'rowCountNeq';
|
|
19
19
|
args: number;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'affectedRowCountEq';
|
|
22
|
+
args: number;
|
|
20
23
|
} | {
|
|
21
24
|
type: 'never';
|
|
22
25
|
};
|
|
@@ -41,6 +44,8 @@ export declare type Fragment = {
|
|
|
41
44
|
*/
|
|
42
45
|
export declare function isDeepStrictEqual(a: unknown, b: unknown): boolean;
|
|
43
46
|
|
|
47
|
+
export declare function isPrismaValueBigInt(value: unknown): value is PrismaValueBigInt;
|
|
48
|
+
|
|
44
49
|
export declare function isPrismaValueBytes(value: unknown): value is PrismaValueBytes;
|
|
45
50
|
|
|
46
51
|
export declare function isPrismaValueGenerator(value: unknown): value is PrismaValueGenerator;
|
|
@@ -68,7 +73,12 @@ export declare interface PlaceholderFormat {
|
|
|
68
73
|
hasNumbering: boolean;
|
|
69
74
|
}
|
|
70
75
|
|
|
71
|
-
export declare type PrismaValue = string | boolean | number | PrismaValue[] | null | Record<string, unknown> | PrismaValuePlaceholder | PrismaValueGenerator | PrismaValueBytes;
|
|
76
|
+
export declare type PrismaValue = string | boolean | number | PrismaValue[] | null | Record<string, unknown> | PrismaValuePlaceholder | PrismaValueGenerator | PrismaValueBytes | PrismaValueBigInt;
|
|
77
|
+
|
|
78
|
+
export declare type PrismaValueBigInt = {
|
|
79
|
+
prisma__type: 'bigint';
|
|
80
|
+
prisma__value: string;
|
|
81
|
+
};
|
|
72
82
|
|
|
73
83
|
export declare type PrismaValueBytes = {
|
|
74
84
|
prisma__type: 'bytes';
|
|
@@ -360,6 +370,13 @@ export declare type ValidationError = {
|
|
|
360
370
|
context: {
|
|
361
371
|
expectedRows: number;
|
|
362
372
|
};
|
|
373
|
+
} | {
|
|
374
|
+
error_identifier: 'INCOMPLETE_CONNECT_OUTPUT';
|
|
375
|
+
context: {
|
|
376
|
+
expectedRows: number;
|
|
377
|
+
relation: string;
|
|
378
|
+
relationType: string;
|
|
379
|
+
};
|
|
363
380
|
} | {
|
|
364
381
|
error_identifier: 'RECORDS_NOT_CONNECTED';
|
|
365
382
|
context: {
|
package/dist/index.js
CHANGED
|
@@ -36,6 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
TransactionManagerError: () => TransactionManagerError,
|
|
37
37
|
UserFacingError: () => UserFacingError,
|
|
38
38
|
isDeepStrictEqual: () => isDeepStrictEqual,
|
|
39
|
+
isPrismaValueBigInt: () => isPrismaValueBigInt,
|
|
39
40
|
isPrismaValueBytes: () => isPrismaValueBytes,
|
|
40
41
|
isPrismaValueGenerator: () => isPrismaValueGenerator,
|
|
41
42
|
isPrismaValuePlaceholder: () => isPrismaValuePlaceholder,
|
|
@@ -431,6 +432,9 @@ function isPrismaValueGenerator(value) {
|
|
|
431
432
|
function isPrismaValueBytes(value) {
|
|
432
433
|
return typeof value === "object" && value !== null && value["prisma__type"] === "bytes";
|
|
433
434
|
}
|
|
435
|
+
function isPrismaValueBigInt(value) {
|
|
436
|
+
return typeof value === "object" && value !== null && value["prisma__type"] === "bigint";
|
|
437
|
+
}
|
|
434
438
|
|
|
435
439
|
// src/interpreter/renderQuery.ts
|
|
436
440
|
function renderQuery(dbQuery, scope, generators) {
|
|
@@ -473,9 +477,10 @@ function evaluateParam(param, scope, generators) {
|
|
|
473
477
|
}
|
|
474
478
|
if (Array.isArray(value)) {
|
|
475
479
|
value = value.map((el) => evaluateParam(el, scope, generators));
|
|
476
|
-
}
|
|
477
|
-
if (isPrismaValueBytes(value)) {
|
|
480
|
+
} else if (isPrismaValueBytes(value)) {
|
|
478
481
|
value = Buffer.from(value.prisma__value, "base64");
|
|
482
|
+
} else if (isPrismaValueBigInt(value)) {
|
|
483
|
+
value = BigInt(value.prisma__value);
|
|
479
484
|
}
|
|
480
485
|
return value;
|
|
481
486
|
}
|
|
@@ -616,6 +621,8 @@ function doesSatisfyRule(data, rule) {
|
|
|
616
621
|
return rule.args !== 0;
|
|
617
622
|
}
|
|
618
623
|
return rule.args !== 1;
|
|
624
|
+
case "affectedRowCountEq":
|
|
625
|
+
return data === rule.args;
|
|
619
626
|
case "never":
|
|
620
627
|
return false;
|
|
621
628
|
default:
|
|
@@ -633,7 +640,9 @@ function renderMessage(data, error) {
|
|
|
633
640
|
return `An operation failed because it depends on one or more records that were required but not found. No '${error.context.model}' record${hint} was found for ${error.context.operation} on ${error.context.relationType} relation '${error.context.relation}'.`;
|
|
634
641
|
}
|
|
635
642
|
case "INCOMPLETE_CONNECT_INPUT":
|
|
636
|
-
return `An operation failed because it depends on one or more records that were required but not found. Expected ${error.context.expectedRows} records to be connected, found only ${Array.isArray(data) ? data.length :
|
|
643
|
+
return `An operation failed because it depends on one or more records that were required but not found. Expected ${error.context.expectedRows} records to be connected, found only ${Array.isArray(data) ? data.length : data}.`;
|
|
644
|
+
case "INCOMPLETE_CONNECT_OUTPUT":
|
|
645
|
+
return `The required connected records were not found. Expected ${error.context.expectedRows} records to be connected after connect operation on ${error.context.relationType} relation '${error.context.relation}', found ${Array.isArray(data) ? data.length : data}.`;
|
|
637
646
|
case "RECORDS_NOT_CONNECTED":
|
|
638
647
|
return `The records for relation \`${error.context.relation}\` between the \`${error.context.parent}\` and \`${error.context.child}\` models are not connected.`;
|
|
639
648
|
default:
|
|
@@ -646,6 +655,8 @@ function getErrorCode2(error) {
|
|
|
646
655
|
return "P2014";
|
|
647
656
|
case "RECORDS_NOT_CONNECTED":
|
|
648
657
|
return "P2017";
|
|
658
|
+
case "INCOMPLETE_CONNECT_OUTPUT":
|
|
659
|
+
return "P2018";
|
|
649
660
|
case "MISSING_RECORD":
|
|
650
661
|
case "MISSING_RELATED_RECORD":
|
|
651
662
|
case "INCOMPLETE_CONNECT_INPUT":
|
|
@@ -1185,6 +1196,7 @@ var TransactionManager = class {
|
|
|
1185
1196
|
TransactionManagerError,
|
|
1186
1197
|
UserFacingError,
|
|
1187
1198
|
isDeepStrictEqual,
|
|
1199
|
+
isPrismaValueBigInt,
|
|
1188
1200
|
isPrismaValueBytes,
|
|
1189
1201
|
isPrismaValueGenerator,
|
|
1190
1202
|
isPrismaValuePlaceholder,
|
package/dist/index.mjs
CHANGED
|
@@ -386,6 +386,9 @@ function isPrismaValueGenerator(value) {
|
|
|
386
386
|
function isPrismaValueBytes(value) {
|
|
387
387
|
return typeof value === "object" && value !== null && value["prisma__type"] === "bytes";
|
|
388
388
|
}
|
|
389
|
+
function isPrismaValueBigInt(value) {
|
|
390
|
+
return typeof value === "object" && value !== null && value["prisma__type"] === "bigint";
|
|
391
|
+
}
|
|
389
392
|
|
|
390
393
|
// src/interpreter/renderQuery.ts
|
|
391
394
|
function renderQuery(dbQuery, scope, generators) {
|
|
@@ -428,9 +431,10 @@ function evaluateParam(param, scope, generators) {
|
|
|
428
431
|
}
|
|
429
432
|
if (Array.isArray(value)) {
|
|
430
433
|
value = value.map((el) => evaluateParam(el, scope, generators));
|
|
431
|
-
}
|
|
432
|
-
if (isPrismaValueBytes(value)) {
|
|
434
|
+
} else if (isPrismaValueBytes(value)) {
|
|
433
435
|
value = Buffer.from(value.prisma__value, "base64");
|
|
436
|
+
} else if (isPrismaValueBigInt(value)) {
|
|
437
|
+
value = BigInt(value.prisma__value);
|
|
434
438
|
}
|
|
435
439
|
return value;
|
|
436
440
|
}
|
|
@@ -571,6 +575,8 @@ function doesSatisfyRule(data, rule) {
|
|
|
571
575
|
return rule.args !== 0;
|
|
572
576
|
}
|
|
573
577
|
return rule.args !== 1;
|
|
578
|
+
case "affectedRowCountEq":
|
|
579
|
+
return data === rule.args;
|
|
574
580
|
case "never":
|
|
575
581
|
return false;
|
|
576
582
|
default:
|
|
@@ -588,7 +594,9 @@ function renderMessage(data, error) {
|
|
|
588
594
|
return `An operation failed because it depends on one or more records that were required but not found. No '${error.context.model}' record${hint} was found for ${error.context.operation} on ${error.context.relationType} relation '${error.context.relation}'.`;
|
|
589
595
|
}
|
|
590
596
|
case "INCOMPLETE_CONNECT_INPUT":
|
|
591
|
-
return `An operation failed because it depends on one or more records that were required but not found. Expected ${error.context.expectedRows} records to be connected, found only ${Array.isArray(data) ? data.length :
|
|
597
|
+
return `An operation failed because it depends on one or more records that were required but not found. Expected ${error.context.expectedRows} records to be connected, found only ${Array.isArray(data) ? data.length : data}.`;
|
|
598
|
+
case "INCOMPLETE_CONNECT_OUTPUT":
|
|
599
|
+
return `The required connected records were not found. Expected ${error.context.expectedRows} records to be connected after connect operation on ${error.context.relationType} relation '${error.context.relation}', found ${Array.isArray(data) ? data.length : data}.`;
|
|
592
600
|
case "RECORDS_NOT_CONNECTED":
|
|
593
601
|
return `The records for relation \`${error.context.relation}\` between the \`${error.context.parent}\` and \`${error.context.child}\` models are not connected.`;
|
|
594
602
|
default:
|
|
@@ -601,6 +609,8 @@ function getErrorCode2(error) {
|
|
|
601
609
|
return "P2014";
|
|
602
610
|
case "RECORDS_NOT_CONNECTED":
|
|
603
611
|
return "P2017";
|
|
612
|
+
case "INCOMPLETE_CONNECT_OUTPUT":
|
|
613
|
+
return "P2018";
|
|
604
614
|
case "MISSING_RECORD":
|
|
605
615
|
case "MISSING_RELATED_RECORD":
|
|
606
616
|
case "INCOMPLETE_CONNECT_INPUT":
|
|
@@ -1139,6 +1149,7 @@ export {
|
|
|
1139
1149
|
TransactionManagerError,
|
|
1140
1150
|
UserFacingError,
|
|
1141
1151
|
isDeepStrictEqual,
|
|
1152
|
+
isPrismaValueBigInt,
|
|
1142
1153
|
isPrismaValueBytes,
|
|
1143
1154
|
isPrismaValueGenerator,
|
|
1144
1155
|
isPrismaValuePlaceholder,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/client-engine-runtime",
|
|
3
|
-
"version": "6.9.0-dev.
|
|
3
|
+
"version": "6.9.0-dev.16",
|
|
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/
|
|
35
|
-
"@prisma/
|
|
34
|
+
"@prisma/debug": "6.9.0-dev.16",
|
|
35
|
+
"@prisma/driver-adapter-utils": "6.9.0-dev.16"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/jest": "29.5.14",
|