使 `Connection` 的 `parsedStatements` 成为无原型对象

作者: brianc创建于 2026年3月5日更新于 2026年8月11日

ConnectionparsedStatements 成为无原型对象(在原生 Client 上为 namedQueries) 也许从来没有人试过使用 name: 'constructor' 来准备查询(更不用说 Object.prototype 上的其他隐晦选项),也许永远不会有人这么做,但不必再考虑这个问题就很好了。从技术上讲,这对那些在访问 pg 内部以进行不建议的 client.connection.parsedStatements.hasOwnProperty(…) 检查的人来说是一个突变性变化,例如:

内容来源: brianc/node-postgres