Conversation
at the cost of more memory usage
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d67aa0f04
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| con.on('authenticationCleartextPassword', this._handleAuthCleartextPassword.bind(this)) | ||
| // password request handling | ||
| con.on('authenticationMD5Password', this._handleAuthMD5Password.bind(this)) |
There was a problem hiding this comment.
Reinstate SCRAM authentication event handling
The client now only registers cleartext/MD5 auth listeners, but the protocol parser still emits authenticationSASL, authenticationSASLContinue, and authenticationSASLFinal for SCRAM flows. On PostgreSQL instances configured for SCRAM-SHA-256, the client never sends the SASL handshake messages, so authentication cannot complete even with correct credentials.
Useful? React with 👍 / 👎.
| const utils = require('./utils') | ||
|
|
||
| class Query extends EventEmitter { | ||
| class Query { |
There was a problem hiding this comment.
Keep Query as an EventEmitter for streaming APIs
Changing Query to a plain class removes the evented query interface (row, end, error) that callers rely on when using client.query(new Query(...)) and other streaming patterns. This is a behavioral regression for existing consumers that attach listeners instead of using callbacks/promises.
Useful? React with 👍 / 👎.
| const cacheKey = fieldDescriptions.map(desc => desc.dataTypeID + "|" + desc.name).join(',') | ||
| parseFn = parserCache.get(cacheKey) | ||
| if(!parseFn) { | ||
| parseFn = 'return function(rowData){return {' |
There was a problem hiding this comment.
Respect rowMode='array' when parsing result rows
Row parsing is now hardcoded to build object literals, so rowMode: 'array' is ignored and results are returned as objects instead of positional arrays. Any caller indexing result rows by position will break once this code path is used.
Useful? React with 👍 / 👎.
| const cacheKey = fieldDescriptions.map(desc => desc.dataTypeID + "|" + desc.name).join(',') | ||
| parseFn = parserCache.get(cacheKey) |
There was a problem hiding this comment.
Include parser context in the Result cache key
The global parser cache key only uses dataTypeID and column name, but compiled parsers also depend on format (text/binary) and the active type parser registry. Reusing cached functions across different clients or parser configurations can silently decode column values with the wrong parser.
Useful? React with 👍 / 👎.
| * The SubtleCrypto API for low level crypto operations. | ||
| * @type SubtleCrypto | ||
| */ | ||
| const subtleCrypto = webCrypto.subtle |
There was a problem hiding this comment.
Preserve legacy crypto fallback for older Node versions
This module now dereferences webCrypto.subtle at load time without guarding for runtimes that lack WebCrypto. With engines still advertising Node 8+, requiring pg can throw immediately on older Node versions instead of using the previous legacy crypto path.
Useful? React with 👍 / 👎.
No description provided.