lang-database 7.3.0 → 8.0.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.
@@ -1,1566 +0,0 @@
1
- declare type Action = keyof typeof DMMF.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw';
2
-
3
- declare class AnyNull extends NullTypesEnumValue {
4
- }
5
-
6
- declare class Arg {
7
- key: string;
8
- value: ArgValue;
9
- error?: InvalidArgError;
10
- hasError: boolean;
11
- isEnum: boolean;
12
- schemaArg?: DMMF.SchemaArg;
13
- isNullable: boolean;
14
- inputType?: DMMF.SchemaArgInputType;
15
- constructor({ key, value, isEnum, error, schemaArg, inputType }: ArgOptions);
16
- get [Symbol.toStringTag](): string;
17
- _toString(value: ArgValue, key: string): string | undefined;
18
- toString(): string | undefined;
19
- collectErrors(): ArgError[];
20
- }
21
-
22
- declare interface ArgError {
23
- path: string[];
24
- id?: string;
25
- error: InvalidArgError;
26
- }
27
-
28
- declare interface ArgOptions {
29
- key: string;
30
- value: ArgValue;
31
- isEnum?: boolean;
32
- error?: InvalidArgError;
33
- schemaArg?: DMMF.SchemaArg;
34
- inputType?: DMMF.SchemaArgInputType;
35
- }
36
-
37
- declare class Args {
38
- args: Arg[];
39
- readonly hasInvalidArg: boolean;
40
- constructor(args?: Arg[]);
41
- get [Symbol.toStringTag](): string;
42
- toString(): string;
43
- collectErrors(): ArgError[];
44
- }
45
-
46
- declare type ArgValue = string | boolean | number | undefined | Args | string[] | boolean[] | number[] | Args[] | null;
47
-
48
- declare interface AtLeastOneError {
49
- type: 'atLeastOne';
50
- key: string;
51
- inputType: DMMF.InputType;
52
- }
53
-
54
- declare interface AtMostOneError {
55
- type: 'atMostOne';
56
- key: string;
57
- inputType: DMMF.InputType;
58
- providedKeys: string[];
59
- }
60
-
61
- export declare type BaseDMMF = Pick<DMMF.Document, 'datamodel' | 'mappings'>;
62
-
63
- declare interface BaseDMMFHelper extends DMMFDatamodelHelper, DMMFMappingsHelper {
64
- }
65
-
66
- declare class BaseDMMFHelper {
67
- constructor(dmmf: BaseDMMF);
68
- }
69
-
70
- declare interface BinaryTargetsEnvValue {
71
- fromEnvVar: null | string;
72
- value: string;
73
- }
74
-
75
- declare interface CallSite {
76
- getLocation(): LocationInFile | null;
77
- }
78
-
79
- declare interface Client {
80
- /** Only via tx proxy */
81
- [TX_ID]?: string;
82
- _baseDmmf: BaseDMMFHelper;
83
- _dmmf?: DMMFClass;
84
- _engine: Engine;
85
- _fetcher: RequestHandler;
86
- _connectionPromise?: Promise<any>;
87
- _disconnectionPromise?: Promise<any>;
88
- _engineConfig: EngineConfig;
89
- _clientVersion: string;
90
- _errorFormat: ErrorFormat;
91
- _tracingConfig: TracingConfig;
92
- readonly $metrics: MetricsClient;
93
- $use<T>(arg0: Namespace | QueryMiddleware<T>, arg1?: QueryMiddleware | EngineMiddleware<T>): any;
94
- $on(eventType: EngineEventType, callback: (event: any) => void): any;
95
- $connect(): any;
96
- $disconnect(): any;
97
- _runDisconnect(): any;
98
- $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): any;
99
- $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): any;
100
- __internal_triggerPanic(fatal: boolean): any;
101
- $transaction(input: any, options?: any): any;
102
- _request(internalParams: InternalRequestParams): Promise<any>;
103
- }
104
-
105
- declare type ConnectorType = 'mysql' | 'mongodb' | 'sqlite' | 'postgresql' | 'sqlserver' | 'jdbc:sqlserver' | 'cockroachdb';
106
-
107
- declare type ConnectorType_2 = 'mysql' | 'mongodb' | 'sqlite' | 'postgresql' | 'sqlserver' | 'jdbc:sqlserver' | 'cockroachdb';
108
-
109
- declare interface Context {
110
- /**
111
- * Get a value from the context.
112
- *
113
- * @param key key which identifies a context value
114
- */
115
- getValue(key: symbol): unknown;
116
- /**
117
- * Create a new context which inherits from this context and has
118
- * the given key set to the given value.
119
- *
120
- * @param key context key for which to set the value
121
- * @param value value to set for the given key
122
- */
123
- setValue(key: symbol, value: unknown): Context;
124
- /**
125
- * Return a new context which inherits from this context but does
126
- * not contain a value for the given key.
127
- *
128
- * @param key context key for which to clear a value
129
- */
130
- deleteValue(key: symbol): Context;
131
- }
132
-
133
- declare class DataLoader<T = unknown> {
134
- private options;
135
- batches: {
136
- [key: string]: Job[];
137
- };
138
- private tickActive;
139
- constructor(options: DataLoaderOptions<T>);
140
- request(request: T): Promise<any>;
141
- private dispatchBatches;
142
- get [Symbol.toStringTag](): string;
143
- }
144
-
145
- declare type DataLoaderOptions<T> = {
146
- singleLoader: (request: T) => Promise<any>;
147
- batchLoader: (request: T[]) => Promise<any[]>;
148
- batchBy: (request: T) => string | undefined;
149
- };
150
-
151
- declare interface DataSource {
152
- name: string;
153
- activeProvider: ConnectorType;
154
- provider: ConnectorType;
155
- url: EnvValue;
156
- config: {
157
- [key: string]: string;
158
- };
159
- }
160
-
161
- declare type Datasource = {
162
- url?: string;
163
- };
164
-
165
- declare interface DatasourceOverwrite {
166
- name: string;
167
- url?: string;
168
- env?: string;
169
- }
170
-
171
- declare type Datasources = {
172
- [name in string]: Datasource;
173
- };
174
-
175
- declare class DbNull extends NullTypesEnumValue {
176
- }
177
-
178
- export declare interface Debug {
179
- (namespace: string): Debugger;
180
- disable: () => string;
181
- enable: (namespace: string) => void;
182
- enabled: (namespace: string) => boolean;
183
- log: (...args: any[]) => any;
184
- formatters: Record<string, ((value: any) => string) | undefined>;
185
- }
186
-
187
- declare interface Debugger {
188
- (format: any, ...args: any[]): void;
189
- log: (...args: any[]) => any;
190
- extend: (namespace: string, delimiter?: string) => Debugger;
191
- color: string | number;
192
- enabled: boolean;
193
- namespace: string;
194
- }
195
-
196
- export declare namespace Decimal {
197
- export type Constructor = typeof Decimal;
198
- export type Instance = Decimal;
199
- export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
200
- export type Modulo = Rounding | 9;
201
- export type Value = string | number | Decimal;
202
-
203
- // http://mikemcl.github.io/decimal.js/#constructor-properties
204
- export interface Config {
205
- precision?: number;
206
- rounding?: Rounding;
207
- toExpNeg?: number;
208
- toExpPos?: number;
209
- minE?: number;
210
- maxE?: number;
211
- crypto?: boolean;
212
- modulo?: Modulo;
213
- defaults?: boolean;
214
- }
215
- }
216
-
217
- export declare class Decimal {
218
- readonly d: number[];
219
- readonly e: number;
220
- readonly s: number;
221
- private readonly toStringTag: string;
222
-
223
- constructor(n: Decimal.Value);
224
-
225
- absoluteValue(): Decimal;
226
- abs(): Decimal;
227
-
228
- ceil(): Decimal;
229
-
230
- clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal;
231
- clamp(min: Decimal.Value, max: Decimal.Value): Decimal;
232
-
233
- comparedTo(n: Decimal.Value): number;
234
- cmp(n: Decimal.Value): number;
235
-
236
- cosine(): Decimal;
237
- cos(): Decimal;
238
-
239
- cubeRoot(): Decimal;
240
- cbrt(): Decimal;
241
-
242
- decimalPlaces(): number;
243
- dp(): number;
244
-
245
- dividedBy(n: Decimal.Value): Decimal;
246
- div(n: Decimal.Value): Decimal;
247
-
248
- dividedToIntegerBy(n: Decimal.Value): Decimal;
249
- divToInt(n: Decimal.Value): Decimal;
250
-
251
- equals(n: Decimal.Value): boolean;
252
- eq(n: Decimal.Value): boolean;
253
-
254
- floor(): Decimal;
255
-
256
- greaterThan(n: Decimal.Value): boolean;
257
- gt(n: Decimal.Value): boolean;
258
-
259
- greaterThanOrEqualTo(n: Decimal.Value): boolean;
260
- gte(n: Decimal.Value): boolean;
261
-
262
- hyperbolicCosine(): Decimal;
263
- cosh(): Decimal;
264
-
265
- hyperbolicSine(): Decimal;
266
- sinh(): Decimal;
267
-
268
- hyperbolicTangent(): Decimal;
269
- tanh(): Decimal;
270
-
271
- inverseCosine(): Decimal;
272
- acos(): Decimal;
273
-
274
- inverseHyperbolicCosine(): Decimal;
275
- acosh(): Decimal;
276
-
277
- inverseHyperbolicSine(): Decimal;
278
- asinh(): Decimal;
279
-
280
- inverseHyperbolicTangent(): Decimal;
281
- atanh(): Decimal;
282
-
283
- inverseSine(): Decimal;
284
- asin(): Decimal;
285
-
286
- inverseTangent(): Decimal;
287
- atan(): Decimal;
288
-
289
- isFinite(): boolean;
290
-
291
- isInteger(): boolean;
292
- isInt(): boolean;
293
-
294
- isNaN(): boolean;
295
-
296
- isNegative(): boolean;
297
- isNeg(): boolean;
298
-
299
- isPositive(): boolean;
300
- isPos(): boolean;
301
-
302
- isZero(): boolean;
303
-
304
- lessThan(n: Decimal.Value): boolean;
305
- lt(n: Decimal.Value): boolean;
306
-
307
- lessThanOrEqualTo(n: Decimal.Value): boolean;
308
- lte(n: Decimal.Value): boolean;
309
-
310
- logarithm(n?: Decimal.Value): Decimal;
311
- log(n?: Decimal.Value): Decimal;
312
-
313
- minus(n: Decimal.Value): Decimal;
314
- sub(n: Decimal.Value): Decimal;
315
-
316
- modulo(n: Decimal.Value): Decimal;
317
- mod(n: Decimal.Value): Decimal;
318
-
319
- naturalExponential(): Decimal;
320
- exp(): Decimal;
321
-
322
- naturalLogarithm(): Decimal;
323
- ln(): Decimal;
324
-
325
- negated(): Decimal;
326
- neg(): Decimal;
327
-
328
- plus(n: Decimal.Value): Decimal;
329
- add(n: Decimal.Value): Decimal;
330
-
331
- precision(includeZeros?: boolean): number;
332
- sd(includeZeros?: boolean): number;
333
-
334
- round(): Decimal;
335
-
336
- sine() : Decimal;
337
- sin() : Decimal;
338
-
339
- squareRoot(): Decimal;
340
- sqrt(): Decimal;
341
-
342
- tangent() : Decimal;
343
- tan() : Decimal;
344
-
345
- times(n: Decimal.Value): Decimal;
346
- mul(n: Decimal.Value) : Decimal;
347
-
348
- toBinary(significantDigits?: number): string;
349
- toBinary(significantDigits: number, rounding: Decimal.Rounding): string;
350
-
351
- toDecimalPlaces(decimalPlaces?: number): Decimal;
352
- toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal;
353
- toDP(decimalPlaces?: number): Decimal;
354
- toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal;
355
-
356
- toExponential(decimalPlaces?: number): string;
357
- toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string;
358
-
359
- toFixed(decimalPlaces?: number): string;
360
- toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string;
361
-
362
- toFraction(max_denominator?: Decimal.Value): Decimal[];
363
-
364
- toHexadecimal(significantDigits?: number): string;
365
- toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string;
366
- toHex(significantDigits?: number): string;
367
- toHex(significantDigits: number, rounding?: Decimal.Rounding): string;
368
-
369
- toJSON(): string;
370
-
371
- toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal;
372
-
373
- toNumber(): number;
374
-
375
- toOctal(significantDigits?: number): string;
376
- toOctal(significantDigits: number, rounding: Decimal.Rounding): string;
377
-
378
- toPower(n: Decimal.Value): Decimal;
379
- pow(n: Decimal.Value): Decimal;
380
-
381
- toPrecision(significantDigits?: number): string;
382
- toPrecision(significantDigits: number, rounding: Decimal.Rounding): string;
383
-
384
- toSignificantDigits(significantDigits?: number): Decimal;
385
- toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal;
386
- toSD(significantDigits?: number): Decimal;
387
- toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal;
388
-
389
- toString(): string;
390
-
391
- truncated(): Decimal;
392
- trunc(): Decimal;
393
-
394
- valueOf(): string;
395
-
396
- static abs(n: Decimal.Value): Decimal;
397
- static acos(n: Decimal.Value): Decimal;
398
- static acosh(n: Decimal.Value): Decimal;
399
- static add(x: Decimal.Value, y: Decimal.Value): Decimal;
400
- static asin(n: Decimal.Value): Decimal;
401
- static asinh(n: Decimal.Value): Decimal;
402
- static atan(n: Decimal.Value): Decimal;
403
- static atanh(n: Decimal.Value): Decimal;
404
- static atan2(y: Decimal.Value, x: Decimal.Value): Decimal;
405
- static cbrt(n: Decimal.Value): Decimal;
406
- static ceil(n: Decimal.Value): Decimal;
407
- static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal;
408
- static clone(object?: Decimal.Config): Decimal.Constructor;
409
- static config(object: Decimal.Config): Decimal.Constructor;
410
- static cos(n: Decimal.Value): Decimal;
411
- static cosh(n: Decimal.Value): Decimal;
412
- static div(x: Decimal.Value, y: Decimal.Value): Decimal;
413
- static exp(n: Decimal.Value): Decimal;
414
- static floor(n: Decimal.Value): Decimal;
415
- static hypot(...n: Decimal.Value[]): Decimal;
416
- static isDecimal(object: any): object is Decimal;
417
- static ln(n: Decimal.Value): Decimal;
418
- static log(n: Decimal.Value, base?: Decimal.Value): Decimal;
419
- static log2(n: Decimal.Value): Decimal;
420
- static log10(n: Decimal.Value): Decimal;
421
- static max(...n: Decimal.Value[]): Decimal;
422
- static min(...n: Decimal.Value[]): Decimal;
423
- static mod(x: Decimal.Value, y: Decimal.Value): Decimal;
424
- static mul(x: Decimal.Value, y: Decimal.Value): Decimal;
425
- static noConflict(): Decimal.Constructor; // Browser only
426
- static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal;
427
- static random(significantDigits?: number): Decimal;
428
- static round(n: Decimal.Value): Decimal;
429
- static set(object: Decimal.Config): Decimal.Constructor;
430
- static sign(n: Decimal.Value): Decimal;
431
- static sin(n: Decimal.Value): Decimal;
432
- static sinh(n: Decimal.Value): Decimal;
433
- static sqrt(n: Decimal.Value): Decimal;
434
- static sub(x: Decimal.Value, y: Decimal.Value): Decimal;
435
- static sum(...n: Decimal.Value[]): Decimal;
436
- static tan(n: Decimal.Value): Decimal;
437
- static tanh(n: Decimal.Value): Decimal;
438
- static trunc(n: Decimal.Value): Decimal;
439
-
440
- static readonly default?: Decimal.Constructor;
441
- static readonly Decimal?: Decimal.Constructor;
442
-
443
- static readonly precision: number;
444
- static readonly rounding: Decimal.Rounding;
445
- static readonly toExpNeg: number;
446
- static readonly toExpPos: number;
447
- static readonly minE: number;
448
- static readonly maxE: number;
449
- static readonly crypto: boolean;
450
- static readonly modulo: Decimal.Modulo;
451
-
452
- static readonly ROUND_UP: 0;
453
- static readonly ROUND_DOWN: 1;
454
- static readonly ROUND_CEIL: 2;
455
- static readonly ROUND_FLOOR: 3;
456
- static readonly ROUND_HALF_UP: 4;
457
- static readonly ROUND_HALF_DOWN: 5;
458
- static readonly ROUND_HALF_EVEN: 6;
459
- static readonly ROUND_HALF_CEIL: 7;
460
- static readonly ROUND_HALF_FLOOR: 8;
461
- static readonly EUCLID: 9;
462
- }
463
-
464
- /**
465
- * Interface for any Decimal.js-like library
466
- * Allows us to accept Decimal.js from different
467
- * versions and some compatible alternatives
468
- */
469
- export declare interface DecimalJsLike {
470
- d: number[];
471
- e: number;
472
- s: number;
473
- }
474
-
475
- export declare const decompressFromBase64: any;
476
-
477
- declare type Dictionary<T> = {
478
- [key: string]: T;
479
- };
480
-
481
- declare interface Dictionary_2<T> {
482
- [key: string]: T;
483
- }
484
-
485
- export declare namespace DMMF {
486
- export interface Document {
487
- datamodel: Datamodel;
488
- schema: Schema;
489
- mappings: Mappings;
490
- }
491
- export interface Mappings {
492
- modelOperations: ModelMapping[];
493
- otherOperations: {
494
- read: string[];
495
- write: string[];
496
- };
497
- }
498
- export interface OtherOperationMappings {
499
- read: string[];
500
- write: string[];
501
- }
502
- export interface DatamodelEnum {
503
- name: string;
504
- values: EnumValue[];
505
- dbName?: string | null;
506
- documentation?: string;
507
- }
508
- export interface SchemaEnum {
509
- name: string;
510
- values: string[];
511
- }
512
- export interface EnumValue {
513
- name: string;
514
- dbName: string | null;
515
- }
516
- export interface Datamodel {
517
- models: Model[];
518
- enums: DatamodelEnum[];
519
- types: Model[];
520
- }
521
- export interface uniqueIndex {
522
- name: string;
523
- fields: string[];
524
- }
525
- export interface PrimaryKey {
526
- name: string | null;
527
- fields: string[];
528
- }
529
- export interface Model {
530
- name: string;
531
- dbName: string | null;
532
- fields: Field[];
533
- uniqueFields: string[][];
534
- uniqueIndexes: uniqueIndex[];
535
- documentation?: string;
536
- primaryKey: PrimaryKey | null;
537
- [key: string]: any;
538
- }
539
- export type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported';
540
- export type FieldNamespace = 'model' | 'prisma';
541
- export type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes';
542
- export interface Field {
543
- kind: FieldKind;
544
- name: string;
545
- isRequired: boolean;
546
- isList: boolean;
547
- isUnique: boolean;
548
- isId: boolean;
549
- isReadOnly: boolean;
550
- isGenerated?: boolean;
551
- isUpdatedAt?: boolean;
552
- /**
553
- * Describes the data type in the same the way is is defined in the Prisma schema:
554
- * BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName
555
- */
556
- type: string;
557
- dbNames?: string[] | null;
558
- hasDefaultValue: boolean;
559
- default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[];
560
- relationFromFields?: string[];
561
- relationToFields?: any[];
562
- relationOnDelete?: string;
563
- relationName?: string;
564
- documentation?: string;
565
- [key: string]: any;
566
- }
567
- export interface FieldDefault {
568
- name: string;
569
- args: any[];
570
- }
571
- export type FieldDefaultScalar = string | boolean | number;
572
- export interface Schema {
573
- rootQueryType?: string;
574
- rootMutationType?: string;
575
- inputObjectTypes: {
576
- model?: InputType[];
577
- prisma: InputType[];
578
- };
579
- outputObjectTypes: {
580
- model: OutputType[];
581
- prisma: OutputType[];
582
- };
583
- enumTypes: {
584
- model?: SchemaEnum[];
585
- prisma: SchemaEnum[];
586
- };
587
- fieldRefTypes: {
588
- prisma?: FieldRefType[];
589
- };
590
- }
591
- export interface Query {
592
- name: string;
593
- args: SchemaArg[];
594
- output: QueryOutput;
595
- }
596
- export interface QueryOutput {
597
- name: string;
598
- isRequired: boolean;
599
- isList: boolean;
600
- }
601
- export type ArgType = string | InputType | SchemaEnum;
602
- export interface SchemaArgInputType {
603
- isList: boolean;
604
- type: ArgType;
605
- location: FieldLocation;
606
- namespace?: FieldNamespace;
607
- }
608
- export interface SchemaArg {
609
- name: string;
610
- comment?: string;
611
- isNullable: boolean;
612
- isRequired: boolean;
613
- inputTypes: SchemaArgInputType[];
614
- deprecation?: Deprecation;
615
- }
616
- export interface OutputType {
617
- name: string;
618
- fields: SchemaField[];
619
- fieldMap?: Record<string, SchemaField>;
620
- }
621
- export interface SchemaField {
622
- name: string;
623
- isNullable?: boolean;
624
- outputType: OutputTypeRef;
625
- args: SchemaArg[];
626
- deprecation?: Deprecation;
627
- documentation?: string;
628
- }
629
- export type TypeRefCommon = {
630
- isList: boolean;
631
- namespace?: FieldNamespace;
632
- };
633
- export type TypeRefScalar = TypeRefCommon & {
634
- location: 'scalar';
635
- type: string;
636
- };
637
- export type TypeRefOutputObject = TypeRefCommon & {
638
- location: 'outputObjectTypes';
639
- type: OutputType | string;
640
- };
641
- export type TypeRefEnum = TypeRefCommon & {
642
- location: 'enumTypes';
643
- type: SchemaEnum | string;
644
- };
645
- export type OutputTypeRef = TypeRefScalar | TypeRefOutputObject | TypeRefEnum;
646
- export interface Deprecation {
647
- sinceVersion: string;
648
- reason: string;
649
- plannedRemovalVersion?: string;
650
- }
651
- export interface InputType {
652
- name: string;
653
- constraints: {
654
- maxNumFields: number | null;
655
- minNumFields: number | null;
656
- };
657
- meta?: {
658
- source?: string;
659
- };
660
- fields: SchemaArg[];
661
- fieldMap?: Record<string, SchemaArg>;
662
- }
663
- export interface FieldRefType {
664
- name: string;
665
- allowTypes: FieldRefAllowType[];
666
- fields: SchemaArg[];
667
- }
668
- export type FieldRefAllowType = TypeRefScalar | TypeRefEnum;
669
- export interface ModelMapping {
670
- model: string;
671
- plural: string;
672
- findUnique?: string | null;
673
- findFirst?: string | null;
674
- findMany?: string | null;
675
- create?: string | null;
676
- createMany?: string | null;
677
- update?: string | null;
678
- updateMany?: string | null;
679
- upsert?: string | null;
680
- delete?: string | null;
681
- deleteMany?: string | null;
682
- aggregate?: string | null;
683
- groupBy?: string | null;
684
- count?: string | null;
685
- findRaw?: string | null;
686
- aggregateRaw?: string | null;
687
- }
688
- export enum ModelAction {
689
- findUnique = "findUnique",
690
- findFirst = "findFirst",
691
- findMany = "findMany",
692
- create = "create",
693
- createMany = "createMany",
694
- update = "update",
695
- updateMany = "updateMany",
696
- upsert = "upsert",
697
- delete = "delete",
698
- deleteMany = "deleteMany",
699
- groupBy = "groupBy",
700
- count = "count",
701
- aggregate = "aggregate",
702
- findRaw = "findRaw",
703
- aggregateRaw = "aggregateRaw"
704
- }
705
- }
706
-
707
- export declare interface DMMFClass extends BaseDMMFHelper, DMMFSchemaHelper {
708
- }
709
-
710
- export declare class DMMFClass {
711
- constructor(dmmf: DMMF.Document);
712
- }
713
-
714
- declare class DMMFDatamodelHelper implements Pick<DMMF.Document, 'datamodel'> {
715
- datamodel: DMMF.Datamodel;
716
- datamodelEnumMap: Dictionary_2<DMMF.DatamodelEnum>;
717
- modelMap: Dictionary_2<DMMF.Model>;
718
- typeMap: Dictionary_2<DMMF.Model>;
719
- typeAndModelMap: Dictionary_2<DMMF.Model>;
720
- constructor({ datamodel }: Pick<DMMF.Document, 'datamodel'>);
721
- getDatamodelEnumMap(): Dictionary_2<DMMF.DatamodelEnum>;
722
- getModelMap(): Dictionary_2<DMMF.Model>;
723
- getTypeMap(): Dictionary_2<DMMF.Model>;
724
- getTypeModelMap(): Dictionary_2<DMMF.Model>;
725
- }
726
-
727
- declare class DMMFMappingsHelper implements Pick<DMMF.Document, 'mappings'> {
728
- mappings: DMMF.Mappings;
729
- mappingsMap: Dictionary_2<DMMF.ModelMapping>;
730
- constructor({ mappings }: Pick<DMMF.Document, 'mappings'>);
731
- getMappingsMap(): Dictionary_2<DMMF.ModelMapping>;
732
- }
733
-
734
- declare class DMMFSchemaHelper implements Pick<DMMF.Document, 'schema'> {
735
- schema: DMMF.Schema;
736
- queryType: DMMF.OutputType;
737
- mutationType: DMMF.OutputType;
738
- outputTypes: {
739
- model: DMMF.OutputType[];
740
- prisma: DMMF.OutputType[];
741
- };
742
- outputTypeMap: Dictionary_2<DMMF.OutputType>;
743
- inputObjectTypes: {
744
- model?: DMMF.InputType[];
745
- prisma: DMMF.InputType[];
746
- };
747
- inputTypeMap: Dictionary_2<DMMF.InputType>;
748
- enumMap: Dictionary_2<DMMF.SchemaEnum>;
749
- rootFieldMap: Dictionary_2<DMMF.SchemaField>;
750
- constructor({ schema }: Pick<DMMF.Document, 'schema'>);
751
- get [Symbol.toStringTag](): string;
752
- outputTypeToMergedOutputType: (outputType: DMMF.OutputType) => DMMF.OutputType;
753
- resolveOutputTypes(): void;
754
- resolveInputTypes(): void;
755
- resolveFieldArgumentTypes(): void;
756
- getQueryType(): DMMF.OutputType;
757
- getMutationType(): DMMF.OutputType;
758
- getOutputTypes(): {
759
- model: DMMF.OutputType[];
760
- prisma: DMMF.OutputType[];
761
- };
762
- getEnumMap(): Dictionary_2<DMMF.SchemaEnum>;
763
- hasEnumInNamespace(enumName: string, namespace: 'prisma' | 'model'): boolean;
764
- getMergedOutputTypeMap(): Dictionary_2<DMMF.OutputType>;
765
- getInputTypeMap(): Dictionary_2<DMMF.InputType>;
766
- getRootFieldMap(): Dictionary_2<DMMF.SchemaField>;
767
- }
768
-
769
- declare class Document_2 {
770
- readonly type: 'query' | 'mutation';
771
- readonly children: Field[];
772
- constructor(type: 'query' | 'mutation', children: Field[]);
773
- get [Symbol.toStringTag](): string;
774
- toString(): string;
775
- validate(select?: any, isTopLevelQuery?: boolean, originalMethod?: string, errorFormat?: 'pretty' | 'minimal' | 'colorless', validationCallsite?: any): void;
776
- protected printFieldError: ({ error }: FieldError, missingItems: MissingItem[], minimal: boolean) => string | undefined;
777
- protected printArgError: ({ error, path, id }: ArgError, hasMissingItems: boolean, minimal: boolean) => string | undefined;
778
- /**
779
- * As we're allowing both single objects and array of objects for list inputs, we need to remove incorrect
780
- * zero indexes from the path
781
- * @param inputPath e.g. ['where', 'AND', 0, 'id']
782
- * @param select select object
783
- */
784
- private normalizePath;
785
- }
786
-
787
- declare interface DocumentInput {
788
- dmmf: DMMFClass;
789
- rootTypeName: 'query' | 'mutation';
790
- rootField: string;
791
- select?: any;
792
- modelName?: string;
793
- }
794
-
795
- /**
796
- * Placeholder value for "no text".
797
- */
798
- export declare const empty: Sql;
799
-
800
- declare interface EmptyIncludeError {
801
- type: 'emptyInclude';
802
- field: DMMF.SchemaField;
803
- }
804
-
805
- declare interface EmptySelectError {
806
- type: 'emptySelect';
807
- field: DMMF.SchemaField;
808
- }
809
-
810
- export declare abstract class Engine {
811
- abstract on(event: EngineEventType, listener: (args?: any) => any): void;
812
- abstract start(): Promise<void>;
813
- abstract stop(): Promise<void>;
814
- abstract getConfig(): Promise<GetConfigResult>;
815
- abstract getDmmf(): Promise<DMMF.Document>;
816
- abstract version(forceRun?: boolean): Promise<string> | string;
817
- abstract request<T>(query: string, headers?: QueryEngineRequestHeaders, numTry?: number): Promise<QueryEngineResult<T>>;
818
- abstract requestBatch<T>(queries: string[], headers?: QueryEngineRequestHeaders, transaction?: boolean, numTry?: number): Promise<QueryEngineResult<T>[]>;
819
- abstract transaction(action: 'start', headers: Transaction.TransactionHeaders, options?: Transaction.Options): Promise<Transaction.Info>;
820
- abstract transaction(action: 'commit', headers: Transaction.TransactionHeaders, info: Transaction.Info): Promise<void>;
821
- abstract transaction(action: 'rollback', headers: Transaction.TransactionHeaders, info: Transaction.Info): Promise<void>;
822
- abstract metrics(options: MetricsOptionsJson): Promise<Metrics>;
823
- abstract metrics(options: MetricsOptionsPrometheus): Promise<string>;
824
- }
825
-
826
- declare interface EngineConfig {
827
- cwd?: string;
828
- dirname?: string;
829
- datamodelPath: string;
830
- enableDebugLogs?: boolean;
831
- allowTriggerPanic?: boolean;
832
- prismaPath?: string;
833
- fetcher?: (query: string) => Promise<{
834
- data?: any;
835
- error?: any;
836
- }>;
837
- generator?: GeneratorConfig;
838
- datasources?: DatasourceOverwrite[];
839
- showColors?: boolean;
840
- logQueries?: boolean;
841
- logLevel?: 'info' | 'warn';
842
- env: Record<string, string>;
843
- flags?: string[];
844
- clientVersion?: string;
845
- previewFeatures?: string[];
846
- engineEndpoint?: string;
847
- activeProvider?: string;
848
- /**
849
- * The contents of the schema encoded into a string
850
- * @remarks only used for the purpose of data proxy
851
- */
852
- inlineSchema?: string;
853
- /**
854
- * The contents of the datasource url saved in a string
855
- * @remarks only used for the purpose of data proxy
856
- */
857
- inlineDatasources?: Record<string, InlineDatasource>;
858
- /**
859
- * The string hash that was produced for a given schema
860
- * @remarks only used for the purpose of data proxy
861
- */
862
- inlineSchemaHash?: string;
863
- /**
864
- * The configuration object for enabling tracing
865
- * @remarks enabling is determined by the client
866
- */
867
- tracingConfig: TracingConfig;
868
- }
869
-
870
- declare type EngineEventType = 'query' | 'info' | 'warn' | 'error' | 'beforeExit';
871
-
872
- declare type EngineMiddleware<T = unknown> = (params: EngineMiddlewareParams, next: (params: EngineMiddlewareParams) => Promise<{
873
- data: T;
874
- elapsed: number;
875
- }>) => Promise<{
876
- data: T;
877
- elapsed: number;
878
- }>;
879
-
880
- declare type EngineMiddlewareParams = {
881
- document: Document_2;
882
- runInTransaction?: boolean;
883
- };
884
-
885
- declare interface EnvValue {
886
- fromEnvVar: null | string;
887
- value: string;
888
- }
889
-
890
- declare interface EnvValue_2 {
891
- fromEnvVar: string | null;
892
- value: string | null;
893
- }
894
-
895
- declare type ErrorFormat = 'pretty' | 'colorless' | 'minimal';
896
-
897
- declare class Field {
898
- readonly name: string;
899
- readonly args?: Args;
900
- readonly children?: Field[];
901
- readonly error?: InvalidFieldError;
902
- readonly hasInvalidChild: boolean;
903
- readonly hasInvalidArg: boolean;
904
- readonly schemaField?: DMMF.SchemaField;
905
- constructor({ name, args, children, error, schemaField }: FieldArgs);
906
- get [Symbol.toStringTag](): string;
907
- toString(): string;
908
- collectErrors(prefix?: string): {
909
- fieldErrors: FieldError[];
910
- argErrors: ArgError[];
911
- };
912
- }
913
-
914
- declare interface FieldArgs {
915
- name: string;
916
- schemaField?: DMMF.SchemaField;
917
- args?: Args;
918
- children?: Field[];
919
- error?: InvalidFieldError;
920
- }
921
-
922
- declare interface FieldError {
923
- path: string[];
924
- error: InvalidFieldError;
925
- }
926
-
927
- /**
928
- * A reference to a specific field of a specific model
929
- */
930
- export declare interface FieldRef<Model, FieldType> {
931
- readonly modelName: Model;
932
- readonly name: string;
933
- readonly typeName: FieldType;
934
- readonly isList: boolean;
935
- }
936
-
937
- /**
938
- * Find paths that match a set of regexes
939
- * @param root to start from
940
- * @param match to match against
941
- * @param types to select files, folders, links
942
- * @param deep to recurse in the directory tree
943
- * @param limit to limit the results
944
- * @param handler to further filter results
945
- * @param found to add to already found
946
- * @param seen to add to already seen
947
- * @returns found paths (symlinks preserved)
948
- */
949
- export declare function findSync(root: string, match: (RegExp | string)[], types?: ('f' | 'd' | 'l')[], deep?: ('d' | 'l')[], limit?: number, handler?: Handler, found?: string[], seen?: Record<string, true>): string[];
950
-
951
- declare interface GeneratorConfig {
952
- name: string;
953
- output: EnvValue | null;
954
- isCustomOutput?: boolean;
955
- provider: EnvValue;
956
- config: Dictionary<string>;
957
- binaryTargets: BinaryTargetsEnvValue[];
958
- previewFeatures: string[];
959
- }
960
-
961
- declare type GetConfigResult = {
962
- datasources: DataSource[];
963
- generators: GeneratorConfig[];
964
- };
965
-
966
- export declare function getPrismaClient(config: GetPrismaClientConfig): new (optionsArg?: PrismaClientOptions) => Client;
967
-
968
- /**
969
- * Config that is stored into the generated client. When the generated client is
970
- * loaded, this same config is passed to {@link getPrismaClient} which creates a
971
- * closure with that config around a non-instantiated [[PrismaClient]].
972
- */
973
- declare interface GetPrismaClientConfig {
974
- document: Omit<DMMF.Document, 'schema'>;
975
- generator?: GeneratorConfig;
976
- sqliteDatasourceOverrides?: DatasourceOverwrite[];
977
- relativeEnvPaths: {
978
- rootEnvPath?: string | null;
979
- schemaEnvPath?: string | null;
980
- };
981
- relativePath: string;
982
- dirname: string;
983
- filename?: string;
984
- clientVersion?: string;
985
- engineVersion?: string;
986
- datasourceNames: string[];
987
- activeProvider: string;
988
- /**
989
- * True when `--data-proxy` is passed to `prisma generate`
990
- * If enabled, we disregard the generator config engineType.
991
- * It means that `--data-proxy` binds you to the Data Proxy.
992
- */
993
- dataProxy: boolean;
994
- /**
995
- * The contents of the schema encoded into a string
996
- * @remarks only used for the purpose of data proxy
997
- */
998
- inlineSchema?: string;
999
- /**
1000
- * A special env object just for the data proxy edge runtime.
1001
- * Allows bundlers to inject their own env variables (Vercel).
1002
- * Allows platforms to declare global variables as env (Workers).
1003
- * @remarks only used for the purpose of data proxy
1004
- */
1005
- injectableEdgeEnv?: LoadedEnv;
1006
- /**
1007
- * The contents of the datasource url saved in a string.
1008
- * This can either be an env var name or connection string.
1009
- * It is needed by the client to connect to the Data Proxy.
1010
- * @remarks only used for the purpose of data proxy
1011
- */
1012
- inlineDatasources?: InlineDatasources;
1013
- /**
1014
- * The string hash that was produced for a given schema
1015
- * @remarks only used for the purpose of data proxy
1016
- */
1017
- inlineSchemaHash?: string;
1018
- }
1019
-
1020
- declare type HandleErrorParams = {
1021
- error: any;
1022
- clientMethod: string;
1023
- callsite?: CallSite;
1024
- };
1025
-
1026
- declare type Handler = (base: string, item: string, type: ItemType) => boolean | string;
1027
-
1028
- declare type HookParams = {
1029
- query: string;
1030
- path: string[];
1031
- rootField?: string;
1032
- typeName?: string;
1033
- document: any;
1034
- clientMethod: string;
1035
- args: any;
1036
- };
1037
-
1038
- declare type Hooks = {
1039
- beforeRequest?: (options: HookParams) => any;
1040
- };
1041
-
1042
- declare interface IncludeAndSelectError {
1043
- type: 'includeAndSelect';
1044
- field: DMMF.SchemaField;
1045
- }
1046
-
1047
- declare type Info = {
1048
- id: string;
1049
- };
1050
-
1051
- declare type InlineDatasource = {
1052
- url: NullableEnvValue;
1053
- };
1054
-
1055
- declare type InlineDatasources = {
1056
- [name in InternalDatasource['name']]: {
1057
- url: InternalDatasource['url'];
1058
- };
1059
- };
1060
-
1061
- declare type InstanceRejectOnNotFound = RejectOnNotFound | Record<string, RejectOnNotFound> | Record<string, Record<string, RejectOnNotFound>>;
1062
-
1063
- declare interface InternalDatasource {
1064
- name: string;
1065
- activeProvider: ConnectorType_2;
1066
- provider: ConnectorType_2;
1067
- url: EnvValue_2;
1068
- config: any;
1069
- }
1070
-
1071
- declare type InternalRequestParams = {
1072
- /**
1073
- * The original client method being called.
1074
- * Even though the rootField / operation can be changed,
1075
- * this method stays as it is, as it's what the user's
1076
- * code looks like
1077
- */
1078
- clientMethod: string;
1079
- /**
1080
- * Name of js model that triggered the request. Might be used
1081
- * for warnings or error messages
1082
- */
1083
- jsModelName?: string;
1084
- callsite?: CallSite;
1085
- /** Headers metadata that will be passed to the Engine */
1086
- headers?: Record<string, string>;
1087
- transactionId?: string | number;
1088
- unpacker?: Unpacker;
1089
- lock?: PromiseLike<void>;
1090
- otelParentCtx?: Context;
1091
- } & QueryMiddlewareParams;
1092
-
1093
- declare type InvalidArgError = InvalidArgNameError | MissingArgError | InvalidArgTypeError | AtLeastOneError | AtMostOneError | InvalidNullArgError;
1094
-
1095
- /**
1096
- * This error occurs if the user provides an arg name that doens't exist
1097
- */
1098
- declare interface InvalidArgNameError {
1099
- type: 'invalidName';
1100
- providedName: string;
1101
- providedValue: any;
1102
- didYouMeanArg?: string;
1103
- didYouMeanField?: string;
1104
- originalType: DMMF.ArgType;
1105
- possibilities?: DMMF.SchemaArgInputType[];
1106
- outputType?: DMMF.OutputType;
1107
- }
1108
-
1109
- /**
1110
- * If the scalar type of an arg is not matching what is required
1111
- */
1112
- declare interface InvalidArgTypeError {
1113
- type: 'invalidType';
1114
- argName: string;
1115
- requiredType: {
1116
- bestFittingType: DMMF.SchemaArgInputType;
1117
- inputType: DMMF.SchemaArgInputType[];
1118
- };
1119
- providedValue: any;
1120
- }
1121
-
1122
- declare type InvalidFieldError = InvalidFieldNameError | InvalidFieldTypeError | EmptySelectError | NoTrueSelectError | IncludeAndSelectError | EmptyIncludeError;
1123
-
1124
- declare interface InvalidFieldNameError {
1125
- type: 'invalidFieldName';
1126
- modelName: string;
1127
- didYouMean?: string | null;
1128
- providedName: string;
1129
- isInclude?: boolean;
1130
- isIncludeScalar?: boolean;
1131
- outputType: DMMF.OutputType;
1132
- }
1133
-
1134
- declare interface InvalidFieldTypeError {
1135
- type: 'invalidFieldType';
1136
- modelName: string;
1137
- fieldName: string;
1138
- providedValue: any;
1139
- }
1140
-
1141
- /**
1142
- * If a user incorrectly provided null where she shouldn't have
1143
- */
1144
- declare interface InvalidNullArgError {
1145
- type: 'invalidNullArg';
1146
- name: string;
1147
- invalidType: DMMF.SchemaArgInputType[];
1148
- atLeastOne: boolean;
1149
- atMostOne: boolean;
1150
- }
1151
-
1152
- declare enum IsolationLevel {
1153
- ReadUncommitted = "ReadUncommitted",
1154
- ReadCommitted = "ReadCommitted",
1155
- RepeatableRead = "RepeatableRead",
1156
- Snapshot = "Snapshot",
1157
- Serializable = "Serializable"
1158
- }
1159
-
1160
- declare type ItemType = 'd' | 'f' | 'l';
1161
-
1162
- declare interface Job {
1163
- resolve: (data: any) => void;
1164
- reject: (data: any) => void;
1165
- request: any;
1166
- }
1167
-
1168
- /**
1169
- * Create a SQL query for a list of values.
1170
- */
1171
- export declare function join(values: RawValue[], separator?: string, prefix?: string, suffix?: string): Sql;
1172
-
1173
- declare class JsonNull extends NullTypesEnumValue {
1174
- }
1175
-
1176
- declare type LoadedEnv = {
1177
- message?: string;
1178
- parsed: {
1179
- [x: string]: string;
1180
- };
1181
- } | undefined;
1182
-
1183
- declare type LocationInFile = {
1184
- fileName: string;
1185
- lineNumber: number | null;
1186
- columnNumber: number | null;
1187
- };
1188
-
1189
- declare type LogDefinition = {
1190
- level: LogLevel;
1191
- emit: 'stdout' | 'event';
1192
- };
1193
-
1194
- declare type LogLevel = 'info' | 'query' | 'warn' | 'error';
1195
-
1196
- export declare function makeDocument({ dmmf, rootTypeName, rootField, select, modelName }: DocumentInput): Document_2;
1197
-
1198
- /**
1199
- * Generates more strict variant of an enum which, unlike regular enum,
1200
- * throws on non-existing property access. This can be useful in following situations:
1201
- * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input
1202
- * - enum values are generated dynamically from DMMF.
1203
- *
1204
- * In that case, if using normal enums and no compile-time typechecking, using non-existing property
1205
- * will result in `undefined` value being used, which will be accepted. Using strict enum
1206
- * in this case will help to have a runtime exception, telling you that you are probably doing something wrong.
1207
- *
1208
- * Note: if you need to check for existence of a value in the enum you can still use either
1209
- * `in` operator or `hasOwnProperty` function.
1210
- *
1211
- * @param definition
1212
- * @returns
1213
- */
1214
- export declare function makeStrictEnum<T extends Record<PropertyKey, string | number>>(definition: T): T;
1215
-
1216
- export declare type Metric<T> = {
1217
- key: string;
1218
- value: T;
1219
- labels: Record<string, string>;
1220
- description: string;
1221
- };
1222
-
1223
- export declare type MetricHistogram = {
1224
- buckets: MetricHistogramBucket[];
1225
- sum: number;
1226
- count: number;
1227
- };
1228
-
1229
- export declare type MetricHistogramBucket = [maxValue: number, count: number];
1230
-
1231
- export declare type Metrics = {
1232
- counters: Metric<number>[];
1233
- gauges: Metric<number>[];
1234
- histograms: Metric<MetricHistogram>[];
1235
- };
1236
-
1237
- export declare class MetricsClient {
1238
- private _engine;
1239
- constructor(engine: Engine);
1240
- /**
1241
- * Returns all metrics gathered up to this point in prometheus format.
1242
- * Result of this call can be exposed directly to prometheus scraping endpoint
1243
- *
1244
- * @param options
1245
- * @returns
1246
- */
1247
- prometheus(options?: MetricsOptions): Promise<string>;
1248
- /**
1249
- * Returns all metrics gathered up to this point in prometheus format.
1250
- *
1251
- * @param options
1252
- * @returns
1253
- */
1254
- json(options?: MetricsOptions): Promise<Metrics>;
1255
- }
1256
-
1257
- declare type MetricsOptions = {
1258
- /**
1259
- * Labels to add to every metrics in key-value format
1260
- */
1261
- globalLabels?: Record<string, string>;
1262
- };
1263
-
1264
- declare type MetricsOptionsCommon = {
1265
- globalLabels?: Record<string, string>;
1266
- };
1267
-
1268
- declare type MetricsOptionsJson = {
1269
- format: 'json';
1270
- } & MetricsOptionsCommon;
1271
-
1272
- declare type MetricsOptionsPrometheus = {
1273
- format: 'prometheus';
1274
- } & MetricsOptionsCommon;
1275
-
1276
- /**
1277
- * Opposite of InvalidArgNameError - if the user *doesn't* provide an arg that should be provided
1278
- * This error both happens with an implicit and explicit `undefined`
1279
- */
1280
- declare interface MissingArgError {
1281
- type: 'missingArg';
1282
- missingName: string;
1283
- missingArg: DMMF.SchemaArg;
1284
- atLeastOne: boolean;
1285
- atMostOne: boolean;
1286
- }
1287
-
1288
- declare interface MissingItem {
1289
- path: string;
1290
- isRequired: boolean;
1291
- type: string | object;
1292
- }
1293
-
1294
- declare type Namespace = 'all' | 'engine';
1295
-
1296
- export declare class NotFoundError extends Error {
1297
- constructor(message: string);
1298
- }
1299
-
1300
- declare interface NoTrueSelectError {
1301
- type: 'noTrueSelect';
1302
- field: DMMF.SchemaField;
1303
- }
1304
-
1305
- declare type NullableEnvValue = {
1306
- fromEnvVar: string | null;
1307
- value?: string | null;
1308
- };
1309
-
1310
- declare class NullTypesEnumValue extends ObjectEnumValue {
1311
- _getNamespace(): string;
1312
- }
1313
-
1314
- /**
1315
- * Base class for unique values of object-valued enums.
1316
- */
1317
- declare abstract class ObjectEnumValue {
1318
- constructor(arg?: symbol);
1319
- abstract _getNamespace(): string;
1320
- _getName(): string;
1321
- toString(): string;
1322
- }
1323
-
1324
- export declare const objectEnumValues: {
1325
- classes: {
1326
- DbNull: typeof DbNull;
1327
- JsonNull: typeof JsonNull;
1328
- AnyNull: typeof AnyNull;
1329
- };
1330
- instances: {
1331
- DbNull: DbNull;
1332
- JsonNull: JsonNull;
1333
- AnyNull: AnyNull;
1334
- };
1335
- };
1336
-
1337
- /**
1338
- * maxWait ?= 2000
1339
- * timeout ?= 5000
1340
- */
1341
- declare type Options = {
1342
- maxWait?: number;
1343
- timeout?: number;
1344
- isolationLevel?: IsolationLevel;
1345
- };
1346
-
1347
- export declare class PrismaClientInitializationError extends Error {
1348
- clientVersion: string;
1349
- errorCode?: string;
1350
- constructor(message: string, clientVersion: string, errorCode?: string);
1351
- get [Symbol.toStringTag](): string;
1352
- }
1353
-
1354
- export declare class PrismaClientKnownRequestError extends Error {
1355
- code: string;
1356
- meta?: Record<string, unknown>;
1357
- clientVersion: string;
1358
- constructor(message: string, code: string, clientVersion: string, meta?: any);
1359
- get [Symbol.toStringTag](): string;
1360
- }
1361
-
1362
- export declare interface PrismaClientOptions {
1363
- /**
1364
- * Will throw an Error if findUnique returns null
1365
- */
1366
- rejectOnNotFound?: InstanceRejectOnNotFound;
1367
- /**
1368
- * Overwrites the datasource url from your schema.prisma file
1369
- */
1370
- datasources?: Datasources;
1371
- /**
1372
- * @default "colorless"
1373
- */
1374
- errorFormat?: ErrorFormat;
1375
- /**
1376
- * @example
1377
- * \`\`\`
1378
- * // Defaults to stdout
1379
- * log: ['query', 'info', 'warn']
1380
- *
1381
- * // Emit as events
1382
- * log: [
1383
- * { emit: 'stdout', level: 'query' },
1384
- * { emit: 'stdout', level: 'info' },
1385
- * { emit: 'stdout', level: 'warn' }
1386
- * ]
1387
- * \`\`\`
1388
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option).
1389
- */
1390
- log?: Array<LogLevel | LogDefinition>;
1391
- /**
1392
- * @internal
1393
- * You probably don't want to use this. \`__internal\` is used by internal tooling.
1394
- */
1395
- __internal?: {
1396
- debug?: boolean;
1397
- hooks?: Hooks;
1398
- engine?: {
1399
- cwd?: string;
1400
- binaryPath?: string;
1401
- endpoint?: string;
1402
- allowTriggerPanic?: boolean;
1403
- };
1404
- };
1405
- }
1406
-
1407
- export declare class PrismaClientRustPanicError extends Error {
1408
- clientVersion: string;
1409
- constructor(message: string, clientVersion: string);
1410
- get [Symbol.toStringTag](): string;
1411
- }
1412
-
1413
- export declare class PrismaClientUnknownRequestError extends Error {
1414
- clientVersion: string;
1415
- constructor(message: string, clientVersion: string);
1416
- get [Symbol.toStringTag](): string;
1417
- }
1418
-
1419
- export declare class PrismaClientValidationError extends Error {
1420
- get [Symbol.toStringTag](): string;
1421
- }
1422
-
1423
- declare type QueryEngineRequestHeaders = {
1424
- traceparent?: string;
1425
- transactionId?: string;
1426
- fatal?: string;
1427
- };
1428
-
1429
- declare type QueryEngineResult<T> = {
1430
- data: T;
1431
- elapsed: number;
1432
- };
1433
-
1434
- declare type QueryMiddleware<T = unknown> = (params: QueryMiddlewareParams, next: (params: QueryMiddlewareParams) => Promise<T>) => Promise<T>;
1435
-
1436
- declare type QueryMiddlewareParams = {
1437
- /** The model this is executed on */
1438
- model?: string;
1439
- /** The action that is being handled */
1440
- action: Action;
1441
- /** TODO what is this */
1442
- dataPath: string[];
1443
- /** TODO what is this */
1444
- runInTransaction: boolean;
1445
- /** TODO what is this */
1446
- args: any;
1447
- };
1448
-
1449
- /**
1450
- * Create raw SQL statement.
1451
- */
1452
- export declare function raw(value: string): Sql;
1453
-
1454
- /**
1455
- * Supported value or SQL instance.
1456
- */
1457
- export declare type RawValue = Value | Sql;
1458
-
1459
- declare type RejectOnNotFound = boolean | ((error: Error) => Error) | undefined;
1460
-
1461
- declare type Request_2 = {
1462
- document: Document_2;
1463
- runInTransaction?: boolean;
1464
- transactionId?: string | number;
1465
- headers?: Record<string, string>;
1466
- otelParentCtx?: Context;
1467
- otelChildCtx?: Context;
1468
- tracingConfig?: TracingConfig;
1469
- };
1470
-
1471
- declare class RequestHandler {
1472
- client: Client;
1473
- hooks: any;
1474
- dataloader: DataLoader<Request_2>;
1475
- constructor(client: Client, hooks?: any);
1476
- request({ document, dataPath, rootField, typeName, isList, callsite, rejectOnNotFound, clientMethod, runInTransaction, engineHook, args, headers, transactionId, unpacker, otelParentCtx, otelChildCtx, }: RequestParams): Promise<any>;
1477
- handleRequestError({ error, clientMethod, callsite }: HandleErrorParams): never;
1478
- sanitizeMessage(message: any): any;
1479
- unpack(document: any, data: any, path: any, rootField: any, unpacker?: Unpacker): any;
1480
- get [Symbol.toStringTag](): string;
1481
- }
1482
-
1483
- declare type RequestParams = {
1484
- document: Document_2;
1485
- dataPath: string[];
1486
- rootField: string;
1487
- typeName: string;
1488
- isList: boolean;
1489
- clientMethod: string;
1490
- callsite?: CallSite;
1491
- rejectOnNotFound?: RejectOnNotFound;
1492
- runInTransaction?: boolean;
1493
- engineHook?: EngineMiddleware;
1494
- args: any;
1495
- headers?: Record<string, string>;
1496
- transactionId?: string | number;
1497
- unpacker?: Unpacker;
1498
- otelParentCtx?: Context;
1499
- otelChildCtx?: Context;
1500
- };
1501
-
1502
- /**
1503
- * A SQL instance can be nested within each other to build SQL strings.
1504
- */
1505
- export declare class Sql {
1506
- values: Value[];
1507
- strings: string[];
1508
- constructor(rawStrings: ReadonlyArray<string>, rawValues: ReadonlyArray<RawValue>);
1509
- get text(): string;
1510
- get sql(): string;
1511
- inspect(): {
1512
- text: string;
1513
- sql: string;
1514
- values: unknown[];
1515
- };
1516
- }
1517
-
1518
- /**
1519
- * Create a SQL object from a template string.
1520
- */
1521
- export declare function sqltag(strings: ReadonlyArray<string>, ...values: RawValue[]): Sql;
1522
-
1523
- declare type TracingConfig = {
1524
- enabled: boolean;
1525
- middleware: boolean;
1526
- };
1527
-
1528
- declare namespace Transaction {
1529
- export {
1530
- IsolationLevel,
1531
- Options,
1532
- Info,
1533
- TransactionHeaders
1534
- }
1535
- }
1536
-
1537
- declare type TransactionHeaders = {
1538
- traceparent?: string;
1539
- };
1540
-
1541
- export declare function transformDocument(document: Document_2): Document_2;
1542
-
1543
- declare const TX_ID: unique symbol;
1544
-
1545
- /**
1546
- * Unpacks the result of a data object and maps DateTime fields to instances of `Date` inplace
1547
- * @param options: UnpackOptions
1548
- */
1549
- export declare function unpack({ document, path, data }: UnpackOptions): any;
1550
-
1551
- declare type Unpacker = (data: any) => any;
1552
-
1553
- declare interface UnpackOptions {
1554
- document: Document_2;
1555
- path: string[];
1556
- data: any;
1557
- }
1558
-
1559
- /**
1560
- * Values supported by SQL engine.
1561
- */
1562
- export declare type Value = unknown;
1563
-
1564
- export declare function warnEnvConflicts(envPaths: any): void;
1565
-
1566
- export { }