db.js
/**
 * Database connection function, accepts the database path as a string and returns an sqlite3 database object
 * @param {String} databasePath sqlite3 database path eg. ':memory:' or './test.db'
 * @returns sqlite3 database object
 */
Database connection function, accepts the database path as a string and returns an sqlite3 database object
@param {String} databasePath sqlite3 database path eg. ':memory:' or './test.db'
@returns sqlite3 database object
Database connection function accepts the database path as a string and returns an sqlite3 database object @param { String } databasePath sqlite3 database path eg . ' : memory : ' or ' . / test . db ' @returns sqlite3 database object
function dbConnect(databasePath) {
  return new sqlite3.Database(databasePath,
    sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE,
    (err) => {
      if (err) return console.error(err.message);
    }
  );
}
function dbConnect ( databasePath ) { return new sqlite3 . Database ( databasePath , sqlite3 . OPEN_READWRITE | sqlite3 . OPEN_CREATE , ( err ) => { if ( err ) return console . error ( err . message ) ; } ) ; }
Database connection function, accepts the database path as a string and returns an sqlite3 database object
 @param {String} databasePath sqlite3 database path eg.
Database connection function accepts the database path as a string and returns an sqlite3 database object @param { String } databasePath sqlite3 database path eg .
// If there is an error, output it to the console