finder

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finder

type Finder struct {
	Model          interface{}                  // 查询的模型
	Wheres         where.Wheres                 // 查询条件
	Recipient      interface{}                  // 查询结果保存的对象
	OrderBy        string                       // 排序条件
	IgnoreNotFound bool                         // 是否过滤未找到数据的错误
	Preloads       []string                     // 预加载关联数据的表名
	Scopes         []func(db *gorm.DB) *gorm.DB // 查询作用域
	Num, Size      int                          // 分页页码, 单页大小
	Total          *int64                       // 总数
}

func New

func New() *Finder

func (*Finder) SetIgnoreNotFound

func (f *Finder) SetIgnoreNotFound(ignoreNotFound bool) *Finder

func (*Finder) SetModel

func (f *Finder) SetModel(model interface{}) *Finder

func (*Finder) SetOrderBy

func (f *Finder) SetOrderBy(orderBy string) *Finder

func (*Finder) SetPaginate

func (f *Finder) SetPaginate(num, size int, total *int64) *Finder

func (*Finder) SetPreloads

func (f *Finder) SetPreloads(preloads ...string) *Finder

func (*Finder) SetRecipient

func (f *Finder) SetRecipient(recipient interface{}) *Finder

func (*Finder) SetScope

func (f *Finder) SetScope(scopes ...func(db *gorm.DB) *gorm.DB) *Finder

func (*Finder) SetWheres

func (f *Finder) SetWheres(wheres where.Wheres) *Finder

Jump to

Keyboard shortcuts

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