第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

錯誤:連接終止 - ASYNC nodeJS

錯誤:連接終止 - ASYNC nodeJS

BIG陽 2022-05-22 17:35:15
正確輸入所有數(shù)據(jù)后如何結束我的異步連接?即使在循環(huán)外聲明連接結束,結構也在第一次 INSERT 之后完成代碼require('es6-promise').polyfill();require('isomorphic-fetch');let queryAPI = {    "query": `{                squads {                    name                        cards(includedOnKanban: true, closed: false, archived: false, cancelled: false, swimlaneName:\"Atividades Nao Transacionais\", updatedSince: \"2020-01-01T00:00:00-0300\") {                            identifier                            title                            description                            status                            priority                            assignees {                                fullname                                email                              }                              swimlane                              workstate                        }                    }            }`};(async () => {  const rawResponse = await fetch('https://www.bluesight.io/graphql', {    method: 'POST',    headers: {      'Content-Type': 'application/json',      'Bluesight-API-Token': 'token-here'    },    body: JSON.stringify(queryAPI)  });  const content = await rawResponse.json();  const { Client } = require('pg');  const client = new Client({      user: 'postgres',      host: '127.0.0.1',      database: 'postgres',      password: 'postgres',      port: 5432  })輸出錯誤:連接在連接處終止。(C:\Users\TESTE\Documents\Autoportal\api\node_modules\pg\lib\client.js:254:9) 在 Object.onceWrapper (events.js:417:28) 在 Connection.emit (events.js: 323:22)
查看完整描述

1 回答

?
浮云間

TA貢獻1829條經(jīng)驗 獲得超4個贊

你可以嘗試使用 await client.connect()


而且,對于您的查詢,這


    res = await client.query(query, parameters);

代替這個


    client.query(query, parameters, (err, res) => {

        console.log(err, res);

    })


查看完整回答
反對 回復 2022-05-22
  • 1 回答
  • 0 關注
  • 133 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號