clause

package
v1.15.3 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByValidEqual

func ByValidEqual[T comparable](column string, v T) clause.Expression

func DateBetween

func DateBetween(column, dateStart, dateEnd string) clause.Expression

func FindByList

func FindByList[T any, O constraints.Ordered](db *gorm.DB, req *param.List[O]) ([]T, error)

func ListClause

func ListClause[O constraints.Ordered](req *param.List[O]) []clause.Expression

func NewWhereClause

func NewWhereClause(field string, op dbi.Operation, args ...interface{}) clause.Expression

func PageExpr

func PageExpr(pageNo, pageSize int) clause.Limit

func SortExpr

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

func TableName

func TableName(tx *gorm.DB, name string) *gorm.DB

Types

type ChainClause

type ChainClause []clause.Interface

func (ChainClause) ById

func (c ChainClause) ById(id int) ChainClause

func (ChainClause) ByIdNoCheck

func (c ChainClause) ByIdNoCheck(id any) ChainClause

func (ChainClause) ByName

func (c ChainClause) ByName(name string) ChainClause

func (ChainClause) ByNameNoCheck

func (c ChainClause) ByNameNoCheck(name string) ChainClause

type Expression

type Expression dbi.FilterExpr

func (*Expression) Clause

func (e *Expression) Clause() func(*gorm.DB) *gorm.DB

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 List

type List[T constraints.Ordered] param.List[T]

func (*List[O]) Clause

func (req *List[O]) Clause() []clause.Expression

type PageSort

type PageSort param.PageSort

func (*PageSort) Clause

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

type Range

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

func (*Range[T]) Clause

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

Jump to

Keyboard shortcuts

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