2
db.any(query)
.then(data => {
//console.log("data: " + JSON.stringify(data));
res.json(data);
//res.send("data: " + JSON.stringify(data));
})
.catch(error => {
console.log("ERROR:", error)
});
是否有可能以CSV格式而不是JSON获取数据?如何使用pg-promise将数据下载为CSV文件?
这是不相关的PG-承诺在所有。 –
[将PostgreSQL的PL/pgSQL输出保存为CSV文件]可能的重复(http://stackoverflow.com/questions/1517635/save-pl-pgsql-output-from-postgresql-to-a-csv-file) –
你使用Express框架吗? –