我正在使用 pgp.helpers.insert 将数据保存到PostgreSQL中,这个工具非常好用。但是我需要返回值并在响应中呈现。我正在使用:
this.collection.one(this.collection.$config.pgp.helpers.insert(values, null, 'branch'))
该语句未返回任何数据。
我希望能在成功插入后返回分支ID,例如:
INSERT into branch (columns) VALUES (values) RETURNING pk_branchID