Documentation ¶
Index ¶
- type Mysql
- func (t *Mysql) Close()
- func (t *Mysql) Connect()
- func (t *Mysql) GetList(sql string, args ...interface{}) (results [](map[string]string), count int)
- func (t *Mysql) GetOne(sql string, args ...interface{}) (result map[string]string, has bool)
- func (t *Mysql) Insert(tablename string, insertsql map[string]interface{}) int64
- func (t *Mysql) Inserts(tablename string, insertsql []map[string]interface{}) int64
- func (t *Mysql) Join(arr []string) string
- func (t *Mysql) Q(query string, args ...interface{}) (sql.Result, error)
- func (t *Mysql) Update(tablename string, setsql map[string]interface{}, ...) int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mysql ¶
func (*Mysql) Insert ¶
insertarr := make(map[string]interface{}, 0) insertarr["link_id"] = 9876543 re := G.Mysql.Insert("cstock_jilu", insertarr) fmt.Println(re)
func (*Mysql) Inserts ¶
insertarrs := make([]map[string]interface{}, 0)
for i := 0; i < 100; i++ { item := make(map[string]interface{}, 0) item["link_id"] = 9876543 + i insertarrs = append(insertarrs, item) }
re := G.Mysql.Inserts("cstock_jilu", insertarrs) fmt.Println(re)
func (*Mysql) Update ¶
func (t *Mysql) Update(tablename string, setsql map[string]interface{}, wheresql map[string]interface{}) int64
updatearr := make(map[string]interface{}, 0) updatearr["newjine"] = 12 wherearr := make(map[string]interface{}, 0) wherearr["cjid"] = 99999 G.Mysql.Update("cstock_jilu", updatearr, wherearr)
Click to show internal directories.
Click to hide internal directories.