prisma 6.3.0-dev.3 → 6.3.0-dev.30

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.
Files changed (30) hide show
  1. package/build/index.js +1388 -1664
  2. package/build/prisma_schema_build_bg.wasm +0 -0
  3. package/build/public/assets/index.js +1 -1
  4. package/build/public/assets/maximize.ce1a88fc.svg +1 -0
  5. package/build/public/assets/minimize.23fe727a.svg +1 -0
  6. package/build/public/assets/moon.387ab66c.svg +1 -0
  7. package/build/public/assets/panel-left.a81e4b97.svg +1 -0
  8. package/build/public/assets/sun.89774753.svg +1 -0
  9. package/build/public/assets/vendor.js +289 -233
  10. package/build/public/index.css +1 -1
  11. package/package.json +26 -16
  12. package/preinstall/index.js +4 -4
  13. package/prisma-client/generator-build/index.js +89 -37
  14. package/prisma-client/package.json +14 -9
  15. package/prisma-client/runtime/binary.js +196 -120
  16. package/prisma-client/runtime/client.d.ts +3447 -0
  17. package/prisma-client/runtime/client.js +103 -0
  18. package/prisma-client/runtime/edge-esm.js +16 -16
  19. package/prisma-client/runtime/edge.js +16 -16
  20. package/prisma-client/runtime/library.d.ts +87 -35
  21. package/prisma-client/runtime/library.js +53 -53
  22. package/prisma-client/runtime/query_compiler_bg.mysql.js +1 -0
  23. package/prisma-client/runtime/query_compiler_bg.postgresql.js +1 -0
  24. package/prisma-client/runtime/query_compiler_bg.sqlite.js +1 -0
  25. package/prisma-client/runtime/query_engine_bg.mysql.js +2 -2
  26. package/prisma-client/runtime/query_engine_bg.postgresql.js +2 -2
  27. package/prisma-client/runtime/query_engine_bg.sqlite.js +2 -2
  28. package/prisma-client/runtime/react-native.d.ts +87 -35
  29. package/prisma-client/runtime/react-native.js +28 -28
  30. package/prisma-client/scripts/default-index.js +3 -3
@@ -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
 
@@ -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;
@@ -216,7 +234,7 @@ declare type ConnectionInfo = {
216
234
  maxBindValues?: number;
217
235
  };
218
236
 
219
- declare type ConnectorType = 'mysql' | 'mongodb' | 'sqlite' | 'postgresql' | 'postgres' | 'sqlserver' | 'cockroachdb';
237
+ declare type ConnectorType = 'mysql' | 'mongodb' | 'sqlite' | 'postgresql' | 'postgres' | 'prisma+postgres' | 'sqlserver' | 'cockroachdb';
220
238
 
