dao

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

type Dao struct {
	// contains filtered or unexported fields
}

func New

func New(db *gorm.DB) *Dao

func (*Dao) AutoMigrate

func (dao *Dao) AutoMigrate(dst interface{}, settings ...map[string]interface{}) error

func (Dao) BeanName

func (Dao) BeanName() string

func (*Dao) Ctx

func (dao *Dao) Ctx(ctx context.Context) *Dao

func (*Dao) DB

func (dao *Dao) DB() *gorm.DB

func (*Dao) Delete

func (dao *Dao) Delete(db *gorm.DB, cause *wrapper.Query) (int64, error)

func (*Dao) Distinct

func (dao *Dao) Distinct(args ...interface{}) *Dao

func (*Dao) FindAll

func (dao *Dao) FindAll(cause *wrapper.Query, target interface{}) error

func (*Dao) FindOne

func (dao *Dao) FindOne(cause *wrapper.Query, target interface{}) (ok bool, err error)

func (*Dao) Insert

func (dao *Dao) Insert(value interface{}) error

func (*Dao) List

func (dao *Dao) List(cause *wrapper.Query, target interface{}, limit ...int) error

func (*Dao) Model

func (dao *Dao) Model(value interface{}) *Dao

func (*Dao) Page

func (dao *Dao) Page(cause *wrapper.Query, target interface{}, page, size int) (total int64, err error)

func (*Dao) Select

func (dao *Dao) Select(query interface{}, args ...interface{}) *Dao

func (*Dao) Sum

func (dao *Dao) Sum(field string, cause *wrapper.Query, target interface{}) (err error)

func (*Dao) Table

func (dao *Dao) Table(name string, args ...interface{}) *Dao

func (*Dao) Transaction

func (dao *Dao) Transaction(fc func(tx *Dao) error, opts ...*sql.TxOptions) error

func (*Dao) Update

func (dao *Dao) Update(update *wrapper.Update) (int64, error)

func (*Dao) Where

func (dao *Dao) Where(wrapper *wrapper.Query) *gorm.DB

Jump to

Keyboard shortcuts

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