{"size": 670, "ext": "js", "max_stars_repo_path": "app-backend/rds/seed-data/seed_local.js", "max_stars_repo_name": "tate2301/usesnip", "max_stars_repo_stars_event_min_datetime": "2016-04-18T01:04:10.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-31T00:21:03.000Z", "max_issues_repo_path": "app-backend/rds/seed-data/seed_local.js", "max_issues_repo_name": "DalavanCloud/serverless-graphql", "max_issues_repo_issues_event_min_datetime": "2016-04-16T01:08:19.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-08T22:48:46.000Z", "max_forks_repo_path": "app-backend/rds/seed-data/seed_local.js", "max_forks_repo_name": "alanionita/serverless-graphql", "max_forks_repo_forks_event_min_datetime": "2016-04-23T20:59:55.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-25T16:04:16.000Z"}
{"max_stars_count": 2349, "max_issues_count": 189, "max_forks_count": 389, "avg_line_length": 18.1081081081, "max_line_length": 47, "alphanum_fraction": 0.5671641791}
const udata = require('./Users.json');
const tdata = require('./Tweets.json');

const knex = require('knex')({
  client: 'sqlite3',
  connection: {
    filename: '../dev.db',
  },
});

const users = udata.map(a => {
  return a;
});

const tweets = tdata.map(a => {
  return a;
});

const insertData = function() {
  return knex('Users')
    .del()
    .then(() => knex('Tweets').del())
    .then(() => knex('Users').insert(users))
    .then(() => knex('Tweets').insert(tweets));
};

insertData()
  .then(function() {
    console.log('Data Insertion Complete');
  })
  .then(function() {
    process.exit(0);
  })
  .catch(function(error) {
    console.log(error);
  });
