Documentation
¶
Index ¶
- Variables
- type OrderBy
- func (w *OrderBy) Add(key string, IsDESC bool)
- func (w *OrderBy) AddClause(clause string)
- func (w *OrderBy) Build() string
- func (w *OrderBy) Debug()
- func (w *OrderBy) Del(key string)
- func (w *OrderBy) Get(key string) (bool, bool)
- func (w *OrderBy) GetClause(key string) string
- func (w *OrderBy) Length() int
- func (w *OrderBy) Reset()
- func (w *OrderBy) Set(key string, IsDESC bool)
- type OrderByOne
- type Query
- type SetWhereOptions
- type Where
- func (w *Where) Add(key string, value interface{}, opts ...*SetWhereOptions)
- func (w *Where) Build() (query string, args []interface{}, err error)
- func (w *Where) Debug()
- func (w *Where) Del(key string)
- func (w *Where) Get(key string) (interface{}, bool)
- func (w *Where) Length() int
- func (w *Where) Reset()
- func (w *Where) Set(key string, value interface{}, opts ...*SetWhereOptions)
- type WhereOne
Constants ¶
This section is empty.
Variables ¶
View Source
var ConstantsQueryAccessTokenKeys = []string{
"access_token",
"accessToken",
}
ConstantsQueryAccessTokenKeys is the keys that are used to identify the access token.
View Source
var ConstantsQueryIDKeys = []string{
"id",
"_id",
}
ConstantsQueryIDKeys is the keys that are used to identify the id.
View Source
var ConstantsQueryPageSizeKeys = []string{
"page_size",
"pageSize",
}
ConstantsQueryPageSizeKeys is the keys that are used to identify the page size.
View Source
var ConstantsWHereIgnoreKeys = []string{
"page",
"page_size",
"pageSize",
"order_by",
"orderBy",
}
ConstantsWHereIgnoreKeys is the keys that are ignored.
Functions ¶
This section is empty.
Types ¶
type OrderBy ¶ added in v1.16.0
type OrderBy []OrderByOne
OrderBy is a list of order bys.
type OrderByOne ¶ added in v1.16.0
OrderByOne is a single order by.
func (*OrderByOne) Clause ¶ added in v1.16.0
func (w *OrderByOne) Clause() string
Clause returns the clause of the order by.
func (*OrderByOne) String ¶ added in v1.16.0
func (w *OrderByOne) String() string
String returns the string of the order by.
type Query ¶
type Query interface { Get(key string, defaultValue ...string) strings.Value // Page(defaultValue ...uint) uint PageSize(defaultValue ...uint) uint Where() *Where OrderBy() *OrderBy // ID() (id strings.Value, err error) MustID() (id strings.Value) AccessToken() (accessToken string, err error) MustAccessToken() (accessToken string) }
Query ...
type SetWhereOptions ¶ added in v1.16.0
type SetWhereOptions struct { IsEqual bool IsNotEqual bool IsFuzzy bool IsIn bool IsNotIn bool IsPlain bool IsFullTextSearch bool FullTextSearchFields []string }
SetWhereOptions is the options for SetWhere.
type Where ¶ added in v1.16.0
Where is the where.
func (*Where) Add ¶ added in v1.16.0
func (w *Where) Add(key string, value interface{}, opts ...*SetWhereOptions)
Add adds a where, if exists, append.
func (*Where) Set ¶ added in v1.16.0
func (w *Where) Set(key string, value interface{}, opts ...*SetWhereOptions)
Set sets a where, if exists, update.
type WhereOne ¶ added in v1.16.0
type WhereOne struct { Key string Value interface{} // IsEqual => = IsEqual bool // IsNotEqual => != IsNotEqual bool // IsFuzzy => ILike IsFuzzy bool // IsIn => in (?) IsIn bool // IsNotIn => not in (?) IsNotIn bool // IsPlain => plain IsPlain bool // IsFullTextSearch => ILike (field1) OR ILike (field2) OR ... IsFullTextSearch bool FullTextSearchFields []string }
WhereOne is the where one.
Click to show internal directories.
Click to hide internal directories.