field

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

package field implement all type field and method

Index

Constants

This section is empty.

Variables

View Source
var ALL = Star
View Source
var Func = new(function)

Func sql functions

View Source
var Star = NewString("", "*")

Star a symbol of "*"

Functions

This section is empty.

Types

type AssignExpr

type AssignExpr interface {
	Expr

	AssignExpr() expression
}

func AssignSubQuery

func AssignSubQuery(columns []Expr, subQuery *gorm.DB) AssignExpr

type Bool

type Bool Field

func NewBool

func NewBool(table, column string, opts ...FieldOption) Bool

func (Bool) And

func (field Bool) And(value bool) Expr

func (Bool) BitAnd

func (field Bool) BitAnd(value bool) Expr

func (Bool) BitOr

func (field Bool) BitOr(value bool) Expr

func (Bool) BitXor

func (field Bool) BitXor(value bool) Expr

func (Bool) Is

func (field Bool) Is(value bool) Expr

func (Bool) Not

func (field Bool) Not() Bool

func (Bool) Or

func (field Bool) Or(value bool) Expr

func (Bool) Value

func (field Bool) Value(value bool) AssignExpr

func (Bool) Xor

func (field Bool) Xor(value bool) Expr

func (Bool) Zero

func (field Bool) Zero() AssignExpr

type BuildOpt

type BuildOpt uint
const (
	// WithTable build column with table
	WithTable BuildOpt = iota

	// WithAll build column with table and alias
	WithAll

	// WithoutQuote
	WithoutQuote
)

type Bytes

type Bytes String

func NewBytes

func NewBytes(table, column string, opts ...FieldOption) Bytes

func (Bytes) Between

func (field Bytes) Between(left []byte, right []byte) Expr

func (Bytes) Eq

func (field Bytes) Eq(value []byte) Expr

func (Bytes) FindInSet

func (field Bytes) FindInSet(targetList string) Expr

FindInSet FIND_IN_SET(field_name, input_string_list)

func (Bytes) FindInSetWith

func (field Bytes) FindInSetWith(target string) Expr

FindInSetWith FIND_IN_SET(input_string, field_name)

func (Bytes) Gt

func (field Bytes) Gt(value []byte) Expr

func (Bytes) Gte

func (field Bytes) Gte(value []byte) Expr

func (Bytes) IfNull

func (field Bytes) IfNull(value []byte) Expr

func (Bytes) In

func (field Bytes) In(values ...[]byte) Expr

func (Bytes) Like

func (field Bytes) Like(value string) Expr

func (Bytes) Lt

func (field Bytes) Lt(value []byte) Expr

func (Bytes) Lte

func (field Bytes) Lte(value []byte) Expr

func (Bytes) Neq

func (field Bytes) Neq(value []byte) Expr

func (Bytes) NotBetween

func (field Bytes) NotBetween(left []byte, right []byte) Expr

func (Bytes) NotIn

func (field Bytes) NotIn(values ...[]byte) Expr

func (Bytes) NotLike

func (field Bytes) NotLike(value string) Expr

func (Bytes) NotRegxp

func (field Bytes) NotRegxp(value string) Expr

func (Bytes) Regexp

func (field Bytes) Regexp(value string) Expr

func (Bytes) Value

func (field Bytes) Value(value []byte) AssignExpr

func (Bytes) Zero

func (field Bytes) Zero() AssignExpr

type CompareOperate

type CompareOperate string
const (
	EqOp     CompareOperate = " = "
	NeqOp    CompareOperate = " <> "
	GtOp     CompareOperate = " > "
	GteOp    CompareOperate = " >= "
	LtOp     CompareOperate = " < "
	LteOp    CompareOperate = " <= "
	ExistsOp CompareOperate = "EXISTS "
)

type Expr

type Expr interface {
	As(alias string) Expr
	ColumnName() sql
	BuildColumn(*gorm.Statement, ...BuildOpt) sql
	Build(*gorm.Statement) sql
	BuildWithArgs(*gorm.Statement) (query sql, args []interface{})
	RawExpr() expression

	// implement Condition
	BeCond() interface{}
	CondError() error
	// contains filtered or unexported methods
}

Expr a query expression about field

var AssociationFields Expr = NewString("", clause.Associations)

func And

func And(exprs ...Expr) Expr

func CompareSubQuery

func CompareSubQuery(op CompareOperate, column Expr, subQuery *gorm.DB) Expr

func ContainsSubQuery

func ContainsSubQuery(columns []Expr, subQuery *gorm.DB) Expr

======================== subquery method ========================

func ContainsValue

func ContainsValue(columns []Expr, value Value) Expr

func EmptyExpr

func EmptyExpr() Expr

func Not

func Not(exprs ...Expr) Expr

func Or

func Or(exprs ...Expr) Expr

======================== boolean operate ========================

type Field

type Field struct {
	// contains filtered or unexported fields
}

Field a standard field struct

func NewField

func NewField(table, column string, opts ...FieldOption) Field

func (Field) As

func (e Field) As(alias string) Expr

======================== keyword ========================

func (Field) AssignExpr

func (e Field) AssignExpr() expression

func (Field) Avg

func (e Field) Avg() Float64

func (Field) BeCond

func (e Field) BeCond() interface{}

func (Field) Build

