I've used most of the Go code generated ORMs and would have to say Ent is now my go-to for new projects. It works really nicely with gqlgen, handles permissions, and does eager loading.
Lol. Started development on the API for my new app and was looking for an ORM, found gorm first and then switched to ent just a few days ago. Suddenly it appears on hackernews.
I can really recommend it. It's been nothing but a pleasure. Only criticism would be the following: if you have a structure named ent/schema/*.go at the root of your project like they recommend, the code it generates lands in ent/
This isn't always great because it bloats the folder quite a bit. A separate folder for the generated code would be terrific.
There have been tons of discussions and proposals regarding error handling boilerplate [0][1], and the general consensus is that go developers like the explicitness of `if err != nil` and just want to leave it be [2]
9 comments
[ 1.2 ms ] story [ 22.6 ms ] threadI can really recommend it. It's been nothing but a pleasure. Only criticism would be the following: if you have a structure named ent/schema/*.go at the root of your project like they recommend, the code it generates lands in ent/ This isn't always great because it bloats the folder quite a bit. A separate folder for the generated code would be terrific.
if err != nil { log.Fatal(err) }
In C# I can just log error on one place and transaction will be automatically rolled back. Much less code.
[0]: https://github.com/golang/go/issues/32437 [1]: https://github.com/golang/go/issues/32804 [2]: https://github.com/golang/go/issues/32825