Skip to content

db_init.js

up2108272 edited this page May 9, 2024 · 2 revisions

db_init.js

Basic information

  • This file needs to be run only once to create the database file
  • It doesn't need to be used after this
function init() {
    console.log("INITIALIZING DB");
    const db = new sqlite3.Database("./server/learnforge.db", sqlite3.OPEN_READWRITE, (err) =>{
        if (err) return console.error(err.message);
    });
    db.exec(sql, (err) => {
        if (err) return console.log(err.message);
    });
}

Clone this wiki locally