entc/gen: add support for MapBulkCreate (#3696)

This commit is contained in:
Ariel Mashraki
2023-08-16 11:46:14 +03:00
committed by GitHub
parent 452aa79d90
commit dc8ea50747
190 changed files with 2991 additions and 11 deletions

View File

@@ -385,6 +385,9 @@ func (u *{{ $upsertBulk }}) Update(set func(*{{ $upsertSet }})) *{{ $upsertBulk
// Exec executes the query.
func (u *{{ $upsertBulk }}) Exec(ctx context.Context) error {
if u.create.err != nil {
return u.create.err
}
for i, b := range u.create.builders {
if len(b.conflict) != 0 {
return fmt.Errorf("{{ $pkg }}: OnConflict was set for builder %d. Set it on the {{ $builder }} instead", i)