Documentation
¶
Index ¶
- Variables
- func BuildUpdateSql[T any](t Traceable[T]) (sql string)
- func CopyValues[T any](fromEntity T, toEntity *T)
- func IsChanged(props map[string]PropValue) (isChanged bool)
- func Trace[T any](entity T, fn func(entity *T)) (e T, props map[string]PropValue)
- func UTC() *time.Time
- func UpdateMap(dest interface{}, updates interface{}) error
- type PropValue
- type Traceable
Constants ¶
This section is empty.
Variables ¶
View Source
var IgnoreName = []string{
"updated_at",
"updated_by",
"created_at",
"created_by",
}
Functions ¶
func BuildUpdateSql ¶ added in v1.0.1
func CopyValues ¶ added in v1.0.3
func CopyValues[T any](fromEntity T, toEntity *T)
Types ¶
type Traceable ¶
type Traceable[T any] struct { Entity T // Entity. Props map[string]PropValue // Changed fields. Columns map[string]interface{} IsChanged bool // Whether the field is changed. UpdateSql string // Update sql statement. }
func TraceProps ¶ added in v1.0.1
func TraceUpdate ¶ added in v1.0.1
Click to show internal directories.
Click to hide internal directories.