model

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	Orm   *gorm.DB       `gorm:"-" json:"-"`
	Log   *logger.Helper `gorm:"-" json:"-"`
	Error error          `gorm:"-" json:"-"`
}

func (Model) Add

func (e Model) Add(model interface{}) (err error)

func (Model) Del

func (e Model) Del(model interface{}, conds string, params ...interface{}) (err error)

func (Model) Delete

func (e Model) Delete(model interface{}, condition ...func(db *gorm.DB) *gorm.DB) error

func (Model) DeleteByConds

func (e Model) DeleteByConds(model interface{}, params ...interface{}) error

func (Model) FindCount

func (e Model) FindCount(model interface{}, count *int64, condition ...func(db *gorm.DB) *gorm.DB) (err error)

func (Model) FindCountByConds

func (e Model) FindCountByConds(list interface{}, count *int64, conds string, params ...interface{}) error

func (Model) FindList

func (e Model) FindList(list interface{}, condition ...func(db *gorm.DB) *gorm.DB) (err error)

func (Model) FindListByConds

func (e Model) FindListByConds(model interface{}, conds string, params ...interface{}) (err error)

func (Model) FindOne

func (e Model) FindOne(model interface{}, condition ...func(db *gorm.DB) *gorm.DB) (err error)

func (Model) FindOneByConds

func (e Model) FindOneByConds(model interface{}, conds string, params ...interface{}) (err error)

func (Model) FindPage

func (e Model) FindPage(list interface{}, count *int64, condition ...func(db *gorm.DB) *gorm.DB) (err error)

func (Model) Mod

func (e Model) Mod(model interface{}) (err error)

func (Model) ModByConds

func (e Model) ModByConds(model interface{}, conds string, params ...interface{}) (err error)

func (Model) ModMap

func (e Model) ModMap(data interface{}, updates map[string]interface{}, condition ...func(db *gorm.DB) *gorm.DB) error

func (Model) Upsert

func (e Model) Upsert(data interface{}, conflictColumns ...string) error

func (Model) UpsertDoUpdate

func (e Model) UpsertDoUpdate(data interface{}, conflictColumns []string, doUpdates []string) error

Jump to

Keyboard shortcuts

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