Documentation ¶
Overview ¶
gPlus gorm封装
Index ¶
- func Initialize(c mysql.Configure) error
- type FieldMap
- type Option
- type Querier
- func (q *Querier[M]) Count(params FieldMap) (int64, error)
- func (q *Querier[T]) Del(params FieldMap) error
- func (q *Querier[T]) Delete(params FieldMap) error
- func (q *Querier[T]) In(params FieldMap) ([]T, error)
- func (q *Querier[T]) ItemByField(params FieldMap) (*T, error)
- func (q *Querier[T]) List(params FieldMap) ([]T, error)
- func (q *Querier[T]) ListByField(params FieldMap) (T, error)
- func (q *Querier[T]) Paging(page, limit int, params FieldMap) ([]T, int, error)
- func (q *Querier[T]) Save(m *T) error
- func (q *Querier[T]) Update(params FieldMap) error
- func (q *Querier[T]) Where(params FieldMap) *Querier[T]
- func (q *Querier[T]) WithTxOption(tx *gorm.DB) *Querier[T]
- type Query
- type T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
Types ¶
type Querier ¶
type Querier[M T] struct { // contains filtered or unexported fields }
func (*Querier[T]) ItemByField ¶
func (*Querier[T]) ListByField ¶ added in v0.1.15
type Query ¶
type Query[T any] interface { Save(m *T) error // 保存model或[]model ItemByField(params FieldMap) (*T, error) List(params FieldMap) ([]T, error) Count(params FieldMap) (int64, error) In(params FieldMap) ([]T, error) Paging(page, limit int, params FieldMap) ([]T, int, error) Where(params FieldMap) *Querier[T] Update(params FieldMap) error Delete(params FieldMap) error Del(params FieldMap) error }
Click to show internal directories.
Click to hide internal directories.