Documentation ¶
Index ¶
- func CloneDB(db *gorm.DB) *gorm.DB
- func ConnectDatabase[T any](dsn string, model *T, TableName string, debug bool) (*gorm.DB, error)
- func CreateItems[T any](db *gorm.DB, model *T, items []*T) ([]uint, error)
- func DeleteItems[T any](db *gorm.DB, model *T, ids []uint) error
- func FindByIDs[T any](db *gorm.DB, model *T, ids []uint) ([]map[string]any, error)
- func FindItems[T any](db *gorm.DB, limit int, page int, model *T, query map[string]any, order string, ...) ([]map[string]any, error)
- func GetItem[T any](db *gorm.DB, model *T, id uint) (map[string]interface{}, error)
- func JSONGetID[T any](obj *T) uint
- func MapToStruct[T any](m map[string]any) *T
- func StructToMap[T any](obj *T) map[string]any
- func UpdateItem[T any](db *gorm.DB, model *T, item map[string]any, id uint) error
- func UpsertItem[T any](db *gorm.DB, model *T, item map[string]any, id uint) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectDatabase ¶
func MapToStruct ¶
func StructToMap ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.