Downgraded from sqlite3 to sqlite because of connection function error.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"database": {
|
"database": {
|
||||||
"host": "shows.db"
|
"host": "../shows.db"
|
||||||
},
|
},
|
||||||
"webserver": {
|
"webserver": {
|
||||||
"port": 31459
|
"port": 31459
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
"python-shell": "^0.4.0",
|
"python-shell": "^0.4.0",
|
||||||
"request": "^2.81.0",
|
"request": "^2.81.0",
|
||||||
"request-promise": "^4.2",
|
"request-promise": "^4.2",
|
||||||
|
"sqlite": "^2.2.1",
|
||||||
"sqlite3": "^2.5.0"
|
"sqlite3": "^2.5.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const sqlite3 = require('sqlite3');
|
const sqlite = require('sqlite');
|
||||||
|
|
||||||
class SqliteDatabase {
|
class SqliteDatabase {
|
||||||
|
|
||||||
constructor(host) {
|
constructor(host) {
|
||||||
this.host = host;
|
this.host = host;
|
||||||
this.connection = sqlite3;
|
this.connection = sqlite;
|
||||||
|
|
||||||
// this.schemaDirectory = path.join(__dirname, 'schemas');
|
// this.schemaDirectory = path.join(__dirname, 'schemas');
|
||||||
}
|
}
|
||||||
|
|
||||||
connect() {
|
connect() {
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
.then(() => new sqlite3.Database(this.host))
|
.then(() => sqlite.open(this.host))
|
||||||
|
.then(() => sqlite.exec('pragma foreign_keys = on;'));
|
||||||
}
|
}
|
||||||
|
|
||||||
all(sql, parameters) {
|
all(sql, parameters) {
|
||||||
|
|||||||
Reference in New Issue
Block a user