-
-
Couldn't load subscription status.
- Fork 953
Closed
Description
Hi! I'm working on sqld, a code generator that takes SQL queries and outputs type-safe Go code using pgx. I'm a big fan of pgx and if you have some time, I'd love to get your thoughts on the usage of pgx, especially around:
- Safe usage of the pgx APIs in the generated code (example/author/queries.sql.go).
- Possible collaboration on a future ClientTrace API similar to the Go stdlib http tracing: https://blog.golang.org/http-tracing. There's a ton of useful metrics we could surface in pgx (DNS resolution for host names, response parse time, pool queue time). I've created an initial pgx-focused ClientTrace.go that I use in the generated code.
RFC: sqld: Go code generation for Postgres (Google doc)
To summarize, sqld takes a query like:
SELECT * FROM author where first_name = sqld.arg('FirstName');And generates:
func (q *DBQuerier) FindAuthors(ctx context.Context, firstName string) ([]Author, error) {}sqld is heavily inspired by sqlc. The main differences are sqld gets type information from Postgres directly and sqld uses pgx instead of the standard library sql types.
aight8 and zeroallox
Metadata
Metadata
Assignees
Labels
No labels