节点 js 和 postgres:更新 select 的最佳方式

nodejs & postgres : best way to do select for update

我需要在 node.js 的 postgres 数据库中执行 'select for update',即获取游标,对其进行迭代并在需要时更新值。

我不知道在 node.js 中是否可行以及如何实现。

我发现 https://github.com/brianc/node-pg-cursor 似乎对读取游标有用,但对更新游标没有帮助。

是否有可以实现此目的的模块或模式?

非常感谢

截至目前,在 Node JS 平台中没有对此的实现,因此您唯一可行的选择是在 Postgres 函数中实现它,然后从 Node JS 中调用它。