1
0
mirror of https://github.com/gogf/gf.git synced 2025-04-05 11:18:50 +08:00
gf/.example/database/gdb/mysql/issue364.go
2021-10-11 21:41:56 +08:00

35 lines
466 B
Go

package main
import (
"github.com/gogf/gf/v2/frame/g"
"time"
)
func test1() {
db := g.DB()
db.SetDebug(true)
time.Sleep(1 * time.Minute)
r, e := db.Model("test").Where("id", 10000).Count()
if e != nil {
panic(e)
}
g.Dump(r)
}
func test2() {
db := g.DB()
db.SetDebug(true)
dao := db.Model("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()
}