clause

package
v1.3.13 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: MIT, Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConditionExprType = reflect.TypeOf((*ConditionExpr)(nil)).Elem()

Functions

func ByPrimaryKey

func ByPrimaryKey(v any) clause.Expression

func ConditionByStruct

func ConditionByStruct(param any) (clause.Expression, error)

func EqualByStruct

func EqualByStruct(param any) clause.Expression

func FindByPageSort

func FindByPageSort[T any](db *gorm.DB, req *param.PageSort, clauses ...clause.Expression) ([]T, int64, error)

func FindByPageSortEmbed

func FindByPageSortEmbed[T any](db *gorm.DB, req *param.PageSortEmbed, clauses ...clause.Expression) ([]T, int64, error)

func NewCondition

func NewCondition(field string, op dbi.ConditionOperation, args ...any) clause.Expression

func PageExpr

func PageExpr(pageNo, pageSize int) clause.Limit

func SortExpr

func SortExpr(column string, typ param.SortType) clause.Expression

Types

type Between

type Between struct {
	Column     any
	Begin, End any
}

func (Between) Build

func (gt Between) Build(builder clause.Builder)

func (Between) NegationBuild

func (gt Between) NegationBuild(builder clause.Builder)

type ChainClause

type ChainClause []clause.Interface

func (ChainClause) ById

func (c ChainClause) ById(id any) ChainClause

func (ChainClause) ByName

func (c ChainClause) ByName(name string) ChainClause

type ConditionExpr

type ConditionExpr interface {
	Condition() clause.Expression
}

type FilterExpr

type FilterExpr dbi.FilterExpr

func (*FilterExpr) Condition

func (f *FilterExpr) Condition() clause.Expression

type FilterExprs

type FilterExprs dbi.FilterExprs

func (FilterExprs) Condition

func (f FilterExprs) Condition() clause.Expression

type IsNotNull

type IsNotNull IsNull

func (IsNotNull) Build

func (inn IsNotNull) Build(builder clause.Builder)

func (IsNotNull) NegationBuild

func (inn IsNotNull) NegationBuild(builder clause.Builder)

type IsNull

type IsNull struct {
	Column any
}

func (IsNull) Build

func (in IsNull) Build(builder clause.Builder)

func (IsNull) NegationBuild

func (in IsNull) NegationBuild(builder clause.Builder)

type Limit

type Limit struct {
	Limit  int
	Offset int
}

Limit limit clause

func (Limit) Build

func (limit Limit) Build(builder clause.Builder)

Build build where clause

func (Limit) MergeClause

func (limit Limit) MergeClause(clause *clause.Clause)

MergeClause merge order by clauses

func (Limit) Name

func (limit Limit) Name() string

Name where clause name

type Not

type Not struct {
	Expr clause.NegationExpressionBuilder
}

func (Not) Build

func (n Not) Build(builder clause.Builder)

type PageEmbed

type PageEmbed param.PageEmbed

func (*PageEmbed) Apply

func (req *PageEmbed) Apply(db *gorm.DB) *gorm.DB

func (*PageEmbed) Clause

func (req *PageEmbed) Clause() clause.Expression

type PageSort

type PageSort param.PageSort

func (*PageSort) Apply

func (req *PageSort) Apply(db *gorm.DB) *gorm.DB

func (*PageSort) Clause

func (req *PageSort) Clause() []clause.Expression

type PageSortEmbed

type PageSortEmbed param.PageSortEmbed

func (*PageSortEmbed) Clause

func (req *PageSortEmbed) Clause() []clause.Expression

type Range

type Range[T param.Ordered] param.Range[T]

func (*Range[T]) Condition

func (req *Range[T]) Condition() clause.Expression

type RangeInTwoField

type RangeInTwoField[T param.Ordered] param.RangeInTwoField[T]

func (*RangeInTwoField[T]) Condition

func (req *RangeInTwoField[T]) Condition() clause.Expression

Jump to

Keyboard shortcuts

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