@creator.co/creatorco-prisma-client 1.0.22-alpha-c4b16cb → 1.0.22
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/default.js +1 -1
- package/edge.js +15 -57
- package/index-browser.js +39 -73
- package/index.d.ts +416 -5540
- package/index.js +15 -57
- package/libquery_engine-darwin-arm64.dylib.node +0 -0
- package/libquery_engine-darwin.dylib.node +0 -0
- package/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
- package/libquery_engine-linux-arm64-openssl-1.0.x.so.node +0 -0
- package/libquery_engine-linux-arm64-openssl-3.0.x.so.node +0 -0
- package/libquery_engine-linux-musl-arm64-openssl-3.0.x.so.node +0 -0
- package/package.json +18 -13
- package/query_engine-windows.dll.node +0 -0
- package/runtime/edge-esm.js +18 -34
- package/runtime/edge.js +18 -34
- package/runtime/index-browser.d.ts +8 -21
- package/runtime/index-browser.js +1 -1
- package/runtime/library.d.ts +203 -111
- package/runtime/library.js +65 -69
- package/runtime/wasm.js +19 -84
- package/schema.prisma +2 -49
- package/wasm.js +39 -73
package/runtime/library.d.ts
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
*/
|
|
4
4
|
declare function $extends(this: Client, extension: ExtensionArgs | ((client: Client) => Client)): Client;
|
|
5
5
|
|
|
6
|
+
declare type AccelerateEngineConfig = {
|
|
7
|
+
inlineSchema: EngineConfig['inlineSchema'];
|
|
8
|
+
inlineSchemaHash: EngineConfig['inlineSchemaHash'];
|
|
9
|
+
env: EngineConfig['env'];
|
|
10
|
+
generator?: {
|
|
11
|
+
previewFeatures: string[];
|
|
12
|
+
};
|
|
13
|
+
inlineDatasources: EngineConfig['inlineDatasources'];
|
|
14
|
+
overrideDatasources: EngineConfig['overrideDatasources'];
|
|
15
|
+
clientVersion: EngineConfig['clientVersion'];
|
|
16
|
+
engineVersion: EngineConfig['engineVersion'];
|
|
17
|
+
logEmitter: EngineConfig['logEmitter'];
|
|
18
|
+
logQueries?: EngineConfig['logQueries'];
|
|
19
|
+
logLevel?: EngineConfig['logLevel'];
|
|
20
|
+
tracingHelper: EngineConfig['tracingHelper'];
|
|
21
|
+
accelerateUtils?: EngineConfig['accelerateUtils'];
|
|
22
|
+
};
|
|
23
|
+
|
|
6
24
|
export declare type Action = keyof typeof DMMF.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw';
|
|
7
25
|
|
|
8
26
|
export declare type Aggregate = '_count' | '_max' | '_min' | '_avg' | '_sum';
|
|
@@ -249,23 +267,31 @@ declare type Datasources = {
|
|
|
249
267
|
declare class DbNull extends NullTypesEnumValue {
|
|
250
268
|
}
|
|
251
269
|
|
|
252
|
-
export declare
|
|
253
|
-
(namespace:
|
|
254
|
-
disable
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
270
|
+
export declare const Debug: typeof debugCreate & {
|
|
271
|
+
enable(namespace: any): void;
|
|
272
|
+
disable(): any;
|
|
273
|
+
enabled(namespace: string): boolean;
|
|
274
|
+
log: (...args: string[]) => void;
|
|
275
|
+
formatters: {};
|
|
276
|
+
};
|
|
260
277
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
278
|
+
/**
|
|
279
|
+
* Create a new debug instance with the given namespace.
|
|
280
|
+
*
|
|
281
|
+
* @example
|
|
282
|
+
* ```ts
|
|
283
|
+
* import Debug from '@prisma/debug'
|
|
284
|
+
* const debug = Debug('prisma:client')
|
|
285
|
+
* debug('Hello World')
|
|
286
|
+
* ```
|
|
287
|
+
*/
|
|
288
|
+
declare function debugCreate(namespace: string): ((...args: any[]) => void) & {
|
|
289
|
+
color: string;
|
|
266
290
|
enabled: boolean;
|
|
267
291
|
namespace: string;
|
|
268
|
-
|
|
292
|
+
log: (...args: string[]) => void;
|
|
293
|
+
extend: () => void;
|
|
294
|
+
};
|
|
269
295
|
|
|
270
296
|
export declare namespace Decimal {
|
|
271
297
|
export type Constructor = typeof Decimal;
|
|
@@ -558,27 +584,6 @@ declare function defineExtension(ext: ExtensionArgs | ((client: Client) => Clien
|
|
|
558
584
|
|
|
559
585
|
declare const denylist: readonly ["$connect", "$disconnect", "$on", "$transaction", "$use", "$extends"];
|
|
560
586
|
|
|
561
|
-
/**
|
|
562
|
-
* Detect the current JavaScript runtime following
|
|
563
|
-
* the WinterCG Runtime Keys proposal:
|
|
564
|
-
*
|
|
565
|
-
* - `edge-routine` Alibaba Cloud Edge Routine
|
|
566
|
-
* - `workerd` Cloudflare Workers
|
|
567
|
-
* - `deno` Deno and Deno Deploy
|
|
568
|
-
* - `lagon` Lagon
|
|
569
|
-
* - `react-native` React Native
|
|
570
|
-
* - `netlify` Netlify Edge Functions
|
|
571
|
-
* - `electron` Electron
|
|
572
|
-
* - `node` Node.js
|
|
573
|
-
* - `bun` Bun
|
|
574
|
-
* - `edge-light` Vercel Edge Functions
|
|
575
|
-
* - `fastly` Fastly Compute@Edge
|
|
576
|
-
*
|
|
577
|
-
* @see https://runtime-keys.proposal.wintercg.org/
|
|
578
|
-
* @returns {Runtime}
|
|
579
|
-
*/
|
|
580
|
-
export declare function detectRuntime(): Runtime;
|
|
581
|
-
|
|
582
587
|
export declare type DevTypeMapDef = {
|
|
583
588
|
meta: {
|
|
584
589
|
modelProps: string;
|
|
@@ -603,10 +608,6 @@ declare type Dictionary<T> = {
|
|
|
603
608
|
[key: string]: T | undefined;
|
|
604
609
|
};
|
|
605
610
|
|
|
606
|
-
declare interface Dictionary_2<T> {
|
|
607
|
-
[key: string]: T;
|
|
608
|
-
}
|
|
609
|
-
|
|
610
611
|
export declare namespace DMMF {
|
|
611
612
|
export type Document = ReadonlyDeep_2<{
|
|
612
613
|
datamodel: Datamodel;
|
|
@@ -808,47 +809,13 @@ export declare namespace DMMF {
|
|
|
808
809
|
delete = "delete",
|
|
809
810
|
deleteMany = "deleteMany",
|
|
810
811
|
groupBy = "groupBy",
|
|
811
|
-
count = "count",
|
|
812
|
+
count = "count",// TODO: count does not actually exist, why?
|
|
812
813
|
aggregate = "aggregate",
|
|
813
814
|
findRaw = "findRaw",
|
|
814
815
|
aggregateRaw = "aggregateRaw"
|
|
815
816
|
}
|
|
816
817
|
}
|
|
817
818
|
|
|
818
|
-
export declare class DMMFClass implements DMMF.Document {
|
|
819
|
-
document: DMMF.Document;
|
|
820
|
-
private _compositeNames?;
|
|
821
|
-
private _inputTypesByName?;
|
|
822
|
-
private _typeAndModelMap?;
|
|
823
|
-
private _mappingsMap?;
|
|
824
|
-
private _outputTypeMap?;
|
|
825
|
-
private _rootFieldMap?;
|
|
826
|
-
constructor(document: DMMF.Document);
|
|
827
|
-
private get compositeNames();
|
|
828
|
-
private get inputTypesByName();
|
|
829
|
-
get typeAndModelMap(): Dictionary_2<DMMF.Model>;
|
|
830
|
-
get mappingsMap(): Dictionary_2<DMMF.ModelMapping>;
|
|
831
|
-
get outputTypeMap(): NamespacedTypeMap<DMMF.OutputType>;
|
|
832
|
-
get rootFieldMap(): Dictionary_2<DMMF.SchemaField>;
|
|
833
|
-
get datamodel(): DMMF.Datamodel;
|
|
834
|
-
get mappings(): DMMF.Mappings;
|
|
835
|
-
get schema(): DMMF.Schema;
|
|
836
|
-
get inputObjectTypes(): DMMF.Schema['inputObjectTypes'];
|
|
837
|
-
get outputObjectTypes(): DMMF.Schema['outputObjectTypes'];
|
|
838
|
-
isComposite(modelOrTypeName: string): boolean;
|
|
839
|
-
getOtherOperationNames(): string[];
|
|
840
|
-
hasEnumInNamespace(enumName: string, namespace: DMMF.FieldNamespace): boolean;
|
|
841
|
-
resolveInputObjectType(ref: DMMF.InputTypeRef): DMMF.InputType | undefined;
|
|
842
|
-
resolveOutputObjectType(ref: DMMF.OutputTypeRef): DMMF.OutputType | undefined;
|
|
843
|
-
private buildModelMap;
|
|
844
|
-
private buildTypeMap;
|
|
845
|
-
private buildTypeModelMap;
|
|
846
|
-
private buildMappingsMap;
|
|
847
|
-
private buildMergedOutputTypeMap;
|
|
848
|
-
private buildRootFieldMap;
|
|
849
|
-
private buildInputTypesMap;
|
|
850
|
-
}
|
|
851
|
-
|
|
852
819
|
export declare interface DriverAdapter extends Queryable {
|
|
853
820
|
/**
|
|
854
821
|
* Starts new transation.
|
|
@@ -1005,18 +972,20 @@ export declare const empty: Sql;
|
|
|
1005
972
|
|
|
1006
973
|
export declare type EmptyToUnknown<T> = T;
|
|
1007
974
|
|
|
1008
|
-
declare
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
975
|
+
declare interface Engine<InteractiveTransactionPayload = unknown> {
|
|
976
|
+
/** The name of the engine. This is meant to be consumed externally */
|
|
977
|
+
readonly name: string;
|
|
978
|
+
onBeforeExit(callback: () => Promise<void>): void;
|
|
979
|
+
start(): Promise<void>;
|
|
980
|
+
stop(): Promise<void>;
|
|
981
|
+
version(forceRun?: boolean): Promise<string> | string;
|
|
982
|
+
request<T>(query: JsonQuery, options: RequestOptions_2<InteractiveTransactionPayload>): Promise<QueryEngineResult<T>>;
|
|
983
|
+
requestBatch<T>(queries: JsonQuery[], options: RequestBatchOptions<InteractiveTransactionPayload>): Promise<BatchQueryEngineResult<T>[]>;
|
|
984
|
+
transaction(action: 'start', headers: Transaction_2.TransactionHeaders, options: Transaction_2.Options): Promise<Transaction_2.InteractiveTransactionInfo<unknown>>;
|
|
985
|
+
transaction(action: 'commit', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo<unknown>): Promise<void>;
|
|
986
|
+
transaction(action: 'rollback', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo<unknown>): Promise<void>;
|
|
987
|
+
metrics(options: MetricsOptionsJson): Promise<Metrics>;
|
|
988
|
+
metrics(options: MetricsOptionsPrometheus): Promise<string>;
|
|
1020
989
|
}
|
|
1021
990
|
|
|
1022
991
|
declare interface EngineConfig {
|
|
@@ -1039,6 +1008,7 @@ declare interface EngineConfig {
|
|
|
1039
1008
|
engineEndpoint?: string;
|
|
1040
1009
|
activeProvider?: string;
|
|
1041
1010
|
logEmitter: LogEmitter;
|
|
1011
|
+
transactionOptions: Transaction_2.Options;
|
|
1042
1012
|
/**
|
|
1043
1013
|
* Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`.
|
|
1044
1014
|
* If set, this is only used in the library engine, and all queries would be performed through it,
|
|
@@ -1073,19 +1043,32 @@ declare interface EngineConfig {
|
|
|
1073
1043
|
*/
|
|
1074
1044
|
isBundled?: boolean;
|
|
1075
1045
|
/**
|
|
1076
|
-
*
|
|
1077
|
-
* generated specifically for each type of client, eg. Node.js client and Edge
|
|
1078
|
-
* clients will have different implementations.
|
|
1079
|
-
* @remarks this is a callback on purpose, we only load the wasm if needed.
|
|
1080
|
-
* @remarks only used by LibraryEngine.ts
|
|
1046
|
+
* Web Assembly module loading configuration
|
|
1081
1047
|
*/
|
|
1082
|
-
|
|
1048
|
+
engineWasm?: WasmLoadingConfig;
|
|
1049
|
+
/**
|
|
1050
|
+
* Allows Accelerate to use runtime utilities from the client. These are
|
|
1051
|
+
* necessary for the AccelerateEngine to function correctly.
|
|
1052
|
+
*/
|
|
1053
|
+
accelerateUtils?: {
|
|
1054
|
+
resolveDatasourceUrl: typeof resolveDatasourceUrl;
|
|
1055
|
+
getBatchRequestPayload: typeof getBatchRequestPayload;
|
|
1056
|
+
prismaGraphQLToJSError: typeof prismaGraphQLToJSError;
|
|
1057
|
+
PrismaClientUnknownRequestError: typeof PrismaClientUnknownRequestError;
|
|
1058
|
+
PrismaClientInitializationError: typeof PrismaClientInitializationError;
|
|
1059
|
+
PrismaClientKnownRequestError: typeof PrismaClientKnownRequestError;
|
|
1060
|
+
debug: (...args: any[]) => void;
|
|
1061
|
+
engineVersion: string;
|
|
1062
|
+
clientVersion: string;
|
|
1063
|
+
};
|
|
1083
1064
|
}
|
|
1084
1065
|
|
|
1085
1066
|
declare type EngineEvent<E extends EngineEventType> = E extends QueryEventType ? QueryEvent : LogEvent;
|
|
1086
1067
|
|
|
1087
1068
|
declare type EngineEventType = QueryEventType | LogEventType;
|
|
1088
1069
|
|
|
1070
|
+
declare type EngineProtocol = 'graphql' | 'json';
|
|
1071
|
+
|
|
1089
1072
|
declare type EngineSpan = {
|
|
1090
1073
|
span: boolean;
|
|
1091
1074
|
name: string;
|
|
@@ -1322,6 +1305,8 @@ export declare type GetAggregateResult<P extends OperationPayload, A> = {
|
|
|
1322
1305
|
};
|
|
1323
1306
|
};
|
|
1324
1307
|
|
|
1308
|
+
declare function getBatchRequestPayload(batch: JsonQuery[], transaction?: TransactionOptions_2<unknown>): QueryEngineBatchRequest;
|
|
1309
|
+
|
|
1325
1310
|
export declare type GetBatchResult = {
|
|
1326
1311
|
count: number;
|
|
1327
1312
|
};
|
|
@@ -1364,11 +1349,13 @@ export declare type GetPayloadResult<Base extends Record<any, any>, R extends In
|
|
|
1364
1349
|
|
|
1365
1350
|
export declare function getPrismaClient(config: GetPrismaClientConfig): {
|
|
1366
1351
|
new (optionsArg?: PrismaClientOptions): {
|
|
1352
|
+
_originalClient: any;
|
|
1367
1353
|
_runtimeDataModel: RuntimeDataModel;
|
|
1368
1354
|
_requestHandler: RequestHandler;
|
|
1369
1355
|
_connectionPromise?: Promise<any> | undefined;
|
|
1370
1356
|
_disconnectionPromise?: Promise<any> | undefined;
|
|
1371
1357
|
_engineConfig: EngineConfig;
|
|
1358
|
+
_accelerateEngineConfig: AccelerateEngineConfig;
|
|
1372
1359
|
_clientVersion: string;
|
|
1373
1360
|
_errorFormat: ErrorFormat;
|
|
1374
1361
|
_tracingHelper: TracingHelper;
|
|
@@ -1560,17 +1547,14 @@ declare type GetPrismaClientConfig = {
|
|
|
1560
1547
|
*/
|
|
1561
1548
|
isBundled?: boolean;
|
|
1562
1549
|
/**
|
|
1563
|
-
* A boolean that is `
|
|
1550
|
+
* A boolean that is `false` when the client was generated with --no-engine. At
|
|
1564
1551
|
* runtime, this means the client will be bound to be using the Data Proxy.
|
|
1565
1552
|
*/
|
|
1566
|
-
|
|
1553
|
+
copyEngine?: boolean;
|
|
1567
1554
|
/**
|
|
1568
|
-
*
|
|
1569
|
-
* generated specifically for each type of client, eg. Node.js client and Edge
|
|
1570
|
-
* clients will have different implementations.
|
|
1571
|
-
* @remarks this is a callback on purpose, we only load the wasm if needed.
|
|
1555
|
+
* Optional wasm loading configuration
|
|
1572
1556
|
*/
|
|
1573
|
-
|
|
1557
|
+
engineWasm?: WasmLoadingConfig;
|
|
1574
1558
|
};
|
|
1575
1559
|
|
|
1576
1560
|
export declare type GetResult<P extends OperationPayload, A, O extends Operation = 'findUniqueOrThrow'> = {
|
|
@@ -1598,6 +1582,14 @@ export declare type GetResult<P extends OperationPayload, A, O extends Operation
|
|
|
1598
1582
|
aggregateRaw: JsonObject;
|
|
1599
1583
|
}[O];
|
|
1600
1584
|
|
|
1585
|
+
export declare function getRuntime(): GetRuntimeOutput;
|
|
1586
|
+
|
|
1587
|
+
declare type GetRuntimeOutput = {
|
|
1588
|
+
id: Runtime;
|
|
1589
|
+
prettyName: string;
|
|
1590
|
+
isEdge: boolean;
|
|
1591
|
+
};
|
|
1592
|
+
|
|
1601
1593
|
export declare type GetSelect<Base extends Record<any, any>, R extends InternalArgs['result'][string], KR extends keyof R = string extends keyof R ? never : keyof R> = {
|
|
1602
1594
|
[K in KR | keyof Base]?: K extends KR ? boolean : Base[K];
|
|
1603
1595
|
};
|
|
@@ -1740,6 +1732,13 @@ declare type JsonArgumentValue = number | string | boolean | null | RawTaggedVal
|
|
|
1740
1732
|
export declare interface JsonArray extends Array<JsonValue> {
|
|
1741
1733
|
}
|
|
1742
1734
|
|
|
1735
|
+
declare type JsonBatchQuery = {
|
|
1736
|
+
batch: JsonQuery[];
|
|
1737
|
+
transaction?: {
|
|
1738
|
+
isolationLevel?: Transaction_2.IsolationLevel;
|
|
1739
|
+
};
|
|
1740
|
+
};
|
|
1741
|
+
|
|
1743
1742
|
export declare interface JsonConvertible {
|
|
1744
1743
|
toJSON(): unknown;
|
|
1745
1744
|
}
|
|
@@ -1828,10 +1827,16 @@ declare type LogDefinition = {
|
|
|
1828
1827
|
emit: 'stdout' | 'event';
|
|
1829
1828
|
};
|
|
1830
1829
|
|
|
1830
|
+
/**
|
|
1831
|
+
* Typings for the events we emit.
|
|
1832
|
+
*
|
|
1833
|
+
* @remarks
|
|
1834
|
+
* If this is updated, our edge runtime shim needs to be updated as well.
|
|
1835
|
+
*/
|
|
1831
1836
|
declare type LogEmitter = {
|
|
1832
1837
|
on<E extends EngineEventType>(event: E, listener: (event: EngineEvent<E>) => void): LogEmitter;
|
|
1833
|
-
emit(event: QueryEventType, payload: QueryEvent):
|
|
1834
|
-
emit(event: LogEventType, payload: LogEvent):
|
|
1838
|
+
emit(event: QueryEventType, payload: QueryEvent): boolean;
|
|
1839
|
+
emit(event: LogEventType, payload: LogEvent): boolean;
|
|
1835
1840
|
};
|
|
1836
1841
|
|
|
1837
1842
|
declare type LogEvent = {
|
|
@@ -1986,11 +1991,6 @@ export declare type NameArgs = {
|
|
|
1986
1991
|
name?: string;
|
|
1987
1992
|
};
|
|
1988
1993
|
|
|
1989
|
-
declare type NamespacedTypeMap<T> = {
|
|
1990
|
-
prisma: Record<string, T>;
|
|
1991
|
-
model: Record<string, T>;
|
|
1992
|
-
};
|
|
1993
|
-
|
|
1994
1994
|
export declare type Narrow<A> = {
|
|
1995
1995
|
[K in keyof A]: A[K] extends Function ? A[K] : Narrow<A[K]>;
|
|
1996
1996
|
} | (A extends Narrowable ? A : never);
|
|
@@ -2095,10 +2095,6 @@ export declare type OptionalKeys<O> = {
|
|
|
2095
2095
|
[K in keyof O]-?: {} extends Pick_2<O, K> ? K : never;
|
|
2096
2096
|
}[keyof O];
|
|
2097
2097
|
|
|
2098
|
-
/**
|
|
2099
|
-
* maxWait ?= 2000
|
|
2100
|
-
* timeout ?= 5000
|
|
2101
|
-
*/
|
|
2102
2098
|
declare type Options = {
|
|
2103
2099
|
maxWait?: number;
|
|
2104
2100
|
timeout?: number;
|
|
@@ -2175,6 +2171,12 @@ export declare type PrismaClientOptions = {
|
|
|
2175
2171
|
* @default "colorless"
|
|
2176
2172
|
*/
|
|
2177
2173
|
errorFormat?: ErrorFormat;
|
|
2174
|
+
/**
|
|
2175
|
+
* The default values for Transaction options
|
|
2176
|
+
* maxWait ?= 2000
|
|
2177
|
+
* timeout ?= 5000
|
|
2178
|
+
*/
|
|
2179
|
+
transactionOptions?: Transaction_2.Options;
|
|
2178
2180
|
/**
|
|
2179
2181
|
* @example
|
|
2180
2182
|
* \`\`\`
|
|
@@ -2204,7 +2206,7 @@ export declare type PrismaClientOptions = {
|
|
|
2204
2206
|
allowTriggerPanic?: boolean;
|
|
2205
2207
|
};
|
|
2206
2208
|
/** This can be used for testing purposes */
|
|
2207
|
-
configOverride?:
|
|
2209
|
+
configOverride?: (config: GetPrismaClientConfig) => GetPrismaClientConfig;
|
|
2208
2210
|
};
|
|
2209
2211
|
};
|
|
2210
2212
|
|
|
@@ -2228,6 +2230,8 @@ export declare class PrismaClientValidationError extends Error {
|
|
|
2228
2230
|
get [Symbol.toStringTag](): string;
|
|
2229
2231
|
}
|
|
2230
2232
|
|
|
2233
|
+
declare function prismaGraphQLToJSError({ error, user_facing_error }: RequestError, clientVersion: string, activeProvider: string): PrismaClientKnownRequestError | PrismaClientUnknownRequestError;
|
|
2234
|
+
|
|
2231
2235
|
export declare interface PrismaPromise<T> extends Promise<T> {
|
|
2232
2236
|
[Symbol.toStringTag]: 'PrismaPromise';
|
|
2233
2237
|
}
|
|
@@ -2335,11 +2339,63 @@ declare interface Queryable {
|
|
|
2335
2339
|
executeRaw(params: Query): Promise<Result_4<number>>;
|
|
2336
2340
|
}
|
|
2337
2341
|
|
|
2342
|
+
declare type QueryEngineBatchGraphQLRequest = {
|
|
2343
|
+
batch: QueryEngineRequest[];
|
|
2344
|
+
transaction?: boolean;
|
|
2345
|
+
isolationLevel?: Transaction_2.IsolationLevel;
|
|
2346
|
+
};
|
|
2347
|
+
|
|
2348
|
+
declare type QueryEngineBatchRequest = QueryEngineBatchGraphQLRequest | JsonBatchQuery;
|
|
2349
|
+
|
|
2350
|
+
declare type QueryEngineConfig = {
|
|
2351
|
+
datamodel: string;
|
|
2352
|
+
configDir: string;
|
|
2353
|
+
logQueries: boolean;
|
|
2354
|
+
ignoreEnvVarErrors: boolean;
|
|
2355
|
+
datasourceOverrides: Record<string, string>;
|
|
2356
|
+
env: Record<string, string | undefined>;
|
|
2357
|
+
logLevel: QueryEngineLogLevel;
|
|
2358
|
+
telemetry?: QueryEngineTelemetry;
|
|
2359
|
+
engineProtocol: EngineProtocol;
|
|
2360
|
+
};
|
|
2361
|
+
|
|
2362
|
+
declare interface QueryEngineConstructor {
|
|
2363
|
+
new (config: QueryEngineConfig, logger: (log: string) => void, adapter?: ErrorCapturingDriverAdapter): QueryEngineInstance;
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
declare type QueryEngineInstance = {
|
|
2367
|
+
connect(headers: string): Promise<void>;
|
|
2368
|
+
disconnect(headers: string): Promise<void>;
|
|
2369
|
+
/**
|
|
2370
|
+
* @param requestStr JSON.stringified `QueryEngineRequest | QueryEngineBatchRequest`
|
|
2371
|
+
* @param headersStr JSON.stringified `QueryEngineRequestHeaders`
|
|
2372
|
+
*/
|
|
2373
|
+
query(requestStr: string, headersStr: string, transactionId?: string): Promise<string>;
|
|
2374
|
+
sdlSchema(): Promise<string>;
|
|
2375
|
+
dmmf(traceparent: string): Promise<string>;
|
|
2376
|
+
startTransaction(options: string, traceHeaders: string): Promise<string>;
|
|
2377
|
+
commitTransaction(id: string, traceHeaders: string): Promise<string>;
|
|
2378
|
+
rollbackTransaction(id: string, traceHeaders: string): Promise<string>;
|
|
2379
|
+
metrics(options: string): Promise<string>;
|
|
2380
|
+
};
|
|
2381
|
+
|
|
2382
|
+
declare type QueryEngineLogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'off';
|
|
2383
|
+
|
|
2384
|
+
declare type QueryEngineRequest = {
|
|
2385
|
+
query: string;
|
|
2386
|
+
variables: Object;
|
|
2387
|
+
};
|
|
2388
|
+
|
|
2338
2389
|
declare type QueryEngineResult<T> = {
|
|
2339
2390
|
data: T;
|
|
2340
2391
|
elapsed: number;
|
|
2341
2392
|
};
|
|
2342
2393
|
|
|
2394
|
+
declare type QueryEngineTelemetry = {
|
|
2395
|
+
enabled: Boolean;
|
|
2396
|
+
endpoint: string;
|
|
2397
|
+
};
|
|
2398
|
+
|
|
2343
2399
|
declare type QueryEvent = {
|
|
2344
2400
|
timestamp: Date;
|
|
2345
2401
|
query: string;
|
|
@@ -2428,6 +2484,17 @@ declare type RequestBatchOptions<InteractiveTransactionPayload> = {
|
|
|
2428
2484
|
customDataProxyFetch?: (fetch: Fetch) => Fetch;
|
|
2429
2485
|
};
|
|
2430
2486
|
|
|
2487
|
+
declare interface RequestError {
|
|
2488
|
+
error: string;
|
|
2489
|
+
user_facing_error: {
|
|
2490
|
+
is_panic: boolean;
|
|
2491
|
+
message: string;
|
|
2492
|
+
meta?: Record<string, unknown>;
|
|
2493
|
+
error_code?: string;
|
|
2494
|
+
batch_request_idx?: number;
|
|
2495
|
+
};
|
|
2496
|
+
}
|
|
2497
|
+
|
|
2431
2498
|
declare class RequestHandler {
|
|
2432
2499
|
client: Client;
|
|
2433
2500
|
dataloader: DataLoader<RequestParams>;
|
|
@@ -2495,6 +2562,13 @@ export declare type RequiredKeys<O> = {
|
|
|
2495
2562
|
[K in keyof O]-?: {} extends Pick_2<O, K> ? never : K;
|
|
2496
2563
|
}[keyof O];
|
|
2497
2564
|
|
|
2565
|
+
declare function resolveDatasourceUrl({ inlineDatasources, overrideDatasources, env, clientVersion, }: {
|
|
2566
|
+
inlineDatasources: GetPrismaClientConfig['inlineDatasources'];
|
|
2567
|
+
overrideDatasources: Datasources;
|
|
2568
|
+
env: Record<string, string | undefined>;
|
|
2569
|
+
clientVersion: string;
|
|
2570
|
+
}): string;
|
|
2571
|
+
|
|
2498
2572
|
export declare type Result<T, A, F extends Operation> = T extends {
|
|
2499
2573
|
[K: symbol]: {
|
|
2500
2574
|
types: {
|
|
@@ -3063,4 +3137,22 @@ export declare function warnEnvConflicts(envPaths: any): void;
|
|
|
3063
3137
|
|
|
3064
3138
|
export declare const warnOnce: (key: string, message: string, ...args: unknown[]) => void;
|
|
3065
3139
|
|
|
3140
|
+
declare type WasmLoadingConfig = {
|
|
3141
|
+
/**
|
|
3142
|
+
* WASM-bindgen runtime for corresponding module
|
|
3143
|
+
*/
|
|
3144
|
+
getRuntime: () => {
|
|
3145
|
+
__wbg_set_wasm(exports: unknown): any;
|
|
3146
|
+
QueryEngine: QueryEngineConstructor;
|
|
3147
|
+
};
|
|
3148
|
+
/**
|
|
3149
|
+
* Loads the raw wasm module for the wasm query engine. This configuration is
|
|
3150
|
+
* generated specifically for each type of client, eg. Node.js client and Edge
|
|
3151
|
+
* clients will have different implementations.
|
|
3152
|
+
* @remarks this is a callback on purpose, we only load the wasm if needed.
|
|
3153
|
+
* @remarks only used by LibraryEngine.ts
|
|
3154
|
+
*/
|
|
3155
|
+
getQueryEngineWasmModule: () => Promise<unknown>;
|
|
3156
|
+
};
|
|
3157
|
+
|
|
3066
3158
|
export { }
|