221
239
  declare interface Context {
222
240
  /**
@@ -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
  *
@@ -760,6 +780,7 @@ export declare namespace DMMF {
760
780
  relationFromFields?: string[];
761
781
  relationToFields?: string[];
762
782
  relationOnDelete?: string;
783
+ relationOnUpdate?: string;
763
784
  relationName?: string;
764
785
  documentation?: string;
765
786
  }>;
@@ -1146,7 +1167,8 @@ declare interface EngineConfig {
1146
1167
  /**
1147
1168
  * Web Assembly module loading configuration
1148
1169
  */
1149
- engineWasm?: WasmLoadingConfig;
1170
+ engineWasm?: EngineWasmLoadingConfig;
1171
+ compilerWasm?: CompilerWasmLoadingConfig;
1150
1172
  /**
1151
1173
  * Allows Accelerate to use runtime utilities from the client. These are
1152
1174
  * necessary for the AccelerateEngine to function correctly.
@@ -1185,6 +1207,24 @@ declare type EngineSpanId = string;
1185
1207
 
1186
1208
  declare type EngineSpanKind = 'client' | 'internal';
1187
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
+
1188
1228
  declare type EnvPaths = {
1189
1229
  rootEnvPath: string | null;
1190
1230
  schemaEnvPath: string | undefined;
@@ -1392,6 +1432,8 @@ export declare interface FieldRef<Model, FieldType> {
1392
1432
  readonly isList: boolean;
1393
1433
  }
1394
1434
 
1435
+ declare type Flavour = 'mysql' | 'postgres' | 'sqlite';
1436
+
1395
1437
  export declare type FluentOperation = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'create' | 'update' | 'upsert' | 'delete';
1396
1438
 
1397
1439
  export declare interface Fn<Params = unknown, Returns = unknown> {
@@ -1528,7 +1570,7 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1528
1570
  * @param values
1529
1571
  * @returns
1530
1572
  */
1531
- $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown>;
1573
+ $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown, any>;
1532
1574
  /**
1533
1575
  * Unsafe counterpart of `$executeRaw` that is susceptible to SQL injections
1534
1576
  * @see https://github.com/prisma/prisma/issues/7142
@@ -1537,14 +1579,14 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1537
1579
  * @param values
1538
1580
  * @returns
1539
1581
  */
1540
- $executeRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown>;
1582
+ $executeRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown, any>;
1541
1583
  /**
1542
1584
  * Executes a raw command only for MongoDB
1543
1585
  *
1544
1586
  * @param command
1545
1587
  * @returns
1546
1588
  */
1547
- $runCommandRaw(command: Record<string, JsInputValue>): PrismaPromise_2<unknown>;
1589
+ $runCommandRaw(command: Record<string, JsInputValue>): PrismaPromise_2<unknown, any>;
1548
1590
  /**
1549
1591
  * Executes a raw query and returns selected data
1550
1592
  */
@@ -1557,12 +1599,12 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1557
1599
  * @param values
1558
1600
  * @returns
1559
1601
  */
1560
- $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown>;
1602
+ $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown, any>;
1561
1603
  /**
1562
1604
  * Counterpart to $queryRaw, that returns strongly typed results
1563
1605
  * @param typedSql
1564
1606
  */
1565
- $queryRawTyped(typedSql: UnknownTypedSql): PrismaPromise_2<unknown>;
1607
+ $queryRawTyped(typedSql: UnknownTypedSql): PrismaPromise_2<unknown, any>;
1566
1608
  /**
1567
1609
  * Unsafe counterpart of `$queryRaw` that is susceptible to SQL injections
1568
1610
  * @see https://github.com/prisma/prisma/issues/7142
@@ -1571,7 +1613,7 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1571
1613
  * @param values
1572
1614
  * @returns
1573
1615
  */
1574
- $queryRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown>;
1616
+ $queryRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown, any>;
1575
1617
  /**
1576
1618
  * Execute a batch of requests in a transaction
1577
1619
  * @param requests
@@ -1694,7 +1736,8 @@ declare type GetPrismaClientConfig = {
1694
1736
  /**
1695
1737
  * Optional wasm loading configuration
1696
1738
  */
1697
- engineWasm?: WasmLoadingConfig;
1739
+ engineWasm?: EngineWasmLoadingConfig;
1740
+ compilerWasm?: CompilerWasmLoadingConfig;
1698
1741
  };
1699
1742
 
1700
1743
  export declare type GetResult<Payload extends OperationPayload, Args, OperationName extends Operation = 'findUniqueOrThrow', ClientOptions = {}> = {
@@ -2296,6 +2339,12 @@ export declare type Or<A extends 1 | 0, B extends 1 | 0> = {
2296
2339
  };
2297
2340
  }[A][B];
2298
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
+
2299
2348
  export declare type PatchFlat<O1, O2> = O1 & Omit_2<O2, keyof O1>;
2300
2349
 
