gf/.example/database/gdb/mysql/gdb_pool.go

23 lines
284 B
Go
Raw Normal View History

package main
import (
2019-04-03 00:03:46 +08:00
"time"
2019-07-29 21:01:19 +08:00
"github.com/gogf/gf/frame/g"
)
func main() {
2019-04-03 00:03:46 +08:00
db := g.DB()
2019-04-03 00:03:46 +08:00
// 开启调试模式以便于记录所有执行的SQL
db.SetDebug(true)
2019-04-03 00:03:46 +08:00
for {
for i := 0; i < 10; i++ {
go db.Table("user").All()
}
time.Sleep(time.Millisecond * 100)
2019-04-03 00:03:46 +08:00
}
2019-04-03 00:03:46 +08:00
}