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框架嗎? –