2301
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;
@@ -2413,6 +2462,12 @@ export declare class PrismaClientValidationError extends Error {
2413
2462
 
2414
2463
  declare function prismaGraphQLToJSError({ error, user_facing_error }: RequestError, clientVersion: string, activeProvider: string): PrismaClientKnownRequestError | PrismaClientUnknownRequestError;
2415
2464
 
2465
+ declare type PrismaOperationSpec<TArgs, TAction = string> = {
2466
+ args: TArgs;
2467
+ action: TAction;
2468
+ model: string;
2469
+ };
2470
+
2416
2471
  export declare interface PrismaPromise<T> extends Promise<T> {
2417
2472
  [Symbol.toStringTag]: 'PrismaPromise';
2418
2473
  }
@@ -2422,26 +2477,27 @@ export declare interface PrismaPromise<T> extends Promise<T> {
2422
2477
  * original `Promise` are optional so that it can be backwards-compatible.
2423
2478
  * @see [[createPrismaPromise]]
2424
2479
  */
2425
- 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;
2426
2482
  /**
2427
2483
  * Extension of the original `.then` function
2428
2484
  * @param onfulfilled same as regular promises
2429
2485
  * @param onrejected same as regular promises
2430
2486
  * @param transaction transaction options
2431
2487
  */
2432
- 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>;
2433
2489
  /**
2434
2490
  * Extension of the original `.catch` function
2435
2491
  * @param onrejected same as regular promises
2436
2492
  * @param transaction transaction options
2437
2493
  */
2438
- 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>;
2439
2495
  /**
2440
2496
  * Extension of the original `.finally` function
2441
2497
  * @param onfinally same as regular promises
2442
2498
  * @param transaction transaction options
2443
2499
  */
2444
- finally(onfinally?: (() => void) | undefined | null, transaction?: PrismaPromiseTransaction): Promise<A>;
2500
+ finally(onfinally?: (() => void) | undefined | null, transaction?: PrismaPromiseTransaction): Promise<TResult>;
2445
2501
  /**
2446
2502
  * Called when executing a batch of regular tx
2447
2503
  * @param transaction transaction options for batch tx
@@ -2457,7 +2513,7 @@ declare type PrismaPromiseBatchTransaction = {
2457
2513
  lock: PromiseLike<void>;
2458
2514
  };
2459
2515
 
2460
- declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => PrismaPromise_2<unknown>;
2516
+ declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => Promise<unknown>;
2461
2517
 
2462
2518
  /**
2463
2519
  * Creates a [[PrismaPromise]]. It is Prisma's implementation of `Promise` which
@@ -2468,7 +2524,7 @@ declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) =>
2468
2524
  * @see [[PrismaPromise]]
2469
2525
  * @returns
2470
2526
  */
2471
- declare type PrismaPromiseFactory = (callback: PrismaPromiseCallback) => PrismaPromise_2<unknown>;
2527
+ declare type PrismaPromiseFactory = <T extends PrismaOperationSpec<unknown>>(callback: PrismaPromiseCallback, op?: T) => PrismaPromise_2<unknown>;
2472
2528
 
2473
2529
  declare type PrismaPromiseInteractiveTransaction<PayloadType = unknown> = {
2474
2530
  kind: 'itx';
@@ -2505,7 +2561,7 @@ declare type Query = {
2505
2561
  };
2506
2562
 
2507
2563
  declare interface Queryable {
2508
- readonly provider: 'mysql' | 'postgres' | 'sqlite';
2564
+ readonly provider: Flavour;
2509
2565
  readonly adapterName: (typeof officialPrismaAdapters)[number] | (string & {});
2510
2566
  /**
2511
2567
  * Execute a query given as SQL, interpolating the given parameters,
@@ -2524,6 +2580,20 @@ declare interface Queryable {
2524
2580
  executeRaw(params: Query): Promise<Result_4<number>>;
2525
2581
  }
2526
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
+
2527
2597
  declare type QueryEngineBatchGraphQLRequest = {
2528
2598
  batch: QueryEngineRequest[];
2529
2599
  transaction?: boolean;
@@ -3374,22 +3444,4 @@ export declare function warnEnvConflicts(envPaths: any): void;
3374
3444
 
3375
3445
  export declare const warnOnce: (key: string, message: string, ...args: unknown[]) => void;
3376
3446
 
3377
- declare type WasmLoadingConfig = {
3378
- /**
3379
- * WASM-bindgen runtime for corresponding module
3380
- */
3381
- getRuntime: () => {
3382
- __wbg_set_wasm(exports: unknown): any;
3383
- QueryEngine: QueryEngineConstructor;
3384
- };
3385
- /**
3386
- * Loads the raw wasm module for the wasm query engine. This configuration is
3387
- * generated specifically for each type of client, eg. Node.js client and Edge
3388
- * clients will have different implementations.
3389
- * @remarks this is a callback on purpose, we only load the wasm if needed.
3390
- * @remarks only used by LibraryEngine.ts
3391
- */
3392
- getQueryEngineWasmModule: () => Promise<unknown>;
3393
- };
3394
-
3395
3447
  export { }