func (bps *BlogPostSelect) Int(ctx context.Context) (_ int, err error) {
	var v []int
	if v, err = bps.Ints(ctx); err != nil {
		return
	}
	switch len(v) {
	case 1:
		return v[0], nil
	case 0:
		err = &NotFoundError{blogpost.Label}
	default:
		err = fmt.Errorf("ent: BlogPostSelect.Ints returned %d results when one was expected", len(v))
	}
	return
}
Int returns a single int from a selector. It is only allowed when selecting one field.
package ent
import (
	"context"
	"database/sql/driver"
	"errors"
	"fmt"
	"math"
	"entgo.io/contrib/entproto/internal/entprototest/ent/blogpost"
	"entgo.io/contrib/entproto/internal/entprototest/ent/category"
	"entgo.io/contrib/entproto/internal/entprototest/ent/predicate"
	"entgo.io/contrib/entproto/internal/entprototest/ent/user"
	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"entgo.io/ent/schema/field"
)
type BlogPostQuery struct {
	config
	limit      *int
	offset     *int
	unique     *bool
	order      []OrderFunc
	fields     []string
	predicates []predicate.BlogPost
	withAuthor     *UserQuery
	withCategories *CategoryQuery
	withFKs        bool
	sql  *sql.Selector
	path func(context.Context) (*sql.Selector, error)
}
func (bpq *BlogPostQuery) Where(ps ...predicate.BlogPost) *BlogPostQuery {
	bpq.predicates = append(bpq.predicates, ps...)
	return bpq
}
func (bpq *BlogPostQuery) Limit(limit int) *BlogPostQuery {
	bpq.limit = &limit
	return bpq
}
func (bpq *BlogPostQuery) Offset(offset int) *BlogPostQuery {
	bpq.offset = &offset
	return bpq
}
func (bpq *BlogPostQuery) Unique(unique bool) *BlogPostQuery {
	bpq.unique = &unique
	return bpq
}
func (bpq *BlogPostQuery) Order(o ...OrderFunc) *BlogPostQuery {
	bpq.order = append(bpq.order, o...)
	return bpq
}
func (bpq *BlogPostQuery) QueryAuthor() *UserQuery {
	query := &UserQuery{config: bpq.config}
	query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
		if err := bpq.prepareQuery(ctx); err != nil {
			return nil, err
		}
		selector := bpq.sqlQuery(ctx)
		if err := selector.Err(); err != nil {
			return nil, err
		}
		step := sqlgraph.NewStep(
			sqlgraph.From(blogpost.Table, blogpost.FieldID, selector),
			sqlgraph.To(user.Table, user.FieldID),
			sqlgraph.Edge(sqlgraph.M2O, false, blogpost.AuthorTable, blogpost.AuthorColumn),
		)
		fromU = sqlgraph.SetNeighbors(bpq.driver.Dialect(), step)
		return fromU, nil
	}
	return query
}
func (bpq *BlogPostQuery) QueryCategories() *CategoryQuery {
	query := &CategoryQuery{config: bpq.config}
	query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
		if err := bpq.prepareQuery(ctx); err != nil {
			return nil, err
		}
		selector := bpq.sqlQuery(ctx)
		if err := selector.Err(); err != nil {
			return nil, err
		}
		step := sqlgraph.NewStep(
			sqlgraph.From(blogpost.Table, blogpost.FieldID, selector),
			sqlgraph.To(category.Table, category.FieldID),
			sqlgraph.Edge(sqlgraph.M2M, true, blogpost.CategoriesTable, blogpost.CategoriesPrimaryKey...),
		)
		fromU = sqlgraph.SetNeighbors(bpq.driver.Dialect(), step)
		return fromU, nil
	}
	return query
}
func (bpq *BlogPostQuery) First(ctx context.Context) (*BlogPost, error) {
	nodes, err := bpq.Limit(1).All(ctx)
	if err != nil {
		return nil, err
	}
	if len(nodes) == 0 {
		return nil, &NotFoundError{blogpost.Label}
	}
	return nodes[0], nil
}
func (bpq *BlogPostQuery) FirstX(ctx context.Context) *BlogPost {
	node, err := bpq.First(ctx)
	if err != nil && !IsNotFound(err) {
		panic(err)
	}
	return node
}
func (bpq *BlogPostQuery) FirstID(ctx context.Context) (id int, err error) {
	var ids []int
	if ids, err = bpq.Limit(1).IDs(ctx); err != nil {
		return
	}
	if len(ids) == 0 {
		err = &NotFoundError{blogpost.Label}
		return
	}
	return ids[0], nil
}
func (bpq *BlogPostQuery) FirstIDX(ctx context.Context) int {
	id, err := bpq.FirstID(ctx)
	if err != nil && !IsNotFound(err) {
		panic(err)
	}
	return id
}
func (bpq *BlogPostQuery) Only(ctx context.Context) (*BlogPost, error) {
	nodes, err := bpq.Limit(2).All(ctx)
	if err != nil {
		return nil, err
	}
	switch len(nodes) {
	case 1:
		return nodes[0], nil
	case 0:
		return nil, &NotFoundError{blogpost.Label}
	default:
		return nil, &NotSingularError{blogpost.Label}
	}
}
func (bpq *BlogPostQuery) OnlyX(ctx context.Context) *BlogPost {
	node, err := bpq.Only(ctx)
	if err != nil {
		panic(err)
	}
	return node
}
func (bpq *BlogPostQuery) OnlyID(ctx context.Context) (id int, err error) {
	var ids []int
	if ids, err = bpq.Limit(2).IDs(ctx); err != nil {
		return
	}
	switch len(ids) {
	case 1:
		id = ids[0]
	case 0:
		err = &NotFoundError{blogpost.Label}
	default:
		err = &NotSingularError{blogpost.Label}
	}
	return
}
func (bpq *BlogPostQuery) OnlyIDX(ctx context.Context) int {
	id, err := bpq.OnlyID(ctx)
	if err != nil {
		panic(err)
	}
	return id
}
func (bpq *BlogPostQuery) All(ctx context.Context) ([]*BlogPost, error) {
	if err := bpq.prepareQuery(ctx); err != nil {
		return nil, err
	}
	return bpq.sqlAll(ctx)
}
func (bpq *BlogPostQuery) AllX(ctx context.Context) []*BlogPost {
	nodes, err := bpq.All(ctx)
	if err != nil {
		panic(err)
	}
	return nodes
}
func (bpq *BlogPostQuery) IDs(ctx context.Context) ([]int, error) {
	var ids []int
	if err := bpq.Select(blogpost.FieldID).Scan(ctx, &ids); err != nil {
		return nil, err
	}
	return ids, nil
}
func (bpq *BlogPostQuery) IDsX(ctx context.Context) []int {
	ids, err := bpq.IDs(ctx)
	if err != nil {
		panic(err)
	}
	return ids
}
func (bpq *BlogPostQuery) Count(ctx context.Context) (int, error) {
	if err := bpq.prepareQuery(ctx); err != nil {
		return 0, err
	}
	return bpq.sqlCount(ctx)
}
func (bpq *BlogPostQuery) CountX(ctx context.Context) int {
	count, err := bpq.Count(ctx)
	if err != nil {
		panic(err)
	}
	return count
}
func (bpq *BlogPostQuery) Exist(ctx context.Context) (bool, error) {
	if err := bpq.prepareQuery(ctx); err != nil {
		return false, err
	}
	return bpq.sqlExist(ctx)
}
func (bpq *BlogPostQuery) ExistX(ctx context.Context) bool {
	exist, err := bpq.Exist(ctx)
	if err != nil {
		panic(err)
	}
	return exist
}
func (bpq *BlogPostQuery) Clone() *BlogPostQuery {
	if bpq == nil {
		return nil
	}
	return &BlogPostQuery{
		config:         bpq.config,
		limit:          bpq.limit,
		offset:         bpq.offset,
		order:          append([]OrderFunc{}, bpq.order...),
		predicates:     append([]predicate.BlogPost{}, bpq.predicates...),
		withAuthor:     bpq.withAuthor.Clone(),
		withCategories: bpq.withCategories.Clone(),
		sql:  bpq.sql.Clone(),
		path: bpq.path,
	}
}
func (bpq *BlogPostQuery) WithAuthor(opts ...func(*UserQuery)) *BlogPostQuery {
	query := &UserQuery{config: bpq.config}
	for _, opt := range opts {
		opt(query)
	}
	bpq.withAuthor = query
	return bpq
}
func (bpq *BlogPostQuery) WithCategories(opts ...func(*CategoryQuery)) *BlogPostQuery {
	query := &CategoryQuery{config: bpq.config}
	for _, opt := range opts {
		opt(query)
	}
	bpq.withCategories = query
	return bpq
}
func (bpq *BlogPostQuery) GroupBy(field string, fields ...string) *BlogPostGroupBy {
	group := &BlogPostGroupBy{config: bpq.config}
	group.fields = append([]string{field}, fields...)
	group.path = func(ctx context.Context) (prev *sql.Selector, err error) {
		if err := bpq.prepareQuery(ctx); err != nil {
			return nil, err
		}
		return bpq.sqlQuery(ctx), nil
	}
	return group
}
func (bpq *BlogPostQuery) Select(fields ...string) *BlogPostSelect {
	bpq.fields = append(bpq.fields, fields...)
	return &BlogPostSelect{BlogPostQuery: bpq}
}
func (bpq *BlogPostQuery) prepareQuery(ctx context.Context) error {
	for _, f := range bpq.fields {
		if !blogpost.ValidColumn(f) {
			return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
		}
	}
	if bpq.path != nil {
		prev, err := bpq.path(ctx)
		if err != nil {
			return err
		}
		bpq.sql = prev
	}
	return nil
}
func (bpq *BlogPostQuery) sqlAll(ctx context.Context) ([]*BlogPost, error) {
	var (
		nodes       = []*BlogPost{}
		withFKs     = bpq.withFKs
		_spec       = bpq.querySpec()
		loadedTypes = [2]bool{
			bpq.withAuthor != nil,
			bpq.withCategories != nil,
		}
	)
	if bpq.withAuthor != nil {
		withFKs = true
	}
	if withFKs {
		_spec.Node.Columns = append(_spec.Node.Columns, blogpost.ForeignKeys...)
	}
	_spec.ScanValues = func(columns []string) ([]interface{}, error) {
		node := &BlogPost{config: bpq.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]
		node.Edges.loadedTypes = loadedTypes
		return node.assignValues(columns, values)
	}
	if err := sqlgraph.QueryNodes(ctx, bpq.driver, _spec); err != nil {
		return nil, err
	}
	if len(nodes) == 0 {
		return nodes, nil
	}
	if query := bpq.withAuthor; query != nil {
		ids := make([]int, 0, len(nodes))
		nodeids := make(map[int][]*BlogPost)
		for i := range nodes {
			if nodes[i].blog_post_author == nil {
				continue
			}
			fk := *nodes[i].blog_post_author
			if _, ok := nodeids[fk]; !ok {
				ids = append(ids, fk)
			}
			nodeids[fk] = append(nodeids[fk], nodes[i])
		}
		query.Where(user.IDIn(ids...))
		neighbors, err := query.All(ctx)
		if err != nil {
			return nil, err
		}
		for _, n := range neighbors {
			nodes, ok := nodeids[n.ID]
			if !ok {
				return nil, fmt.Errorf(`unexpected foreign-key "blog_post_author" returned %v`, n.ID)
			}
			for i := range nodes {
				nodes[i].Edges.Author = n
			}
		}
	}
	if query := bpq.withCategories; query != nil {
		fks := make([]driver.Value, 0, len(nodes))
		ids := make(map[int]*BlogPost, len(nodes))
		for _, node := range nodes {
			ids[node.ID] = node
			fks = append(fks, node.ID)
			node.Edges.Categories = []*Category{}
		}
		var (
			edgeids []int
			edges   = make(map[int][]*BlogPost)
		)
		_spec := &sqlgraph.EdgeQuerySpec{
			Edge: &sqlgraph.EdgeSpec{
				Inverse: true,
				Table:   blogpost.CategoriesTable,
				Columns: blogpost.CategoriesPrimaryKey,
			},
			Predicate: func(s *sql.Selector) {
				s.Where(sql.InValues(blogpost.CategoriesPrimaryKey[1], fks...))
			},
			ScanValues: func() [2]interface{} {
				return [2]interface{}{new(sql.NullInt64), new(sql.NullInt64)}
			},
			Assign: func(out, in interface{}) error {
				eout, ok := out.(*sql.NullInt64)
				if !ok || eout == nil {
					return fmt.Errorf("unexpected id value for edge-out")
				}
				ein, ok := in.(*sql.NullInt64)
				if !ok || ein == nil {
					return fmt.Errorf("unexpected id value for edge-in")
				}
				outValue := int(eout.Int64)
				inValue := int(ein.Int64)
				node, ok := ids[outValue]
				if !ok {
					return fmt.Errorf("unexpected node id in edges: %v", outValue)
				}
				if _, ok := edges[inValue]; !ok {
					edgeids = append(edgeids, inValue)
				}
				edges[inValue] = append(edges[inValue], node)
				return nil
			},
		}
		if err := sqlgraph.QueryEdges(ctx, bpq.driver, _spec); err != nil {
			return nil, fmt.Errorf(`query edges "categories": %w`, err)
		}
		query.Where(category.IDIn(edgeids...))
		neighbors, err := query.All(ctx)
		if err != nil {
			return nil, err
		}
		for _, n := range neighbors {
			nodes, ok := edges[n.ID]
			if !ok {
				return nil, fmt.Errorf(`unexpected "categories" node returned %v`, n.ID)
			}
			for i := range nodes {
				nodes[i].Edges.Categories = append(nodes[i].Edges.Categories, n)
			}
		}
	}
	return nodes, nil
}
func (bpq *BlogPostQuery) sqlCount(ctx context.Context) (int, error) {
	_spec := bpq.querySpec()
	return sqlgraph.CountNodes(ctx, bpq.driver, _spec)
}
func (bpq *BlogPostQuery) sqlExist(ctx context.Context) (bool, error) {
	n, err := bpq.sqlCount(ctx)
	if err != nil {
		return false, fmt.Errorf("ent: check existence: %w", err)
	}
	return n > 0, nil
}
func (bpq *BlogPostQuery) querySpec() *sqlgraph.QuerySpec {
	_spec := &sqlgraph.QuerySpec{
		Node: &sqlgraph.NodeSpec{
			Table:   blogpost.Table,
			Columns: blogpost.Columns,
			ID: &sqlgraph.FieldSpec{
				Type:   field.TypeInt,
				Column: blogpost.FieldID,
			},
		},
		From:   bpq.sql,
		Unique: true,
	}
	if unique := bpq.unique; unique != nil {
		_spec.Unique = *unique
	}
	if fields := bpq.fields; len(fields) > 0 {
		_spec.Node.Columns = make([]string, 0, len(fields))
		_spec.Node.Columns = append(_spec.Node.Columns, blogpost.FieldID)
		for i := range fields {
			if fields[i] != blogpost.FieldID {
				_spec.Node.Columns = append(_spec.Node.Columns, fields[i])
			}
		}
	}
	if ps := bpq.predicates; len(ps) > 0 {
		_spec.Predicate = func(selector *sql.Selector) {
			for i := range ps {
				ps[i](selector)
			}
		}
	}
	if limit := bpq.limit; limit != nil {
		_spec.Limit = *limit
	}
	if offset := bpq.offset; offset != nil {
		_spec.Offset = *offset
	}
	if ps := bpq.order; len(ps) > 0 {
		_spec.Order = func(selector *sql.Selector) {
			for i := range ps {
				ps[i](selector)
			}
		}
	}
	return _spec
}
func (bpq *BlogPostQuery) sqlQuery(ctx context.Context) *sql.Selector {
	builder := sql.Dialect(bpq.driver.Dialect())
	t1 := builder.Table(blogpost.Table)
	columns := bpq.fields
	if len(columns) == 0 {
		columns = blogpost.Columns
	}
	selector := builder.Select(t1.Columns(columns...)...).From(t1)
	if bpq.sql != nil {
		selector = bpq.sql
		selector.Select(selector.Columns(columns...)...)
	}
	for _, p := range bpq.predicates {
		p(selector)
	}
	for _, p := range bpq.order {
		p(selector)
	}
	if offset := bpq.offset; offset != nil {
		selector.Offset(*offset).Limit(math.MaxInt32)
	}
	if limit := bpq.limit; limit != nil {
		selector.Limit(*limit)
	}
	return selector
}
type BlogPostGroupBy struct {
	config
	fields []string
	fns    []AggregateFunc
	sql  *sql.Selector
	path func(context.Context) (*sql.Selector, error)
}
func (bpgb *BlogPostGroupBy) Aggregate(fns ...AggregateFunc) *BlogPostGroupBy {
	bpgb.fns = append(bpgb.fns, fns...)
	return bpgb
}
func (bpgb *BlogPostGroupBy) Scan(ctx context.Context, v interface{}) error {
	query, err := bpgb.path(ctx)
	if err != nil {
		return err
	}
	bpgb.sql = query
	return bpgb.sqlScan(ctx, v)
}
func (bpgb *BlogPostGroupBy) ScanX(ctx context.Context, v interface{}) {
	if err := bpgb.Scan(ctx, v); err != nil {
		panic(err)
	}
}
func (bpgb *BlogPostGroupBy) Strings(ctx context.Context) ([]string, error) {
	if len(bpgb.fields) > 1 {
		return nil, errors.New("ent: BlogPostGroupBy.Strings is not achievable when grouping more than 1 field")
	}
	var v []string
	if err := bpgb.Scan(ctx, &v); err != nil {
		return nil, err
	}
	return v, nil
}
func (bpgb *BlogPostGroupBy) StringsX(ctx context.Context) []string {
	v, err := bpgb.Strings(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (bpgb *BlogPostGroupBy) String(ctx context.Context) (_ string, err error) {
	var v []string
	if v, err = bpgb.Strings(ctx); err != nil {
		return
	}
	switch len(v) {
	case 1:
		return v[0], nil
	case 0:
		err = &NotFoundError{blogpost.Label}
	default:
		err = fmt.Errorf("ent: BlogPostGroupBy.Strings returned %d results when one was expected", len(v))
	}
	return
}
func (bpgb *BlogPostGroupBy) StringX(ctx context.Context) string {
	v, err := bpgb.String(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (bpgb *BlogPostGroupBy) Ints(ctx context.Context) ([]int, error) {
	if len(bpgb.fields) > 1 {
		return nil, errors.New("ent: BlogPostGroupBy.Ints is not achievable when grouping more than 1 field")
	}
	var v []int
	if err := bpgb.Scan(ctx, &v); err != nil {
		return nil, err
	}
	return v, nil
}
func (bpgb *BlogPostGroupBy) IntsX(ctx context.Context) []int {
	v, err := bpgb.Ints(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (bpgb *BlogPostGroupBy) Int(ctx context.Context) (_ int, err error) {
	var v []int
	if v, err = bpgb.Ints(ctx); err != nil {
		return
	}
	switch len(v) {
	case 1:
		return v[0], nil
	case 0:
		err = &NotFoundError{blogpost.Label}
	default:
		err = fmt.Errorf("ent: BlogPostGroupBy.Ints returned %d results when one was expected", len(v))
	}
	return
}
func (bpgb *BlogPostGroupBy) IntX(ctx context.Context) int {
	v, err := bpgb.Int(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (bpgb *BlogPostGroupBy) Float64s(ctx context.Context) ([]float64, error) {
	if len(bpgb.fields) > 1 {
		return nil, errors.New("ent: BlogPostGroupBy.Float64s is not achievable when grouping more than 1 field")
	}
	var v []float64
	if err := bpgb.Scan(ctx, &v); err != nil {
		return nil, err
	}
	return v, nil
}
func (bpgb *BlogPostGroupBy) Float64sX(ctx context.Context) []float64 {
	v, err := bpgb.Float64s(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (bpgb *BlogPostGroupBy) Float64(ctx context.Context) (_ float64, err error) {
	var v []float64
	if v, err = bpgb.Float64s(ctx); err != nil {
		return
	}
	switch len(v) {
	case 1:
		return v[0], nil
	case 0:
		err = &NotFoundError{blogpost.Label}
	default:
		err = fmt.Errorf("ent: BlogPostGroupBy.Float64s returned %d results when one was expected", len(v))
	}
	return
}
func (bpgb *BlogPostGroupBy) Float64X(ctx context.Context) float64 {
	v, err := bpgb.Float64(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (bpgb *BlogPostGroupBy) Bools(ctx context.Context) ([]bool, error) {
	if len(bpgb.fields) > 1 {
		return nil, errors.New("ent: BlogPostGroupBy.Bools is not achievable when grouping more than 1 field")
	}
	var v []bool
	if err := bpgb.Scan(ctx, &v); err != nil {
		return nil, err
	}
	return v, nil
}
func (bpgb *BlogPostGroupBy) BoolsX(ctx context.Context) []bool {
	v, err := bpgb.Bools(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (bpgb *BlogPostGroupBy) Bool(ctx context.Context) (_ bool, err error) {
	var v []bool
	if v, err = bpgb.Bools(ctx); err != nil {
		return
	}
	switch len(v) {
	case 1:
		return v[0], nil
	case 0:
		err = &NotFoundError{blogpost.Label}
	default:
		err = fmt.Errorf("ent: BlogPostGroupBy.Bools returned %d results when one was expected", len(v))
	}
	return
}
func (bpgb *BlogPostGroupBy) BoolX(ctx context.Context) bool {
	v, err := bpgb.Bool(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (bpgb *BlogPostGroupBy) sqlScan(ctx context.Context, v interface{}) error {
	for _, f := range bpgb.fields {
		if !blogpost.ValidColumn(f) {
			return &ValidationError{Name: f, err: fmt.Errorf("invalid field %q for group-by", f)}
		}
	}
	selector := bpgb.sqlQuery()
	if err := selector.Err(); err != nil {
		return err
	}
	rows := &sql.Rows{}
	query, args := selector.Query()
	if err := bpgb.driver.Query(ctx, query, args, rows); err != nil {
		return err
	}
	defer rows.Close()
	return sql.ScanSlice(rows, v)
}
func (bpgb *BlogPostGroupBy) sqlQuery() *sql.Selector {
	selector := bpgb.sql.Select()
	aggregation := make([]string, 0, len(bpgb.fns))
	for _, fn := range bpgb.fns {
		aggregation = append(aggregation, fn(selector))
	}
	if len(selector.SelectedColumns()) == 0 {
		columns := make([]string, 0, len(bpgb.fields)+len(bpgb.fns))
		for _, f := range bpgb.fields {
			columns = append(columns, selector.C(f))
		}
		for _, c := range aggregation {
			columns = append(columns, c)
		}
		selector.Select(columns...)
	}
	return selector.GroupBy(selector.Columns(bpgb.fields...)...)
}
type BlogPostSelect struct {
	*BlogPostQuery
	sql *sql.Selector
}
func (bps *BlogPostSelect) Scan(ctx context.Context, v interface{}) error {
	if err := bps.prepareQuery(ctx); err != nil {
		return err
	}
	bps.sql = bps.BlogPostQuery.sqlQuery(ctx)
	return bps.sqlScan(ctx, v)
}
func (bps *BlogPostSelect) ScanX(ctx context.Context, v interface{}) {
	if err := bps.Scan(ctx, v); err != nil {
		panic(err)
	}
}
func (bps *BlogPostSelect) Strings(ctx context.Context) ([]string, error) {
	if len(bps.fields) > 1 {
		return nil, errors.New("ent: BlogPostSelect.Strings is not achievable when selecting more than 1 field")
	}
	var v []string
	if err := bps.Scan(ctx, &v); err != nil {
		return nil, err
	}
	return v, nil
}
func (bps *BlogPostSelect) StringsX(ctx context.Context) []string {
	v, err := bps.Strings(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (bps *BlogPostSelect) String(ctx context.Context) (_ string, err error) {
	var v []string
	if v, err = bps.Strings(ctx); err != nil {
		return
	}
	switch len(v) {
	case 1:
		return v[0], nil
	case 0:
		err = &NotFoundError{blogpost.Label}
	default:
		err = fmt.Errorf("ent: BlogPostSelect.Strings returned %d results when one was expected", len(v))
	}
	return
}
func (bps *BlogPostSelect) StringX(ctx context.Context) string {
	v, err := bps.String(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
func (bps *BlogPostSelect) Ints(ctx context.Context) ([]int, error) {
	if len(bps.fields) > 1 {
		return nil, errors.New("ent: BlogPostSelect.Ints is not achievable when selecting more than 1 field")
	}
	var v []int
	if err := bps.Scan(ctx, &v); err != nil {
		return nil, err
	}
	return v, nil
}
func (bps *BlogPostSelect) IntsX(ctx context.Context) []int {
	v, err := bps.Ints(ctx)
	if err != nil {
		panic(err)
	}
	return v
}