21stio
(21stio)
September 11, 2016, 1:27pm
1
Hey,
I am new to the Go community and asking myself if there is something like a sql adapter that supports multiple backends?
Something I can reconfigure it in different environments by injecting environment variables. An equivalent in the node.js world would be Knex .
Thanks
The standard package database/sql
comes with a list of database drivers . If the standard sql
package is too bare-bone for your taste, try sqlx , or look here and here for inspiration.
1 Like
21stio
(21stio)
September 12, 2016, 9:55am
3
Okay, but wouldn’t a “true” sql adapter wrap the queries instead of accepting pure sql to make sure it works with all backends?
radovskyb
(Benjamin Radovsky)
September 12, 2016, 12:04pm
4
Hey @21stio ,
I think you might be looking for something like gorm
: https://github.com/jinzhu/gorm .
Here’s it’s guide: http://jinzhu.me/gorm/ .
2 Likes
21stio
(21stio)
September 12, 2016, 12:39pm
5
Hey @radovskyb ,
thanks, that’s exactly what I was looking for… It seems like it also enables repository / data mapping… Really cool, thank a lot!
radovskyb
(Benjamin Radovsky)
September 12, 2016, 12:44pm
6
No worries, glad to help and also welcome to the Go community
21stio
(21stio)
September 12, 2016, 12:54pm
7
Thanks a lot, seems to be an awesome community! I am really looking forward to get the first project into production
1 Like
system
(system)
Closed
December 11, 2016, 12:54pm
8
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.