func (neq *NilExampleQuery) IDsX(ctx context.Context) []int {
	ids, err := neq.IDs(ctx)
	if err != nil {
		panic(err)
	}
	return ids
}
IDsX is like IDs, but panics if an error occurs.
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
}