I quickly looked this over. Does Golang have some hidden ORM like feature that makes complex persistence easy? I spent the last three months working on a storage mechanism that controls all of CRUD at the document level across what is essentially Google Groups (each op is allowed to multiple groups). This is where web work is complex.
Came here to say the same thing. Go won't enter "crud webapp" market until they have a better story on relational db interactions. I'm afraid this is way beyond the current possibilities of the language as it offer barely any meta-programming technics, on purpose.
Macaron: a high productive and modular web framework in Go
41–50 of 52 posts
Re: Macaron: a high productive and modular web framework in Go
#42Starting to feel like Go is suffering from a glut of web frameworks.
This framework has been around forever and not really. Most people use the standard library unless they need better routing than the standard library provides. There are actually very few web frameworks that provide much other than a router in Go. Most of the frameworks are actually just packages that can be used for all sorts of things. e.g. Beego by astaxie
Re: Macaron: a high productive and modular web framework in Go
#43Earlier quoted context omitted.
Came here to say the same thing. Go won't enter "crud webapp" market until they have a better story on relational db interactions. I'm afraid this is way beyond the current possibilities of the language as it offer barely any meta-programming technics, on purpose.
None of the company I worked for had any ORM like in place and they were all doing crud app.
It could make sense in some context, and i'm pretty sure that any sufficiently advanced service has so many custom and optimized queries that an ORM doesn't make a difference.
however IMHO, ORMs do play a very important role in the beginning of the project when prototyping screens and apis, and when rapid iteration is important. It isn't a coincidence that RoR advertized active record as much, that symfony use doctrine in all tutorials, and that java , .net and node.js frameworks all include an ORM component.
Re: Macaron: a high productive and modular web framework in Go
#44Starting to feel like Go is suffering from a glut of web frameworks.
People are going to write code for multiple reason. You can't complain about people writing opensource code, you're not forced to use it.
Re: Macaron: a high productive and modular web framework in Go
#45Earlier quoted context omitted.
We use SQLalchemy at work and I would rather write queries by hand. A lot of that is because the documentation is a huge pain, but also because the object composition isn't intuitive. I've built a profile query builder in Go and it was pretty straight forward; I'm confident I could build an ORM in a couple of weeks.
sqlalchemy ( which i used and liked a lot) has multiple layers. query builder is the bottom one, but the most "challenging" one for go is probably the orm with things lazy loading and its parametrization ( such as eager loading of relationships). keeping it all type safe ( not having the user cast interface{} to struct everywhere) and performant would be a challenge.
Re: Macaron: a high productive and modular web framework in Go
#46I quickly looked this over. Does Golang have some hidden ORM like feature that makes complex persistence easy? I spent the last three months working on a storage mechanism that controls all of CRUD at the document level across what is essentially Google Groups (each op is allowed to multiple groups). This is where web work is complex.
I've been experimenting with a library called `refmt` which does the O bject M apping part, but explicitly not the R elational part. It's still experimental, but you might like it, and test coverage is shaping up nicely. The idea is by focusing completely on making Object Mapping consistent and powerfully customizable, and then composing that with either serialization formats or relational storage, we'll get good thi…
Re: Macaron: a high productive and modular web framework in Go
#47Starting to feel like Go is suffering from a glut of web frameworks.
Re: Macaron: a high productive and modular web framework in Go
#48Earlier quoted context omitted.
sqlx didn't work in my case last time i tried (don't remember why exactly), but it's still far from any standard like sqlalchemy (python), hibernate (java) , active records (ruby),entity framework (.net), doctrine (php) or bookshelf (js). Writing every select for every entity, with all the variations depending on whether you want to inner join with 1-n relationships (and which ones) is really tedious when you've got…
We use SQLalchemy at work and I would rather write queries by hand. A lot of that is because the documentation is a huge pain, but also because the object composition isn't intuitive. I've built a profile query builder in Go and it was pretty straight forward; I'm confident I could build an ORM in a couple of weeks.
Re: Macaron: a high productive and modular web framework in Go
#49Earlier quoted context omitted.
sqlalchemy ( which i used and liked a lot) has multiple layers. query builder is the bottom one, but the most "challenging" one for go is probably the orm with things lazy loading and its parametrization ( such as eager loading of relationships). keeping it all type safe ( not having the user cast interface{} to struct everywhere) and performant would be a challenge.
I'm not sure exactly what you mean about parameterization, but I suspect in general my notion of what an ORM is differs from yours (in particular, I don't assume lazy loading). Maybe what I'm thinking isn't appropriately called "ORM" (maybe "type relational mapping" is more appropriate?). At any rate, I don't think type safety should be a challenge (somehow a mapping must be generated for each type, just like SQLAlch…
anyway, it should make for a good exercise i'm sure.
as for the definition of Object-Relationnal-Mapper the idea is to completely abstract the fact that you're storing your object graph ( or struct graph in the case of go) in a relationnal database. To do so, the developper provides meta data , like an xml file or annotation, to describe the mapping. This is a pretty hard problem.
Re: Macaron: a high productive and modular web framework in Go
#50Macaron is awesome. It's used in Gogs and Gitea