News for hackers. Stuff that matters.
Re:Back to basics: Writing an application using Go and Postg... by henvic on Monday November 22, 2021 @09:04PM (#29313829)
Thanks! I love the concept of sqlc, but their support for pgx with its native PostgreSQL interface was quite limited when I checked. I imagine it's better nowadays, and will try again soon!
Re:Back to basics: Writing an application using Go and Postg... by sa46 on Monday November 22, 2021 @10:18PM (#29314243)
You might like pggen (I’m the author) which only supports Postgres and pgx. https://github.com/jschaf/pggen

pggen occupies the same design space as sqlc but the implementations are quite different. Sqlc figures out the query types using type inference in Go which is nice because you don’t need Postgres at build time. Pggen asks Postgres what the query types are which is nice because it works with any extensions and arbitrarily complex queries.

Re:Back to basics: Writing an application using Go and Postg... by henvic on Monday November 22, 2021 @10:55PM (#29314427)
Thank you. I'll take a look in the upcoming weeks. It seems promising!
Re:Back to basics: Writing an application using Go and Postg... by lonk11 on Monday November 22, 2021 @10:46PM (#29314373)
The support for native pgx in sqlc is good now. I migrated my project from database/sql to pgx recently and posted the instructions at the end of this post: https://linklonk.com/item/1948319982853095424