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

18 lines
292 B
Go

package main
import (
"fmt"
"github.com/gogf/gf/v2/frame/g"
)
func main() {
g.Config().SetFileName("config2.toml")
if r, err := g.DB().Model("user").Where("uid=?", 1).One(); err == nil {
fmt.Println(r["uid"].Int())
fmt.Println(r["name"].String())
} else {
fmt.Println(err)
}
}