Documentation
¶
Index ¶
- Constants
- func Fn(fn, alias string, params ...interface{}) *funCarrier
- func From(tableName string, args ...interface{}) *sqlBuilder
- func Literal(originVal string) *literalCarrier
- func RegisterArgsHandle(n int, obj IArgser)
- func RegisterSymbol(operater string, obj IOperater)
- func SField(tableAlias, field, fieldAlias string) *colCarrier
- type Condition
- type GroupWhere
- type IArgser
- type IOperater
- 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" )
Variables ¶
This section is empty.
Functions ¶
func Fn ¶
func Fn(fn, alias string, params ...interface{}) *funCarrier
*
- 使用mysql函数
- 避免使用本函数来拼接用户提交的数据
- fn 表示函数名,如:sum,max,min,count,avg
- alias 表示别名
- params 表示函数参数
func From ¶
func From(tableName string, args ...interface{}) *sqlBuilder
From 用于创建一个 sqlBuilder 实例,并返回该实例的指针。 参数 tableName 表示表名。 返回值为 *sqlBuilder 指针,指向新创建的 sqlBuilder 实例。
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 interface{}
// 表
TableName string
// 关系
Relation string
}
条件结构体
type GroupWhere ¶
type IArgser ¶
type IArgser interface {
ParseArgs(relation string, args ...interface{}) []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.