go语言的ORM框架 GoORM

fmms 12年前

GoORM 是 Google Go 语言的 ORM 框架,它映射数据库记录到 Go 的结构体。特点是轻量级。

示例代码:

var person1 Person  orm.Get(&person1, "id = ?", 3)    var person2 Person  orm.Get(&person2, 3) // this is shorthand for the version above    var person3 Person  orm.Get(&person3, "name = ?", "john") // more complex query    var person4 Person  orm.Get(&person4, "name = ? and age < ?", "john", 88) // even more complex

项目主页:http://www.open-open.com/lib/view/home/1335796473624