Documentation ¶
Index ¶
Constants ¶
View Source
const ( TypeTag = "type" // 类型标签 ColumnTag = "column" // 字段标签 TableTag = "table" // 表标签 OnTag = "on" // on标签 JoinTag = "join" // 连接标签 SkipTag = "-" // 连接标签 LeftTypeTag = "left" ExactTypeTag = "exact" IExactTypeTag = "iexact" ContainsTypeTag = "contains" IContainsTypeTag = "icontains" GtTypeTag = "gt" // 大于 GteTypeTag = "gte" // 大于等于 LtTypeTag = "lt" // 小于 LteTypeTag = "lte" // 小于等于 StartsWithTypeTag = "startswith" IStartsWithTypeTag = "istartswith" EndWithTypeTag = "endswith" IEndWithTypeTag = "iendswith" IsNullTypeTag = "isnull" InTypeTag = "in" OrderTypeTag = "order" DescTypeTag = "desc" AscTypeTag = "asc" )
View Source
const ( // Mysql 数据库标识 Mysql = "mysql" // Postgres 数据库标识 Postgres = "postgres" )
Variables ¶
View Source
var (
// QueryTag tag标记
QueryTag = "search"
)
Functions ¶
func ResolveSearchQuery ¶
ResolveSearchQuery 解析 *
- exact / iexact 等于
- contains / icontains 包含
- gt / gte 大于 / 大于等于
- lt / lte 小于 / 小于等于
- startswith / istartswith 以…起始
- endswith / iendswith 以…结束
- in
- isnull
- order 排序 e.g. order[key]=desc order[key]=asc
Types ¶
type Condition ¶
type Condition interface { SetWhere(k string, v []interface{}) SetOr(k string, v []interface{}) SetOrder(k string) SetJoinOn(t, on string) Condition }
Condition 条件
type OrmCondition ¶
OrmCondition Orm查询的条件
func NewOrmCondition ¶
func NewOrmCondition() *OrmCondition
func (*OrmCondition) SetJoinOn ¶
func (e *OrmCondition) SetJoinOn(t, on string) Condition
SetJoinOn 设置join on
Click to show internal directories.
Click to hide internal directories.