entc/gen: make generated client to implement the ent.Mutator interface (#3161)

This commit is contained in:
Ariel Mashraki
2022-12-09 21:18:25 +02:00
committed by GitHub
parent 3f4916ff8b
commit d0c5afa705
85 changed files with 3522 additions and 22 deletions

View File

@@ -1044,7 +1044,7 @@ func (f Field) EntSQL() *entsql.Annotation {
// mutMethods returns the method names of mutation interface.
var mutMethods = func() map[string]bool {
names := map[string]bool{"Client": true, "Tx": true, "Where": true}
names := map[string]bool{"Client": true, "Tx": true, "Where": true, "SetOp": true}
t := reflect.TypeOf(new(ent.Mutation)).Elem()
for i := 0; i < t.NumMethod(); i++ {
names[t.Method(i).Name] = true