News for hackers. Stuff that matters.
Re:What ORMs Have Taught Me: Just Learn SQL (2014) by Dave3of5 on Wednesday October 21, 2020 @04:56AM (#24845994)
Just a friendly reminder to anyone reading this about v1 of GORM. It doesn't properly support JOINS:

https://github.com/go-gorm/gorm/issues/1436

Note that there is some work for v2 in allowing users to create JOIN queries but without JOIN support it's effectively unusable in anything other than very small databases.

Re:What ORMs Have Taught Me: Just Learn SQL (2014) by giantDinosaur on Wednesday October 21, 2020 @05:26AM (#24846122)
wait, what? doesn't support joins? Things like this make me doubt my fundamentals. 'Are joins really necessary?' is the question now running through my mind ;-)
Re:What ORMs Have Taught Me: Just Learn SQL (2014) by Dave3of5 on Wednesday October 21, 2020 @05:48AM (#24846209)
It does not support joins. The expectation is that you "Preload" your data which is a fancy way of saying load it all into memory. The performance of this is trash so don't use that ORM there are a few better ORMs for GO mentioned in the issue.

Yes joins are really necessary in SQL they are a foundational part of using any relational database.

Re:What ORMs Have Taught Me: Just Learn SQL (2014) by giantDinosaur on Wednesday October 21, 2020 @06:24AM (#24846387)
Yes, they're literally the second thing one learns about SQL, really. I'm not being too serious about rethinking whether they're necessary, to be clear!

What a strange design decision though. I don't really understand why it is doing this? Why would anyone really think it's a good idea?

Re:What ORMs Have Taught Me: Just Learn SQL (2014) by Dave3of5 on Wednesday October 21, 2020 @07:00AM (#24846565)
> I'm not being too serious about rethinking whether they're necessary, to be clear!

My apologies if I came off condescending, it's hard to impart tone of voice in text.

> I don't really understand why it is doing this?

I think it's because it makes the SQL Generation harder. I think the lib at the moment is simply a search and replace on a bunch of SQL strings.

Re:What ORMs Have Taught Me: Just Learn SQL (2014) by henvic on Thursday October 22, 2020 @05:54PM (#24863713)
Thankfully my team is making the switch from gorm to vanilla SQL. I joined the company a little over one year ago on another team that also uses it, and using gorm turned out to be a really pain. It was the first time I had to use an ORM, and I really disliked the experience & constant source of issues.