<commit_before>//require PostgreSQL
var pg = require("pg");

//connect to 'customers' database on PostgreSQL
var conString = "postgres://localhost:5432/customers";

var client = new pg.Client(conString);
client.connect();

//creates new table
client.query("CREATE TABLE IF NOT EXISTS cstmrs(firstname varchar(64), lastname varchar(64))");
client.query("INSERT INTO cstmrs(firstname, lastname) values($1, $2)", ['Bryan', 'Duplantis']);
client.query("INSERT INTO cstmrs(firstname, lastname) values($1, $2)", ['Ed', 'Bush']);
client.query("INSERT INTO cstmrs(firstname, lastname) values($1, $2)", ['Zoe', 'Ames']);
client.query("INSERT INTO cstmrs(firstname, lastname) values($1, $2)", ['Bob', 'Paterno']);

var query = client.query("SELECT firstname, lastname FROM cstmrs ORDER BY lastname, firstname");
query.on("row", function (row, result) {
    result.addRow(row);
});
query.on("end", function (result) {
    console.log(JSON.stringify(result.rows, null, "    "));
    client.end();
});<commit_msg>added comments<commit_after>//require PostgreSQL
var pg = require("pg");

//connect to 'customers' database on PostgreSQL
var conString = "postgres://localhost:5432/customers";

var client = new pg.Client(conString);
client.connect();

//creates table & inserts 3 records into it
client.query("CREATE TABLE IF NOT EXISTS cstmrs(firstname varchar(64), lastname varchar(64))");
client.query("INSERT INTO cstmrs(firstname, lastname) values($1, $2)", ['Bryan', 'Duplantis']);
client.query("INSERT INTO cstmrs(firstname, lastname) values($1, $2)", ['Ed', 'Bush']);
client.query("INSERT INTO cstmrs(firstname, lastname) values($1, $2)", ['Zoe', 'Ames']);
client.query("INSERT INTO cstmrs(firstname, lastname) values($1, $2)", ['Bob', 'Paterno']);

var query = client.query("SELECT firstname, lastname FROM cstmrs ORDER BY lastname, firstname");
query.on("row", function (row, result) {
    result.addRow(row);
});
//On 'end' JSONify and write results to console
query.on("end", function (result) {
    console.log(JSON.stringify(result.rows, null, "    "));
    client.end();
});
{'fraction_non_alphanumeric': 0.1837916063675832, 'fraction_numerical': 0.015918958031837915, 'mean_word_length': 6.1271477663230245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3879702', 'n_tokens_mistral': 712, 'n_tokens_neox': 679, 'n_words': 183}