func (e Field) Build(stmt *gorm.Statement) sql

func (Field) BuildColumn

func (e Field) BuildColumn(stmt *gorm.Statement, opts ...BuildOpt) sql

func (Field) BuildWithArgs

func (e Field) BuildWithArgs(stmt *gorm.Statement) (sql, []interface{})

func (Field) ColumnName

func (e Field) ColumnName() sql

func (Field) CondError

func (Field) CondError() error

func (Field) Count

func (e Field) Count() Int

func (Field) Desc

func (e Field) Desc() Expr

func (Field) Distinct

func (e Field) Distinct() Int

func (Field) Eq

func (field Field) Eq(value driver.Valuer) Expr

func (Field) EqCol

func (e Field) EqCol(col Expr) Expr

======================== comparison between columns ========================

func (Field) GroupConcat

func (e Field) GroupConcat() Expr

func (Field) Gt

func (field Field) Gt(value driver.Valuer) Expr

func (Field) GtCol

func (e Field) GtCol(col Expr) Expr

func (Field) Gte

func (field Field) Gte(value driver.Valuer) Expr

func (Field) GteCol

func (e Field) GteCol(col Expr) Expr

func (Field) IfNull

func (field Field) IfNull(value driver.Valuer) Expr

func (Field) In

func (field Field) In(values ...driver.Valuer) Expr

func (Field) IsNotNull

func (e Field) IsNotNull() Expr

func (Field) IsNull

func (e Field) IsNull() Expr

func (Field) Length

func (e Field) Length() Int

func (Field) Like

func (field Field) Like(value driver.Valuer) Expr

func (Field) Lt

func (field Field) Lt(value driver.Valuer) Expr

func (Field) LtCol

func (e Field) LtCol(col Expr) Expr

func (Field) Lte

func (field Field) Lte(value driver.Valuer) Expr

func (Field) LteCol

func (e Field) LteCol(col Expr) Expr

func (Field) Max

func (e Field) Max() Float64

func (Field) Min

func (e Field) Min() Float64

func (Field) Neq

func (field Field) Neq(value driver.Valuer) Expr

func (Field) NeqCol

func (e Field) NeqCol(col Expr) Expr

func (Field) Null

func (e Field) Null() AssignExpr

func (Field) RawExpr

func (e Field) RawExpr() expression

func (Field) SetCol

func (e Field) SetCol(col Expr) AssignExpr

func (Field) Sum

func (field Field) Sum() Field

func (Field) Value

func (field Field) Value(value driver.Valuer) AssignExpr

func (Field) WithTable

func (e Field) WithTable(table string) Expr

======================== basic function ========================

type FieldOption

type FieldOption func(clause.Column) clause.Column

type Float32

type Float32 Float64

func NewFloat32

func NewFloat32(table, column string, opts ...FieldOption) Float32

func (Float32) Add

func (field Float32) Add(value float32) Float32

func (Float32) Between

func (field Float32) Between(left float32, right float32) Expr

func (Float32) Div

func (field Float32) Div(value float32) Float32

func (Float32) Eq

func (field Float32) Eq(value float32) Expr

func (Float32) Floor

func (field Float32) Floor() Int

func (Float32) FloorDiv

func (field Float32) FloorDiv(value float32) Int

func (Float32) Gt

func (field Float32) Gt(value float32) Expr

func (Float32) Gte

func (field Float32) Gte(value float32) Expr

func (Float32) IfNull

func (field Float32) IfNull(value float32) Expr

func (Float32) In

func (field Float32) In(values ...float32) Expr

func (Float32) Like

func (field Float32) Like(value float32) Expr

func (Float32) Lt

func (field Float32) Lt(value float32) Expr

func (Float32) Lte

func (field Float32) Lte(value float32) Expr

func (Float32) Mul

func (field Float32) Mul(value float32) Float32

func (Float32) Neq

func (field Float32) Neq(value float32) Expr

func (Float32) NotBetween

func (field Float32) NotBetween(left float32, right float32) Expr

func (Float32) NotIn

func (field Float32) NotIn(values ...float32) Expr

func (Float32) NotLike

func (field Float32) NotLike(value float32) Expr

func (Float32) Sub

func (field Float32) Sub(value float32) Float32

func (Float32) Sum

func (field Float32) Sum() Float32

func (Float32) Value

func (field Float32) Value(value float32) AssignExpr

func (Float32) Zero

func (field Float32) Zero() AssignExpr

type Float64

type Float64 Field

func NewFloat64

func NewFloat64(table, column string, opts ...FieldOption) Float64

func (Float64) Add

func (field Float64) Add(value float64) Float64

func (Float64) Between

func (field Float64) Between(left float64, right float64) Expr

func (Float64) Div

func (field Float64) Div(value float64) Float64

func (Float64) Eq

func (field Float64) Eq(value float64) Expr

func (Float64) Floor

func (field Float64) Floor() Int

func (Float64) FloorDiv

func (field Float64) FloorDiv(value float64) Int

func (Float64) Gt

func (field Float64) Gt(value float64) Expr

func (Float64) Gte

func (field Float64) Gte(value float64) Expr

func (Float64) IfNull

func (field Float64) IfNull(value float64) Expr

func (Float64) In

func (field Float64) In(values ...float64) Expr

