Documentation ¶
Overview ¶
Package field implement all type field and method
Index ¶
- Constants
- Variables
- func Attrs(attr interface{}) *attrs
- type AssignExpr
- type Asterisk
- type Bool
- func (field Bool) And(value bool) Expr
- func (field Bool) BitAnd(value bool) Expr
- func (field Bool) BitOr(value bool) Expr
- func (field Bool) BitXor(value bool) Expr
- func (field Bool) Is(value bool) Expr
- func (field Bool) Not() Bool
- func (field Bool) Or(value bool) Expr
- func (field Bool) Value(value bool) AssignExpr
- func (field Bool) Xor(value bool) Expr
- func (field Bool) Zero() AssignExpr
- type BuildOpt
- type Bytes
- func (field Bytes) Between(left []byte, right []byte) Expr
- func (field Bytes) Eq(value []byte) Expr
- func (field Bytes) Filed(values ...[]byte) Bytes
- func (field Bytes) FindInSet(targetList string) Expr
- func (field Bytes) FindInSetWith(target string) Expr
- func (field Bytes) Gt(value []byte) Expr
- func (field Bytes) Gte(value []byte) Expr
- func (field Bytes) IfNull(value []byte) Expr
- func (field Bytes) In(values ...[]byte) Expr
- func (field Bytes) Like(value string) Expr
- func (field Bytes) Lower() String
- func (field Bytes) Lt(value []byte) Expr
- func (field Bytes) Lte(value []byte) Expr
- func (field Bytes) Neq(value []byte) Expr
- func (field Bytes) NotBetween(left []byte, right []byte) Expr
- func (field Bytes) NotIn(values ...[]byte) Expr
- func (field Bytes) NotLike(value string) Expr
- func (field Bytes) NotRegxp(value string) Expr
- func (field Bytes) Regexp(value string) Expr
- func (field Bytes) SubstringIndex(delim string, count int) Bytes
- func (field Bytes) Upper() String
- func (field Bytes) Value(value []byte) AssignExpr
- func (field Bytes) Zero() AssignExpr
- type CompareOperator
- type Expr
- func And(exprs ...Expr) Expr
- func CompareSubQuery(op CompareOperator, column Expr, subQuery *gorm.DB) Expr
- func ContainsSubQuery(columns []Expr, subQuery *gorm.DB) Expr
- func ContainsValue(columns []Expr, value Value) Expr
- func EmptyExpr() Expr
- func Not(exprs ...Expr) Expr
- func Or(exprs ...Expr) Expr
- type Field
- func (e Field) Abs() Float64
- func (e Field) AddCol(col Expr) Expr
- func (e Field) As(alias string) Expr
- func (e Field) Asc() Expr
- func (e Field) AssignExpr() expression
- func (e Field) Avg() Float64
- func (e Field) BeCond() interface{}
- func (e Field) Build(builder clause.Builder)
- func (e Field) BuildColumn(stmt *gorm.Statement, opts ...BuildOpt) sql
- func (e Field) BuildWithArgs(stmt *gorm.Statement) (sql, []interface{})
- func (e Field) ColumnName() sql
- func (e Field) ConcatCol(cols ...Expr) Expr
- func (Field) CondError() error
- func (e Field) Count() Int
- func (e Field) Desc() Expr
- func (e Field) Distinct() Int
- func (e Field) DivCol(col Expr) Expr
- func (field Field) Eq(value driver.Valuer) Expr
- func (e Field) EqCol(col Expr) Expr
- func (field Field) Field(value []interface{}) Expr
- func (e Field) GroupConcat() Expr
- func (field Field) Gt(value driver.Valuer) Expr
- func (e Field) GtCol(col Expr) Expr
- func (field Field) Gte(value driver.Valuer) Expr
- func (e Field) GteCol(col Expr) Expr
- func (field Field) IfNull(value driver.Valuer) Expr
- func (field Field) In(values ...driver.Valuer) Expr
- func (e Field) IsNotNull() Expr
- func (e Field) IsNull() Expr
- func (e Field) Length() Int
- func (field Field) Like(value driver.Valuer) Expr
- func (field Field) Lt(value driver.Valuer) Expr
- func (e Field) LtCol(col Expr) Expr
- func (field Field) Lte(value driver.Valuer) Expr
- func (e Field) LteCol(col Expr) Expr
- func (e Field) Max() Float64
- func (e Field) Min() Float64
- func (e Field) MulCol(col Expr) Expr
- func (field Field) Neq(value driver.Valuer) Expr
- func (e Field) NeqCol(col Expr) Expr
- func (e Field) Null() AssignExpr
- func (e Field) RawExpr() expression
- func (e Field) SetCol(col Expr) AssignExpr
- func (e Field) SubCol(col Expr) Expr
- func (field Field) Sum() Field
- func (field Field) Value(value driver.Valuer) AssignExpr
- func (e Field) WithTable(table string) Expr
- type Float32
- func (field Float32) Add(value float32) Float32
- func (field Float32) Between(left float32, right float32) Expr
- func (field Float32) Div(value float32) Float32
- func (field Float32) Eq(value float32) Expr
- func (field Float32) Filed(values ...float32) Float32
- func (field Float32) Floor() Int
- func (field Float32) FloorDiv(value float32) Int
- func (field Float32) Gt(value float32) Expr
- func (field Float32) Gte(value float32) Expr
- func (field Float32) IfNull(value float32) Expr
- func (field Float32) In(values ...float32) Expr
- func (field Float32) Like(value float32) Expr
- func (field Float32) Lt(value float32) Expr
- func (field Float32) Lte(value float32) Expr
- func (field Float32) Mul(value float32) Float32
- func (field Float32) Neq(value float32) Expr
- func (field Float32) NotBetween(left float32, right float32) Expr
- func (field Float32) NotIn(values ...float32) Expr
- func (field Float32) NotLike(value float32) Expr
- func (field Float32) Sub(value float32) Float32
- func (field Float32) Sum() Float32
- func (field Float32) Value(value float32) AssignExpr
- func (field Float32) Zero() AssignExpr
- type Float64
- func (field Float64) Add(value float64) Float64
- func (field Float64) Between(left float64, right float64) Expr
- func (field Float64) Div(value float64) Float64
- func (field Float64) Eq(value float64) Expr
- func (field Float64) Filed(values ...float64) Float64
- func (field Float64) Floor() Int
- func (field Float64) FloorDiv(value float64) Int
- func (field Float64) Gt(value float64) Expr
- func (field Float64) Gte(value float64) Expr
- func (field Float64) IfNull(value float64) Expr
- func (field Float64) In(values ...float64) Expr
- func (field Float64) Like(value float64) Expr
- func (field Float64) Lt(value float64) Expr
- func (field Float64) Lte(value float64) Expr
- func (field Float64) Mul(value float64) Float64
- func (field Float64) Neq(value float64) Expr
- func (field Float64) NotBetween(left float64, right float64) Expr
- func (field Float64) NotIn(values ...float64) Expr
- func (field Float64) NotLike(value float64) Expr
- func (field Float64) Sub(value float64) Float64
- func (field Float64) Sum() Float64
- func (field Float64) Value(value float64) AssignExpr
- func (field Float64) Zero() AssignExpr
- type GormTag
- type IColumnName
- type IValues
- type Int
- func (field Int) Add(value int) Int
- func (field Int) Between(left int, right int) Expr
- func (field Int) BitAnd(value int) Int
- func (field Int) BitFlip() Int
- func (field Int) BitOr(value int) Int
- func (field Int) BitXor(value int) Int
- func (field Int) Div(value int) Int
- func (field Int) Eq(value int) Expr
- func (field Int) Filed(values ...int) Int
- func (field Int) FloorDiv(value int) Int
- func (field Int) Gt(value int) Expr
- func (field Int) Gte(value int) Expr
- func (field Int) IfNull(value int) Expr
- func (field Int) In(values ...int) Expr
- func (field Int) LeftShift(value int) Int
- func (field Int) Like(value int) Expr
- func (field Int) Lt(value int) Expr
- func (field Int) Lte(value int) Expr
- func (field Int) Mod(value int) Int
- func (field Int) Mul(value int) Int
- func (field Int) Neq(value int) Expr
- func (field Int) NotBetween(left int, right int) Expr
- func (field Int) NotIn(values ...int) Expr
- func (field Int) NotLike(value int) Expr
- func (field Int) RightShift(value int) Int
- func (field Int) Sub(value int) Int
- func (field Int) Sum() Int
- func (field Int) Value(value int) AssignExpr
- func (field Int) Zero() AssignExpr
- type Int16
- func (field Int16) Add(value int16) Int16
- func (field Int16) Between(left int16, right int16) Expr
- func (field Int16) BitAnd(value int16) Int16
- func (field Int16) BitFlip() Int16
- func (field Int16) BitOr(value int16) Int16
- func (field Int16) BitXor(value int16) Int16
- func (field Int16) Div(value int16) Int16
- func (field Int16) Eq(value int16) Expr
- func (field Int16) Filed(values ...int16) Int16
- func (field Int16) FloorDiv(value int16) Int16
- func (field Int16) Gt(value int16) Expr
- func (field Int16) Gte(value int16) Expr
- func (field Int16) IfNull(value int16) Expr
- func (field Int16) In(values ...int16) Expr
- func (field Int16) LeftShift(value int16) Int16
- func (field Int16) Like(value int16) Expr
- func (field Int16) Lt(value int16) Expr
- func (field Int16) Lte(value int16) Expr
- func (field Int16) Mod(value int16) Int16
- func (field Int16) Mul(value int16) Int16
- func (field Int16) Neq(value int16) Expr
- func (field Int16) NotBetween(left int16, right int16) Expr
- func (field Int16) NotIn(values ...int16) Expr
- func (field Int16) NotLike(value int16) Expr
- func (field Int16) RightShift(value int16) Int16
- func (field Int16) Sub(value int16) Int16
- func (field Int16) Sum() Int16
- func (field Int16) Value(value int16) AssignExpr
- func (field Int16) Zero() AssignExpr
- type Int32
- func (field Int32) Add(value int32) Int32
- func (field Int32) Between(left int32, right int32) Expr
- func (field Int32) BitAnd(value int32) Int32
- func (field Int32) BitFlip() Int32
- func (field Int32) BitOr(value int32) Int32
- func (field Int32) BitXor(value int32) Int32
- func (field Int32) Div(value int32) Int32
- func (field Int32) Eq(value int32) Expr
- func (field Int32) Filed(values ...int32) Int32
- func (field Int32) FloorDiv(value int32) Int32
- func (field Int32) Gt(value int32) Expr
- func (field Int32) Gte(value int32) Expr
- func (field Int32) IfNull(value int32) Expr
- func (field Int32) In(values ...int32) Expr
- func (field Int32) LeftShift(value int32) Int32
- func (field Int32) Like(value int32) Expr
- func (field Int32) Lt(value int32) Expr
- func (field Int32) Lte(value int32) Expr
- func (field Int32) Mod(value int32) Int32
- func (field Int32) Mul(value int32) Int32
- func (field Int32) Neq(value int32) Expr
- func (field Int32) NotBetween(left int32, right int32) Expr
- func (field Int32) NotIn(values ...int32) Expr
- func (field Int32) NotLike(value int32) Expr
- func (field Int32) RightShift(value int32) Int32
- func (field Int32) Sub(value int32) Int32
- func (field Int32) Sum() Int32
- func (field Int32) Value(value int32) AssignExpr
- func (field Int32) Zero() AssignExpr
- type Int64
- func (field Int64) Add(value int64) Int64
- func (field Int64) Between(left int64, right int64) Expr
- func (field Int64) BitAnd(value int64) Int64
- func (field Int64) BitFlip() Int64
- func (field Int64) BitOr(value int64) Int64
- func (field Int64) BitXor(value int64) Int64
- func (field Int64) Div(value int64) Int64
- func (field Int64) Eq(value int64) Expr
- func (field Int64) Filed(values ...int64) Int64
- func (field Int64) FloorDiv(value int64) Int64
- func (field Int64) Gt(value int64) Expr
- func (field Int64) Gte(value int64) Expr
- func (field Int64) IfNull(value int64) Expr
- func (field Int64) In(values ...int64) Expr
- func (field Int64) LeftShift(value int64) Int64
- func (field Int64) Like(value int64) Expr
- func (field Int64) Lt(value int64) Expr
- func (field Int64) Lte(value int64) Expr
- func (field Int64) Mod(value int64) Int64
- func (field Int64) Mul(value int64) Int64
- func (field Int64) Neq(value int64) Expr
- func (field Int64) NotBetween(left int64, right int64) Expr
- func (field Int64) NotIn(values ...int64) Expr
- func (field Int64) NotLike(value int64) Expr
- func (field Int64) RightShift(value int64) Int64
- func (field Int64) Sub(value int64) Int64
- func (field Int64) Sum() Int64
- func (field Int64) Value(value int64) AssignExpr
- func (field Int64) Zero() AssignExpr
- type Int8
- func (field Int8) Add(value int8) Int8
- func (field Int8) Between(left int8, right int8) Expr
- func (field Int8) BitAnd(value int8) Int8
- func (field Int8) BitFlip() Int8
- func (field Int8) BitOr(value int8) Int8
- func (field Int8) BitXor(value int8) Int8
- func (field Int8) Div(value int8) Int8
- func (field Int8) Eq(value int8) Expr
- func (field Int8) Filed(values ...int8) Int8
- func (field Int8) FloorDiv(value int8) Int8
- func (field Int8) Gt(value int8) Expr
- func (field Int8) Gte(value int8) Expr
- func (field Int8) IfNull(value int8) Expr
- func (field Int8) In(values ...int8) Expr
- func (field Int8) LeftShift(value int8) Int8
- func (field Int8) Like(value int8) Expr
- func (field Int8) Lt(value int8) Expr
- func (field Int8) Lte(value int8) Expr
- func (field Int8) Mod(value int8) Int8
- func (field Int8) Mul(value int8) Int8
- func (field Int8) Neq(value int8) Expr
- func (field Int8) NotBetween(left int8, right int8) Expr
- func (field Int8) NotIn(values ...int8) Expr
- func (field Int8) NotLike(value int8) Expr
- func (field Int8) RightShift(value int8) Int8
- func (field Int8) Sub(value int8) Int8
- func (field Int8) Sum() Int8
- func (field Int8) Value(value int8) AssignExpr
- func (field Int8) Zero() AssignExpr
- type Option
- type OrderExpr
- type RelateConfig
- type Relation
- func NewRelation(fieldName string, fieldType string, relations ...Relation) *Relation
- func NewRelationWithModel(relationship RelationshipType, fieldName string, fieldType string, ...) *Relation
- func NewRelationWithType(relationship RelationshipType, fieldName string, fieldType string, ...) *Relation
- func (r *Relation) AppendChildRelation(relations ...Relation)
- func (r Relation) ChildRelations() []Relation
- func (r Relation) Clauses(hints ...clause.Expression) RelationField
- func (r Relation) Field(fields ...string) Expr
- func (r *Relation) GetClauses() []clause.Expression
- func (r *Relation) GetConds() []Expr
- func (r *Relation) GetOrderCol() []Expr
- func (r *Relation) GetPage() (offset, limit int)
- func (r *Relation) GetScopes() []relationScope
- func (r *Relation) GetSelects() []Expr
- func (r Relation) Limit(limit int) RelationField
- func (r Relation) Model() interface{}
- func (r Relation) Name() string
- func (r Relation) Offset(offset int) RelationField
- func (r Relation) On(conds ...Expr) RelationField
- func (r Relation) Order(columns ...Expr) RelationField
- func (r Relation) Path() string
- func (r Relation) Relationship() RelationshipType
- func (r Relation) RelationshipName() string
- func (r Relation) Scopes(funcs ...relationScope) RelationField
- func (r Relation) Select(columns ...Expr) RelationField
- func (r *Relation) StructField() (fieldStr string)
- func (r *Relation) StructFieldInit() string
- func (r Relation) Type() string
- type RelationField
- type RelationshipType
- type ScanValuer
- type Serializer
- func (e Serializer) Abs() Float64
- func (e Serializer) AddCol(col Expr) Expr
- func (e Serializer) As(alias string) Expr
- func (e Serializer) Asc() Expr
- func (e Serializer) AssignExpr() expression
- func (e Serializer) Avg() Float64
- func (e Serializer) BeCond() interface{}
- func (e Serializer) Build(builder clause.Builder)
- func (e Serializer) BuildColumn(stmt *gorm.Statement, opts ...BuildOpt) sql
- func (e Serializer) BuildWithArgs(stmt *gorm.Statement) (sql, []interface{})
- func (e Serializer) ColumnName() sql
- func (e Serializer) ConcatCol(cols ...Expr) Expr
- func (Serializer) CondError() error
- func (e Serializer) Count() Int
- func (e Serializer) Desc() Expr
- func (e Serializer) Distinct() Int
- func (e Serializer) DivCol(col Expr) Expr
- func (field Serializer) Eq(value schema.SerializerValuerInterface) Expr
- func (e Serializer) EqCol(col Expr) Expr
- func (e Serializer) GroupConcat() Expr
- func (field Serializer) Gt(value schema.SerializerValuerInterface) Expr
- func (e Serializer) GtCol(col Expr) Expr
- func (field Serializer) Gte(value schema.SerializerValuerInterface) Expr
- func (e Serializer) GteCol(col Expr) Expr
- func (field Serializer) IfNull(value schema.SerializerValuerInterface) Expr
- func (field Serializer) In(values ...schema.SerializerValuerInterface) Expr
- func (e Serializer) IsNotNull() Expr
- func (e Serializer) IsNull() Expr
- func (e Serializer) Length() Int
- func (field Serializer) Like(value schema.SerializerValuerInterface) Expr
- func (field Serializer) Lt(value schema.SerializerValuerInterface) Expr
- func (e Serializer) LtCol(col Expr) Expr
- func (field Serializer) Lte(value schema.SerializerValuerInterface) Expr
- func (e Serializer) LteCol(col Expr) Expr
- func (e Serializer) Max() Float64
- func (e Serializer) Min() Float64
- func (e Serializer) MulCol(col Expr) Expr
- func (field Serializer) Neq(value schema.SerializerValuerInterface) Expr
- func (e Serializer) NeqCol(col Expr) Expr
- func (e Serializer) Null() AssignExpr
- func (e Serializer) RawExpr() expression
- func (e Serializer) SetCol(col Expr) AssignExpr
- func (e Serializer) SubCol(col Expr) Expr
- func (field Serializer) Sum() Field
- func (field Serializer) Value(value schema.SerializerValuerInterface) AssignExpr
- func (e Serializer) WithTable(table string) Expr
- type String
- func (field String) Between(left string, right string) Expr
- func (field String) Concat(before, after string) String
- func (field String) Eq(value string) Expr
- func (field String) Filed(values ...string) String
- func (field String) FindInSet(targetList string) Expr
- func (field String) FindInSetWith(target string) Expr
- func (field String) Gt(value string) Expr
- func (field String) Gte(value string) Expr
- func (field String) IfNull(value string) Expr
- func (field String) In(values ...string) Expr
- func (field String) Like(value string) Expr
- func (field String) Lower() String
- func (field String) Lt(value string) Expr
- func (field String) Lte(value string) Expr
- func (field String) Neq(value string) Expr
- func (field String) NotBetween(left string, right string) Expr
- func (field String) NotIn(values ...string) Expr
- func (field String) NotLike(value string) Expr
- func (field String) NotRegxp(value string) Expr
- func (field String) Regexp(value string) Expr
- func (field String) Replace(from, to string) String
- func (field String) SubstringIndex(delim string, count int) String
- func (field String) Upper() String
- func (field String) Value(value string) AssignExpr
- func (field String) Zero() AssignExpr
- type Tag
- type TagBuilder
- type Time
- func (field Time) Add(value time.Duration) Time
- func (field Time) Between(left time.Time, right time.Time) Expr
- func (field Time) CurDate() Time
- func (field Time) CurTime() Time
- func (field Time) Date() Time
- func (field Time) DateDiff(value time.Time) Int
- func (field Time) DateFormat(value string) String
- func (field Time) Day() Int
- func (field Time) DayName() String
- func (field Time) DayOfMonth() Int
- func (field Time) DayOfWeek() Int
- func (field Time) DayOfYear() Int
- func (field Time) Eq(value time.Time) Expr
- func (field Time) FromDays(value int) Time
- func (field Time) FromUnixtime(value int) Time
- func (field Time) Gt(value time.Time) Expr
- func (field Time) Gte(value time.Time) Expr
- func (field Time) Hour() Int
- func (field Time) IfNull(value time.Time) Expr
- func (field Time) In(values ...time.Time) Expr
- func (field Time) Lt(value time.Time) Expr
- func (field Time) Lte(value time.Time) Expr
- func (field Time) MicroSecond() Int
- func (field Time) Minute() Int
- func (field Time) Month() Int
- func (field Time) MonthName() String
- func (field Time) Neq(value time.Time) Expr
- func (field Time) NotBetween(left time.Time, right time.Time) Expr
- func (field Time) NotIn(values ...time.Time) Expr
- func (field Time) Now() Time
- func (field Time) Second() Int
- func (field Time) Sub(value time.Duration) Time
- func (field Time) Sum() Time
- func (field Time) Value(value time.Time) AssignExpr
- func (field Time) Year() Int
- func (field Time) Zero() AssignExpr
- type Uint
- func (field Uint) Add(value uint) Uint
- func (field Uint) Between(left uint, right uint) Expr
- func (field Uint) BitAnd(value uint) Uint
- func (field Uint) BitFlip() Uint
- func (field Uint) BitOr(value uint) Uint
- func (field Uint) BitXor(value uint) Uint
- func (field Uint) Div(value uint) Uint
- func (field Uint) Eq(value uint) Expr
- func (field Uint) Filed(values ...uint) Uint
- func (field Uint) FloorDiv(value uint) Uint
- func (field Uint) Gt(value uint) Expr
- func (field Uint) Gte(value uint) Expr
- func (field Uint) IfNull(value uint) Expr
- func (field Uint) In(values ...uint) Expr
- func (field Uint) LeftShift(value uint) Uint
- func (field Uint) Like(value uint) Expr
- func (field Uint) Lt(value uint) Expr
- func (field Uint) Lte(value uint) Expr
- func (field Uint) Mod(value uint) Uint
- func (field Uint) Mul(value uint) Uint
- func (field Uint) Neq(value uint) Expr
- func (field Uint) NotBetween(left uint, right uint) Expr
- func (field Uint) NotIn(values ...uint) Expr
- func (field Uint) NotLike(value uint) Expr
- func (field Uint) RightShift(value uint) Uint
- func (field Uint) Sub(value uint) Uint
- func (field Uint) Sum() Uint
- func (field Uint) Value(value uint) AssignExpr
- func (field Uint) Zero() AssignExpr
- type Uint16
- func (field Uint16) Add(value uint16) Uint16
- func (field Uint16) Between(left uint16, right uint16) Expr
- func (field Uint16) BitAnd(value uint16) Uint16
- func (field Uint16) BitFlip() Uint16
- func (field Uint16) BitOr(value uint16) Uint16
- func (field Uint16) BitXor(value uint16) Uint16
- func (field Uint16) Div(value uint16) Uint16
- func (field Uint16) Eq(value uint16) Expr
- func (field Uint16) Filed(values ...uint16) Uint16
- func (field Uint16) FloorDiv(value uint16) Uint16
- func (field Uint16) Gt(value uint16) Expr
- func (field Uint16) Gte(value uint16) Expr
- func (field Uint16) IfNull(value uint16) Expr
- func (field Uint16) In(values ...uint16) Expr
- func (field Uint16) LeftShift(value uint16) Uint16
- func (field Uint16) Like(value uint16) Expr
- func (field Uint16) Lt(value uint16) Expr
- func (field Uint16) Lte(value uint16) Expr
- func (field Uint16) Mod(value uint16) Uint16
- func (field Uint16) Mul(value uint16) Uint16
- func (field Uint16) Neq(value uint16) Expr
- func (field Uint16) NotBetween(left uint16, right uint16) Expr
- func (field Uint16) NotIn(values ...uint16) Expr
- func (field Uint16) NotLike(value uint16) Expr
- func (field Uint16) RightShift(value uint16) Uint16
- func (field Uint16) Sub(value uint16) Uint16
- func (field Uint16) Sum() Uint16
- func (field Uint16) Value(value uint16) AssignExpr
- func (field Uint16) Zero() AssignExpr
- type Uint32
- func (field Uint32) Add(value uint32) Uint32
- func (field Uint32) Between(left uint32, right uint32) Expr
- func (field Uint32) BitAnd(value uint32) Uint32
- func (field Uint32) BitFlip() Uint32
- func (field Uint32) BitOr(value uint32) Uint32
- func (field Uint32) BitXor(value uint32) Uint32
- func (field Uint32) Div(value uint32) Uint32
- func (field Uint32) Eq(value uint32) Expr
- func (field Uint32) Filed(values ...uint32) Uint32
- func (field Uint32) FloorDiv(value uint32) Uint32
- func (field Uint32) Gt(value uint32) Expr
- func (field Uint32) Gte(value uint32) Expr
- func (field Uint32) IfNull(value uint32) Expr
- func (field Uint32) In(values ...uint32) Expr
- func (field Uint32) LeftShift(value uint32) Uint32
- func (field Uint32) Like(value uint32) Expr
- func (field Uint32) Lt(value uint32) Expr
- func (field Uint32) Lte(value uint32) Expr
- func (field Uint32) Mod(value uint32) Uint32
- func (field Uint32) Mul(value uint32) Uint32
- func (field Uint32) Neq(value uint32) Expr
- func (field Uint32) NotBetween(left uint32, right uint32) Expr
- func (field Uint32) NotIn(values ...uint32) Expr
- func (field Uint32) NotLike(value uint32) Expr
- func (field Uint32) RightShift(value uint32) Uint32
- func (field Uint32) Sub(value uint32) Uint32
- func (field Uint32) Sum() Uint32
- func (field Uint32) Value(value uint32) AssignExpr
- func (field Uint32) Zero() AssignExpr
- type Uint64
- func (field Uint64) Add(value uint64) Uint64
- func (field Uint64) Between(left uint64, right uint64) Expr
- func (field Uint64) BitAnd(value uint64) Uint64
- func (field Uint64) BitFlip() Uint64
- func (field Uint64) BitOr(value uint64) Uint64
- func (field Uint64) BitXor(value uint64) Uint64
- func (field Uint64) Div(value uint64) Uint64
- func (field Uint64) Eq(value uint64) Expr
- func (field Uint64) Filed(values ...uint64) Uint64
- func (field Uint64) FloorDiv(value uint64) Uint64
- func (field Uint64) Gt(value uint64) Expr
- func (field Uint64) Gte(value uint64) Expr
- func (field Uint64) IfNull(value uint64) Expr
- func (field Uint64) In(values ...uint64) Expr
- func (field Uint64) LeftShift(value uint64) Uint64
- func (field Uint64) Like(value uint64) Expr
- func (field Uint64) Lt(value uint64) Expr
- func (field Uint64) Lte(value uint64) Expr
- func (field Uint64) Mod(value uint64) Uint64
- func (field Uint64) Mul(value uint64) Uint64
- func (field Uint64) Neq(value uint64) Expr
- func (field Uint64) NotBetween(left uint64, right uint64) Expr
- func (field Uint64) NotIn(values ...uint64) Expr
- func (field Uint64) NotLike(value uint64) Expr
- func (field Uint64) RightShift(value uint64) Uint64
- func (field Uint64) Sub(value uint64) Uint64
- func (field Uint64) Sum() Uint64
- func (field Uint64) Value(value uint64) AssignExpr
- func (field Uint64) Zero() AssignExpr
- type Uint8
- func (field Uint8) Add(value uint8) Uint8
- func (field Uint8) Between(left uint8, right uint8) Expr
- func (field Uint8) BitAnd(value uint8) Uint8
- func (field Uint8) BitFlip() Uint8
- func (field Uint8) BitOr(value uint8) Uint8
- func (field Uint8) BitXor(value uint8) Uint8
- func (field Uint8) Div(value uint8) Uint8
- func (field Uint8) Eq(value uint8) Expr
- func (field Uint8) Filed(values ...uint8) Uint8
- func (field Uint8) FloorDiv(value uint8) Uint8
- func (field Uint8) Gt(value uint8) Expr
- func (field Uint8) Gte(value uint8) Expr
- func (field Uint8) IfNull(value uint8) Expr
- func (field Uint8) In(values ...uint8) Expr
- func (field Uint8) LeftShift(value uint8) Uint8
- func (field Uint8) Like(value uint8) Expr
- func (field Uint8) Lt(value uint8) Expr
- func (field Uint8) Lte(value uint8) Expr
- func (field Uint8) Mod(value uint8) Uint8
- func (field Uint8) Mul(value uint8) Uint8
- func (field Uint8) Neq(value uint8) Expr
- func (field Uint8) NotBetween(left uint8, right uint8) Expr
- func (field Uint8) NotIn(values ...uint8) Expr
- func (field Uint8) NotLike(value uint8) Expr
- func (field Uint8) RightShift(value uint8) Uint8
- func (field Uint8) Sub(value uint8) Uint8
- func (field Uint8) Sum() Uint8
- func (field Uint8) Value(value uint8) AssignExpr
- func (field Uint8) Zero() AssignExpr
- type Value
- type ValuerType
Constants ¶
const ( TagKeyGorm = "gorm" TagKeyJson = "json" //gorm tag TagKeyGormColumn = "column" TagKeyGormType = "type" TagKeyGormPrimaryKey = "primaryKey" TagKeyGormAutoIncrement = "autoIncrement" TagKeyGormNotNull = "not null" TagKeyGormUniqueIndex = "uniqueIndex" TagKeyGormIndex = "index" TagKeyGormDefault = "default" TagKeyGormComment = "comment" )
Variables ¶
var ( // Star a symbol of "*" Star = NewAsterisk("") // ALL same with Star ALL = Star )
var Func = new(function)
Func sql functions
var ( // RelationFieldUnscoped relation fild unscoped RelationFieldUnscoped relationScope = func(tx *gorm.DB) *gorm.DB { return tx.Unscoped() } )
Functions ¶
Types ¶
type AssignExpr ¶
type AssignExpr interface { Expr AssignExpr() expression }
AssignExpr assign expression
func AssignSubQuery ¶
func AssignSubQuery(columns []Expr, subQuery *gorm.DB) AssignExpr
AssignSubQuery assign with subquery
type Asterisk ¶
type Asterisk struct {
// contains filtered or unexported fields
}
Asterisk a type of xxx.*
func NewAsterisk ¶
NewAsterisk create new * field
func (Asterisk) BuildWithArgs ¶
type Bytes ¶
type Bytes String
Bytes []byte type field
func (Bytes) FindInSetWith ¶
FindInSetWith FIND_IN_SET(input_string, field_name)
func (Bytes) NotBetween ¶
NotBetween ...
func (Bytes) SubstringIndex ¶
SubstringIndex SUBSTRING_INDEX https://dev.mysql.com/doc/refman/8.0/en/functions.html#function_substring-index
type CompareOperator ¶
type CompareOperator string
CompareOperator compare operator
const ( // EqOp = EqOp CompareOperator = " = " // NeqOp <> NeqOp CompareOperator = " <> " // GtOp > GtOp CompareOperator = " > " // GteOp >= GteOp CompareOperator = " >= " // LtOp < LtOp CompareOperator = " < " // LteOp <= LteOp CompareOperator = " <= " // ExistsOp EXISTS ExistsOp CompareOperator = "EXISTS " )
type Expr ¶
type Expr interface { // Clause Expression interface Build(clause.Builder) As(alias string) Expr IColumnName BuildColumn(*gorm.Statement, ...BuildOpt) sql BuildWithArgs(*gorm.Statement) (query sql, args []interface{}) RawExpr() expression // col operate expression AddCol(col Expr) Expr SubCol(col Expr) Expr MulCol(col Expr) Expr DivCol(col Expr) Expr ConcatCol(cols ...Expr) Expr // implement Condition BeCond() interface{} CondError() error // contains filtered or unexported methods }
Expr a query expression about field
var AssociationFields Expr = NewString("", clause.Associations).appendBuildOpts(WithoutQuote)
AssociationFields all association
func CompareSubQuery ¶
func CompareSubQuery(op CompareOperator, column Expr, subQuery *gorm.DB) Expr
CompareSubQuery compare with sub query
func ContainsSubQuery ¶
ContainsSubQuery return contains subquery when len(columns) == 1, equal to columns[0] IN (subquery) when len(columns) > 1, equal to (columns[0], columns[1], ...) IN (subquery)
func ContainsValue ¶
ContainsValue return expression which compare with value
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
Field a standard field struct
func (Field) AssignExpr ¶
func (e Field) AssignExpr() expression
func (Field) BuildColumn ¶
func (Field) BuildWithArgs ¶
func (Field) ColumnName ¶
func (e Field) ColumnName() sql
func (Field) GroupConcat ¶
func (e Field) GroupConcat() Expr
func (Field) Null ¶
func (e Field) Null() AssignExpr
func (Field) SetCol ¶
func (e Field) SetCol(col Expr) AssignExpr
type Float32 ¶
type Float32 Float64
Float32 float32 type field
func (Float32) NotBetween ¶
NotBetween ...
type Float64 ¶
type Float64 Field
Float64 float64 type field
func (Float64) NotBetween ¶
NotBetween ...
type IColumnName ¶
type IColumnName interface {
ColumnName() sql
}
type RelateConfig ¶
type RelateConfig struct { RelatePointer bool RelateSlice bool RelateSlicePointer bool JSONTag string GORMTag GormTag Tag Tag OverwriteTag Tag }
RelateConfig config for relationship
func (*RelateConfig) GetTag ¶
func (c *RelateConfig) GetTag(fieldName string) Tag
func (*RelateConfig) RelateFieldPrefix ¶
func (c *RelateConfig) RelateFieldPrefix(relationshipType RelationshipType) string
RelateFieldPrefix return generated relation field's type
type Relation ¶
type Relation struct {
// contains filtered or unexported fields
}
Relation relation meta info
func NewRelation ¶
NewRelation return a new Relation for association
func NewRelationWithModel ¶
func NewRelationWithModel(relationship RelationshipType, fieldName string, fieldType string, fieldModel interface{}, relations ...Relation) *Relation
NewRelationWithModel return a Relation with specified model struct
func NewRelationWithType ¶
func NewRelationWithType(relationship RelationshipType, fieldName string, fieldType string, relations ...Relation) *Relation
NewRelationWithType return a Relation with specified field type
func (*Relation) AppendChildRelation ¶
AppendChildRelation append child relationship
func (Relation) ChildRelations ¶
ChildRelations return child relations
func (Relation) Clauses ¶
func (r Relation) Clauses(hints ...clause.Expression) RelationField
Clauses set relation clauses
func (*Relation) GetClauses ¶
func (r *Relation) GetClauses() []clause.Expression
GetClauses get clauses
func (*Relation) GetOrderCol ¶
GetOrderCol get order columns
func (*Relation) GetScopes ¶
func (r *Relation) GetScopes() []relationScope
GetScopes get scope functions
func (Relation) Offset ¶
func (r Relation) Offset(offset int) RelationField
Offset set relation offset
func (Relation) Order ¶
func (r Relation) Order(columns ...Expr) RelationField
Order relation order columns
func (Relation) Relationship ¶
func (r Relation) Relationship() RelationshipType
Relationship relationship between field and table struct
func (Relation) RelationshipName ¶
RelationshipName relationship's name
func (Relation) Scopes ¶
func (r Relation) Scopes(funcs ...relationScope) RelationField
Scopes set scopes func
func (Relation) Select ¶
func (r Relation) Select(columns ...Expr) RelationField
Select relation select columns
func (*Relation) StructField ¶
StructField return struct field code
func (*Relation) StructFieldInit ¶
StructFieldInit return field initialize code
type RelationField ¶
type RelationField interface { Name() string Path() string // Field return expr for Select // Field() return "<self>" field name in struct // Field("RelateField") return "<self>.RelateField" for Select // Field("RelateField", "RelateRelateField") return "<self>.RelateField.RelateRelateField" for Select // ex: // Select(u.CreditCards.Field()) equals to GORM: Select("CreditCards") // Select(u.CreditCards.Field("Bank")) equals to GORM: Select("CreditCards.Bank") // Select(u.CreditCards.Field("Bank","Owner")) equals to GORM: Select("CreditCards.Bank.Owner") Field(fields ...string) Expr On(conds ...Expr) RelationField Select(conds ...Expr) RelationField Order(columns ...Expr) RelationField Clauses(hints ...clause.Expression) RelationField Scopes(funcs ...relationScope) RelationField Offset(offset int) RelationField Limit(limit int) RelationField GetConds() []Expr GetSelects() []Expr GetOrderCol() []Expr GetClauses() []clause.Expression GetScopes() []relationScope GetPage() (offset, limit int) }
RelationField interface for relation field
var Associations RelationField = NewRelation(clause.Associations, "")
Associations ...
type RelationshipType ¶
type RelationshipType schema.RelationshipType
RelationshipType table relationship
const ( // HasOne a has one association sets up a one-to-one connection with another model. Reference https://gorm.io/docs/has_one.html HasOne RelationshipType = RelationshipType(schema.HasOne) // HasOneRel has one relationship // HasMany a has many association sets up a one-to-many connection with another model. Reference https://gorm.io/docs/has_many.html HasMany RelationshipType = RelationshipType(schema.HasMany) // HasManyRel has many relationships // BelongsTo A belongs to association sets up a one-to-one connection with another model. Reference https://gorm.io/docs/belongs_to.html BelongsTo RelationshipType = RelationshipType(schema.BelongsTo) // BelongsToRel belongs to relationship // Many2Many Many to Many add a join table between two models. Reference https://gorm.io/docs/many2many.html Many2Many RelationshipType = RelationshipType(schema.Many2Many) // Many2ManyRel many to many relationship )
type ScanValuer ¶
type ScanValuer interface { Scan(src interface{}) error // sql.Scanner Value() (driver.Value, error) // driver.Valuer }
ScanValuer interface for Field
type Serializer ¶
type Serializer struct {
// contains filtered or unexported fields
}
Field2 a standard field struct
func NewSerializer ¶
func NewSerializer(table, column string, opts ...Option) Serializer
NewSerializer create new field2
func (Serializer) AssignExpr ¶
func (e Serializer) AssignExpr() expression
func (Serializer) BuildColumn ¶
func (Serializer) BuildWithArgs ¶
func (Serializer) ColumnName ¶
func (e Serializer) ColumnName() sql
func (Serializer) Eq ¶
func (field Serializer) Eq(value schema.SerializerValuerInterface) Expr
Eq judge equal
func (Serializer) EqCol ¶
======================== comparison between columns ========================
func (Serializer) GroupConcat ¶
func (e Serializer) GroupConcat() Expr
func (Serializer) Gt ¶
func (field Serializer) Gt(value schema.SerializerValuerInterface) Expr
Gt ...
func (Serializer) Gte ¶
func (field Serializer) Gte(value schema.SerializerValuerInterface) Expr
Gte ...
func (Serializer) IfNull ¶
func (field Serializer) IfNull(value schema.SerializerValuerInterface) Expr
IfNull ...
func (Serializer) In ¶
func (field Serializer) In(values ...schema.SerializerValuerInterface) Expr
In ...
func (Serializer) Like ¶
func (field Serializer) Like(value schema.SerializerValuerInterface) Expr
Like ...
func (Serializer) Lt ¶
func (field Serializer) Lt(value schema.SerializerValuerInterface) Expr
Lt ...
func (Serializer) Lte ¶
func (field Serializer) Lte(value schema.SerializerValuerInterface) Expr
Lte ...
func (Serializer) Neq ¶
func (field Serializer) Neq(value schema.SerializerValuerInterface) Expr
Neq judge not equal
func (Serializer) Null ¶
func (e Serializer) Null() AssignExpr
func (Serializer) SetCol ¶
func (e Serializer) SetCol(col Expr) AssignExpr
func (Serializer) Value ¶
func (field Serializer) Value(value schema.SerializerValuerInterface) AssignExpr
Value ...
type String ¶
type String Field
String string type field
func (String) FindInSetWith ¶
FindInSetWith equal to FIND_IN_SET(input_string, field_name)
func (String) NotBetween ¶
NotBetween ...
func (String) SubstringIndex ¶
SubstringIndex SUBSTRING_INDEX https://dev.mysql.com/doc/refman/8.0/en/functions.html#function_substring-index
type TagBuilder ¶
type TagBuilder interface {
Build() string
}
type Time ¶
type Time Field
Time time type field
func (Time) DateFormat ¶
DateFormat equal to DATE_FORMAT(self, value)
func (Time) FromUnixtime ¶
FromUnixtime equal to FROM_UNIXTIME(self)
func (Time) MicroSecond ¶
MicroSecond equal to MICROSECOND(self)
func (Time) NotBetween ¶
NotBetween ...
type Value ¶
type Value interface { // implement Condition BeCond() interface{} CondError() error // contains filtered or unexported methods }
Value ...
type ValuerType ¶
type ValuerType struct { Column string Value schema.SerializerValuerInterface FucName string }