This is a creation in Article, where the information may have evolved or changed.
Recently infatuated with Go language, have a special affection to go.
However, as a result of the development of PHP for a long time, just start with go to do web development a bit less accustomed to, perhaps the previous laravel framework of the eloquent ORM is too good, so, led to use go to do web development of a variety of non-adaptation.
So, looking for a similar ORM use, looking all over the go ecosystem, found a lot of well-known go orm, such as: Gorm, Xorm, SQLX, and so on, found that no one is my feel, in the experience of a variety of unpleasant to, a lesson from the bitter, I have a go orm, Goros E was born so.
Gorose, is a mini go ORM, can also be said to be Golang version of the Laravel eloquent, because like this feel, began to masturbate, after a week of femdom, first edition on the line to see the effect:
Gorose Linked Database
// 开启一个链接db := gorose.Open("这是数据库配置啊配置")// 执行完毕后关闭数据库 DBdefer db.Close()
Laravel-like simple query
db.Table("userinfo").First()
The parsed SQL is: select * from userinfo limit 1
is not very familiar with the feeling, the more familiar is still behind
Multi-Conditional chain query
db.Table("userinfo").Where("id","<",10).Order("id desc").Get()
The parsed SQL is:select * from userinfo where id<10 order by id desc
Native query
db.Query("select * from userinfo")db.Query("select * from userinfo where id>?", 1)
is not PHP orm feel back again, yes, not only that, eloquent most of the usage, can be used directly here, more usage
- Please look at Github.com/gohouse/gorose.
- Or click Join QQ Group: 470809220 slowly tease ~ ~ ~
Powered by Fizzday (Week VIII)