no pool
This commit is contained in:
parent
b706e630ce
commit
db0261bf45
14
script.js
14
script.js
@ -1,21 +1,23 @@
|
|||||||
const { Pool, Client } = require('pg')
|
const { Pool, Client } = require('pg')
|
||||||
|
/*
|
||||||
const pool = new Pool({
|
const pool = new Pool({
|
||||||
user: 'ptrowbridge',
|
user: 'api',
|
||||||
host: '192.168.1.110',
|
host: '192.168.1.110',
|
||||||
database: 'ubm',
|
database: 'ubm',
|
||||||
password: 'gyaswddh1983',
|
password: 'qqqx53!028',
|
||||||
port: 5432,
|
port: 5433,
|
||||||
})
|
})
|
||||||
pool.query('SELECT NOW()', (err, res) => {
|
pool.query('SELECT NOW()', (err, res) => {
|
||||||
console.log(err, res)
|
console.log(err, res)
|
||||||
pool.end()
|
pool.end()
|
||||||
})
|
})
|
||||||
|
*/
|
||||||
const client = new Client({
|
const client = new Client({
|
||||||
user: 'ptrowbridge',
|
user: 'api',
|
||||||
host: '192.168.1.110',
|
host: '192.168.1.110',
|
||||||
database: 'ubm',
|
database: 'ubm',
|
||||||
password: 'gyaswddh1983',
|
password: 'qqqx53!028',
|
||||||
port: 5432,
|
port: 5433,
|
||||||
})
|
})
|
||||||
client.connect()
|
client.connect()
|
||||||
client.query('SELECT * from pg_stat_activity', (err, res) => {
|
client.query('SELECT * from pg_stat_activity', (err, res) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user