Documentation ¶
Index ¶
- Variables
- func Pagination[T any](pager *Pager[T]) func(db *gorm.DB) *gorm.DB
- type BaseMapper
- func (m *BaseMapper[T]) Count(entity T) (count int64, err error)
- func (m *BaseMapper[T]) Delete(entity T, db ...*gorm.DB) error
- func (m *BaseMapper[T]) Detail(entity T) (res T, err error)
- func (m *BaseMapper[T]) Insert(entity T, db ...*gorm.DB) error
- func (m *BaseMapper[T]) List(entity T, order ...string) (res []T, err error)
- func (m *BaseMapper[T]) Page(entity T, page, size int64) (res *Pager[T], err error)
- func (m *BaseMapper[T]) Update(entity T, fields map[string]interface{}, db ...*gorm.DB) error
- type BaseModel
- type Database
- type Pager
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DBDriverNotSupport = errors.New("database driver not support")
)
Functions ¶
Types ¶
type BaseMapper ¶
func NewMapper ¶
func NewMapper[T any](db *Database, model T) *BaseMapper[T]
func (*BaseMapper[T]) Count ¶
func (m *BaseMapper[T]) Count(entity T) (count int64, err error)
func (*BaseMapper[T]) Detail ¶
func (m *BaseMapper[T]) Detail(entity T) (res T, err error)
func (*BaseMapper[T]) List ¶
func (m *BaseMapper[T]) List(entity T, order ...string) (res []T, err error)
type Database ¶
func NewDatabase ¶
Click to show internal directories.
Click to hide internal directories.