improve configuration for gdb; add more unit test case for ghttp.Server

This commit is contained in:
John
2019-10-15 21:20:38 +08:00
parent b26330aee1
commit e1164e935b
9 changed files with 119 additions and 64 deletions

View File

@ -1,5 +1,6 @@
# MySQL数据库配置
[database]
link = "mysql:root:12345678@tcp(127.0.0.1:3306)/test"
debug = true
link = "mysql:root:12345678@tcp(127.0.0.1:3306)/test"

View File

@ -7,7 +7,7 @@ import (
func main() {
db := g.DB()
db.SetDebug(true)
//db.SetDebug(true)
type User struct {
Id int

View File

@ -0,0 +1,34 @@
package main
import (
"github.com/gogf/gf/frame/g"
"time"
)
func test1() {
db := g.DB()
db.SetDebug(true)
time.Sleep(1 * time.Minute)
r, e := db.Table("test").Where("id", 10000).Count()
if e != nil {
panic(e)
}
g.Dump(r)
}
func test2() {
db := g.DB()
db.SetDebug(true)
dao := db.Table("test").Safe()
time.Sleep(1 * time.Minute)
r, e := dao.Where("id", 10000).Count()
if e != nil {
panic(e)
}
g.Dump(r)
}
func main() {
test1()
test2()
}