Downgraded from sqlite3 to sqlite because of connection function error.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"database": {
|
||||
"host": "shows.db"
|
||||
"host": "../shows.db"
|
||||
},
|
||||
"webserver": {
|
||||
"port": 31459
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"python-shell": "^0.4.0",
|
||||
"request": "^2.81.0",
|
||||
"request-promise": "^4.2",
|
||||
"sqlite": "^2.2.1",
|
||||
"sqlite3": "^2.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user