Documentation ¶
Index ¶
- type Builder
- type Pagination
- type Query
- func (q *Query) ApplyPaginationTotals(totalRecordCount int64)
- func (q *Query) ApplyToGorm(g *gorm.DB) (*gorm.DB, error)
- func (q *Query) GetGormPageQuery(g *gorm.DB) (*gorm.DB, error)
- func (q *Query) OrWhereEq(field string, value interface{})
- func (q *Query) OrWhereGt(field string, value interface{})
- func (q *Query) OrWhereGtEq(field string, value interface{})
- func (q *Query) OrWhereIn(field string, value interface{})
- func (q *Query) OrWhereLike(field string, value interface{})
- func (q *Query) OrWhereLt(field string, value interface{})
- func (q *Query) OrWhereLtEq(field string, value interface{})
- func (q *Query) OrWhereNotEq(field string, value interface{})
- func (q *Query) Order(field string, dir SortDir)
- func (q *Query) String() string
- func (q *Query) WhereEq(field string, value interface{})
- func (q *Query) WhereGt(field string, value interface{})
- func (q *Query) WhereGtEq(field string, value interface{})
- func (q *Query) WhereIn(field string, value interface{})
- func (q *Query) WhereLike(field string, value interface{})
- func (q *Query) WhereLt(field string, value interface{})
- func (q *Query) WhereLtEq(field string, value interface{})
- func (q *Query) WhereNotEq(field string, value interface{})
- type Sort
- type SortDir
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder interface { String() string Order(field string, dir SortDir) ApplyToGorm(g *gorm.DB) (*gorm.DB, error) ApplyToGormCount(g *gorm.DB) (*gorm.DB, error) WhereEq(field string, value interface{}) WhereLike(field string, value interface{}) WhereIn(field string, value interface{}) WhereLt(field string, value interface{}) WhereLtEq(field string, value interface{}) WhereGt(field string, value interface{}) WhereGtEq(field string, value interface{}) WhereNotEq(field string, value interface{}) OrWhereEq(field string, value interface{}) OrWhereLike(field string, value interface{}) OrWhereIn(field string, value interface{}) OrWhereLt(field string, value interface{}) OrWhereLtEq(field string, value interface{}) OrWhereGt(field string, value interface{}) OrWhereGtEq(field string, value interface{}) OrWhereNotEq(field string, value interface{}) }
type Pagination ¶
type Pagination struct { Page int64 `json:"page,omitempty"` // the json name must match currentPageKey, defined above PageSize int64 `json:"page_size,omitempty"` // the json name must match perPageKey, defined above Total int64 `json:"total,omitempty"` TotalPages int64 `json:"total_pages,omitempty"` FirstPage string `json:"first_page,omitempty"` PreviousPage string `json:"previous_page,omitempty"` NextPage string `json:"next_page,omitempty"` LastPage string `json:"last_page,omitempty"` }
func NewPaginationFromGin ¶ added in v0.1.29
func NewPaginationFromGin(c *gin.Context) Pagination
func NewPaginationFromValues ¶ added in v0.1.29
func NewPaginationFromValues(page, size, total int64) Pagination
func (Pagination) String ¶
func (p Pagination) String() string
type Query ¶
type Query struct { Pagination Pagination Filter filter.Filter Sort []Sort Preload []string }
func NewQueryBuilder ¶
func (*Query) ApplyPaginationTotals ¶ added in v0.1.29
ApplyPaginationTotals updates the Pagination Total and TotalPages values using the provided new totalRecordCount.
func (*Query) GetGormPageQuery ¶ added in v0.1.29
GetGormPageQuery copies the query, removing the pagination and applies it to the provided Gorm instance. Can be used to get the un-paginated total count of rows for use in pagination. DOES NOT MODIFY THE QUERY INSTANCE
func (*Query) OrWhereGtEq ¶
func (*Query) OrWhereLike ¶
func (*Query) OrWhereLtEq ¶
func (*Query) OrWhereNotEq ¶
func (*Query) WhereNotEq ¶
Click to show internal directories.
Click to hide internal directories.