Documentation
¶
Index ¶
- func AppendAssociations(db *gorm.DB, item interface{}) error
- func FindPhraseByStringFields[T any](phrase string, entity T) ([]*T, error)
- func GetColumnName(model any, fieldName string, db *gorm.DB) (string, error)
- func GetTableName(model any, db *gorm.DB) (string, error)
- func ReplaceEmptySlicesWithNil(v interface{})
- func SortByOrder[T any](fieldsSortingOrder []SortField, entity T) ([]*T, error)
- func UpdateAssociations(db *gorm.DB, item interface{}) error
- type SortField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendAssociations ¶
AppendAssociations uses reflection to find all exported slice fields in 'item' and then appends any elements in each slice to the association.
func ReplaceEmptySlicesWithNil ¶
func ReplaceEmptySlicesWithNil(v interface{})
ReplaceEmptySlicesWithNil takes a pointer to any struct (or struct-like type) and replaces all empty slices with nil, traversing nested fields recursively.
func SortByOrder ¶
func UpdateAssociations ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.