clause

package
v1.8.11 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByValidEqual added in v1.7.8

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

func Page(pageNo, pageSize int) clause.Limit

func Sort

func Sort(column string, typ request.SortType) clause.Expression

func TableName

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

Types

type ChainClause added in v1.6.13

type ChainClause []clause.Interface

func (ChainClause) ById added in v1.6.13

func (c ChainClause) ById(id int) ChainClause

func (ChainClause) ByIdNoCheck added in v1.6.13

func (c ChainClause) ByIdNoCheck(id any) ChainClause

func (ChainClause) ByName added in v1.6.13

func (c ChainClause) ByName(name string) ChainClause

func (ChainClause) ByNameNoCheck added in v1.6.13

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

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

func (*ListReq[O]) Clause

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

type PageSortReq

type PageSortReq request.PageSortReq

func (*PageSortReq) Clause

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

type RangeReq

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

func (*RangeReq[T]) Clause

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