我知道关于参数化查询,但由于我必须以编程方式构造哪里条件,计算参数的数量并构建参数数组是一项比简单地调用escape需要时发挥作用。所以:
node-postgres 中有参数转义函数吗?
Yes, since this PR there are client.escapeIdentifier and client.escapeLiteral (sadly still undocumented), and since PR2954 (released with v8.11.0) they are exported and documented as pg.escapeIdentifier and pg.escapeLiteral.
但是,当您可以使用参数化查询以及动态查询时,不建议使用它们WHERE
条件你可以轻松构造一个查询对象text
and values
在飞行中。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)