Documentation ¶
Index ¶
- func Column(name string) column
- func Initialize(c mysql.Configure) error
- type FieldMap
- type Option
- type Querier
- func (q *Querier[T]) Between(c column, start, end any) *Querier[T]
- func (q *Querier[M]) Count() (int64, error)
- func (q *Querier[T]) Debug() *Querier[T]
- func (q *Querier[T]) Del(params FieldMap) error
- func (q *Querier[T]) Delete(params FieldMap) error
- func (q *Querier[T]) In(params FieldMap) *Querier[T]
- func (q *Querier[T]) Item() (*T, error)
- func (q *Querier[T]) Limit(limit int) *Querier[T]
- func (q *Querier[T]) List() (T, error)
- func (q *Querier[T]) OffSet(offSet int) *Querier[T]
- func (q *Querier[T]) OrderBy(orderBy string) *Querier[T]
- func (q *Querier[T]) Paging(page, limit int, params FieldMap) ([]T, int, error)
- func (q *Querier[T]) SQL() string
- func (q *Querier[T]) Save(m *T) error
- func (q *Querier[T]) Select(columns ...expr) *Querier[T]
- 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 }
type Query ¶
type Query[T any] interface { Save(m *T) error // 保存model或[]model Item() (*T, error) List() (T, error) Count() (int64, error) Paging(page, limit int, params FieldMap) ([]T, int, error) Where(params FieldMap) *Querier[T] In(params FieldMap) *Querier[T] Between(c column, start, end any) *Querier[T] Update(params FieldMap) error Delete(params FieldMap) error Del(params FieldMap) error SQL() string Debug() *Querier[T] }
Click to show internal directories.
Click to hide internal directories.