func (dosuo *DependsOnSkippedUpdateOne) ExecX(ctx context.Context) {
	if err := dosuo.Exec(ctx); err != nil {
		panic(err)
	}
}
ExecX is like Exec, but panics if an error occurs.
package ent
import (
	"context"
	"fmt"
	"entgo.io/contrib/entproto/internal/entprototest/ent/dependsonskipped"
	"entgo.io/contrib/entproto/internal/entprototest/ent/implicitskippedmessage"
	"entgo.io/contrib/entproto/internal/entprototest/ent/predicate"
	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"entgo.io/ent/schema/field"
)
type DependsOnSkippedUpdate struct {
	config
	hooks    []Hook
	mutation *DependsOnSkippedMutation
}
func (dosu *DependsOnSkippedUpdate) Where(ps ...predicate.DependsOnSkipped) *DependsOnSkippedUpdate {
	dosu.mutation.Where(ps...)
	return dosu
}
func (dosu *DependsOnSkippedUpdate) SetName(s string) *DependsOnSkippedUpdate {
	dosu.mutation.SetName(s)
	return dosu
}
func (dosu *DependsOnSkippedUpdate) AddSkippedIDs(ids ...int) *DependsOnSkippedUpdate {
	dosu.mutation.AddSkippedIDs(ids...)
	return dosu
}
func (dosu *DependsOnSkippedUpdate) AddSkipped(i ...*ImplicitSkippedMessage) *DependsOnSkippedUpdate {
	ids := make([]int, len(i))
	for j := range i {
		ids[j] = i[j].ID
	}
	return dosu.AddSkippedIDs(ids...)
}
func (dosu *DependsOnSkippedUpdate) Mutation() *DependsOnSkippedMutation {
	return dosu.mutation
}
func (dosu *DependsOnSkippedUpdate) ClearSkipped() *DependsOnSkippedUpdate {
	dosu.mutation.ClearSkipped()
	return dosu
}
func (dosu *DependsOnSkippedUpdate) RemoveSkippedIDs(ids ...int) *DependsOnSkippedUpdate {
	dosu.mutation.RemoveSkippedIDs(ids...)
	return dosu
}
func (dosu *DependsOnSkippedUpdate) RemoveSkipped(i ...*ImplicitSkippedMessage) *DependsOnSkippedUpdate {
	ids := make([]int, len(i))
	for j := range i {
		ids[j] = i[j].ID
	}
	return dosu.RemoveSkippedIDs(ids...)
}
func (dosu *DependsOnSkippedUpdate) Save(ctx context.Context) (int, error) {
	var (
		err      error
		affected int
	)
	if len(dosu.hooks) == 0 {
		affected, err = dosu.sqlSave(ctx)
	} else {
		var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
			mutation, ok := m.(*DependsOnSkippedMutation)
			if !ok {
				return nil, fmt.Errorf("unexpected mutation type %T", m)
			}
			dosu.mutation = mutation
			affected, err = dosu.sqlSave(ctx)
			mutation.done = true
			return affected, err
		})
		for i := len(dosu.hooks) - 1; i >= 0; i-- {
			if dosu.hooks[i] == nil {
				return 0, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)")
			}
			mut = dosu.hooks[i](mut)
		}
		if _, err := mut.Mutate(ctx, dosu.mutation); err != nil {
			return 0, err
		}
	}
	return affected, err
}
func (dosu *DependsOnSkippedUpdate) SaveX(ctx context.Context) int {
	affected, err := dosu.Save(ctx)
	if err != nil {
		panic(err)
	}
	return affected
}
func (dosu *DependsOnSkippedUpdate) Exec(ctx context.Context) error {
	_, err := dosu.Save(ctx)
	return err
}
func (dosu *DependsOnSkippedUpdate) ExecX(ctx context.Context) {
	if err := dosu.Exec(ctx); err != nil {
		panic(err)
	}
}
func (dosu *DependsOnSkippedUpdate) sqlSave(ctx context.Context) (n int, err error) {
	_spec := &sqlgraph.UpdateSpec{
		Node: &sqlgraph.NodeSpec{
			Table:   dependsonskipped.Table,
			Columns: dependsonskipped.Columns,
			ID: &sqlgraph.FieldSpec{
				Type:   field.TypeInt,
				Column: dependsonskipped.FieldID,
			},
		},
	}
	if ps := dosu.mutation.predicates; len(ps) > 0 {
		_spec.Predicate = func(selector *sql.Selector) {
			for i := range ps {
				ps[i](selector)
			}
		}
	}
	if value, ok := dosu.mutation.Name(); ok {
		_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
			Type:   field.TypeString,
			Value:  value,
			Column: dependsonskipped.FieldName,
		})
	}
	if dosu.mutation.SkippedCleared() {
		edge := &sqlgraph.EdgeSpec{
			Rel:     sqlgraph.O2M,
			Inverse: false,
			Table:   dependsonskipped.SkippedTable,
			Columns: []string{dependsonskipped.SkippedColumn},
			Bidi:    false,
			Target: &sqlgraph.EdgeTarget{
				IDSpec: &sqlgraph.FieldSpec{
					Type:   field.TypeInt,
					Column: implicitskippedmessage.FieldID,
				},
			},
		}
		_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
	}
	if nodes := dosu.mutation.RemovedSkippedIDs(); len(nodes) > 0 && !dosu.mutation.SkippedCleared() {
		edge := &sqlgraph.EdgeSpec{
			Rel:     sqlgraph.O2M,
			Inverse: false,
			Table:   dependsonskipped.SkippedTable,
			Columns: []string{dependsonskipped.SkippedColumn},
			Bidi:    false,
			Target: &sqlgraph.EdgeTarget{
				IDSpec: &sqlgraph.FieldSpec{
					Type:   field.TypeInt,
					Column: implicitskippedmessage.FieldID,
				},
			},
		}
		for _, k := range nodes {
			edge.Target.Nodes = append(edge.Target.Nodes, k)
		}
		_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
	}
	if nodes := dosu.mutation.SkippedIDs(); len(nodes) > 0 {
		edge := &sqlgraph.EdgeSpec{
			Rel:     sqlgraph.O2M,
			Inverse: false,
			Table:   dependsonskipped.SkippedTable,
			Columns: []string{dependsonskipped.SkippedColumn},
			Bidi:    false,
			Target: &sqlgraph.EdgeTarget{
				IDSpec: &sqlgraph.FieldSpec{
					Type:   field.TypeInt,
					Column: implicitskippedmessage.FieldID,
				},
			},
		}
		for _, k := range nodes {
			edge.Target.Nodes = append(edge.Target.Nodes, k)
		}
		_spec.Edges.Add = append(_spec.Edges.Add, edge)
	}
	if n, err = sqlgraph.UpdateNodes(ctx, dosu.driver, _spec); err != nil {
		if _, ok := err.(*sqlgraph.NotFoundError); ok {
			err = &NotFoundError{dependsonskipped.Label}
		} else if sqlgraph.IsConstraintError(err) {
			err = &ConstraintError{err.Error(), err}
		}
		return 0, err
	}
	return n, nil
}
type DependsOnSkippedUpdateOne struct {
	config
	fields   []string
	hooks    []Hook
	mutation *DependsOnSkippedMutation
}
func (dosuo *DependsOnSkippedUpdateOne) SetName(s string) *DependsOnSkippedUpdateOne {
	dosuo.mutation.SetName(s)
	return dosuo
}
func (dosuo *DependsOnSkippedUpdateOne) AddSkippedIDs(ids ...int) *DependsOnSkippedUpdateOne {
	dosuo.mutation.AddSkippedIDs(ids...)
	return dosuo
}
func (dosuo *DependsOnSkippedUpdateOne) AddSkipped(i ...*ImplicitSkippedMessage) *DependsOnSkippedUpdateOne {
	ids := make([]int, len(i))
	for j := range i {
		ids[j] = i[j].ID
	}
	return dosuo.AddSkippedIDs(ids...)
}
func (dosuo *DependsOnSkippedUpdateOne) Mutation() *DependsOnSkippedMutation {
	return dosuo.mutation
}
func (dosuo *DependsOnSkippedUpdateOne) ClearSkipped() *DependsOnSkippedUpdateOne {
	dosuo.mutation.ClearSkipped()
	return dosuo
}
func (dosuo *DependsOnSkippedUpdateOne) RemoveSkippedIDs(ids ...int) *DependsOnSkippedUpdateOne {
	dosuo.mutation.RemoveSkippedIDs(ids...)
	return dosuo
}
func (dosuo *DependsOnSkippedUpdateOne) RemoveSkipped(i ...*ImplicitSkippedMessage) *DependsOnSkippedUpdateOne {
	ids := make([]int, len(i))
	for j := range i {
		ids[j] = i[j].ID
	}
	return dosuo.RemoveSkippedIDs(ids...)
}
func (dosuo *DependsOnSkippedUpdateOne) Select(field string, fields ...string) *DependsOnSkippedUpdateOne {
	dosuo.fields = append([]string{field}, fields...)
	return dosuo
}
func (dosuo *DependsOnSkippedUpdateOne) Save(ctx context.Context) (*DependsOnSkipped, error) {
	var (
		err  error
		node *DependsOnSkipped
	)
	if len(dosuo.hooks) == 0 {
		node, err = dosuo.sqlSave(ctx)
	} else {
		var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
			mutation, ok := m.(*DependsOnSkippedMutation)
			if !ok {
				return nil, fmt.Errorf("unexpected mutation type %T", m)
			}
			dosuo.mutation = mutation
			node, err = dosuo.sqlSave(ctx)
			mutation.done = true
			return node, err
		})
		for i := len(dosuo.hooks) - 1; i >= 0; i-- {
			if dosuo.hooks[i] == nil {
				return nil, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)")
			}
			mut = dosuo.hooks[i](mut)
		}
		if _, err := mut.Mutate(ctx, dosuo.mutation); err != nil {
			return nil, err
		}
	}
	return node, err
}
func (dosuo *DependsOnSkippedUpdateOne) SaveX(ctx context.Context) *DependsOnSkipped {
	node, err := dosuo.Save(ctx)
	if err != nil {
		panic(err)
	}
	return node
}
func (dosuo *DependsOnSkippedUpdateOne) Exec(ctx context.Context) error {
	_, err := dosuo.Save(ctx)
	return err
}