Documentation ¶
Overview ¶
gPlus gorm封装
Index ¶
- func Column(name string) column
- func Initialization(c mysql.Configure2) error
- 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(params FieldMap) (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]) GroupBy(col string) *Querier[T]
- func (q *Querier[T]) In(params FieldMap) ([]T, error)
- func (q *Querier[T]) In2(c column, data any) *Querier[T]
- func (q *Querier[T]) ItemByField(params FieldMap) (*T, error)
- func (q *Querier[T]) Join(joins string, args ...any) *Querier[T]
- func (q *Querier[T]) Limit(limit int) *Querier[T]
- func (q *Querier[T]) List(params FieldMap) ([]T, error)
- func (q *Querier[T]) ListByField(params FieldMap) (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]) Table(table string) *Querier[T]
- func (q *Querier[T]) Update(params FieldMap) error
- func (q *Querier[T]) Updates(p T) 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 Initialization ¶ added in v0.1.75
func Initialization(c mysql.Configure2) error
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) Table(table string) *Querier[T] Where(params FieldMap) *Querier[T] Between(c column, start, end any) *Querier[T] Update(params FieldMap) error Delete(params FieldMap) error Del(params FieldMap) error In2(c column, data any) *Querier[T] SQL() string Debug() *Querier[T] }
Click to show internal directories.
Click to hide internal directories.