clause

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT, Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func ByPrimaryKey added in v0.3.9

func ByPrimaryKey(v any) clause.Expression

func ConditionByStruct added in v0.6.0

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

func EqualByStruct added in v0.6.0

func EqualByStruct(param any) clause.Expression

func FindByPageSort added in v0.3.9

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

func FindByPageSortEmbed added in v0.3.9

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

func NewCondition added in v0.6.0

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 added in v0.3.9

type Between struct {
	Column     any
	Begin, End any
}

func (Between) Build added in v0.3.9

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

func (Between) NegationBuild added in v0.3.9

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 added in v0.6.1

type ConditionExpr interface {
	Condition() clause.Expression
}

type FilterExpr added in v0.6.0

type FilterExpr dbi.FilterExpr

func (*FilterExpr) Condition added in v0.6.1

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

type FilterExprs added in v0.6.0

type FilterExprs dbi.FilterExprs

func (FilterExprs) Condition added in v0.6.1

func (f FilterExprs) Condition() clause.Expression

type IsNotNull added in v0.6.1

type IsNotNull IsNull

func (IsNotNull) Build added in v0.6.1

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

func (IsNotNull) NegationBuild added in v0.6.1

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

type IsNull added in v0.6.1

type IsNull struct {
	Column any
}

func (IsNull) Build added in v0.6.1

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

func (IsNull) NegationBuild added in v0.6.1

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 added in v0.3.9

type Not struct {
	Expr clause.NegationExpressionBuilder
}

func (Not) Build added in v0.3.9

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

type PageEmbed added in v0.3.9

type PageEmbed param.PageEmbed

func (*PageEmbed) Apply added in v0.3.9

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

func (*PageEmbed) Clause added in v0.3.9

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

type PageSort

type PageSort param.PageSort

func (*PageSort) Apply added in v0.3.9

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

func (*PageSort) Clause

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

type PageSortEmbed added in v0.3.9

type PageSortEmbed param.PageSortEmbed

func (*PageSortEmbed) Clause added in v0.3.9

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

type Range

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

func (*Range[T]) Condition added in v0.6.1

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

type RangeInTwoField added in v0.6.0

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

func (*RangeInTwoField[T]) Condition added in v0.6.1

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