<commit_before>var mysql = require('mysql');

module.export = {
    searchImagesByText = function(userId, text, cb){
        var connection = mysql.createConnection({
          host     : 'localhost',
          user     : 'me',
          password : '<PASSWORD>',
          database : 'my_db'
        });

        connection.connect();

        connection.query('SELECT 1 + 1 AS solution', function (error, results, fields) {
          if (error) throw error;
          console.log('The solution is: ', results[0].solution);
          cb(results);
        });

        connection.end();
    }
};<commit_msg>Added db pooling<commit_after>var mysql = require('mysql');

var pool  = mysql.createPool({
  connectionLimit : 10,
  host            : 'example.org',
  user            : 'bob',
  password        : '<PASSWORD>',
  database        : 'my_db'
});

module.export = {
    subscribeUser = function(userId){
        pool.query('insert into subscribtions (user, subscribtion_date) VALUES ()', );
    },
    searchImagesByText = function(userId, text, cb){

        pool.query('SELECT 1 + 1 AS solution', function (error, results, fields) {
          if (error) throw error;
          console.log('The solution is: ', results[0]);
          cb(results);
        });
    }
};
{'fraction_non_alphanumeric': 0.14162077104642015, 'fraction_numerical': 0.006294256490952006, 'mean_word_length': 2.220253164556962, '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': '5348732', 'n_tokens_mistral': 367, 'n_tokens_neox': 353, 'n_words': 88}