Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Always use well documented pg client query() config argument #3004
For queries that included bindings, I found that arguments were sent in this form:
Technically, this works when calling out to the Node.js Postgres client directly. However, it is not documented publicly (see here). This change just adopts an approach that is public documented and therefore less prone to breaking in the future. After this change, the above becomes:
The motivation behind this change was for other libraries that try to instrument the postgres client in between. Using undocumented inputs can lead to issues if the library didn't consider all possible undocumented input patterns. My particular usecase was an AWS X-Ray instrumentation package,
note: I was only able to get a subset of tests to pass on my local machine. I added a unit test for explicit arg checking, but am relying on existing integration tests to ensure no regressions in basic querying functionality. I'm relying on the CI job to run the remainder of tests. If something fails, I may need pointers on how to get the full suite running locally - I wasn't able to get everything running using the existing docs... but perhaps I missed some steps.