1.0.0 ā€¢ Published 3 years ago

@aleks1123/easy-database v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

A small SQLite wrapper

šŸ  Homepage

Install

npm install easy-database --save

Using

let Database = require("easy-database");

let db = new Database({
    path: "./db.sqlite", // path to database file (optional, default ./database.sqlite)
    table: "testing" // default table (optional, default master)
});

/* Basic usage */
let foo = db.get("foo");
console.log(foo) // null
let operation = db.set("foo", "bar");
console.log(operation) // true
let newFoo = db.get("foo");
console.log(newFoo) // bar

/* Using tables */

db.table("foo");


let operation = db.set("foo", "bar");
console.log(operation) // true
let newFoo = db.get("foo");
console.log(newFoo) // bar

let newFooFromOtherTable = db.table('bar').get('foo');
console.log(newFooFromOtherTable); // null !

Author

šŸ‘¤ Aleks1123

Show your support

Give a ā­ļø if this project helped you!

šŸ“ License

Copyright Ā© 2021 Aleks1123. This project is ISC licensed.


This README was generated with ā¤ļø by readme-md-generator

1.0.0

3 years ago