func (Float64) Like

func (field Float64) Like(value float64) Expr

func (Float64) Lt

func (field Float64) Lt(value float64) Expr

func (Float64) Lte

func (field Float64) Lte(value float64) Expr

func (Float64) Mul

func (field Float64) Mul(value float64) Float64

func (Float64) Neq

func (field Float64) Neq(value float64) Expr

func (Float64) NotBetween

func (field Float64) NotBetween(left float64, right float64) Expr

func (Float64) NotIn

func (field Float64) NotIn(values ...float64) Expr

func (Float64) NotLike

func (field Float64) NotLike(value float64) Expr

func (Float64) Sub

func (field Float64) Sub(value float64) Float64

func (Float64) Sum

func (field Float64) Sum() Float64

func (Float64) Value

func (field Float64) Value(value float64) AssignExpr

func (Float64) Zero

func (field Float64) Zero() AssignExpr

type Int

type Int Field

func NewInt

func NewInt(table, column string, opts ...FieldOption) Int

func (Int) Add

func (field Int) Add(value int) Int

func (Int) Between

func (field Int) Between(left int, right int) Expr

func (Int) BitAnd

func (field Int) BitAnd(value int) Int

func (Int) BitFlip

func (field Int) BitFlip() Int

func (Int) BitOr

func (field Int) BitOr(value int) Int

func (Int) BitXor

func (field Int) BitXor(value int) Int

func (Int) Div

func (field Int) Div(value int) Int

func (Int) Eq

func (field Int) Eq(value int) Expr

func (Int) FloorDiv

func (field Int) FloorDiv(value int) Int

func (Int) Gt

func (field Int) Gt(value int) Expr

func (Int) Gte

func (field Int) Gte(value int) Expr

func (Int) IfNull

func (field Int) IfNull(value int) Expr

func (Int) In

func (field Int) In(values ...int) Expr

func (Int) LeftShift

func (field Int) LeftShift(value int) Int

func (Int) Like

func (field Int) Like(value int) Expr

func (Int) Lt

func (field Int) Lt(value int) Expr

func (Int) Lte

func (field Int) Lte(value int) Expr

func (Int) Mod

func (field Int) Mod(value int) Int

func (Int) Mul

func (field Int) Mul(value int) Int

func (Int) Neq

func (field Int) Neq(value int) Expr

func (Int) NotBetween

func (field Int) NotBetween(left int, right int) Expr

func (Int) NotIn

func (field Int) NotIn(values ...int) Expr

func (Int) NotLike

func (field Int) NotLike(value int) Expr

func (Int) RightShift

func (field Int) RightShift(value int) Int

func (Int) Sub

func (field Int) Sub(value int) Int

func (Int) Sum

func (field Int) Sum() Int

func (Int) Value

func (field Int) Value(value int) AssignExpr

func (Int) Zero

func (field Int) Zero() AssignExpr

type Int16

type Int16 Int

func NewInt16

func NewInt16(table, column string, opts ...FieldOption) Int16

func (Int16) Add

func (field Int16) Add(value int16) Int16

func (Int16) Between

func (field Int16) Between(left int16, right int16) Expr

func (Int16) BitAnd

func (field Int16) BitAnd(value int16) Int16

func (Int16) BitFlip

func (field Int16) BitFlip() Int16

func (Int16) BitOr

func (field Int16) BitOr(value int16) Int16

func (Int16) BitXor

func (field Int16) BitXor(value int16) Int16

func (Int16) Div

func (field Int16) Div(value int16) Int16

func (Int16) Eq

func (field Int16) Eq(value int16) Expr

func (Int16) FloorDiv

func (field Int16) FloorDiv(value int16) Int16

func (Int16) Gt

func (field Int16) Gt(value int16) Expr

func (Int16) Gte

func (field Int16) Gte(value int16) Expr

func (Int16) IfNull

func (field Int16) IfNull(value int16) Expr

func (Int16) In

func (field Int16) In(values ...int16) Expr

func (Int16) LeftShift

func (field Int16) LeftShift(value int16) Int16

func (Int16) Like

func (field Int16) Like(value int16) Expr

func (Int16) Lt

func (field Int16) Lt(value int16) Expr

func (Int16) Lte

func (field Int16) Lte(value int16) Expr

func (Int16) Mod

func (field Int16) Mod(value int16) Int16

func (Int16) Mul

func (field Int16) Mul(value int16) Int16

func (Int16) Neq

func (field Int16) Neq(value int16) Expr

func (Int16) NotBetween

func (field Int16) NotBetween(left int16, right int16) Expr

func (Int16) NotIn

func (field Int16) NotIn(values ...int16) Expr

func (Int16) NotLike

func (field Int16) NotLike(value int16) Expr

func (Int16) RightShift

func (field Int16) RightShift(value int16) Int16

func (Int16) Sub

func (field Int16) Sub(value int16) Int16

func (Int16) Sum

func (field Int16) Sum() Int16

func (Int16) Value

func (field Int16) Value(value int16) AssignExpr

func (Int16) Zero

func (field Int16) Zero() AssignExpr

type Int32

type Int32 Int

func NewInt32

func NewInt32(table, column string, opts ...FieldOption) Int32

func (Int32) Add

func (field Int32) Add(value int32) Int32

