{"size": 487, "ext": "js", "max_stars_repo_path": "db/connection.js", "max_stars_repo_name": "Jruuuu/employeeTracker", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "db/connection.js", "max_issues_repo_name": "Jruuuu/employeeTracker", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "db/connection.js", "max_forks_repo_name": "Jruuuu/employeeTracker", "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": 22.1363636364, "max_line_length": 52, "alphanum_fraction": 0.6858316222}
const util = require("util");
const mysql = require("mysql");

//create new mysql connection to local host
const connection = mysql.createConnection({
    //host
    host: "localhost",
    //username
    user: "root",
    //password
    password: "grace",
    //local db name
    database: "employees"
});

//connect to local DB
connection.connect();

//make the query method in mysql lib to be a promise
connection.query = util.promisify(connection.query);

module.exports = connection;