Documentation ¶
Index ¶
- type Builder
- type Direction
- type Filter
- func NewFilter() Filter
- func Where(field string, op Operator, value any) Filter
- func WhereBetween(field string, valueMin, valueMax any) Filter
- func WhereEq(field string, value any) Filter
- func WhereGt(field string, value any) Filter
- func WhereGtEq(field string, value any) Filter
- func WhereIn(field string, value any) Filter
- func WhereIs(field string, value any) Filter
- func WhereLike(field string, value any) Filter
- func WhereLt(field string, value any) Filter
- func WhereLtEq(field string, value any) Filter
- func WhereNotBetween(field string, valueMin, valueMax any) Filter
- func WhereNotEq(field string, value any) Filter
- func WhereNotIn(field string, value any) Filter
- func WhereNotIs(field string, value any) Filter
- func WhereNotLike(field string, value any) Filter
- type Join
- type Logic
- type Operator
- type Order
- type Pagination
- func (p *Pagination) ApplyToUrl(q url.Values)
- func (p *Pagination) First() *Pagination
- func (p *Pagination) GetPage() int
- func (p *Pagination) GetPageSize() int
- func (p *Pagination) GetTotal() int
- func (p *Pagination) GetTotalPages() int
- func (p *Pagination) Last() *Pagination
- func (p *Pagination) Next() *Pagination
- func (p *Pagination) Previous() *Pagination
- func (p *Pagination) SetPage(page int) *Pagination
- func (p *Pagination) SetPageSize(size int) *Pagination
- func (p *Pagination) SetTotal(total int) *Pagination
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder interface { Where(field string, op Operator, value any) Builder WhereEq(field string, value any) Builder WhereNotEq(field string, value any) Builder WhereLt(field string, value any) Builder WhereLtEq(field string, value any) Builder WhereGt(field string, value any) Builder WhereGtEq(field string, value any) Builder WhereLike(field string, value any) Builder WhereNotLike(field string, value any) Builder WhereIn(field string, value any) Builder WhereNotIn(field string, value any) Builder WhereIs(field string, value any) Builder WhereNotIs(field string, value any) Builder WhereBetween(field string, valueMin, valueMax any) Builder WhereNotBetween(field string, valueMin, valueMax any) Builder And(field string, op Operator, value any) Builder AndEq(field string, value any) Builder AndNotEq(field string, value any) Builder AndLt(field string, value any) Builder AndLtEq(field string, value any) Builder AndGt(field string, value any) Builder AndGtEq(field string, value any) Builder AndLike(field string, value any) Builder AndNotLike(field string, value any) Builder AndIn(field string, value any) Builder AndNotIn(field string, value any) Builder AndIs(field string, value any) Builder AndNotIs(field string, value any) Builder AndBetween(field string, valueMin, valueMax any) Builder AndNotBetween(field string, valueMin, valueMax any) Builder Or(field string, op Operator, value any) Builder OrEq(field string, value any) Builder OrNotEq(field string, value any) Builder OrLt(field string, value any) Builder OrLtEq(field string, value any) Builder OrGt(field string, value any) Builder OrGtEq(field string, value any) Builder OrLike(field string, value any) Builder OrNotLike(field string, value any) Builder OrIn(field string, value any) Builder OrNotIn(field string, value any) Builder OrIs(field string, value any) Builder OrNotIs(field string, value any) Builder OrBetween(field string, valueMin, valueMax any) Builder OrNotBetween(field string, valueMin, valueMax any) Builder AndGroup(conditions Filter) Builder OrGroup(conditions Filter) Builder GetWhere() (string, []any, error) Order(field string, dir ...Direction) Builder GetOrderBy() string GetOrder() *Order Limit(int) Builder GetLimit() int Offset(int) Builder GetOffset() int Pagination(p *Pagination) Builder GetPagination() *Pagination Join(query string, args ...any) Builder GetJoins() []Join Build() (Template, error) }
func NewQueryFromUrl ¶ added in v0.2.1
type Filter ¶ added in v0.2.1
type Filter interface { girraph.Tree[Filter] Generate() (string, []any, error) And(field string, op Operator, value any) Filter AndEq(field string, value any) Filter AndNotEq(field string, value any) Filter AndLt(field string, value any) Filter AndLtEq(field string, value any) Filter AndGt(field string, value any) Filter AndGtEq(field string, value any) Filter AndLike(field string, value any) Filter AndNotLike(field string, value any) Filter AndIn(field string, value any) Filter AndNotIn(field string, value any) Filter AndIs(field string, value any) Filter AndNotIs(field string, value any) Filter AndBetween(field string, valueMin, valueMax any) Filter AndNotBetween(field string, valueMin, valueMax any) Filter Or(field string, op Operator, value any) Filter OrEq(field string, value any) Filter OrNotEq(field string, value any) Filter OrLt(field string, value any) Filter OrLtEq(field string, value any) Filter OrGt(field string, value any) Filter OrGtEq(field string, value any) Filter OrLike(field string, value any) Filter OrNotLike(field string, value any) Filter OrIn(field string, value any) Filter OrNotIn(field string, value any) Filter OrIs(field string, value any) Filter OrNotIs(field string, value any) Filter OrBetween(field string, valueMin, valueMax any) Filter OrNotBetween(field string, valueMin, valueMax any) Filter AndGroup(conditions Filter) Filter OrGroup(conditions Filter) Filter // contains filtered or unexported methods }
func WhereBetween ¶
func WhereNotBetween ¶
func WhereNotEq ¶ added in v0.2.1
func WhereNotIn ¶ added in v0.2.1
func WhereNotIs ¶
func WhereNotLike ¶ added in v0.2.1
type Operator ¶ added in v0.2.1
type Operator string
const ( Equals Operator = "=" NotEqual Operator = "!=" LessThan Operator = "<" LessThanEqualTo Operator = "<=" GreaterThan Operator = ">" GreaterThanEqualTo Operator = ">=" Like Operator = "LIKE" NotLike Operator = "NOT LIKE" In Operator = "IN" NotIn Operator = "NOT IN" Is Operator = "IS" NotIs Operator = "IS NOT" Between Operator = "BETWEEN" NotBetween Operator = "NOT BETWEEN" )
type Order ¶ added in v0.2.1
type Order struct {
// contains filtered or unexported fields
}
func NewOrderFromUrl ¶ added in v0.2.1
func (*Order) ApplyToUrl ¶ added in v0.2.1
type Pagination ¶
type Pagination struct { Page int `json:"page,omitempty"` PageSize int `json:"size,omitempty"` Total int `json:"total,omitempty"` TotalPages int `json:"pages,omitempty"` }
func NewPagination ¶
func NewPagination() *Pagination
func NewPaginationFromUrl ¶ added in v0.2.1
func NewPaginationFromUrl(q url.Values) *Pagination
func (*Pagination) ApplyToUrl ¶ added in v0.2.1
func (p *Pagination) ApplyToUrl(q url.Values)
func (*Pagination) First ¶ added in v0.2.1
func (p *Pagination) First() *Pagination
func (*Pagination) GetPage ¶ added in v0.2.1
func (p *Pagination) GetPage() int
func (*Pagination) GetPageSize ¶ added in v0.2.1
func (p *Pagination) GetPageSize() int
func (*Pagination) GetTotal ¶ added in v0.2.1
func (p *Pagination) GetTotal() int
func (*Pagination) GetTotalPages ¶ added in v0.2.1
func (p *Pagination) GetTotalPages() int
func (*Pagination) Last ¶ added in v0.2.1
func (p *Pagination) Last() *Pagination
func (*Pagination) Next ¶ added in v0.2.1
func (p *Pagination) Next() *Pagination
func (*Pagination) Previous ¶ added in v0.2.1
func (p *Pagination) Previous() *Pagination
func (*Pagination) SetPage ¶ added in v0.2.1
func (p *Pagination) SetPage(page int) *Pagination
func (*Pagination) SetPageSize ¶ added in v0.2.1
func (p *Pagination) SetPageSize(size int) *Pagination
func (*Pagination) SetTotal ¶ added in v0.2.1
func (p *Pagination) SetTotal(total int) *Pagination
Click to show internal directories.
Click to hide internal directories.