0.1.0 • Published 5 years ago

evodb v0.1.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
5 years ago

EvoDB

The JSON based database system with promises

How to use it

var evodb = require("evodb"); // require the library
var db = new evodb("random", true); // the second parameter is to save on write
db.createTable("hello").then(db => { // create a table/array called "hello"

    db.add({ id: 0, name: "pyxel" }, "hello"); // add a new item to the hello table
    db.update({ key: "id", value: 0 }, { name: "pyxelx" }, "hello"); // update a item in the table
    db.delete({ key: "id", value: 0 }, "hello"); // delete the item we created
    db.save(); // only use if you didn't enable save on write
    var item = db.fetch({ key: "id", value: 0 }, "hello"); // fetch/get an item from the table
    db.deleteTable("hello"); // delete the table

});

Note

Doing stuff to fast can and will cause corruption. it is async.
use the promises wisely and sparingly, this is meant to be powerful, and optimised for performance, not for security.