mdb

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbConf

type DbConf struct {
	Host        string `json:"host"`
	DataBase    string `json:"dataBase"`
	User        string `json:"user"`
	Password    string `json:"password"`
	DbName      string `json:"dbName"`
	MaxTime     int    `json:"maxTime"`
	MaxOpenConn int    `json:"maxOpenConn"`
	MaxIdlConn  int    `json:"maxIdlConn"`
}

type DbParam

type DbParam struct {
	Table    string
	LimitStr string
	WhereStr string
	OrderStr string
	ExpStr   string
	// contains filtered or unexported fields
}

type H

type H map[string]interface{}

type MDB

type MDB struct {
	Fd    *sqlx.DB
	Conf  *DbConf
	Param DbParam
}

func NewDb

func NewDb(tb string, name string) (ret *MDB)

func (*MDB) Add

func (this *MDB) Add(par map[string]interface{}) (rt int64, _err error)

func (*MDB) All

func (this *MDB) All() (data []map[string]interface{}, rt error)

func (*MDB) Begin

func (this *MDB) Begin() (tx *sqlx.Tx)

func (*MDB) Count

func (this *MDB) Count() (c int)

func (*MDB) Del

func (this *MDB) Del() (e error)

func (*MDB) Exp

func (this *MDB) Exp(par string) (ret *MDB)

func (*MDB) Limit

func (this *MDB) Limit(page int, count int) (ret *MDB)

func (*MDB) Map

func (this *MDB) Map(data []map[string]interface{}, key string, fun func(data map[string]interface{}) (r map[string]interface{}))

func (*MDB) One

func (this *MDB) One() (data map[string]interface{}, rt error)

func (*MDB) Order

func (this *MDB) Order(par H) (ret *MDB)

func (*MDB) Update

func (this *MDB) Update(par map[string]interface{}) (e error)

func (*MDB) Where

func (this *MDB) Where(par H) (ret *MDB)

func (*MDB) WhereEx

func (this *MDB) WhereEx(par map[string]zmf.WHVAL) (ret *MDB)

func (*MDB) WhereOr

func (this *MDB) WhereOr(par H) (ret *MDB)

Jump to

Keyboard shortcuts

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