repos

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delete added in v1.9.5

type Delete struct {
	Model  interface{}
	Wheres where.Wheres
}

type IBasicRepository

type IBasicRepository interface {
	IRepository
	ITxRepository
}

IBasicRepository 基础查询与事务

type IRepository

type IRepository interface {
	Exist(*finder.Finder) bool
	Get(*finder.Finder) error
	Find(*finder.Finder) error
	Create(*creator.Creator) error
	Update(*updater.Updater) error
	Delete(*deleter.Deleter) error
	Exec(context.Context, string, ...interface{}) error
	Raw(context.Context, string, ...interface{}) error
}

IRepository 基础查询

type ITxRepository

type ITxRepository interface {
	Tx(context.Context, func(context.Context) error) error
	GetTx(context.Context) (interface{}, error)
}

ITxRepository 事务

type Query added in v1.9.5

type Query struct {
	Model          interface{}  // 查询的模型
	Wheres         where.Wheres // 查询条件
	Recipient      interface{}  // 查询结果保存的对象
	OrderBy        string       // 排序条件
	IgnoreNotFound bool         // 是否过滤未找到数据的错误
	Num, Size      int          // 分页页码, 单页大小
	Total          *int64       // 总数
}

type TxKey

type TxKey struct{}

type Update added in v1.9.5

type Update struct {
	Model   interface{}            // 修改对应的模型
	Wheres  where.Wheres           // 修改的过滤条件
	Update  interface{}            // 修改的结构体值, 修改整体值时使用
	Fields  map[string]interface{} // 修改的map值, 用于修改单个或多个字段时使用
	SaveNil bool                   // 是否保存空值, 默认不会更新类似 0,false,"" 等值
	Omits   []string               // 修改时指定不更新的字段
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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