DEV Community

Discussion on: How I Built an API with Mux, Go, PostgreSQL, and GORM

Collapse
 
umakanthdiwakar profile image
Umakanthan D

Nice article. GO/Postgres is the technology which we use to develop microservices in our organization. Choice here was on chi framework, due to its native support for GO context (available from GO 1.7) and for Postgres we use pgx for its ultra-fast performance, able to snapshot a few thousand records in a second or so. But then pgx is more of a low-level API resulting in a lot of boiler-plate code. We developed a pgx GO code generator to automate developing all the database access code. We recently opened up the generator code at github.com/umakanthdiwakar/pgx-daogen. It basically generates the entire database access code by reading the metadata from Postgres catalog schema. In a way encourages database first development, but saves a lot of effort. Generated code is pure GO and pgx, with no dependency on our library.