pgx
pgx copied to clipboard
Where can I find docs?
The documentation seems very limited and you have to look through all the source files!?
How to use connection pool and do prepared statements yourself? I need full control over the prepared statements
Should also support context :)
The documentation seems very limited and you have to look through all the source files!?
As is typical with Go projects there is a link to the docs at the top of the README.md.
How to use connection pool and do prepared statements yourself? I need full control over the prepared statements
Use https://pkg.go.dev/github.com/jackc/pgx/v5#Conn.Prepare to prepare statements in a AfterConnect hook to have them registered on all connections managed by a connection pool.
Should also support context :)
It does...
FWIW, I think that context usage is underdocumented. For example: https://pkg.go.dev/github.com/jackc/pgx/[email protected]/pgxpool#New What canceling that context would do? Close all connections in the pool? Cancel the initial connection attempt only? Nothing? Most examples using context.Background()
do not help.
@jackc I've read the documentation available on pkg.go.dev and saying it's under-documented would be an understatement. Consider working on a documentation site or rewriting the documentation already available on pkg.go.dev and github. Right now, it's the major pain point of this project. Very poorly documented.
@JARI-Y Feel free to open a PR to add better documentation or consider supporting @jackc trough a donation.
Thanks @jackc for all the work you already did.
https://www.youtube.com/watch?v=R6S-b_k-ZKY&t=136s