@prisma/client 6.3.0-integration-studio-ux-refinements.2 → 6.3.0-integration-studio-ux-refinements.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -193,6 +193,24 @@ declare const ColumnTypeEnum: {
193
193
  readonly UnknownNumber: 128;
194
194
  };
195
195
 
196
+ declare type CompilerWasmLoadingConfig = {
197
+ /**
198
+ * WASM-bindgen runtime for corresponding module
199
+ */
200
+ getRuntime: () => {
201
+ __wbg_set_wasm(exports: unknown): any;
202
+ QueryCompiler: QueryCompilerConstructor;
203
+ };
204
+ /**
205
+ * Loads the raw wasm module for the wasm compiler engine. This configuration is
206
+ * generated specifically for each type of client, eg. Node.js client and Edge
207
+ * clients will have different implementations.
208
+ * @remarks this is a callback on purpose, we only load the wasm if needed.
209
+ * @remarks only used by ClientEngine
210
+ */
211
+ getQueryCompilerWasmModule: () => Promise<unknown>;
212
+ };
213
+
196
214
  export declare type Compute<T> = T extends Function ? T : {
197
215
  [K in keyof T]: T[K];
198
216
  } & unknown;
@@ -266,6 +284,8 @@ export declare type Count<O> = {
266
284
  [K in keyof O]: Count<number>;
267
285
  } & {};
268
286
 
287
+ export declare function createParam(name: string): Param<unknown, string>;
288
+
269
289
  /**
270
290
  * Custom fetch function for `DataProxyEngine`.
271
291
  *
@@ -1147,7 +1167,8 @@ declare interface EngineConfig {
1147
1167
  /**
1148
1168
  * Web Assembly module loading configuration
1149
1169
  */
