updated deps; regen ent

This commit is contained in:
2022-08-15 12:10:15 +02:00
parent b8b9f82067
commit 657ca32bb3
66 changed files with 1578 additions and 4744 deletions

View File

@@ -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 (
// WeaponUpdate is the builder for updating Weapon entities.
type WeaponUpdate struct {
config
hooks []Hook
mutation *WeaponMutation
hooks []Hook
mutation *WeaponMutation
modifiers []func(*sql.UpdateBuilder)
}
// Where appends a list predicates to the WeaponUpdate builder.
@@ -164,6 +165,12 @@ func (wu *WeaponUpdate) ExecX(ctx context.Context) {
}
}
// Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (wu *WeaponUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *WeaponUpdate {
wu.modifiers = append(wu.modifiers, modifiers...)
return wu
}
func (wu *WeaponUpdate) sqlSave(ctx context.Context) (n int, err error) {
_spec := &sqlgraph.UpdateSpec{
Node: &sqlgraph.NodeSpec{
@@ -273,11 +280,12 @@ func (wu *WeaponUpdate) sqlSave(ctx context.Context) (n int, err error) {
}
_spec.Edges.Add = append(_spec.Edges.Add, edge)
}
_spec.Modifiers = wu.modifiers
if n, err = sqlgraph.UpdateNodes(ctx, wu.driver, _spec); err != nil {
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{weapon.Label}
} else if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{err.Error(), err}
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return 0, err
}
@@ -287,9 +295,10 @@ func (wu *WeaponUpdate) sqlSave(ctx context.Context) (n int, err error) {
// WeaponUpdateOne is the builder for updating a single Weapon entity.
type WeaponUpdateOne struct {
config
fields []string
hooks []Hook
mutation *WeaponMutation
fields []string
hooks []Hook
mutation *WeaponMutation
modifiers []func(*sql.UpdateBuilder)
}
// SetVictim sets the "victim" field.
@@ -406,9 +415,15 @@ func (wuo *WeaponUpdateOne) Save(ctx context.Context) (*Weapon, error) {
}
mut = wuo.hooks[i](mut)
}
if _, err := mut.Mutate(ctx, wuo.mutation); err != nil {
v, err := mut.Mutate(ctx, wuo.mutation)
if err != nil {
return nil, err
}
nv, ok := v.(*Weapon)
if !ok {
return nil, fmt.Errorf("unexpected node type %T returned from WeaponMutation", v)
}
node = nv
}
return node, err
}
@@ -435,6 +450,12 @@ func (wuo *WeaponUpdateOne) ExecX(ctx context.Context) {
}
}
// Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (wuo *WeaponUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *WeaponUpdateOne {
wuo.modifiers = append(wuo.modifiers, modifiers...)
return wuo
}
func (wuo *WeaponUpdateOne) sqlSave(ctx context.Context) (_node *Weapon, err error) {
_spec := &sqlgraph.UpdateSpec{
Node: &sqlgraph.NodeSpec{
@@ -561,6 +582,7 @@ func (wuo *WeaponUpdateOne) sqlSave(ctx context.Context) (_node *Weapon, err err
}
_spec.Edges.Add = append(_spec.Edges.Add, edge)
}
_spec.Modifiers = wuo.modifiers
_node = &Weapon{config: wuo.config}
_spec.Assign = _node.assignValues
_spec.ScanValues = _node.scanValues
@@ -568,7 +590,7 @@ func (wuo *WeaponUpdateOne) sqlSave(ctx context.Context) (_node *Weapon, err err
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{weapon.Label}
} else if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{err.Error(), err}
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return nil, err
}