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.
-
testcontainers-go
Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done.
-
korm
KORM, an elegant and lightning-fast ORM for all your concurrent and async needs. Inspired by the highly popular Django Framework, KORM offers similar functionality with the added bonus of performance
Honestly I think the code generation approach using sqlc is better these days than manually writing all of the DB code yourself or an ORM like GORM. You are writing the queries, and it's handling the boilerplate that you'd do anyway, and it's not using introspection but rather providing type safe functions and structures for your queries.
Have you seen my library https://github.com/bokwoon95/sq? You can use it like database/sql and write plain SQL strings, only needing to provide a function that maps an database row to a struct and generics returns a slice of those structs at the end.
Using something like TestContainers to spin up a DB for testing has been my best experience. Any mocks leave too much room for error imo
I wish there was a dapper equivalent in Go. I don't ever want a full blown ORM, nor do I want this query builder BS. I guess with generics we can approach something like dapper now.
Hi, you can check https://github.com/kamalshkeir/korm , this is my personal ORM , lot of people start using it and like it very much specialy those coming from django like environment, i would love to have your feedbacks
Related posts
- Is sqlx still the top choice for auto mapping database query results to a struct?
- The "preferred" way of mapping SQL results in Golang is honestly, subjectively, awful, how to deal with this
- goscanql - conveniently reading joined SQL data into structs
- Why SQL is right for Infrastructure Management
- Automatic CRUD code generetor?