Documentation ¶
Index ¶
- type Updater
- func (u *Updater) SetFields(fields map[string]interface{}) *Updater
- func (u *Updater) SetModel(model interface{}) *Updater
- func (u *Updater) SetOmits(omits []string) *Updater
- func (u *Updater) SetPreloads(preloads ...string) *Updater
- func (u *Updater) SetSaveFull(saveFull bool) *Updater
- func (u *Updater) SetSaveNil(saveNil bool) *Updater
- func (u *Updater) SetTx(tx context.Context) *Updater
- func (u *Updater) SetUpdate(update interface{}) *Updater
- func (u *Updater) SetWheres(wheres where.Wheres) *Updater
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Updater ¶
type Updater struct { Tx context.Context // 事务上下文 Model interface{} // 修改对应的模型 Wheres where.Wheres // 修改的过滤条件 Update interface{} // 修改的结构体值, 修改整体值时使用 Fields map[string]interface{} // 修改的map值, 用于修改单个或多个字段时使用 SaveNil bool // 是否保存空值, 默认不会更新类似 0,false,"" 等值 SaveFull bool // 是否同时修改关联数据 Debug bool // 是否开启调试模式 Preloads []string // 预加载关联数据 Omits []string // 修改时指定不更新的字段 Selects []string // 修改时指定更新的字段 }
func (*Updater) SetPreloads ¶
func (*Updater) SetSaveFull ¶
func (*Updater) SetSaveNil ¶
Click to show internal directories.
Click to hide internal directories.