@danielcok17/prisma-db 1.0.1 → 1.0.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.
Files changed (43) hide show
  1. package/README.md +99 -8
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +1 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/paths.d.ts +4 -0
  7. package/dist/paths.d.ts.map +1 -0
  8. package/dist/paths.js +12 -0
  9. package/dist/paths.js.map +1 -0
  10. package/package.json +3 -3
  11. package/prisma/app.prisma +148 -72
  12. package/prisma/generated/app/edge.js +67 -11
  13. package/prisma/generated/app/index-browser.js +62 -6
  14. package/prisma/generated/app/index.d.ts +5386 -292
  15. package/prisma/generated/app/index.js +67 -11
  16. package/prisma/generated/app/libquery_engine-darwin-arm64.dylib.node +0 -0
  17. package/prisma/generated/app/package.json +2 -2
  18. package/prisma/generated/app/runtime/edge-esm.js +3 -3
  19. package/prisma/generated/app/runtime/edge.js +3 -3
  20. package/prisma/generated/app/runtime/library.d.ts +66 -92
  21. package/prisma/generated/app/runtime/library.js +21 -21
  22. package/prisma/generated/app/runtime/react-native.js +13 -13
  23. package/prisma/generated/app/runtime/wasm-compiler-edge.js +27 -27
  24. package/prisma/generated/app/runtime/wasm-engine-edge.js +13 -13
  25. package/prisma/generated/app/schema.prisma +99 -21
  26. package/prisma/generated/app/wasm.js +62 -6
  27. package/prisma/generated/law/edge.js +6 -6
  28. package/prisma/generated/law/index-browser.js +4 -4
  29. package/prisma/generated/law/index.d.ts +2 -2
  30. package/prisma/generated/law/index.js +6 -6
  31. package/prisma/generated/law/libquery_engine-darwin-arm64.dylib.node +0 -0
  32. package/prisma/generated/law/package.json +1 -1
  33. package/prisma/generated/law/runtime/edge-esm.js +3 -3
  34. package/prisma/generated/law/runtime/edge.js +3 -3
  35. package/prisma/generated/law/runtime/library.d.ts +66 -92
  36. package/prisma/generated/law/runtime/library.js +21 -21
  37. package/prisma/generated/law/runtime/react-native.js +13 -13
  38. package/prisma/generated/law/runtime/wasm-compiler-edge.js +27 -27
  39. package/prisma/generated/law/runtime/wasm-engine-edge.js +13 -13
  40. package/prisma/generated/law/wasm.js +4 -4
  41. package/prisma/migrations/20250818134929_init/migration.sql +374 -0
  42. package/prisma/migrations/20250903104817_add_workflow_log/migration.sql +103 -0
  43. package/prisma/migrations/20250817194531_/migration.sql +0 -372
@@ -21,6 +21,29 @@ declare type AccelerateEngineConfig = {
21
21
  accelerateUtils?: AccelerateUtils;
22
22
  };
23
23
 
24
+ /**
25
+ * A stripped down interface of `fetch` that `@prisma/extension-accelerate`
26
+ * relies on. It must be in sync with the corresponding definition in the
27
+ * Accelerate extension.
28
+ *
29
+ * This is the actual interface exposed by the extension. We can't use the
30
+ * custom fetch function provided by it as normal fetch because the API is
31
+ * different. Notably, `headers` must be an object and not a `Headers`
32
+ * instance, and `url` must be a `string` and not a `URL`.
33
+ *
34
+ * The return type is `Response` but we can't specify this in an exported type
35
+ * because it would end up referencing external types from `@types/node` or DOM
36
+ * which can fail typechecking depending on TypeScript configuration in a user's
37
+ * project.
38
+ */
39
+ declare type AccelerateExtensionFetch = (url: string, options: {
40
+ body?: string;
41
+ method?: string;
42
+ headers: Record<string, string>;
43
+ }) => Promise<unknown>;
44
+
45
+ declare type AccelerateExtensionFetchDecorator = (fetch: AccelerateExtensionFetch) => AccelerateExtensionFetch;
46
+
24
47
  declare type AccelerateUtils = EngineConfig['accelerateUtils'];