func (Int32) Between

func (field Int32) Between(left int32, right int32) Expr

func (Int32) BitAnd

func (field Int32) BitAnd(value int32) Int32

func (Int32) BitFlip

func (field Int32) BitFlip() Int32

func (Int32) BitOr

func (field Int32) BitOr(value int32) Int32

func (Int32) BitXor

func (field Int32) BitXor(value int32) Int32

func (Int32) Div

func (field Int32) Div(value int32) Int32

func (Int32) Eq

func (field Int32) Eq(value int32) Expr

func (Int32) FloorDiv

func (field Int32) FloorDiv(value int32) Int32

func (Int32) Gt

func (field Int32) Gt(value int32) Expr

func (Int32) Gte

func (field Int32) Gte(value int32) Expr

func (Int32) IfNull

func (field Int32) IfNull(value int32) Expr

func (Int32) In

func (field Int32) In(values ...int32) Expr

func (Int32) LeftShift

func (field Int32) LeftShift(value int32) Int32

func (Int32) Like

func (field Int32) Like(value int32) Expr

func (Int32) Lt

func (field Int32) Lt(value int32) Expr

func (Int32) Lte

func (field Int32) Lte(value int32) Expr

func (Int32) Mod

func (field Int32) Mod(value int32) Int32

func (Int32) Mul

func (field Int32) Mul(value int32) Int32

func (Int32) Neq

func (field Int32) Neq(value int32) Expr

func (Int32) NotBetween

func (field Int32) NotBetween(left int32, right int32) Expr

func (Int32) NotIn

func (field Int32) NotIn(values ...int32) Expr

func (Int32) NotLike

func (field Int32) NotLike(value int32) Expr

func (Int32) RightShift

func (field Int32) RightShift(value int32) Int32

func (Int32) Sub

func (field Int32) Sub(value int32) Int32

func (Int32) Sum

func (field Int32) Sum() Int32

func (Int32) Value

func (field Int32) Value(value int32) AssignExpr

func (Int32) Zero

func (field Int32) Zero() AssignExpr

type Int64

type Int64 Int

func NewInt64

func NewInt64(table, column string, opts ...FieldOption) Int64

func (Int64) Add

func (field Int64) Add(value int64) Int64

func (Int64) Between

func (field Int64) Between(left int64, right int64) Expr

func (Int64) BitAnd

func (field Int64) BitAnd(value int64) Int64

func (Int64) BitFlip

func (field Int64) BitFlip() Int64

func (Int64) BitOr

func (field Int64) BitOr(value int64) Int64

func (Int64) BitXor

func (field Int64) BitXor(value int64) Int64

func (Int64) Div

func (field Int64) Div(value int64) Int64

func (Int64) Eq

func (field Int64) Eq(value int64) Expr

func (Int64) FloorDiv

func (field Int64) FloorDiv(value int64) Int64

func (Int64) Gt

func (field Int64) Gt(value int64) Expr

func (Int64) Gte

func (field Int64) Gte(value int64) Expr

func (Int64) IfNull

func (field Int64) IfNull(value int64) Expr

func (Int64) In

func (field Int64) In(values ...int64) Expr

func (Int64) LeftShift

func (field Int64) LeftShift(value int64) Int64

func (Int64) Like

func (field Int64) Like(value int64) Expr

func (Int64) Lt

func (field Int64) Lt(value int64) Expr

func (Int64) Lte

func (field Int64) Lte(value int64) Expr

func (Int64) Mod

func (field Int64) Mod(value int64) Int64

func (Int64) Mul

func (field Int64) Mul(value int64) Int64

func (Int64) Neq

func (field Int64) Neq(value int64) Expr

func (Int64) NotBetween

func (field Int64) NotBetween(left int64, right int64) Expr

func (Int64) NotIn

func (field Int64) NotIn(values ...int64) Expr

func (Int64) NotLike

func (field Int64) NotLike(value int64) Expr

func (Int64) RightShift

func (field Int64) RightShift(value int64) Int64

func (Int64) Sub

func (field Int64) Sub(value int64) Int64

func (Int64) Sum

func (field Int64) Sum() Int64

func (Int64) Value

func (field Int64) Value(value int64) AssignExpr

func (Int64) Zero

func (field Int64) Zero() AssignExpr

type Int8

type Int8 Int

func NewInt8

func NewInt8(table, column string, opts ...FieldOption) Int8

func (Int8) Add

func (field Int8) Add(value int8) Int8

func (Int8) Between

func (field Int8) Between(left int8, right int8) Expr

func (Int8) BitAnd

func (field Int8) BitAnd(value int8) Int8

func (Int8) BitFlip

func (field Int8) BitFlip() Int8

func (Int8) BitOr

func (field Int8) BitOr(value int8) Int8

func (Int8) BitXor

func (field Int8) BitXor(value int8) Int8

func (Int8) Div

func (field Int8) Div(value int8) Int8

func (Int8) Eq

func (field Int8) Eq(value int8) Expr

func (Int8) FloorDiv

func (field Int8) FloorDiv(value int8) Int8

func (Int8) Gt

func (field Int8) Gt(value int8) Expr

func (Int8) Gte

func (field Int8) Gte(value int8) Expr

func (Int8) IfNull

