mysql

package
v1.5.38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
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) Limit

func (lo *ListOptions) Limit(limit int)

Limit set the list limit.

func (*ListOptions) Lt

func (lo *ListOptions) Lt(key string, value interface{})

Lt describe the condition: key less than value.

func (*ListOptions) Offset

func (lo *ListOptions) Offset(offset int)

Offset set the list offset.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL