Documentation ¶
Overview ¶
Package gormf contains utilities & extensions for gorm.io/gorm package.
Index ¶
- func CollectTaggedColumns(entity interface{}, setting string) map[string]string
- func Filter(tx *gorm.DB, entity any, setting string, operator string, value any) (*gorm.DB, error)
- func LogfLogger(clock syncf.Clock, name ...any) logger.Interface
- func OnConflictClause(entity interface{}, setting string, updateAll bool, doUpdates clause.Set) *clause.OnConflict
- type Batch
- type JSONB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectTaggedColumns ¶
CollectTaggedColumns collects all columns from this entity tagged with a setting from this entity and all its embedded structs.
func Filter ¶ added in v0.10.5
Filter applies filter based on tagged field struct. setting is used to specify gorm setting in struct field tag which is used to resolve the column for filtering.
func LogfLogger ¶ added in v0.10.5
LogfLogger returns a logger.Interface adapter for logf.
func OnConflictClause ¶
func OnConflictClause(entity interface{}, setting string, updateAll bool, doUpdates clause.Set) *clause.OnConflict
OnConflictClause generates ON CONFLICT clause containing columns tagged with "setting" in the struct of "entity".
Types ¶
type Batch ¶ added in v0.10.5
type Batch[T any] []T
Batch is a slice of values.
type JSONB ¶
type JSONB json.RawMessage
JSONB provides PostgreSQL jsonb type support for gorm.
func (JSONB) GormDataType ¶
Click to show internal directories.
Click to hide internal directories.