func (field Int8) IfNull(value int8) Expr

func (Int8) In

func (field Int8) In(values ...int8) Expr

func (Int8) LeftShift

func (field Int8) LeftShift(value int8) Int8

func (Int8) Like

func (field Int8) Like(value int8) Expr

func (Int8) Lt

func (field Int8) Lt(value int8) Expr

func (Int8) Lte

func (field Int8) Lte(value int8) Expr

func (Int8) Mod

func (field Int8) Mod(value int8) Int8

func (Int8) Mul

func (field Int8) Mul(value int8) Int8

func (Int8) Neq

func (field Int8) Neq(value int8) Expr

func (Int8) NotBetween

func (field Int8) NotBetween(left int8, right int8) Expr

func (Int8) NotIn

func (field Int8) NotIn(values ...int8) Expr

func (Int8) NotLike

func (field Int8) NotLike(value int8) Expr

func (Int8) RightShift

func (field Int8) RightShift(value int8) Int8

func (Int8) Sub

func (field Int8) Sub(value int8) Int8

func (Int8) Sum

func (field Int8) Sum() Int8

func (Int8) Value

func (field Int8) Value(value int8) AssignExpr

func (Int8) Zero

func (field Int8) Zero() AssignExpr

type OrderExpr

type OrderExpr interface {
	Expr
	Desc() Expr
}

type RelateConfig

type RelateConfig struct {
	RelatePointer      bool
	RelateSlice        bool
	RelateSlicePointer bool

	JSONTag      string
	GORMTag      string
	NewTag       string
	OverwriteTag string
}

func (*RelateConfig) RelateFieldPrefix

func (c *RelateConfig) RelateFieldPrefix(relationshipType RelationshipType) string

type Relation

type Relation struct {
	// contains filtered or unexported fields
}

func NewRelation

func NewRelation(fieldName string, fieldType string, relations ...Relation) *Relation

func NewRelationWithModel

func NewRelationWithModel(relationship RelationshipType, fieldName string, fieldType string, fieldModel interface{}, relations ...Relation) *Relation

func NewRelationWithType

func NewRelationWithType(relationship RelationshipType, fieldName string, fieldType string, relations ...Relation) *Relation

func (*Relation) AppendChildRelation

func (r *Relation) AppendChildRelation(relations ...Relation)

func (Relation) ChildRelations

func (r Relation) ChildRelations() []Relation

func (Relation) Clauses

func (r Relation) Clauses(hints ...clause.Expression) RelationField

func (Relation) Field

func (r Relation) Field(fields ...string) Expr

func (*Relation) GetClauses

func (r *Relation) GetClauses() []clause.Expression

func (*Relation) GetConds

func (r *Relation) GetConds() []Expr

func (*Relation) GetOrderCol

func (r *Relation) GetOrderCol() []Expr

func (*Relation) GetPage

func (r *Relation) GetPage() (offset, limit int)

func (*Relation) GetSelects

func (r *Relation) GetSelects() []Expr

func (Relation) Limit

func (r Relation) Limit(limit int) RelationField

func (Relation) Model

func (r Relation) Model() interface{}

func (Relation) Name

func (r Relation) Name() string

func (Relation) Offset

func (r Relation) Offset(offset int) RelationField

func (Relation) On

func (r Relation) On(conds ...Expr) RelationField

func (Relation) Order

func (r Relation) Order(columns ...Expr) RelationField

func (Relation) Path

func (r Relation) Path() string

func (Relation) Relationship

func (r Relation) Relationship() RelationshipType

func (Relation) RelationshipName

func (r Relation) RelationshipName() string

func (Relation) Select

func (r Relation) Select(columns ...Expr) RelationField

func (*Relation) StructField

func (r *Relation) StructField() (fieldStr string)

func (*Relation) StructFieldInit

func (r *Relation) StructFieldInit() string

func (Relation) Type

func (r Relation) Type() string

type RelationField

type RelationField interface {
	Name() string
	Path() string
	Field(fields ...string) Expr

	On(conds ...Expr) RelationField
	Select(conds ...Expr) RelationField
	Order(columns ...Expr) RelationField
	Clauses(hints ...clause.Expression) RelationField
	Offset(offset int) RelationField
	Limit(limit int) RelationField

	GetConds() []Expr
	GetSelects() []Expr
	GetOrderCol() []Expr
	GetClauses() []clause.Expression
	GetPage() (offset, limit int)
}
var Associations RelationField = NewRelation(clause.Associations, "")

type RelationshipType

type RelationshipType schema.RelationshipType
const (
	HasOne    RelationshipType = RelationshipType(schema.HasOne)    // HasOneRel has one relationship
	HasMany   RelationshipType = RelationshipType(schema.HasMany)   // HasManyRel has many relationships
	BelongsTo RelationshipType = RelationshipType(schema.BelongsTo) // BelongsToRel belongs to relationship
	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
}

type String

type String Field

func NewString

func NewString(table, column string, opts ...FieldOption) String

func (String) Between

func (field String) Between(left string, right string) Expr

func (String) Eq

func (field String) Eq(value string) Expr

func (String) FindInSet

func (field String) FindInSet(targetList string) Expr

FindInSet FIND_IN_SET(field_name, input_string_list)

func (String) FindInSetWith

