@prisma/client-engine-runtime 6.9.0-dev.9 → 6.9.0-integration-push-xtvzqtsrpwpk.3
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 +35 -1
- package/dist/UserFacingError.d.ts +3 -3
- package/dist/index.d.mts +67 -13
- package/dist/index.d.ts +67 -13
- package/dist/index.js +544 -199
- package/dist/index.mjs +539 -198
- package/dist/interpreter/DataMapper.d.ts +4 -1
- package/dist/interpreter/QueryInterpreter.d.ts +2 -1
- package/dist/interpreter/generators.d.ts +2 -1
- package/dist/interpreter/renderQuery.d.ts +2 -1
- package/dist/interpreter/serializeSql.d.ts +2 -1
- package/dist/tracing.d.ts +10 -2
- package/dist/transactionManager/TransactionManager.d.ts +3 -1
- package/dist/transactionManager/TransactionManagerErrors.d.ts +4 -4
- package/dist/utils.d.ts +11 -0
- 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
|
} | {
|
|
@@ -36,6 +41,8 @@ export type PrismaValueType = {
|
|
|
36
41
|
type: 'Decimal';
|
|
37
42
|
} | {
|
|
38
43
|
type: 'Date';
|
|
44
|
+
} | {
|
|
45
|
+
type: 'Time';
|
|
39
46
|
} | {
|
|
40
47
|
type: 'Array';
|
|
41
48
|
inner: PrismaValueType;
|
|
@@ -43,8 +50,13 @@ export type PrismaValueType = {
|
|
|
43
50
|
type: 'Object';
|
|
44
51
|
} | {
|
|
45
52
|
type: 'Bytes';
|
|
53
|
+
} | {
|
|
54
|
+
type: 'Enum';
|
|
55
|
+
inner: string;
|
|
46
56
|
};
|
|
47
57
|
export type ResultNode = {
|
|
58
|
+
type: 'AffectedRows';
|
|
59
|
+
} | {
|
|
48
60
|
type: 'Object';
|
|
49
61
|
fields: Record<string, ResultNode>;
|
|
50
62
|
flattened: boolean;
|
|
@@ -147,6 +159,7 @@ export type QueryPlanNode = {
|
|
|
147
159
|
args: {
|
|
148
160
|
expr: QueryPlanNode;
|
|
149
161
|
structure: ResultNode;
|
|
162
|
+
enums: Record<string, Record<string, string>>;
|
|
150
163
|
};
|
|
151
164
|
} | {
|
|
152
165
|
type: 'validate';
|
|
@@ -182,6 +195,17 @@ export type QueryPlanNode = {
|
|
|
182
195
|
expr: QueryPlanNode;
|
|
183
196
|
pagination: Pagination;
|
|
184
197
|
};
|
|
198
|
+
} | {
|
|
199
|
+
type: 'extendRecord';
|
|
200
|
+
args: {
|
|
201
|
+
expr: QueryPlanNode;
|
|
202
|
+
values: Record<string, {
|
|
203
|
+
type: 'value';
|
|
204
|
+
value: PrismaValue;
|
|
205
|
+
} | {
|
|
206
|
+
type: 'lastInsertId';
|
|
207
|
+
}>;
|
|
208
|
+
};
|
|
185
209
|
};
|
|
186
210
|
export type Pagination = {
|
|
187
211
|
cursor: Record<string, PrismaValue> | null;
|
|
@@ -195,6 +219,9 @@ export type DataRule = {
|
|
|
195
219
|
} | {
|
|
196
220
|
type: 'rowCountNeq';
|
|
197
221
|
args: number;
|
|
222
|
+
} | {
|
|
223
|
+
type: 'affectedRowCountEq';
|
|
224
|
+
args: number;
|
|
198
225
|
} | {
|
|
199
226
|
type: 'never';
|
|
200
227
|
};
|
|
@@ -224,6 +251,13 @@ export type ValidationError = {
|
|
|
224
251
|
context: {
|
|
225
252
|
expectedRows: number;
|
|
226
253
|
};
|
|
254
|
+
} | {
|
|
255
|
+
error_identifier: 'INCOMPLETE_CONNECT_OUTPUT';
|
|
256
|
+
context: {
|
|
257
|
+
expectedRows: number;
|
|
258
|
+
relation: string;
|
|
259
|
+
relationType: string;
|
|
260
|
+
};
|
|
227
261
|
} | {
|
|
228
262
|
error_identifier: 'RECORDS_NOT_CONNECTED';
|
|
229
263
|
context: {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export declare class UserFacingError extends Error {
|
|
2
2
|
name: string;
|
|
3
3
|
code: string;
|
|
4
|
-
meta: unknown
|
|
5
|
-
constructor(message: string, code: string, meta?: unknown);
|
|
4
|
+
meta: Record<string, unknown>;
|
|
5
|
+
constructor(message: string, code: string, meta?: Record<string, unknown>);
|
|
6
6
|
toQueryResponseErrorObject(): {
|
|
7
7
|
error: string;
|
|
8
8
|
user_facing_error: {
|
|
9
9
|
is_panic: boolean;
|
|
10
10
|
message: string;
|
|
11
|
-
meta: unknown
|
|
11
|
+
meta: Record<string, unknown>;
|
|
12
12
|
error_code: string;
|
|
13
13
|
};
|
|
14
14
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,22 +1,36 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Context } from '@opentelemetry/api';
|
|
2
2
|
import type { IsolationLevel } from '@prisma/driver-adapter-utils';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { Span } from '@opentelemetry/api';
|
|
4
|
+
import { SpanOptions } from '@opentelemetry/api';
|
|
5
5
|
import { SqlDriverAdapter } from '@prisma/driver-adapter-utils';
|
|
6
6
|
import { SqlQueryable } from '@prisma/driver-adapter-utils';
|
|
7
7
|
import { SqlResultSet } from '@prisma/driver-adapter-utils';
|
|
8
8
|
import { Transaction } from '@prisma/driver-adapter-utils';
|
|
9
9
|
|
|
10
|
+
export declare class DataMapperError extends Error {
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
export declare type DataRule = {
|
|
11
15
|
type: 'rowCountEq';
|
|
12
16
|
args: number;
|
|
13
17
|
} | {
|
|
14
18
|
type: 'rowCountNeq';
|
|
15
19
|
args: number;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'affectedRowCountEq';
|
|
22
|
+
args: number;
|
|
16
23
|
} | {
|
|
17
24
|
type: 'never';
|
|
18
25
|
};
|
|
19
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Checks if two objects representing the names and values of key columns match. A match is
|
|
29
|
+
* defined by one of the sets of keys being a subset of the other. This function also
|
|
30
|
+
* converts arguments to the types used by driver adapters if necessary.
|
|
31
|
+
*/
|
|
32
|
+
export declare function doKeysMatch(lhs: {}, rhs: {}): boolean;
|
|
33
|
+
|
|
20
34
|
declare type ExtendedSpanOptions = SpanOptions & {
|
|
21
35
|
name: string;
|
|
22
36
|
};
|
|
@@ -37,6 +51,8 @@ export declare type Fragment = {
|
|
|
37
51
|
*/
|
|
38
52
|
export declare function isDeepStrictEqual(a: unknown, b: unknown): boolean;
|
|
39
53
|
|
|
54
|
+
export declare function isPrismaValueBigInt(value: unknown): value is PrismaValueBigInt;
|
|
55
|
+
|
|
40
56
|
export declare function isPrismaValueBytes(value: unknown): value is PrismaValueBytes;
|
|
41
57
|
|
|
42
58
|
export declare function isPrismaValueGenerator(value: unknown): value is PrismaValueGenerator;
|
|
@@ -64,7 +80,12 @@ export declare interface PlaceholderFormat {
|
|
|
64
80
|
hasNumbering: boolean;
|
|
65
81
|
}
|
|
66
82
|
|
|
67
|
-
export declare type PrismaValue = string | boolean | number | PrismaValue[] | null | Record<string, unknown> | PrismaValuePlaceholder | PrismaValueGenerator | PrismaValueBytes;
|
|
83
|
+
export declare type PrismaValue = string | boolean | number | PrismaValue[] | null | Record<string, unknown> | PrismaValuePlaceholder | PrismaValueGenerator | PrismaValueBytes | PrismaValueBigInt;
|
|
84
|
+
|
|
85
|
+
export declare type PrismaValueBigInt = {
|
|
86
|
+
prisma__type: 'bigint';
|
|
87
|
+
prisma__value: string;
|
|
88
|
+
};
|
|
68
89
|
|
|
69
90
|
export declare type PrismaValueBytes = {
|
|
70
91
|
prisma__type: 'bytes';
|
|
@@ -103,6 +124,8 @@ export declare type PrismaValueType = {
|
|
|
103
124
|
type: 'Decimal';
|
|
104
125
|
} | {
|
|
105
126
|
type: 'Date';
|
|
127
|
+
} | {
|
|
128
|
+
type: 'Time';
|
|
106
129
|
} | {
|
|
107
130
|
type: 'Array';
|
|
108
131
|
inner: PrismaValueType;
|
|
@@ -110,6 +133,9 @@ export declare type PrismaValueType = {
|
|
|
110
133
|
type: 'Object';
|
|
111
134
|
} | {
|
|
112
135
|
type: 'Bytes';
|
|
136
|
+
} | {
|
|
137
|
+
type: 'Enum';
|
|
138
|
+
inner: string;
|
|
113
139
|
};
|
|
114
140
|
|
|
115
141
|
export declare type QueryEvent = {
|
|
@@ -121,7 +147,7 @@ export declare type QueryEvent = {
|
|
|
121
147
|
|
|
122
148
|
export declare class QueryInterpreter {
|
|
123
149
|
#private;
|
|
124
|
-
constructor({ transactionManager, placeholderValues, onQuery, tracingHelper, serializer }: QueryInterpreterOptions);
|
|
150
|
+
constructor({ transactionManager, placeholderValues, onQuery, tracingHelper, serializer, rawSerializer, }: QueryInterpreterOptions);
|
|
125
151
|
static forSql(options: {
|
|
126
152
|
transactionManager: QueryInterpreterTransactionManager;
|
|
127
153
|
placeholderValues: Record<string, unknown>;
|
|
@@ -138,6 +164,7 @@ export declare type QueryInterpreterOptions = {
|
|
|
138
164
|
onQuery?: (event: QueryEvent) => void;
|
|
139
165
|
tracingHelper: TracingHelper;
|
|
140
166
|
serializer: (results: SqlResultSet) => Value;
|
|
167
|
+
rawSerializer?: (results: SqlResultSet) => Value;
|
|
141
168
|
};
|
|
142
169
|
|
|
143
170
|
export declare type QueryInterpreterTransactionManager = {
|
|
@@ -223,6 +250,7 @@ export declare type QueryPlanNode = {
|
|
|
223
250
|
args: {
|
|
224
251
|
expr: QueryPlanNode;
|
|
225
252
|
structure: ResultNode;
|
|
253
|
+
enums: Record<string, Record<string, string>>;
|
|
226
254
|
};
|
|
227
255
|
} | {
|
|
228
256
|
type: 'validate';
|
|
@@ -258,9 +286,22 @@ export declare type QueryPlanNode = {
|
|
|
258
286
|
expr: QueryPlanNode;
|
|
259
287
|
pagination: Pagination;
|
|
260
288
|
};
|
|
289
|
+
} | {
|
|
290
|
+
type: 'extendRecord';
|
|
291
|
+
args: {
|
|
292
|
+
expr: QueryPlanNode;
|
|
293
|
+
values: Record<string, {
|
|
294
|
+
type: 'value';
|
|
295
|
+
value: PrismaValue;
|
|
296
|
+
} | {
|
|
297
|
+
type: 'lastInsertId';
|
|
298
|
+
}>;
|
|
299
|
+
};
|
|
261
300
|
};
|
|
262
301
|
|
|
263
302
|
export declare type ResultNode = {
|
|
303
|
+
type: 'AffectedRows';
|
|
304
|
+
} | {
|
|
264
305
|
type: 'Object';
|
|
265
306
|
fields: Record<string, ResultNode>;
|
|
266
307
|
flattened: boolean;
|
|
@@ -270,6 +311,12 @@ export declare type ResultNode = {
|
|
|
270
311
|
resultType: PrismaValueType;
|
|
271
312
|
};
|
|
272
313
|
|
|
314
|
+
/**
|
|
315
|
+
* `JSON.stringify` wrapper with custom replacer function that handles nested
|
|
316
|
+
* BigInt and Uint8Array values.
|
|
317
|
+
*/
|
|
318
|
+
export declare function safeJsonStringify(obj: unknown): string;
|
|
319
|
+
|
|
273
320
|
declare type SpanCallback<R> = (span?: Span, context?: Context) => R;
|
|
274
321
|
|
|
275
322
|
export declare interface TracingHelper {
|
|
@@ -287,10 +334,11 @@ export declare class TransactionManager {
|
|
|
287
334
|
private readonly driverAdapter;
|
|
288
335
|
private readonly transactionOptions;
|
|
289
336
|
private readonly tracingHelper;
|
|
290
|
-
constructor({ driverAdapter, transactionOptions, tracingHelper, }: {
|
|
337
|
+
constructor({ driverAdapter, transactionOptions, tracingHelper, onQuery, }: {
|
|
291
338
|
driverAdapter: SqlDriverAdapter;
|
|
292
339
|
transactionOptions: TransactionOptions;
|
|
293
340
|
tracingHelper: TracingHelper;
|
|
341
|
+
onQuery?: (event: QueryEvent) => void;
|
|
294
342
|
});
|
|
295
343
|
startTransaction(options?: TransactionOptions): Promise<TransactionInfo>;
|
|
296
344
|
commitTransaction(transactionId: string): Promise<void>;
|
|
@@ -303,10 +351,9 @@ export declare class TransactionManager {
|
|
|
303
351
|
private validateOptions;
|
|
304
352
|
}
|
|
305
353
|
|
|
306
|
-
export declare class TransactionManagerError extends
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
constructor(message: string, meta?: Record<string, unknown> | undefined);
|
|
354
|
+
export declare class TransactionManagerError extends UserFacingError {
|
|
355
|
+
name: string;
|
|
356
|
+
constructor(message: string, meta?: Record<string, unknown>);
|
|
310
357
|
}
|
|
311
358
|
|
|
312
359
|
export declare type TransactionOptions = {
|
|
@@ -318,14 +365,14 @@ export declare type TransactionOptions = {
|
|
|
318
365
|
export declare class UserFacingError extends Error {
|
|
319
366
|
name: string;
|
|
320
367
|
code: string;
|
|
321
|
-
meta: unknown
|
|
322
|
-
constructor(message: string, code: string, meta?: unknown);
|
|
368
|
+
meta: Record<string, unknown>;
|
|
369
|
+
constructor(message: string, code: string, meta?: Record<string, unknown>);
|
|
323
370
|
toQueryResponseErrorObject(): {
|
|
324
371
|
error: string;
|
|
325
372
|
user_facing_error: {
|
|
326
373
|
is_panic: boolean;
|
|
327
374
|
message: string;
|
|
328
|
-
meta: unknown
|
|
375
|
+
meta: Record<string, unknown>;
|
|
329
376
|
error_code: string;
|
|
330
377
|
};
|
|
331
378
|
};
|
|
@@ -357,6 +404,13 @@ export declare type ValidationError = {
|
|
|
357
404
|
context: {
|
|
358
405
|
expectedRows: number;
|
|
359
406
|
};
|
|
407
|
+
} | {
|
|
408
|
+
error_identifier: 'INCOMPLETE_CONNECT_OUTPUT';
|
|
409
|
+
context: {
|
|
410
|
+
expectedRows: number;
|
|
411
|
+
relation: string;
|
|
412
|
+
relationType: string;
|
|
413
|
+
};
|
|
360
414
|
} | {
|
|
361
415
|
error_identifier: 'RECORDS_NOT_CONNECTED';
|
|
362
416
|
context: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,36 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Context } from '@opentelemetry/api';
|
|
2
2
|
import type { IsolationLevel } from '@prisma/driver-adapter-utils';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { Span } from '@opentelemetry/api';
|
|
4
|
+
import { SpanOptions } from '@opentelemetry/api';
|
|
5
5
|
import { SqlDriverAdapter } from '@prisma/driver-adapter-utils';
|
|
6
6
|
import { SqlQueryable } from '@prisma/driver-adapter-utils';
|
|
7
7
|
import { SqlResultSet } from '@prisma/driver-adapter-utils';
|
|
8
8
|
import { Transaction } from '@prisma/driver-adapter-utils';
|
|
9
9
|
|
|
10
|
+
export declare class DataMapperError extends Error {
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
export declare type DataRule = {
|
|
11
15
|
type: 'rowCountEq';
|
|
12
16
|
args: number;
|
|
13
17
|
} | {
|
|
14
18
|
type: 'rowCountNeq';
|
|
15
19
|
args: number;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'affectedRowCountEq';
|
|
22
|
+
args: number;
|
|
16
23
|
} | {
|
|
17
24
|
type: 'never';
|
|
18
25
|
};
|
|
19
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Checks if two objects representing the names and values of key columns match. A match is
|
|
29
|
+
* defined by one of the sets of keys being a subset of the other. This function also
|
|
30
|
+
* converts arguments to the types used by driver adapters if necessary.
|
|
31
|
+
*/
|
|
32
|
+
export declare function doKeysMatch(lhs: {}, rhs: {}): boolean;
|
|
33
|
+
|
|
20
34
|
declare type ExtendedSpanOptions = SpanOptions & {
|
|
21
35
|
name: string;
|
|
22
36
|
};
|
|
@@ -37,6 +51,8 @@ export declare type Fragment = {
|
|
|
37
51
|
*/
|
|
38
52
|
export declare function isDeepStrictEqual(a: unknown, b: unknown): boolean;
|
|
39
53
|
|
|
54
|
+
export declare function isPrismaValueBigInt(value: unknown): value is PrismaValueBigInt;
|
|
55
|
+
|
|
40
56
|
export declare function isPrismaValueBytes(value: unknown): value is PrismaValueBytes;
|
|
41
57
|
|
|
42
58
|
export declare function isPrismaValueGenerator(value: unknown): value is PrismaValueGenerator;
|
|
@@ -64,7 +80,12 @@ export declare interface PlaceholderFormat {
|
|
|
64
80
|
hasNumbering: boolean;
|
|
65
81
|
}
|
|
66
82
|
|
|
67
|
-
export declare type PrismaValue = string | boolean | number | PrismaValue[] | null | Record<string, unknown> | PrismaValuePlaceholder | PrismaValueGenerator | PrismaValueBytes;
|
|
83
|
+
export declare type PrismaValue = string | boolean | number | PrismaValue[] | null | Record<string, unknown> | PrismaValuePlaceholder | PrismaValueGenerator | PrismaValueBytes | PrismaValueBigInt;
|
|
84
|
+
|
|
85
|
+
export declare type PrismaValueBigInt = {
|
|
86
|
+
prisma__type: 'bigint';
|
|
87
|
+
prisma__value: string;
|
|
88
|
+
};
|
|
68
89
|
|
|
69
90
|
export declare type PrismaValueBytes = {
|
|
70
91
|
prisma__type: 'bytes';
|
|
@@ -103,6 +124,8 @@ export declare type PrismaValueType = {
|
|
|
103
124
|
type: 'Decimal';
|
|
104
125
|
} | {
|
|
105
126
|
type: 'Date';
|
|
127
|
+
} | {
|
|
128
|
+
type: 'Time';
|
|
106
129
|
} | {
|
|
107
130
|
type: 'Array';
|
|
108
131
|
inner: PrismaValueType;
|
|
@@ -110,6 +133,9 @@ export declare type PrismaValueType = {
|
|
|
110
133
|
type: 'Object';
|
|
111
134
|
} | {
|
|
112
135
|
type: 'Bytes';
|
|
136
|
+
} | {
|
|
137
|
+
type: 'Enum';
|
|
138
|
+
inner: string;
|
|
113
139
|
};
|
|
114
140
|
|
|
115
141
|
export declare type QueryEvent = {
|
|
@@ -121,7 +147,7 @@ export declare type QueryEvent = {
|
|
|
121
147
|
|
|
122
148
|
export declare class QueryInterpreter {
|
|
123
149
|
#private;
|
|
124
|
-
constructor({ transactionManager, placeholderValues, onQuery, tracingHelper, serializer }: QueryInterpreterOptions);
|
|
150
|
+
constructor({ transactionManager, placeholderValues, onQuery, tracingHelper, serializer, rawSerializer, }: QueryInterpreterOptions);
|
|
125
151
|
static forSql(options: {
|
|
126
152
|
transactionManager: QueryInterpreterTransactionManager;
|
|
127
153
|
placeholderValues: Record<string, unknown>;
|
|
@@ -138,6 +164,7 @@ export declare type QueryInterpreterOptions = {
|
|
|
138
164
|
onQuery?: (event: QueryEvent) => void;
|
|
139
165
|
tracingHelper: TracingHelper;
|
|
140
166
|
serializer: (results: SqlResultSet) => Value;
|
|
167
|
+
rawSerializer?: (results: SqlResultSet) => Value;
|
|
141
168
|
};
|
|
142
169
|
|
|
143
170
|
export declare type QueryInterpreterTransactionManager = {
|
|
@@ -223,6 +250,7 @@ export declare type QueryPlanNode = {
|
|
|
223
250
|
args: {
|
|
224
251
|
expr: QueryPlanNode;
|
|
225
252
|
structure: ResultNode;
|
|
253
|
+
enums: Record<string, Record<string, string>>;
|
|
226
254
|
};
|
|
227
255
|
} | {
|
|
228
256
|
type: 'validate';
|
|
@@ -258,9 +286,22 @@ export declare type QueryPlanNode = {
|
|
|
258
286
|
expr: QueryPlanNode;
|
|
259
287
|
pagination: Pagination;
|
|
260
288
|
};
|
|
289
|
+
} | {
|
|
290
|
+
type: 'extendRecord';
|
|
291
|
+
args: {
|
|
292
|
+
expr: QueryPlanNode;
|
|
293
|
+
values: Record<string, {
|
|
294
|
+
type: 'value';
|
|
295
|
+
value: PrismaValue;
|
|
296
|
+
} | {
|
|
297
|
+
type: 'lastInsertId';
|
|
298
|
+
}>;
|
|
299
|
+
};
|
|
261
300
|
};
|
|
262
301
|
|
|
263
302
|
export declare type ResultNode = {
|
|
303
|
+
type: 'AffectedRows';
|
|
304
|
+
} | {
|
|
264
305
|
type: 'Object';
|
|
265
306
|
fields: Record<string, ResultNode>;
|
|
266
307
|
flattened: boolean;
|
|
@@ -270,6 +311,12 @@ export declare type ResultNode = {
|
|
|
270
311
|
resultType: PrismaValueType;
|
|
271
312
|
};
|
|
272
313
|
|
|
314
|
+
/**
|
|
315
|
+
* `JSON.stringify` wrapper with custom replacer function that handles nested
|
|
316
|
+
* BigInt and Uint8Array values.
|
|
317
|
+
*/
|
|
318
|
+
export declare function safeJsonStringify(obj: unknown): string;
|
|
319
|
+
|
|
273
320
|
declare type SpanCallback<R> = (span?: Span, context?: Context) => R;
|
|
274
321
|
|
|
275
322
|
export declare interface TracingHelper {
|
|
@@ -287,10 +334,11 @@ export declare class TransactionManager {
|
|
|
287
334
|
private readonly driverAdapter;
|
|
288
335
|
private readonly transactionOptions;
|
|
289
336
|
private readonly tracingHelper;
|
|
290
|
-
constructor({ driverAdapter, transactionOptions, tracingHelper, }: {
|
|
337
|
+
constructor({ driverAdapter, transactionOptions, tracingHelper, onQuery, }: {
|
|
291
338
|
driverAdapter: SqlDriverAdapter;
|
|
292
339
|
transactionOptions: TransactionOptions;
|
|
293
340
|
tracingHelper: TracingHelper;
|
|
341
|
+
onQuery?: (event: QueryEvent) => void;
|
|
294
342
|
});
|
|
295
343
|
startTransaction(options?: TransactionOptions): Promise<TransactionInfo>;
|
|
296
344
|
commitTransaction(transactionId: string): Promise<void>;
|
|
@@ -303,10 +351,9 @@ export declare class TransactionManager {
|
|
|
303
351
|
private validateOptions;
|
|
304
352
|
}
|
|
305
353
|
|
|
306
|
-
export declare class TransactionManagerError extends
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
constructor(message: string, meta?: Record<string, unknown> | undefined);
|
|
354
|
+
export declare class TransactionManagerError extends UserFacingError {
|
|
355
|
+
name: string;
|
|
356
|
+
constructor(message: string, meta?: Record<string, unknown>);
|
|
310
357
|
}
|
|
311
358
|
|
|
312
359
|
export declare type TransactionOptions = {
|
|
@@ -318,14 +365,14 @@ export declare type TransactionOptions = {
|
|
|
318
365
|
export declare class UserFacingError extends Error {
|
|
319
366
|
name: string;
|
|
320
367
|
code: string;
|
|
321
|
-
meta: unknown
|
|
322
|
-
constructor(message: string, code: string, meta?: unknown);
|
|
368
|
+
meta: Record<string, unknown>;
|
|
369
|
+
constructor(message: string, code: string, meta?: Record<string, unknown>);
|
|
323
370
|
toQueryResponseErrorObject(): {
|
|
324
371
|
error: string;
|
|
325
372
|
user_facing_error: {
|
|
326
373
|
is_panic: boolean;
|
|
327
374
|
message: string;
|
|
328
|
-
meta: unknown
|
|
375
|
+
meta: Record<string, unknown>;
|
|
329
376
|
error_code: string;
|
|
330
377
|
};
|
|
331
378
|
};
|
|
@@ -357,6 +404,13 @@ export declare type ValidationError = {
|
|
|
357
404
|
context: {
|
|
358
405
|
expectedRows: number;
|
|
359
406
|
};
|
|
407
|
+
} | {
|
|
408
|
+
error_identifier: 'INCOMPLETE_CONNECT_OUTPUT';
|
|
409
|
+
context: {
|
|
410
|
+
expectedRows: number;
|
|
411
|
+
relation: string;
|
|
412
|
+
relationType: string;
|
|
413
|
+
};
|
|
360
414
|
} | {
|
|
361
415
|
error_identifier: 'RECORDS_NOT_CONNECTED';
|
|
362
416
|
context: {
|