fix issue in prefix feature for method operations of gdb

This commit is contained in:
John
2019-12-23 23:14:54 +08:00
parent 5db8851213
commit 597f7468e9
9 changed files with 180 additions and 72 deletions

View File

@ -1,7 +1,7 @@
# MySQL数据库配置
[database]
debug = true
# debug = true
link = "mysql:root:12345678@tcp(127.0.0.1:3306)/test?parseTime=true&loc=Local"
#[database]

View File

@ -1,8 +1,6 @@
package main
import (
"fmt"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/glog"
@ -23,7 +21,7 @@ func main() {
if err != nil {
panic(err)
}
db.SetDebug(true)
//db.SetDebug(false)
glog.SetPath("/tmp")
@ -36,7 +34,4 @@ func main() {
db.Table("user").Data(g.Map{"name": "smith"}).Where("uid=?", 1).Save()
db.PrintQueriedSqls()
fmt.Println(db.GetLastSql())
}

View File

@ -6,6 +6,7 @@ import (
func main() {
db := g.DB()
// 执行3条SQL查询
for i := 1; i <= 3; i++ {
db.Table("user").Where("id=?", i).One()