Age int32 `xorm:" INT(8)"`
}
字段超多可以从数据库用xorm reverse出来结构,
或者直接querystring 得到map[string]string,想怎么处理都行。
另外,没太明白你要问什么。
session := engine.NewSession()defer session.Close()// add Begin() before any actionerr := session.Begin()user1 := Userinfo{Username: "xiaoxiao", Departname: "dev", Alias: "lunny", Created: time.Now()}_, err = session.Insert(&user1)if err != nil {session.Rollback()return}user2 := Userinfo{Username: "yyy"}_, err = session.Where("id = ?", 2).Update(&user2)if err != nil {session.Rollback()return} _, err = session.Exec("delete from userinfo where username = ?", user2.Username)if err != nil {session.Rollback()return} // add Commit() after all actionserr = session.Commit()if err != nil {return}欢迎分享,转载请注明来源:内存溢出
评论列表(0条)