mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 21:28:22 +08:00
26 lines
335 B
Go
26 lines
335 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/frame/g"
|
|
)
|
|
|
|
func main() {
|
|
db := g.DB()
|
|
db.SetDebug(true)
|
|
|
|
tables, e := db.Tables()
|
|
if e != nil {
|
|
panic(e)
|
|
}
|
|
if tables != nil {
|
|
g.Dump(tables)
|
|
for _, table := range tables {
|
|
fields, err := db.TableFields(table)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
g.Dump(fields)
|
|
}
|
|
}
|
|
}
|