pgClient2暂时不用.js 628 B

12345678910111213141516171819202122232425262728
  1. // 此文件暂时不用
  2. // 此文件暂时不用
  3. // 此文件暂时不用
  4. // 此文件暂时不用
  5. // 此文件暂时不用
  6. // 此文件暂时不用
  7. // 此文件暂时不用
  8. const pgClient = require("../Postgresql/pgClient2.js")
  9. //执行 单条 查询语句
  10. // 返回一个 Promise
  11. const doQuery = function (sqlstr) {
  12. return new Promise((resolve, reject) => {
  13. pgClient.query(sqlstr, function (err, result) {
  14. if (!err) {
  15. resolve(result)
  16. } else {
  17. reject(err)
  18. }
  19. });
  20. })
  21. }
  22. module.exports = {
  23. doQuery
  24. }