mysql

package
v0.0.0-...-325abe0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchInsert

func BatchInsert(obj Domain, objs []interface{}) error

func Close

func Close(conn sqlbuilder.Database, tx sqlbuilder.Tx)

func Generate

func Generate(savePath string, tables []string) error

func GetConnect

func GetConnect() (sqlbuilder.Database, error)

func GetFileSplit

func GetFileSplit() string

func Insert

func Insert(obj Domain) error

func IsExistByCond

func IsExistByCond(table string, cond db.Cond) (bool, error)

func Rollback

func Rollback(tx sqlbuilder.Tx)

func SelectAllByCond

func SelectAllByCond(table string, cond db.Cond, objs interface{}) error

func SelectAllByCondWithNumAndOrder

func SelectAllByCondWithNumAndOrder(table string, cond db.Cond, union *db.Union, page int, size int, order interface{}, objs interface{}) error

func SelectAllByCondWithPageAndOrder

func SelectAllByCondWithPageAndOrder(table string, cond db.Cond, union *db.Union, page int, size int, order interface{}, objs interface{}) (uint64, error)

func SelectById

func SelectById(table string, id interface{}, obj interface{}) error

func SelectByQuery

func SelectByQuery(query string, objs interface{}, args ...interface{}) error

func SelectCountByCond

func SelectCountByCond(table string, cond db.Cond) (uint64, error)

func SelectOneByCond

func SelectOneByCond(table string, cond db.Cond, obj interface{}) error

func TransBatchInsert

func TransBatchInsert(tx sqlbuilder.Tx, obj Domain, objs []interface{}) error

func TransInsert

func TransInsert(tx sqlbuilder.Tx, obj Domain) error

func TransUpdate

func TransUpdate(tx sqlbuilder.Tx, obj Domain) error

func TransUpdateSmart

func TransUpdateSmart(tx sqlbuilder.Tx, table string, id int64, upd Upd) error

func TransUpdateSmartWithCond

func TransUpdateSmartWithCond(tx sqlbuilder.Tx, table string, cond db.Cond, upd Upd) (int64, error)

func TransX

func TransX(txFunc func(tx sqlbuilder.Tx) error) error

func Update

func Update(obj Domain) error

func UpdateSmart

func UpdateSmart(table string, id int64, upd Upd) error

func UpdateSmartWithCond

func UpdateSmartWithCond(table string, cond db.Cond, upd Upd) (int64, error)

Types

type Domain

type Domain interface {
	TableName() string
}

type Upd

type Upd map[string]interface{}

Jump to

Keyboard shortcuts

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