func (field String) FindInSetWith(target string) Expr

FindInSetWith FIND_IN_SET(input_string, field_name)

func (String) Gt

func (field String) Gt(value string) Expr

func (String) Gte

func (field String) Gte(value string) Expr

func (String) IfNull

func (field String) IfNull(value string) Expr

func (String) In

func (field String) In(values ...string) Expr

func (String) Like

func (field String) Like(value string) Expr

func (String) Lt

func (field String) Lt(value string) Expr

func (String) Lte

func (field String) Lte(value string) Expr

func (String) Neq

func (field String) Neq(value string) Expr

func (String) NotBetween

func (field String) NotBetween(left string, right string) Expr

func (String) NotIn

func (field String) NotIn(values ...string) Expr

func (String) NotLike

func (field String) NotLike(value string) Expr

func (String) NotRegxp

func (field String) NotRegxp(value string) Expr

func (String) Regexp

func (field String) Regexp(value string) Expr

func (String) Value

func (field String) Value(value string) AssignExpr

func (String) Zero

func (field String) Zero() AssignExpr

type Time

type Time Field

func NewTime

func NewTime(table, column string, opts ...FieldOption) Time

func (Time) Add

func (field Time) Add(value time.Duration) Time

func (Time) Between

func (field Time) Between(left time.Time, right time.Time) Expr

func (Time) CurDate

func (field Time) CurDate() Time

func (Time) CurTime

func (field Time) CurTime() Time

func (Time) Date

func (field Time) Date() Time

func (Time) DateDiff

func (field Time) DateDiff(value time.Time) Int

func (Time) DateFormat

func (field Time) DateFormat(value string) String

func (Time) Day

func (field Time) Day() Int

func (Time) DayName

func (field Time) DayName() String

func (Time) DayOfMonth

func (field Time) DayOfMonth() Int

func (Time) DayOfWeek

func (field Time) DayOfWeek() Int

func (Time) DayOfYear

func (field Time) DayOfYear() Int

func (Time) Eq

func (field Time) Eq(value time.Time) Expr

func (Time) FromDays

func (field Time) FromDays(value int) Time

func (Time) FromUnixtime

func (field Time) FromUnixtime(value int) Time

func (Time) Gt

func (field Time) Gt(value time.Time) Expr

func (Time) Gte

func (field Time) Gte(value time.Time) Expr

func (Time) Hour

func (field Time) Hour() Int

func (Time) IfNull

func (field Time) IfNull(value Time) Expr

func (Time) In

func (field Time) In(values ...time.Time) Expr

func (Time) Lt

func (field Time) Lt(value time.Time) Expr

func (Time) Lte

func (field Time) Lte(value time.Time) Expr

func (Time) MicroSecond

func (field Time) MicroSecond() Int

func (Time) Minute

func (field Time) Minute() Int

func (Time) Month

func (field Time) Month() Int

func (Time) MonthName

func (field Time) MonthName() String

func (Time) Neq

func (field Time) Neq(value time.Time) Expr

func (Time) NotBetween

func (field Time) NotBetween(left time.Time, right time.Time) Expr

func (Time) NotIn

func (field Time) NotIn(values ...time.Time) Expr

func (Time) Now

func (field Time) Now() Time

func (Time) Second

func (field Time) Second() Int

func (Time) Sub

func (field Time) Sub(value time.Duration) Time

func (Time) Sum

func (field Time) Sum() Time

func (Time) Value

func (field Time) Value(value time.Time) AssignExpr

func (Time) Zero

func (field Time) Zero() AssignExpr

type Uint

type Uint Int

func NewUint

func NewUint(table, column string, opts ...FieldOption) Uint

func (Uint) Add

func (field Uint) Add(value uint) Uint

func (Uint) Between

func (field Uint) Between(left uint, right uint) Expr

func (Uint) BitAnd

func (field Uint) BitAnd(value uint) Uint

func (Uint) BitFlip

func (field Uint) BitFlip() Uint

func (Uint) BitOr

func (field Uint) BitOr(value uint) Uint

func (Uint) BitXor

func (field Uint) BitXor(value uint) Uint

func (Uint) Div

func (field Uint) Div(value uint) Uint

func (Uint) Eq

func (field Uint) Eq(value uint) Expr

func (Uint) FloorDiv

func (field Uint) FloorDiv(value uint) Uint

func (Uint) Gt

func (field Uint) Gt(value uint) Expr

func (Uint) Gte

func (field Uint) Gte(value uint) Expr

func (Uint) IfNull

func (field Uint) IfNull(value uint) Expr

func (Uint) In

func (field Uint) In(values ...uint) Expr

func (Uint) LeftShift

func (field Uint) LeftShift(value uint) Uint

func (Uint) Like

func (field Uint) Like(value uint) Expr

func (Uint) Lt

func (field Uint) Lt(value uint) Expr

func (Uint) Lte

func (field Uint) Lte(value uint) Expr

func (Uint) Mod

func (field Uint) Mod(value uint) Uint

func (Uint) Mul

func (field Uint) Mul(value uint) Uint

func (Uint) Neq

func (field Uint) Neq(value uint) Expr

func (Uint) NotBetween

func (field Uint) NotBetween(left uint, right uint) Expr

func (Uint) NotIn

