func (q tBookQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) {
	var count int64
	queries.SetSelect(q.Query, nil)
	queries.SetCount(q.Query)
	err := q.Query.QueryRowContext(ctx, exec).Scan(&count)
	if err != nil {
		return 0, errors.Wrap(err, "models: failed to count t_book rows")
	}
	return count, nil
}
Count returns the count of all TBook records in the query.
package models
import (
	"context"
	"database/sql"
	"fmt"
	"reflect"
	"strconv"
	"strings"
	"sync"
	"time"
	"github.com/friendsofgo/errors"
	"github.com/volatiletech/null"
	"github.com/volatiletech/sqlboiler/boil"
	"github.com/volatiletech/sqlboiler/queries"
	"github.com/volatiletech/sqlboiler/queries/qm"
	"github.com/volatiletech/sqlboiler/queries/qmhelper"
	"github.com/volatiletech/sqlboiler/strmangle"
)
type TBook struct {
	ID        int         `boil:"id" json:"id" toml:"id" yaml:"id"`
	Title     string      `boil:"title" json:"title" toml:"title" yaml:"title"`
	Author    string      `boil:"author" json:"author" toml:"author" yaml:"author"`
	Category  string      `boil:"category" json:"category" toml:"category" yaml:"category"`
	DeleteFLG null.String `boil:"delete_flg" json:"delete_flg,omitempty" toml:"delete_flg" yaml:"delete_flg,omitempty"`
	CreatedAt null.Time   `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`
	UpdatedAt null.Time   `boil:"updated_at" json:"updated_at,omitempty" toml:"updated_at" yaml:"updated_at,omitempty"`
	R *tBookR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L tBookL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}
