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.
> Does Golang have some hidden ... feature No.
Macaron: a high productive and modular web framework in Go
31–40 of 52 posts
Re: Macaron: a high productive and modular web framework in Go
#32I 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'm no expert, but I think for ORM like you're referring to, the language would need features like generics, which Go doesn't have and may never have. At best there would be a code generator which would allow you to write your stuff in a higher-level language which would generate compilable and efficient Go code in turn.
So you definitely could implement an ORM in go without code generation - it's almost certainly been done.
Re: Macaron: a high productive and modular web framework in Go
#33I 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.
Re: Macaron: a high productive and modular web framework in Go
#34Starting to feel like Go is suffering from a glut of web frameworks.
Re: Macaron: a high productive and modular web framework in Go
#35Starting to feel like Go is suffering from a glut of web frameworks.
See PHP and JavaScript.
The languages that don't have all the web stuff built in tend to have a single dominant framework.
Re: Macaron: a high productive and modular web framework in Go
#36I 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.
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 things. Right now we seem to be at and awkward hump of complexity where every new DB binding ends up implementing their own object mapping, increasing everyone's complexity, overhead, and decreasing reusability of code; refmt will hopefully represent a break from that.
Re: Macaron: a high productive and modular web framework in Go
#37Re: Macaron: a high productive and modular web framework in Go
#38Earlier 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.
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
#39Starting to feel like Go is suffering from a glut of web frameworks.
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
#40A Django project can't use less than 100mb of memory because of Python. Gogs is a full github clone which uses 5-10mb on average. When you're trying to run something self-hosted it's super valuable that you don't need a huge server(i.e. $$$) just to make it responsive which helps make self-hosting make sense economically.