Our great sponsors
-
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.
-
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.
Beyond that, as others have suggested, sqlx is very close to dapper in terms of functionality. It’s not generic, but generics don’t actually get you anything here except dapper will instantiate the types for you while with sqlx you have to do it yourself. Under the hood, both must use reflection to map fields.
Just my opinion, so it it for what it’s worth to you, but I haven’t been especially impressed with the ORM landscape in Go. I have tinkered with a few ORMs - I gave gorm a serious whirl a few months ago, but ended up ditching it in less than a month. If time is on your side, I’d strongly encourage you to experiment with what the standard library’s database/sql package has to offer.
Try https://github.com/ent/ent :D
Since you’re using postgres, I’d recommend sqlc if it fits your use case: https://github.com/kyleconroy/sqlc
If your schema/migrations are not part of the go project then it might not be a great fit. It does support pgx which is a huge advantage imo vs plain database/sql.
You might also consider https://github.com/nofeaturesonlybugs/sqlh as an alternative to sqlx.