Documentation
¶
Index ¶
- Constants
- func DateBetween(column, dateStart, dateEnd string) clause.Expression
- func List[T any, O request.Ordered](db *gorm.DB, req *request.ListReq[O]) ([]T, error)
- func ListClause[O request.Ordered](req *request.ListReq[O]) []clause.Expression
- func NewClause(field string, op dbi.Operation, args ...interface{}) func(*gorm.DB) *gorm.DB
- func NewWhereClause(field string, op dbi.Operation, args ...interface{}) clause.Expression
- func Page(pageNo, pageSize int) clause.Limit
- func Sort(column string, typ request.SortType) clause.Expression
- func TableName(tx *gorm.DB, name string) *gorm.DB
- type ChainClause
- func (c ChainClause) ById(id int) ChainClause
- func (c ChainClause) ByIdNoCheck(id int) ChainClause
- func (c ChainClause) ByName(name string) ChainClause
- func (c ChainClause) ByNameNoCheck(name string) ChainClause
- func (c ChainClause) Exec(db *gorm.DB) *gorm.DB
- func (c ChainClause) Or(clauses ...ChainClause) ChainClause
- type ChainDB
- type Clause3
- type EmptyClause
- type Expression
- type Limit
- type ListReq
- type PageSortReq
- type RangeReq
Constants ¶
View Source
const ( IDEQUAL = dbi.ColumnId + dbi.ExprEqual NAMEEQUAL = dbi.ColumnName + dbi.ExprEqual )
Variables ¶
This section is empty.
Functions ¶
func DateBetween ¶
func DateBetween(column, dateStart, dateEnd string) clause.Expression
func ListClause ¶
func NewWhereClause ¶
func NewWhereClause(field string, op dbi.Operation, args ...interface{}) clause.Expression
Types ¶
type ChainClause ¶ added in v1.6.13
func (ChainClause) ById ¶ added in v1.6.13
func (c ChainClause) ById(id int) ChainClause
db.Scope(ById(1),ByName("a")).First(v)
func (ChainClause) ByIdNoCheck ¶ added in v1.6.13
func (c ChainClause) ByIdNoCheck(id int) 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
func (ChainClause) Or ¶ added in v1.6.13
func (c ChainClause) Or(clauses ...ChainClause) ChainClause
type ChainDB ¶
func NewChainDB ¶
func (ChainDB) ByIdNoCheck ¶ added in v1.6.13
func (ChainDB) ByNameNoCheck ¶ added in v1.6.13
type Clause3 ¶ added in v1.6.13
func (Clause3) ByIdNoCheck ¶ added in v1.6.13
type EmptyClause ¶
type EmptyClause struct { }
func (*EmptyClause) Build ¶
func (receiver *EmptyClause) Build(builder clause.Builder)
func (*EmptyClause) ModifyStatement ¶
func (receiver *EmptyClause) ModifyStatement(*gorm.Statement)
type Expression ¶
type Expression dbi.FilterExpr
type PageSortReq ¶
type PageSortReq request.PageSortReq
func (*PageSortReq) Clause ¶
func (req *PageSortReq) Clause() []clause.Expression
Click to show internal directories.
Click to hide internal directories.