by jchw · 3y ago · 0 comments
Every time I see SQL and Go stuff, I feel literally obligated to introduce people to sqlc. That said, sqlc only has good support for PostgreSQL, and you'd have to generate code for each dialect... so that's something worth considering. (I still find it to be one of my favorite SQL tools, even with its issues.)
In general, sqlc is very nice to use. It works well out of the box with a standard config. You can also override a lot of things.
One of the nice extras about sqlc is that it doesn't feel like a real dependency.
You don't actually include sqlc anywhere. You just use a config and the cli to generate Go code that relies on the std library. The generated code is very straight forward std Go code that you could write by hand.
A couple of reasons to use Go in a project would be great support for IO, stability, great tooling, low operational complexity and minimal dependencies. sqlc fits nicely in there.