News for hackers. Stuff that matters.
Re:Open-sourcing SQX, a way to build flexible database model... by jchw on Saturday September 02, 2023 @10:28AM (#37361824)
This does look like it's a little bit better than a lot of the other options in the Go ecosystem for database access, but this introduction misses something important: what SQL dialects does this support? It appears to be partly a wrapper around Squirrel. Squirrel is not new (and apparently also no longer being updated) but I actually have no idea which and how much of each SQL dialect Squirrel supports.

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.)

https://sqlc.dev/

Re:Open-sourcing SQX, a way to build flexible database model... by superb_dev on Saturday September 02, 2023 @12:56PM (#37363253)
SQLc is amazing, I think it should be the gold standard for SQL in Go
Re:Open-sourcing SQX, a way to build flexible database model... by resharpe105 on Saturday September 02, 2023 @03:31PM (#37364739)
I can atest to this. Sqlc is awesome.
Re:Open-sourcing SQX, a way to build flexible database model... by dgb23 on Saturday September 02, 2023 @04:12PM (#37365094)
I used sqlc with sqlite. The support seems fine there.

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.