2020-11-27 00:40:08 -05:00
|
|
|
const { Pool, Client } = require('pg')
|
2020-11-27 01:01:42 -05:00
|
|
|
/*
|
2020-11-27 00:40:08 -05:00
|
|
|
const pool = new Pool({
|
2020-11-27 01:01:42 -05:00
|
|
|
user: 'api',
|
2020-11-27 00:40:08 -05:00
|
|
|
host: '192.168.1.110',
|
|
|
|
database: 'ubm',
|
2020-11-27 01:01:42 -05:00
|
|
|
password: 'qqqx53!028',
|
|
|
|
port: 5433,
|
2020-11-27 00:40:08 -05:00
|
|
|
})
|
|
|
|
pool.query('SELECT NOW()', (err, res) => {
|
|
|
|
console.log(err, res)
|
|
|
|
pool.end()
|
|
|
|
})
|
2020-11-27 01:01:42 -05:00
|
|
|
*/
|
2020-11-27 00:40:08 -05:00
|
|
|
const client = new Client({
|
2020-11-27 01:01:42 -05:00
|
|
|
user: 'api',
|
2020-11-27 00:40:08 -05:00
|
|
|
host: '192.168.1.110',
|
|
|
|
database: 'ubm',
|
2020-11-27 01:01:42 -05:00
|
|
|
password: 'qqqx53!028',
|
|
|
|
port: 5433,
|
2020-11-27 00:40:08 -05:00
|
|
|
})
|
|
|
|
client.connect()
|
|
|
|
client.query('SELECT * from pg_stat_activity', (err, res) => {
|
|
|
|
console.log(err, res)
|
|
|
|
client.end()
|
|
|
|
})
|