Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
https://github.com/kyleconroy/sqlc will generate Go structs for inputs & outputs of Postgres queries, that'll get you type safety.
Hi fellow Gophers, I have a question involving both (Postgre-) SQL and Go. For a hobby project, I so far have used plain SQL with some additional filtering logic and pgx to to retrieve rows and mapped these rows to structs manually. This worked quite well as the types were rather simple and only involved 1-3 SQL tables.However, I now do have a more complex struct type with 10 underlying SQL tables including some nested structs and slices. I feel that my prior strategy of plain SQL query strings doesn't scale to retrieve data from the SQL DB even for this moderatly complex struct type.
Check https://github.com/go-jet/jet. It supports arbitrary nested structs. Also it works well with pgx, as a driver.
bun and go-pg both seem to work fairly well for these kind of purposes.
bun and go-pg both seem to work fairly well for these kind of purposes.
didn’t know jet, any major difference with https://github.com/volatiletech/sqlboiler?
I like to use pgxscan from https://github.com/georgysavva/scany
https://github.com/avelino/awesome-go is good place to start.