switched to the package better-sqlite3
This commit is contained in:
parent
a3054c8131
commit
cb8151cb40
1
bot.js
1
bot.js
|
@ -1,6 +1,7 @@
|
||||||
const config = require("./config/config.json");
|
const config = require("./config/config.json");
|
||||||
const irc = require("irc-upd");
|
const irc = require("irc-upd");
|
||||||
const geocode = require("node-geocoder");
|
const geocode = require("node-geocoder");
|
||||||
|
const sqlite = require("better-sqlite3");
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
const options = {
|
const options = {
|
||||||
|
|
16
createdb.js
16
createdb.js
|
@ -1,19 +1,11 @@
|
||||||
const bluebird = require("bluebird");
|
const bluebird = require("bluebird");
|
||||||
const sqlite = require("sqlite3");
|
const sqlite = require("better-sqlite3");
|
||||||
|
|
||||||
function main() { // Not a part of bot.js
|
function main() { // Not a part of bot.js
|
||||||
let db = new sqlite.Database("./db/users.db", (err) => {
|
let db = new sqlite("./db/users.db",{});
|
||||||
if(err) {
|
|
||||||
console.log(err);
|
|
||||||
process.exit();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
db.run("CREATE TABLE locations(usermask text, location text)", (err) => {
|
let statement = db.prepare("CREATE TABLE user_location(hostmask text, location text, coordinates text)");
|
||||||
if(err) {
|
statement.run();
|
||||||
console.log(err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
db.close();
|
db.close();
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -11,10 +11,10 @@
|
||||||
"author": "rgdra",
|
"author": "rgdra",
|
||||||
"contributors": [],
|
"contributors": [],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"better-sqlite3": "^7.1.1",
|
||||||
"bluebird": "^3.7.2",
|
"bluebird": "^3.7.2",
|
||||||
"irc-upd": "^0.11.0",
|
"irc-upd": "^0.11.0",
|
||||||
"node-geocoder": "^3.27.0",
|
"node-geocoder": "^3.27.0"
|
||||||
"sqlite3": "^5.0.0"
|
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node bot.js"
|
"start": "node bot.js"
|
||||||
|
|
Loading…
Reference in New Issue