@vsrepo/prisma7-adapter 1.3.1 → 2.0.0-dev

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 (77) hide show
  1. package/CHANGELOG.md +417 -0
  2. package/LICENSE +20 -20
  3. package/README.md +303 -299
  4. package/README.pt-BR.md +303 -299
  5. package/dist/constants/provider-capabilities.constant.d.ts +17 -0
  6. package/dist/constants/provider-capabilities.constant.js +27 -0
  7. package/dist/index.d.ts +8 -8
  8. package/dist/index.js +1 -7
  9. package/dist/parsers/data.parser.d.ts +3 -33
  10. package/dist/parsers/data.parser.js +7 -45
  11. package/dist/parsers/include.parser.d.ts +1 -1
  12. package/dist/parsers/include.parser.js +3 -7
  13. package/dist/parsers/order-by.parser.d.ts +2 -10
  14. package/dist/parsers/order-by.parser.js +6 -19
  15. package/dist/parsers/select.parser.d.ts +1 -1
  16. package/dist/parsers/select.parser.js +3 -7
  17. package/dist/parsers/where.parser.d.ts +4 -28
  18. package/dist/parsers/where.parser.js +49 -151
  19. package/dist/prisma7.adapter.d.ts +104 -81
  20. package/dist/prisma7.adapter.js +329 -362
  21. package/dist/resolvers/map-prisma-error.resolver.d.ts +0 -11
  22. package/dist/resolvers/map-prisma-error.resolver.js +48 -72
  23. package/dist/resolvers/merge-entities.resolver.d.ts +11 -15
  24. package/dist/resolvers/merge-entities.resolver.js +29 -38
  25. package/dist/resolvers/resolve-provider.resolver.d.ts +2 -22
  26. package/dist/resolvers/resolve-provider.resolver.js +10 -33
  27. package/dist/types/adapter-config.type.d.ts +7 -12
  28. package/dist/types/adapter-config.type.js +1 -3
  29. package/dist/types/adapter-relations.type.d.ts +2 -2
  30. package/dist/types/adapter-relations.type.js +1 -3
  31. package/dist/types/plain-object.type.js +1 -3
  32. package/dist/types/prisma-arg-like.type.js +1 -3
  33. package/dist/types/prisma-client-models.type.d.ts +4 -4
  34. package/dist/types/prisma-client-models.type.js +1 -3
  35. package/dist/types/prisma-provider.type.d.ts +1 -1
  36. package/dist/types/prisma-provider.type.js +1 -3
  37. package/dist/types/prisma-repository-like.type.d.ts +1 -1
  38. package/dist/types/prisma-repository-like.type.js +1 -3
  39. package/dist/types/prisma7-client-like.type.d.ts +1 -8
  40. package/dist/types/prisma7-client-like.type.js +1 -3
  41. package/dist/types/prisma7-orm-types.type.d.ts +2 -2
  42. package/dist/types/prisma7-orm-types.type.js +1 -3
  43. package/dist/types/relation.type.d.ts +25 -19
  44. package/dist/types/relation.type.js +1 -3
  45. package/dist/validators/is-decimal.validator.d.ts +2 -5
  46. package/dist/validators/is-decimal.validator.js +3 -6
  47. package/dist/validators/is-plain-object.validator.d.ts +1 -1
  48. package/dist/validators/is-plain-object.validator.js +3 -7
  49. package/dist/validators/validate-prisma-client.validator.d.ts +1 -14
  50. package/dist/validators/validate-prisma-client.validator.js +7 -24
  51. package/package.json +108 -91
  52. package/dist/index.js.map +0 -1
  53. package/dist/parsers/data.parser.js.map +0 -1
  54. package/dist/parsers/include.parser.js.map +0 -1
  55. package/dist/parsers/order-by.parser.js.map +0 -1
  56. package/dist/parsers/select.parser.js.map +0 -1
  57. package/dist/parsers/where.parser.js.map +0 -1
  58. package/dist/prisma7.adapter.js.map +0 -1
  59. package/dist/resolvers/map-prisma-error.resolver.js.map +0 -1
  60. package/dist/resolvers/merge-entities.resolver.js.map +0 -1
  61. package/dist/resolvers/resolve-provider.resolver.js.map +0 -1
  62. package/dist/types/adapter-config.type.js.map +0 -1
  63. package/dist/types/adapter-relations.type.js.map +0 -1
  64. package/dist/types/plain-object.type.js.map +0 -1
  65. package/dist/types/prisma-arg-like.type.js.map +0 -1
  66. package/dist/types/prisma-client-models.type.js.map +0 -1
  67. package/dist/types/prisma-provider.type.js.map +0 -1
  68. package/dist/types/prisma-repository-like.type.js.map +0 -1
  69. package/dist/types/prisma7-client-like.type.js.map +0 -1
  70. package/dist/types/prisma7-orm-types.type.js.map +0 -1
  71. package/dist/types/relation.type.js.map +0 -1
  72. package/dist/validators/is-decimal.validator.js.map +0 -1
  73. package/dist/validators/is-plain-object.validator.js.map +0 -1
  74. package/dist/validators/validate-adapter-config.validator.d.ts +0 -8
  75. package/dist/validators/validate-adapter-config.validator.js +0 -78
  76. package/dist/validators/validate-adapter-config.validator.js.map +0 -1
  77. package/dist/validators/validate-prisma-client.validator.js.map +0 -1
