Live data from Hacker News

Macaron: a high productive and modular web framework in Go

go-macaron.com

11–20 of 52 posts

Re: Macaron: a high productive and modular web framework in Go

#12
post #8
post #2

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.

What about https://github.com/go-xorm/xorm ?

Re: Macaron: a high productive and modular web framework in Go

#13
post #10
post #8

Earlier 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.

Did you had a look at sqlx? [1] Granted, it won't generate the queries for you - but parsing into structs works 95% of time without additional mapping for me. Coming from other languages I also found the amount of necessary typing a bit disturbing first. But then you can actually read code instead of orm framework documentation, issue trackers and workarounds. [1] http://jmoiron.github.io/sqlx/

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 30 entities in your model.

Re: Macaron: a high productive and modular web framework in Go

#14
post #2

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.

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.

Re: Macaron: a high productive and modular web framework in Go

#15
post #8

Earlier 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.

What about https://github.com/go-xorm/xorm ?

Thanks for the link, i didn't know about it. From what i see from the documentation (which looks pretty sparse) it doesn't implement lazy loading or any kind of mapping between SQL relation (1-n , n-n) to and from the go structs, so i guess it's pretty far from any of today's standard.

Re: Macaron: a high productive and modular web framework in Go

#16
post #15

Earlier quoted context omitted.

What about https://github.com/go-xorm/xorm ?

Thanks for the link, i didn't know about it. From what i see from the documentation (which looks pretty sparse) it doesn't implement lazy loading or any kind of mapping between SQL relation (1-n , n-n) to and from the go structs, so i guess it's pretty far from any of today's standard.

I've used https://github.com/jinzhu/gorm with Go, and it's ok. Sometimes I just use https://github.com/Masterminds/squirrel or https://github.com/elgris/sqrl with database/sql or https://github.com/jmoiron/sqlx

Re: Macaron: a high productive and modular web framework in Go

#17
post #9
post #2

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.

There is no ORM like feature anywhere that makes complex persistence easy.

Sorry if that was a snarky reply. I have a deep hatred of ORMs.

In the past I've had great success with XO, which will generate Go code from an existing DB Schema:

https://github.com/knq/xo

It's really very good!

Re: Macaron: a high productive and modular web framework in Go

#20
post #2

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.

I'm learning Django after playing with Go and webapps just to see how much easier can some things be...
Post reply on HN