prisma 6.5.0-dev.6 → 6.5.0-dev.60

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.
@@ -18,13 +18,24 @@ declare type AccelerateEngineConfig = {
18
18
  logQueries?: EngineConfig['logQueries'];
19
19
  logLevel?: EngineConfig['logLevel'];
20
20
  tracingHelper: EngineConfig['tracingHelper'];
21
- accelerateUtils?: EngineConfig['accelerateUtils'];
21
+ accelerateUtils?: AccelerateUtils;
22
22
  };
23
23
 
24
+ declare type AccelerateUtils = EngineConfig['accelerateUtils'];
25
+
24
26
  export declare type Action = keyof typeof DMMF.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw';
25
27
 
26
28
  declare type ActiveConnectorType = Exclude<ConnectorType, 'postgres' | 'prisma+postgres'>;
27
29
 
30
+ /**
31
+ * An interface that exposes some basic information about the
32
+ * adapter like its name and provider type.
33
+ */
34
+ declare interface AdapterInfo {
35
+ readonly provider: Provider;
36
+ readonly adapterName: (typeof officialPrismaAdapters)[number] | (string & {});
37
+ }
38
+
28
39
  export declare type Aggregate = '_count' | '_max' | '_min' | '_avg' | '_sum';
29
40
 
30
41
  export declare type AllModelsToStringIndex<TypeMap extends TypeMapDef, Args extends Record<string, any>, K extends PropertyKey> = Args extends {
@@ -937,15 +948,23 @@ export declare namespace DMMF {
937
948
 
938
949
  export declare function dmmfToRuntimeDataModel(dmmfDataModel: DMMF.Datamodel): RuntimeDataModel;
939
950
 
940
- export declare interface DriverAdapter extends Queryable {
951
+ export declare interface DriverAdapter extends SqlQueryable {
941
952
  /**
942
- * Starts new transaction.
953
+ * Execute multiple SQL statements separated by semicolon.
943
954
  */
944
- transactionContext(): Promise<Result_4<TransactionContext>>;
955
+ executeScript(script: string): Promise<void>;
956
+ /**
957
+ * Start new transaction.
958
+ */
959
+ transactionContext(): Promise<TransactionContext>;
945
960
  /**
946
961
  * Optional method that returns extra connection info
947
962
  */
948
- getConnectionInfo?(): Result_4<ConnectionInfo>;
963
+ getConnectionInfo?(): ConnectionInfo;
964
+ /**
965
+ * Dispose of the connection and release any resources.
966
+ */
967
+ dispose(): Promise<void>;
949
968
  }
950
969
 
951
970
  /** Client */
@@ -1142,7 +1161,7 @@ declare interface EngineConfig {
1142
1161
  * rather than Prisma's Rust drivers.
1143
1162
  * @remarks only used by LibraryEngine.ts
1144
1163
  */
1145
- adapter?: ErrorCapturingDriverAdapter;
1164
+ adapter?: ErrorCapturingSqlConnection;
1146
1165
  /**
1147
1166
  * The contents of the schema encoded into a string
1148
1167
  * @remarks only used by DataProxyEngine.ts
@@ -1271,7 +1290,13 @@ declare type Error_2 = {
1271
1290
  message: string;
1272
1291
  };
1273
1292
 
1274
- declare interface ErrorCapturingDriverAdapter extends DriverAdapter {
1293
+ declare type ErrorCapturingFunction<T> = T extends (...args: infer A) => Promise<infer R> ? (...args: A) => Promise<Result_4<ErrorCapturingInterface<R>>> : T extends (...args: infer A) => infer R ? (...args: A) => Result_4<ErrorCapturingInterface<R>> : T;
1294
+
1295
+ declare type ErrorCapturingInterface<T> = {
1296
+ [K in keyof T]: ErrorCapturingFunction<T[K]>;
1297
+ };
1298
+
1299
+ declare interface ErrorCapturingSqlConnection extends ErrorCapturingInterface<DriverAdapter> {
1275
1300
  readonly errorRegistry: ErrorRegistry;
1276
1301
  }
1277
1302
 
@@ -1558,7 +1583,7 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1558
1583
  * @param middleware to hook
1559
1584
  */
1560
1585
  $use(middleware: QueryMiddleware): void;
1561
- $on<E extends ExtendedEventType>(eventType: E, callback: EventCallback<E>): void;
1586
+ $on<E extends ExtendedEventType>(eventType: E, callback: EventCallback<E>): any;
1562
1587
  $connect(): Promise<void>;
1563
1588
  /**
1564
1589
  * Disconnect from the database
@@ -1777,7 +1802,7 @@ export declare type GetResult<Payload extends OperationPayload, Args, OperationN
1777
1802
  export declare function getRuntime(): GetRuntimeOutput;
1778
1803
 
1779
1804
  declare type GetRuntimeOutput = {
1780
- id: Runtime;
1805
+ id: RuntimeName;
1781
1806
  prettyName: string;
1782
1807
  isEdge: boolean;
1783
1808
  };
@@ -2556,30 +2581,15 @@ declare namespace Public_2 {
2556
2581
  }
2557
2582
  }
2558
2583
 
2559
- declare type Query = {
2560
- sql: string;
2561
- args: Array<unknown>;
2562
- argTypes: Array<ArgType>;
2563
- };
2564
-
2565
- declare interface Queryable {
2566
- readonly provider: Provider;
2567
- readonly adapterName: (typeof officialPrismaAdapters)[number] | (string & {});
2584
+ declare interface Queryable<Query, Result> extends AdapterInfo {
2568
2585
  /**
2569
- * Execute a query given as SQL, interpolating the given parameters,
2570
- * and returning the type-aware result set of the query.
2571
- *
2572
- * This is the preferred way of executing `SELECT` queries.
2586
+ * Execute a query and return its result.
2573
2587
  */
2574
- queryRaw(params: Query): Promise<Result_4<ResultSet>>;
2588
+ queryRaw(params: Query): Promise<Result>;
2575
2589
  /**
2576
- * Execute a query given as SQL, interpolating the given parameters,
2577
- * and returning the number of affected rows.
2578
- *
2579
- * This is the preferred way of executing `INSERT`, `UPDATE`, `DELETE` queries,
2580
- * as well as transactional queries.
2590
+ * Execute a query and return the number of affected rows.
2581
2591
  */
2582
- executeRaw(params: Query): Promise<Result_4<number>>;
2592
+ executeRaw(params: Query): Promise<number>;
2583
2593
  }
2584
2594
 
2585
2595
  declare type QueryCompiler = {
@@ -2617,7 +2627,7 @@ declare type QueryEngineConfig = {
2617
2627
  };
2618
2628
 
2619
2629
  declare interface QueryEngineConstructor {
2620
- new (config: QueryEngineConfig, logger: (log: string) => void, adapter?: ErrorCapturingDriverAdapter): QueryEngineInstance;
2630
+ new (config: QueryEngineConfig, logger: (log: string) => void, adapter?: ErrorCapturingSqlConnection): QueryEngineInstance;
2621
2631
  }
2622
2632
 
2623
2633
  declare type QueryEngineInstance = {
@@ -2881,32 +2891,8 @@ export declare type ResultFieldDefinition = {
2881
2891
  compute: ResultArgsFieldCompute;
2882
2892
  };
2883
2893
 
2884
- declare interface ResultSet {
2885
- /**
2886
- * List of column types appearing in a database query, in the same order as `columnNames`.
2887
- * They are used within the Query Engine to convert values from JS to Quaint values.
2888
- */
2889
- columnTypes: Array<ColumnType>;
2890
- /**
2891
- * List of column names appearing in a database query, in the same order as `columnTypes`.
2892
- */
2893
- columnNames: Array<string>;
2894
- /**
2895
- * List of rows retrieved from a database query.
2896
- * Each row is a list of values, whose length matches `columnNames` and `columnTypes`.
2897
- */
2898
- rows: Array<Array<unknown>>;
2899
- /**
2900
- * The last ID of an `INSERT` statement, if any.
2901
- * This is required for `AUTO_INCREMENT` columns in databases based on MySQL and SQLite.
2902
- */
2903
- lastInsertId?: string;
2904
- }
2905
-
2906
2894
  export declare type Return<T> = T extends (...args: any[]) => infer R ? R : T;
2907
2895
 
2908
- declare type Runtime = "edge-routine" | "workerd" | "deno" | "lagon" | "react-native" | "netlify" | "electron" | "node" | "bun" | "edge-light" | "fastly" | "unknown";
2909
-
2910
2896
  export declare type RuntimeDataModel = {
2911
2897
  readonly models: Record<string, RuntimeModel>;
2912
2898
  readonly enums: Record<string, RuntimeEnum>;
@@ -2917,6 +2903,8 @@ declare type RuntimeEnum = Omit<DMMF.DatamodelEnum, 'name'>;
2917
2903
 
2918
2904
  declare type RuntimeModel = Omit<DMMF.Model, 'name'>;
2919
2905
 
2906
+ declare type RuntimeName = 'workerd' | 'deno' | 'netlify' | 'node' | 'bun' | 'edge-light' | '';
2907
+
2920
2908
  export declare type Select<T, U> = T extends U ? T : never;
2921
2909
 
2922
2910
  export declare type SelectablePayloadFields<K extends PropertyKey, O> = {
@@ -3229,6 +3217,37 @@ export declare class Sql {
3229
3217
  };
3230
3218
  }
3231
3219
 
3220
+ declare type SqlQuery = {
3221
+ sql: string;
3222
+ args: Array<unknown>;
3223
+ argTypes: Array<ArgType>;
3224
+ };
3225
+
3226
+ declare interface SqlQueryable extends Queryable<SqlQuery, SqlResultSet> {
3227
+ }
3228
+
3229
+ declare interface SqlResultSet {
3230
+ /**
3231
+ * List of column types appearing in a database query, in the same order as `columnNames`.
3232
+ * They are used within the Query Engine to convert values from JS to Quaint values.
3233
+ */
3234
+ columnTypes: Array<ColumnType>;
3235
+ /**
3236
+ * List of column names appearing in a database query, in the same order as `columnTypes`.
3237
+ */
3238
+ columnNames: Array<string>;
3239
+ /**
3240
+ * List of rows retrieved from a database query.
3241
+ * Each row is a list of values, whose length matches `columnNames` and `columnTypes`.
3242
+ */
3243
+ rows: Array<Array<unknown>>;
3244
+ /**
3245
+ * The last ID of an `INSERT` statement, if any.
3246
+ * This is required for `AUTO_INCREMENT` columns in databases based on MySQL and SQLite.
3247
+ */
3248
+ lastInsertId?: string;
3249
+ }
3250
+
3232
3251
  /**
3233
3252
  * Create a SQL object from a template string.
3234
3253
  */
@@ -3289,7 +3308,7 @@ declare interface TracingHelper {
3289
3308
  runInChildSpan<R>(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback<R>): R;
3290
3309
  }
3291
3310
 
3292
- declare interface Transaction extends Queryable {
3311
+ declare interface Transaction extends AdapterInfo, SqlQueryable {
3293
3312
  /**
3294
3313
  * Transaction options.
3295
3314
  */
@@ -3297,11 +3316,11 @@ declare interface Transaction extends Queryable {
3297
3316
  /**
3298
3317
  * Commit the transaction.
3299
3318
  */
3300
- commit(): Promise<Result_4<void>>;
3319
+ commit(): Promise<void>;
3301
3320
  /**
3302
- * Rolls back the transaction.
3321
+ * Roll back the transaction.
3303
3322
  */
3304
- rollback(): Promise<Result_4<void>>;
3323
+ rollback(): Promise<void>;
3305
3324
  }
3306
3325
 
3307
3326
  declare namespace Transaction_2 {
@@ -3313,11 +3332,11 @@ declare namespace Transaction_2 {
3313
3332
  }
3314
3333
  }
3315
3334
 
3316
- declare interface TransactionContext extends Queryable {
3335
+ declare interface TransactionContext extends AdapterInfo, SqlQueryable {
3317
3336
  /**
3318
- * Starts new transaction.
3337
+ * Start new transaction.
3319
3338
  */
3320
- startTransaction(): Promise<Result_4<Transaction>>;
3339
+ startTransaction(): Promise<Transaction>;
3321
3340
  }
3322
3341
 
3323
3342
  declare type TransactionHeaders = {