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 AssignExpr
- type Asterisk
- func (e Asterisk) As(alias string) Expr
- func (e Asterisk) Asc() 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) AssignExpr
- func (e Asterisk) SetExpr() any
- func (e Asterisk) SetSubQuery(subQuery *gorm.DB) AssignExpr
- func (e Asterisk) ValueAny(value any) AssignExpr
- func (e Asterisk) ValueNull() AssignExpr
- func (e Asterisk) ValueSubQuery(subQuery *gorm.DB) AssignExpr
- 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) NullIf(value bool) Expr
- func (field Bool) Or(value bool) Expr
- func (field Bool) Value(value bool) AssignExpr
- func (field Bool) ValuePointer(value *bool) AssignExpr
- func (field Bool) ValueZero() AssignExpr
- 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) NullIf(value []byte) Expr
- func (field Bytes) Regexp(value string) Expr
- func (field Bytes) SubstringIndex(delim string, count int) Bytes
- func (field Bytes) Value(value []byte) AssignExpr
- func (field Bytes) ValueZero() AssignExpr
- type CaseWhen
- type Columns
- type Condition
- func CrossJoinsExpr(table schema.Tabler, conds ...Expr) Condition
- func CrossJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) Conditiondeprecated
- 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 GromModel[T any]() Condition
- func GroupExpr(columns ...Expr) Condition
- func InnerJoinsExpr(table schema.Tabler, conds ...Expr) Condition
- func InnerJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) Conditiondeprecated
- func LeftJoinsExpr(table schema.Tabler, conds ...Expr) Condition
- func LeftJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) Conditiondeprecated
- 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) Conditiondeprecated
- 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) *Conditionsdeprecated
- 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) *Conditionsdeprecated
- 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) *Conditionsdeprecated
- 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) *Conditionsdeprecated
- 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 ...AssignExpr) *Executor[T]
- func (x *Executor[T]) Attrs(attrs ...any) *Executor[T]
- func (x *Executor[T]) AttrsExpr(attrs ...AssignExpr) *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]deprecated
- 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() (rows []*T, err error)
- func (x *Executor[T]) FindAllByPage(offset, limit int) (rows []*T, count int64, err error)
- func (x *Executor[T]) FindAllPaginate(page, perPage int64, maxPerPages ...int64) (rows []*T, count int64, err error)
- func (x *Executor[T]) FindByPage(dest any, offset, limit int) (count int64, err error)
- func (x *Executor[T]) FindInBatches(dest any, batchSize int, fc func(tx *gorm.DB, batch int) error) error
- func (x *Executor[T]) FindPaginate(dest any, page, perPage int64, maxPerPages ...int64) (count int64, err 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]deprecated
- 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]deprecated
- 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]) Model() *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]) Returning(columns ...string) *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]deprecated
- func (x *Executor[T]) Save(value *T) (rowsAffected int64, err 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 ...AssignExpr) (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 ...AssignExpr) (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) Asc() 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 (field Field) ConcatWsCol(separator Expr, 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) NullIf(value any) 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) AssignExpr
- func (e Field) SetExpr() any
- func (e Field) SetSubQuery(subQuery *gorm.DB) AssignExpr
- 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) AssignExpr
- func (e Field) ValueAny(value any) AssignExpr
- func (e Field) ValueNull() AssignExpr
- func (e Field) ValueSubQuery(subQuery *gorm.DB) AssignExpr
- 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]) NullIf(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) AssignExpr
- func (field Float[T]) ValuePointer(value *T) AssignExpr
- func (field Float[T]) ValueZero() AssignExpr
- 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]) NullIf(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) AssignExpr
- func (field Integer[T]) ValuePointer(value *T) AssignExpr
- func (field Integer[T]) ValueZero() AssignExpr
- type JoinTable
- type JoinTableExpr
- 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) ConcatWsCol(separator Expr, 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) NullIf(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) AssignExpr
- func (field String) ValuePointer(value *string) AssignExpr
- func (field String) ValueZero() AssignExpr
- type Table
- 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) NullIf(value time.Time) 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) AssignExpr
- func (field Time) ValuePointer(value *time.Time) AssignExpr
- func (field Time) ValueZero() AssignExpr
- func (field Time) Year() Int
- type Uint
- type Uint16
- type Uint32
- type Uint64
- type Uint8
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 "*"
var Zero = NewRaw("0")
Zero a symbol of "0"
Functions ¶
func IntoExpression ¶
func IntoExpression(conds ...Expr) []clause.Expression
IntoExpression convert Expr to clause.Expression
func IntoIntegerSlice ¶
func IntoIntegerSlice[T constraints.Integer, R constraints.Integer](values []T) []R
Types ¶
type AssignExpr ¶ added in v0.0.17
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 ¶
EqSubQuery use expr1 = (subQuery)
func (Asterisk) Expression ¶
func (e Asterisk) Expression() clause.Expression
func (Asterisk) FieldName ¶
FieldName hold column name. if prefixes not exist returns same as ColumnName(), others {prefixes[0]}_{ColumnName}
func (Asterisk) FindInSetCol ¶
FindInSetCol use FIND_IN_SET(expr1, expr2)
func (Asterisk) FindInSetColWith ¶
FindInSetColWith use FIND_IN_SET(expr2, expr1)
func (Asterisk) FindInSetSubQuery ¶
FindInSetSubQuery FIND_IN_SET(column, (subQuery))
func (Asterisk) GroupConcat ¶
func (e Asterisk) GroupConcat() Expr
GroupConcat use GROUP_CONCAT(expr)
func (Asterisk) GtSubQuery ¶
GtSubQuery use expr1 > (subQuery)
func (Asterisk) GteSubQuery ¶
GteSubQuery use expr1 >= (subQuery)
func (Asterisk) InSubQuery ¶
InSubQuery use expr1 IN (subQuery)
func (Asterisk) LtSubQuery ¶
LtSubQuery use expr1 < (subQuery)
func (Asterisk) LteSubQuery ¶
LteSubQuery use expr1 <= (subQuery)
func (Asterisk) NeqSubQuery ¶
NeqSubQuery use expr1 <> (subQuery)
func (Asterisk) NotInSubQuery ¶
NotInSubQuery use expr1 NOT IN (subQuery)
func (Asterisk) SetSubQuery ¶
func (e Asterisk) SetSubQuery(subQuery *gorm.DB) AssignExpr
SetSubQuery set with subQuery
func (Asterisk) ValueSubQuery ¶ added in v0.0.11
func (e Asterisk) ValueSubQuery(subQuery *gorm.DB) AssignExpr
ValueSubQuery set with subQuery same as SetSubQuery.
type Bool ¶
type Bool Field
Bool boolean type field
func (Bool) ValuePointer ¶
func (field Bool) ValuePointer(value *bool) AssignExpr
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 CaseWhen ¶
type CaseWhen struct {
// contains filtered or unexported fields
}
func NewCaseWhen ¶
func NewCaseWhen() *CaseWhen
NewCaseWhen new case when clause CASE
WHEN condition1 THEN result1 WHEN condition2 THEN result2 ... [ELSE result]
END
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 ¶
CrossJoinsExpr cross joins condition
func GormClauses ¶
func GormClauses(conds ...clause.Expression) Condition
func GormDistinct ¶
func GormHaving ¶
func GormInnerJoins ¶
func GormOffset ¶
func GormPreload ¶
func GormSelect ¶
func GormUnscoped ¶
func GormUnscoped() Condition
func InnerJoinsExpr ¶
InnerJoinsExpr inner joins condition
func LeftJoinsExpr ¶
LeftJoinsExpr 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 ¶
RightJoinsExpr 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 ¶
func (c *Conditions) Clauses(conds ...clause.Expression) *Conditions
func (*Conditions) Configure ¶
func (c *Conditions) Configure(funcs ...func(*Conditions) *Conditions) *Conditions
Configure the conditions in the scope
func (*Conditions) CrossJoinsExpr ¶
func (c *Conditions) CrossJoinsExpr(table schema.Tabler, conds ...Expr) *Conditions
CrossJoinsExpr cross joins condition
func (*Conditions) CrossJoinsXExpr
deprecated
func (c *Conditions) CrossJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) *Conditions
Deprecated: use other CrossJoinsExpr(NewJoinTable(table, alias), conds...). CrossJoinsXExpr cross joins condition
func (*Conditions) Distinct ¶
func (c *Conditions) Distinct(args ...any) *Conditions
Distinct with field
func (*Conditions) DistinctExpr ¶
func (c *Conditions) DistinctExpr(columns ...Expr) *Conditions
DistinctExpr with field
func (*Conditions) Group ¶
func (c *Conditions) Group(name string) *Conditions
func (*Conditions) GroupExpr ¶
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 ¶
func (c *Conditions) InnerJoins(query string, args ...any) *Conditions
func (*Conditions) InnerJoinsExpr ¶
func (c *Conditions) InnerJoinsExpr(table schema.Tabler, conds ...Expr) *Conditions
InnerJoinsExpr inner joins condition
func (*Conditions) InnerJoinsXExpr
deprecated
func (c *Conditions) InnerJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) *Conditions
Deprecated: use other InnerJoinsExpr(NewJoinTable(table, alias), conds...). InnerJoinsXExpr inner joins condition
func (*Conditions) Joins ¶
func (c *Conditions) Joins(query string, args ...any) *Conditions
func (*Conditions) LeftJoinsExpr ¶
func (c *Conditions) LeftJoinsExpr(table schema.Tabler, conds ...Expr) *Conditions
LeftJoinsExpr left join condition
func (*Conditions) LeftJoinsXExpr
deprecated
func (c *Conditions) LeftJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) *Conditions
Deprecated: use other LeftJoinsExpr(NewJoinTable(table, alias), conds...). LeftJoinsXExpr left join condition
func (*Conditions) Limit ¶
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 ¶
func (c *Conditions) Not(query any, args ...any) *Conditions
func (*Conditions) Offset ¶
func (c *Conditions) Offset(offset int) *Conditions
func (*Conditions) Omit ¶
func (c *Conditions) Omit(columns ...string) *Conditions
func (*Conditions) OmitExpr ¶
func (c *Conditions) OmitExpr(columns ...Expr) *Conditions
OmitExpr with field
func (*Conditions) Or ¶
func (c *Conditions) Or(query any, args ...any) *Conditions
func (*Conditions) Order ¶
func (c *Conditions) Order(value any) *Conditions
func (*Conditions) OrderExpr ¶
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 ¶
func (c *Conditions) Preload(query string, args ...any) *Conditions
func (*Conditions) RightJoinsExpr ¶
func (c *Conditions) RightJoinsExpr(table schema.Tabler, conds ...Expr) *Conditions
RightJoinsExpr right join condition
func (*Conditions) RightJoinsXExpr
deprecated
func (c *Conditions) RightJoinsXExpr(table schema.Tabler, alias string, conds ...Expr) *Conditions
Deprecated: use other RightJoinsExpr(NewJoinTable(table, alias), conds...). RightJoinsXExpr right join condition
func (*Conditions) Scopes ¶
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 ¶
func (c *Conditions) SelectExpr(columns ...Expr) *Conditions
SelectExpr with field
func (*Conditions) Unscoped ¶
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 ¶
type Executor[T any] struct { // contains filtered or unexported fields }
func (*Executor[T]) AssignExpr ¶
func (x *Executor[T]) AssignExpr(attrs ...AssignExpr) *Executor[T]
AssignExpr with AssignExpr provide attributes used in [FirstOrCreate] or [FirstOrInit]
func (*Executor[T]) AttrsExpr ¶
func (x *Executor[T]) AttrsExpr(attrs ...AssignExpr) *Executor[T]
AttrsExpr with AssignExpr provide attributes used in [FirstOrCreate] or [FirstOrInit]
func (*Executor[T]) Clauses ¶
func (x *Executor[T]) Clauses(conds ...clause.Expression) *Executor[T]
func (*Executor[T]) CreateInBatches ¶
func (*Executor[T]) CrossJoinsExpr ¶
func (*Executor[T]) DistinctExpr ¶
func (*Executor[T]) FindAllByPage ¶ added in v0.0.16
func (*Executor[T]) FindAllPaginate ¶ added in v0.0.16
func (*Executor[T]) FindByPage ¶ added in v0.0.16
func (*Executor[T]) FindInBatches ¶
func (*Executor[T]) FindPaginate ¶ added in v0.0.16
func (*Executor[T]) FirstFloat32 ¶
func (*Executor[T]) FirstFloat64 ¶
func (*Executor[T]) FirstInt16 ¶
func (*Executor[T]) FirstInt32 ¶
func (*Executor[T]) FirstInt64 ¶
func (*Executor[T]) FirstOrCreate ¶
func (*Executor[T]) FirstOrInit ¶
func (*Executor[T]) FirstString ¶
func (*Executor[T]) FirstUint16 ¶
func (*Executor[T]) FirstUint32 ¶
func (*Executor[T]) FirstUint64 ¶
func (*Executor[T]) FirstUint8 ¶
func (*Executor[T]) InnerJoins ¶
func (*Executor[T]) InnerJoinsExpr ¶
func (*Executor[T]) IntoExistExpr ¶
func (*Executor[T]) IntoNotExistExpr ¶
func (*Executor[T]) IntoSubQueryExpr ¶
func (*Executor[T]) LeftJoinsExpr ¶
func (*Executor[T]) LockingShare ¶
func (*Executor[T]) LockingUpdate ¶
func (*Executor[T]) Pagination ¶
func (*Executor[T]) PluckExprBool ¶
func (*Executor[T]) PluckExprInt ¶
func (*Executor[T]) PluckExprInt16 ¶
func (*Executor[T]) PluckExprInt32 ¶
func (*Executor[T]) PluckExprInt64 ¶
func (*Executor[T]) PluckExprInt8 ¶
func (*Executor[T]) PluckExprString ¶
func (*Executor[T]) PluckExprUint ¶
func (*Executor[T]) PluckExprUint16 ¶
func (*Executor[T]) PluckExprUint32 ¶
func (*Executor[T]) PluckExprUint64 ¶
func (*Executor[T]) PluckExprUint8 ¶
func (*Executor[T]) PluckInt16 ¶
func (*Executor[T]) PluckInt32 ¶
func (*Executor[T]) PluckInt64 ¶
func (*Executor[T]) PluckString ¶
func (*Executor[T]) PluckUint16 ¶
func (*Executor[T]) PluckUint32 ¶
func (*Executor[T]) PluckUint64 ¶
func (*Executor[T]) PluckUint8 ¶
func (*Executor[T]) RightJoinsExpr ¶
func (*Executor[T]) ScanFloat32 ¶
func (*Executor[T]) ScanFloat64 ¶
func (*Executor[T]) ScanString ¶
func (*Executor[T]) ScanUint16 ¶
func (*Executor[T]) ScanUint32 ¶
func (*Executor[T]) ScanUint64 ¶
func (*Executor[T]) SelectExpr ¶
func (*Executor[T]) TakeFloat32 ¶
func (*Executor[T]) TakeFloat64 ¶
func (*Executor[T]) TakeString ¶
func (*Executor[T]) TakeUint16 ¶
func (*Executor[T]) TakeUint32 ¶
func (*Executor[T]) TakeUint64 ¶
func (*Executor[T]) UpdateColumn ¶
func (*Executor[T]) UpdateColumnExpr ¶
func (*Executor[T]) UpdateColumns ¶
func (*Executor[T]) UpdateColumnsExpr ¶
func (x *Executor[T]) UpdateColumnsExpr(columns ...AssignExpr) (rowsAffected int64, err error)
func (*Executor[T]) UpdateColumnsMap ¶
func (*Executor[T]) UpdateExpr ¶
func (*Executor[T]) UpdatesExpr ¶
func (x *Executor[T]) UpdatesExpr(columns ...AssignExpr) (rowsAffected int64, err error)
func (*Executor[T]) UpdatesMap ¶
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 ConcatWsCol ¶ added in v0.0.10
CONCAT_WS(separator,expr1,expr2,...exprN)
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) ConcatWsCol ¶ added in v0.0.10
ConcatWsCol use CONCAT_WS(separator,expr1,expr2,...exprN)
func (Field) DateFormat ¶
DateFormat use DATE_FORMAT(date,format)
func (Field) EqSubQuery ¶
EqSubQuery use expr1 = (subQuery)
func (Field) Expression ¶
func (e Field) Expression() clause.Expression
func (Field) FieldName ¶
FieldName hold column name. if prefixes not exist returns same as ColumnName(), others {prefixes[0]}_{ColumnName}
func (Field) FindInSetCol ¶
FindInSetCol use FIND_IN_SET(expr1, expr2)
func (Field) FindInSetColWith ¶
FindInSetColWith use FIND_IN_SET(expr2, expr1)
func (Field) FindInSetSubQuery ¶
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 ¶
GtSubQuery use expr1 > (subQuery)
func (Field) GteSubQuery ¶
GteSubQuery use expr1 >= (subQuery)
func (Field) InSubQuery ¶
InSubQuery use expr1 IN (subQuery)
func (Field) LtSubQuery ¶
LtSubQuery use expr1 < (subQuery)
func (Field) LteSubQuery ¶
LteSubQuery use expr1 <= (subQuery)
func (Field) MicroSecond ¶
MicroSecond use MICROSECOND(date) return the microsecond.
func (Field) NeqSubQuery ¶
NeqSubQuery use expr1 <> (subQuery)
func (Field) NotBetween ¶
NotBetween use NOT (expr BETWEEN ? AND ?)
func (Field) NotInSubQuery ¶
NotInSubQuery use expr1 NOT IN (subQuery)
func (Field) SetSubQuery ¶
func (e Field) SetSubQuery(subQuery *gorm.DB) AssignExpr
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) ValueSubQuery ¶ added in v0.0.11
func (e Field) ValueSubQuery(subQuery *gorm.DB) AssignExpr
ValueSubQuery set with subQuery same as SetSubQuery.
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 ¶
func (field Float[T]) ValuePointer(value *T) AssignExpr
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]) RightShift ¶
RightShift use expr>>?
func (Integer[T]) ValuePointer ¶
func (field Integer[T]) ValuePointer(value *T) AssignExpr
Value set value use pointer
func (Integer[T]) ValueZero ¶
func (field Integer[T]) ValueZero() AssignExpr
ValueZero set value zero
type JoinTable ¶ added in v0.0.6
type JoinTable struct {
// contains filtered or unexported fields
}
func NewJoinTable ¶ added in v0.0.6
NewJoinTable new join table as alias
func NewJoinTableSubQuery ¶ added in v0.0.7
NewJoinTableSubQuery new join table sub query as alias
type JoinTableExpr ¶ added in v0.0.6
type JoinTableExpr struct { clause.Join TableExpr clause.Expression }
JoinTableExpr join clause with table expression(sub query...)
func (JoinTableExpr) Build ¶ added in v0.0.6
func (join JoinTableExpr) Build(builder clause.Builder)
type SetExpr ¶
type SetExpr = AssignExpr
type String ¶
type String Field
String string type field
func FromUnixTime ¶
FromUnixTime use FROM_UNIXTIME(unix_timestamp[,format])
func (String) ConcatWsCol ¶ added in v0.0.10
ConcatWsCol use CONCAT_WS(separator,expr1,expr2,...exprN)
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 ¶
Hidden hidden field content. left > 0 && right > 0 -- CONCAT(LEFT(expr,left),pad,RIGHT(expr,right)) left > 0 && right <= 0 -- CONCAT(LEFT(expr,left),pad) right > 0 && left <= 0 -- CONCAT(pad,RIGHT(expr,right))
func (String) HiddenPrefix ¶
HiddenPrefix use CONCAT(pad,RIGHT(expr,right))
func (String) HiddenSuffix ¶
HiddenSuffix use CONCAT(LEFT(expr,left),pad)
func (String) NotBetween ¶
NotBetween use NOT (expr BETWEEN ? AND ?)
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 ¶
func (field String) ValuePointer(value *string) AssignExpr
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 ¶
func (field Time) ValuePointer(value *time.Time) AssignExpr
ValuePointer set value use pointer
Source Files ¶
- 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_join_table.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_case_when.go
- function_concat.go
- function_if.go
- function_sub_query.go
- function_time.go
- interface.go
- rapier.go
- rapier_chains.go
- rapier_gorm.go
- rapier_join.go
- rapier_paginate.go
- utils.go