Closed jcalfee closed 1 year ago
Possible work-around: client.release = client.end
We only support PG clients from a PG pool. Please use a pool, like it says in the documentation:
https://www.graphile.org/postgraphile/usage-library/#api-postgraphilepgconfig-schemaname-options
You can create a pool with a max size of 1 and grab a client from that if you really want to.
I can see now how a max connection of 1 and the pool, instead of the client, can help standardize the code. I just did not see that up-front when I wrote a transactional unit testing libraray..
And, the way I triggered this error was using the createPostGraphileSchema pgConfig documentation "If you already have a client or pool instance, when using this function you may also pass a pg client or a pg-pool instance directly instead of a config." (about https://github.com/graphile/postgraphile/issues/1723)
So, I'll use the work around but plan to move to the pool. That seams to be better anyways. thanks..
Thanks; fixed 👍
Summary
This logic assumes I want to use a pool and that I don't have an error handler:
https://github.com/graphile/graphile-engine/blob/68c20b45b6ef2ec5b81a301b489b0eefea26f53f/packages/graphile-build-pg/src/withPgClient.js#L50
Possible Solution
Move this message to the documentation.