updated deps; switched sitemap lib; ent regen

This commit is contained in:
2023-03-03 20:10:31 +01:00
parent e9a5daa9e3
commit 727d530378
52 changed files with 2626 additions and 5665 deletions

View File

@@ -4,7 +4,6 @@ package ent
import (
"context"
"fmt"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
@@ -28,34 +27,7 @@ func (rsd *RoundStatsDelete) Where(ps ...predicate.RoundStats) *RoundStatsDelete
// Exec executes the deletion query and returns how many vertices were deleted.
func (rsd *RoundStatsDelete) Exec(ctx context.Context) (int, error) {
var (
err error
affected int
)
if len(rsd.hooks) == 0 {
affected, err = rsd.sqlExec(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)
}
rsd.mutation = mutation
affected, err = rsd.sqlExec(ctx)
mutation.done = true
return affected, err
})
for i := len(rsd.hooks) - 1; i >= 0; i-- {
if rsd.hooks[i] == nil {
return 0, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)")
}
mut = rsd.hooks[i](mut)
}
if _, err := mut.Mutate(ctx, rsd.mutation); err != nil {
return 0, err
}
}
return affected, err
return withHooks[int, RoundStatsMutation](ctx, rsd.sqlExec, rsd.mutation, rsd.hooks)
}
// ExecX is like Exec, but panics if an error occurs.
@@ -68,15 +40,7 @@ func (rsd *RoundStatsDelete) ExecX(ctx context.Context) int {
}
func (rsd *RoundStatsDelete) sqlExec(ctx context.Context) (int, error) {
_spec := &sqlgraph.DeleteSpec{
Node: &sqlgraph.NodeSpec{
Table: roundstats.Table,
ID: &sqlgraph.FieldSpec{
Type: field.TypeInt,
Column: roundstats.FieldID,
},
},
}
_spec := sqlgraph.NewDeleteSpec(roundstats.Table, sqlgraph.NewFieldSpec(roundstats.FieldID, field.TypeInt))
if ps := rsd.mutation.predicates; len(ps) > 0 {
_spec.Predicate = func(selector *sql.Selector) {
for i := range ps {
@@ -88,6 +52,7 @@ func (rsd *RoundStatsDelete) sqlExec(ctx context.Context) (int, error) {
if err != nil && sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
rsd.mutation.done = true
return affected, err
}
@@ -96,6 +61,12 @@ type RoundStatsDeleteOne struct {
rsd *RoundStatsDelete
}
// Where appends a list predicates to the RoundStatsDelete builder.
func (rsdo *RoundStatsDeleteOne) Where(ps ...predicate.RoundStats) *RoundStatsDeleteOne {
rsdo.rsd.mutation.Where(ps...)
return rsdo
}
// Exec executes the deletion query.
func (rsdo *RoundStatsDeleteOne) Exec(ctx context.Context) error {
n, err := rsdo.rsd.Exec(ctx)
@@ -111,5 +82,7 @@ func (rsdo *RoundStatsDeleteOne) Exec(ctx context.Context) error {
// ExecX is like Exec, but panics if an error occurs.
func (rsdo *RoundStatsDeleteOne) ExecX(ctx context.Context) {
rsdo.rsd.ExecX(ctx)
if err := rsdo.Exec(ctx); err != nil {
panic(err)
}
}