updated deps; regen ent
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Code generated by entc, DO NOT EDIT.
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package ent
|
||||
|
||||
@@ -18,8 +18,9 @@ import (
|
||||
// SprayUpdate is the builder for updating Spray entities.
|
||||
type SprayUpdate struct {
|
||||
config
|
||||
hooks []Hook
|
||||
mutation *SprayMutation
|
||||
hooks []Hook
|
||||
mutation *SprayMutation
|
||||
modifiers []func(*sql.UpdateBuilder)
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the SprayUpdate builder.
|
||||
@@ -131,6 +132,12 @@ func (su *SprayUpdate) ExecX(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
|
||||
func (su *SprayUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *SprayUpdate {
|
||||
su.modifiers = append(su.modifiers, modifiers...)
|
||||
return su
|
||||
}
|
||||
|
||||
func (su *SprayUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
_spec := &sqlgraph.UpdateSpec{
|
||||
Node: &sqlgraph.NodeSpec{
|
||||
@@ -205,11 +212,12 @@ func (su *SprayUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
_spec.Modifiers = su.modifiers
|
||||
if n, err = sqlgraph.UpdateNodes(ctx, su.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{spray.Label}
|
||||
} else if sqlgraph.IsConstraintError(err) {
|
||||
err = &ConstraintError{err.Error(), err}
|
||||
err = &ConstraintError{msg: err.Error(), wrap: err}
|
||||
}
|
||||
return 0, err
|
||||
}
|
||||
@@ -219,9 +227,10 @@ func (su *SprayUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
// SprayUpdateOne is the builder for updating a single Spray entity.
|
||||
type SprayUpdateOne struct {
|
||||
config
|
||||
fields []string
|
||||
hooks []Hook
|
||||
mutation *SprayMutation
|
||||
fields []string
|
||||
hooks []Hook
|
||||
mutation *SprayMutation
|
||||
modifiers []func(*sql.UpdateBuilder)
|
||||
}
|
||||
|
||||
// SetWeapon sets the "weapon" field.
|
||||
@@ -305,9 +314,15 @@ func (suo *SprayUpdateOne) Save(ctx context.Context) (*Spray, error) {
|
||||
}
|
||||
mut = suo.hooks[i](mut)
|
||||
}
|
||||
if _, err := mut.Mutate(ctx, suo.mutation); err != nil {
|
||||
v, err := mut.Mutate(ctx, suo.mutation)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
nv, ok := v.(*Spray)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unexpected node type %T returned from SprayMutation", v)
|
||||
}
|
||||
node = nv
|
||||
}
|
||||
return node, err
|
||||
}
|
||||
@@ -334,6 +349,12 @@ func (suo *SprayUpdateOne) ExecX(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
|
||||
func (suo *SprayUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *SprayUpdateOne {
|
||||
suo.modifiers = append(suo.modifiers, modifiers...)
|
||||
return suo
|
||||
}
|
||||
|
||||
func (suo *SprayUpdateOne) sqlSave(ctx context.Context) (_node *Spray, err error) {
|
||||
_spec := &sqlgraph.UpdateSpec{
|
||||
Node: &sqlgraph.NodeSpec{
|
||||
@@ -425,6 +446,7 @@ func (suo *SprayUpdateOne) sqlSave(ctx context.Context) (_node *Spray, err error
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
_spec.Modifiers = suo.modifiers
|
||||
_node = &Spray{config: suo.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
_spec.ScanValues = _node.scanValues
|
||||
@@ -432,7 +454,7 @@ func (suo *SprayUpdateOne) sqlSave(ctx context.Context) (_node *Spray, err error
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{spray.Label}
|
||||
} else if sqlgraph.IsConstraintError(err) {
|
||||
err = &ConstraintError{err.Error(), err}
|
||||
err = &ConstraintError{msg: err.Error(), wrap: err}
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user