Skip to content

Normalize query config without copying it - #3743

Open
charmander wants to merge 1 commit into
brianc:masterfrom
charmander:no-clone-query-config
Open

Normalize query config without copying it#3743
charmander wants to merge 1 commit into
brianc:masterfrom
charmander:no-clone-query-config

Conversation

@charmander

@charmander charmander commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Thoroughly copying an object with create(getPrototypeOf(x), getOwnPropertyDescriptors(x)) just to read some properties from it is a little awkward and inefficient, and still has potential issues with setters for callback/values, for example. Follow-up to #3720 using a new backwards-incompatible function that can’t be imported from the outside, deprecating the original (now unused) function because it’s not a very good public API. When/if the callback API is removed, that’ll be a good opportunity to clean things up even more.

This comment was marked as resolved.

Comment thread packages/pg/lib/query.js
class Query extends EventEmitter {
constructor(config, values, callback) {
super()
;({

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Prettier removes the newline before this for some reason, but I’m not going to dig into that.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants