let sqlite3 = require('sqlite3').verbose();
const path = require('path');
let db = new sqlite3.Database('./haiku.db');

(async () => {
    try {
       const fs = require('fs');
       let init = fs.readFileSync(path.join(__dirname, './init.sql')).toString();

       await db.exec(init, (e, res) => {
          if (e) {
             console.log(e);
          } else {
             console.log(" - DB init CHECK DONE");
          }
       });

    } catch (e) {
       console.error(e);
    }
 })();
 