finder

package
v1.12.10 Latest Latest
Warning

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

Go to latest
Published: Aug 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

	// 是否查询软删除的数据, 默认不查询软删除的数据, true: 查询软删除的数据
	Unscoped bool

	// 分页页码, 单页大小
	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