Api request #84

Merged
KevinMidboe merged 39 commits from api_request into master 2018-03-19 14:46:19 +00:00
Showing only changes of commit 354b833375 - Show all commits

View File

@@ -14,12 +14,10 @@ class SqliteDatabase {
* Connect to the database. * Connect to the database.
* @returns {Promise} succeeds if connection was established * @returns {Promise} succeeds if connection was established
*/ */
async connect() { connect() {
return Promise.resolve() let database = new sqlite3.Database(this.host);
.then(() => { this.connection = database;
this.connection = new sqlite3.Database(this.host); return database;
this.connection.run('PRAGMA foreign_keys=on')
});
} }
/** /**
@@ -67,7 +65,6 @@ class SqliteDatabase {
if (err) { if (err) {
reject(err); reject(err);
} }
console.log('rows', rows)
resolve(rows); resolve(rows);
}) })
}) })