<commit_before>const Sequelize = require('sequelize');
const fs = require('fs-extra');
const path = require('path');

const config = require('./../../../package.json').config;

var dataDirPath = path.join(__dirname, '../../../', config.data);

fs.ensureDirSync(dataDirPath);

var sequelize = new Sequelize(process.env.DB_NAME, process.env.DB_USERNAME, process.env.DB_PASSWORD, {
  host: 'localhost',
  dialect: 'sqlite',

  pool: {
    max: 5,
    min: 0,
    idle: 10000
  },

  // SQLite only
  storage: path.join(dataDirPath, 'data.sqlite')
});

module.exports = sequelize;
<commit_msg>manage different type of database<commit_after>const Sequelize = require('sequelize');
const fs = require('fs-extra');
const path = require('path');

const config = require('./../../../package.json').config;

var dataDirPath = path.join(__dirname, '../../../', config.data);

fs.ensureDirSync(dataDirPath);

var options = {
  host: 'localhost',
  dialect: process.env.DB_TYPE,

  pool: {
    max: 5,
    min: 0,
    idle: 10000
  },
};

if (process.env.DB_TYPE == 'sqlite') {
    options.storage = path.join(dataDirPath, 'data.sqlite');
}

var sequelize = new Sequelize(process.env.DB_NAME, process.env.DB_USERNAME, process.env.DB_PASSWORD, options);

module.exports = sequelize;

{'fraction_non_alphanumeric': 0.18124507486209615, 'fraction_numerical': 0.01103230890464933, 'mean_word_length': 3.8659003831417627, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6621822', 'n_tokens_mistral': 449, 'n_tokens_neox': 432, 'n_words': 90}