{"size": 495, "ext": "js", "max_stars_repo_path": "src/db/dbs.js", "max_stars_repo_name": "arnaudm/igo", "max_stars_repo_stars_event_min_datetime": "2017-01-03T10:12:57.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-14T13:12:48.000Z", "max_issues_repo_path": "src/db/dbs.js", "max_issues_repo_name": "arnaudm/igo", "max_issues_repo_issues_event_min_datetime": "2017-01-21T13:20:17.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-01T17:33:29.000Z", "max_forks_repo_path": "src/db/dbs.js", "max_forks_repo_name": "arnaudm/igo", "max_forks_repo_forks_event_min_datetime": "2016-12-18T01:29:54.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-28T13:06:15.000Z"}
{"max_stars_count": 8, "max_issues_count": 13, "max_forks_count": 10, "avg_line_length": 22.5, "max_line_length": 60, "alphanum_fraction": 0.6161616162}


const _           = require('lodash');

const Db          = require('./Db');
const config      = require('../config');
const migrations  = require('./migrations');


// init databases connections
module.exports.init = () => {
  
  _.each(config.databases, (database) => {
    const db = new Db(database);
    db.init();
    module.exports[database] = db;
  });
  // main is first database
  module.exports.main = module.exports[config.databases[0]];
  migrations.init(module.exports.main);

};