Created
August 27, 2021 23:29
-
-
Save andrewdoss-bit/fadc976400c74e54cb4280a105d7d675 to your computer and use it in GitHub Desktop.
node connect example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Client } = require('pg'); | |
const client = new Client({ | |
database: 'bitdotio', | |
host: 'db.bit.io', | |
port: 5432, | |
user: '<YOUR USERNAME HERE>', | |
password: '<YOUR PASSWORD HERE>' | |
}); | |
client.connect(); | |
client.query('SELECT * FROM "<YOUR USERNAME HERE>/demo_repo"."atl_home_sales"', (err, res) => { | |
console.log(err ? err.stack : res.rows[0]); | |
client.end(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment