mirror of
https://github.com/gogf/gf.git
synced 2025-04-05 11:18:50 +08:00
27 lines
359 B
Go
27 lines
359 B
Go
package main
|
||
|
||
import (
|
||
"github.com/gogf/gf/v2/os/gctx"
|
||
"time"
|
||
|
||
"github.com/gogf/gf/v2/frame/g"
|
||
)
|
||
|
||
func main() {
|
||
var (
|
||
db = g.DB()
|
||
ctx = gctx.New()
|
||
)
|
||
|
||
// 开启调试模式,以便于记录所有执行的SQL
|
||
db.SetDebug(true)
|
||
|
||
for {
|
||
for i := 0; i < 10; i++ {
|
||
go db.Ctx(ctx).Model("user").All()
|
||
}
|
||
time.Sleep(time.Millisecond * 100)
|
||
}
|
||
|
||
}
|