Documentation
¶
Index ¶
Constants ¶
View Source
const ( OperatorIn Operator = "IN" OperatorNotIn Operator = "NOT IN" OperatorLike Operator = "LIKE" OperatorNotLike Operator = "NOT LIKE" OperatorEqual Operator = "=" OperatorGreaterThan Operator = ">" OperatorLessThan Operator = "<" OperatorGreaterThanOrEqual Operator = ">=" OperatorLessThanOrEqual Operator = "<=" OperatorNotEqual Operator = "<>" OperatorJSONBContains Operator = "@>" ConnectorAND Connector = " AND " ConnectorOR Connector = " OR " )
View Source
const DefaultPaginationLimit = 100
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
IDB bun.IDB
Model any
Pagination *Pagination
DefaultOrderBy []OrderBy
Filterables []Filterable
Columns []string
Relations []string
}
type Filter ¶
func (*Filter) ApplyTo ¶
func (f *Filter) ApplyTo(q *bun.SelectQuery) *bun.SelectQuery
type FilterGroup ¶
func (*FilterGroup) ApplyTo ¶
func (f *FilterGroup) ApplyTo(q *bun.SelectQuery) *bun.SelectQuery
type Filterable ¶
type Filterable interface {
ApplyTo(q *bun.SelectQuery) *bun.SelectQuery
}
Filterable is an interface for types that can be applied to a Bun query
type OrderBy ¶
type OrderBy struct {
Column string `json:"column"`
Direction OrderDirection `json:"direction"`
}
type OrderDirection ¶
type OrderDirection string
const ( OrderAscending OrderDirection = "ASC" OrderDescending OrderDirection = "DESC" )
type Pagination ¶
type Pagination struct {
Offset int `json:"offset"`
Limit int `json:"limit"`
Total int `json:"total"`
}
func DefaultPagination ¶ added in v1.2.0
func DefaultPagination() *Pagination
DefaultPagination returns a Pagination with offset 0 and the default limit.
func (*Pagination) Validate ¶
func (p *Pagination) Validate() error
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
func (*Query) TotalCount ¶
type StringQueryInfo ¶
func (*StringQueryInfo) ToFilterable ¶
func (info *StringQueryInfo) ToFilterable(col string) Filterable
Click to show internal directories.
Click to hide internal directories.