@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.
- package/CHANGELOG.md +417 -0
- package/LICENSE +20 -20
- package/README.md +303 -299
- package/README.pt-BR.md +303 -299
- package/dist/constants/provider-capabilities.constant.d.ts +17 -0
- package/dist/constants/provider-capabilities.constant.js +27 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.js +1 -7
- package/dist/parsers/data.parser.d.ts +3 -33
- package/dist/parsers/data.parser.js +7 -45
- package/dist/parsers/include.parser.d.ts +1 -1
- package/dist/parsers/include.parser.js +3 -7
- package/dist/parsers/order-by.parser.d.ts +2 -10
- package/dist/parsers/order-by.parser.js +6 -19
- package/dist/parsers/select.parser.d.ts +1 -1
- package/dist/parsers/select.parser.js +3 -7
- package/dist/parsers/where.parser.d.ts +4 -28
- package/dist/parsers/where.parser.js +49 -151
- package/dist/prisma7.adapter.d.ts +104 -81
- package/dist/prisma7.adapter.js +329 -362
- package/dist/resolvers/map-prisma-error.resolver.d.ts +0 -11
- package/dist/resolvers/map-prisma-error.resolver.js +48 -72
- package/dist/resolvers/merge-entities.resolver.d.ts +11 -15
- package/dist/resolvers/merge-entities.resolver.js +29 -38
- package/dist/resolvers/resolve-provider.resolver.d.ts +2 -22
- package/dist/resolvers/resolve-provider.resolver.js +10 -33
- package/dist/types/adapter-config.type.d.ts +7 -12
- package/dist/types/adapter-config.type.js +1 -3
- package/dist/types/adapter-relations.type.d.ts +2 -2
- package/dist/types/adapter-relations.type.js +1 -3
- package/dist/types/plain-object.type.js +1 -3
- package/dist/types/prisma-arg-like.type.js +1 -3
- package/dist/types/prisma-client-models.type.d.ts +4 -4
- package/dist/types/prisma-client-models.type.js +1 -3
- package/dist/types/prisma-provider.type.d.ts +1 -1
- package/dist/types/prisma-provider.type.js +1 -3
- package/dist/types/prisma-repository-like.type.d.ts +1 -1
- package/dist/types/prisma-repository-like.type.js +1 -3
- package/dist/types/prisma7-client-like.type.d.ts +1 -8
- package/dist/types/prisma7-client-like.type.js +1 -3
- package/dist/types/prisma7-orm-types.type.d.ts +2 -2
- package/dist/types/prisma7-orm-types.type.js +1 -3
- package/dist/types/relation.type.d.ts +25 -19
- package/dist/types/relation.type.js +1 -3
- package/dist/validators/is-decimal.validator.d.ts +2 -5
- package/dist/validators/is-decimal.validator.js +3 -6
- package/dist/validators/is-plain-object.validator.d.ts +1 -1
- package/dist/validators/is-plain-object.validator.js +3 -7
- package/dist/validators/validate-prisma-client.validator.d.ts +1 -14
- package/dist/validators/validate-prisma-client.validator.js +7 -24
- package/package.json +108 -91
- package/dist/index.js.map +0 -1
- package/dist/parsers/data.parser.js.map +0 -1
- package/dist/parsers/include.parser.js.map +0 -1
- package/dist/parsers/order-by.parser.js.map +0 -1
- package/dist/parsers/select.parser.js.map +0 -1
- package/dist/parsers/where.parser.js.map +0 -1
- package/dist/prisma7.adapter.js.map +0 -1
- package/dist/resolvers/map-prisma-error.resolver.js.map +0 -1
- package/dist/resolvers/merge-entities.resolver.js.map +0 -1
- package/dist/resolvers/resolve-provider.resolver.js.map +0 -1
- package/dist/types/adapter-config.type.js.map +0 -1
- package/dist/types/adapter-relations.type.js.map +0 -1
- package/dist/types/plain-object.type.js.map +0 -1
- package/dist/types/prisma-arg-like.type.js.map +0 -1
- package/dist/types/prisma-client-models.type.js.map +0 -1
- package/dist/types/prisma-provider.type.js.map +0 -1
- package/dist/types/prisma-repository-like.type.js.map +0 -1
- package/dist/types/prisma7-client-like.type.js.map +0 -1
- package/dist/types/prisma7-orm-types.type.js.map +0 -1
- package/dist/types/relation.type.js.map +0 -1
- package/dist/validators/is-decimal.validator.js.map +0 -1
- package/dist/validators/is-plain-object.validator.js.map +0 -1
- package/dist/validators/validate-adapter-config.validator.d.ts +0 -8
- package/dist/validators/validate-adapter-config.validator.js +0 -78
- package/dist/validators/validate-adapter-config.validator.js.map +0 -1
- 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 {
|
|
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.
|
|
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
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
95
|
+
findOneOrThrow(where?: VSRepoWhere<T>, options?: AdapterMethodOptions<T>): Promise<T>;
|
|
92
96
|
/** Fetches all records matching `where`. */
|
|
93
|
-
findMany(where
|
|
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?:
|
|
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
|
|
102
|
-
* `runTransactional`).
|
|
103
|
+
* reusing `options.db` when it's already a transaction client.
|
|
103
104
|
*/
|
|
104
|
-
saveMany(objs: DeepPartial<T>[], options?:
|
|
105
|
+
saveMany(objs: DeepPartial<T>[], options?: SimpleAdapterMethodOptions<T>): Promise<T[]>;
|
|
105
106
|
/** Deletes a single record matching `where`. */
|
|
106
|
-
delete(where: VSRepoWhere<T>, options?:
|
|
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?:
|
|
109
|
+
deleteMany(where: VSRepoWhere<T>, options?: RestrictAdapterMethodOptions<T>): Promise<CountResult>;
|
|
109
110
|
/**
|
|
110
|
-
* Deletes every record matching `where
|
|
111
|
+
* Deletes every record matching `where` and returns the deleted records.
|
|
111
112
|
*
|
|
112
|
-
*
|
|
113
|
-
* `
|
|
114
|
-
*
|
|
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
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
* `
|
|
123
|
-
|
|
124
|
-
|
|
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?:
|
|
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?:
|
|
129
|
-
/**
|
|
130
|
-
|
|
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
|
|
139
|
+
count(where?: VSRepoWhere<T>, options?: RestrictAdapterMethodOptions<T>): Promise<number>;
|
|
133
140
|
/** Checks whether at least one record matching `where` exists. */
|
|
134
|
-
exists(where
|
|
135
|
-
/** Executes a raw query/statement against the underlying database
|
|
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?:
|
|
145
|
+
create(obj: DeepPartial<T>, options?: SimpleAdapterMethodOptions<T>): Promise<T>;
|
|
139
146
|
/**
|
|
140
|
-
* Creates multiple records in a single operation.
|
|
141
|
-
*
|
|
142
|
-
*
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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?:
|
|
167
|
-
/**
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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
|
-
*
|
|
173
|
-
*
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
*
|