pgx icon indicating copy to clipboard operation
pgx copied to clipboard

Where can I find docs?

Open clarkk opened this issue 10 months ago • 4 comments

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 :)

clarkk avatar Aug 27 '23 08:08 clarkk

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.

Screenshot 2023-09-02 at 8 03 23 AM

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...

jackc avatar Sep 02 '23 13:09 jackc

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.

AlekSi avatar Sep 08 '23 12:09 AlekSi

@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 avatar Sep 28 '23 13:09 JARI-Y

@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

EJTJ3 avatar Oct 20 '23 11:10 EJTJ3