fast-database
v2.0.5
Published
A small SQLite wrapper
Downloads
3
Readme
A small SQLite wrapper
🏠 Homepage
Install
Windows
$ npm install windows-build-tools -g
$ npm i node-gyp -g
$ npm install fast-database --save
Linux
$ npm i node-gyp -g
$ npm install fast-database --save
Using
const Database = require("fast-database");
const db = new Database({
path: "./db.sqlite", // path to database file (optional, default ./database.sqlite)
table: "testing" // default table (optional, default master)
});
/* Basic usage */
const foo = db.get("foo");
console.log(foo) // null
const operation = db.set("foo", "bar");
console.log(operation) // true
const newFoo = db.get("foo");
console.log(newFoo) // bar
/* Using tables */
db.table("foo");
const operation = db.set("foo", "bar");
console.log(operation) // true
const newFoo = db.get("foo");
console.log(newFoo) // bar
const newFooFromOtherTable = db.table('bar').get('foo');
console.log(newFooFromOtherTable); // null !
Author
👤 Aleks1123
- Website: http://aleks.ovh
- Github: @Aleks-1123
Show your support
Give a ⭐️ if this project helped you!
📝 License
Copyright © 2021 Aleks1123. This project is ISC licensed.