chores/general-cleanup-release-prep (#31)

* do ent generation

* update edges

* fix redirect
This commit is contained in:
Hayden 2022-09-28 21:42:33 -08:00 committed by GitHub
parent 8a43fc953d
commit 1ca430af21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 785 additions and 765 deletions

View file

@ -402,10 +402,10 @@ func (uq *UserQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*User, e
if withFKs {
_spec.Node.Columns = append(_spec.Node.Columns, user.ForeignKeys...)
}
_spec.ScanValues = func(columns []string) ([]interface{}, error) {
_spec.ScanValues = func(columns []string) ([]any, error) {
return (*User).scanValues(nil, columns)
}
_spec.Assign = func(columns []string, values []interface{}) error {
_spec.Assign = func(columns []string, values []any) error {
node := &User{config: uq.config}
nodes = append(nodes, node)
node.Edges.loadedTypes = loadedTypes
@ -507,11 +507,14 @@ func (uq *UserQuery) sqlCount(ctx context.Context) (int, error) {
}
func (uq *UserQuery) sqlExist(ctx context.Context) (bool, error) {
n, err := uq.sqlCount(ctx)
if err != nil {
switch _, err := uq.FirstID(ctx); {
case IsNotFound(err):
return false, nil
case err != nil:
return false, fmt.Errorf("ent: check existence: %w", err)
default:
return true, nil
}
return n > 0, nil
}
func (uq *UserQuery) querySpec() *sqlgraph.QuerySpec {
@ -612,7 +615,7 @@ func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy {
}
// Scan applies the group-by query and scans the result into the given value.
func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error {
func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error {
query, err := ugb.path(ctx)
if err != nil {
return err
@ -621,7 +624,7 @@ func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error {
return ugb.sqlScan(ctx, v)
}
func (ugb *UserGroupBy) sqlScan(ctx context.Context, v interface{}) error {
func (ugb *UserGroupBy) sqlScan(ctx context.Context, v any) error {
for _, f := range ugb.fields {
if !user.ValidColumn(f) {
return &ValidationError{Name: f, err: fmt.Errorf("invalid field %q for group-by", f)}
@ -668,7 +671,7 @@ type UserSelect struct {
}
// Scan applies the selector query and scans the result into the given value.
func (us *UserSelect) Scan(ctx context.Context, v interface{}) error {
func (us *UserSelect) Scan(ctx context.Context, v any) error {
if err := us.prepareQuery(ctx); err != nil {
return err
}
@ -676,7 +679,7 @@ func (us *UserSelect) Scan(ctx context.Context, v interface{}) error {
return us.sqlScan(ctx, v)
}
func (us *UserSelect) sqlScan(ctx context.Context, v interface{}) error {
func (us *UserSelect) sqlScan(ctx context.Context, v any) error {
rows := &sql.Rows{}
query, args := us.sql.Query()
if err := us.driver.Query(ctx, query, args, rows); err != nil {