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

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