Downgraded from sqlite3 to sqlite because of connection function error.

This commit is contained in:
2017-08-23 10:26:23 +02:00
parent daa1915203
commit 56405e54f9
3 changed files with 7 additions and 5 deletions

View File

@@ -1,19 +1,20 @@
const fs = require('fs');
const path = require('path');
const sqlite3 = require('sqlite3');
const sqlite = require('sqlite');
class SqliteDatabase {
constructor(host) {
this.host = host;
this.connection = sqlite3;
this.connection = sqlite;
// this.schemaDirectory = path.join(__dirname, 'schemas');
}
connect() {
return Promise.resolve()
.then(() => new sqlite3.Database(this.host))
.then(() => sqlite.open(this.host))
.then(() => sqlite.exec('pragma foreign_keys = on;'));
}
all(sql, parameters) {
@@ -29,4 +30,4 @@ class SqliteDatabase {
}
}
module.exports = SqliteDatabase;
module.exports = SqliteDatabase;