Documentation ¶
Index ¶
- Constants
- type ListOptions
- func (lo *ListOptions) AddOffsetLimit(db *gorm.DB) *gorm.DB
- func (lo *ListOptions) AddOrder(db *gorm.DB) *gorm.DB
- func (lo *ListOptions) AddSelector(db *gorm.DB) *gorm.DB
- func (lo *ListOptions) AddWhere(db *gorm.DB) *gorm.DB
- func (lo *ListOptions) Equal(key string, value interface{})
- func (lo *ListOptions) Gt(key string, value interface{})
- func (lo *ListOptions) In(key string, value interface{})
- func (lo *ListOptions) Like(key string, value interface{})
- func (lo *ListOptions) Limit(limit int)
- func (lo *ListOptions) Lt(key string, value interface{})
- func (lo *ListOptions) Offset(offset int)
- func (lo *ListOptions) Order(order []string)
- func (lo *ListOptions) Select(selector []string)
Constants ¶
const ( // OpsOrderDESCSuffix is order DESC suffix, "order=name" will be: select * from table order by name; // "order=-name" will be: select * from table order by name desc; OpsOrderDESCSuffix = "-" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ListOptions ¶
type ListOptions struct {
// contains filtered or unexported fields
}
ListOptions describe the conditions using in mysql select command.
func NewListOptions ¶
func NewListOptions() ListOptions
NewListOptions get a new, empty ListOptions.
func (*ListOptions) AddOffsetLimit ¶
func (lo *ListOptions) AddOffsetLimit(db *gorm.DB) *gorm.DB
AddOffsetLimit receive a database operator and register offset and limit into it.
func (*ListOptions) AddOrder ¶
func (lo *ListOptions) AddOrder(db *gorm.DB) *gorm.DB
AddOrder receive a database operator and register order into it.
func (*ListOptions) AddSelector ¶
func (lo *ListOptions) AddSelector(db *gorm.DB) *gorm.DB
AddSelector receive a database operator and register selector into it.
func (*ListOptions) AddWhere ¶
func (lo *ListOptions) AddWhere(db *gorm.DB) *gorm.DB
AddWhere receive a database operator and register all the compare conditions into it with 'WHERE'.
func (*ListOptions) Equal ¶
func (lo *ListOptions) Equal(key string, value interface{})
Equal describe the condition: key equal to value.
func (*ListOptions) Gt ¶
func (lo *ListOptions) Gt(key string, value interface{})
Gt describe the condition: key greater than value.
func (*ListOptions) In ¶
func (lo *ListOptions) In(key string, value interface{})
In describe the condition: key in value list.
func (*ListOptions) Like ¶
func (lo *ListOptions) Like(key string, value interface{})
Like describe the condition: key like value.
func (*ListOptions) Lt ¶
func (lo *ListOptions) Lt(key string, value interface{})
Lt describe the condition: key less than value.
func (*ListOptions) Order ¶
func (lo *ListOptions) Order(order []string)
Order describe the order columns.
func (*ListOptions) Select ¶
func (lo *ListOptions) Select(selector []string)
Select decide the return columns, empty for all.