beego orm操作mysql数据库

package main  
import (  
    "fmt"
    "github.com/astaxie/beego/orm"
    _ "github.com/go-sql-driver/mysql"
)

type User struct {  
    Id   int
    Name string `orm:"size(100)"`
}

func init() {  
    orm.RegisterDataBase("default", "mysql",
        "user:pass@tcp(127.0.0.1:3306)/TEST?charset=utf8", 30)
    orm.RegisterModel(new(User))
    orm.RunSyncdb("default", false, true)
}

func main() {  
    orm.Debug = true
    o := orm.NewOrm()
    user := User{Name: "aaa"}
    id, err := o.Insert(&user)
    fmt.Printf("ID: %d, ERR: %v\n", id, err)

    user1 := User{Name: "bbb"}
    id, err3 := o.Insert(&user1)
    fmt.Printf("ID: %d, ERR: %v\n", id, err3)

    user2 := User{Name: "ccc"}
    id, err4 := o.Insert(&user2)
    fmt.Printf("ID: %d, ERR: %v\n", id, err4)

    user3 := User{Name: "ddd"}
    id, err5 := o.Insert(&user3)
    fmt.Printf("ID: %d, ERR: %v\n", id, err5)

    user.Name = "eee"
    num, err6 := o.Update(&user)
    fmt.Printf("NUM: %d, ERR: %v\n", num, err6)

    u := User{Id: user.Id}
    err1 := o.Read(&u)
    fmt.Printf("ERR: %v\n", err1)

    num, err2 := o.Delete(&u)
    fmt.Printf("NUM: %d, ERR: %v\n", num, err2)
}