[go-nuts] Re: Golang, SQL and ORM avoidance techniques

2017-06-07 Thread Tieson Molly
I had the same line of thinking regarding avoiding an ORM. I settled on using sqlx for my project. On Friday, June 2, 2017 at 8:55:12 AM UTC-4, brylant wrote: > > > I've been trying hard (well.. as much as I can considering my lack of > in-depth go knowledge or - to be perfectly honest - lack

[go-nuts] Re: Golang, SQL and ORM avoidance techniques

2017-06-06 Thread Ren Thraysk
On Tuesday, 6 June 2017 13:46:58 UTC+1, venturestre...@gmail.com wrote: > > On a complete tangent, are you calling a stored procedure there? I thought > the database/sql package didn't support MySQL stored procedures yet? > Haven't encountered a serious issue, as yet. Obviously output paramete

[go-nuts] Re: Golang, SQL and ORM avoidance techniques

2017-06-06 Thread venturestreamtemporary
On a complete tangent, are you calling a stored procedure there? I thought the database/sql package didn't support MySQL stored procedures yet? On Monday, June 5, 2017 at 5:43:33 PM UTC+1, Ren Thraysk wrote: > > > Wrote something similar recently. > > One difference is that I moved the rows.Scan

[go-nuts] Re: Golang, SQL and ORM avoidance techniques

2017-06-05 Thread Ren Thraysk
Wrote something similar recently. One difference is that I moved the rows.Scan call into the passed in function. type Scannable interface { Scan(...interface{}) error } func scanIntoUser(u *store.User) func(s Scannable) error { return func(s Scannable) error { return s.Scan(&u.Id, &u.Name

[go-nuts] Re: Golang, SQL and ORM avoidance techniques

2017-06-04 Thread 'Niko Schwarz' via golang-nuts
There's no great trick, but there are some general ideas you should be aware of. - Active Record Pattern - Database normalization - The Google way of storing data: Cloud Spanner

[go-nuts] Re: Golang, SQL and ORM avoidance techniques

2017-06-03 Thread silviucapota
Hi Adam, Back in 2014 I had the same driving motives like you and I ended up writing my own generator for Postgres (to deal with tables, views, and functions, for the basic types): https://github.com/silviucm/pgtogogen https://www.cmscomputing.com/articles/programming/generate-go-entities-from-