gorpGo 语言 ORM 框架
一个Go语言的ORM框架,目前支持MySQL、PostgresSQL和SQLite
一个使用示例:
// Define a type for your join // It *must* contain all the columns in your SELECT statement // // The names here should match the aliased column names you specify // in your SQL - no additional binding work required. simple. // type InvoicePersonView struct { InvoiceId int64 PersonId int64 Memo string FName string } // Create some rows p1 := &Person{0, 0, 0, "bob", "smith"} dbmap.Insert(p1) // notice how we can wire up p1.Id to the invoice easily inv1 := &Invoice{0, 0, 0, "xmas order", p1.Id} dbmap.Insert(inv1) // Run your query query := "select i.Id InvoiceId, p.Id PersonId, i.Memo, p.FName " + "from invoice_test i, person_test p " + "where i.PersonId = p.Id" list, err := dbmap.Select(InvoicePersonView{}, query) // this should test true expected := &InvoicePersonView{inv1.Id, p1.Id, inv1.Memo, p1.FName} if reflect.DeepEqual(list[0], expected) { fmt.Println("Woot! My join worked!") }
评论
GoORMGo 语言的 ORM 框架
GoORM是GoogleGo语言的ORM框架,它映射数据库记录到Go的结构体。特点是轻量级。示例代码:varbobs[]Personerr:=orm.GetAll(&bobs,"name=?"
GoORMGo 语言的 ORM 框架
0
EntityD 语言的 ORM 框架
Entity是D语言(DLang)数据库操作ORM框架,设计参照javaxJPA实现,具有很好的扩展性和规范性,数据库驱动依赖HuntLabs开发的databasefordlang。特性实现了完整的C
EntityD 语言的 ORM 框架
0
GoRoseGo 语言的 ORM 框架
gorose是一个golangorm框架,借鉴自laravel的eloquent.gorose2.0采用模块化架构,通过interface的api通信,严格的上层依赖下层.每一个模块都可以拆卸,甚至可
GoRoseGo 语言的 ORM 框架
0
HibernateDD 语言的 ORM 框架
HibernateD是D语言的ORM框架,类似Java的Hibernate,示例代码:import hibernated.core;// Annotations of entity classescl
HibernateDD 语言的 ORM 框架
0
SqlFlyJava ORM 框架
SqlFly是一个好用的Java语言orm框架。特点对内将jdbc繁琐步骤进行封装,并对外提供简洁好用的API自动将查询结果集映射到实体类中,可以让你完全脱离对ResultSet的操作,贴心省事内置了
SqlFlyJava ORM 框架
0