News for hackers. Stuff that matters.
Re:Toyorm – ORM for Go by astockwell on Monday April 02, 2018 @12:28AM (#16732339)
Yes yes and yes. Unless the usecase is truly as simple as CRUD with a single model (in which case I reach for gorm), The easiest road often seems to be just using sqlx and hand-writing the inserts/updates.
Re:Toyorm – ORM for Go by swah on Monday April 02, 2018 @04:54PM (#16739187)
What about 90% of cases being simple CRUD and 10% you just do the usual "raw SQL query"?

I've chosen this path of using only sqlx on my current work project (only me) and regret it, because so much typing..

Re:Toyorm – ORM for Go by bm1362 on Monday April 02, 2018 @06:02PM (#16739810)
I also work alone on a Go service and have some complex models. I used Gorm and then for complex selects broke out the raw sql. It works okay, I’m still having to bolt on things like OCC and Versioning to my models. I’m glad I used it though- it gave me a solid foundation to work off and replace the bits that don’t quite work well.
Re:Toyorm – ORM for Go by kemitche on Monday April 02, 2018 @07:17PM (#16740348)
I use Masterminds' squirrel library to build up queries which cuts down on the amount of hand written SQL I need.
Re:Toyorm – ORM for Go by bigpigeon on Monday April 02, 2018 @12:34AM (#16732361)
toyorm support half hand-writing you can bind the model and use its field in sql e.g https://github.com/bigpigeon/toyorm/blob/master/examples/sim...