@@ -1,18 +1,8 @@
1
- import { AdapterMethodOptions, AdapterQueryOptions, CountResult, DeepPartial, NumericKeys, VSRepoAdapter, VSRepoTransactionOptions, VSRepoWhere } from "vsrepo";
2
- import { VSRepoPrisma7AdapterConfig } from "./types/adapter-config.type";
3
- import { Prisma7ClientLike } from "./types/prisma7-client-like.type";
1
+ import { AdapterMethodOptions, AdapterQueryOptions, CountResult, DeepPartial, NumericKeys, RestrictAdapterMethodOptions, SimpleAdapterMethodOptions, VSRepoAdapter, VSRepoTransactionOptions, VSRepoWhere, WithIgnoreConflicts } from "vsrepo";
2
+ import { Prisma7AdapterConfig } from "./types/adapter-config.type.js";
3
+ import { Prisma7ClientLike } from "./types/prisma7-client-like.type.js";
4
4
  /**
5
- * `VSRepoAdapter` implementation for Prisma 7. Translates every method of the
6
- * adapter contract into Prisma Client calls, resolving `VSRepoWhere`/`Ordering`/
7
- * `select`/`include` through the parsers, and — when a
8
- * `relations` config is provided — resolving relation fields on `create`/
9
- * `update`/`upsert`/`merge` the same way the v1 of VSRepository did (see
10
- * `Relation`).
11
- *
12
- * Every method always rejects with a `VSRepoAdapterError` — any error raised
13
- * by Prisma (or by the adapter itself) is translated through `mapPrismaError`
14
- * before leaving the adapter, so callers never have to deal with a raw
15
- * Prisma/driver error shape.
5
+ * `VSRepoAdapter` implementation for Prisma 7.
16
6
  *
17
7
  * @template T Entity type this adapter operates on.
18
8
  *
@@ -20,15 +10,27 @@ import { Prisma7ClientLike } from "./types/prisma7-client-like.type";
20
10
  */
