func (o *UserPersonalInfoHonor) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {
	var err error
	if err = o.doBeforeUpdateHooks(ctx, exec); err != nil {
		return 0, err
	}
	key := makeCacheKey(columns, nil)
	userPersonalInfoHonorUpdateCacheMut.RLock()
	cache, cached := userPersonalInfoHonorUpdateCache[key]
	userPersonalInfoHonorUpdateCacheMut.RUnlock()

	if !cached {
		wl := columns.UpdateColumnSet(
			userPersonalInfoHonorColumns,
			userPersonalInfoHonorPrimaryKeyColumns,
		)

		if !columns.IsWhitelist() {
			wl = strmangle.SetComplement(wl, []string{"created_at"})
		}
		if len(wl) == 0 {
			return 0, errors.New("models: unable to update user_personal_info_honors, could not build whitelist")
		}

		cache.query = fmt.Sprintf("UPDATE \"user_personal_info_honors\" SET %s WHERE %s",
			strmangle.SetParamNames("\"", "\"", 1, wl),
			strmangle.WhereClause("\"", "\"", len(wl)+1, userPersonalInfoHonorPrimaryKeyColumns),
		)
		cache.valueMapping, err = queries.BindMapping(userPersonalInfoHonorType, userPersonalInfoHonorMapping, append(wl, userPersonalInfoHonorPrimaryKeyColumns...))
		if err != nil {
			return 0, err
		}
	}

	values := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)

	if boil.DebugMode {
		fmt.Fprintln(boil.DebugWriter, cache.query)
		fmt.Fprintln(boil.DebugWriter, 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 user_personal_info_honors row")
	}

	rowsAff, err := result.RowsAffected()
	if err != nil {
		return 0, errors.Wrap(err, "models: failed to get rows affected by update for user_personal_info_honors")
	}

	if !cached {
		userPersonalInfoHonorUpdateCacheMut.Lock()
		userPersonalInfoHonorUpdateCache[key] = cache
		userPersonalInfoHonorUpdateCacheMut.Unlock()
	}

	return rowsAff, o.doAfterUpdateHooks(ctx, exec)
}
// Update uses an executor to update the UserPersonalInfoHonor.
// See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates.
// Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.
Update uses an executor to update the UserPersonalInfoHonor.
See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates.
Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.
// Update uses an executor to update the UserPersonalInfoHonor . // See boil . Columns . UpdateColumnSet documentation to understand column list inference for updates . // Update does not automatically update the record in case of default values . Use . Reload () to refresh the records .
func (o *UserPersonalInfoHonor) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {
	var err error
	if err = o.doBeforeUpdateHooks(ctx, exec); err != nil {
		return 0, err
	}
	key := makeCacheKey(columns, nil)
	userPersonalInfoHonorUpdateCacheMut.RLock()
	cache, cached := userPersonalInfoHonorUpdateCache[key]
	userPersonalInfoHonorUpdateCacheMut.RUnlock()
	if !cached {
		wl := columns.UpdateColumnSet(
			userPersonalInfoHonorColumns,
			userPersonalInfoHonorPrimaryKeyColumns,
		)
		if !columns.IsWhitelist() {
			wl = strmangle.SetComplement(wl, []string{"created_at"})
		}
		if len(wl) == 0 {
			return 0, errors.New("models: unable to update user_personal_info_honors, could not build whitelist")
		}
		cache.query = fmt.Sprintf("UPDATE \"user_personal_info_honors\" SET %s WHERE %s",
			strmangle.SetParamNames("\"", "\"", 1, wl),
			strmangle.WhereClause("\"", "\"", len(wl)+1, userPersonalInfoHonorPrimaryKeyColumns),
		)
		cache.valueMapping, err = queries.BindMapping(userPersonalInfoHonorType, userPersonalInfoHonorMapping, append(wl, userPersonalInfoHonorPrimaryKeyColumns...))
		if err != nil {
			return 0, err
		}
	}
	values := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)
	if boil.DebugMode {
		fmt.Fprintln(boil.DebugWriter, cache.query)
		fmt.Fprintln(boil.DebugWriter, 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 user_personal_info_honors row")
	}
	rowsAff, err := result.RowsAffected()
	if err != nil {
		return 0, errors.Wrap(err, "models: failed to get rows affected by update for user_personal_info_honors")
	}
	if !cached {
		userPersonalInfoHonorUpdateCacheMut.Lock()
		userPersonalInfoHonorUpdateCache[key] = cache
		userPersonalInfoHonorUpdateCacheMut.Unlock()
	}
	return rowsAff, o.doAfterUpdateHooks(ctx, exec)
}
func ( o * UserPersonalInfoHonor ) Update ( ctx context . Context , exec boil . ContextExecutor , columns boil . Columns ) ( int64 , error ) { var err error if err = o . doBeforeUpdateHooks ( ctx , exec ) ; err != nil { return 0 , err } key := makeCacheKey ( columns , nil ) userPersonalInfoHonorUpdateCacheMut . RLock ( ) cache , cached := userPersonalInfoHonorUpdateCache [ key ] userPersonalInfoHonorUpdateCacheMut . RUnlock ( ) if ! cached { wl := columns . UpdateColumnSet ( userPersonalInfoHonorColumns , userPersonalInfoHonorPrimaryKeyColumns , ) if ! columns . IsWhitelist ( ) { wl = strmangle . SetComplement ( wl , [ ] string { " " } ) } if len ( wl ) == 0 { return 0 , errors . New ( " " ) } cache . query = fmt . Sprintf ( " \" \" " , strmangle . SetParamNames ( " \" " , " \" " , 1 , wl ) , strmangle . WhereClause ( " \" " , " \" " , len ( wl ) + 1 , userPersonalInfoHonorPrimaryKeyColumns ) , ) cache . valueMapping , err = queries . BindMapping ( userPersonalInfoHonorType , userPersonalInfoHonorMapping , append ( wl , userPersonalInfoHonorPrimaryKeyColumns ... ) ) if err != nil { return 0 , err } } values := queries . ValuesFromMapping ( reflect . Indirect ( reflect . ValueOf ( o ) ) , cache . valueMapping ) if boil . DebugMode { fmt . Fprintln ( boil . DebugWriter , cache . query ) fmt . Fprintln ( boil . DebugWriter , values ) } var result sql . Result result , err = exec . ExecContext ( ctx , cache . query , values ... ) if err != nil { return 0 , errors . Wrap ( err , " " ) } rowsAff , err := result . RowsAffected ( ) if err != nil { return 0 , errors . Wrap ( err , " " ) } if ! cached { userPersonalInfoHonorUpdateCacheMut . Lock ( ) userPersonalInfoHonorUpdateCache [ key ] = cache userPersonalInfoHonorUpdateCacheMut . Unlock ( ) } return rowsAff , o . doAfterUpdateHooks ( ctx , exec ) }
Update uses an executor to update the UserPersonalInfoHonor.
Update uses an executor to update the UserPersonalInfoHonor .