func (q tBookQuery) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) {
	if q.Query == nil {
		return 0, errors.New("models: no tBookQuery provided for delete all")
	}
	queries.SetDelete(q.Query)
	result, err := q.Query.ExecContext(ctx, exec)
	if err != nil {
		return 0, errors.Wrap(err, "models: unable to delete all from t_book")
	}
	rowsAff, err := result.RowsAffected()
	if err != nil {
		return 0, errors.Wrap(err, "models: failed to get rows affected by deleteall for t_book")
	}
	return rowsAff, nil
}
DeleteAll deletes all matching rows.
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
}
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
}
func (q tBookQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {
	var count int64
	queries.SetSelect(q.Query, nil)
	queries.SetCount(q.Query)
	queries.SetLimit(q.Query, 1)
	err := q.Query.QueryRowContext(ctx, exec).Scan(&count)
	if err != nil {
		return false, errors.Wrap(err, "models: failed to check if t_book exists")
	}
	return count > 0, nil
}
func TBooks(mods ...qm.QueryMod) tBookQuery {
	mods = append(mods, qm.From("`t_book`"))
	return tBookQuery{NewQuery(mods...)}
}
func FindTBook(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*TBook, error) {
	tBookObj := &TBook{}
	sel := "*"
	if len(selectCols) > 0 {
		sel = strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, selectCols), ",")
	}
	query := fmt.Sprintf(
		"select %s from `t_book` where `id`=?", sel,
	)
	q := queries.Raw(query, iD)
	err := q.Bind(ctx, exec, tBookObj)
	if err != nil {
		if errors.Cause(err) == sql.ErrNoRows {
			return nil, sql.ErrNoRows
		}
		return nil, errors.Wrap(err, "models: unable to select from t_book")
	}
	return tBookObj, nil
}
func (o *TBook) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error {
	if o == nil {
		return errors.New("models: no t_book provided for insertion")
	}
	var err error
	if !boil.TimestampsAreSkipped(ctx) {
		currTime := time.Now().In(boil.GetLocation())
		if queries.MustTime(o.CreatedAt).IsZero() {
			queries.SetScanner(&o.CreatedAt, currTime)
		}
		if queries.MustTime(o.UpdatedAt).IsZero() {
			queries.SetScanner(&o.UpdatedAt, currTime)
		}
	}
	nzDefaults := queries.NonZeroDefaultSet(tBookColumnsWithDefault, o)
	key := makeCacheKey(columns, nzDefaults)
	tBookInsertCacheMut.RLock()
	cache, cached := tBookInsertCache[key]
	tBookInsertCacheMut.RUnlock()
	if !cached {
		wl, returnColumns := columns.InsertColumnSet(
			tBookAllColumns,
			tBookColumnsWithDefault,
			tBookColumnsWithoutDefault,
			nzDefaults,
		)
		cache.valueMapping, err = queries.BindMapping(tBookType, tBookMapping, wl)
		if err != nil {
			return err
		}
		cache.retMapping, err = queries.BindMapping(tBookType, tBookMapping, returnColumns)
		if err != nil {
			return err
		}
		if len(wl) != 0 {
			cache.query = fmt.Sprintf("INSERT INTO `t_book` (`%s`) %%sVALUES (%s)%%s", strings.Join(wl, "`,`"), strmangle.Placeholders(dialect.UseIndexPlaceholders, len(wl), 1, 1))
		} else {
			cache.query = "INSERT INTO `t_book` () VALUES ()%s%s"
		}
		var queryOutput, queryReturning string
		if len(cache.retMapping) != 0 {
			cache.retQuery = fmt.Sprintf("SELECT `%s` FROM `t_book` WHERE %s", strings.Join(returnColumns, "`,`"), strmangle.WhereClause("`", "`", 0, tBookPrimaryKeyColumns))
		}
		cache.query = fmt.Sprintf(cache.query, queryOutput, queryReturning)
	}
	value := reflect.Indirect(reflect.ValueOf(o))
	vals := queries.ValuesFromMapping(value, cache.valueMapping)
	if boil.IsDebug(ctx) {
		writer := boil.DebugWriterFrom(ctx)
		fmt.Fprintln(writer, cache.query)
		fmt.Fprintln(writer, vals)
	}
	result, err := exec.ExecContext(ctx, cache.query, vals...)
	if err != nil {
		return errors.Wrap(err, "models: unable to insert into t_book")
	}
	var lastID int64
	var identifierCols []interface{}
	if len(cache.retMapping) == 0 {
		goto CacheNoHooks
	}
	lastID, err = result.LastInsertId()
	if err != nil {
		return ErrSyncFail
	}
	o.ID = int(lastID)
	if lastID != 0 && len(cache.retMapping) == 1 && cache.retMapping[0] == tBookMapping["id"] {
		goto CacheNoHooks
	}
	identifierCols = []interface{}{
		o.ID,
	}
	if boil.IsDebug(ctx) {
		writer := boil.DebugWriterFrom(ctx)
		fmt.Fprintln(writer, cache.retQuery)
		fmt.Fprintln(writer, identifierCols...)
	}
	err = exec.QueryRowContext(ctx, cache.retQuery, identifierCols...).Scan(queries.PtrsFromMapping(value, cache.retMapping)...)
	if err != nil {
		return errors.Wrap(err, "models: unable to populate default values for t_book")
	}
CacheNoHooks:
	if !cached {
		tBookInsertCacheMut.Lock()
		tBookInsertCache[key] = cache
		tBookInsertCacheMut.Unlock()
	}
	return nil
}
func (o *TBook) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {
	if !boil.TimestampsAreSkipped(ctx) {
		currTime := time.Now().In(boil.GetLocation())
		queries.SetScanner(&o.UpdatedAt, currTime)
	}
	var err error
	key := makeCacheKey(columns, nil)
	tBookUpdateCacheMut.RLock()
	cache, cached := tBookUpdateCache[key]
	tBookUpdateCacheMut.RUnlock()
	if !cached {
		wl := columns.UpdateColumnSet(
			tBookAllColumns,
			tBookPrimaryKeyColumns,
		)
		if !columns.IsWhitelist() {
			wl = strmangle.SetComplement(wl, []string{"created_at"})
		}
		if len(wl) == 0 {
			return 0, errors.New("models: unable to update t_book, could not build whitelist")
		}
		cache.query = fmt.Sprintf("UPDATE `t_book` SET %s WHERE %s",
			strmangle.SetParamNames("`", "`", 0, wl),
			strmangle.WhereClause("`", "`", 0, tBookPrimaryKeyColumns),
		)
		cache.valueMapping, err = queries.BindMapping(tBookType, tBookMapping, append(wl, tBookPrimaryKeyColumns...))
		if err != nil {
			return 0, err
		}
	}
	values := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)
	if boil.IsDebug(ctx) {
		writer := boil.DebugWriterFrom(ctx)
		fmt.Fprintln(writer, cache.query)
		fmt.Fprintln(writer, values)
	}
	var result sql.Result
	result, err = exec.ExecContext(ctx, cache.query, values...)
	if err != nil {
		return 0, errors.Wrap(err, "models: unable to update t_book row")
	}
	rowsAff, err := result.RowsAffected()
	if err != nil {
		return 0, errors.Wrap(err, "models: failed to get rows affected by update for t_book")
	}
	if !cached {
		tBookUpdateCacheMut.Lock()
		tBookUpdateCache[key] = cache
		tBookUpdateCacheMut.Unlock()
	}
	return rowsAff, nil
}
func (q tBookQuery) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {
	queries.SetUpdate(q.Query, cols)
	result, err := q.Query.ExecContext(ctx, exec)
	if err != nil {
		return 0, errors.Wrap(err, "models: unable to update all for t_book")
	}
	rowsAff, err := result.RowsAffected()
	if err != nil {
		return 0, errors.Wrap(err, "models: unable to retrieve rows affected for t_book")
	}
	return rowsAff, nil
}
func (o TBookSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {
	ln := int64(len(o))
	if ln == 0 {
		return 0, nil
	}
	if len(cols) == 0 {
		return 0, errors.New("models: update all requires at least one column argument")
	}
	colNames := make([]string, len(cols))
	args := make([]interface{}, len(cols))
	i := 0
	for name, value := range cols {
		colNames[i] = name
		args[i] = value
		i++
	}
	for _, obj := range o {
		pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), tBookPrimaryKeyMapping)
		args = append(args, pkeyArgs...)
	}
	sql := fmt.Sprintf("UPDATE `t_book` SET %s WHERE %s",
		strmangle.SetParamNames("`", "`", 0, colNames),
		strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, tBookPrimaryKeyColumns, len(o)))
	if boil.IsDebug(ctx) {
		writer := boil.DebugWriterFrom(ctx)
		fmt.Fprintln(writer, sql)
		fmt.Fprintln(writer, args...)
	}
	result, err := exec.ExecContext(ctx, sql, args...)
	if err != nil {
		return 0, errors.Wrap(err, "models: unable to update all in tBook slice")
	}
	rowsAff, err := result.RowsAffected()
	if err != nil {
		return 0, errors.Wrap(err, "models: unable to retrieve rows affected all in update all tBook")
	}
	return rowsAff, nil
}
var mySQLTBookUniqueColumns = []string{
	"id",
}
func (o *TBook) Upsert(ctx context.Context, exec boil.ContextExecutor, updateColumns, insertColumns boil.Columns) error {
	if o == nil {
		return errors.New("models: no t_book provided for upsert")
	}
	if !boil.TimestampsAreSkipped(ctx) {
		currTime := time.Now().In(boil.GetLocation())
		if queries.MustTime(o.CreatedAt).IsZero() {
			queries.SetScanner(&o.CreatedAt, currTime)
		}
		queries.SetScanner(&o.UpdatedAt, currTime)
	}
	nzDefaults := queries.NonZeroDefaultSet(tBookColumnsWithDefault, o)
	nzUniques := queries.NonZeroDefaultSet(mySQLTBookUniqueColumns, o)
	if len(nzUniques) == 0 {
		return errors.New("cannot upsert with a table that cannot conflict on a unique column")
	}
	buf := strmangle.GetBuffer()
	buf.WriteString(strconv.Itoa(updateColumns.Kind))
	for _, c := range updateColumns.Cols {
		buf.WriteString(c)
	}
	buf.WriteByte('.')
	buf.WriteString(strconv.Itoa(insertColumns.Kind))
	for _, c := range insertColumns.Cols {
		buf.WriteString(c)
	}
	buf.WriteByte('.')
	for _, c := range nzDefaults {
		buf.WriteString(c)
	}
	buf.WriteByte('.')
	for _, c := range nzUniques {
		buf.WriteString(c)
	}
	key := buf.String()
	strmangle.PutBuffer(buf)
	tBookUpsertCacheMut.RLock()
	cache, cached := tBookUpsertCache[key]
	tBookUpsertCacheMut.RUnlock()
	var err error
	if !cached {
		insert, ret := insertColumns.InsertColumnSet(
			tBookAllColumns,
			tBookColumnsWithDefault,
			tBookColumnsWithoutDefault,
			nzDefaults,
		)
		update := updateColumns.UpdateColumnSet(
			tBookAllColumns,
			tBookPrimaryKeyColumns,
		)
		if len(update) == 0 {
			return errors.New("models: unable to upsert t_book, could not build update column list")
		}
		ret = strmangle.SetComplement(ret, nzUniques)
		cache.query = buildUpsertQueryMySQL(dialect, "t_book", update, insert)
		cache.retQuery = fmt.Sprintf(
			"SELECT %s FROM `t_book` WHERE %s",
			strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, ret), ","),
			strmangle.WhereClause("`", "`", 0, nzUniques),
		)
		cache.valueMapping, err = queries.BindMapping(tBookType, tBookMapping, insert)
		if err != nil {
			return err
		}
		if len(ret) != 0 {
			cache.retMapping, err = queries.BindMapping(tBookType, tBookMapping, ret)
			if err != nil {
				return err
			}
		}
	}
	value := reflect.Indirect(reflect.ValueOf(o))
	vals := queries.ValuesFromMapping(value, cache.valueMapping)
	var returns []interface{}
	if len(cache.retMapping) != 0 {
		returns = queries.PtrsFromMapping(value, cache.retMapping)
	}
	if boil.IsDebug(ctx) {
		writer := boil.DebugWriterFrom(ctx)
		fmt.Fprintln(writer, cache.query)
		fmt.Fprintln(writer, vals)
	}
	result, err := exec.ExecContext(ctx, cache.query, vals...)
	if err != nil {
		return errors.Wrap(err, "models: unable to upsert for t_book")
	}
	var lastID int64
	var uniqueMap []uint64
	var nzUniqueCols []interface{}
	if len(cache.retMapping) == 0 {
		goto CacheNoHooks
	}
	lastID, err = result.LastInsertId()
	if err != nil {
		return ErrSyncFail
	}
	o.ID = int(lastID)
	if lastID != 0 && len(cache.retMapping) == 1 && cache.retMapping[0] == tBookMapping["id"] {
		goto CacheNoHooks
	}
	uniqueMap, err = queries.BindMapping(tBookType, tBookMapping, nzUniques)
	if err != nil {
		return errors.Wrap(err, "models: unable to retrieve unique values for t_book")
	}
	nzUniqueCols = queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), uniqueMap)
	if boil.IsDebug(ctx) {
		writer := boil.DebugWriterFrom(ctx)
		fmt.Fprintln(writer, cache.retQuery)
		fmt.Fprintln(writer, nzUniqueCols...)
	}
	err = exec.QueryRowContext(ctx, cache.retQuery, nzUniqueCols...).Scan(returns...)
	if err != nil {
		return errors.Wrap(err, "models: unable to populate default values for t_book")
	}
CacheNoHooks:
	if !cached {
		tBookUpsertCacheMut.Lock()
		tBookUpsertCache[key] = cache
		tBookUpsertCacheMut.Unlock()
	}
	return nil
}
func (o *TBook) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error) {
	if o == nil {
		return 0, errors.New("models: no TBook provided for delete")
	}
	args := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), tBookPrimaryKeyMapping)
	sql := "DELETE FROM `t_book` WHERE `id`=?"
	if boil.IsDebug(ctx) {
		writer := boil.DebugWriterFrom(ctx)
		fmt.Fprintln(writer, sql)
		fmt.Fprintln(writer, args...)
	}
	result, err := exec.ExecContext(ctx, sql, args...)
	if err != nil {
		return 0, errors.Wrap(err, "models: unable to delete from t_book")
	}
	rowsAff, err := result.RowsAffected()
	if err != nil {
		return 0, errors.Wrap(err, "models: failed to get rows affected by delete for t_book")
	}
	return rowsAff, nil
}