Documentation ¶
Overview ¶
Package utils xxx
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RawCond ¶
RawCond 自定义sql语句,支持所有mysql逻辑运算符以及mysql函数 RawCond("JSON_UNQUOTE(column_name) = xxx ") SELECT * FROM `table_name` JSON_UNQUOTE(column_name) = "xxx"
RawCond("JSON_UNQUOTE(?) = ?", "column_name", "xxx") SELECT * FROM `table_name` JSON_UNQUOTE("column_name") = "xxx"
RawCond("JSON_UNQUOTE(?) = ?", Field{Field: "column_name", Table: &q} , "xxx") SELECT * FROM `table_name` JSON_UNQUOTE("table_name"."column_name") = "xxx"
RawCond("column_name != xxx ") SELECT * FROM `table_name` column_name != "xxx"
RawCond("column_name in (?)",[]uint32{1,2,4}) SELECT * FROM `table_name` column_name in (1,2,4)
RawCond("column_name > ?", 3) SELECT * FROM `table_name` WHERE column_name > 3
RawCond("column_name like ?", "%s%") SELECT * FROM `table_name` WHERE column_name like '%s%'
Types ¶
type CustomExpr ¶
CustomExpr raw expression
func NewCustomExpr ¶
func NewCustomExpr(sql string, value []interface{}) CustomExpr
NewCustomExpr custom expression
func (CustomExpr) Build ¶
func (expr CustomExpr) Build(builder clause.Builder)
Build build raw expression