Documentation ¶
Index ¶
- func Distinct(col interface{}) string
- func Max(col interface{}) string
- func NULL() string
- func Now() string
- type ConditionOption
- func And(field interface{}, ops Operator, value ...interface{}) ConditionOption
- func In(selectIn []interface{}, col ...interface{}) ConditionOption
- func Like(column interface{}, value interface{}) ConditionOption
- func Or(field interface{}, ops Operator, value ...interface{}) ConditionOption
- func Pair(isAnd bool, field []interface{}, value ...interface{}) ConditionOption
- type FromOption
- type FromQuery
- type InsertOption
- type Operator
- type OrderByMode
- type QueryBuild
- type SelectOption
- type TableOption
- type UpdateOption
- type WhereOption
- type WhereQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConditionOption ¶
type ConditionOption func(c *conditionQuery)
func And ¶
func And(field interface{}, ops Operator, value ...interface{}) ConditionOption
func In ¶
func In(selectIn []interface{}, col ...interface{}) ConditionOption
func Like ¶
func Like(column interface{}, value interface{}) ConditionOption
func Or ¶
func Or(field interface{}, ops Operator, value ...interface{}) ConditionOption
func Pair ¶
func Pair(isAnd bool, field []interface{}, value ...interface{}) ConditionOption
type FromOption ¶
type FromOption func(fo *fromQueryBuild)
func FromAs ¶
func FromAs(query string, as interface{}) FromOption
type FromQuery ¶
type FromQuery interface {
From(...FromOption) WhereQuery
}
type InsertOption ¶
type InsertOption func(i *insert)
func NotCheckFieldInsert ¶
func NotCheckFieldInsert() InsertOption
func OnDuplicate ¶
func OnDuplicate(listValue map[interface{}]interface{}) InsertOption
func WithField ¶
func WithField(field ...interface{}) InsertOption
func WithIgnore ¶
func WithIgnore() InsertOption
func WithValues ¶
func WithValues(rows int64) InsertOption
type OrderByMode ¶
type OrderByMode string
const ( ASC OrderByMode = "ASC" DESC OrderByMode = "DESC" )
type QueryBuild ¶
type QueryBuild interface { Insert(opts ...InsertOption) toQuery Select(opts ...SelectOption) FromQuery Update(opts ...UpdateOption) WhereQuery Delete(opts ...WhereOption) toQuery }
func NewQueryBuilder ¶
func NewQueryBuilder(tableName string, options ...TableOption) QueryBuild
type SelectOption ¶
type SelectOption func(sq *selectQueryBuild)
func Count ¶
func Count() SelectOption
func ForUpdate ¶
func ForUpdate() SelectOption
func NotCheckField ¶
func NotCheckField() SelectOption
func SelectAll ¶
func SelectAll() SelectOption
func SelectAs ¶
func SelectAs(column, as string) SelectOption
func SelectField ¶
func SelectField(list ...interface{}) SelectOption
type TableOption ¶
type TableOption func(q *tableQuery)
func Column ¶
func Column(value ...interface{}) TableOption
func WithLogger ¶
func WithLogger(l *logrus.Entry) TableOption
type UpdateOption ¶
type UpdateOption func(uq *updateQueryBuild)
func NotCheckFieldUpdate ¶
func NotCheckFieldUpdate() UpdateOption
func UpdateField ¶
func UpdateField(colName interface{}, value interface{}) UpdateOption
type WhereOption ¶
type WhereOption func(wb *whereQueryBuild)
func Condition ¶
func Condition(conOpt ...ConditionOption) WhereOption
func GroupBy ¶
func GroupBy(colName string) WhereOption
func Having ¶
func Having(colName string, conOpt ...ConditionOption) WhereOption
func Limit ¶
func Limit(offset, size int64) WhereOption
func OrderBy ¶
func OrderBy(colName string, mode OrderByMode) WhereOption
type WhereQuery ¶
type WhereQuery interface { Where(...WhereOption) toQuery // contains filtered or unexported methods }
Click to show internal directories.
Click to hide internal directories.