Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { Pool, Client } = require('pg')
- const pool = new Pool({
- user: 'user',
- host: 'database.server.com',
- database: 'db',
- password: 'password',
- port: 3211,
- })
- pool.query('SELECT NOW()', (err, res) => {
- console.log(err, res)
- pool.end()
- })
- const client = new Client({
- user: 'user',
- host: 'database.server.com',
- database: 'db',
- password: 'password',
- port: 3211,
- })
- client.connect()
- client.query('SELECT NOW()', (err, res) => {
- console.log(err, res)
- client.end()
- })
Add Comment
Please, Sign In to add comment