entc/gen: add the Exec(X) methods for BulkCreate

This commit is contained in:
Ariel Mashraki
2021-07-29 17:43:41 +03:00
committed by Ariel Mashraki
parent b4ba9eb12f
commit 3307dd5323
87 changed files with 1108 additions and 3 deletions

View File

@@ -314,3 +314,16 @@ func (fcb *FileCreateBulk) SaveX(ctx context.Context) []*File {
}
return v
}
// Exec executes the query.
func (fcb *FileCreateBulk) Exec(ctx context.Context) error {
_, err := fcb.Save(ctx)
return err
}
// ExecX is like Exec, but panics if an error occurs.
func (fcb *FileCreateBulk) ExecX(ctx context.Context) {
if err := fcb.Exec(ctx); err != nil {
panic(err)
}
}