1150
- engineWasm?: WasmLoadingConfig;
1170
+ engineWasm?: EngineWasmLoadingConfig;
1171
+ compilerWasm?: CompilerWasmLoadingConfig;
1151
1172
  /**
1152
1173
  * Allows Accelerate to use runtime utilities from the client. These are
1153
1174
  * necessary for the AccelerateEngine to function correctly.
@@ -1186,6 +1207,24 @@ declare type EngineSpanId = string;
1186
1207
 
1187
1208
  declare type EngineSpanKind = 'client' | 'internal';
1188
1209
 
1210
+ declare type EngineWasmLoadingConfig = {
1211
+ /**
1212
+ * WASM-bindgen runtime for corresponding module
1213
+ */
1214
+ getRuntime: () => {
1215
+ __wbg_set_wasm(exports: unknown): any;
1216
+ QueryEngine: QueryEngineConstructor;
1217
+ };
1218
+ /**
1219
+ * Loads the raw wasm module for the wasm query engine. This configuration is
1220
+ * generated specifically for each type of client, eg. Node.js client and Edge
1221
+ * clients will have different implementations.
1222
+ * @remarks this is a callback on purpose, we only load the wasm if needed.
1223
+ * @remarks only used by LibraryEngine
1224
+ */
1225
+ getQueryEngineWasmModule: () => Promise<unknown>;
1226
+ };
1227
+
1189
1228
  declare type EnvPaths = {
1190
1229
  rootEnvPath: string | null;
1191
1230
  schemaEnvPath: string | undefined;
@@ -1393,6 +1432,8 @@ export declare interface FieldRef<Model, FieldType> {
1393
1432
  readonly isList: boolean;
1394
1433
  }
1395
1434
 
1435
+ declare type Flavour = 'mysql' | 'postgres' | 'sqlite';
1436
+
1396
1437
  export declare type FluentOperation = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'create' | 'update' | 'upsert' | 'delete';
1397
1438
 
1398
1439
  export declare interface Fn<Params = unknown, Returns = unknown> {
@@ -1529,7 +1570,7 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1529
1570
  * @param values
1530
1571
  * @returns
1531
1572
  */
1532
- $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown>;
1573
+ $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown, any>;
1533
1574
  /**
1534
1575
  * Unsafe counterpart of `$executeRaw` that is susceptible to SQL injections
1535
1576
  * @see https://github.com/prisma/prisma/issues/7142
@@ -1538,14 +1579,14 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1538
1579
  * @param values
1539
1580
  * @returns
1540
1581
  */
1541
- $executeRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown>;
1582
+ $executeRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown, any>;
1542
1583
  /**
1543
1584
  * Executes a raw command only for MongoDB
1544
1585
  *
1545
1586
  * @param command
1546
1587
  * @returns
1547
1588
  */
1548
- $runCommandRaw(command: Record<string, JsInputValue>): PrismaPromise_2<unknown>;
1589
+ $runCommandRaw(command: Record<string, JsInputValue>): PrismaPromise_2<unknown, any>;
1549
1590
  /**
1550
1591
  * Executes a raw query and returns selected data
1551
1592
  */
@@ -1558,12 +1599,12 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1558
1599
  * @param values
1559
1600
  * @returns
1560
1601
  */
1561
- $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown>;
1602
+ $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown, any>;
1562
1603
  /**
1563
1604
  * Counterpart to $queryRaw, that returns strongly typed results
1564
1605
  * @param typedSql
1565
1606
  */
1566
- $queryRawTyped(typedSql: UnknownTypedSql): PrismaPromise_2<unknown>;
1607
+ $queryRawTyped(typedSql: UnknownTypedSql): PrismaPromise_2<unknown, any>;
1567
1608
  /**
1568
1609
  * Unsafe counterpart of `$queryRaw` that is susceptible to SQL injections
1569
1610
  * @see https://github.com/prisma/prisma/issues/7142
@@ -1572,7 +1613,7 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1572
1613
  * @param values
1573
1614
  * @returns
1574
1615
  */
1575
- $queryRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown>;
1616
+ $queryRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown, any>;
1576
1617
  /**
1577
1618
  * Execute a batch of requests in a transaction
1578
1619
  * @param requests
@@ -1695,7 +1736,8 @@ declare type GetPrismaClientConfig = {
1695
1736
  /**
1696
1737
  * Optional wasm loading configuration
1697
1738
  */
1698
- engineWasm?: WasmLoadingConfig;
1739
+ engineWasm?: EngineWasmLoadingConfig;
1740
+ compilerWasm?: CompilerWasmLoadingConfig;
1699
1741
  };
1700
1742
 
1701
1743
  export declare type GetResult<Payload extends OperationPayload, Args, OperationName extends Operation = 'findUniqueOrThrow', ClientOptions = {}> = {
@@ -2297,6 +2339,12 @@ export declare type Or<A extends 1 | 0, B extends 1 | 0> = {
2297
2339
  };
2298
2340
  }[A][B];
2299
2341
 
2342
+ export declare function Param<$Type, $Value extends string>(name: $Value): Param<$Type, $Value>;
2343
+
2344
+ export declare type Param<out $Type, $Value extends string> = {
2345
+ readonly name: $Value;
2346
+ };
2347
+
2300
2348
  export declare type PatchFlat<O1, O2> = O1 & Omit_2<O2, keyof O1>;
2301
2349
 
2302
2350
  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 +2462,12 @@ export declare class PrismaClientValidationError extends Error {
2414
2462
 
2415
2463
  declare function prismaGraphQLToJSError({ error, user_facing_error }: RequestError, clientVersion: string, activeProvider: string): PrismaClientKnownRequestError | PrismaClientUnknownRequestError;
2416
2464
 
2465
+ declare type PrismaOperationSpec<TArgs, TAction = string> = {
2466
+ args: TArgs;
2467
+ action: TAction;
2468
+ model: string;
2469
+ };
2470
+
2417
2471
  export declare interface PrismaPromise<T> extends Promise<T> {
2418
2472
  [Symbol.toStringTag]: 'PrismaPromise';
2419
2473
  }
@@ -2423,26 +2477,27 @@ export declare interface PrismaPromise<T> extends Promise<T> {
2423
2477
  * original `Promise` are optional so that it can be backwards-compatible.
2424
2478
  * @see [[createPrismaPromise]]
2425
2479
  */
2426
- declare interface PrismaPromise_2<A> extends Promise<A> {
2480
+ declare interface PrismaPromise_2<TResult, TSpec extends PrismaOperationSpec<unknown> = any> extends Promise<TResult> {
2481
+ get spec(): TSpec;
2427
2482
  /**
2428
2483
  * Extension of the original `.then` function
2429
2484
  * @param onfulfilled same as regular promises
2430
2485
  * @param onrejected same as regular promises
2431
2486
  * @param transaction transaction options
2432
2487
  */
2433
- then<R1 = A, R2 = never>(onfulfilled?: (value: A) => R1 | PromiseLike<R1>, onrejected?: (error: unknown) => R2 | PromiseLike<R2>, transaction?: PrismaPromiseTransaction): Promise<R1 | R2>;
2488
+ then<R1 = TResult, R2 = never>(onfulfilled?: (value: TResult) => R1 | PromiseLike<R1>, onrejected?: (error: unknown) => R2 | PromiseLike<R2>, transaction?: PrismaPromiseTransaction): Promise<R1 | R2>;
2434
2489
  /**
2435
2490
  * Extension of the original `.catch` function
2436
2491
  * @param onrejected same as regular promises
2437
2492
  * @param transaction transaction options
2438
2493
  */
2439
- catch<R = never>(onrejected?: ((reason: any) => R | PromiseLike<R>) | undefined | null, transaction?: PrismaPromiseTransaction): Promise<A | R>;
2494
+ catch<R = never>(onrejected?: ((reason: any) => R | PromiseLike<R>) | undefined | null, transaction?: PrismaPromiseTransaction): Promise<TResult | R>;
2440
2495
  /**
2441
2496
  * Extension of the original `.finally` function
2442
2497
  * @param onfinally same as regular promises
2443
2498
  * @param transaction transaction options
2444
2499
  */
2445
- finally(onfinally?: (() => void) | undefined | null, transaction?: PrismaPromiseTransaction): Promise<A>;
2500
+ finally(onfinally?: (() => void) | undefined | null, transaction?: PrismaPromiseTransaction): Promise<TResult>;
2446
2501
  /**
2447
2502
  * Called when executing a batch of regular tx
2448
2503
  * @param transaction transaction options for batch tx
@@ -2458,7 +2513,7 @@ declare type PrismaPromiseBatchTransaction = {
2458
2513
  lock: PromiseLike<void>;
2459
2514
  };
2460
2515
 
2461
- declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => PrismaPromise_2<unknown>;
2516
+ declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => Promise<unknown>;
2462
2517
 
2463
2518
  /**
2464
2519
  * Creates a [[PrismaPromise]]. It is Prisma's implementation of `Promise` which
@@ -2469,7 +2524,7 @@ declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) =>
2469
2524
  * @see [[PrismaPromise]]
2470
2525
  * @returns
2471
2526
  */
2472
- declare type PrismaPromiseFactory = (callback: PrismaPromiseCallback) => PrismaPromise_2<unknown>;
2527
+ declare type PrismaPromiseFactory = <T extends PrismaOperationSpec<unknown>>(callback: PrismaPromiseCallback, op?: T) => PrismaPromise_2<unknown>;
2473
2528
 
2474
2529
  declare type PrismaPromiseInteractiveTransaction<PayloadType = unknown> = {
2475
2530
  kind: 'itx';
@@ -2506,7 +2561,7 @@ declare type Query = {
2506
2561
  };
2507
2562
 
2508
2563
  declare interface Queryable {
2509
- readonly provider: 'mysql' | 'postgres' | 'sqlite';
2564
+ readonly provider: Flavour;
2510
2565
  readonly adapterName: (typeof officialPrismaAdapters)[number] | (string & {});
2511
2566
  /**
2512
2567
  * Execute a query given as SQL, interpolating the given parameters,
@@ -2525,6 +2580,20 @@ declare interface Queryable {
2525
2580
  executeRaw(params: Query): Promise<Result_4<number>>;
2526
2581
  }
2527
2582
 
2583
+ declare type QueryCompiler = {
2584
+ compile(request: string): Promise<string>;
2585
+ };
2586
+
2587
+ declare interface QueryCompilerConstructor {
2588
+ new (options: QueryCompilerOptions): QueryCompiler;
2589
+ }
2590
+
2591
+ declare type QueryCompilerOptions = {
2592
+ datamodel: string;
2593
+ flavour: Flavour;
2594
+ connectionInfo: ConnectionInfo;
2595
+ };
2596
+
2528
2597
  declare type QueryEngineBatchGraphQLRequest = {
2529
2598
  batch: QueryEngineRequest[];
2530
2599
  transaction?: boolean;
@@ -3375,22 +3444,4 @@ export declare function warnEnvConflicts(envPaths: any): void;
3375
3444
 
3376
3445
  export declare const warnOnce: (key: string, message: string, ...args: unknown[]) => void;
3377
3446
 
3378
- declare type WasmLoadingConfig = {
3379
- /**
3380
- * WASM-bindgen runtime for corresponding module
3381
- */
3382
- getRuntime: () => {
3383
- __wbg_set_wasm(exports: unknown): any;
3384
- QueryEngine: QueryEngineConstructor;
3385
- };
3386
- /**
3387
- * Loads the raw wasm module for the wasm query engine. This configuration is
3388
- * generated specifically for each type of client, eg. Node.js client and Edge
3389
- * clients will have different implementations.
3390
- * @remarks this is a callback on purpose, we only load the wasm if needed.
3391
- * @remarks only used by LibraryEngine.ts
3392
- */
3393
- getQueryEngineWasmModule: () => Promise<unknown>;
3394
- };
3395
-
3396
3447
  export { }