📅  最后修改于: 2022-03-11 15:02:26.296000             🧑  作者: Mango
const { Client } = require('pg')const client = new Client();(async () => { await client.connect() const res = await client.query('SELECT $1::text as message', ['Hello world!']) console.log(res.rows[0].message) // Hello world! await client.end()})()