Re:Ask HN: Which stack do you use at your startup?
by swah on Friday February 16, 2018 @07:52AM
(#16391958)
I usually do the same, or even just sqlx. But then wish I had gone full-ORM when I have to change SQL code in 50 places due to a column rename...
Re:Ask HN: Which stack do you use at your startup?
by majewsky on Sunday February 18, 2018 @10:00AM
(#16406339)
I'm struggling to think of instances where you would want to rename a column without changing the behavior of the column. The latter would mean that you have to review those 50 places anyway.
Furthermore, Go emphasizes "doing it your own way". There are no big web frameworks in Go, you just pull in some small and rather orthogonal libraries and make up your own abstractions to tie them together as you build your application. The end result is something that's highly optimized for your personal needs, but it requires a certain way of thinking and working that's not for everyone (and not always desirable). Some people do better when given more freedom; those should prefer Go etc. Some people do better when working within a well-known set of rules; those should prefer Rails etc.
Regarding ORM, I use Gorp (https://github.com/go-gorp/gorp) for INSERT, UPDATE, DELETE and basic SELECTs (e.g `SELECT * FROM things WHERE id = $1`), but when doing complex reports, I write SQL by hand [1] because ORMs are usually too constrained. I always feel like I know more SQL than the people who designed the ORM.
[1] For example: https://github.com/sapcc/limes/blob/ab4245a8f195672b808f990f...