prisma 6.3.0-dev.17 → 6.3.0-dev.18

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.
@@ -266,6 +266,8 @@ export declare type Count<O> = {
266
266
  [K in keyof O]: Count<number>;
267
267
  } & {};
268
268
 
269
+ export declare function createParam(name: string): Param<unknown, string>;
270
+
269
271
  /**
270
272
  * Custom fetch function for `DataProxyEngine`.
271
273
  *
@@ -1529,7 +1531,7 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1529
1531
  * @param values
1530
1532
  * @returns
1531
1533
  */
1532
- $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown>;
1534
+ $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown, any>;
1533
1535
  /**
1534
1536
  * Unsafe counterpart of `$executeRaw` that is susceptible to SQL injections
1535
1537
  * @see https://github.com/prisma/prisma/issues/7142
@@ -1538,14 +1540,14 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1538
1540
  * @param values
1539
1541
  * @returns
1540
1542
  */
1541
- $executeRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown>;
1543
+ $executeRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown, any>;
1542
1544
  /**
1543
1545
  * Executes a raw command only for MongoDB
1544
1546
  *
1545
1547
  * @param command
1546
1548
  * @returns
1547
1549
  */
1548
- $runCommandRaw(command: Record<string, JsInputValue>): PrismaPromise_2<unknown>;
1550
+ $runCommandRaw(command: Record<string, JsInputValue>): PrismaPromise_2<unknown, any>;
1549
1551
  /**
1550
1552
  * Executes a raw query and returns selected data
1551
1553
  */
@@ -1558,12 +1560,12 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1558
1560
  * @param values
1559
1561
  * @returns
1560
1562
  */
1561
- $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown>;
1563
+ $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown, any>;
1562
1564
  /**
1563
1565
  * Counterpart to $queryRaw, that returns strongly typed results
1564
1566
  * @param typedSql
1565
1567
  */
1566
- $queryRawTyped(typedSql: UnknownTypedSql): PrismaPromise_2<unknown>;
1568
+ $queryRawTyped(typedSql: UnknownTypedSql): PrismaPromise_2<unknown, any>;
1567
1569
  /**
1568
1570
  * Unsafe counterpart of `$queryRaw` that is susceptible to SQL injections
1569
1571
  * @see https://github.com/prisma/prisma/issues/7142
@@ -1572,7 +1574,7 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1572
1574
  * @param values
1573
1575
  * @returns
1574
1576
  */
1575
- $queryRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown>;
1577
+ $queryRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown, any>;
1576
1578
  /**
1577
1579
  * Execute a batch of requests in a transaction
1578
1580
  * @param requests
@@ -2297,6 +2299,12 @@ export declare type Or<A extends 1 | 0, B extends 1 | 0> = {
2297
2299
  };
2298
2300
  }[A][B];
2299
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
+
2300
2308
  export declare type PatchFlat<O1, O2> = O1 & Omit_2<O2, keyof O1>;
2301
2309
 
2302
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;
@@ -2414,6 +2422,12 @@ export declare class PrismaClientValidationError extends Error {
2414
2422
 
2415
2423
  declare function prismaGraphQLToJSError({ error, user_facing_error }: RequestError, clientVersion: string, activeProvider: string): PrismaClientKnownRequestError | PrismaClientUnknownRequestError;
2416
2424
 
2425
+ declare type PrismaOperationSpec<TArgs, TAction = string> = {
2426
+ args: TArgs;
2427
+ action: TAction;
2428
+ model: string;
2429
+ };
2430
+
2417
2431
  export declare interface PrismaPromise<T> extends Promise<T> {
2418
2432
  [Symbol.toStringTag]: 'PrismaPromise';
2419
2433
  }
@@ -2423,26 +2437,27 @@ export declare interface PrismaPromise<T> extends Promise<T> {
2423
2437
  * original `Promise` are optional so that it can be backwards-compatible.
2424
2438
  * @see [[createPrismaPromise]]
2425
2439
  */
2426
- 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;
2427
2442
  /**
2428
2443
  * Extension of the original `.then` function
2429
2444
  * @param onfulfilled same as regular promises
2430
2445
  * @param onrejected same as regular promises
2431
2446
  * @param transaction transaction options
2432
2447
  */
2433
- 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>;
2434
2449
  /**
2435
2450
  * Extension of the original `.catch` function
2436
2451
  * @param onrejected same as regular promises
2437
2452
  * @param transaction transaction options
2438
2453
  */
2439
- 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>;
2440
2455
  /**
2441
2456
  * Extension of the original `.finally` function
2442
2457
  * @param onfinally same as regular promises
2443
2458
  * @param transaction transaction options
2444
2459
  */
2445
- finally(onfinally?: (() => void) | undefined | null, transaction?: PrismaPromiseTransaction): Promise<A>;
2460
+ finally(onfinally?: (() => void) | undefined | null, transaction?: PrismaPromiseTransaction): Promise<TResult>;
2446
2461
  /**
2447
2462
  * Called when executing a batch of regular tx
2448
2463
  * @param transaction transaction options for batch tx
@@ -2458,7 +2473,7 @@ declare type PrismaPromiseBatchTransaction = {
2458
2473
  lock: PromiseLike<void>;
2459
2474
  };
2460
2475
 
2461
- declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => PrismaPromise_2<unknown>;
2476
+ declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => Promise<unknown>;
2462
2477
 
2463
2478
  /**
2464
2479
  * Creates a [[PrismaPromise]]. It is Prisma's implementation of `Promise` which
@@ -2469,7 +2484,7 @@ declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) =>
2469
2484
  * @see [[PrismaPromise]]
2470
2485
  * @returns
2471
2486
  */
2472
- declare type PrismaPromiseFactory = (callback: PrismaPromiseCallback) => PrismaPromise_2<unknown>;
2487
+ declare type PrismaPromiseFactory = <T extends PrismaOperationSpec<unknown>>(callback: PrismaPromiseCallback, op?: T) => PrismaPromise_2<unknown>;
2473
2488
 
2474
2489
  declare type PrismaPromiseInteractiveTransaction<PayloadType = unknown> = {
2475
2490
  kind: 'itx';
@@ -2552,6 +2567,7 @@ declare interface QueryEngineConstructor {
2552
2567
  declare type QueryEngineInstance = {
2553
2568
  connect(headers: string, requestId: string): Promise<void>;
2554
2569
  disconnect(headers: string, requestId: string): Promise<void>;
2570
+ compile(request: string, humanReadable: boolean): Promise<string>;
2555
2571
  /**
2556
2572
  * @param requestStr JSON.stringified `QueryEngineRequest | QueryEngineBatchRequest`
2557
2573
  * @param headersStr JSON.stringified `QueryEngineRequestHeaders`