regenerate ent
This commit is contained in:
@@ -20,56 +20,56 @@ type MatchDelete struct {
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the MatchDelete builder.
|
||||
func (md *MatchDelete) Where(ps ...predicate.Match) *MatchDelete {
|
||||
md.mutation.Where(ps...)
|
||||
return md
|
||||
func (_d *MatchDelete) Where(ps ...predicate.Match) *MatchDelete {
|
||||
_d.mutation.Where(ps...)
|
||||
return _d
|
||||
}
|
||||
|
||||
// Exec executes the deletion query and returns how many vertices were deleted.
|
||||
func (md *MatchDelete) Exec(ctx context.Context) (int, error) {
|
||||
return withHooks(ctx, md.sqlExec, md.mutation, md.hooks)
|
||||
func (_d *MatchDelete) Exec(ctx context.Context) (int, error) {
|
||||
return withHooks(ctx, _d.sqlExec, _d.mutation, _d.hooks)
|
||||
}
|
||||
|
||||
// ExecX is like Exec, but panics if an error occurs.
|
||||
func (md *MatchDelete) ExecX(ctx context.Context) int {
|
||||
n, err := md.Exec(ctx)
|
||||
func (_d *MatchDelete) ExecX(ctx context.Context) int {
|
||||
n, err := _d.Exec(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (md *MatchDelete) sqlExec(ctx context.Context) (int, error) {
|
||||
func (_d *MatchDelete) sqlExec(ctx context.Context) (int, error) {
|
||||
_spec := sqlgraph.NewDeleteSpec(match.Table, sqlgraph.NewFieldSpec(match.FieldID, field.TypeUint64))
|
||||
if ps := md.mutation.predicates; len(ps) > 0 {
|
||||
if ps := _d.mutation.predicates; len(ps) > 0 {
|
||||
_spec.Predicate = func(selector *sql.Selector) {
|
||||
for i := range ps {
|
||||
ps[i](selector)
|
||||
}
|
||||
}
|
||||
}
|
||||
affected, err := sqlgraph.DeleteNodes(ctx, md.driver, _spec)
|
||||
affected, err := sqlgraph.DeleteNodes(ctx, _d.driver, _spec)
|
||||
if err != nil && sqlgraph.IsConstraintError(err) {
|
||||
err = &ConstraintError{msg: err.Error(), wrap: err}
|
||||
}
|
||||
md.mutation.done = true
|
||||
_d.mutation.done = true
|
||||
return affected, err
|
||||
}
|
||||
|
||||
// MatchDeleteOne is the builder for deleting a single Match entity.
|
||||
type MatchDeleteOne struct {
|
||||
md *MatchDelete
|
||||
_d *MatchDelete
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the MatchDelete builder.
|
||||
func (mdo *MatchDeleteOne) Where(ps ...predicate.Match) *MatchDeleteOne {
|
||||
mdo.md.mutation.Where(ps...)
|
||||
return mdo
|
||||
func (_d *MatchDeleteOne) Where(ps ...predicate.Match) *MatchDeleteOne {
|
||||
_d._d.mutation.Where(ps...)
|
||||
return _d
|
||||
}
|
||||
|
||||
// Exec executes the deletion query.
|
||||
func (mdo *MatchDeleteOne) Exec(ctx context.Context) error {
|
||||
n, err := mdo.md.Exec(ctx)
|
||||
func (_d *MatchDeleteOne) Exec(ctx context.Context) error {
|
||||
n, err := _d._d.Exec(ctx)
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
@@ -81,8 +81,8 @@ func (mdo *MatchDeleteOne) Exec(ctx context.Context) error {
|
||||
}
|
||||
|
||||
// ExecX is like Exec, but panics if an error occurs.
|
||||
func (mdo *MatchDeleteOne) ExecX(ctx context.Context) {
|
||||
if err := mdo.Exec(ctx); err != nil {
|
||||
func (_d *MatchDeleteOne) ExecX(ctx context.Context) {
|
||||
if err := _d.Exec(ctx); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user