<commit_before>var Utils = require("./utils")
var Query = module.exports = function(databaseConfig, callee, options) {
  this.config = databaseConfig
  this.callee = callee
  this.options = options || {}
}
Utils.addEventEmitter(Query)

Query.prototype.run = function(query) {
  var self = this
  var client = new (require("mysql").Client)({
    user: this.config.username,
    password: <PASSWORD>,
    host: this.config.host,
    port: this.config.port,
    database: this.config.database
  })

  // Save the query text for testing and debugging.
  this.sql = query

  if(this.options.logging)
    console.log('Executing: ' + query)

  client.connect()
  client.query(query, function(err, results, fields) {
    err ? self.onFailure(err) : self.onSuccess(query, results, fields)
  })
  client.on('error', function(err) { self.onFailure(err) })
  client.end()<commit_msg>use query.sql more consequently<commit_after>var Utils = require("./utils")
var Query = module.exports = function(databaseConfig, callee, options) {
  this.config = databaseConfig
  this.callee = callee
  this.options = options || {}
}
Utils.addEventEmitter(Query)

Query.prototype.run = function(query) {
  var self = this
  var client = new (require("mysql").Client)({
    user: this.config.username,
    password: <PASSWORD>,
    host: this.config.host,
    port: this.config.port,
    database: this.config.database
  })
  this.sql = query

  if(this.options.logging)
    console.log('Executing: ' + this.sql)

  client.connect()
  client.query(this.sql, function(err, results, fields) {
    err ? self.onFailure(err) : self.onSuccess(self.sql, results, fields)
  })
  client.on('error', function(err) { self.onFailure(err) })
  client.end()
{'fraction_non_alphanumeric': 0.14627039627039626, 'fraction_numerical': 0.0, 'mean_word_length': 3.9197707736389686, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3181836', 'n_tokens_mistral': 555, 'n_tokens_neox': 549, 'n_words': 118}