Re:What ORMs Have Taught Me: Just Learn SQL (2014)
by vptr on Wednesday October 21, 2020 @12:29PM
(#24849386)
Depending on which DB you're using, I'd suggest trying out https://sqlc.dev instead of gorm if on PG. Mysql support is a bit flaky last time I checked.
I'm reluctant to go to straight SQL because then I have to:
- Write a ton of 'mapping' code between resultsets and data model
- Do a lot of diffing to determine which relations to add, update or remove
- Manage my own database migrations - challenging because I'm stuck with using sqlite
- etc
I want my tools to make things easier for me, but gorm seems to be the "now you have two problems" direction - for now. Maybe I just don't get it yet. Maybe I just don't get databases anymore either.