Documentation
¶
Index ¶
- Constants
- func CaseWhen(alias string) *caseCarrier
- func Fn(fn, alias string, params ...any) *funCarrier
- func From(tableName string, args ...any) *sqlBuilder
- func JsonField(tableAlias, field, arrow, path string) *jsonFieldCarrier
- func Literal(originVal string) *literalCarrier
- func RegisterArgsHandle(n int, obj IArgser)
- func RegisterSymbol(operator string, obj IOperator)
- func SField(tableAlias, field, fieldAlias string) *colCarrier
- func WinFn(fn, alias string, params ...any) *winCarrier
- type Condition
- type GroupWhere
- type IArgser
- type IOperator
- type Where
Constants ¶
View Source
const ( LIKE = "like" NLIKE = "not like" START_WITH = "start with" NSTART_WITH = "not start with" END_WITH = "end with" NEND_WITH = "not end with" IN = "in" NIN = "not in" BETWEEN = "between" NBETWEEN = "not between" EQUAL = "=" NEQUAL = "!=" GT = ">" LT = "<" GTE = ">=" LTE = "<=" IS_NULL = "is null" IS_NOT_NULL = "is not null" IS_EMPTY = "is empty" IS_NOT_EMPTY = "is not empty" EXISTS = "exists" NOT_EXISTS = "not exists" FIND_IN_SET = "find in set" JSON_EXTRACT = "json_extract" MULTI_IN = "multi in" MULTI_NIN = "multi not in" )
Variables ¶
This section is empty.
Functions ¶
func CaseWhen ¶ added in v0.0.14
func CaseWhen(alias string) *caseCarrier
*
- CASE WHEN 表达式
- alias 表示别名
func JsonField ¶ added in v0.0.14
func JsonField(tableAlias, field, arrow, path string) *jsonFieldCarrier
*
- JSON 字段访问
- 避免使用本函数来拼接用户提交的数据
- tableAlias 表别名,field 字段名,arrow "->" 或 "->>",path JSON 路径
func Literal ¶ added in v0.0.4
func Literal(originVal string) *literalCarrier
*
- 使用原语
- 避免使用本函数来拼接用户提交的数据
func RegisterSymbol ¶
Types ¶
type Condition ¶
type Condition struct {
// 字段
Field string
FieldType int64
// 条件
Condition string
// 值
Value any
// 表
TableName string
// 关系
Relation string
}
条件结构体
type GroupWhere ¶
type IArgser ¶
type IArgser interface {
ParseArgs(relation string, args ...any) []GroupWhere
}
type Where ¶
type Where struct {
// contains filtered or unexported fields
}
func (*Where) SetGroupWhere ¶
func (r *Where) SetGroupWhere(groupWhere []GroupWhere)
Click to show internal directories.
Click to hide internal directories.