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