func (q tUserQuery) 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_user")
	}
	rowsAff, err := result.RowsAffected()
	if err != nil {
		return 0, errors.Wrap(err, "models: unable to retrieve rows affected for t_user")
	}
	return rowsAff, nil
}
UpdateAll updates all rows with the specified column values.
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 TUser struct {
	ID         int         `boil:"id" json:"id" toml:"id" yaml:"id"`
	FirstName  string      `boil:"first_name" json:"first_name" toml:"first_name" yaml:"first_name"`
	LastName   string      `boil:"last_name" json:"last_name" toml:"last_name" yaml:"last_name"`
	Email      string      `boil:"email" json:"email" toml:"email" yaml:"email"`
	Password   string      `boil:"password" json:"password" toml:"password" yaml:"password"`
	Oauth2Type uint8       `boil:"oauth2_type" json:"oauth2_type" toml:"oauth2_type" yaml:"oauth2_type"`
	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 *tUserR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L tUserL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}
var TUserColumns = struct {
	ID         string
	FirstName  string
	LastName   string
	Email      string
	Password   string
	Oauth2Type string
	DeleteFLG  string
	CreatedAt  string
	UpdatedAt  string
}{
	ID:         "id",
	FirstName:  "first_name",
	LastName:   "last_name",
	Email:      "email",
	Password:   "password",
	Oauth2Type: "oauth2_type",
	DeleteFLG:  "delete_flg",
	CreatedAt:  "created_at",
	UpdatedAt:  "updated_at",
}
type whereHelperuint8 struct{ field string }
func (w whereHelperuint8) EQ(x uint8) qm.QueryMod  { return qmhelper.Where(w.field, qmhelper.EQ, x) }
func (w whereHelperuint8) NEQ(x uint8) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.NEQ, x) }
func (w whereHelperuint8) LT(x uint8) qm.QueryMod  { return qmhelper.Where(w.field, qmhelper.LT, x) }
func (w whereHelperuint8) LTE(x uint8) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LTE, x) }
func (w whereHelperuint8) GT(x uint8) qm.QueryMod  { return qmhelper.Where(w.field, qmhelper.GT, x) }
func (w whereHelperuint8) GTE(x uint8) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GTE, x) }
func (w whereHelperuint8) IN(slice []uint8) 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...)
}
var TUserWhere = struct {
	ID         whereHelperint
	FirstName  whereHelperstring
	LastName   whereHelperstring
	Email      whereHelperstring
	Password   whereHelperstring
	Oauth2Type whereHelperuint8
	DeleteFLG  whereHelpernull_String
	CreatedAt  whereHelpernull_Time
	UpdatedAt  whereHelpernull_Time
}{
	ID:         whereHelperint{field: "`t_user`.`id`"},
	FirstName:  whereHelperstring{field: "`t_user`.`first_name`"},
	LastName:   whereHelperstring{field: "`t_user`.`last_name`"},
	Email:      whereHelperstring{field: "`t_user`.`email`"},
	Password:   whereHelperstring{field: "`t_user`.`password`"},
	Oauth2Type: whereHelperuint8{field: "`t_user`.`oauth2_type`"},
	DeleteFLG:  whereHelpernull_String{field: "`t_user`.`delete_flg`"},
	CreatedAt:  whereHelpernull_Time{field: "`t_user`.`created_at`"},
	UpdatedAt:  whereHelpernull_Time{field: "`t_user`.`updated_at`"},
}
var TUserRels = struct {
}{}
type tUserR struct {
}
func (*tUserR) NewStruct() *tUserR {
	return &tUserR{}
}
type tUserL struct{}
var (
	tUserAllColumns            = []string{"id", "first_name", "last_name", "email", "password", "oauth2_type", "delete_flg", "created_at", "updated_at"}
	tUserColumnsWithoutDefault = []string{"first_name", "last_name", "email", "password"}
	tUserColumnsWithDefault    = []string{"id", "oauth2_type", "delete_flg", "created_at", "updated_at"}
	tUserPrimaryKeyColumns     = []string{"id"}
)
type (
	TUserSlice []*TUser
	tUserQuery struct {
		*queries.Query
	}
)
var (
	tUserType                 = reflect.TypeOf(&TUser{})
	tUserMapping              = queries.MakeStructMapping(tUserType)
	tUserPrimaryKeyMapping, _ = queries.BindMapping(tUserType, tUserMapping, tUserPrimaryKeyColumns)
	tUserInsertCacheMut       sync.RWMutex
	tUserInsertCache          = make(map[string]insertCache)
	tUserUpdateCacheMut       sync.RWMutex
	tUserUpdateCache          = make(map[string]updateCache)
	tUserUpsertCacheMut       sync.RWMutex
	tUserUpsertCache          = make(map[string]insertCache)
)
var (
	_ = time.Second
	_ = qmhelper.Where
)
func (q tUserQuery) One(ctx context.Context, exec boil.ContextExecutor) (*TUser, error) {
	o := &TUser{}
	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_user")
	}
	return o, nil
}
func (q tUserQuery) All(ctx context.Context, exec boil.ContextExecutor) (TUserSlice, error) {
	var o []*TUser
	err := q.Bind(ctx, exec, &o)
	if err != nil {
		return nil, errors.Wrap(err, "models: failed to assign all query results to TUser slice")
	}
	return o, nil
}
func (q tUserQuery) 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_user rows")
	}
	return count, nil
}
func (q tUserQuery) 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_user exists")
	}
	return count > 0, nil
}
func TUsers(mods ...qm.QueryMod) tUserQuery {
	mods = append(mods, qm.From("`t_user`"))
	return tUserQuery{NewQuery(mods...)}
}
func FindTUser(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*TUser, error) {
	tUserObj := &TUser{}
	sel := "*"
	if len(selectCols) > 0 {
		sel = strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, selectCols), ",")
	}
	query := fmt.Sprintf(
		"select %s from `t_user` where `id`=?", sel,
	)
	q := queries.Raw(query, iD)
	err := q.Bind(ctx, exec, tUserObj)
	if err != nil {
		if errors.Cause(err) == sql.ErrNoRows {
			return nil, sql.ErrNoRows
		}
		return nil, errors.Wrap(err, "models: unable to select from t_user")
	}
	return tUserObj, nil
}
func (o *TUser) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error {
	if o == nil {
		return errors.New("models: no t_user 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(tUserColumnsWithDefault, o)
	key := makeCacheKey(columns, nzDefaults)
	tUserInsertCacheMut.RLock()
	cache, cached := tUserInsertCache[key]
	tUserInsertCacheMut.RUnlock()
	if !cached {
		wl, returnColumns := columns.InsertColumnSet(
			tUserAllColumns,
			tUserColumnsWithDefault,
			tUserColumnsWithoutDefault,
			nzDefaults,
		)
		cache.valueMapping, err = queries.BindMapping(tUserType, tUserMapping, wl)
		if err != nil {
			return err
		}
		cache.retMapping, err = queries.BindMapping(tUserType, tUserMapping, returnColumns)
		if err != nil {
			return err
		}
		if len(wl) != 0 {
			cache.query = fmt.Sprintf("INSERT INTO `t_user` (`%s`) %%sVALUES (%s)%%s", strings.Join(wl, "`,`"), strmangle.Placeholders(dialect.UseIndexPlaceholders, len(wl), 1, 1))
		} else {
			cache.query = "INSERT INTO `t_user` () VALUES ()%s%s"
		}
		var queryOutput, queryReturning string
		if len(cache.retMapping) != 0 {
			cache.retQuery = fmt.Sprintf("SELECT `%s` FROM `t_user` WHERE %s", strings.Join(returnColumns, "`,`"), strmangle.WhereClause("`", "`", 0, tUserPrimaryKeyColumns))
		}
		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_user")
	}
	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] == tUserMapping["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_user")
	}
CacheNoHooks:
	if !cached {
		tUserInsertCacheMut.Lock()
		tUserInsertCache[key] = cache
		tUserInsertCacheMut.Unlock()
	}
	return nil
}
func (o *TUser) 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)
	tUserUpdateCacheMut.RLock()
	cache, cached := tUserUpdateCache[key]
	tUserUpdateCacheMut.RUnlock()
	if !cached {
		wl := columns.UpdateColumnSet(
			tUserAllColumns,
			tUserPrimaryKeyColumns,
		)
		if !columns.IsWhitelist() {
			wl = strmangle.SetComplement(wl, []string{"created_at"})
		}
		if len(wl) == 0 {
			return 0, errors.New("models: unable to update t_user, could not build whitelist")
		}
		cache.query = fmt.Sprintf("UPDATE `t_user` SET %s WHERE %s",
			strmangle.SetParamNames("`", "`", 0, wl),
			strmangle.WhereClause("`", "`", 0, tUserPrimaryKeyColumns),
		)
		cache.valueMapping, err = queries.BindMapping(tUserType, tUserMapping, append(wl, tUserPrimaryKeyColumns...))
		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_user row")
	}
	rowsAff, err := result.RowsAffected()
	if err != nil {
		return 0, errors.Wrap(err, "models: failed to get rows affected by update for t_user")
	}
	if !cached {
		tUserUpdateCacheMut.Lock()
		tUserUpdateCache[key] = cache
		tUserUpdateCacheMut.Unlock()
	}
	return rowsAff, nil
}