@prisma/client 6.3.0-integration-simpler-typeinfo-query.1 → 6.3.0-integration-fix-subcommands-esm-projects.1

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.
@@ -23,7 +23,7 @@ declare type AccelerateEngineConfig = {
23
23
 
24
24
  export declare type Action = keyof typeof DMMF.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw';
25
25
 
26
- declare type ActiveConnectorType = Exclude<ConnectorType, 'postgres'>;
26
+ declare type ActiveConnectorType = Exclude<ConnectorType, 'postgres' | 'prisma+postgres'>;
27
27
 
28
28
  export declare type Aggregate = '_count' | '_max' | '_min' | '_avg' | '_sum';
29
29
 
@@ -101,7 +101,7 @@ declare type BatchQuery = {
101
101
  args: JsArgs | RawQueryArgs;
102
102
  };
103
103
 
104
- declare type BatchQueryEngineResult<T> = QueryEngineResult<T> | Error;
104
+ declare type BatchQueryEngineResult<T> = QueryEngineResultData<T> | Error;
105
105
 
106
106
  declare type BatchQueryOptionsCb = (args: BatchQueryOptionsCbArgs) => Promise<any>;
107
107
 
@@ -216,7 +216,7 @@ declare type ConnectionInfo = {
216
216
  maxBindValues?: number;
217
217
  };
218
218
 
219
- declare type ConnectorType = 'mysql' | 'mongodb' | 'sqlite' | 'postgresql' | 'postgres' | 'sqlserver' | 'cockroachdb';
219
+ declare type ConnectorType = 'mysql' | 'mongodb' | 'sqlite' | 'postgresql' | 'postgres' | 'prisma+postgres' | 'sqlserver' | 'cockroachdb';
220
220
 
221
221
  declare interface Context {
222
222
  /**
@@ -266,7 +266,38 @@ export declare type Count<O> = {
266
266
  [K in keyof O]: Count<number>;
267
267
  } & {};
268
268
 
269
- declare type CustomDataProxyFetch = (fetch: Fetch) => Fetch;
269
+ export declare function createParam(name: string): Param<unknown, string>;
270
+
271
+ /**
272
+ * Custom fetch function for `DataProxyEngine`.
273
+ *
274
+ * We can't use the actual type of `globalThis.fetch` because this will result
275
+ * in API Extractor referencing Node.js type definitions in the `.d.ts` bundle
276
+ * for the client runtime. We can only use such types in internal types that
277
+ * don't end up exported anywhere.
278
+
279
+ * It's also not possible to write a definition of `fetch` that would accept the
280
+ * actual `fetch` function from different environments such as Node.js and
281
+ * Cloudflare Workers (with their extensions to `RequestInit` and `Response`).
282
+ * `fetch` is used in both covariant and contravariant positions in
283
+ * `CustomDataProxyFetch`, making it invariant, so we need the exact same type.
284
+ * Even if we removed the argument and left `fetch` in covariant position only,
285
+ * then for an extension-supplied function to be assignable to `customDataProxyFetch`,
286
+ * the platform-specific (or custom) `fetch` function needs to be assignable
287
+ * to our `fetch` definition. This, in turn, requires the third-party `Response`
288
+ * to be a subtype of our `Response` (which is not a problem, we could declare
289
+ * a minimal `Response` type that only includes what we use) *and* requires the
290
+ * third-party `RequestInit` to be a supertype of our `RequestInit` (i.e. we
291
+ * have to declare all properties any `RequestInit` implementation in existence
292
+ * could possibly have), which is not possible.
293
+ *
294
+ * Since `@prisma/extension-accelerate` redefines the type of
295
+ * `__internalParams.customDataProxyFetch` to its own type anyway (probably for
296
+ * exactly this reason), our definition is never actually used and is completely
297
+ * ignored, so it doesn't matter, and we can just use `unknown` as the type of
298
+ * `fetch` here.
299
+ */
300
+ declare type CustomDataProxyFetch = (fetch: unknown) => unknown;
270
301
 
271
302
  declare class DataLoader<T = unknown> {
272
303
  private options;
@@ -619,8 +650,12 @@ declare function defineExtension(ext: ExtensionArgs | ((client: Client) => Clien
619
650
 
620
651
  declare const denylist: readonly ["$connect", "$disconnect", "$on", "$transaction", "$use", "$extends"];
621
652
 
653
+ declare type DeserializedResponse = Array<Record<string, unknown>>;
654
+
622
655
  export declare function deserializeJsonResponse(result: unknown): unknown;
623
656
 
657
+ export declare function deserializeRawResult(response: RawResponse): DeserializedResponse;
658
+
624
659
  export declare type DevTypeMapDef = {
625
660
  meta: {
626
661
  modelProps: string;
@@ -689,6 +724,7 @@ export declare namespace DMMF {
689
724
  export type Model = ReadonlyDeep_2<{
690
725
  name: string;
691
726
  dbName: string | null;
727
+ schema: string | null;
692
728
  fields: Field[];
693
729
  uniqueFields: string[][];
694
730
  uniqueIndexes: uniqueIndex[];
@@ -714,18 +750,25 @@ export declare namespace DMMF {
714
750
  * BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName
715
751
  */
716
752
  type: string;
753
+ /**
754
+ * Native database type, if specified.
755
+ * For example, `@db.VarChar(191)` is encoded as `['VarChar', ['191']]`,
756
+ * `@db.Text` is encoded as `['Text', []]`.
757
+ */
758
+ nativeType?: [string, string[]] | null;
717
759
  dbName?: string | null;
718
760
  hasDefaultValue: boolean;
719
761
  default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[];
720
762
  relationFromFields?: string[];
721
763
  relationToFields?: string[];
722
764
  relationOnDelete?: string;
765
+ relationOnUpdate?: string;
723
766
  relationName?: string;
724
767
  documentation?: string;
725
768
  }>;
726
769
  export type FieldDefault = ReadonlyDeep_2<{
727
770
  name: string;
728
- args: any[];
771
+ args: Array<string | number>;
729
772
  }>;
730
773
  export type FieldDefaultScalar = string | boolean | number;
731
774
  export type Index = ReadonlyDeep_2<{
@@ -839,6 +882,7 @@ export declare namespace DMMF {
839
882
  createManyAndReturn?: string | null;
840
883
  update?: string | null;
841
884
  updateMany?: string | null;
885
+ updateManyAndReturn?: string | null;
842
886
  upsert?: string | null;
843
887
  delete?: string | null;
844
888
  deleteMany?: string | null;
@@ -859,6 +903,7 @@ export declare namespace DMMF {
859
903
  createManyAndReturn = "createManyAndReturn",
860
904
  update = "update",
861
905
  updateMany = "updateMany",
906
+ updateManyAndReturn = "updateManyAndReturn",
862
907
  upsert = "upsert",
863
908
  delete = "delete",
864
909
  deleteMany = "deleteMany",
@@ -1037,7 +1082,7 @@ declare interface Engine<InteractiveTransactionPayload = unknown> {
1037
1082
  start(): Promise<void>;
1038
1083
  stop(): Promise<void>;
1039
1084
  version(forceRun?: boolean): Promise<string> | string;
1040
- request<T>(query: JsonQuery, options: RequestOptions_2<InteractiveTransactionPayload>): Promise<QueryEngineResult<T>>;
1085
+ request<T>(query: JsonQuery, options: RequestOptions<InteractiveTransactionPayload>): Promise<QueryEngineResultData<T>>;
1041
1086
  requestBatch<T>(queries: JsonQuery[], options: RequestBatchOptions<InteractiveTransactionPayload>): Promise<BatchQueryEngineResult<T>[]>;
1042
1087
  transaction(action: 'start', headers: Transaction_2.TransactionHeaders, options: Transaction_2.Options): Promise<Transaction_2.InteractiveTransactionInfo<unknown>>;
1043
1088
  transaction(action: 'commit', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo<unknown>): Promise<void>;
@@ -1129,25 +1174,17 @@ declare type EngineEventType = QueryEventType | LogEventType;
1129
1174
  declare type EngineProtocol = 'graphql' | 'json';
1130
1175
 
1131
1176
  declare type EngineSpan = {
1132
- span: boolean;
1177
+ id: EngineSpanId;
1178
+ parentId: string | null;
1133
1179
  name: string;
1134
- trace_id: string;
1135
- span_id: string;
1136
- parent_span_id: string;
1137
- start_time: [number, number];
1138
- end_time: [number, number];
1139
- attributes?: Record<string, string>;
1140
- links?: {
1141
- trace_id: string;
1142
- span_id: string;
1143
- }[];
1180
+ startTime: HrTime;
1181
+ endTime: HrTime;
1144
1182
  kind: EngineSpanKind;
1183
+ attributes?: Record<string, unknown>;
1184
+ links?: EngineSpanId[];
1145
1185
  };
1146
1186
 
1147
- declare type EngineSpanEvent = {
1148
- span: boolean;
1149
- spans: EngineSpan[];
1150
- };
1187
+ declare type EngineSpanId = string;
1151
1188
 
1152
1189
  declare type EngineSpanKind = 'client' | 'internal';
1153
1190
 
@@ -1348,8 +1385,6 @@ export declare type ExtractGlobalOmit<Options, ModelName extends string> = Optio
1348
1385
  };
1349
1386
  } ? GlobalOmit : {};
1350
1387
 
1351
- declare type Fetch = typeof nodeFetch;
1352
-
1353
1388
  /**
1354
1389
  * A reference to a specific field of a specific model
1355
1390
  */
@@ -1420,7 +1455,9 @@ export declare type GetFindResult<P extends OperationPayload, A, ClientOptions>
1420
1455
  } ? O : K extends '_count' ? Count<P['objects']> : never;
1421
1456
  } & (A extends {
1422
1457
  include: any;
1423
- } & Record<string, unknown> ? DefaultSelection<P, A, ClientOptions> : unknown) : DefaultSelection<P, A, ClientOptions>;
1458
+ } & Record<string, unknown> ? DefaultSelection<P, A & {
1459
+ omit: A['omit'];
1460
+ }, ClientOptions> : unknown) : DefaultSelection<P, A, ClientOptions>;
1424
1461
 
1425
1462
  export declare type GetGroupByResult<P extends OperationPayload, A> = A extends {
1426
1463
  by: string[];
@@ -1494,7 +1531,7 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1494
1531
  * @param values
1495
1532
  * @returns
1496
1533
  */
1497
- $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown>;
1534
+ $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown, any>;
1498
1535
  /**
1499
1536
  * Unsafe counterpart of `$executeRaw` that is susceptible to SQL injections
1500
1537
  * @see https://github.com/prisma/prisma/issues/7142
@@ -1503,14 +1540,14 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1503
1540
  * @param values
1504
1541
  * @returns
1505
1542
  */
1506
- $executeRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown>;
1543
+ $executeRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown, any>;
1507
1544
  /**
1508
1545
  * Executes a raw command only for MongoDB
1509
1546
  *
1510
1547
  * @param command
1511
1548
  * @returns
1512
1549
  */
1513
- $runCommandRaw(command: Record<string, JsInputValue>): PrismaPromise_2<unknown>;
1550
+ $runCommandRaw(command: Record<string, JsInputValue>): PrismaPromise_2<unknown, any>;
1514
1551
  /**
1515
1552
  * Executes a raw query and returns selected data
1516
1553
  */
@@ -1523,12 +1560,12 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1523
1560
  * @param values
1524
1561
  * @returns
1525
1562
  */
1526
- $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown>;
1563
+ $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown, any>;
1527
1564
  /**
1528
1565
  * Counterpart to $queryRaw, that returns strongly typed results
1529
1566
  * @param typedSql
1530
1567
  */
1531
- $queryRawTyped(typedSql: UnknownTypedSql): PrismaPromise_2<unknown>;
1568
+ $queryRawTyped(typedSql: UnknownTypedSql): PrismaPromise_2<unknown, any>;
1532
1569
  /**
1533
1570
  * Unsafe counterpart of `$queryRaw` that is susceptible to SQL injections
1534
1571
  * @see https://github.com/prisma/prisma/issues/7142
@@ -1537,7 +1574,7 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1537
1574
  * @param values
1538
1575
  * @returns
1539
1576
  */
1540
- $queryRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown>;
1577
+ $queryRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown, any>;
1541
1578
  /**
1542
1579
  * Execute a batch of requests in a transaction
1543
1580
  * @param requests
@@ -1674,6 +1711,7 @@ export declare type GetResult<Payload extends OperationPayload, Args, OperationN
1674
1711
  createManyAndReturn: GetFindResult<Payload, Args, ClientOptions>[];
1675
1712
  update: GetFindResult<Payload, Args, ClientOptions>;
1676
1713
  updateMany: GetBatchResult;
1714
+ updateManyAndReturn: GetFindResult<Payload, Args, ClientOptions>[];
1677
1715
  upsert: GetFindResult<Payload, Args, ClientOptions>;
1678
1716
  delete: GetFindResult<Payload, Args, ClientOptions>;
1679
1717
  deleteMany: GetBatchResult;
@@ -1718,6 +1756,8 @@ declare type HandleErrorParams = {
1718
1756
  globalOmit?: GlobalOmitOptions;
1719
1757
  };
1720
1758
 
1759
+ declare type HrTime = [number, number];
1760
+
1721
1761
  /**
1722
1762
  * Defines High-Resolution Time.
1723
1763
  *
@@ -1730,7 +1770,7 @@ declare type HandleErrorParams = {
1730
1770
  * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.
1731
1771
  * This is represented in HrTime format as [1609504210, 150000000].
1732
1772
  */
1733
- declare type HrTime = [number, number];
1773
+ declare type HrTime_2 = [number, number];
1734
1774
 
1735
1775
  /**
1736
1776
  * Matches a JSON array.
@@ -1836,7 +1876,7 @@ declare type InternalRequestParams = {
1836
1876
  /** Used to convert args for middleware and back */
1837
1877
  middlewareArgsMapper?: MiddlewareArgsMapper<unknown, unknown>;
1838
1878
  /** Used for Accelerate client extension via Data Proxy */
1839
- customDataProxyFetch?: (fetch: Fetch) => Fetch;
1879
+ customDataProxyFetch?: CustomDataProxyFetch;
1840
1880
  } & Omit<QueryMiddlewareParams, 'runInTransaction'>;
1841
1881
 
1842
1882
  declare enum IsolationLevel {
@@ -1922,7 +1962,7 @@ export declare type JsonQuery = {
1922
1962
  query: JsonFieldSelection;
1923
1963
  };
1924
1964
 
1925
- declare type JsonQueryAction = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'findMany' | 'createOne' | 'createMany' | 'createManyAndReturn' | 'updateOne' | 'updateMany' | 'deleteOne' | 'deleteMany' | 'upsertOne' | 'aggregate' | 'groupBy' | 'executeRaw' | 'queryRaw' | 'runCommandRaw' | 'findRaw' | 'aggregateRaw';
1965
+ declare type JsonQueryAction = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'findMany' | 'createOne' | 'createMany' | 'createManyAndReturn' | 'updateOne' | 'updateMany' | 'updateManyAndReturn' | 'deleteOne' | 'deleteMany' | 'upsertOne' | 'aggregate' | 'groupBy' | 'executeRaw' | 'queryRaw' | 'runCommandRaw' | 'findRaw' | 'aggregateRaw';
1926
1966
 
1927
1967
  declare type JsonSelectionSet = {
1928
1968
  $scalars?: boolean;
@@ -2166,37 +2206,6 @@ export declare type Narrowable = string | number | bigint | boolean | [];
2166
2206
 
2167
2207
  export declare type NeverToUnknown<T> = [T] extends [never] ? unknown : T;
2168
2208
 
2169
- /**
2170
- * Imitates `fetch` via `https` to only suit our needs, it does nothing more.
2171
- * This is because we cannot bundle `node-fetch` as it uses many other Node.js
2172
- * utilities, while also bloating our bundles. This approach is much leaner.
2173
- * @param url
2174
- * @param options
2175
- * @returns
2176
- */
2177
- declare function nodeFetch(url: string, options?: RequestOptions): Promise<RequestResponse>;
2178
-
2179
- declare class NodeHeaders {
2180
- readonly headers: Map<string, string>;
2181
- constructor(init?: Record<any, any>);
2182
- append(name: string, value: string): void;
2183
- delete(name: string): void;
2184
- get(name: string): string | null;
2185
- has(name: string): boolean;
2186
- set(name: string, value: string): void;
2187
- forEach(callbackfn: (value: string, key: string, parent: this) => void, thisArg?: any): void;
2188
- }
2189
-
2190
- /**
2191
- * @deprecated Please don´t rely on type checks to this error anymore.
2192
- * This will become a regular `PrismaClientKnownRequestError` with code `P2025`
2193
- * in the future major version of the client.
2194
- * Instead of `error instanceof Prisma.NotFoundError` use `error.code === "P2025"`.
2195
- */
2196
- export declare class NotFoundError extends PrismaClientKnownRequestError {
2197
- constructor(message: string, clientVersion: string);
2198
- }
2199
-
2200
2209
  declare class NullTypesEnumValue extends ObjectEnumValue {
2201
2210
  _getNamespace(): string;
2202
2211
  }
@@ -2240,7 +2249,7 @@ export { Omit_2 as Omit }
2240
2249
 
2241
2250
  export declare type OmitValue<Omit, Key> = Key extends keyof Omit ? Omit[Key] : false;
2242
2251
 
2243
- export declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw';
2252
+ export declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'updateManyAndReturn' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw';
2244
2253
 
2245
2254
  export declare type OperationPayload = {
2246
2255
  name: string;
@@ -2290,6 +2299,12 @@ export declare type Or<A extends 1 | 0, B extends 1 | 0> = {
2290
2299
  };
2291
2300
  }[A][B];
2292
2301
 
2302
+ export declare function Param<$Type, $Value extends string>(name: $Value): Param<$Type, $Value>;
2303
+
2304
+ export declare type Param<out $Type, $Value extends string> = {
2305
+ readonly name: $Value;
2306
+ };
2307
+
2293
2308
  export declare type PatchFlat<O1, O2> = O1 & Omit_2<O2, keyof O1>;
2294
2309
 
2295
2310
  export declare type Path<O, P, Default = never> = O extends unknown ? P extends [infer K, ...infer R] ? K extends keyof O ? Path<O[K], R> : Default : O : never;
@@ -2407,6 +2422,12 @@ export declare class PrismaClientValidationError extends Error {
2407
2422
 
2408
2423
  declare function prismaGraphQLToJSError({ error, user_facing_error }: RequestError, clientVersion: string, activeProvider: string): PrismaClientKnownRequestError | PrismaClientUnknownRequestError;
2409
2424
 
2425
+ declare type PrismaOperationSpec<TArgs, TAction = string> = {
2426
+ args: TArgs;
2427
+ action: TAction;
2428
+ model: string;
2429
+ };
2430
+
2410
2431
  export declare interface PrismaPromise<T> extends Promise<T> {
2411
2432
  [Symbol.toStringTag]: 'PrismaPromise';
2412
2433
  }
@@ -2416,26 +2437,27 @@ export declare interface PrismaPromise<T> extends Promise<T> {
2416
2437
  * original `Promise` are optional so that it can be backwards-compatible.
2417
2438
  * @see [[createPrismaPromise]]
2418
2439
  */
2419
- declare interface PrismaPromise_2<A> extends Promise<A> {
2440
+ declare interface PrismaPromise_2<TResult, TSpec extends PrismaOperationSpec<unknown> = any> extends Promise<TResult> {
2441
+ get spec(): TSpec;
2420
2442
  /**
2421
2443
  * Extension of the original `.then` function
2422
2444
  * @param onfulfilled same as regular promises
2423
2445
  * @param onrejected same as regular promises
2424
2446
  * @param transaction transaction options
2425
2447
  */
2426
- then<R1 = A, R2 = never>(onfulfilled?: (value: A) => R1 | PromiseLike<R1>, onrejected?: (error: unknown) => R2 | PromiseLike<R2>, transaction?: PrismaPromiseTransaction): Promise<R1 | R2>;
2448
+ then<R1 = TResult, R2 = never>(onfulfilled?: (value: TResult) => R1 | PromiseLike<R1>, onrejected?: (error: unknown) => R2 | PromiseLike<R2>, transaction?: PrismaPromiseTransaction): Promise<R1 | R2>;
2427
2449
  /**
2428
2450
  * Extension of the original `.catch` function
2429
2451
  * @param onrejected same as regular promises
2430
2452
  * @param transaction transaction options
2431
2453
  */
2432
- catch<R = never>(onrejected?: ((reason: any) => R | PromiseLike<R>) | undefined | null, transaction?: PrismaPromiseTransaction): Promise<A | R>;
2454
+ catch<R = never>(onrejected?: ((reason: any) => R | PromiseLike<R>) | undefined | null, transaction?: PrismaPromiseTransaction): Promise<TResult | R>;
2433
2455
  /**
2434
2456
  * Extension of the original `.finally` function
2435
2457
  * @param onfinally same as regular promises
2436
2458
  * @param transaction transaction options
2437
2459
  */
2438
- finally(onfinally?: (() => void) | undefined | null, transaction?: PrismaPromiseTransaction): Promise<A>;
2460
+ finally(onfinally?: (() => void) | undefined | null, transaction?: PrismaPromiseTransaction): Promise<TResult>;
2439
2461
  /**
2440
2462
  * Called when executing a batch of regular tx
2441
2463
  * @param transaction transaction options for batch tx
@@ -2451,7 +2473,7 @@ declare type PrismaPromiseBatchTransaction = {
2451
2473
  lock: PromiseLike<void>;
2452
2474
  };
2453
2475
 
2454
- declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => PrismaPromise_2<unknown>;
2476
+ declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => Promise<unknown>;
2455
2477
 
2456
2478
  /**
2457
2479
  * Creates a [[PrismaPromise]]. It is Prisma's implementation of `Promise` which
@@ -2462,7 +2484,7 @@ declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) =>
2462
2484
  * @see [[PrismaPromise]]
2463
2485
  * @returns
2464
2486
  */
2465
- declare type PrismaPromiseFactory = (callback: PrismaPromiseCallback) => PrismaPromise_2<unknown>;
2487
+ declare type PrismaPromiseFactory = <T extends PrismaOperationSpec<unknown>>(callback: PrismaPromiseCallback, op?: T) => PrismaPromise_2<unknown>;
2466
2488
 
2467
2489
  declare type PrismaPromiseInteractiveTransaction<PayloadType = unknown> = {
2468
2490
  kind: 'itx';
@@ -2534,8 +2556,8 @@ declare type QueryEngineConfig = {
2534
2556
  datasourceOverrides: Record<string, string>;
2535
2557
  env: Record<string, string | undefined>;
2536
2558
  logLevel: QueryEngineLogLevel;
2537
- telemetry?: QueryEngineTelemetry;
2538
2559
  engineProtocol: EngineProtocol;
2560
+ enableTracing: boolean;
2539
2561
  };
2540
2562
 
2541
2563
  declare interface QueryEngineConstructor {
@@ -2543,20 +2565,21 @@ declare interface QueryEngineConstructor {
2543
2565
  }
2544
2566
 
2545
2567
  declare type QueryEngineInstance = {
2546
- connect(headers: string): Promise<void>;
2547
- disconnect(headers: string): Promise<void>;
2568
+ connect(headers: string, requestId: string): Promise<void>;
2569
+ disconnect(headers: string, requestId: string): Promise<void>;
2570
+ compile(request: string, humanReadable: boolean): Promise<string>;
2548
2571
  /**
2549
2572
  * @param requestStr JSON.stringified `QueryEngineRequest | QueryEngineBatchRequest`
2550
2573
  * @param headersStr JSON.stringified `QueryEngineRequestHeaders`
2551
2574
  */
2552
- query(requestStr: string, headersStr: string, transactionId?: string): Promise<string>;
2553
- sdlSchema(): Promise<string>;
2554
- dmmf(traceparent: string): Promise<string>;
2555
- startTransaction(options: string, traceHeaders: string): Promise<string>;
2556
- commitTransaction(id: string, traceHeaders: string): Promise<string>;
2557
- rollbackTransaction(id: string, traceHeaders: string): Promise<string>;
2558
- metrics(options: string): Promise<string>;
2559
- applyPendingMigrations(): Promise<void>;
2575
+ query(requestStr: string, headersStr: string, transactionId: string | undefined, requestId: string): Promise<string>;
2576
+ sdlSchema?(): Promise<string>;
2577
+ startTransaction(options: string, traceHeaders: string, requestId: string): Promise<string>;
2578
+ commitTransaction(id: string, traceHeaders: string, requestId: string): Promise<string>;
2579
+ rollbackTransaction(id: string, traceHeaders: string, requestId: string): Promise<string>;
2580
+ metrics?(options: string): Promise<string>;
2581
+ applyPendingMigrations?(): Promise<void>;
2582
+ trace(requestId: string): Promise<string | null>;
2560
2583
  };
2561
2584
 
2562
2585
  declare type QueryEngineLogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'off';
@@ -2566,14 +2589,8 @@ declare type QueryEngineRequest = {
2566
2589
  variables: Object;
2567
2590
  };
2568
2591
 
2569
- declare type QueryEngineResult<T> = {
2592
+ declare type QueryEngineResultData<T> = {
2570
2593
  data: T;
2571
- elapsed: number;
2572
- };
2573
-
2574
- declare type QueryEngineTelemetry = {
2575
- enabled: Boolean;
2576
- endpoint: string;
2577
2594
  };
2578
2595
 
2579
2596
  declare type QueryEvent = {
@@ -2586,6 +2603,8 @@ declare type QueryEvent = {
2586
2603
 
2587
2604
  declare type QueryEventType = 'query';
2588
2605
 
2606
+ declare type QueryIntrospectionBuiltinType = 'int' | 'bigint' | 'float' | 'double' | 'string' | 'enum' | 'bytes' | 'bool' | 'char' | 'decimal' | 'json' | 'xml' | 'uuid' | 'datetime' | 'date' | 'time' | 'int-array' | 'bigint-array' | 'float-array' | 'double-array' | 'string-array' | 'char-array' | 'bytes-array' | 'bool-array' | 'decimal-array' | 'json-array' | 'xml-array' | 'uuid-array' | 'datetime-array' | 'date-array' | 'time-array' | 'null' | 'unknown';
2607
+
2589
2608
  declare type QueryMiddleware = (params: QueryMiddlewareParams, next: (params: QueryMiddlewareParams) => Promise<unknown>) => Promise<unknown>;
2590
2609
 
2591
2610
  declare type QueryMiddlewareParams = {
@@ -2629,6 +2648,12 @@ export declare type RawParameters = {
2629
2648
 
2630
2649
  export declare type RawQueryArgs = Sql | UnknownTypedSql | [query: string, ...values: RawValue[]];
2631
2650
 
2651
+ declare type RawResponse = {
2652
+ columns: string[];
2653
+ types: QueryIntrospectionBuiltinType[];
2654
+ rows: unknown[][];
2655
+ };
2656
+
2632
2657
  declare type RawTaggedValue = {
2633
2658
  $type: 'Raw';
2634
2659
  value: unknown;
@@ -2661,7 +2686,7 @@ declare type RequestBatchOptions<InteractiveTransactionPayload> = {
2661
2686
  traceparent?: string;
2662
2687
  numTry?: number;
2663
2688
  containsWrite: boolean;
2664
- customDataProxyFetch?: (fetch: Fetch) => Fetch;
2689
+ customDataProxyFetch?: CustomDataProxyFetch;
2665
2690
  };
2666
2691
 
2667
2692
  declare interface RequestError {
@@ -2681,7 +2706,7 @@ declare class RequestHandler {
2681
2706
  private logEmitter?;
2682
2707
  constructor(client: Client, logEmitter?: LogEmitter);
2683
2708
  request(params: RequestParams): Promise<any>;
2684
- mapQueryEngineResult({ dataPath, unpacker }: RequestParams, response: QueryEngineResult<any>): any;
2709
+ mapQueryEngineResult({ dataPath, unpacker }: RequestParams, response: QueryEngineResultData<any>): any;
2685
2710
  /**
2686
2711
  * Handles the error and logs it, logging the error is done synchronously waiting for the event
2687
2712
  * handlers to finish.
@@ -2693,18 +2718,12 @@ declare class RequestHandler {
2693
2718
  get [Symbol.toStringTag](): string;
2694
2719
  }
2695
2720
 
2696
- declare type RequestOptions = {
2697
- method?: string;
2698
- headers?: Record<string, string>;
2699
- body?: string;
2700
- };
2701
-
2702
- declare type RequestOptions_2<InteractiveTransactionPayload> = {
2721
+ declare type RequestOptions<InteractiveTransactionPayload> = {
2703
2722
  traceparent?: string;
2704
2723
  numTry?: number;
2705
2724
  interactiveTransaction?: InteractiveTransactionOptions<InteractiveTransactionPayload>;
2706
2725
  isWrite: boolean;
2707
- customDataProxyFetch?: (fetch: Fetch) => Fetch;
2726
+ customDataProxyFetch?: CustomDataProxyFetch;
2708
2727
  };
2709
2728
 
2710
2729
  declare type RequestParams = {
@@ -2722,17 +2741,7 @@ declare type RequestParams = {
2722
2741
  otelParentCtx?: Context;
2723
2742
  otelChildCtx?: Context;
2724
2743
  globalOmit?: GlobalOmitOptions;
2725
- customDataProxyFetch?: (fetch: Fetch) => Fetch;
2726
- };
2727
-
2728
- declare type RequestResponse = {
2729
- ok: boolean;
2730
- url: string;
2731
- statusText?: string;
2732
- status: number;
2733
- headers: NodeHeaders;
2734
- text: () => Promise<string>;
2735
- json: () => Promise<any>;
2744
+ customDataProxyFetch?: CustomDataProxyFetch;
2736
2745
  };
2737
2746
 
2738
2747
  declare type RequiredExtensionArgs = NameArgs & ResultArgs & ModelArgs & ClientArgs & QueryOptions;
@@ -3175,7 +3184,7 @@ export declare function sqltag(strings: readonly string[], ...values: readonly R
3175
3184
  *
3176
3185
  * hrtime, epoch milliseconds, performance.now() or Date
3177
3186
  */
3178
- declare type TimeInput = HrTime | number | Date;
3187
+ declare type TimeInput = HrTime_2 | number | Date;
3179
3188
 
3180
3189
  export declare type ToTuple<T> = T extends any[] ? T : [T];
3181
3190
 
@@ -3220,7 +3229,7 @@ declare interface TraceState {
3220
3229
  declare interface TracingHelper {
3221
3230
  isEnabled(): boolean;
3222
3231
  getTraceParent(context?: Context): string;
3223
- createEngineSpan(engineSpanEvent: EngineSpanEvent): void;
3232
+ dispatchEngineSpans(spans: EngineSpan[]): void;
3224
3233
  getActiveContext(): Context | undefined;
3225
3234
  runInChildSpan<R>(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback<R>): R;
3226
3235
  }