<commit_before>/* jslint node: true, esnext: true */

'use struct';

const  sqlite3 = require('sqlite3').verbose();

export function prepareDatabase(config) {
  const db = new sqlite3.Database(config.database.file);

  return new Promise((fullfill, reject) => {
    db.serialize(() => {
      //db.run("CREATE TABLE lorem (info TEXT)");

      const stmt = db.prepare("INSERT INTO lorem VALUES (?)");
      for (let i = 0; i < 10; i++) {
        stmt.run("Ipsum " + i);
      }
      stmt.finalize();

      db.each("SELECT rowid AS id, info FROM lorem", (err, row) => console.log(row.id + ": " + row.info));

      fullfill(db);
    });
  });
}
<commit_msg>feat(prepareDatabase): table with three columns will be created if not exists<commit_after>/* jslint node: true, esnext: true */

'use struct';

const sqlite3 = require('sqlite3').verbose();

export function prepareDatabase(config) {
  const db = new sqlite3.Database(config.database.file);

  return new Promise((fullfill, reject) => {
    db.serialize(() => {
      //db.run("CREATE TABLE if not exists Konsum (date real NOT NULL, amount real NOT NULL, type text NOT NULL)");

      /*
            const stmt = db.prepare("INSERT INTO lorem VALUES (?)");
            for (let i = 0; i < 10; i++) {
              stmt.run("Ipsum " + i);
            }
            stmt.finalize();
*/

      db.run("CREATE TABLE if not exists Konsum (date datetime NOT NULL, amount real NOT NULL, type text NOT NULL)");

      //db.run("INSERT INTO Konsum (amount,type) values (120.5,'strom')");
      //db.each("SELECT rowid AS id, info FROM lorem", (err, row) => console.log(row.id + ": " + row.info));

      fullfill(db);
    });
  });
}

{'fraction_non_alphanumeric': 0.1651812240047534, 'fraction_numerical': 0.009506833036244802, 'mean_word_length': 2.784269662921348, 'pattern_counts': {'":': 2, '<': 5, '<?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': '2173333', 'n_tokens_mistral': 555, 'n_tokens_neox': 527, 'n_words': 159}