app.js
/**
 * db_run_func
 * 
 * Convenience function that converts sqlite3.run to a callable promise.
 * 
 * Modified from https://github.com/mozilla/promise-sqlite
 */


Convenience function that converts sqlite3.run to a callable promise.


Convenience function that converts sqlite3 . run to a callable promise .
function db_run_func(sql, params) {
  return () => {
    return new Promise((resolve, reject) => {
      DB.run(sql, params, (err) => {
        if (err) {
          reject(err);
        } else {
          resolve();
        }
      });
    });
  }
}
function db_run_func ( sql , params ) { return ( ) => { return new Promise ( ( resolve , reject ) => { DB . run ( sql , params , ( err ) => { if ( err ) { reject ( err ) ; } else { resolve ( ) ; } } ) ; } ) ; } }
db_run_func
db_run_func