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