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 (
|
||||
// MessagesUpdate is the builder for updating Messages entities.
|
||||
type MessagesUpdate struct {
|
||||
config
|
||||
hooks []Hook
|
||||
mutation *MessagesMutation
|
||||
hooks []Hook
|
||||
mutation *MessagesMutation
|
||||
modifiers []func(*sql.UpdateBuilder)
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the MessagesUpdate builder.
|
||||
@@ -137,6 +138,12 @@ func (mu *MessagesUpdate) ExecX(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
|
||||
func (mu *MessagesUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *MessagesUpdate {
|
||||
mu.modifiers = append(mu.modifiers, modifiers...)
|
||||
return mu
|
||||
}
|
||||
|
||||
func (mu *MessagesUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
_spec := &sqlgraph.UpdateSpec{
|
||||
Node: &sqlgraph.NodeSpec{
|
||||
@@ -218,11 +225,12 @@ func (mu *MessagesUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
_spec.Modifiers = mu.modifiers
|
||||
if n, err = sqlgraph.UpdateNodes(ctx, mu.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{messages.Label}
|
||||
} else if sqlgraph.IsConstraintError(err) {
|
||||
err = &ConstraintError{err.Error(), err}
|
||||
err = &ConstraintError{msg: err.Error(), wrap: err}
|
||||
}
|
||||
return 0, err
|
||||
}
|
||||
@@ -232,9 +240,10 @@ func (mu *MessagesUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
// MessagesUpdateOne is the builder for updating a single Messages entity.
|
||||
type MessagesUpdateOne struct {
|
||||
config
|
||||
fields []string
|
||||
hooks []Hook
|
||||
mutation *MessagesMutation
|
||||
fields []string
|
||||
hooks []Hook
|
||||
mutation *MessagesMutation
|
||||
modifiers []func(*sql.UpdateBuilder)
|
||||
}
|
||||
|
||||
// SetMessage sets the "message" field.
|
||||
@@ -324,9 +333,15 @@ func (muo *MessagesUpdateOne) Save(ctx context.Context) (*Messages, error) {
|
||||
}
|
||||
mut = muo.hooks[i](mut)
|
||||
}
|
||||
if _, err := mut.Mutate(ctx, muo.mutation); err != nil {
|
||||
v, err := mut.Mutate(ctx, muo.mutation)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
nv, ok := v.(*Messages)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unexpected node type %T returned from MessagesMutation", v)
|
||||
}
|
||||
node = nv
|
||||
}
|
||||
return node, err
|
||||
}
|
||||
@@ -353,6 +368,12 @@ func (muo *MessagesUpdateOne) ExecX(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
|
||||
func (muo *MessagesUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *MessagesUpdateOne {
|
||||
muo.modifiers = append(muo.modifiers, modifiers...)
|
||||
return muo
|
||||
}
|
||||
|
||||
func (muo *MessagesUpdateOne) sqlSave(ctx context.Context) (_node *Messages, err error) {
|
||||
_spec := &sqlgraph.UpdateSpec{
|
||||
Node: &sqlgraph.NodeSpec{
|
||||
@@ -451,6 +472,7 @@ func (muo *MessagesUpdateOne) sqlSave(ctx context.Context) (_node *Messages, err
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
_spec.Modifiers = muo.modifiers
|
||||
_node = &Messages{config: muo.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
_spec.ScanValues = _node.scanValues
|
||||
@@ -458,7 +480,7 @@ func (muo *MessagesUpdateOne) sqlSave(ctx context.Context) (_node *Messages, err
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{messages.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