📜  如何将下一个 js 与 postgresql localhost 连接 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:53.306000             🧑  作者: Mango

代码示例1
const pgp = require('pg-promise')();

// Get the values for these variables from configuration
const user = ...
const password = ...
const host = ...
const port = ...
const database = ...

const db = pgp(`postgres://${user}:${password}@${host}:${port}/${database}`)