func (nes *NilExampleSelect) Float64s(ctx context.Context) ([]float64, error) {
	if len(nes.fields) > 1 {
		return nil, errors.New("ent: NilExampleSelect.Float64s is not achievable when selecting more than 1 field")
	}
	var v []float64
	if err := nes.Scan(ctx, &v); err != nil {
		return nil, err
	}
	return v, nil
}
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
package ent
import (
	"context"
	"errors"
	"fmt"
	"math"
	"entgo.io/contrib/entproto/internal/todo/ent/nilexample"
	"entgo.io/contrib/entproto/internal/todo/ent/predicate"
	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"entgo.io/ent/schema/field"
)
type NilExampleQuery struct {
	config
	limit      *int
	offset     *int
	unique     *bool
	order      []OrderFunc
	fields     []string
	predicates []predicate.NilExample
	sql  *sql.Selector
	path func(context.Context) (*sql.Selector, error)
}
func (neq *NilExampleQuery) Where(ps ...predicate.NilExample) *NilExampleQuery {
	neq.predicates = append(neq.predicates, ps...)
	return neq
}
func (neq *NilExampleQuery) Limit(limit int) *NilExampleQuery {
	neq.limit = &limit
	return neq
}
func (neq *NilExampleQuery) Offset(offset int) *NilExampleQuery {
	neq.offset = &offset
	return neq
}
func (neq *NilExampleQuery) Unique(unique bool) *NilExampleQuery {
	neq.unique = &unique
	return neq
}
func (neq *NilExampleQuery) Order(o ...OrderFunc) *NilExampleQuery {
	neq.order = append(neq.order, o...)
	return neq
}
func (neq *NilExampleQuery) First(ctx context.Context) (*NilExample, error) {
	nodes, err := neq.Limit(1).All(ctx)
	if err != nil {
		return nil, err
	}
	if len(nodes) == 0 {
		return nil, &NotFoundError{nilexample.Label}
	}
	return nodes[0], nil
}
func (neq *NilExampleQuery) FirstX(ctx context.Context) *NilExample {
	node, err := neq.First(ctx)
	if err != nil && !IsNotFound(err) {
		panic(err)
	}
	return node
}
func (neq *NilExampleQuery) FirstID(ctx context.Context) (id int, err error) {
	var ids []int
	if ids, err = neq.Limit(1).IDs(ctx); err != nil {
		return
	}
	if len(ids) == 0 {
		err = &NotFoundError{nilexample.Label}
		return
	}
	return ids[0], nil
}
func (neq *NilExampleQuery) FirstIDX(ctx context.Context) int {
	id, err := neq.FirstID(ctx)
	if err != nil && !IsNotFound(err) {
		panic(err)
	}
	return id
}
func (neq *NilExampleQuery) Only(ctx context.Context) (*NilExample, error) {
	nodes, err := neq.Limit(2).All(ctx)
	if err != nil {
		return nil, err
	}
	switch len(nodes) {
	case 1:
		return nodes[0], nil
	case 0:
		return nil, &NotFoundError{nilexample.Label}
	default:
		return nil, &NotSingularError{nilexample.Label}
	}
}
func (neq *NilExampleQuery) OnlyX(ctx context.Context) *NilExample {
	node, err := neq.Only(ctx)
	if err != nil {
		panic(err)
	}
	return node
}
func (neq *NilExampleQuery) OnlyID(ctx context.Context) (id int, err error) {
	var ids []int
	if ids, err = neq.Limit(2).IDs(ctx); err != nil {
		return
	}
	switch len(ids) {
	case 1:
		id = ids[0]
	case 0:
		err = &NotFoundError{nilexample.Label}
	default:
		err = &NotSingularError{nilexample.Label}
	}
	return
}
func (neq *NilExampleQuery) OnlyIDX(ctx context.Context) int {
	id, err := neq.OnlyID(ctx)
	if err != nil {
		panic(err)
	}
	return id
}
func (neq *NilExampleQuery) All(ctx context.Context) ([]*NilExample, error) {
	if err := neq.prepareQuery(ctx); err != nil {
		return nil, err
	}
	return neq.sqlAll(ctx)
}
func (neq *NilExampleQuery) AllX(ctx context.Context) []*NilExample {
	nodes, err := neq.All(ctx)
	if err != nil {
		panic(err)
	}
	return nodes
}
func (neq *NilExampleQuery) IDs(ctx context.Context) ([]int, error) {
	var ids []int
	if err := neq.Select(nilexample.FieldID).Scan(ctx, &ids); err != nil {
		return nil, err
	}
	return ids, nil
}
func (neq *NilExampleQuery) IDsX(ctx context.Context) []int {
	ids, err := neq.IDs(ctx)
	if err != nil {
		panic(err)
	}
	return ids
}
func (neq *NilExampleQuery) Count(ctx context.Context) (int, error) {
	if err := neq.prepareQuery(ctx); err != nil {
		return 0, err
	}
	return neq.sqlCount(ctx)
}
func (neq *NilExampleQuery) CountX(ctx context.Context) int {
	count, err := neq.Count(ctx)
	if err != nil {
		panic(err)
	}
	return count
}
func (neq *NilExampleQuery) Exist(ctx context.Context) (bool, error) {
	if err := neq.prepareQuery(ctx); err != nil {
		return false, err
	}
	return neq.sqlExist(ctx)
}
func (neq *NilExampleQuery) ExistX(ctx context.Context) bool {
	exist, err := neq.Exist(ctx)
	if err != nil {
		panic(err)
	}
	return exist
}
func (neq *NilExampleQuery) Clone() *NilExampleQuery {
	if neq == nil {
		return nil
	}
	return &NilExampleQuery{
		config:     neq.config,
		limit:      neq.limit,
		offset:     neq.offset,
		order:      append([]OrderFunc{}, neq.order...),
		predicates: append([]predicate.NilExample{}, neq.predicates...),
		sql:  neq.sql.Clone(),
		path: neq.path,
	}
}
func (neq *NilExampleQuery) GroupBy(field string, fields ...string) *NilExampleGroupBy {
	group := &NilExampleGroupBy{config: neq.config}
	group.fields = append([]string{field}, fields...)
	group.path = func(ctx context.Context) (prev *sql.Selector, err error) {
		if err := neq.prepareQuery(ctx); err != nil {
			return nil, err
		}
		return neq.sqlQuery(ctx), nil
	}
	return group
}
func (neq *NilExampleQuery) Select(fields ...string) *NilExampleSelect {
	neq.fields = append(neq.fields, fields...)
	return &NilExampleSelect{NilExampleQuery: neq}
}
func (neq *NilExampleQuery) prepareQuery(ctx context.Context) error {
	for _, f := range neq.fields {
		if !nilexample.ValidColumn(f) {
			return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
		}
	}
	if neq.path != nil {
		prev, err := neq.path(ctx)
		if err != nil {
			return err
		}
		neq.sql = prev
	}
	return nil
}
func (neq *NilExampleQuery) sqlAll(ctx context.Context) ([]*NilExample, error) {
	var (
		nodes = []*NilExample{}
		_spec = neq.querySpec()
	)
	_spec.ScanValues = func(columns []string) ([]interface{}, error) {
		node := &NilExample{config: neq.config}
		nodes = append(nodes, node)
		return node.scanValues(columns)
	}
	_spec.Assign = func(columns []string, values []interface{}) error {
		if len(nodes) == 0 {
			return fmt.Errorf("ent: Assign called without calling ScanValues")
		}
		node := nodes[len(nodes)-1]
		return node.assignValues(columns, values)
	}
	if err := sqlgraph.QueryNodes(ctx, neq.driver, _spec); err != nil {
		return nil, err
	}
	if len(nodes) == 0 {
		return nodes, nil
	}
	return nodes, nil
}
func (neq *NilExampleQuery) sqlCount(ctx context.Context) (int, error) {
	_spec := neq.querySpec()
	return sqlgraph.CountNodes(ctx, neq.driver, _spec)
}
func (neq *NilExampleQuery) sqlExist(ctx context.Context) (bool, error) {
	n, err := neq.sqlCount(ctx)
	if err != nil {
		return false, fmt.Errorf("ent: check existence: %w", err)
	}
	return n > 0, nil
}
func (neq *NilExampleQuery) querySpec() *sqlgraph.QuerySpec {
	_spec := &sqlgraph.QuerySpec{
		Node: &sqlgraph.NodeSpec{
			Table:   nilexample.Table,
			Columns: nilexample.Columns,
			ID: &sqlgraph.FieldSpec{
				Type:   field.TypeInt,
				Column: nilexample.FieldID,
			},
		},
		From:   neq.sql,
		Unique: true,
	}
	if unique := neq.unique; unique != nil {
		_spec.Unique = *unique
	}
	if fields := neq.fields; len(fields) > 0 {
		_spec.Node.Columns = make([]string, 0, len(fields))
		_spec.Node.Columns = append(_spec.Node.Columns, nilexample.FieldID)
		for i := range fields {
			if fields[i] != nilexample.FieldID {
				_spec.Node.Columns = append(_spec.Node.Columns, fields[i])
			}
		}
	}
	if ps := neq.predicates; len(ps) > 0 {
		_spec.Predicate = func(selector *sql.Selector) {
			for i := range ps {
				ps[i](selector)
			}
		}
	}
	if limit := neq.limit; limit != nil {
		_spec.Limit = *limit
	}
	if offset := neq.offset; offset != nil {
		_spec.Offset = *offset
	}
	if ps := neq.order; len(ps) > 0 {
		_spec.Order = func(selector *sql.Selector) {
			for i := range ps {
				ps[i](selector)
			}
		}
	}
	return _spec
}
func (neq *NilExampleQuery) sqlQuery(ctx context.Context) *sql.Selector {
	builder := sql.Dialect(neq.driver.Dialect())
	t1 := builder.Table(nilexample.Table)
	columns := neq.fields
	if len(columns) == 0 {
		columns = nilexample.Columns
	}
	selector := builder.Select(t1.Columns(columns...)...).From(t1)
	if neq.sql != nil {
		selector = neq.sql
		selector.Select(selector.Columns(columns...)...)
	}
	for _, p := range neq.predicates {
		p(selector)
	}
	for _, p := range neq.order {
		p(selector)
	}
	if offset := neq.offset; offset != nil {
		selector.Offset(*offset).Limit(math.MaxInt32)
	}
	if limit := neq.limit; limit != nil {
		selector.Limit(*limit)
	}
	return selector
}
type NilExampleGroupBy struct {
	config
	fields []string
	fns    []AggregateFunc
	sql  *sql.Selector
	path func(context.Context) (*sql.Selector, error)
}
func (negb *NilExampleGroupBy) Aggregate(fns ...AggregateFunc) *NilExampleGroupBy {
	negb.fns = append(negb.fns, fns...)
	return negb
}
func (negb *NilExampleGroupBy) Scan(ctx context.Context, v interface{}) error {
	query, err := negb.path(ctx)
	if err != nil {
		return err
	}
	negb.sql = query
	return negb.sqlScan(ctx, v)
}
func (negb *NilExampleGroupBy) ScanX(ctx context.Context, v interface{}) {
	if err := negb.Scan(ctx, v); err != nil {
		panic(err)
	}
}
func (negb *NilExampleGroupBy) Strings(ctx context.Context) ([]string, error) {
	if len(negb.fields) > 1 {
		return nil, errors.New("ent: NilExampleGroupBy.Strings is not achievable when grouping more than 1 field")
	}
	var v []string
	if err := negb.Scan(ctx, &v); err != nil {
		return nil, err
	}
	return v, nil
}
func (negb *NilExampleGroupBy) StringsX(ctx context.Context) []string {
	v, err := negb.Strings(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (negb *NilExampleGroupBy) String(ctx context.Context) (_ string, err error) {
	var v []string
	if v, err = negb.Strings(ctx); err != nil {
		return
	}
	switch len(v) {
	case 1:
		return v[0], nil
	case 0:
		err = &NotFoundError{nilexample.Label}
	default:
		err = fmt.Errorf("ent: NilExampleGroupBy.Strings returned %d results when one was expected", len(v))
	}
	return
}
func (negb *NilExampleGroupBy) StringX(ctx context.Context) string {
	v, err := negb.String(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (negb *NilExampleGroupBy) Ints(ctx context.Context) ([]int, error) {
	if len(negb.fields) > 1 {
		return nil, errors.New("ent: NilExampleGroupBy.Ints is not achievable when grouping more than 1 field")
	}
	var v []int
	if err := negb.Scan(ctx, &v); err != nil {
		return nil, err
	}
	return v, nil
}
func (negb *NilExampleGroupBy) IntsX(ctx context.Context) []int {
	v, err := negb.Ints(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (negb *NilExampleGroupBy) Int(ctx context.Context) (_ int, err error) {
	var v []int
	if v, err = negb.Ints(ctx); err != nil {
		return
	}
	switch len(v) {
	case 1:
		return v[0], nil
	case 0:
		err = &NotFoundError{nilexample.Label}
	default:
		err = fmt.Errorf("ent: NilExampleGroupBy.Ints returned %d results when one was expected", len(v))
	}
	return
}
func (negb *NilExampleGroupBy) IntX(ctx context.Context) int {
	v, err := negb.Int(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (negb *NilExampleGroupBy) Float64s(ctx context.Context) ([]float64, error) {
	if len(negb.fields) > 1 {
		return nil, errors.New("ent: NilExampleGroupBy.Float64s is not achievable when grouping more than 1 field")
	}
	var v []float64
	if err := negb.Scan(ctx, &v); err != nil {
		return nil, err
	}
	return v, nil
}
func (negb *NilExampleGroupBy) Float64sX(ctx context.Context) []float64 {
	v, err := negb.Float64s(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (negb *NilExampleGroupBy) Float64(ctx context.Context) (_ float64, err error) {
	var v []float64
	if v, err = negb.Float64s(ctx); err != nil {
		return
	}
	switch len(v) {
	case 1:
		return v[0], nil
	case 0:
		err = &NotFoundError{nilexample.Label}
	default:
		err = fmt.Errorf("ent: NilExampleGroupBy.Float64s returned %d results when one was expected", len(v))
	}
	return
}
func (negb *NilExampleGroupBy) Float64X(ctx context.Context) float64 {
	v, err := negb.Float64(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (negb *NilExampleGroupBy) Bools(ctx context.Context) ([]bool, error) {
	if len(negb.fields) > 1 {
		return nil, errors.New("ent: NilExampleGroupBy.Bools is not achievable when grouping more than 1 field")
	}
	var v []bool
	if err := negb.Scan(ctx, &v); err != nil {
		return nil, err
	}
	return v, nil
}
func (negb *NilExampleGroupBy) BoolsX(ctx context.Context) []bool {
	v, err := negb.Bools(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (negb *NilExampleGroupBy) Bool(ctx context.Context) (_ bool, err error) {
	var v []bool
	if v, err = negb.Bools(ctx); err != nil {
		return
	}
	switch len(v) {
	case 1:
		return v[0], nil
	case 0:
		err = &NotFoundError{nilexample.Label}
	default:
		err = fmt.Errorf("ent: NilExampleGroupBy.Bools returned %d results when one was expected", len(v))
	}
	return
}
func (negb *NilExampleGroupBy) BoolX(ctx context.Context) bool {
	v, err := negb.Bool(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (negb *NilExampleGroupBy) sqlScan(ctx context.Context, v interface{}) error {
	for _, f := range negb.fields {
		if !nilexample.ValidColumn(f) {
			return &ValidationError{Name: f, err: fmt.Errorf("invalid field %q for group-by", f)}
		}
	}
	selector := negb.sqlQuery()
	if err := selector.Err(); err != nil {
		return err
	}
	rows := &sql.Rows{}
	query, args := selector.Query()
	if err := negb.driver.Query(ctx, query, args, rows); err != nil {
		return err
	}
	defer rows.Close()
	return sql.ScanSlice(rows, v)
}
func (negb *NilExampleGroupBy) sqlQuery() *sql.Selector {
	selector := negb.sql.Select()
	aggregation := make([]string, 0, len(negb.fns))
	for _, fn := range negb.fns {
		aggregation = append(aggregation, fn(selector))
	}
	if len(selector.SelectedColumns()) == 0 {
		columns := make([]string, 0, len(negb.fields)+len(negb.fns))
		for _, f := range negb.fields {
			columns = append(columns, selector.C(f))
		}
		for _, c := range aggregation {
			columns = append(columns, c)
		}
		selector.Select(columns...)
	}
	return selector.GroupBy(selector.Columns(negb.fields...)...)
}
type NilExampleSelect struct {
	*NilExampleQuery
	sql *sql.Selector
}
func (nes *NilExampleSelect) Scan(ctx context.Context, v interface{}) error {
	if err := nes.prepareQuery(ctx); err != nil {
		return err
	}
	nes.sql = nes.NilExampleQuery.sqlQuery(ctx)
	return nes.sqlScan(ctx, v)
}
func (nes *NilExampleSelect) ScanX(ctx context.Context, v interface{}) {
	if err := nes.Scan(ctx, v); err != nil {
		panic(err)
	}
}
func (nes *NilExampleSelect) Strings(ctx context.Context) ([]string, error) {
	if len(nes.fields) > 1 {
		return nil, errors.New("ent: NilExampleSelect.Strings is not achievable when selecting more than 1 field")
	}
	var v []string
	if err := nes.Scan(ctx, &v); err != nil {
		return nil, err
	}
	return v, nil
}
func (nes *NilExampleSelect) StringsX(ctx context.Context) []string {
	v, err := nes.Strings(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (nes *NilExampleSelect) String(ctx context.Context) (_ string, err error) {
	var v []string
	if v, err = nes.Strings(ctx); err != nil {
		return
	}
	switch len(v) {
	case 1:
		return v[0], nil
	case 0:
		err = &NotFoundError{nilexample.Label}
	default:
		err = fmt.Errorf("ent: NilExampleSelect.Strings returned %d results when one was expected", len(v))
	}
	return
}
func (nes *NilExampleSelect) StringX(ctx context.Context) string {
	v, err := nes.String(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (nes *NilExampleSelect) Ints(ctx context.Context) ([]int, error) {
	if len(nes.fields) > 1 {
		return nil, errors.New("ent: NilExampleSelect.Ints is not achievable when selecting more than 1 field")
	}
	var v []int
	if err := nes.Scan(ctx, &v); err != nil {
		return nil, err
	}
	return v, nil
}
func (nes *NilExampleSelect) IntsX(ctx context.Context) []int {
	v, err := nes.Ints(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (nes *NilExampleSelect) Int(ctx context.Context) (_ int, err error) {
	var v []int
	if v, err = nes.Ints(ctx); err != nil {
		return
	}
	switch len(v) {
	case 1:
		return v[0], nil
	case 0:
		err = &NotFoundError{nilexample.Label}
	default:
		err = fmt.Errorf("ent: NilExampleSelect.Ints returned %d results when one was expected", len(v))
	}
	return
}
func (nes *NilExampleSelect) IntX(ctx context.Context) int {
	v, err := nes.Int(ctx)
	if err != nil {
		panic(err)
	}
	return v
}