var TBookColumns = struct {
	ID        string
	Title     string
	Author    string
	Category  string
	DeleteFLG string
	CreatedAt string
	UpdatedAt string
}{
	ID:        "id",
	Title:     "title",
	Author:    "author",
	Category:  "category",
	DeleteFLG: "delete_flg",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
}
type whereHelperint struct{ field string }
func (w whereHelperint) EQ(x int) qm.QueryMod  { return qmhelper.Where(w.field, qmhelper.EQ, x) }
func (w whereHelperint) NEQ(x int) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.NEQ, x) }
func (w whereHelperint) LT(x int) qm.QueryMod  { return qmhelper.Where(w.field, qmhelper.LT, x) }
func (w whereHelperint) LTE(x int) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LTE, x) }
func (w whereHelperint) GT(x int) qm.QueryMod  { return qmhelper.Where(w.field, qmhelper.GT, x) }
func (w whereHelperint) GTE(x int) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GTE, x) }
func (w whereHelperint) IN(slice []int) qm.QueryMod {
	values := make([]interface{}, 0, len(slice))
	for _, value := range slice {
		values = append(values, value)
	}
	return qm.WhereIn(fmt.Sprintf("%s IN ?", w.field), values...)
}
type whereHelperstring struct{ field string }
func (w whereHelperstring) EQ(x string) qm.QueryMod  { return qmhelper.Where(w.field, qmhelper.EQ, x) }
func (w whereHelperstring) NEQ(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.NEQ, x) }
func (w whereHelperstring) LT(x string) qm.QueryMod  { return qmhelper.Where(w.field, qmhelper.LT, x) }
func (w whereHelperstring) LTE(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LTE, x) }
func (w whereHelperstring) GT(x string) qm.QueryMod  { return qmhelper.Where(w.field, qmhelper.GT, x) }
func (w whereHelperstring) GTE(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GTE, x) }
func (w whereHelperstring) IN(slice []string) qm.QueryMod {
	values := make([]interface{}, 0, len(slice))
	for _, value := range slice {
		values = append(values, value)
	}
	return qm.WhereIn(fmt.Sprintf("%s IN ?", w.field), values...)
}
type whereHelpernull_String struct{ field string }
func (w whereHelpernull_String) EQ(x null.String) qm.QueryMod {
	return qmhelper.WhereNullEQ(w.field, false, x)
}
func (w whereHelpernull_String) NEQ(x null.String) qm.QueryMod {
	return qmhelper.WhereNullEQ(w.field, true, x)
}
func (w whereHelpernull_String) IsNull() qm.QueryMod    { return qmhelper.WhereIsNull(w.field) }
func (w whereHelpernull_String) IsNotNull() qm.QueryMod { return qmhelper.WhereIsNotNull(w.field) }
func (w whereHelpernull_String) LT(x null.String) qm.QueryMod {
	return qmhelper.Where(w.field, qmhelper.LT, x)
}
func (w whereHelpernull_String) LTE(x null.String) qm.QueryMod {
	return qmhelper.Where(w.field, qmhelper.LTE, x)
}
func (w whereHelpernull_String) GT(x null.String) qm.QueryMod {
	return qmhelper.Where(w.field, qmhelper.GT, x)
}
func (w whereHelpernull_String) GTE(x null.String) qm.QueryMod {
	return qmhelper.Where(w.field, qmhelper.GTE, x)
}
type whereHelpernull_Time struct{ field string }
func (w whereHelpernull_Time) EQ(x null.Time) qm.QueryMod {
	return qmhelper.WhereNullEQ(w.field, false, x)
}
func (w whereHelpernull_Time) NEQ(x null.Time) qm.QueryMod {
	return qmhelper.WhereNullEQ(w.field, true, x)
}
func (w whereHelpernull_Time) IsNull() qm.QueryMod    { return qmhelper.WhereIsNull(w.field) }
func (w whereHelpernull_Time) IsNotNull() qm.QueryMod { return qmhelper.WhereIsNotNull(w.field) }
func (w whereHelpernull_Time) LT(x null.Time) qm.QueryMod {
	return qmhelper.Where(w.field, qmhelper.LT, x)
}
func (w whereHelpernull_Time) LTE(x null.Time) qm.QueryMod {
	return qmhelper.Where(w.field, qmhelper.LTE, x)
}
func (w whereHelpernull_Time) GT(x null.Time) qm.QueryMod {
	return qmhelper.Where(w.field, qmhelper.GT, x)
}
func (w whereHelpernull_Time) GTE(x null.Time) qm.QueryMod {
	return qmhelper.Where(w.field, qmhelper.GTE, x)
}
var TBookWhere = struct {
	ID        whereHelperint
	Title     whereHelperstring
	Author    whereHelperstring
	Category  whereHelperstring
	DeleteFLG whereHelpernull_String
	CreatedAt whereHelpernull_Time
	UpdatedAt whereHelpernull_Time
}{
	ID:        whereHelperint{field: "`t_book`.`id`"},
	Title:     whereHelperstring{field: "`t_book`.`title`"},
	Author:    whereHelperstring{field: "`t_book`.`author`"},
	Category:  whereHelperstring{field: "`t_book`.`category`"},
	DeleteFLG: whereHelpernull_String{field: "`t_book`.`delete_flg`"},
	CreatedAt: whereHelpernull_Time{field: "`t_book`.`created_at`"},
	UpdatedAt: whereHelpernull_Time{field: "`t_book`.`updated_at`"},
}
var TBookRels = struct {
}{}
type tBookR struct {
}
func (*tBookR) NewStruct() *tBookR {
	return &tBookR{}
}
type tBookL struct{}
var (
	tBookAllColumns            = []string{"id", "title", "author", "category", "delete_flg", "created_at", "updated_at"}
	tBookColumnsWithoutDefault = []string{"title", "author", "category"}
	tBookColumnsWithDefault    = []string{"id", "delete_flg", "created_at", "updated_at"}
	tBookPrimaryKeyColumns     = []string{"id"}
)
type (
	TBookSlice []*TBook
	tBookQuery struct {
		*queries.Query
	}
)
var (
	tBookType                 = reflect.TypeOf(&TBook{})
	tBookMapping              = queries.MakeStructMapping(tBookType)
	tBookPrimaryKeyMapping, _ = queries.BindMapping(tBookType, tBookMapping, tBookPrimaryKeyColumns)
	tBookInsertCacheMut       sync.RWMutex
	tBookInsertCache          = make(map[string]insertCache)
	tBookUpdateCacheMut       sync.RWMutex
	tBookUpdateCache          = make(map[string]updateCache)
	tBookUpsertCacheMut       sync.RWMutex
	tBookUpsertCache          = make(map[string]insertCache)
)
var (
	_ = time.Second
	_ = qmhelper.Where
)
func (q tBookQuery) One(ctx context.Context, exec boil.ContextExecutor) (*TBook, error) {
	o := &TBook{}
	queries.SetLimit(q.Query, 1)
	err := q.Bind(ctx, exec, o)
	if err != nil {
		if errors.Cause(err) == sql.ErrNoRows {
			return nil, sql.ErrNoRows
		}
		return nil, errors.Wrap(err, "models: failed to execute a one query for t_book")
	}
	return o, nil
}
func (q tBookQuery) All(ctx context.Context, exec boil.ContextExecutor) (TBookSlice, error) {
	var o []*TBook
	err := q.Bind(ctx, exec, &o)
	if err != nil {
		return nil, errors.Wrap(err, "models: failed to assign all query results to TBook slice")
	}
	return o, nil
}