func (field Uint) NotIn(values ...uint) Expr

func (Uint) NotLike

func (field Uint) NotLike(value uint) Expr

func (Uint) RightShift

func (field Uint) RightShift(value uint) Uint

func (Uint) Sub

func (field Uint) Sub(value uint) Uint

func (Uint) Sum

func (field Uint) Sum() Uint

func (Uint) Value

func (field Uint) Value(value uint) AssignExpr

func (Uint) Zero

func (field Uint) Zero() AssignExpr

type Uint16

type Uint16 Int

func NewUint16

func NewUint16(table, column string, opts ...FieldOption) Uint16

func (Uint16) Add

func (field Uint16) Add(value uint16) Uint16

func (Uint16) Between

func (field Uint16) Between(left uint16, right uint16) Expr

func (Uint16) BitAnd

func (field Uint16) BitAnd(value uint16) Uint16

func (Uint16) BitFlip

func (field Uint16) BitFlip() Uint16

func (Uint16) BitOr

func (field Uint16) BitOr(value uint16) Uint16

func (Uint16) BitXor

func (field Uint16) BitXor(value uint16) Uint16

func (Uint16) Div

func (field Uint16) Div(value uint16) Uint16

func (Uint16) Eq

func (field Uint16) Eq(value uint16) Expr

func (Uint16) FloorDiv

func (field Uint16) FloorDiv(value uint16) Uint16

func (Uint16) Gt

func (field Uint16) Gt(value uint16) Expr

func (Uint16) Gte

func (field Uint16) Gte(value uint16) Expr

func (Uint16) IfNull

func (field Uint16) IfNull(value uint16) Expr

func (Uint16) In

func (field Uint16) In(values ...uint16) Expr

func (Uint16) LeftShift

func (field Uint16) LeftShift(value uint16) Uint16

func (Uint16) Like

func (field Uint16) Like(value uint16) Expr

func (Uint16) Lt

func (field Uint16) Lt(value uint16) Expr

func (Uint16) Lte

func (field Uint16) Lte(value uint16) Expr

func (Uint16) Mod

func (field Uint16) Mod(value uint16) Uint16

func (Uint16) Mul

func (field Uint16) Mul(value uint16) Uint16

func (Uint16) Neq

func (field Uint16) Neq(value uint16) Expr

func (Uint16) NotBetween

func (field Uint16) NotBetween(left uint16, right uint16) Expr

func (Uint16) NotIn

func (field Uint16) NotIn(values ...uint16) Expr

func (Uint16) NotLike

func (field Uint16) NotLike(value uint16) Expr

func (Uint16) RightShift

func (field Uint16) RightShift(value uint16) Uint16

func (Uint16) Sub

func (field Uint16) Sub(value uint16) Uint16

func (Uint16) Sum

func (field Uint16) Sum() Uint16

func (Uint16) Value

func (field Uint16) Value(value uint16) AssignExpr

func (Uint16) Zero

func (field Uint16) Zero() AssignExpr

type Uint32

type Uint32 Int

func NewUint32

func NewUint32(table, column string, opts ...FieldOption) Uint32

func (Uint32) Add

func (field Uint32) Add(value uint32) Uint32

func (Uint32) Between

func (field Uint32) Between(left uint32, right uint32) Expr

func (Uint32) BitAnd

func (field Uint32) BitAnd(value uint32) Uint32

func (Uint32) BitFlip

func (field Uint32) BitFlip() Uint32

func (Uint32) BitOr

func (field Uint32) BitOr(value uint32) Uint32

func (Uint32) BitXor

func (field Uint32) BitXor(value uint32) Uint32

func (Uint32) Div

func (field Uint32) Div(value uint32) Uint32

func (Uint32) Eq

func (field Uint32) Eq(value uint32) Expr

func (Uint32) FloorDiv

func (field Uint32) FloorDiv(value uint32) Uint32

func (Uint32) Gt

func (field Uint32) Gt(value uint32) Expr

func (Uint32) Gte

func (field Uint32) Gte(value uint32) Expr

func (Uint32) IfNull

func (field Uint32) IfNull(value uint32) Expr

func (Uint32) In

func (field Uint32) In(values ...uint32) Expr

func (Uint32) LeftShift

func (field Uint32) LeftShift(value uint32) Uint32

func (Uint32) Like

func (field Uint32) Like(value uint32) Expr

func (Uint32) Lt

func (field Uint32) Lt(value uint32) Expr

func (Uint32) Lte

func (field Uint32) Lte(value uint32) Expr

func (Uint32) Mod

func (field Uint32) Mod(value uint32) Uint32

func (Uint32) Mul

func (field Uint32) Mul(value uint32) Uint32

func (Uint32) Neq

func (field Uint32) Neq(value uint32) Expr

func (Uint32) NotBetween

func (field Uint32) NotBetween(left uint32, right uint32) Expr

func (Uint32) NotIn

func (field Uint32) NotIn(values ...uint32) Expr

func (Uint32) NotLike

func (field Uint32) NotLike(value uint32) Expr

func (Uint32) RightShift

func (field Uint32) RightShift(value uint32) Uint32

func (Uint32) Sub

func (field Uint32) Sub(value uint32) Uint32

func (Uint32) Sum

func (field Uint32) Sum() Uint32

func (Uint32) Value

func (field Uint32) Value(value uint32) AssignExpr

func (Uint32) Zero

func (field Uint32) Zero() AssignExpr

type Uint64

type Uint64 Int

func NewUint64

func NewUint64(table, column string, opts ...FieldOption) Uint64

func (Uint64) Add

func (field Uint64) Add(value uint64) Uint64

func (Uint64) Between

func (field Uint64) Between(left uint64, right uint64) Expr

func (Uint64) BitAnd

func (field Uint64) BitAnd(value uint64) Uint64

func (Uint64) BitFlip

func (field Uint64) BitFlip() Uint64

func (Uint64) BitOr

func (field Uint64) BitOr(value uint64) Uint64

func (Uint64) BitXor

func (field Uint64) BitXor(value uint64) Uint64

func (Uint64) Div

func (field Uint64) Div(value uint64) Uint64

func (Uint64) Eq

func (field Uint64) Eq(value uint64) Expr

func (Uint64) FloorDiv

func (field Uint64) FloorDiv(value uint64) Uint64

func (Uint64) Gt

func (field Uint64) Gt(value uint64) Expr

func (Uint64) Gte

func (field Uint64) Gte(value uint64) Expr

func (Uint64) IfNull

func (field Uint64) IfNull(value uint64) Expr

func (Uint64) In

func (field Uint64) In(values ...uint64) Expr

func (Uint64) LeftShift

func (field Uint64) LeftShift(value uint64) Uint64

func (Uint64) Like

func (field Uint64) Like(value uint64) Expr

func (Uint64) Lt

func (field Uint64) Lt(value uint64) Expr

func (Uint64) Lte

func (field Uint64) Lte(value uint64) Expr

func (Uint64) Mod

func (field Uint64) Mod(value uint64) Uint64

func (Uint64) Mul

func (field Uint64) Mul(value uint64) Uint64

func (Uint64) Neq

func (field Uint64) Neq(value uint64) Expr

func (Uint64) NotBetween

func (field Uint64) NotBetween(left uint64, right uint64) Expr

func (Uint64) NotIn

func (field Uint64) NotIn(values ...uint64) Expr

func (Uint64) NotLike

func (field Uint64) NotLike(value uint64) Expr

func (Uint64) RightShift

func (field Uint64) RightShift(value uint64) Uint64

func (Uint64) Sub

func (field Uint64) Sub(value uint64) Uint64

func (Uint64) Sum

func (field Uint64) Sum() Uint64

func (Uint64) Value

func (field Uint64) Value(value uint64) AssignExpr

func (Uint64) Zero

func (field Uint64) Zero() AssignExpr

type Uint8

type Uint8 Int

func NewUint8

func NewUint8(table, column string, opts ...FieldOption) Uint8

func (Uint8) Add

func (field Uint8) Add(value uint8) Uint8

func (Uint8) Between

func (field Uint8) Between(left uint8, right uint8) Expr

func (Uint8) BitAnd

func (field Uint8) BitAnd(value uint8) Uint8

func (Uint8) BitFlip

func (field Uint8) BitFlip() Uint8

func (Uint8) BitOr

func (field Uint8) BitOr(value uint8) Uint8

func (Uint8) BitXor

func (field Uint8) BitXor(value uint8) Uint8

func (Uint8) Div

func (field Uint8) Div(value uint8) Uint8

func (Uint8) Eq

func (field Uint8) Eq(value uint8) Expr

func (Uint8) FloorDiv

func (field Uint8) FloorDiv(value uint8) Uint8

func (Uint8) Gt

func (field Uint8) Gt(value uint8) Expr

func (Uint8) Gte

func (field Uint8) Gte(value uint8) Expr

func (Uint8) IfNull

func (field Uint8) IfNull(value uint8) Expr

func (Uint8) In

func (field Uint8) In(values ...uint8) Expr

func (Uint8) LeftShift

func (field Uint8) LeftShift(value uint8) Uint8

func (Uint8) Like

func (field Uint8) Like(value uint8) Expr

func (Uint8) Lt

func (field Uint8) Lt(value uint8) Expr

func (Uint8) Lte

func (field Uint8) Lte(value uint8) Expr

func (Uint8) Mod

func (field Uint8) Mod(value uint8) Uint8

func (Uint8) Mul

func (field Uint8) Mul(value uint8) Uint8

func (Uint8) Neq

func (field Uint8) Neq(value uint8) Expr

func (Uint8) NotBetween

func (field Uint8) NotBetween(left uint8, right uint8) Expr

func (Uint8) NotIn

func (field Uint8) NotIn(values ...uint8) Expr

func (Uint8) NotLike

func (field Uint8) NotLike(value uint8) Expr

func (Uint8) RightShift

func (field Uint8) RightShift(value uint8) Uint8

func (Uint8) Sub

func (field Uint8) Sub(value uint8) Uint8

func (Uint8) Sum

func (field Uint8) Sum() Uint8

func (Uint8) Value

func (field Uint8) Value(value uint8) AssignExpr

func (Uint8) Zero

func (field Uint8) Zero() AssignExpr

type Value

type Value interface {

	// implement Condition
	BeCond() interface{}
	CondError() error
	// contains filtered or unexported methods
}

func Values

func Values(value interface{}) Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL