Skip to content

Instantly share code, notes, and snippets.

@andrewdoss-bit
Created August 27, 2021 23:29
Show Gist options
  • Save andrewdoss-bit/fadc976400c74e54cb4280a105d7d675 to your computer and use it in GitHub Desktop.
Save andrewdoss-bit/fadc976400c74e54cb4280a105d7d675 to your computer and use it in GitHub Desktop.
node connect example
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