21
11
  export declare class VSRepoPrisma7Adapter<T, K extends Prisma7ClientLike = Prisma7ClientLike> extends VSRepoAdapter<T> {
22
12
  private readonly prisma;
23
- private readonly tableName;
13
+ private readonly modelName;
24
14
  private readonly pkName;
25
15
  private readonly relations?;
26
16
  private readonly logger;
27
17
  private readonly provider;
28
- constructor(prisma: K, config: VSRepoPrisma7AdapterConfig<T, K>);
18
+ constructor(prisma: K, config: Prisma7AdapterConfig<T, K>);
29
19
  private getPrismaRepository;
30
20
  /** Resolves the "read" part of a Prisma arg: select/include/orderBy/pagination. */
31
21
  private resolveReadArg;
22
+ /** Parses a `where` for this adapter's provider (rejecting what the provider cannot run). */
23
+ private parseWhere;
24
+ /**
25
+ * `createManyReturning` and `updateManyReturning` rely on Prisma's `createManyAndReturn` /
26
+ * `updateManyAndReturn`, which only exist on PostgreSQL, CockroachDB and SQLite.
27
+ */
28
+ private assertReturningManySupported;
29
+ /**
30
+ * `ignoreConflicts` is translated to Prisma's `skipDuplicates`, which isn't available on
31
+ * SQL Server and SQLite. Rejects with `NOT_SUPPORTED` instead of leaving it to Prisma.
32
+ */
33
+ private assertIgnoreConflictsSupported;
32
34
  /**
33
35
  * Strips relation fields from a payload — used by `createMany`/`updateMany`/
34
36
  * `updateManyReturning`, since those Prisma operations don't support nested
@@ -58,13 +60,14 @@ export declare class VSRepoPrisma7Adapter<T, K extends Prisma7ClientLike = Prism
58
60
  * evaluated server-side against the row's current value, never as a
59
61
  * client-side read-modify-write. `value` is passed through as-is:
60
62
  * Prisma accepts a `number`, `bigint`, or any `Decimal`/`DecimalJsLike`
61
- * value (which covers a {@link DecimalLike} like `Prisma.Decimal`)
63
+ * value (which covers a `DecimalLike` like `Prisma.Decimal`)
62
64
  * depending on the target column's type.
63
65
  *
64
66
  * Prisma's `update()` already returns the row reflecting the state
65
67
  * *after* the write, so no follow-up read is needed here.
66
68
  */
67
69
  private atomicUpdate;
70
+ private atomicUpdateMany;
68
71
  /**
69
72
  * Converts a raw value returned by Prisma's `aggregate()` (`number`,
70
73
  * `bigint`, a `Decimal` instance, or `null` when no record matches)
@@ -85,108 +88,128 @@ export declare class VSRepoPrisma7Adapter<T, K extends Prisma7ClientLike = Prism
85
88
  getDbClient(): any;
86
89
  /** Runs `fn` inside a native transaction of the underlying ORM/database. */
87
90
  runInTransaction<R>(fn: (tx: any) => Promise<R>, options?: VSRepoTransactionOptions): Promise<R>;
91
+ private execMethod;
88
92
  /** Fetches a single record matching `where`. */
89
- findOne(where: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<T | null>;
93
+ findOne(where?: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<T | null>;
90
94
  /** Fetches a single record matching `where`, throwing if none is found. */
91
- findOneOrThrow(where: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<T>;
95
+ findOneOrThrow(where?: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<T>;
92
96
  /** Fetches all records matching `where`. */
93
- findMany(where: VSRepoWhere<T>, options?: AdapterMethodOptions<T> & {
94
- distinct?: (keyof T)[];
95
- }): Promise<T[]>;
97
+ findMany(where?: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<T[]>;
96
98
  /** Creates or updates (upsert) a single record. */
97
- save(obj: DeepPartial<T>, options?: AdapterMethodOptions<T>): Promise<T>;
99
+ save(obj: DeepPartial<T>, options?: SimpleAdapterMethodOptions<T>): Promise<T>;
98
100
  /**
99
101
  * Creates or updates (upsert) multiple records. Prisma has no native bulk
100
102
  * upsert, so each record is saved individually inside a transaction —
101
- * reusing `options.db` when it's already a transaction client (see
102
- * `runTransactional`).
103
+ * reusing `options.db` when it's already a transaction client.
103
104
  */
104
- saveMany(objs: DeepPartial<T>[], options?: AdapterMethodOptions<T>): Promise<T[]>;
105
+ saveMany(objs: DeepPartial<T>[], options?: SimpleAdapterMethodOptions<T>): Promise<T[]>;
105
106
  /** Deletes a single record matching `where`. */
106
- delete(where: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<T>;
107
+ delete(where: VSRepoWhere<T>, options?: SimpleAdapterMethodOptions<T>): Promise<T>;
107
108
  /** Deletes every record matching `where`, returning the count of affected rows. */
108
- deleteMany(where: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<CountResult>;
109
+ deleteMany(where: VSRepoWhere<T>, options?: RestrictAdapterMethodOptions<T>): Promise<CountResult>;
109
110
  /**
110
- * Deletes every record matching `where`, returning the deleted records.
111
+ * Deletes every record matching `where` and returns the deleted records.
111
112
  *
112
- * Prisma has no `deleteManyAndReturn`, so this does a `findMany` on
113
- * `where` first and then re-applies the same `where` to a `deleteMany`,
114
- * both inside a transaction (`runTransactional`).
113
+ * In the absence of a native `deleteManyAndReturn`, this fetches matching records
114
+ * via `findMany` first, extracts their primary keys, and then deletes them by ID
115
+ * using `{ [pkName]: { in: pks } }` inside a transaction.
115
116
  *
116
- * Because the delete is driven by the same `where` (not by the fetched
117
- * records), a concurrent change between the two operations can make them
118
- * diverge — e.g. a row inserted after the `findMany` matching the `where`
119
- * would still be deleted, while a row changed to stop matching wouldn't.
120
- * If you need to guarantee no concurrency issues, run this method inside a
121
- * `repository.transaction()` with a higher isolation level, e.g.
122
- * `TransactionIsolationLevel.SERIALIZABLE`.
123
- */
124
- deleteManyReturning(where: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<T[]>;
117
+ * Key behaviors:
118
+ * - **Primary Key Handling:** If `options.select` omits the primary key, it is
119
+ * temporarily added to the query so the subsequent batch delete can target
120
+ * those exact IDs, and stripped from the returned objects afterward.
121
+ * - **Concurrency & Isolation:** Deleting strictly by the fetched IDs ensures only
122
+ * the exact returned rows are removed (avoiding deleting newly inserted rows that
123
+ * match `where`). However, if a row is modified or deleted concurrently between
124
+ * the read and the delete step, race conditions can still occur unless wrapped
125
+ * in a transaction with an appropriate isolation level (e.g., `SERIALIZABLE`).
126
+ */
127
+ deleteManyReturning(where: VSRepoWhere<T>, options?: SimpleAdapterMethodOptions<T>): Promise<T[]>;
125
128
  /** Updates a single record matching `where`. */
126
- update(where: VSRepoWhere<T>, obj: DeepPartial<T>, options?: AdapterMethodOptions<T>): Promise<T>;
129
+ update(where: VSRepoWhere<T>, obj: DeepPartial<T>, options?: SimpleAdapterMethodOptions<T>): Promise<T>;
127
130
  /** Updates every record matching `where`, returning the count of affected rows. */
128
- updateMany(where: VSRepoWhere<T>, obj: DeepPartial<T>, options?: AdapterMethodOptions<T>): Promise<CountResult>;
129
- /** Updates every record matching `where`, returning the updated records. */
130
- updateManyReturning(where: VSRepoWhere<T>, obj: DeepPartial<T>, options?: AdapterMethodOptions<T>): Promise<T[]>;
131
+ updateMany(where: VSRepoWhere<T>, obj: DeepPartial<T>, options?: RestrictAdapterMethodOptions<T>): Promise<CountResult>;
132
+ /**
133
+ * Updates every record matching `where`, returning the updated records.
134
+ *
135
+ * Rejects with `NOT_SUPPORTED` on providers without `updateManyAndReturn` (MySQL and SQL Server).
136
+ */
137
+ updateManyReturning(where: VSRepoWhere<T>, obj: DeepPartial<T>, options?: SimpleAdapterMethodOptions<T>): Promise<T[]>;
131
138
  /** Returns the number of records matching `where`. */
132
- count(where: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<number>;
139
+ count(where?: VSRepoWhere<T>, options?: RestrictAdapterMethodOptions<T>): Promise<number>;
133
140
  /** Checks whether at least one record matching `where` exists. */
134
- exists(where: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<boolean>;
135
- /** Executes a raw query/statement against the underlying database, used by `@QueryMethod`. */
141
+ exists(where?: VSRepoWhere<T>, options?: RestrictAdapterMethodOptions<T>): Promise<boolean>;
142
+ /** Executes a raw query/statement against the underlying database. */
136
143
  query<R = any>(query: string, options?: AdapterQueryOptions): Promise<R>;
137
144
  /** Creates a single record. */
138
- create(obj: DeepPartial<T>, options?: AdapterMethodOptions<T>): Promise<T>;
145
+ create(obj: DeepPartial<T>, options?: SimpleAdapterMethodOptions<T>): Promise<T>;
139
146
  /**
140
- * Creates multiple records in a single operation. Relation fields are
141
- * stripped (see `stripRelationFields`), since Prisma's `createMany` doesn't
142
- * support nested writes.
147
+ * Creates multiple records in a single operation.
148
+ *
149
+ * Rejects with `NOT_SUPPORTED` when `ignoreConflicts` is used on a provider without
150
+ * `skipDuplicates` (SQL Server and SQLite).
143
151
  */
144
- createMany(objs: DeepPartial<T>[], options?: AdapterMethodOptions<T> & {
145
- ignoreConflicts?: boolean;
146
- }): Promise<CountResult>;
152
+ createMany(objs: DeepPartial<T>[], options?: WithIgnoreConflicts<RestrictAdapterMethodOptions<T>>): Promise<CountResult>;
147
153
  /**
148
154
  * Creates multiple records in a single operation, returning the created records.
155
+ *
156
+ * Rejects with `NOT_SUPPORTED` on providers without `createManyAndReturn` (MySQL and SQL Server),
157
+ * and when `ignoreConflicts` is used on a provider without `skipDuplicates` (SQL Server and SQLite).
149
158
  */
150
- createManyReturning(objs: DeepPartial<T>[], options?: AdapterMethodOptions<T> & {
151
- ignoreConflicts?: boolean;
152
- }): Promise<T[]>;
153
- /**
154
- * Fetches the record matching `where` and returns it deep-merged with
155
- * `obj`, WITHOUT persisting anything — same behavior the v1 of
156
- * VSRepository had (see `mergeEntities`). It's on the caller to decide
157
- * what to do with the result (e.g. call `save` next).
158
- */
159
- merge<K extends DeepPartial<T>>(where: VSRepoWhere<T>, obj: K, options?: AdapterMethodOptions<T>): Promise<(K & T) | null>;
159
+ createManyReturning(objs: DeepPartial<T>[], options?: WithIgnoreConflicts<SimpleAdapterMethodOptions<T>>): Promise<T[]>;
160
160
  /** Creates a record if none matches `where`, otherwise updates it. */
161
- upsert(where: VSRepoWhere<T>, create: DeepPartial<T>, update: DeepPartial<T>, options?: AdapterMethodOptions<T>): Promise<T>;
161
+ upsert(where: VSRepoWhere<T>, create: DeepPartial<T>, update: DeepPartial<T>, options?: SimpleAdapterMethodOptions<T>): Promise<T>;
162
162
  /**
163
163
  * Atomically adds `value` to `field` on the record matching `where`,
164
164
  * via Prisma's native `{ field: { increment: value } }` write.
165
165
  */
166
- incrementOne<K extends NumericKeys<T>>(field: K, value: NonNullable<T[K]>, where: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<T>;
167
- /** Same as {@link VSRepoPrisma7Adapter.incrementOne}, subtracting `value` instead of adding it. */
168
- decrementOne<K extends NumericKeys<T>>(field: K, value: NonNullable<T[K]>, where: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<T>;
169
- /** Same as {@link VSRepoPrisma7Adapter.incrementOne}, multiplying the field's current value by `value`. */
170
- multiplyOne<K extends NumericKeys<T>>(field: K, value: NonNullable<T[K]>, where: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<T>;
166
+ incrementOne<K extends NumericKeys<T>>(field: K, value: NonNullable<T[K]>, where: VSRepoWhere<T>, options?: SimpleAdapterMethodOptions<T>): Promise<T>;
167
+ /**
168
+ * Atomically subtracts `value` to `field` on the record matching `where`,
169
+ * via Prisma's native `{ field: { decrement: value } }` write.
170
+ */
171
+ decrementOne<K extends NumericKeys<T>>(field: K, value: NonNullable<T[K]>, where: VSRepoWhere<T>, options?: SimpleAdapterMethodOptions<T>): Promise<T>;
172
+ /**
173
+ * Atomically multiplies `value` to `field` on the record matching `where`,
174
+ * via Prisma's native `{ field: { multiply: value } }` write.
175
+ */
176
+ multiplyOne<K extends NumericKeys<T>>(field: K, value: NonNullable<T[K]>, where: VSRepoWhere<T>, options?: SimpleAdapterMethodOptions<T>): Promise<T>;
177
+ /**
178
+ * Atomically divides `value` to `field` on the record matching `where`,
179
+ * via Prisma's native `{ field: { divide: value } }` write.
180
+ */
181
+ divideOne<K extends NumericKeys<T>>(field: K, value: NonNullable<T[K]>, where: VSRepoWhere<T>, options?: SimpleAdapterMethodOptions<T>): Promise<T>;
182
+ /**
183
+ * Atomically adds `value` to `field` on every record matching `where`,
184
+ * via Prisma's native `{ field: { increment: value } }` write.
185
+ */
186
+ incrementMany<K extends NumericKeys<T>>(field: K, value: NonNullable<T[K]>, where: VSRepoWhere<T>, options?: RestrictAdapterMethodOptions<T>): Promise<CountResult>;
187
+ /**
188
+ * Atomically subtracts `value` from `field` on every record matching `where`,
189
+ * via Prisma's native `{ field: { decrement: value } }` write.
190
+ */
191
+ decrementMany<K extends NumericKeys<T>>(field: K, value: NonNullable<T[K]>, where: VSRepoWhere<T>, options?: RestrictAdapterMethodOptions<T>): Promise<CountResult>;
192
+ /**
193
+ * Atomically multiplies `field` by `value` on every record matching `where`,
194
+ * via Prisma's native `{ field: { multiply: value } }` write.
195
+ */
196
+ multiplyMany<K extends NumericKeys<T>>(field: K, value: NonNullable<T[K]>, where: VSRepoWhere<T>, options?: RestrictAdapterMethodOptions<T>): Promise<CountResult>;
171
197
  /**
172
- * Same as {@link VSRepoPrisma7Adapter.incrementOne}, dividing the
173
- * field's current value by `value`. Division-by-zero is not handled by
174
- * the adapter — it's whatever Postgres does natively (raises a
175
- * `division_by_zero` error for integer columns; `Infinity`/`NaN` are not
176
- * representable in a numeric/decimal column, so those also error).
198
+ * Atomically divides `field` by `value` on every record matching `where`,
199
+ * via Prisma's native `{ field: { divide: value } }` write.
177
200
  */
178
- divideOne<K extends NumericKeys<T>>(field: K, value: NonNullable<T[K]>, where: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<T>;
201
+ divideMany<K extends NumericKeys<T>>(field: K, value: NonNullable<T[K]>, where: VSRepoWhere<T>, options?: RestrictAdapterMethodOptions<T>): Promise<CountResult>;
179
202
  /**
180
203
  * Returns the sum of `field` across every record matching `where` (all
181
204
  * records if `where` is empty), or `null` if no record matches.
182
205
  */
183
- sum(field: NumericKeys<T>, where: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<number | null>;
206
+ sum(field: NumericKeys<T>, where?: VSRepoWhere<T>, options?: RestrictAdapterMethodOptions<T>): Promise<number | null>;
184
207
  /** Same as {@link VSRepoPrisma7Adapter.sum}, but the arithmetic mean instead of the total. */
185
- average(field: NumericKeys<T>, where: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<number | null>;
208
+ average(field: NumericKeys<T>, where?: VSRepoWhere<T>, options?: RestrictAdapterMethodOptions<T>): Promise<number | null>;
186
209
  /** Same as {@link VSRepoPrisma7Adapter.sum}, but the minimum value instead of the total. */
187
- min(field: NumericKeys<T>, where: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<number | null>;
210
+ min(field: NumericKeys<T>, where?: VSRepoWhere<T>, options?: RestrictAdapterMethodOptions<T>): Promise<number | null>;
188
211
  /** Same as {@link VSRepoPrisma7Adapter.sum}, but the maximum value instead of the total. */
189
- max(field: NumericKeys<T>, where: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<number | null>;
212
+ max(field: NumericKeys<T>, where?: VSRepoWhere<T>, options?: RestrictAdapterMethodOptions<T>): Promise<number | null>;
190
213
  /**
191
214
  * Returns the model's primary key
192
215
  *