<commit_before>var env = require('./../../env/env-config.js');

var knex = require('knex')({
  client: 'mysql',
  connection: {
    host: '127.0.0.1',
    user: env.DB_USER,
    password: <PASSWORD>.DB_PASSWORD,
    database: 'sentimize',
    charset: 'utf8'
  }
});

var db = require('bookshelf')(knex);

module.exports = db;
<commit_msg>Configure knex + mysql database creation & connection<commit_after>var env = require('./../../env/env-config.js');

var connection = {
  client: 'mysql',
  connection: {
    host: env.HOST,
    user: env.DB_USER,
    password: <PASSWORD>,
    charset: 'utf8'
  }
};

var knex = require('knex')(connection);

knex.raw('CREATE DATABASE IF NOT EXISTS ' + env.APP_NAME)
  .then(function(){
    knex.destroy();
    connection.database = env.APP_NAME;

    knex = require('knex')(connection);
  })
  .then(function() {
    var db = require('bookshelf')(knex);
    module.exports = db;
  })
  .catch(function(err) {
    console.error(err);
  });
{'fraction_non_alphanumeric': 0.18833162743091095, 'fraction_numerical': 0.008188331627430911, 'mean_word_length': 3.327433628318584, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '5353411', 'n_tokens_mistral': 358, 'n_tokens_neox': 348, 'n_words': 68}