<commit_before>const config = require('smart-config').get('local');
const sqlite3 = require('sqlite3').verbose();
const uuidv4 = require('uuid/v4');

module.exports = function () {

  let db = new sqlite3.Database(config.db_storage);

  return {

    createTables() {
      db.run('CREATE TABLE IF NOT EXISTS storedfiles(filekey text PRIMARY KEY,filename text)');
    },

    saveFile(filename) {
      let key = uuidv4();

      db.run("INSERT INTO storedfiles(filekey,filename) VALUES (?,?)", [key, filename], (err) => {
        throw err;
      });

      return key;
    },

    getFile(key) {
      db.get(`SELECT filename FROM storedfiles WHERE filekey = ?`, [key], (err, row) => {
        if (err) {
          throw err;
        }
        return row.filename;
      });
    },

    deleteFile(key) {
      db.run(`DELETE FROM storedfiles WHERE filekey = ?`, [key], (err) => {
        throw err;
      });
    }<commit_msg>bugifx: fixed improper configuration file<commit_after>const config = require('smart-config').get('db');
const sqlite3 = require('sqlite3').verbose();
const uuidv4 = require('uuid/v4');

module.exports = function () {

  const db = new sqlite3.Database(config.db_storage);

  return {

    createTables() {
      db.run('CREATE TABLE IF NOT EXISTS storedfiles(filekey text PRIMARY KEY,filename text)');
    },

    saveFile(filename) {
      let key = uuidv4();

      db.run("INSERT INTO storedfiles(filekey,filename) VALUES (?,?)", [key, filename], (err) => {
        throw err;
      });

      return key;
    },

    getFile(key) {
      db.get(`SELECT filename FROM storedfiles WHERE filekey = ?`, [key], (err, row) => {
        if (err) {
          throw err;
        }
        return row.filename;
      });
    },

    deleteFile(key) {
      db.run(`DELETE FROM storedfiles WHERE filekey = ?`, [key], (err) => {
        throw err;
      });
    }
{'fraction_non_alphanumeric': 0.15649867374005305, 'fraction_numerical': 0.00636604774535809, 'mean_word_length': 2.5787476280834913, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '105062', 'n_tokens_mistral': 601, 'n_tokens_neox': 574, 'n_words': 140}