updated deps; switched sitemap lib; ent regen
This commit is contained in:
@@ -113,34 +113,7 @@ func (rsu *RoundStatsUpdate) ClearMatchPlayer() *RoundStatsUpdate {
|
||||
|
||||
// Save executes the query and returns the number of nodes affected by the update operation.
|
||||
func (rsu *RoundStatsUpdate) Save(ctx context.Context) (int, error) {
|
||||
var (
|
||||
err error
|
||||
affected int
|
||||
)
|
||||
if len(rsu.hooks) == 0 {
|
||||
affected, err = rsu.sqlSave(ctx)
|
||||
} else {
|
||||
var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
|
||||
mutation, ok := m.(*RoundStatsMutation)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unexpected mutation type %T", m)
|
||||
}
|
||||
rsu.mutation = mutation
|
||||
affected, err = rsu.sqlSave(ctx)
|
||||
mutation.done = true
|
||||
return affected, err
|
||||
})
|
||||
for i := len(rsu.hooks) - 1; i >= 0; i-- {
|
||||
if rsu.hooks[i] == nil {
|
||||
return 0, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)")
|
||||
}
|
||||
mut = rsu.hooks[i](mut)
|
||||
}
|
||||
if _, err := mut.Mutate(ctx, rsu.mutation); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
return affected, err
|
||||
return withHooks[int, RoundStatsMutation](ctx, rsu.sqlSave, rsu.mutation, rsu.hooks)
|
||||
}
|
||||
|
||||
// SaveX is like Save, but panics if an error occurs.
|
||||
@@ -172,16 +145,7 @@ func (rsu *RoundStatsUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *Ro
|
||||
}
|
||||
|
||||
func (rsu *RoundStatsUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
_spec := &sqlgraph.UpdateSpec{
|
||||
Node: &sqlgraph.NodeSpec{
|
||||
Table: roundstats.Table,
|
||||
Columns: roundstats.Columns,
|
||||
ID: &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: roundstats.FieldID,
|
||||
},
|
||||
},
|
||||
}
|
||||
_spec := sqlgraph.NewUpdateSpec(roundstats.Table, roundstats.Columns, sqlgraph.NewFieldSpec(roundstats.FieldID, field.TypeInt))
|
||||
if ps := rsu.mutation.predicates; len(ps) > 0 {
|
||||
_spec.Predicate = func(selector *sql.Selector) {
|
||||
for i := range ps {
|
||||
@@ -257,6 +221,7 @@ func (rsu *RoundStatsUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
return 0, err
|
||||
}
|
||||
rsu.mutation.done = true
|
||||
return n, nil
|
||||
}
|
||||
|
||||
@@ -351,6 +316,12 @@ func (rsuo *RoundStatsUpdateOne) ClearMatchPlayer() *RoundStatsUpdateOne {
|
||||
return rsuo
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the RoundStatsUpdate builder.
|
||||
func (rsuo *RoundStatsUpdateOne) Where(ps ...predicate.RoundStats) *RoundStatsUpdateOne {
|
||||
rsuo.mutation.Where(ps...)
|
||||
return rsuo
|
||||
}
|
||||
|
||||
// Select allows selecting one or more fields (columns) of the returned entity.
|
||||
// The default is selecting all fields defined in the entity schema.
|
||||
func (rsuo *RoundStatsUpdateOne) Select(field string, fields ...string) *RoundStatsUpdateOne {
|
||||
@@ -360,40 +331,7 @@ func (rsuo *RoundStatsUpdateOne) Select(field string, fields ...string) *RoundSt
|
||||
|
||||
// Save executes the query and returns the updated RoundStats entity.
|
||||
func (rsuo *RoundStatsUpdateOne) Save(ctx context.Context) (*RoundStats, error) {
|
||||
var (
|
||||
err error
|
||||
node *RoundStats
|
||||
)
|
||||
if len(rsuo.hooks) == 0 {
|
||||
node, err = rsuo.sqlSave(ctx)
|
||||
} else {
|
||||
var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
|
||||
mutation, ok := m.(*RoundStatsMutation)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unexpected mutation type %T", m)
|
||||
}
|
||||
rsuo.mutation = mutation
|
||||
node, err = rsuo.sqlSave(ctx)
|
||||
mutation.done = true
|
||||
return node, err
|
||||
})
|
||||
for i := len(rsuo.hooks) - 1; i >= 0; i-- {
|
||||
if rsuo.hooks[i] == nil {
|
||||
return nil, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)")
|
||||
}
|
||||
mut = rsuo.hooks[i](mut)
|
||||
}
|
||||
v, err := mut.Mutate(ctx, rsuo.mutation)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
nv, ok := v.(*RoundStats)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unexpected node type %T returned from RoundStatsMutation", v)
|
||||
}
|
||||
node = nv
|
||||
}
|
||||
return node, err
|
||||
return withHooks[*RoundStats, RoundStatsMutation](ctx, rsuo.sqlSave, rsuo.mutation, rsuo.hooks)
|
||||
}
|
||||
|
||||
// SaveX is like Save, but panics if an error occurs.
|
||||
@@ -425,16 +363,7 @@ func (rsuo *RoundStatsUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder))
|
||||
}
|
||||
|
||||
func (rsuo *RoundStatsUpdateOne) sqlSave(ctx context.Context) (_node *RoundStats, err error) {
|
||||
_spec := &sqlgraph.UpdateSpec{
|
||||
Node: &sqlgraph.NodeSpec{
|
||||
Table: roundstats.Table,
|
||||
Columns: roundstats.Columns,
|
||||
ID: &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: roundstats.FieldID,
|
||||
},
|
||||
},
|
||||
}
|
||||
_spec := sqlgraph.NewUpdateSpec(roundstats.Table, roundstats.Columns, sqlgraph.NewFieldSpec(roundstats.FieldID, field.TypeInt))
|
||||
id, ok := rsuo.mutation.ID()
|
||||
if !ok {
|
||||
return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "RoundStats.id" for update`)}
|
||||
@@ -530,5 +459,6 @@ func (rsuo *RoundStatsUpdateOne) sqlSave(ctx context.Context) (_node *RoundStats
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
rsuo.mutation.done = true
|
||||
return _node, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user