switched to the package better-sqlite3

This commit is contained in:
Robert Drake 2020-11-06 01:33:36 -06:00
parent a3054c8131
commit cb8151cb40
4 changed files with 474 additions and 629 deletions

1
bot.js
View File

@ -1,6 +1,7 @@
const config = require("./config/config.json");
const irc = require("irc-upd");
const geocode = require("node-geocoder");
const sqlite = require("better-sqlite3");
function main() {
const options = {

View File

@ -1,19 +1,11 @@
const bluebird = require("bluebird");
const sqlite = require("sqlite3");
const sqlite = require("better-sqlite3");
function main() { // Not a part of bot.js
let db = new sqlite.Database("./db/users.db", (err) => {
if(err) {
console.log(err);
process.exit();
}
});
let db = new sqlite("./db/users.db",{});
db.run("CREATE TABLE locations(usermask text, location text)", (err) => {
if(err) {
console.log(err);
}
});
let statement = db.prepare("CREATE TABLE user_location(hostmask text, location text, coordinates text)");
statement.run();
db.close();
}

1082
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,10 +11,10 @@
"author": "rgdra",
"contributors": [],
"dependencies": {
"better-sqlite3": "^7.1.1",
"bluebird": "^3.7.2",
"irc-upd": "^0.11.0",
"node-geocoder": "^3.27.0",
"sqlite3": "^5.0.0"
"node-geocoder": "^3.27.0"
},
"scripts": {
"start": "node bot.js"