{"size": 447, "ext": "js", "max_stars_repo_path": "postgres-query.js", "max_stars_repo_name": "Rukeith/node-n2-example", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "postgres-query.js", "max_issues_repo_name": "Rukeith/node-n2-example", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "postgres-query.js", "max_forks_repo_name": "Rukeith/node-n2-example", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.8333333333, "max_line_length": 69, "alphanum_fraction": 0.5637583893}
var pg = require('pg');
var uri = 'postgres://fred:12345678@localhost/mydb';

pg.connect(uri, function(err, client, done) {
    if (err) {
        return console.error('error fetching client from pool', err);
    }

    client.query('SELECT * FROM mytable', function(err, result) {
        done();
        if (err) {
            return console.error('error running query', err);
        }
        
        console.log(result.rows[0]);
    });
});
