Documentation ¶
Index ¶
- Variables
- func IntoExpression(conds ...Expr) []clause.Expression
- func IntoIntegerSlice[T constraints.Integer, R constraints.Integer](values []T) []R
- func IntoSlice[T any, R any](values []T, f func(T) R) []R
- func Paginate(page, perPage int64, maxPerPages ...int64) clause.Expression
- type Asterisk
- func (e Asterisk) As(alias string) Expr
- func (e Asterisk) Avg() Float64
- func (e Asterisk) Build(builder clause.Builder)
- func (e Asterisk) BuildColumn(stmt *gorm.Statement, opts ...BuildOption) string
- func (e Asterisk) BuildWithArgs(stmt *gorm.Statement) (string, []any)
- func (e Asterisk) ColumnName() string
- func (a Asterisk) Count() Asterisk
- func (e Asterisk) Desc() Expr
- func (a Asterisk) Distinct() Asterisk
- func (e Asterisk) EqCol(e2 Expr) Expr
- func (e Asterisk) EqSubQuery(subQuery *gorm.DB) Expr
- func (e Asterisk) Expression() clause.Expression
- func (e Asterisk) FieldName(prefixes ...string) string
- func (e Asterisk) FindInSetCol(e2 Expr) Expr
- func (e Asterisk) FindInSetColWith(e2 Expr) Expr
- func (e Asterisk) FindInSetSubQuery(subQuery *gorm.DB) Expr
- func (e Asterisk) GroupConcat() Expr
- func (e Asterisk) GtCol(e2 Expr) Expr
- func (e Asterisk) GtSubQuery(subQuery *gorm.DB) Expr
- func (e Asterisk) GteCol(e2 Expr) Expr
- func (e Asterisk) GteSubQuery(subQuery *gorm.DB) Expr
- func (e Asterisk) InSubQuery(subQuery *gorm.DB) Expr
- func (e Asterisk) IsNotNull() Expr
- func (e Asterisk) IsNull() Expr
- func (e Asterisk) Length() Int
- func (e Asterisk) LtCol(e2 Expr) Expr
- func (e Asterisk) LtSubQuery(subQuery *gorm.DB) Expr
- func (e Asterisk) LteCol(e2 Expr) Expr
- func (e Asterisk) LteSubQuery(subQuery *gorm.DB) Expr
- func (e Asterisk) Max() Float64
- func (e Asterisk) Min() Float64
- func (e Asterisk) NeqCol(e2 Expr) Expr
- func (e Asterisk) NeqSubQuery(subQuery *gorm.DB) Expr
- func (e Asterisk) NotInSubQuery(subQuery *gorm.DB) Expr
- func (e Asterisk) RawExpr() any
- func (e Asterisk) SetCol(e2 Expr) SetExpr
- func (e Asterisk) SetExpr() any
- func (e Asterisk) SetSubQuery(subQuery *gorm.DB) SetExpr
- func (e Asterisk) ValueAny(value any) SetExpr
- func (e Asterisk) ValueNull() SetExpr
- func (e Asterisk) WithTable(table string) Expr
- 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) Eq(value bool) Expr
- func (field Bool) FindInSet(targetList string) Expr
- func (field Bool) IfNull(value bool) Expr
- func (field Bool) Is(value bool) Expr
- func (field Bool) Neq(value bool) Expr
- func (field Bool) Not() Expr
- func (field Bool) Or(value bool) Expr
- func (field Bool) Value(value bool) SetExpr
- func (field Bool) ValuePointer(value *bool) SetExpr
- func (field Bool) ValueZero() SetExpr
- func (field Bool) Xor(value bool) Expr
- type BuildOption
- type Bytes
- func (field Bytes) Between(left []byte, right []byte) Expr
- func (field Bytes) Eq(value []byte) Expr
- func (field Bytes) FindInSet(targetList string) Expr
- func (field Bytes) FindInSetWith(target string) Expr
- func (field Bytes) FuzzyLike(value 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) InAny(value any) Expr
- func (field Bytes) IntoField() Field
- func (field Bytes) LeftLike(value string) Expr
- func (field Bytes) Like(value string) Expr
- 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) NotInAny(value any) 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) Value(value []byte) SetExpr
- func (field Bytes) ValueZero() SetExpr
- type Columns
- type Condition
- func CrossJoinsExpr(table schema.Tabler, conds ...Expr) Condition
- func CrossJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) Condition
- func DistinctExpr(columns ...Expr) Condition
- func GormClauses(conds ...clause.Expression) Condition
- func GormDistinct(args ...any) Condition
- func GormGroup(name string) Condition
- func GormHaving(query any, args ...any) Condition
- func GormInnerJoins(query string, args ...any) Condition
- func GormJoins(query string, args ...any) Condition
- func GormLimit(limit int) Condition
- func GormNot(query any, args ...any) Condition
- func GormOffset(offset int) Condition
- func GormOmit(columns ...string) Condition
- func GormOr(query any, args ...any) Condition
- func GormOrder(value any) Condition
- func GormPreload(query string, args ...any) Condition
- func GormSelect(query any, args ...any) Condition
- func GormTable(name string, args ...any) Condition
- func GormUnscoped() Condition
- func GormWhere(query any, args ...any) Condition
- func GroupExpr(columns ...Expr) Condition
- func InnerJoinsExpr(table schema.Tabler, conds ...Expr) Condition
- func InnerJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) Condition
- func LeftJoinsExpr(table schema.Tabler, conds ...Expr) Condition
- func LeftJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) Condition
- func LockingShare() Condition
- func LockingUpdate() Condition
- func OmitExpr(columns ...Expr) Condition
- func OrderExpr(columns ...Expr) Condition
- func Pagination(page, perPage int64, maxPerPages ...int64) Condition
- func RightJoinsExpr(table schema.Tabler, conds ...Expr) Condition
- func RightJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) Condition
- func SelectExpr(columns ...Expr) Condition
- func TableExpr(fromSubs ...From) Condition
- type Conditions
- func (c *Conditions) Build() []Condition
- func (c *Conditions) Clauses(conds ...clause.Expression) *Conditions
- func (c *Conditions) Configure(funcs ...func(*Conditions) *Conditions) *Conditions
- func (c *Conditions) CrossJoinsExpr(table schema.Tabler, conds ...Expr) *Conditions
- func (c *Conditions) CrossJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) *Conditions
- func (c *Conditions) Distinct(args ...any) *Conditions
- func (c *Conditions) DistinctExpr(columns ...Expr) *Conditions
- func (c *Conditions) Group(name string) *Conditions
- func (c *Conditions) GroupExpr(columns ...Expr) *Conditions
- func (c *Conditions) Having(query any, args ...any) *Conditions
- func (c *Conditions) InnerJoins(query string, args ...any) *Conditions
- func (c *Conditions) InnerJoinsExpr(table schema.Tabler, conds ...Expr) *Conditions
- func (c *Conditions) InnerJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) *Conditions
- func (c *Conditions) Joins(query string, args ...any) *Conditions
- func (c *Conditions) LeftJoinsExpr(table schema.Tabler, conds ...Expr) *Conditions
- func (c *Conditions) LeftJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) *Conditions
- func (c *Conditions) Limit(limit int) *Conditions
- func (c *Conditions) LockingShare() *Conditions
- func (c *Conditions) LockingUpdate() *Conditions
- func (c *Conditions) Not(query any, args ...any) *Conditions
- func (c *Conditions) Offset(offset int) *Conditions
- func (c *Conditions) Omit(columns ...string) *Conditions
- func (c *Conditions) OmitExpr(columns ...Expr) *Conditions
- func (c *Conditions) Or(query any, args ...any) *Conditions
- func (c *Conditions) Order(value any) *Conditions
- func (c *Conditions) OrderExpr(columns ...Expr) *Conditions
- func (c *Conditions) Pagination(page, perPage int64, maxPages ...int64) *Conditions
- func (c *Conditions) Preload(query string, args ...any) *Conditions
- func (c *Conditions) RightJoinsExpr(table schema.Tabler, conds ...Expr) *Conditions
- func (c *Conditions) RightJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) *Conditions
- func (c *Conditions) Scopes(cs ...Condition) *Conditions
- func (c *Conditions) Select(query any, args ...any) *Conditions
- func (c *Conditions) SelectExpr(columns ...Expr) *Conditions
- func (c *Conditions) Unscoped() *Conditions
- func (c *Conditions) Where(query any, args ...any) *Conditions
- type Decimal
- type Executor
- func (x *Executor[T]) Assign(attrs ...any) *Executor[T]
- func (x *Executor[T]) AssignExpr(attrs ...SetExpr) *Executor[T]
- func (x *Executor[T]) Attrs(attrs ...any) *Executor[T]
- func (x *Executor[T]) AttrsExpr(attrs ...SetExpr) *Executor[T]
- func (x *Executor[T]) Clauses(conds ...clause.Expression) *Executor[T]
- func (x *Executor[T]) Count() (count int64, err error)
- func (x *Executor[T]) Create(values ...*T) error
- func (x *Executor[T]) CreateInBatches(value []*T, batchSize int) error
- func (x *Executor[T]) CrossJoinsExpr(table schema.Tabler, conds ...Expr) *Executor[T]
- func (x *Executor[T]) CrossJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) *Executor[T]
- func (x *Executor[T]) Debug() *Executor[T]
- func (x *Executor[T]) Delete() (rowsAffected int64, err error)
- func (x *Executor[T]) Distinct(args ...any) *Executor[T]
- func (x *Executor[T]) DistinctExpr(columns ...Expr) *Executor[T]
- func (x *Executor[T]) Exist() (exist bool, err error)
- func (x *Executor[T]) Find(dest any) error
- func (x *Executor[T]) FindAll() ([]*T, error)
- func (x *Executor[T]) FindInBatches(dest any, batchSize int, fc func(tx *gorm.DB, batch int) error) error
- func (x *Executor[T]) First(dest any) error
- func (x *Executor[T]) FirstBool() (v bool, err error)
- func (x *Executor[T]) FirstFloat32() (v float32, err error)
- func (x *Executor[T]) FirstFloat64() (v float64, err error)
- func (x *Executor[T]) FirstInt() (v int, err error)
- func (x *Executor[T]) FirstInt16() (v int16, err error)
- func (x *Executor[T]) FirstInt32() (v int32, err error)
- func (x *Executor[T]) FirstInt64() (v int64, err error)
- func (x *Executor[T]) FirstInt8() (v int8, err error)
- func (x *Executor[T]) FirstOne() (*T, error)
- func (x *Executor[T]) FirstOrCreate() (*T, error)
- func (x *Executor[T]) FirstOrInit() (*T, error)
- func (x *Executor[T]) FirstString() (v string, err error)
- func (x *Executor[T]) FirstUint() (v uint, err error)
- func (x *Executor[T]) FirstUint16() (v uint16, err error)
- func (x *Executor[T]) FirstUint32() (v uint32, err error)
- func (x *Executor[T]) FirstUint64() (v uint64, err error)
- func (x *Executor[T]) FirstUint8() (v uint8, err error)
- func (x *Executor[T]) Group(name string) *Executor[T]
- func (x *Executor[T]) GroupExpr(columns ...Expr) *Executor[T]
- func (x *Executor[T]) Having(query any, args ...any) *Executor[T]
- func (x *Executor[T]) InnerJoins(query string, args ...any) *Executor[T]
- func (x *Executor[T]) InnerJoinsExpr(table schema.Tabler, conds ...Expr) *Executor[T]
- func (x *Executor[T]) InnerJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) *Executor[T]
- func (x *Executor[T]) IntoDB() *gorm.DB
- func (x *Executor[T]) IntoExistExpr() Expr
- func (x *Executor[T]) IntoNotExistExpr() Expr
- func (x *Executor[T]) IntoRawDB() *gorm.DB
- func (x *Executor[T]) IntoSubQueryExpr() Field
- func (x *Executor[T]) Joins(query string, args ...any) *Executor[T]
- func (x *Executor[T]) Last(dest any) error
- func (x *Executor[T]) LastOne() (*T, error)
- func (x *Executor[T]) LeftJoinsExpr(table schema.Tabler, conds ...Expr) *Executor[T]
- func (x *Executor[T]) LeftJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) *Executor[T]
- func (x *Executor[T]) Limit(limit int) *Executor[T]
- func (x *Executor[T]) LockingShare() *Executor[T]
- func (x *Executor[T]) LockingUpdate() *Executor[T]
- func (x *Executor[T]) Not(query any, args ...any) *Executor[T]
- func (x *Executor[T]) Offset(offset int) *Executor[T]
- func (x *Executor[T]) Omit(columns ...string) *Executor[T]
- func (x *Executor[T]) OmitExpr(columns ...Expr) *Executor[T]
- func (x *Executor[T]) Or(query any, args ...any) *Executor[T]
- func (x *Executor[T]) Order(value any) *Executor[T]
- func (x *Executor[T]) OrderExpr(columns ...Expr) *Executor[T]
- func (x *Executor[T]) Pagination(page, perPage int64, maxPerPages ...int64) *Executor[T]
- func (x *Executor[T]) Pluck(column string, value any) error
- func (x *Executor[T]) PluckBool(column string) (slice []bool, err error)
- func (x *Executor[T]) PluckExpr(column Expr, value any) error
- func (x *Executor[T]) PluckExprBool(column Expr) (slice []bool, err error)
- func (x *Executor[T]) PluckExprInt(column Expr) (slice []int, err error)
- func (x *Executor[T]) PluckExprInt16(column Expr) (slice []int16, err error)
- func (x *Executor[T]) PluckExprInt32(column Expr) (slice []int32, err error)
- func (x *Executor[T]) PluckExprInt64(column Expr) (slice []int64, err error)
- func (x *Executor[T]) PluckExprInt8(column Expr) (slice []int8, err error)
- func (x *Executor[T]) PluckExprString(column Expr) (slice []string, err error)
- func (x *Executor[T]) PluckExprUint(column Expr) (slice []uint, err error)
- func (x *Executor[T]) PluckExprUint16(column Expr) (slice []uint16, err error)
- func (x *Executor[T]) PluckExprUint32(column Expr) (slice []uint32, err error)
- func (x *Executor[T]) PluckExprUint64(column Expr) (slice []uint64, err error)
- func (x *Executor[T]) PluckExprUint8(column Expr) (slice []uint8, err error)
- func (x *Executor[T]) PluckInt(column string) (slice []int, err error)
- func (x *Executor[T]) PluckInt16(column string) (slice []int16, err error)
- func (x *Executor[T]) PluckInt32(column string) (slice []int32, err error)
- func (x *Executor[T]) PluckInt64(column string) (slice []int64, err error)
- func (x *Executor[T]) PluckInt8(column string) (slice []int8, err error)
- func (x *Executor[T]) PluckString(column string) (slice []string, err error)
- func (x *Executor[T]) PluckUint(column string) (slice []uint, err error)
- func (x *Executor[T]) PluckUint16(column string) (slice []uint16, err error)
- func (x *Executor[T]) PluckUint32(column string) (slice []uint32, err error)
- func (x *Executor[T]) PluckUint64(column string) (slice []uint64, err error)
- func (x *Executor[T]) PluckUint8(column string) (slice []uint8, err error)
- func (x *Executor[T]) Preload(query string, args ...any) *Executor[T]
- func (x *Executor[T]) RightJoinsExpr(table schema.Tabler, conds ...Expr) *Executor[T]
- func (x *Executor[T]) RightJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) *Executor[T]
- func (x *Executor[T]) Save(value *T) error
- func (x *Executor[T]) Scan(dest any) error
- func (x *Executor[T]) ScanBool() (v bool, err error)
- func (x *Executor[T]) ScanFloat32() (v float32, err error)
- func (x *Executor[T]) ScanFloat64() (v float64, err error)
- func (x *Executor[T]) ScanInt() (v int, err error)
- func (x *Executor[T]) ScanInt16() (v int16, err error)
- func (x *Executor[T]) ScanInt32() (v int32, err error)
- func (x *Executor[T]) ScanInt64() (v int64, err error)
- func (x *Executor[T]) ScanInt8() (v int8, err error)
- func (x *Executor[T]) ScanOne() (*T, error)
- func (x *Executor[T]) ScanString() (v string, err error)
- func (x *Executor[T]) ScanUint() (v uint, err error)
- func (x *Executor[T]) ScanUint16() (v uint16, err error)
- func (x *Executor[T]) ScanUint32() (v uint32, err error)
- func (x *Executor[T]) ScanUint64() (v uint64, err error)
- func (x *Executor[T]) ScanUint8() (v uint8, err error)
- func (x *Executor[T]) Scopes(cs ...Condition) *Executor[T]
- func (x *Executor[T]) Select(query any, args ...any) *Executor[T]
- func (x *Executor[T]) SelectExpr(columns ...Expr) *Executor[T]
- func (x *Executor[T]) Session(config *gorm.Session) *Executor[T]
- func (x *Executor[T]) Table(name string, args ...any) *Executor[T]
- func (x *Executor[T]) TableExpr(fromSubs ...From) *Executor[T]
- func (x *Executor[T]) Take(dest any) error
- func (x *Executor[T]) TakeBool() (v bool, err error)
- func (x *Executor[T]) TakeFloat32() (v float32, err error)
- func (x *Executor[T]) TakeFloat64() (v float64, err error)
- func (x *Executor[T]) TakeInt() (v int, err error)
- func (x *Executor[T]) TakeInt16() (v int16, err error)
- func (x *Executor[T]) TakeInt32() (v int32, err error)
- func (x *Executor[T]) TakeInt64() (v int64, err error)
- func (x *Executor[T]) TakeInt8() (v int8, err error)
- func (x *Executor[T]) TakeOne() (*T, error)
- func (x *Executor[T]) TakeString() (v string, err error)
- func (x *Executor[T]) TakeUint() (v uint, err error)
- func (x *Executor[T]) TakeUint16() (v uint16, err error)
- func (x *Executor[T]) TakeUint32() (v uint32, err error)
- func (x *Executor[T]) TakeUint64() (v uint64, err error)
- func (x *Executor[T]) TakeUint8() (v uint8, err error)
- func (x *Executor[T]) Unscoped() *Executor[T]
- func (x *Executor[T]) Update(column string, value any) (rowsAffected int64, err error)
- func (x *Executor[T]) UpdateColumn(column string, value any) (rowsAffected int64, err error)
- func (x *Executor[T]) UpdateColumnExpr(column Expr, value any) (rowsAffected int64, err error)
- func (x *Executor[T]) UpdateColumns(value *T) (rowsAffected int64, err error)
- func (x *Executor[T]) UpdateColumnsExpr(columns ...SetExpr) (rowsAffected int64, err error)
- func (x *Executor[T]) UpdateColumnsMap(value map[string]any) (rowsAffected int64, err error)
- func (x *Executor[T]) UpdateExpr(column Expr, value any) (rowsAffected int64, err error)
- func (x *Executor[T]) Updates(value *T) (rowsAffected int64, err error)
- func (x *Executor[T]) UpdatesExpr(columns ...SetExpr) (rowsAffected int64, err error)
- func (x *Executor[T]) UpdatesMap(value map[string]any) (rowsAffected int64, err error)
- func (x *Executor[T]) Where(query any, args ...any) *Executor[T]
- func (x *Executor[T]) WithContext(ctx context.Context) *Executor[T]
- type Expr
- type Field
- func (field Field) Add(value any) Field
- func (e Field) AddCol(col Expr) Field
- func (e Field) As(alias string) Expr
- func (e Field) Avg() Float64
- func (field Field) Between(left any, right any) Expr
- func (field Field) BitAnd(value any) Field
- func (field Field) BitFlip() Field
- func (field Field) BitOr(value any) Field
- func (field Field) BitXor(value any) Field
- func (e Field) Build(builder clause.Builder)
- func (e Field) BuildColumn(stmt *gorm.Statement, opts ...BuildOption) string
- func (e Field) BuildWithArgs(stmt *gorm.Statement) (string, []any)
- func (e Field) ColumnName() string
- func (field Field) Concat(before, after string) String
- func (e Field) ConcatCol(cols ...Expr) Field
- func (e Field) Count() Int
- func (field Field) Date() Time
- func (field Field) DateDiff(expr2 time.Time) Int
- func (field Field) DateFormat(format string) String
- func (field Field) Day() Int
- func (field Field) DayName() String
- func (field Field) DayOfMonth() Int
- func (field Field) DayOfWeek() Int
- func (field Field) DayOfYear() Int
- func (e Field) Desc() Expr
- func (e Field) Distinct() Int
- func (field Field) Div(value any) Field
- func (e Field) DivCol(col Expr) Field
- func (field Field) Eq(value any) Expr
- func (e Field) EqCol(e2 Expr) Expr
- func (e Field) EqSubQuery(subQuery *gorm.DB) Expr
- func (e Field) Expression() clause.Expression
- func (e Field) FieldName(prefixes ...string) string
- func (field Field) FindInSet(targetList string) Expr
- func (e Field) FindInSetCol(e2 Expr) Expr
- func (e Field) FindInSetColWith(e2 Expr) Expr
- func (e Field) FindInSetSubQuery(subQuery *gorm.DB) Expr
- func (field Field) FindInSetWith(target string) Expr
- func (field Field) Floor() Field
- func (field Field) FloorDiv(value any) Field
- func (field Field) FromDays() Time
- func (field Field) FromUnixTime(format ...string) String
- func (e Field) GroupConcat() Expr
- func (field Field) Gt(value any) Expr
- func (e Field) GtCol(e2 Expr) Expr
- func (e Field) GtSubQuery(subQuery *gorm.DB) Expr
- func (field Field) Gte(value any) Expr
- func (e Field) GteCol(e2 Expr) Expr
- func (e Field) GteSubQuery(subQuery *gorm.DB) Expr
- func (field Field) Hour() Int
- func (field Field) IfNull(value any) Expr
- func (field Field) In(values ...any) Expr
- func (e Field) InSubQuery(subQuery *gorm.DB) Expr
- func (e Field) IsNotNull() Expr
- func (e Field) IsNull() Expr
- func (field Field) LTrim(remStr string) String
- func (field Field) LTrimSpace() String
- func (field Field) LeftShift(value any) Field
- func (e Field) Length() Int
- func (field Field) Like(value any) Expr
- func (field Field) Lt(value any) Expr
- func (e Field) LtCol(e2 Expr) Expr
- func (e Field) LtSubQuery(subQuery *gorm.DB) Expr
- func (field Field) Lte(value any) Expr
- func (e Field) LteCol(e2 Expr) Expr
- func (e Field) LteSubQuery(subQuery *gorm.DB) Expr
- func (e Field) Max() Float64
- func (field Field) MicroSecond() Int
- func (e Field) Min() Float64
- func (field Field) Minute() Int
- func (field Field) Mod(value any) Field
- func (field Field) Month() Int
- func (field Field) MonthName() String
- func (field Field) Mul(value any) Field
- func (e Field) MulCol(col Expr) Field
- func (field Field) Neq(value any) Expr
- func (e Field) NeqCol(e2 Expr) Expr
- func (e Field) NeqSubQuery(subQuery *gorm.DB) Expr
- func (field Field) NotBetween(left any, right any) Expr
- func (field Field) NotIn(values ...any) Expr
- func (e Field) NotInSubQuery(subQuery *gorm.DB) Expr
- func (field Field) NotLike(value any) Expr
- func (field Field) NotRegxp(value string) Expr
- func (field Field) RTrim(remStr string) String
- func (field Field) RTrimSpace() String
- func (e Field) RawExpr() any
- func (field Field) Regexp(value any) Expr
- func (field Field) Replace(from, to string) String
- func (field Field) RightShift(value any) Field
- func (field Field) Round(decimals int) Field
- func (field Field) Second() Int
- func (e Field) SetCol(e2 Expr) SetExpr
- func (e Field) SetExpr() any
- func (e Field) SetSubQuery(subQuery *gorm.DB) SetExpr
- func (field Field) Sub(value any) Field
- func (e Field) SubCol(col Expr) Field
- func (field Field) SubstringIndex(delim string, count int) String
- func (field Field) Sum() Field
- func (field Field) Trim(remStr string) String
- func (field Field) TrimSpace() String
- func (field Field) UnixTimestamp() Int64
- func (field Field) Value(value any) SetExpr
- func (e Field) ValueAny(value any) SetExpr
- func (e Field) ValueNull() SetExpr
- func (e Field) WithTable(table string) Expr
- func (field Field) Year() Int
- type Float
- func (field Float[T]) Add(value T) Float[T]
- func (e Float[T]) AddCol(col Expr) Float[T]
- func (field Float[T]) Between(left T, right T) Expr
- func (field Float[T]) Div(value T) Float[T]
- func (e Float[T]) DivCol(col Expr) Float[T]
- func (field Float[T]) Eq(value T) Expr
- func (field Float[T]) FindInSet(targetList string) Expr
- func (field Float[T]) Floor() Int
- func (field Float[T]) FloorDiv(value T) Int
- func (field Float[T]) Gt(value T) Expr
- func (field Float[T]) Gte(value T) Expr
- func (field Float[T]) IfNull(value T) Expr
- func (field Float[T]) In(values ...T) Expr
- func (field Float[T]) InAny(value any) Expr
- func (field Float[T]) IntoField() Field
- func (field Float[T]) Like(value T) Expr
- func (field Float[T]) Lt(value T) Expr
- func (field Float[T]) Lte(value T) Expr
- func (field Float[T]) Mul(value T) Float[T]
- func (e Float[T]) MulCol(col Expr) Float[T]
- func (field Float[T]) Neq(value T) Expr
- func (field Float[T]) NotBetween(left T, right T) Expr
- func (field Float[T]) NotIn(values ...T) Expr
- func (field Float[T]) NotInAny(value any) Expr
- func (field Float[T]) NotLike(value T) Expr
- func (field Float[T]) Round(decimals int) Float[T]
- func (field Float[T]) Sub(value T) Float[T]
- func (e Float[T]) SubCol(col Expr) Float[T]
- func (field Float[T]) Sum() Float[T]
- func (field Float[T]) Value(value T) SetExpr
- func (field Float[T]) ValuePointer(value *T) SetExpr
- func (field Float[T]) ValueZero() SetExpr
- type Float32
- type Float64
- type From
- type Int
- type Int16
- type Int32
- type Int64
- type Int8
- type Integer
- func (field Integer[T]) Add(value T) Integer[T]
- func (e Integer[T]) AddCol(col Expr) Integer[T]
- func (field Integer[T]) Between(left T, right T) Expr
- func (field Integer[T]) BitAnd(value T) Integer[T]
- func (field Integer[T]) BitFlip() Integer[T]
- func (field Integer[T]) BitOr(value T) Integer[T]
- func (field Integer[T]) BitXor(value T) Integer[T]
- func (field Integer[T]) Div(value T) Integer[T]
- func (e Integer[T]) DivCol(col Expr) Integer[T]
- func (field Integer[T]) Eq(value T) Expr
- func (field Integer[T]) FindInSet(targetList string) Expr
- func (field Integer[T]) FloorDiv(value T) Integer[T]
- func (field Integer[T]) FromDays() Time
- func (field Integer[T]) FromUnixTime(format ...string) String
- func (field Integer[T]) Gt(value T) Expr
- func (field Integer[T]) Gte(value T) Expr
- func (field Integer[T]) IfNull(value T) Expr
- func (field Integer[T]) In(values ...T) Expr
- func (field Integer[T]) InAny(value any) Expr
- func (field Integer[T]) IntoField() Field
- func (field Integer[T]) LeftShift(value T) Integer[T]
- func (field Integer[T]) Like(value T) Expr
- func (field Integer[T]) Lt(value T) Expr
- func (field Integer[T]) Lte(value T) Expr
- func (field Integer[T]) Mod(value T) Integer[T]
- func (field Integer[T]) Mul(value T) Integer[T]
- func (e Integer[T]) MulCol(col Expr) Integer[T]
- func (field Integer[T]) Neq(value T) Expr
- func (field Integer[T]) NotBetween(left T, right T) Expr
- func (field Integer[T]) NotIn(values ...T) Expr
- func (field Integer[T]) NotInAny(value any) Expr
- func (field Integer[T]) NotLike(value T) Expr
- func (field Integer[T]) RightShift(value T) Integer[T]
- func (field Integer[T]) Round(value int) Integer[T]
- func (field Integer[T]) Sub(value T) Integer[T]
- func (e Integer[T]) SubCol(col Expr) Integer[T]
- func (field Integer[T]) Sum() Integer[T]
- func (field Integer[T]) Value(value T) SetExpr
- func (field Integer[T]) ValuePointer(value *T) SetExpr
- func (field Integer[T]) ValueZero() SetExpr
- type Option
- type Raw
- type SetExpr
- type String
- func (field String) AddCol(col Expr) String
- func (field String) Between(left, right string) Expr
- func (field String) Concat(before, after string) String
- func (field String) ConcatCol(cols ...Expr) String
- func (field String) DivCol(col Expr) String
- func (field String) Eq(value string) Expr
- func (field String) FindInSet(targetList string) Expr
- func (field String) FindInSetWith(target string) Expr
- func (field String) FuzzyLike(value string) Expr
- func (field String) Gt(value string) Expr
- func (field String) Gte(value string) Expr
- func (field String) Hidden(left, right int, pad string) String
- func (field String) HiddenPrefix(right int, pad string) String
- func (field String) HiddenSuffix(left int, pad string) String
- func (field String) IfNull(value string) Expr
- func (field String) In(values ...string) Expr
- func (field String) InAny(value any) Expr
- func (field String) IntoField() Field
- func (field String) LTrim(remStr string) String
- func (field String) LTrimSpace() String
- func (field String) LeftLike(value string) Expr
- func (field String) Like(value string) Expr
- func (field String) Lt(value string) Expr
- func (field String) Lte(value string) Expr
- func (field String) MulCol(col Expr) String
- func (field String) Neq(value string) Expr
- func (field String) NotBetween(left, right string) Expr
- func (field String) NotIn(values ...string) Expr
- func (field String) NotInAny(value any) Expr
- func (field String) NotLike(value string) Expr
- func (field String) NotRegxp(value string) Expr
- func (field String) RTrim(remStr string) String
- func (field String) RTrimSpace() String
- func (field String) Regexp(value string) Expr
- func (field String) Replace(from, to string) String
- func (field String) SubCol(col Expr) String
- func (field String) SubstringIndex(delim string, count int) String
- func (field String) Trim(remStr string) String
- func (field String) TrimSpace() String
- func (field String) Value(value string) SetExpr
- func (field String) ValuePointer(value *string) SetExpr
- func (field String) ValueZero() SetExpr
- type Time
- func (field Time) Add(value time.Duration) Time
- func (e Time) AddCol(col Expr) Time
- func (field Time) Between(left time.Time, right time.Time) Expr
- func (field Time) Date() Time
- func (field Time) DateDiff(expr2 time.Time) Int
- func (field Time) DateFormat(format 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 (e Time) DivCol(col Expr) Time
- func (field Time) Eq(value time.Time) Expr
- func (field Time) FindInSet(targetList string) Expr
- 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) InAny(value any) 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 (e Time) MulCol(col Expr) Time
- 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) NotInAny(value any) Expr
- func (field Time) Second() Int
- func (field Time) Sub(value time.Duration) Time
- func (e Time) SubCol(col Expr) Time
- func (field Time) Sum() Time
- func (field Time) UnixTimestamp() Int64
- func (field Time) Value(value time.Time) SetExpr
- func (field Time) ValuePointer(value *time.Time) SetExpr
- func (field Time) ValueZero() SetExpr
- func (field Time) Year() Int
- type Uint
- type Uint16
- type Uint32
- type Uint64
- type Uint8
- type Value
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultPerPage 默认页大小 DefaultPerPage = int64(50) // DefaultPageSize 默认最大页大小 DefaultMaxPerPage = int64(500) )
var All = Star
var One = NewRaw("1")
One a symbol of "1"
var Star = NewAsterisk("")
Star/All a symbol of "*"
Functions ¶
func IntoExpression ¶
func IntoExpression(conds ...Expr) []clause.Expression
IntoExpression convert Expr to clause.Expression
func IntoIntegerSlice ¶ added in v0.0.6
func IntoIntegerSlice[T constraints.Integer, R constraints.Integer](values []T) []R
Types ¶
type Asterisk ¶
type Asterisk struct {
// contains filtered or unexported fields
}
Asterisk a type of xxx.*
func (Asterisk) BuildColumn ¶
func (e Asterisk) BuildColumn(stmt *gorm.Statement, opts ...BuildOption) string
func (Asterisk) BuildWithArgs ¶
func (Asterisk) ColumnName ¶
func (e Asterisk) ColumnName() string
func (Asterisk) EqSubQuery ¶ added in v0.3.0
EqSubQuery use expr1 = (subQuery)
func (Asterisk) Expression ¶
func (e Asterisk) Expression() clause.Expression
func (Asterisk) FieldName ¶ added in v0.5.5
FieldName hold column name. if prefixes not exist returns same as ColumnName(), others {prefixes[0]}_{ColumnName}
func (Asterisk) FindInSetCol ¶ added in v0.3.1
FindInSetCol use FIND_IN_SET(expr1, expr2)
func (Asterisk) FindInSetColWith ¶ added in v0.3.1
FindInSetColWith use FIND_IN_SET(expr2, expr1)
func (Asterisk) FindInSetSubQuery ¶ added in v0.3.0
FindInSetSubQuery FIND_IN_SET(column, (subQuery))
func (Asterisk) GroupConcat ¶
func (e Asterisk) GroupConcat() Expr
GroupConcat use GROUP_CONCAT(expr)
func (Asterisk) GtSubQuery ¶ added in v0.3.0
GtSubQuery use expr1 > (subQuery)
func (Asterisk) GteSubQuery ¶ added in v0.3.0
GteSubQuery use expr1 >= (subQuery)
func (Asterisk) InSubQuery ¶ added in v0.3.0
InSubQuery use expr1 IN (subQuery)
func (Asterisk) LtSubQuery ¶ added in v0.3.0
LtSubQuery use expr1 < (subQuery)
func (Asterisk) LteSubQuery ¶ added in v0.3.0
LteSubQuery use expr1 <= (subQuery)
func (Asterisk) NeqSubQuery ¶ added in v0.3.0
NeqSubQuery use expr1 <> (subQuery)
func (Asterisk) NotInSubQuery ¶ added in v0.3.0
NotInSubQuery use expr1 NOT IN (subQuery)
func (Asterisk) SetSubQuery ¶ added in v0.3.2
setSubQuery set with subQuery
func (Asterisk) ValueAny ¶ added in v0.3.3
ValueAny set any value. Deprecated: use other ValueXXX instead.
type Bool ¶
type Bool Field
Bool boolean type field
func (Bool) ValuePointer ¶ added in v0.4.1
Value set value use pointer
type BuildOption ¶
type BuildOption uint
BuildOption build option
const ( // WithTable build column with table WithTable BuildOption = iota // WithAll build column with table and alias(if have) WithAll // WithoutQuote build column without quote WithoutQuote )
type Bytes ¶
type Bytes Field
Bytes []byte type field
func (Bytes) FindInSetWith ¶
FindInSetWith FIND_IN_SET(?, expr)
func (Bytes) FuzzyLike ¶
FuzzyLike use expr LIKE ?, ? contain prefix % and suffix % e.g. expr LIKE %value%
func (Bytes) NotBetween ¶
NotBetween use NOT (expr BETWEEN ? AND ?)
func (Bytes) SubstringIndex ¶
SubstringIndex use SUBSTRING_INDEX(expr,?,?) https://dev.mysql.com/doc/refman/8.0/en/functions.html#function_substring-index
type Columns ¶
type Columns []Expr
Columns columns array
func (Columns) In ¶
IN return contains subQuery or value when len(columns) == 1, equal to columns[0] IN (subQuery/value) when len(columns) > 1, equal to (columns[0], columns[1], ...) IN (subQuery/value)
type Condition ¶
Condition alias func(*gorm.DB) *gorm.DB
func CrossJoinsExpr ¶ added in v0.2.0
CrossJoinsExpr cross joins condition
func CrossJoinsXExpr ¶ added in v0.2.0
CrossJoinsXExpr cross joins condition
func DistinctExpr ¶ added in v0.2.0
DistinctExpr with field
func GormClauses ¶ added in v0.1.7
func GormClauses(conds ...clause.Expression) Condition
func GormDistinct ¶ added in v0.1.7
func GormHaving ¶ added in v0.1.7
func GormInnerJoins ¶ added in v0.1.7
func GormOffset ¶ added in v0.1.7
func GormPreload ¶ added in v0.1.7
func GormSelect ¶ added in v0.1.7
func GormUnscoped ¶ added in v0.1.7
func GormUnscoped() Condition
func InnerJoinsExpr ¶ added in v0.2.0
InnerJoinsExpr inner joins condition
func InnerJoinsXExpr ¶ added in v0.2.0
InnerJoinsXExpr inner joins condition
func LeftJoinsExpr ¶ added in v0.2.0
LeftJoinsExpr left join condition
func LeftJoinsXExpr ¶ added in v0.2.0
LeftJoinsXExpr left join condition
func LockingUpdate ¶
func LockingUpdate() Condition
LockingUpdate specify the lock strength to UPDATE
func Pagination ¶
Pagination 分页器 分页索引: page >= 1 分页大小: perPage >= 1 && <= DefaultMaxPerPage
func RightJoinsExpr ¶ added in v0.2.0
RightJoinsExpr right join condition
func RightJoinsXExpr ¶ added in v0.2.0
RightJoinsXExpr right join condition
type Conditions ¶
type Conditions struct {
// contains filtered or unexported fields
}
Conditions hold Condition slice
func NewConditions ¶
func NewConditions(cs ...Condition) *Conditions
NewConditions new condition instance.
func (*Conditions) Clauses ¶ added in v0.2.1
func (c *Conditions) Clauses(conds ...clause.Expression) *Conditions
func (*Conditions) Configure ¶ added in v0.5.1
func (c *Conditions) Configure(funcs ...func(*Conditions) *Conditions) *Conditions
Configure the conditions in the scope
func (*Conditions) CrossJoinsExpr ¶ added in v0.2.0
func (c *Conditions) CrossJoinsExpr(table schema.Tabler, conds ...Expr) *Conditions
CrossJoinsExpr cross joins condition
func (*Conditions) CrossJoinsXExpr ¶ added in v0.2.0
func (c *Conditions) CrossJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) *Conditions
CrossJoinsXExpr cross joins condition
func (*Conditions) Distinct ¶ added in v0.1.5
func (c *Conditions) Distinct(args ...any) *Conditions
Distinct with field
func (*Conditions) DistinctExpr ¶ added in v0.2.0
func (c *Conditions) DistinctExpr(columns ...Expr) *Conditions
DistinctExpr with field
func (*Conditions) Group ¶
func (c *Conditions) Group(name string) *Conditions
func (*Conditions) GroupExpr ¶ added in v0.2.0
func (c *Conditions) GroupExpr(columns ...Expr) *Conditions
GroupExpr with field
func (*Conditions) Having ¶
func (c *Conditions) Having(query any, args ...any) *Conditions
func (*Conditions) InnerJoins ¶ added in v0.0.8
func (c *Conditions) InnerJoins(query string, args ...any) *Conditions
func (*Conditions) InnerJoinsExpr ¶ added in v0.2.0
func (c *Conditions) InnerJoinsExpr(table schema.Tabler, conds ...Expr) *Conditions
InnerJoinsExpr inner joins condition
func (*Conditions) InnerJoinsXExpr ¶ added in v0.2.0
func (c *Conditions) InnerJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) *Conditions
InnerJoinsXExpr inner joins condition
func (*Conditions) Joins ¶ added in v0.2.1
func (c *Conditions) Joins(query string, args ...any) *Conditions
func (*Conditions) LeftJoinsExpr ¶ added in v0.2.0
func (c *Conditions) LeftJoinsExpr(table schema.Tabler, conds ...Expr) *Conditions
LeftJoinsExpr left join condition
func (*Conditions) LeftJoinsXExpr ¶ added in v0.2.0
func (c *Conditions) LeftJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) *Conditions
LeftJoinsXExpr left join condition
func (*Conditions) Limit ¶ added in v0.2.1
func (c *Conditions) Limit(limit int) *Conditions
func (*Conditions) LockingShare ¶
func (c *Conditions) LockingShare() *Conditions
LockingShare specify the lock strength to SHARE
func (*Conditions) LockingUpdate ¶
func (c *Conditions) LockingUpdate() *Conditions
LockingUpdate specify the lock strength to UPDATE
func (*Conditions) Not ¶ added in v0.2.1
func (c *Conditions) Not(query any, args ...any) *Conditions
func (*Conditions) Offset ¶ added in v0.2.1
func (c *Conditions) Offset(offset int) *Conditions
func (*Conditions) Omit ¶ added in v0.2.1
func (c *Conditions) Omit(columns ...string) *Conditions
func (*Conditions) OmitExpr ¶ added in v0.3.2
func (c *Conditions) OmitExpr(columns ...Expr) *Conditions
OmitExpr with field
func (*Conditions) Or ¶ added in v0.2.1
func (c *Conditions) Or(query any, args ...any) *Conditions
func (*Conditions) Order ¶
func (c *Conditions) Order(value any) *Conditions
func (*Conditions) OrderExpr ¶ added in v0.2.0
func (c *Conditions) OrderExpr(columns ...Expr) *Conditions
OrderExpr with field
func (*Conditions) Pagination ¶
func (c *Conditions) Pagination(page, perPage int64, maxPages ...int64) *Conditions
Pagination 分页器 分页索引: page >= 1 分页大小: perPage >= 1 && <= DefaultMaxPerPage
func (*Conditions) Preload ¶ added in v0.2.1
func (c *Conditions) Preload(query string, args ...any) *Conditions
func (*Conditions) RightJoinsExpr ¶ added in v0.2.0
func (c *Conditions) RightJoinsExpr(table schema.Tabler, conds ...Expr) *Conditions
RightJoinsExpr right join condition
func (*Conditions) RightJoinsXExpr ¶ added in v0.2.0
func (c *Conditions) RightJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) *Conditions
RightJoinsXExpr right join condition
func (*Conditions) Scopes ¶ added in v0.2.1
func (c *Conditions) Scopes(cs ...Condition) *Conditions
Scopes more condition
func (*Conditions) Select ¶
func (c *Conditions) Select(query any, args ...any) *Conditions
Select with field
func (*Conditions) SelectExpr ¶ added in v0.2.0
func (c *Conditions) SelectExpr(columns ...Expr) *Conditions
SelectExpr with field
func (*Conditions) Unscoped ¶ added in v0.2.1
func (c *Conditions) Unscoped() *Conditions
func (*Conditions) Where ¶
func (c *Conditions) Where(query any, args ...any) *Conditions
type Decimal ¶
func NewDecimal ¶
NewDecimal new decimal field
type Executor ¶ added in v0.1.0
type Executor[T any] struct { // contains filtered or unexported fields }
func NewExecutor ¶ added in v0.1.0
Executor new executor
func (*Executor[T]) Assign ¶ added in v0.1.1
Assign provide attributes used in [FirstOrCreate] or [FirstOrInit]
func (*Executor[T]) AssignExpr ¶ added in v0.3.2
AssignExpr with SetExpr provide attributes used in [FirstOrCreate] or [FirstOrInit]
func (*Executor[T]) Attrs ¶ added in v0.1.1
Attrs provide attributes used in [FirstOrCreate] or [FirstOrInit]
func (*Executor[T]) AttrsExpr ¶ added in v0.3.2
AttrsExpr with SetExpr provide attributes used in [FirstOrCreate] or [FirstOrInit]
func (*Executor[T]) Clauses ¶ added in v0.1.0
func (x *Executor[T]) Clauses(conds ...clause.Expression) *Executor[T]
func (*Executor[T]) CreateInBatches ¶ added in v0.1.0
func (*Executor[T]) CrossJoinsExpr ¶ added in v0.1.0
func (*Executor[T]) CrossJoinsXExpr ¶ added in v0.1.0
func (*Executor[T]) DistinctExpr ¶ added in v0.1.5
func (*Executor[T]) FindInBatches ¶ added in v0.1.1
func (*Executor[T]) FirstFloat32 ¶ added in v0.1.5
func (*Executor[T]) FirstFloat64 ¶ added in v0.1.2
func (*Executor[T]) FirstInt16 ¶ added in v0.1.5
func (*Executor[T]) FirstInt32 ¶ added in v0.1.5
func (*Executor[T]) FirstInt64 ¶ added in v0.1.2
func (*Executor[T]) FirstOrCreate ¶ added in v0.1.1
func (*Executor[T]) FirstOrInit ¶ added in v0.1.1
func (*Executor[T]) FirstString ¶ added in v0.1.2
func (*Executor[T]) FirstUint16 ¶ added in v0.1.5
func (*Executor[T]) FirstUint32 ¶ added in v0.1.5
func (*Executor[T]) FirstUint64 ¶ added in v0.1.5
func (*Executor[T]) FirstUint8 ¶ added in v0.1.5
func (*Executor[T]) InnerJoins ¶ added in v0.1.0
func (*Executor[T]) InnerJoinsExpr ¶ added in v0.1.0
func (*Executor[T]) InnerJoinsXExpr ¶ added in v0.1.0
func (*Executor[T]) IntoExistExpr ¶ added in v0.3.0
func (*Executor[T]) IntoNotExistExpr ¶ added in v0.3.0
func (*Executor[T]) IntoSubQueryExpr ¶ added in v0.3.0
func (*Executor[T]) LeftJoinsExpr ¶ added in v0.1.0
func (*Executor[T]) LeftJoinsXExpr ¶ added in v0.1.0
func (*Executor[T]) LockingShare ¶ added in v0.1.0
func (*Executor[T]) LockingUpdate ¶ added in v0.1.0
func (*Executor[T]) Pagination ¶ added in v0.1.0
func (*Executor[T]) PluckExprBool ¶ added in v0.3.0
func (*Executor[T]) PluckExprInt ¶ added in v0.3.0
func (*Executor[T]) PluckExprInt16 ¶ added in v0.3.0
func (*Executor[T]) PluckExprInt32 ¶ added in v0.3.0
func (*Executor[T]) PluckExprInt64 ¶ added in v0.3.0
func (*Executor[T]) PluckExprInt8 ¶ added in v0.3.0
func (*Executor[T]) PluckExprString ¶ added in v0.3.0
func (*Executor[T]) PluckExprUint ¶ added in v0.3.0
func (*Executor[T]) PluckExprUint16 ¶ added in v0.3.0
func (*Executor[T]) PluckExprUint32 ¶ added in v0.3.0
func (*Executor[T]) PluckExprUint64 ¶ added in v0.3.0
func (*Executor[T]) PluckExprUint8 ¶ added in v0.3.0
func (*Executor[T]) PluckInt16 ¶ added in v0.1.5
func (*Executor[T]) PluckInt32 ¶ added in v0.1.5
func (*Executor[T]) PluckInt64 ¶ added in v0.1.2
func (*Executor[T]) PluckString ¶ added in v0.1.2
func (*Executor[T]) PluckUint16 ¶ added in v0.1.5
func (*Executor[T]) PluckUint32 ¶ added in v0.1.5
func (*Executor[T]) PluckUint64 ¶ added in v0.1.5
func (*Executor[T]) PluckUint8 ¶ added in v0.1.5
func (*Executor[T]) RightJoinsExpr ¶ added in v0.1.0
func (*Executor[T]) RightJoinsXExpr ¶ added in v0.1.0
func (*Executor[T]) ScanFloat32 ¶ added in v0.1.5
func (*Executor[T]) ScanFloat64 ¶ added in v0.1.2
func (*Executor[T]) ScanString ¶ added in v0.1.2
func (*Executor[T]) ScanUint16 ¶ added in v0.1.5
func (*Executor[T]) ScanUint32 ¶ added in v0.1.5
func (*Executor[T]) ScanUint64 ¶ added in v0.1.5
func (*Executor[T]) SelectExpr ¶ added in v0.1.0
func (*Executor[T]) TakeFloat32 ¶ added in v0.1.5
func (*Executor[T]) TakeFloat64 ¶ added in v0.1.2
func (*Executor[T]) TakeString ¶ added in v0.1.2
func (*Executor[T]) TakeUint16 ¶ added in v0.1.5
func (*Executor[T]) TakeUint32 ¶ added in v0.1.5
func (*Executor[T]) TakeUint64 ¶ added in v0.1.5
func (*Executor[T]) UpdateColumn ¶ added in v0.1.0
func (*Executor[T]) UpdateColumnExpr ¶ added in v0.3.2
func (*Executor[T]) UpdateColumns ¶ added in v0.1.0
func (*Executor[T]) UpdateColumnsExpr ¶ added in v0.3.2
func (*Executor[T]) UpdateColumnsMap ¶ added in v0.1.3
func (*Executor[T]) UpdateExpr ¶ added in v0.3.2
func (*Executor[T]) UpdatesExpr ¶ added in v0.3.2
func (*Executor[T]) UpdatesMap ¶ added in v0.1.3
type Expr ¶
type Expr interface { clause.Expression As(alias string) Expr ColumnName() string Expression() clause.Expression RawExpr() any BuildColumn(*gorm.Statement, ...BuildOption) string BuildWithArgs(*gorm.Statement) (query string, args []any) }
Expr a query expression about field
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
Field a standard field struct
func (Field) Add ¶
Add use value type:
time.Duration: use DATE_ADD(expr, INTERVAL ? MICROSECOND) other: use expr+?
func (Field) BuildColumn ¶
func (e Field) BuildColumn(stmt *gorm.Statement, opts ...BuildOption) string
func (Field) ColumnName ¶
func (e Field) ColumnName() string
func (Field) DateFormat ¶
DateFormat use DATE_FORMAT(date,format)
func (Field) EqSubQuery ¶ added in v0.3.0
EqSubQuery use expr1 = (subQuery)
func (Field) Expression ¶
func (e Field) Expression() clause.Expression
func (Field) FieldName ¶ added in v0.5.5
FieldName hold column name. if prefixes not exist returns same as ColumnName(), others {prefixes[0]}_{ColumnName}
func (Field) FindInSetCol ¶ added in v0.3.1
FindInSetCol use FIND_IN_SET(expr1, expr2)
func (Field) FindInSetColWith ¶ added in v0.3.1
FindInSetColWith use FIND_IN_SET(expr2, expr1)
func (Field) FindInSetSubQuery ¶ added in v0.3.0
FindInSetSubQuery FIND_IN_SET(column, (subQuery))
func (Field) FindInSetWith ¶
FindInSetWith use FIND_IN_SET(?, expr)
func (Field) FromUnixTime ¶
FromUnixTime use FromUnixTime(unix_timestamp[, format])
func (Field) GtSubQuery ¶ added in v0.3.0
GtSubQuery use expr1 > (subQuery)
func (Field) GteSubQuery ¶ added in v0.3.0
GteSubQuery use expr1 >= (subQuery)
func (Field) InSubQuery ¶ added in v0.3.0
InSubQuery use expr1 IN (subQuery)
func (Field) LTrimSpace ¶ added in v0.0.7
LTrimSpace use LTRIM(?)
func (Field) LtSubQuery ¶ added in v0.3.0
LtSubQuery use expr1 < (subQuery)
func (Field) LteSubQuery ¶ added in v0.3.0
LteSubQuery use expr1 <= (subQuery)
func (Field) MicroSecond ¶
MicroSecond use MICROSECOND(date) return the microsecond.
func (Field) NeqSubQuery ¶ added in v0.3.0
NeqSubQuery use expr1 <> (subQuery)
func (Field) NotBetween ¶
NotBetween use NOT (expr BETWEEN ? AND ?)
func (Field) NotInSubQuery ¶ added in v0.3.0
NotInSubQuery use expr1 NOT IN (subQuery)
func (Field) RTrimSpace ¶ added in v0.0.7
RTrimSpace use RTRIM(?)
func (Field) SetSubQuery ¶ added in v0.3.2
setSubQuery set with subQuery
func (Field) Sub ¶
Sub use below value type:
time.Duration: use DATE_SUB(expr, INTERVAL ? MICROSECOND) other: use expr-?
func (Field) SubstringIndex ¶
SubstringIndex use SUBSTRING_INDEX(expr,?,?) https://dev.mysql.com/doc/refman/8.0/en/functions.html#function_substring-index
func (Field) UnixTimestamp ¶
UnixTimestamp use UnixTimestamp(date)
func (Field) ValueAny ¶ added in v0.3.3
ValueAny set any value. Deprecated: use other ValueXXX instead.
type Float ¶
type Float[T constraints.Float | ~string] Field
Float type field
func (Float[T]) NotBetween ¶
NotBetween use NOT (expr BETWEEN ? AND ?).
func (Float[T]) ValuePointer ¶ added in v0.4.1
Value set value use pointer
type Float32 ¶
func NewFloat32 ¶
NewFloat32 new float32 field
type Float64 ¶
func NewFloat64 ¶
NewFloat64 new float64 field
type Int64 ¶
func UnixTimestamp ¶
UnixTimestamp use UNIX_TIMESTAMP([date])
type Integer ¶
type Integer[T constraints.Integer] Field
Integer type field
func NewInteger ¶
func NewInteger[T constraints.Integer](table, column string, opts ...Option) Integer[T]
NewInt new Integer
func (Integer[T]) FromUnixTime ¶
FromUnixTime use FromUnixTime(unix_timestamp[, format])
func (Integer[T]) NotBetween ¶
NotBetween use NOT (expr BETWEEN ? AND ?)
func (Integer[T]) NotInAny ¶ added in v0.1.6
NotInAny use expr NOT IN (?) value must be a array/slice
func (Integer[T]) RightShift ¶
RightShift use expr>>?
func (Integer[T]) ValuePointer ¶ added in v0.4.1
Value set value use pointer
type String ¶
type String Field
String string type field
func FromUnixTime ¶
FromUnixTime use FROM_UNIXTIME(unix_timestamp[,format])
func (String) FindInSetWith ¶
FindInSetWith equal to FIND_IN_SET(?, expr)
func (String) FuzzyLike ¶
FuzzyLike use expr LIKE ?, ? contain prefix % and suffix % e.g. expr LIKE %value%
func (String) Hidden ¶ added in v0.2.2
Hidden use CONCAT(LEFT(expr,left),pad,RIGHT(expr,right)) detail see innerHidden
func (String) HiddenPrefix ¶ added in v0.2.2
HiddenPrefix use CONCAT(pad,RIGHT(expr,right))
func (String) HiddenSuffix ¶ added in v0.2.2
HiddenSuffix use CONCAT(LEFT(expr,left),pad)
func (String) LTrimSpace ¶ added in v0.0.7
LTrimSpace use LTRIM(?)
func (String) NotBetween ¶
NotBetween use NOT (expr BETWEEN ? AND ?)
func (String) RTrimSpace ¶ added in v0.0.7
RTrimSpace use RTRIM(?)
func (String) SubstringIndex ¶
SubstringIndex use SUBSTRING_INDEX(expr,?,?) https://dev.mysql.com/doc/refman/8.0/en/functions.html#function_substring-index
func (String) ValuePointer ¶ added in v0.4.1
Value set value use pointer
type Time ¶
type Time Field
Time time type field
func (Time) DateFormat ¶
DateFormat use DATE_FORMAT(date,format)
func (Time) MicroSecond ¶
MicroSecond use MICROSECOND(date) return the microsecond.
func (Time) NotBetween ¶
NotBetween use NOT (expr BETWEEN ? AND ?)
func (Time) UnixTimestamp ¶
UnixTimestamp use UnixTimestamp(date)
func (Time) ValuePointer ¶ added in v0.4.1
ValuePointer set value use pointer
Source Files ¶
- assist.go
- assist_chains.go
- assist_gorm.go
- assist_join.go
- assist_paginate.go
- column_option.go
- executor.go
- executor_chains.go
- executor_finish_api.go
- executor_sub_query.go
- expr.go
- expr_basic.go
- expr_col.go
- expr_general.go
- expr_keyword.go
- expr_set.go
- expr_sub_query.go
- field.go
- field_asterisk.go
- field_bool.go
- field_bytes.go
- field_constant.go
- field_float.go
- field_float_generic.go
- field_integer.go
- field_integer_generic.go
- field_string.go
- field_time.go
- function.go
- function_time.go
- interface.go
- sub_query.go
- utils.go