prisma 6.6.0-dev.9 → 6.6.0-dev.90

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 (36) hide show
  1. package/build/index.js +4023 -1167
  2. package/build/prisma_schema_build_bg.wasm +0 -0
  3. package/build/public/assets/index.js +1 -1
  4. package/package.json +21 -19
  5. package/preinstall/index.js +4 -4
  6. package/prisma-client/generator-build/index.js +15466 -9300
  7. package/prisma-client/package.json +43 -24
  8. package/prisma-client/runtime/binary.js +120 -120
  9. package/prisma-client/runtime/binary.mjs +291 -0
  10. package/prisma-client/runtime/client.d.mts +3604 -0
  11. package/prisma-client/runtime/client.d.ts +421 -290
  12. package/prisma-client/runtime/client.js +41 -38
  13. package/prisma-client/runtime/client.mjs +113 -0
  14. package/prisma-client/runtime/edge-esm.js +18 -18
  15. package/prisma-client/runtime/edge.d.ts +3604 -0
  16. package/prisma-client/runtime/edge.js +18 -18
  17. package/prisma-client/runtime/index-browser.js +1 -1
  18. package/prisma-client/runtime/library.d.mts +3604 -0
  19. package/prisma-client/runtime/library.d.ts +421 -290
  20. package/prisma-client/runtime/library.js +65 -65
  21. package/prisma-client/runtime/library.mjs +150 -0
  22. package/prisma-client/runtime/query_compiler_bg.mysql.js +2 -2
  23. package/prisma-client/runtime/query_compiler_bg.mysql.mjs +2 -0
  24. package/prisma-client/runtime/query_compiler_bg.postgresql.js +2 -2
  25. package/prisma-client/runtime/query_compiler_bg.postgresql.mjs +2 -0
  26. package/prisma-client/runtime/query_compiler_bg.sqlite.js +2 -2
  27. package/prisma-client/runtime/query_compiler_bg.sqlite.mjs +2 -0
  28. package/prisma-client/runtime/query_engine_bg.mysql.js +2 -2
  29. package/prisma-client/runtime/query_engine_bg.mysql.mjs +2 -0
  30. package/prisma-client/runtime/query_engine_bg.postgresql.js +2 -2
  31. package/prisma-client/runtime/query_engine_bg.postgresql.mjs +2 -0
  32. package/prisma-client/runtime/query_engine_bg.sqlite.js +2 -2
  33. package/prisma-client/runtime/query_engine_bg.sqlite.mjs +2 -0
  34. package/prisma-client/runtime/react-native.d.ts +421 -290
  35. package/prisma-client/runtime/react-native.js +27 -27
  36. package/prisma-client/scripts/default-index.js +3 -3
@@ -23,7 +23,7 @@ declare type AccelerateEngineConfig = {
23
23
 
24
24
  declare type AccelerateUtils = EngineConfig['accelerateUtils'];
25
25
 
26
- export declare type Action = keyof typeof DMMF.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw';
26
+ export declare type Action = keyof typeof DMMF_2.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw';
27
27
 
28
28
  declare type ActiveConnectorType = Exclude<ConnectorType, 'postgres' | 'prisma+postgres'>;
29
29
 
@@ -91,7 +91,7 @@ declare interface Attributes {
91
91
  declare type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
92
92
 
93
93
  export declare type BaseDMMF = {
94
- readonly datamodel: Omit<DMMF.Datamodel, 'indexes'>;
94
+ readonly datamodel: Omit<DMMF_2.Datamodel, 'indexes'>;
95
95
  };
96
96
 
97
97
  declare type BatchArgs = {
@@ -122,8 +122,10 @@ declare type BatchQueryOptionsCbArgs = {
122
122
  __internalParams: BatchInternalParams;
123
123
  };
124
124
 
125
+ declare type BatchResponse = MultiBatchResponse | CompactedBatchResponse;
126
+
125
127
  declare type BatchTransactionOptions = {
126
- isolationLevel?: Transaction_2.IsolationLevel;
128
+ isolationLevel?: IsolationLevel;
127
129
  };
128
130
 
129
131
  declare interface BinaryTargetsEnvValue {
@@ -204,12 +206,21 @@ declare const ColumnTypeEnum: {
204
206
  readonly UnknownNumber: 128;
205
207
  };
206
208
 
209
+ declare type CompactedBatchResponse = {
210
+ type: 'compacted';
211
+ plan: object;
212
+ arguments: Map<string, {}>[];
213
+ nestedSelection: string[];
214
+ keys: string[];
215
+ expectNonEmpty: boolean;
216
+ };
217
+
207
218
  declare type CompilerWasmLoadingConfig = {
208
219
  /**
209
220
  * WASM-bindgen runtime for corresponding module
210
221
  */
211
222
  getRuntime: () => {
212
- __wbg_set_wasm(exports: unknown): any;
223
+ __wbg_set_wasm(exports: unknown): void;
213
224
  QueryCompiler: QueryCompilerConstructor;
214
225
  };
215
226
  /**
@@ -347,6 +358,22 @@ declare type DataLoaderOptions<T> = {
347
358
  batchOrder: (requestA: T, requestB: T) => number;
348
359
  };
349
360
 
361
+ declare type Datamodel = ReadonlyDeep_2<{
362
+ models: Model[];
363
+ enums: DatamodelEnum[];
364
+ types: Model[];
365
+ indexes: Index[];
366
+ }>;
367
+
368
+ declare type DatamodelEnum = ReadonlyDeep_2<{
369
+ name: string;
370
+ values: EnumValue[];
371
+ dbName?: string | null;
372
+ documentation?: string;
373
+ }>;
374
+
375
+ declare function datamodelEnumToSchemaEnum(datamodelEnum: DatamodelEnum): SchemaEnum;
376
+
350
377
  declare type Datasource = {
351
378
  url?: string;
352
379
  };
@@ -681,6 +708,12 @@ declare function defineExtension(ext: ExtensionArgs | ((client: Client) => Clien
681
708
 
682
709
  declare const denylist: readonly ["$connect", "$disconnect", "$on", "$transaction", "$use", "$extends"];
683
710
 
711
+ declare type Deprecation = ReadonlyDeep_2<{
712
+ sinceVersion: string;
713
+ reason: string;
714
+ plannedRemovalVersion?: string;
715
+ }>;
716
+
684
717
  declare type DeserializedResponse = Array<Record<string, unknown>>;
685
718
 
686
719
  export declare function deserializeJsonResponse(result: unknown): unknown;
@@ -708,263 +741,104 @@ export declare type DevTypeMapFnDef = {
708
741
  };
709
742
 
710
743
  export declare namespace DMMF {
711
- export type Document = ReadonlyDeep_2<{
712
- datamodel: Datamodel;
713
- schema: Schema;
714
- mappings: Mappings;
715
- }>;
716
- export type Mappings = ReadonlyDeep_2<{
717
- modelOperations: ModelMapping[];
718
- otherOperations: {
719
- read: string[];
720
- write: string[];
721
- };
722
- }>;
723
- export type OtherOperationMappings = ReadonlyDeep_2<{
724
- read: string[];
725
- write: string[];
726
- }>;
727
- export type DatamodelEnum = ReadonlyDeep_2<{
728
- name: string;
729
- values: EnumValue[];
730
- dbName?: string | null;
731
- documentation?: string;
732
- }>;
733
- export type SchemaEnum = ReadonlyDeep_2<{
734
- name: string;
735
- values: string[];
736
- }>;
737
- export type EnumValue = ReadonlyDeep_2<{
738
- name: string;
739
- dbName: string | null;
740
- }>;
741
- export type Datamodel = ReadonlyDeep_2<{
742
- models: Model[];
743
- enums: DatamodelEnum[];
744
- types: Model[];
745
- indexes: Index[];
746
- }>;
747
- export type uniqueIndex = ReadonlyDeep_2<{
748
- name: string;
749
- fields: string[];
750
- }>;
751
- export type PrimaryKey = ReadonlyDeep_2<{
752
- name: string | null;
753
- fields: string[];
754
- }>;
755
- export type Model = ReadonlyDeep_2<{
756
- name: string;
757
- dbName: string | null;
758
- schema: string | null;
759
- fields: Field[];
760
- uniqueFields: string[][];
761
- uniqueIndexes: uniqueIndex[];
762
- documentation?: string;
763
- primaryKey: PrimaryKey | null;
764
- isGenerated?: boolean;
765
- }>;
766
- export type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported';
767
- export type FieldNamespace = 'model' | 'prisma';
768
- export type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes';
769
- export type Field = ReadonlyDeep_2<{
770
- kind: FieldKind;
771
- name: string;
772
- isRequired: boolean;
773
- isList: boolean;
774
- isUnique: boolean;
775
- isId: boolean;
776
- isReadOnly: boolean;
777
- isGenerated?: boolean;
778
- isUpdatedAt?: boolean;
779
- /**
780
- * Describes the data type in the same the way it is defined in the Prisma schema:
781
- * BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName
782
- */
783
- type: string;
784
- /**
785
- * Native database type, if specified.
786
- * For example, `@db.VarChar(191)` is encoded as `['VarChar', ['191']]`,
787
- * `@db.Text` is encoded as `['Text', []]`.
788
- */
789
- nativeType?: [string, string[]] | null;
790
- dbName?: string | null;
791
- hasDefaultValue: boolean;
792
- default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[];
793
- relationFromFields?: string[];
794
- relationToFields?: string[];
795
- relationOnDelete?: string;
796
- relationOnUpdate?: string;
797
- relationName?: string;
798
- documentation?: string;
799
- }>;
800
- export type FieldDefault = ReadonlyDeep_2<{
801
- name: string;
802
- args: Array<string | number>;
803
- }>;
804
- export type FieldDefaultScalar = string | boolean | number;
805
- export type Index = ReadonlyDeep_2<{
806
- model: string;
807
- type: IndexType;
808
- isDefinedOnField: boolean;
809
- name?: string;
810
- dbName?: string;
811
- algorithm?: string;
812
- clustered?: boolean;
813
- fields: IndexField[];
814
- }>;
815
- export type IndexType = 'id' | 'normal' | 'unique' | 'fulltext';
816
- export type IndexField = ReadonlyDeep_2<{
817
- name: string;
818
- sortOrder?: SortOrder;
819
- length?: number;
820
- operatorClass?: string;
821
- }>;
822
- export type SortOrder = 'asc' | 'desc';
823
- export type Schema = ReadonlyDeep_2<{
824
- rootQueryType?: string;
825
- rootMutationType?: string;
826
- inputObjectTypes: {
827
- model?: InputType[];
828
- prisma: InputType[];
829
- };
830
- outputObjectTypes: {
831
- model: OutputType[];
832
- prisma: OutputType[];
833
- };
834
- enumTypes: {
835
- model?: SchemaEnum[];
836
- prisma: SchemaEnum[];
837
- };
838
- fieldRefTypes: {
839
- prisma?: FieldRefType[];
840
- };
841
- }>;
842
- export type Query = ReadonlyDeep_2<{
843
- name: string;
844
- args: SchemaArg[];
845
- output: QueryOutput;
846
- }>;
847
- export type QueryOutput = ReadonlyDeep_2<{
848
- name: string;
849
- isRequired: boolean;
850
- isList: boolean;
851
- }>;
852
- export type TypeRef<AllowedLocations extends FieldLocation> = {
853
- isList: boolean;
854
- type: string;
855
- location: AllowedLocations;
856
- namespace?: FieldNamespace;
857
- };
858
- export type InputTypeRef = TypeRef<'scalar' | 'inputObjectTypes' | 'enumTypes' | 'fieldRefTypes'>;
859
- export type SchemaArg = ReadonlyDeep_2<{
860
- name: string;
861
- comment?: string;
862
- isNullable: boolean;
863
- isRequired: boolean;
864
- inputTypes: InputTypeRef[];
865
- deprecation?: Deprecation;
866
- }>;
867
- export type OutputType = ReadonlyDeep_2<{
868
- name: string;
869
- fields: SchemaField[];
870
- }>;
871
- export type SchemaField = ReadonlyDeep_2<{
872
- name: string;
873
- isNullable?: boolean;
874
- outputType: OutputTypeRef;
875
- args: SchemaArg[];
876
- deprecation?: Deprecation;
877
- documentation?: string;
878
- }>;
879
- export type OutputTypeRef = TypeRef<'scalar' | 'outputObjectTypes' | 'enumTypes'>;
880
- export type Deprecation = ReadonlyDeep_2<{
881
- sinceVersion: string;
882
- reason: string;
883
- plannedRemovalVersion?: string;
884
- }>;
885
- export type InputType = ReadonlyDeep_2<{
886
- name: string;
887
- constraints: {
888
- maxNumFields: number | null;
889
- minNumFields: number | null;
890
- fields?: string[];
891
- };
892
- meta?: {
893
- source?: string;
894
- };
895
- fields: SchemaArg[];
896
- }>;
897
- export type FieldRefType = ReadonlyDeep_2<{
898
- name: string;
899
- allowTypes: FieldRefAllowType[];
900
- fields: SchemaArg[];
901
- }>;
902
- export type FieldRefAllowType = TypeRef<'scalar' | 'enumTypes'>;
903
- export type ModelMapping = ReadonlyDeep_2<{
904
- model: string;
905
- plural: string;
906
- findUnique?: string | null;
907
- findUniqueOrThrow?: string | null;
908
- findFirst?: string | null;
909
- findFirstOrThrow?: string | null;
910
- findMany?: string | null;
911
- create?: string | null;
912
- createMany?: string | null;
913
- createManyAndReturn?: string | null;
914
- update?: string | null;
915
- updateMany?: string | null;
916
- updateManyAndReturn?: string | null;
917
- upsert?: string | null;
918
- delete?: string | null;
919
- deleteMany?: string | null;
920
- aggregate?: string | null;
921
- groupBy?: string | null;
922
- count?: string | null;
923
- findRaw?: string | null;
924
- aggregateRaw?: string | null;
925
- }>;
926
- export enum ModelAction {
927
- findUnique = "findUnique",
928
- findUniqueOrThrow = "findUniqueOrThrow",
929
- findFirst = "findFirst",
930
- findFirstOrThrow = "findFirstOrThrow",
931
- findMany = "findMany",
932
- create = "create",
933
- createMany = "createMany",
934
- createManyAndReturn = "createManyAndReturn",
935
- update = "update",
936
- updateMany = "updateMany",
937
- updateManyAndReturn = "updateManyAndReturn",
938
- upsert = "upsert",
939
- delete = "delete",
940
- deleteMany = "deleteMany",
941
- groupBy = "groupBy",
942
- count = "count",// TODO: count does not actually exist, why?
943
- aggregate = "aggregate",
944
- findRaw = "findRaw",
945
- aggregateRaw = "aggregateRaw"
744
+ export {
745
+ datamodelEnumToSchemaEnum,
746
+ Document_2 as Document,
747
+ Mappings,
748
+ OtherOperationMappings,
749
+ DatamodelEnum,
750
+ SchemaEnum,
751
+ EnumValue,
752
+ Datamodel,
753
+ uniqueIndex,
754
+ PrimaryKey,
755
+ Model,
756
+ FieldKind,
757
+ FieldNamespace,
758
+ FieldLocation,
759
+ Field,
760
+ FieldDefault,
761
+ FieldDefaultScalar,
762
+ Index,
763
+ IndexType,
764
+ IndexField,
765
+ SortOrder,
766
+ Schema,
767
+ Query,
768
+ QueryOutput,
769
+ TypeRef,
770
+ InputTypeRef,
771
+ SchemaArg,
772
+ OutputType,
773
+ SchemaField,
774
+ OutputTypeRef,
775
+ Deprecation,
776
+ InputType,
777
+ FieldRefType,
778
+ FieldRefAllowType,
779
+ ModelMapping,
780
+ ModelAction
946
781
  }
947
782
  }
948
783
 
949
- export declare function dmmfToRuntimeDataModel(dmmfDataModel: DMMF.Datamodel): RuntimeDataModel;
784
+ declare namespace DMMF_2 {
785
+ export {
786
+ datamodelEnumToSchemaEnum,
787
+ Document_2 as Document,
788
+ Mappings,
789
+ OtherOperationMappings,
790
+ DatamodelEnum,
791
+ SchemaEnum,
792
+ EnumValue,
793
+ Datamodel,
794
+ uniqueIndex,
795
+ PrimaryKey,
796
+ Model,
797
+ FieldKind,
798
+ FieldNamespace,
799
+ FieldLocation,
800
+ Field,
801
+ FieldDefault,
802
+ FieldDefaultScalar,
803
+ Index,
804
+ IndexType,
805
+ IndexField,
806
+ SortOrder,
807
+ Schema,
808
+ Query,
809
+ QueryOutput,
810
+ TypeRef,
811
+ InputTypeRef,
812
+ SchemaArg,
813
+ OutputType,
814
+ SchemaField,
815
+ OutputTypeRef,
816
+ Deprecation,
817
+ InputType,
818
+ FieldRefType,
819
+ FieldRefAllowType,
820
+ ModelMapping,
821
+ ModelAction
822
+ }
823
+ }
950
824
 
951
- export declare interface DriverAdapter extends SqlQueryable {
952
- /**
953
- * Execute multiple SQL statements separated by semicolon.
954
- */
955
- executeScript(script: string): Promise<void>;
956
- /**
957
- * Start new transaction.
958
- */
959
- transactionContext(): Promise<TransactionContext>;
960
- /**
961
- * Optional method that returns extra connection info
962
- */
963
- getConnectionInfo?(): ConnectionInfo;
825
+ export declare function dmmfToRuntimeDataModel(dmmfDataModel: DMMF_2.Datamodel): RuntimeDataModel;
826
+
827
+ declare type Document_2 = ReadonlyDeep_2<{
828
+ datamodel: Datamodel;
829
+ schema: Schema;
830
+ mappings: Mappings;
831
+ }>;
832
+
833
+ /**
834
+ * A generic driver adapter factory that allows the user to instantiate a
835
+ * driver adapter. The query and result types are specific to the adapter.
836
+ */
837
+ declare interface DriverAdapterFactory<Query, Result> extends AdapterInfo {
964
838
  /**
965
- * Dispose of the connection and release any resources.
839
+ * Instantiate a driver adapter.
966
840
  */
967
- dispose(): Promise<void>;
841
+ connect(): Promise<Queryable<Query, Result>>;
968
842
  }
969
843
 
970
844
  /** Client */
@@ -1161,7 +1035,7 @@ declare interface EngineConfig {
1161
1035
  * rather than Prisma's Rust drivers.
1162
1036
  * @remarks only used by LibraryEngine.ts
1163
1037
  */
1164
- adapter?: ErrorCapturingSqlConnection;
1038
+ adapter?: SqlDriverAdapterFactory;
1165
1039
  /**
1166
1040
  * The contents of the schema encoded into a string
1167
1041
  * @remarks only used by DataProxyEngine.ts
@@ -1215,8 +1089,6 @@ declare type EngineEvent<E extends EngineEventType> = E extends QueryEventType ?
1215
1089
 
1216
1090
  declare type EngineEventType = QueryEventType | LogEventType;
1217
1091
 
1218
- declare type EngineProtocol = 'graphql' | 'json';
1219
-
1220
1092
  declare type EngineSpan = {
1221
1093
  id: EngineSpanId;
1222
1094
  parentId: string | null;
@@ -1237,7 +1109,7 @@ declare type EngineWasmLoadingConfig = {
1237
1109
  * WASM-bindgen runtime for corresponding module
1238
1110
  */
1239
1111
  getRuntime: () => {
1240
- __wbg_set_wasm(exports: unknown): any;
1112
+ __wbg_set_wasm(exports: unknown): void;
1241
1113
  QueryEngine: QueryEngineConstructor;
1242
1114
  };
1243
1115
  /**
@@ -1250,6 +1122,11 @@ declare type EngineWasmLoadingConfig = {
1250
1122
  getQueryEngineWasmModule: () => Promise<unknown>;
1251
1123
  };
1252
1124
 
1125
+ declare type EnumValue = ReadonlyDeep_2<{
1126
+ name: string;
1127
+ dbName: string | null;
1128
+ }>;
1129
+
1253
1130
  declare type EnvPaths = {
1254
1131
  rootEnvPath: string | null;
1255
1132
  schemaEnvPath: string | undefined;
@@ -1268,6 +1145,9 @@ declare type Error_2 = {
1268
1145
  } | {
1269
1146
  kind: 'UnsupportedNativeDataType';
1270
1147
  type: string;
1148
+ } | {
1149
+ kind: 'InvalidIsolationLevel';
1150
+ level: string;
1271
1151
  } | {
1272
1152
  kind: 'postgres';
1273
1153
  code: string;
@@ -1296,7 +1176,7 @@ declare type ErrorCapturingInterface<T> = {
1296
1176
  [K in keyof T]: ErrorCapturingFunction<T[K]>;
1297
1177
  };
1298
1178
 
1299
- declare interface ErrorCapturingSqlConnection extends ErrorCapturingInterface<DriverAdapter> {
1179
+ declare interface ErrorCapturingSqlDriverAdapter extends ErrorCapturingInterface<SqlDriverAdapter> {
1300
1180
  readonly errorRegistry: ErrorRegistry;
1301
1181
  }
1302
1182
 
@@ -1453,6 +1333,51 @@ export declare type ExtractGlobalOmit<Options, ModelName extends string> = Optio
1453
1333
  };
1454
1334
  } ? GlobalOmit : {};
1455
1335
 
1336
+ declare type Field = ReadonlyDeep_2<{
1337
+ kind: FieldKind;
1338
+ name: string;
1339
+ isRequired: boolean;
1340
+ isList: boolean;
1341
+ isUnique: boolean;
1342
+ isId: boolean;
1343
+ isReadOnly: boolean;
1344
+ isGenerated?: boolean;
1345
+ isUpdatedAt?: boolean;
1346
+ /**
1347
+ * Describes the data type in the same the way it is defined in the Prisma schema:
1348
+ * BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName
1349
+ */
1350
+ type: string;
1351
+ /**
1352
+ * Native database type, if specified.
1353
+ * For example, `@db.VarChar(191)` is encoded as `['VarChar', ['191']]`,
1354
+ * `@db.Text` is encoded as `['Text', []]`.
1355
+ */
1356
+ nativeType?: [string, string[]] | null;
1357
+ dbName?: string | null;
1358
+ hasDefaultValue: boolean;
1359
+ default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[];
1360
+ relationFromFields?: string[];
1361
+ relationToFields?: string[];
1362
+ relationOnDelete?: string;
1363
+ relationOnUpdate?: string;
1364
+ relationName?: string;
1365
+ documentation?: string;
1366
+ }>;
1367
+
1368
+ declare type FieldDefault = ReadonlyDeep_2<{
1369
+ name: string;
1370
+ args: Array<string | number>;
1371
+ }>;
1372
+
1373
+ declare type FieldDefaultScalar = string | boolean | number;
1374
+
1375
+ declare type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported';
1376
+
1377
+ declare type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes';
1378
+
1379
+ declare type FieldNamespace = 'model' | 'prisma';
1380
+
1456
1381
  /**
1457
1382
  * A reference to a specific field of a specific model
1458
1383
  */
@@ -1463,7 +1388,15 @@ export declare interface FieldRef<Model, FieldType> {
1463
1388
  readonly isList: boolean;
1464
1389
  }
1465
1390
 
1466
- export declare type FluentOperation = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'create' | 'update' | 'upsert' | 'delete';
1391
+ declare type FieldRefAllowType = TypeRef<'scalar' | 'enumTypes'>;
1392
+
1393
+ declare type FieldRefType = ReadonlyDeep_2<{
1394
+ name: string;
1395
+ allowTypes: FieldRefAllowType[];
1396
+ fields: SchemaArg[];
1397
+ }>;
1398
+
1399
+ declare type FluentOperation = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'create' | 'update' | 'upsert' | 'delete';
1467
1400
 
1468
1401
  export declare interface Fn<Params = unknown, Returns = unknown> {
1469
1402
  params: Params;
@@ -1843,6 +1776,26 @@ declare type HrTime = [number, number];
1843
1776
  */
1844
1777
  declare type HrTime_2 = [number, number];
1845
1778
 
1779
+ declare type Index = ReadonlyDeep_2<{
1780
+ model: string;
1781
+ type: IndexType;
1782
+ isDefinedOnField: boolean;
1783
+ name?: string;
1784
+ dbName?: string;
1785
+ algorithm?: string;
1786
+ clustered?: boolean;
1787
+ fields: IndexField[];
1788
+ }>;
1789
+
1790
+ declare type IndexField = ReadonlyDeep_2<{
1791
+ name: string;
1792
+ sortOrder?: SortOrder;
1793
+ length?: number;
1794
+ operatorClass?: string;
1795
+ }>;
1796
+
1797
+ declare type IndexType = 'id' | 'normal' | 'unique' | 'fulltext';
1798
+
1846
1799
  /**
1847
1800
  * Matches a JSON array.
1848
1801
  * Unlike \`JsonArray\`, readonly arrays are assignable to this type.
@@ -1875,6 +1828,22 @@ export declare type InputJsonValue = string | number | boolean | InputJsonObject
1875
1828
  toJSON(): unknown;
1876
1829
  };
1877
1830
 
1831
+ declare type InputType = ReadonlyDeep_2<{
1832
+ name: string;
1833
+ constraints: {
1834
+ maxNumFields: number | null;
1835
+ minNumFields: number | null;
1836
+ fields?: string[];
1837
+ };
1838
+ meta?: {
1839
+ source?: string;
1840
+ grouping?: string;
1841
+ };
1842
+ fields: SchemaArg[];
1843
+ }>;
1844
+
1845
+ declare type InputTypeRef = TypeRef<'scalar' | 'inputObjectTypes' | 'enumTypes' | 'fieldRefTypes'>;
1846
+
1878
1847
  declare type InteractiveTransactionInfo<Payload = unknown> = {
1879
1848
  /**
1880
1849
  * Transaction ID returned by the query engine.
@@ -1950,13 +1919,7 @@ declare type InternalRequestParams = {
1950
1919
  customDataProxyFetch?: CustomDataProxyFetch;
1951
1920
  } & Omit<QueryMiddlewareParams, 'runInTransaction'>;
1952
1921
 
1953
- declare const enum IsolationLevel {
1954
- ReadUncommitted = "ReadUncommitted",
1955
- ReadCommitted = "ReadCommitted",
1956
- RepeatableRead = "RepeatableRead",
1957
- Snapshot = "Snapshot",
1958
- Serializable = "Serializable"
1959
- }
1922
+ declare type IsolationLevel = 'READ UNCOMMITTED' | 'READ COMMITTED' | 'REPEATABLE READ' | 'SNAPSHOT' | 'SERIALIZABLE';
1960
1923
 
1961
1924
  declare function isSkip(value: unknown): value is Skip;
1962
1925
 
@@ -2002,7 +1965,7 @@ export declare interface JsonArray extends Array<JsonValue> {
2002
1965
  export declare type JsonBatchQuery = {
2003
1966
  batch: JsonQuery[];
2004
1967
  transaction?: {
2005
- isolationLevel?: Transaction_2.IsolationLevel;
1968
+ isolationLevel?: IsolationLevel;
2006
1969
  };
2007
1970
  };
2008
1971
 
@@ -2145,6 +2108,14 @@ export declare function makeStrictEnum<T extends Record<PropertyKey, string | nu
2145
2108
 
2146
2109
  export declare function makeTypedQueryFactory(sql: string): (...values: any[]) => TypedSql<any[], unknown>;
2147
2110
 
2111
+ declare type Mappings = ReadonlyDeep_2<{
2112
+ modelOperations: ModelMapping[];
2113
+ otherOperations: {
2114
+ read: string[];
2115
+ write: string[];
2116
+ };
2117
+ }>;
2118
+
2148
2119
  /**
2149
2120
  * Class that holds the list of all extensions, applied to particular instance,
2150
2121
  * as well as resolved versions of the components that need to apply on
@@ -2244,6 +2215,40 @@ declare class MiddlewareHandler<M extends Function> {
2244
2215
  length(): number;
2245
2216
  }
2246
2217
 
2218
+ declare type Model = ReadonlyDeep_2<{
2219
+ name: string;
2220
+ dbName: string | null;
2221
+ schema: string | null;
2222
+ fields: Field[];
2223
+ uniqueFields: string[][];
2224
+ uniqueIndexes: uniqueIndex[];
2225
+ documentation?: string;
2226
+ primaryKey: PrimaryKey | null;
2227
+ isGenerated?: boolean;
2228
+ }>;
2229
+
2230
+ declare enum ModelAction {
2231
+ findUnique = "findUnique",
2232
+ findUniqueOrThrow = "findUniqueOrThrow",
2233
+ findFirst = "findFirst",
2234
+ findFirstOrThrow = "findFirstOrThrow",
2235
+ findMany = "findMany",
2236
+ create = "create",
2237
+ createMany = "createMany",
2238
+ createManyAndReturn = "createManyAndReturn",
2239
+ update = "update",
2240
+ updateMany = "updateMany",
2241
+ updateManyAndReturn = "updateManyAndReturn",
2242
+ upsert = "upsert",
2243
+ delete = "delete",
2244
+ deleteMany = "deleteMany",
2245
+ groupBy = "groupBy",
2246
+ count = "count",// TODO: count does not actually exist in DMMF
2247
+ aggregate = "aggregate",
2248
+ findRaw = "findRaw",
2249
+ aggregateRaw = "aggregateRaw"
2250
+ }
2251
+
2247
2252
  export declare type ModelArg = {
2248
2253
  [MethodName in string]: unknown;
2249
2254
  };
@@ -2256,6 +2261,30 @@ export declare type ModelArgs = {
2256
2261
 
2257
2262
  export declare type ModelKey<TypeMap extends TypeMapDef, M extends PropertyKey> = M extends keyof TypeMap['model'] ? M : Capitalize<M & string>;
2258
2263
 
2264
+ declare type ModelMapping = ReadonlyDeep_2<{
2265
+ model: string;
2266
+ plural: string;
2267
+ findUnique?: string | null;
2268
+ findUniqueOrThrow?: string | null;
2269
+ findFirst?: string | null;
2270
+ findFirstOrThrow?: string | null;
2271
+ findMany?: string | null;
2272
+ create?: string | null;
2273
+ createMany?: string | null;
2274
+ createManyAndReturn?: string | null;
2275
+ update?: string | null;
2276
+ updateMany?: string | null;
2277
+ updateManyAndReturn?: string | null;
2278
+ upsert?: string | null;
2279
+ delete?: string | null;
2280
+ deleteMany?: string | null;
2281
+ aggregate?: string | null;
2282
+ groupBy?: string | null;
2283
+ count?: string | null;
2284
+ findRaw?: string | null;
2285
+ aggregateRaw?: string | null;
2286
+ }>;
2287
+
2259
2288
  export declare type ModelQueryOptionsCb = (args: ModelQueryOptionsCbArgs) => Promise<any>;
2260
2289
 
2261
2290
  export declare type ModelQueryOptionsCbArgs = {
@@ -2265,6 +2294,11 @@ export declare type ModelQueryOptionsCbArgs = {
2265
2294
  query: (args: JsArgs) => Promise<unknown>;
2266
2295
  };
2267
2296
 
2297
+ declare type MultiBatchResponse = {
2298
+ type: 'multi';
2299
+ plans: object[];
2300
+ };
2301
+
2268
2302
  export declare type NameArgs = {
2269
2303
  name?: string;
2270
2304
  };
@@ -2281,11 +2315,6 @@ declare class NullTypesEnumValue extends ObjectEnumValue {
2281
2315
  _getNamespace(): string;
2282
2316
  }
2283
2317
 
2284
- /**
2285
- * List of Prisma enums that must use unique objects instead of strings as their values.
2286
- */
2287
- export declare const objectEnumNames: string[];
2288
-
2289
2318
  /**
2290
2319
  * Base class for unique values of object-valued enums.
2291
2320
  */
@@ -2364,6 +2393,18 @@ export declare type Or<A extends 1 | 0, B extends 1 | 0> = {
2364
2393
  };
2365
2394
  }[A][B];
2366
2395
 
2396
+ declare type OtherOperationMappings = ReadonlyDeep_2<{
2397
+ read: string[];
2398
+ write: string[];
2399
+ }>;
2400
+
2401
+ declare type OutputType = ReadonlyDeep_2<{
2402
+ name: string;
2403
+ fields: SchemaField[];
2404
+ }>;
2405
+
2406
+ declare type OutputTypeRef = TypeRef<'scalar' | 'outputObjectTypes' | 'enumTypes'>;
2407
+
2367
2408
  export declare function Param<$Type, $Value extends string>(name: $Value): Param<$Type, $Value>;
2368
2409
 
2369
2410
  export declare type Param<out $Type, $Value extends string> = {
@@ -2391,6 +2432,11 @@ declare type Pick_2<T, K extends string | number | symbol> = {
2391
2432
  };
2392
2433
  export { Pick_2 as Pick }
2393
2434
 
2435
+ declare type PrimaryKey = ReadonlyDeep_2<{
2436
+ name: string | null;
2437
+ fields: string[];
2438
+ }>;
2439
+
2394
2440
  export declare class PrismaClientInitializationError extends Error {
2395
2441
  clientVersion: string;
2396
2442
  errorCode?: string;
@@ -2416,7 +2462,7 @@ export declare type PrismaClientOptions = {
2416
2462
  /**
2417
2463
  * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale.
2418
2464
  */
2419
- adapter?: DriverAdapter | null;
2465
+ adapter?: SqlDriverAdapterFactory | null;
2420
2466
  /**
2421
2467
  * Overwrites the datasource url from your schema.prisma file
2422
2468
  */
@@ -2581,6 +2627,12 @@ declare namespace Public_2 {
2581
2627
  }
2582
2628
  }
2583
2629
 
2630
+ declare type Query = ReadonlyDeep_2<{
2631
+ name: string;
2632
+ args: SchemaArg[];
2633
+ output: QueryOutput;
2634
+ }>;
2635
+
2584
2636
  declare interface Queryable<Query, Result> extends AdapterInfo {
2585
2637
  /**
2586
2638
  * Execute a query and return its result.
@@ -2594,6 +2646,7 @@ declare interface Queryable<Query, Result> extends AdapterInfo {
2594
2646
 
2595
2647
  declare type QueryCompiler = {
2596
2648
  compile(request: string): Promise<string>;
2649
+ compileBatch(batchRequest: string): Promise<BatchResponse>;
2597
2650
  };
2598
2651
 
2599
2652
  declare interface QueryCompilerConstructor {
@@ -2609,7 +2662,7 @@ declare type QueryCompilerOptions = {
2609
2662
  declare type QueryEngineBatchGraphQLRequest = {
2610
2663
  batch: QueryEngineRequest[];
2611
2664
  transaction?: boolean;
2612
- isolationLevel?: Transaction_2.IsolationLevel;
2665
+ isolationLevel?: IsolationLevel;
2613
2666
  };
2614
2667
 
2615
2668
  declare type QueryEngineBatchRequest = QueryEngineBatchGraphQLRequest | JsonBatchQuery;
@@ -2622,12 +2675,12 @@ declare type QueryEngineConfig = {
2622
2675
  datasourceOverrides: Record<string, string>;
2623
2676
  env: Record<string, string | undefined>;
2624
2677
  logLevel: QueryEngineLogLevel;
2625
- engineProtocol: EngineProtocol;
2678
+ engineProtocol: QueryEngineProtocol;
2626
2679
  enableTracing: boolean;
2627
2680
  };
2628
2681
 
2629
2682
  declare interface QueryEngineConstructor {
2630
- new (config: QueryEngineConfig, logger: (log: string) => void, adapter?: ErrorCapturingSqlConnection): QueryEngineInstance;
2683
+ new (config: QueryEngineConfig, logger: (log: string) => void, adapter?: ErrorCapturingSqlDriverAdapter): QueryEngineInstance;
2631
2684
  }
2632
2685
 
2633
2686
  declare type QueryEngineInstance = {
@@ -2649,6 +2702,8 @@ declare type QueryEngineInstance = {
2649
2702
 
2650
2703
  declare type QueryEngineLogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'off';
2651
2704
 
2705
+ declare type QueryEngineProtocol = 'graphql' | 'json';
2706
+
2652
2707
  declare type QueryEngineRequest = {
2653
2708
  query: string;
2654
2709
  variables: Object;
@@ -2701,6 +2756,12 @@ export declare type QueryOptionsCbArgs = {
2701
2756
  query: (args: JsArgs | RawQueryArgs) => Promise<unknown>;
2702
2757
  };
2703
2758
 
2759
+ declare type QueryOutput = ReadonlyDeep_2<{
2760
+ name: string;
2761
+ isRequired: boolean;
2762
+ isList: boolean;
2763
+ }>;
2764
+
2704
2765
  /**
2705
2766
  * Create raw SQL statement.
2706
2767
  */
@@ -2841,8 +2902,6 @@ export declare type Result_2<T, A, F extends Operation> = Result<T, A, F>;
2841
2902
 
2842
2903
  declare namespace Result_3 {
2843
2904
  export {
2844
- Operation,
2845
- FluentOperation,
2846
2905
  Count,
2847
2906
  GetFindResult,
2848
2907
  SelectablePayloadFields,
@@ -2899,12 +2958,55 @@ export declare type RuntimeDataModel = {
2899
2958
  readonly types: Record<string, RuntimeModel>;
2900
2959
  };
2901
2960
 
2902
- declare type RuntimeEnum = Omit<DMMF.DatamodelEnum, 'name'>;
2961
+ declare type RuntimeEnum = Omit<DMMF_2.DatamodelEnum, 'name'>;
2903
2962
 
2904
- declare type RuntimeModel = Omit<DMMF.Model, 'name'>;
2963
+ declare type RuntimeModel = Omit<DMMF_2.Model, 'name'>;
2905
2964
 
2906
2965
  declare type RuntimeName = 'workerd' | 'deno' | 'netlify' | 'node' | 'bun' | 'edge-light' | '';
2907
2966
 
2967
+ declare type Schema = ReadonlyDeep_2<{
2968
+ rootQueryType?: string;
2969
+ rootMutationType?: string;
2970
+ inputObjectTypes: {
2971
+ model?: InputType[];
2972
+ prisma: InputType[];
2973
+ };
2974
+ outputObjectTypes: {
2975
+ model: OutputType[];
2976
+ prisma: OutputType[];
2977
+ };
2978
+ enumTypes: {
2979
+ model?: SchemaEnum[];
2980
+ prisma: SchemaEnum[];
2981
+ };
2982
+ fieldRefTypes: {
2983
+ prisma?: FieldRefType[];
2984
+ };
2985
+ }>;
2986
+
2987
+ declare type SchemaArg = ReadonlyDeep_2<{
2988
+ name: string;
2989
+ comment?: string;
2990
+ isNullable: boolean;
2991
+ isRequired: boolean;
2992
+ inputTypes: InputTypeRef[];
2993
+ deprecation?: Deprecation;
2994
+ }>;
2995
+
2996
+ declare type SchemaEnum = ReadonlyDeep_2<{
2997
+ name: string;
2998
+ values: string[];
2999
+ }>;
3000
+
3001
+ declare type SchemaField = ReadonlyDeep_2<{
3002
+ name: string;
3003
+ isNullable?: boolean;
3004
+ outputType: OutputTypeRef;
3005
+ args: SchemaArg[];
3006
+ deprecation?: Deprecation;
3007
+ documentation?: string;
3008
+ }>;
3009
+
2908
3010
  export declare type Select<T, U> = T extends U ? T : never;
2909
3011
 
2910
3012
  export declare type SelectablePayloadFields<K extends PropertyKey, O> = {
@@ -2949,6 +3051,8 @@ declare class Skip {
2949
3051
 
2950
3052
  export declare const skip: Skip;
2951
3053
 
3054
+ declare type SortOrder = 'asc' | 'desc';
3055
+
2952
3056
  /**
2953
3057
  * An interface that represents a span. A span represents a single operation
2954
3058
  * within a trace. Examples of span might include remote procedure calls or a
@@ -3217,6 +3321,29 @@ export declare class Sql {
3217
3321
  };
3218
3322
  }
3219
3323
 
3324
+ declare interface SqlDriverAdapter extends SqlQueryable {
3325
+ /**
3326
+ * Execute multiple SQL statements separated by semicolon.
3327
+ */
3328
+ executeScript(script: string): Promise<void>;
3329
+ /**
3330
+ * Start new transaction.
3331
+ */
3332
+ startTransaction(isolationLevel?: IsolationLevel): Promise<Transaction>;
3333
+ /**
3334
+ * Optional method that returns extra connection info
3335
+ */
3336
+ getConnectionInfo?(): ConnectionInfo;
3337
+ /**
3338
+ * Dispose of the connection and release any resources.
3339
+ */
3340
+ dispose(): Promise<void>;
3341
+ }
3342
+
3343
+ export declare interface SqlDriverAdapterFactory extends DriverAdapterFactory<SqlQuery, SqlResultSet> {
3344
+ connect(): Promise<SqlDriverAdapter>;
3345
+ }
3346
+
3220
3347
  declare type SqlQuery = {
3221
3348
  sql: string;
3222
3349
  args: Array<unknown>;
@@ -3325,20 +3452,12 @@ declare interface Transaction extends AdapterInfo, SqlQueryable {
3325
3452
 
3326
3453
  declare namespace Transaction_2 {
3327
3454
  export {
3328
- IsolationLevel,
3329
3455
  TransactionOptions_2 as Options,
3330
3456
  InteractiveTransactionInfo,
3331
3457
  TransactionHeaders
3332
3458
  }
3333
3459
  }
3334
3460
 
3335
- declare interface TransactionContext extends AdapterInfo, SqlQueryable {
3336
- /**
3337
- * Start new transaction.
3338
- */
3339
- startTransaction(): Promise<Transaction>;
3340
- }
3341
-
3342
3461
  declare type TransactionHeaders = {
3343
3462
  traceparent?: string;
3344
3463
  };
@@ -3375,6 +3494,13 @@ export declare type TypeMapCbDef = Fn<{
3375
3494
  /** Shared */
3376
3495
  export declare type TypeMapDef = Record<any, any>;
3377
3496
 
3497
+ declare type TypeRef<AllowedLocations extends FieldLocation> = {
3498
+ isList: boolean;
3499
+ type: string;
3500
+ location: AllowedLocations;
3501
+ namespace?: FieldNamespace;
3502
+ };
3503
+
3378
3504
  declare namespace Types {
3379
3505
  export {
3380
3506
  Result_3 as Result,
@@ -3390,6 +3516,11 @@ declare namespace Types {
3390
3516
  }
3391
3517
  export { Types }
3392
3518
 
3519
+ declare type uniqueIndex = ReadonlyDeep_2<{
3520
+ name: string;
3521
+ fields: string[];
3522
+ }>;
3523
+
3393
3524
  declare type UnknownErrorParams = {
3394
3525
  clientVersion: string;
3395
3526
  batchRequestIdx?: number;