SQL Database Adapter

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

Okay, but wouldn’t a “true” sql adapter wrap the queries instead of accepting pure sql to make sure it works with all backends?

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

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! :slight_smile:

No worries, glad to help and also welcome to the Go community :slight_smile:

Thanks a lot, seems to be an awesome community! I am really looking forward to get the first project into production :slight_smile:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.