Documentation
¶
Index ¶
- Variables
- func GetColumnsByModel(mapper *reflectx.Mapper, model interface{}, omitColumns ...string) []string
- func GetColumnsByType(mapper *reflectx.Mapper, typ reflect.Type, omitColumns ...string) []string
- func GetMapperByTagName(tagName string) *reflectx.Mapper
- type Builder
- type Condition
- type ConditionBuilder
- type Deleter
- type Inserter
- func (ins *Inserter) Columns(columns ...string) *Inserter
- func (ins *Inserter) IsReplaceInto(replaceInto bool) *Inserter
- func (ins *Inserter) NameSQL() (string, error)
- func (ins *Inserter) OnDuplicateKeyUpdateString(updateString string) *Inserter
- func (ins *Inserter) SQL() (string, error)
- func (ins *Inserter) StructColumns(m interface{}, tagName string, omitColumns ...string) *Inserter
- type OrderBy
- type OrderType
- type Predicate
- type Selector
- func (s *Selector) Columns(columns ...string) *Selector
- func (s *Selector) Distinct() *Selector
- func (s *Selector) ForUpdate(isForUpdate bool) *Selector
- func (s *Selector) GroupBy(columns ...string) *Selector
- func (s *Selector) Limit(limit int) *Selector
- func (s *Selector) Offset(offset int) *Selector
- func (s *Selector) OrderBy(orderBy ...OrderBy) *Selector
- func (s *Selector) QueryString(queryString string) *Selector
- func (s *Selector) SQL() (string, error)
- func (s *Selector) SQLArgs() (string, []interface{}, error)
- func (s *Selector) StructColumns(model interface{}, tagName string, omitColumns ...string) *Selector
- func (s *Selector) Where(where ConditionBuilder) *Selector
- type SimpleCondition
- func (c *SimpleCondition) And(express string, args ...interface{}) *SimpleCondition
- func (c *SimpleCondition) Or(express string, args ...interface{}) *SimpleCondition
- func (c *SimpleCondition) Predicates() []*Predicate
- func (c *SimpleCondition) Where(express string, args ...interface{}) *SimpleCondition
- type Updater
- func (u *Updater) Columns(columns ...string) *Updater
- func (u *Updater) NameSQL() (string, error)
- func (u *Updater) SQL() (string, error)
- func (u *Updater) SQLArgs() (string, []interface{}, error)
- func (u *Updater) StructColumns(model interface{}, tagName string, omitColumns ...string) *Updater
- func (u *Updater) Where(where ConditionBuilder) *Updater
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OpAnd = &op{symbol: "AND", text: " AND "} OpOr = &op{symbol: "OR", text: " OR "} )
Functions ¶
func GetColumnsByModel ¶
func GetColumnsByType ¶
GetColumnsByType 通过字段 tag 解析数据库字段
func GetMapperByTagName ¶
Types ¶
type Condition ¶
type Condition struct {
// contains filtered or unexported fields
}
type ConditionBuilder ¶
type ConditionBuilder interface {
// contains filtered or unexported methods
}
type Deleter ¶
type Deleter struct {
// contains filtered or unexported fields
}
func (*Deleter) Where ¶
func (d *Deleter) Where(where ConditionBuilder) *Deleter
Where 条件 condition 可以通过 sqlbuilder.C() 方法创建
type Inserter ¶
type Inserter struct {
// contains filtered or unexported fields
}
func NewInserter ¶
func (*Inserter) IsReplaceInto ¶
func (*Inserter) OnDuplicateKeyUpdateString ¶
type Selector ¶
type Selector struct {
IsForUpdate bool
// contains filtered or unexported fields
}
func NewSelector ¶
func (*Selector) QueryString ¶
QueryString 自定义select字段,sql原样输出
func (*Selector) StructColumns ¶
func (s *Selector) StructColumns(model interface{}, tagName string, omitColumns ...string) *Selector
StructColumns 通过任意model解析出表字段 tagName 解析数据库字段的 tag-name omitColumns 排除哪些字段
func (*Selector) Where ¶
func (s *Selector) Where(where ConditionBuilder) *Selector
Where 条件 condition 可以通过 sqlbuilder.C() 方法创建
type SimpleCondition ¶
type SimpleCondition struct {
// contains filtered or unexported fields
}
SimpleCondition 简单 where 语句
func (*SimpleCondition) And ¶
func (c *SimpleCondition) And(express string, args ...interface{}) *SimpleCondition
And and 语句 express where 表达式
func (*SimpleCondition) Or ¶
func (c *SimpleCondition) Or(express string, args ...interface{}) *SimpleCondition
Or or 语句 express where 表达式
func (*SimpleCondition) Predicates ¶
func (c *SimpleCondition) Predicates() []*Predicate
func (*SimpleCondition) Where ¶
func (c *SimpleCondition) Where(express string, args ...interface{}) *SimpleCondition
Where express where 表达式
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
func NewUpdater ¶
func (*Updater) StructColumns ¶
StructColumns 通过任意model解析出表字段 tagName 解析数据库字段的 tag-name omitColumns 排除哪些字段
func (*Updater) Where ¶
func (u *Updater) Where(where ConditionBuilder) *Updater
Where 条件 condition 可以通过 sqlbuilder.C() 方法创建
Click to show internal directories.
Click to hide internal directories.