Jack Christensen
Jack Christensen
Your query returns a column "id" but you don't have anywhere to scan it. Every column returned from a query must have a destination for the `RowToStruct*` functions.
https://pkg.go.dev/github.com/jackc/pgx/[email protected]/pgxpool#Stat.EmptyAcquireCount is how many acquires had to wait.
Seems reasonable.
You can use `ParseConfig("")`. Then nilify `Fallbacks` and set `Host`, `Port`, `Database`, `User`, `Password`, and `TLSConfig` directly.
The environment variables and other default values are all used during `ParseConfig`. You will be overwriting whatever they were.
I'm not opposed to this in principle, but it would definitely need some careful thought and consideration. And if something is to be done, it may also be worth revisiting...
```go ct, err := conn.Exec(ctx, "delete from widgets where foo = @foo and bar = @bar", pgx.NamedArgs{"foo": 1, "bar": 2}) ```
The issue might be the connection pool size. It appears the code is starting a new Go routine for every item -- depending on the nature of your workload this...
Do you have a test case I could see?
Perhaps try calling Acquire and then the query method on the conn instead of the query method directly on the pool. This will allow measuring the acquire and query time...