Documentation ¶
Index ¶
- func MustLoad(userName, password, host, database string, maxOpen, maxIdle int, ...)
- type IDB
- type RepoDB
- func (r *RepoDB[T]) Count() (int64, error)
- func (r *RepoDB[T]) Create(obj T) error
- func (r *RepoDB[T]) Delete(obj T) error
- func (*RepoDB[T]) DeleteByKV(key string, val interface{}, obj T) error
- func (r *RepoDB[T]) Expr(obj T, key, value string, column, expr string, num int) error
- func (r *RepoDB[T]) Find() ([]T, error)
- func (r *RepoDB[T]) FindByPage(options *options.ListOptions) ([]T, int64, error)
- func (r *RepoDB[T]) FindByRaw(sql string) ([]T, error)
- func (r *RepoDB[T]) First() (T, error)
- func (r *RepoDB[T]) List(options *options.ListOptions) ([]T, error)
- func (r *RepoDB[T]) SetOptions(key string, val interface{}) *RepoDB[T]
- func (r *RepoDB[T]) SetOptionsByMap(data map[string]interface{}) *RepoDB[T]
- func (r *RepoDB[T]) SetOrderBy(orderBy string) *RepoDB[T]
- func (r *RepoDB[T]) SetPreLoad(pre string) *RepoDB[T]
- func (r *RepoDB[T]) SetTable(table string) *RepoDB[T]
- func (r *RepoDB[T]) TxCreate(obj T, txDB *gorm.DB) error
- func (r *RepoDB[T]) TxDelete(obj T, txDB *gorm.DB) error
- func (r *RepoDB[T]) TxExpr(obj T, key, value string, column, expr string, num int, txDB *gorm.DB) error
- func (r *RepoDB[T]) TxUpdate(key, value string, attr map[string]interface{}, obj T, txDB *gorm.DB) error
- func (r *RepoDB[T]) Update(key, value string, attr map[string]interface{}, obj T) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RepoDB ¶
type RepoDB[T any] struct { // contains filtered or unexported fields }
func (*RepoDB[T]) DeleteByKV ¶
func (*RepoDB[T]) FindByPage ¶
func (r *RepoDB[T]) FindByPage(options *options.ListOptions) ([]T, int64, error)
func (*RepoDB[T]) SetOptions ¶
func (*RepoDB[T]) SetOptionsByMap ¶
func (*RepoDB[T]) SetOrderBy ¶
func (*RepoDB[T]) SetPreLoad ¶
Click to show internal directories.
Click to hide internal directories.