File tree Expand file tree Collapse file tree 5 files changed +10
-0
lines changed Expand file tree Collapse file tree 5 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -77,5 +77,6 @@ export const ACTIONS_WITH_WRITE_PAYLOAD = [
77
77
'createManyAndReturn' ,
78
78
'update' ,
79
79
'updateMany' ,
80
+ 'updateManyAndReturn' ,
80
81
'upsert' ,
81
82
] ;
Original file line number Diff line number Diff line change @@ -247,6 +247,7 @@ export class NestedWriteVisitor {
247
247
break ;
248
248
249
249
case 'updateMany' :
250
+ case 'updateManyAndReturn' :
250
251
for ( const item of this . enumerateReverse ( data ) ) {
251
252
const newContext = pushNewContext ( field , model , item . where ) ;
252
253
let callbackResult : any ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export const PrismaWriteActions = [
8
8
'connectOrCreate' ,
9
9
'update' ,
10
10
'updateMany' ,
11
+ 'updateManyAndReturn' ,
11
12
'upsert' ,
12
13
'connect' ,
13
14
'disconnect' ,
Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ export interface PrismaProxyHandler {
35
35
36
36
updateMany ( args : any ) : Promise < BatchResult > ;
37
37
38
+ updateManyAndReturn ( args : any ) : Promise < unknown [ ] > ;
39
+
38
40
upsert ( args : any ) : Promise < unknown > ;
39
41
40
42
delete ( args : any ) : Promise < unknown > ;
@@ -132,6 +134,10 @@ export class DefaultPrismaProxyHandler implements PrismaProxyHandler {
132
134
return this . deferred < { count : number } > ( 'updateMany' , args , false ) ;
133
135
}
134
136
137
+ updateManyAndReturn ( args : any ) {
138
+ return this . deferred < unknown [ ] > ( 'updateManyAndReturn' , args ) ;
139
+ }
140
+
135
141
upsert ( args : any ) {
136
142
return this . deferred ( 'upsert' , args ) ;
137
143
}
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export interface DbOperations {
19
19
createManyAndReturn ( args : unknown ) : Promise < unknown [ ] > ;
20
20
update ( args : unknown ) : Promise < any > ;
21
21
updateMany ( args : unknown ) : Promise < { count : number } > ;
22
+ updateManyAndReturn ( args : unknown ) : Promise < unknown [ ] > ;
22
23
upsert ( args : unknown ) : Promise < any > ;
23
24
delete ( args : unknown ) : Promise < any > ;
24
25
deleteMany ( args ?: unknown ) : Promise < { count : number } > ;
You can’t perform that action at this time.
0 commit comments