clause

package
v1.12.6 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: MIT Imports: 5 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 List

func List[T any, O request.Ordered](db *gorm.DB, req *request.ListReq[O]) ([]T, error)

func ListClause

func ListClause[O request.Ordered](req *request.ListReq[O]) []clause.Expression

func NewWhereClause

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

func Page added in v1.9.0

func Page(pageNo, pageSize int) clause.Limit

func Sort added in v1.9.0

func Sort(column string, typ request.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 ListReq added in v1.9.0

type ListReq[T request.Ordered] request.ListReq[T]

func (*ListReq[O]) Clause added in v1.9.0

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

type PageSortReq added in v1.9.0

type PageSortReq request.PageSortReq

func (*PageSortReq) Clause added in v1.9.0

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

type RangeReq added in v1.9.0

type RangeReq[T request.Ordered] request.RangeReq[T]

func (*RangeReq[T]) Clause added in v1.9.0

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

Jump to

Keyboard shortcuts

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