func PrintTable(orm beedb.Model) { var users []User if err := orm.FindAll(&users); err != nil { panic(err) } fmt.Printf("%+v,", users) for _, user := range users { fmt.Printf("%+v,", user) } fmt.Println() }
func QueryRows2(db *sql.DB) { var orm beedb.Model var allCommands []Command beedb.PluralizeTableNames = true orm = beedb.New(db, "pg") beedb.OnDebug = true err := orm.FindAll(&allCommands) if err != nil { panic(err) } for i, command := range allCommands { fmt.Printf("row %d : %s %s\n", i, command.Path, command.Dir) } }
func QueryRows2(db *sql.DB) { var orm beedb.Model var allclones []Clone beedb.PluralizeTableNames = true orm = beedb.New(db, "pg") beedb.OnDebug = true err := orm.FindAll(&allclones) if err != nil { panic(err) } for i, clone := range allclones { fmt.Printf("row %d : %s %s\n", i, clone.Name, clone.Seq) } }