25
48
 
26
49
  export declare type Action = keyof typeof DMMF_2.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw';
@@ -68,12 +91,15 @@ export declare type Args<T, F extends Operation> = T extends {
68
91
 
69
92
  export declare type Args_3<T, F extends Operation> = Args<T, F>;
70
93
 
71
- /**
72
- * Original `quaint::ValueType` enum tag from Prisma's `quaint`.
73
- * Query arguments marked with this type are sanitized before being sent to the database.
74
- * Notice while a query argument may be `null`, `ArgType` is guaranteed to be defined.
75
- */
76
- declare type ArgType = 'Int32' | 'Int64' | 'Float' | 'Double' | 'Text' | 'Enum' | 'EnumArray' | 'Bytes' | 'Boolean' | 'Char' | 'Array' | 'Numeric' | 'Json' | 'Xml' | 'Uuid' | 'DateTime' | 'Date' | 'Time' | 'Unknown';
94
+ declare type ArgScalarType = 'string' | 'int' | 'bigint' | 'float' | 'decimal' | 'boolean' | 'enum' | 'uuid' | 'json' | 'datetime' | 'bytes' | 'unknown';
95
+
96
+ declare type ArgType = {
97
+ scalarType: ArgScalarType;
98
+ dbType?: string;
99
+ arity: Arity;
100
+ };
101
+
102
+ declare type Arity = 'scalar' | 'list';
77
103
 
78
104
  /**
79
105
  * Attributes is a map from string to attribute values.
@@ -104,7 +130,7 @@ declare type BatchArgs = {
104
130
 
105
131
  declare type BatchInternalParams = {
106
132
  requests: RequestParams[];
107
- customDataProxyFetch?: CustomDataProxyFetch;
133
+ customDataProxyFetch?: AccelerateExtensionFetchDecorator;
108
134
  };
109
135
 
110
136
  declare type BatchQuery = {
@@ -310,37 +336,6 @@ export declare type Count<O> = {
310
336
 
311
337
  export declare function createParam(name: string): Param<unknown, string>;
312
338
 
313
- /**
314
- * Custom fetch function for `DataProxyEngine`.
315
- *
316
- * We can't use the actual type of `globalThis.fetch` because this will result
317
- * in API Extractor referencing Node.js type definitions in the `.d.ts` bundle
318
- * for the client runtime. We can only use such types in internal types that
319
- * don't end up exported anywhere.
320
-
321
- * It's also not possible to write a definition of `fetch` that would accept the
322
- * actual `fetch` function from different environments such as Node.js and
323
- * Cloudflare Workers (with their extensions to `RequestInit` and `Response`).
324
- * `fetch` is used in both covariant and contravariant positions in
325
- * `CustomDataProxyFetch`, making it invariant, so we need the exact same type.
326
- * Even if we removed the argument and left `fetch` in covariant position only,
327
- * then for an extension-supplied function to be assignable to `customDataProxyFetch`,
328
- * the platform-specific (or custom) `fetch` function needs to be assignable
329
- * to our `fetch` definition. This, in turn, requires the third-party `Response`
330
- * to be a subtype of our `Response` (which is not a problem, we could declare
331
- * a minimal `Response` type that only includes what we use) *and* requires the
332
- * third-party `RequestInit` to be a supertype of our `RequestInit` (i.e. we
333
- * have to declare all properties any `RequestInit` implementation in existence
334
- * could possibly have), which is not possible.
335
- *
336
- * Since `@prisma/extension-accelerate` redefines the type of
337
- * `__internalParams.customDataProxyFetch` to its own type anyway (probably for
338
- * exactly this reason), our definition is never actually used and is completely
339
- * ignored, so it doesn't matter, and we can just use `unknown` as the type of
340
- * `fetch` here.
341
- */
342
- declare type CustomDataProxyFetch = (fetch: unknown) => unknown;
343
-
344
339
  declare class DataLoader<T = unknown> {
345
340
  private options;
346
341
  batches: {
@@ -857,6 +852,11 @@ declare interface DriverAdapterFactory<Query, Result> extends AdapterInfo {
857
852
  connect(): Promise<Queryable<Query, Result>>;
858
853
  }
859
854
 
855
+ declare type DynamicArgType = ArgType | {
856
+ arity: 'tuple';
857
+ elements: ArgType[];
858
+ };
859
+
860
860
  /** Client */
861
861
  export declare type DynamicClientExtensionArgs<C_, TypeMap extends TypeMapDef, TypeMapCb extends TypeMapCbDef, ExtArgs extends Record<string, any>> = {
862
862
  [P in keyof C_]: unknown;
@@ -1407,6 +1407,20 @@ declare type FieldRefType = ReadonlyDeep_2<{
1407
1407
  fields: SchemaArg[];
1408
1408
  }>;
1409
1409
 
1410
+ declare type FieldScalarType = {
1411
+ type: 'string' | 'int' | 'bigint' | 'float' | 'boolean' | 'json' | 'object' | 'datetime' | 'decimal' | 'unsupported';
1412
+ } | {
1413
+ type: 'enum';
1414
+ name: string;
1415
+ } | {
1416
+ type: 'bytes';
1417
+ encoding: 'array' | 'base64' | 'hex';
1418
+ };
1419
+
1420
+ declare type FieldType = {
1421
+ arity: Arity;
1422
+ } & FieldScalarType;
1423
+
1410
1424
  declare type FluentOperation = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'create' | 'update' | 'upsert' | 'delete';
1411
1425
 
1412
1426
  export declare interface Fn<Params = unknown, Returns = unknown> {
@@ -1943,7 +1957,7 @@ declare type InternalRequestParams = {
1943
1957
  /** Used to convert args for middleware and back */
1944
1958
  middlewareArgsMapper?: MiddlewareArgsMapper<unknown, unknown>;
1945
1959
  /** Used for Accelerate client extension via Data Proxy */
1946
- customDataProxyFetch?: CustomDataProxyFetch;
1960
+ customDataProxyFetch?: AccelerateExtensionFetchDecorator;
1947
1961
  } & Omit<QueryMiddlewareParams, 'runInTransaction'>;
1948
1962
 
1949
1963
  declare type IsolationLevel = 'READ UNCOMMITTED' | 'READ COMMITTED' | 'REPEATABLE READ' | 'SNAPSHOT' | 'SERIALIZABLE';
@@ -2764,17 +2778,7 @@ declare type PrismaPromiseInteractiveTransaction<PayloadType = unknown> = {
2764
2778
 
2765
2779
  declare type PrismaPromiseTransaction<PayloadType = unknown> = PrismaPromiseBatchTransaction | PrismaPromiseInteractiveTransaction<PayloadType>;
2766
2780
 
2767
- declare type PrismaValue = string | boolean | number | PrismaValue[] | null | Record<string, unknown> | PrismaValuePlaceholder | PrismaValueGenerator | PrismaValueBytes | PrismaValueBigInt;
2768
-
2769
- declare type PrismaValueBigInt = {
2770
- prisma__type: 'bigint';
2771
- prisma__value: string;
2772
- };
2773
-
2774
- declare type PrismaValueBytes = {
2775
- prisma__type: 'bytes';
2776
- prisma__value: string;
2777
- };
2781
+ declare type PrismaValue = string | boolean | number | PrismaValue[] | null | Record<string, unknown> | PrismaValuePlaceholder | PrismaValueGenerator;
2778
2782
 
2779
2783
  declare type PrismaValueGenerator = {
2780
2784
  prisma__type: 'generatorCall';
@@ -2792,38 +2796,6 @@ declare type PrismaValuePlaceholder = {
2792
2796
  };
2793
2797
  };
2794
2798
 
2795
- declare type PrismaValueType = {
2796
- type: 'Any';
2797
- } | {
2798
- type: 'String';
2799
- } | {
2800
- type: 'Int';
2801
- } | {
2802
- type: 'BigInt';
2803
- } | {
2804
- type: 'Float';
2805
- } | {
2806
- type: 'Boolean';
2807
- } | {
2808
- type: 'Decimal';
2809
- } | {
2810
- type: 'Date';
2811
- } | {
2812
- type: 'Time';
2813
- } | {
2814
- type: 'Array';
2815
- inner: PrismaValueType;
2816
- } | {
2817
- type: 'Json';
2818
- } | {
2819
- type: 'Object';
2820
- } | {
2821
- type: 'Bytes';
2822
- } | {
2823
- type: 'Enum';
2824
- inner: string;
2825
- };
2826
-
2827
2799
  export declare const PrivateResultType: unique symbol;
2828
2800
 
2829
2801
  declare type Provider = 'mysql' | 'postgres' | 'sqlite' | 'sqlserver';
@@ -2993,12 +2965,14 @@ declare type QueryPlanBinding = {
2993
2965
  declare type QueryPlanDbQuery = {
2994
2966
  type: 'rawSql';
2995
2967
  sql: string;
2996
- params: PrismaValue[];
2968
+ args: PrismaValue[];
2969
+ argTypes: ArgType[];
2997
2970
  } | {
2998
2971
  type: 'templateSql';
2999
2972
  fragments: Fragment[];
3000
2973
  placeholderFormat: PlaceholderFormat;
3001
- params: PrismaValue[];
2974
+ args: PrismaValue[];
2975
+ argTypes: DynamicArgType[];
3002
2976
  chunkable: boolean;
3003
2977
  };
3004
2978
 
@@ -3159,7 +3133,7 @@ declare type RequestBatchOptions<InteractiveTransactionPayload> = {
3159
3133
  traceparent?: string;
3160
3134
  numTry?: number;
3161
3135
  containsWrite: boolean;
3162
- customDataProxyFetch?: CustomDataProxyFetch;
3136
+ customDataProxyFetch?: AccelerateExtensionFetchDecorator;
3163
3137
  };
3164
3138
 
3165
3139
  declare interface RequestError {
@@ -3196,7 +3170,7 @@ declare type RequestOptions<InteractiveTransactionPayload> = {
3196
3170
  numTry?: number;
3197
3171
  interactiveTransaction?: InteractiveTransactionOptions<InteractiveTransactionPayload>;
3198
3172
  isWrite: boolean;
3199
- customDataProxyFetch?: CustomDataProxyFetch;
3173
+ customDataProxyFetch?: AccelerateExtensionFetchDecorator;
3200
3174
  };
3201
3175
 
3202
3176
  declare type RequestParams = {
@@ -3214,7 +3188,7 @@ declare type RequestParams = {
3214
3188
  otelParentCtx?: Context;
3215
3189
  otelChildCtx?: Context;
3216
3190
  globalOmit?: GlobalOmitOptions;
3217
- customDataProxyFetch?: CustomDataProxyFetch;
3191
+ customDataProxyFetch?: AccelerateExtensionFetchDecorator;
3218
3192
  };
3219
3193
 
3220
3194
  declare type RequiredExtensionArgs = NameArgs & ResultArgs & ModelArgs & ClientArgs & QueryOptions;
@@ -3298,16 +3272,16 @@ export declare type ResultFieldDefinition = {
3298
3272
  };
3299
3273
 
3300
3274
  declare type ResultNode = {
3301
- type: 'AffectedRows';
3275
+ type: 'affectedRows';
3302
3276
  } | {
3303
- type: 'Object';
3277
+ type: 'object';
3304
3278
  fields: Record<string, ResultNode>;
3305
3279
  serializedName: string | null;
3306
3280
  skipNulls: boolean;
3307
3281
  } | {
3308
- type: 'Value';
3282
+ type: 'field';
3309
3283
  dbName: string;
3310
- resultType: PrismaValueType;
3284
+ fieldType: FieldType;
3311
3285
  };
3312
3286
 
3313
3287
  export declare type Return<T> = T extends (...args: any[]) => infer R ? R : T;
@@ -3329,7 +3303,7 @@ declare type Schema = ReadonlyDeep_2<{
3329
3303
  rootMutationType?: string;
3330
3304
  inputObjectTypes: {
3331
3305
  model?: InputType[];
3332
- prisma: InputType[];
3306
+ prisma?: InputType[];
3333
3307
  };
3334
3308
  outputObjectTypes: {
3335
3309
  model: OutputType[];