1.5.3 • Published 4 years ago

reaver.db v1.5.3

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

🌟 REAVER.DB 🌟

Introduction

My name is Reaver (AKA LeBanana) and this is my own database, It can be used for projects and discord bots, down below will be all the things you need to know about this database!

Installation

All you need to do is use the cli of npm/yarn to install

Example:

npm install reaver.db
npm install https://github.com/ItsReaver/reaver.db
yarn add reaver.db

Example Usage

Here is an example for reaver.db usage:

const { Database } = require('reaver.db');
const db = new Database("File Path") // No need to puth the path it will put json.sqlite by default

db.createTable("Items");

db.set("Items", {
    Sword: { ID: 1, Price: 1000 },
    Potion: { ID: 2, Price: 2500 },
    Shield: { ID: 3, Price: 5000 }
});

// You can use that data any further you want with all the methods down below

Methods

Here will be the list of methods and their usages:

db.createTable("Table Name");
db.deleteTable("Existing Table Name");
db.get("key");
db.set("key", value);
db.add("key", number);
db.subtract("key", number);
db.has("key");
db.fetch("key");
db.push("key", element);
db.type("key");
db.deleteAll();
db.getAll();
db.fetchAll();
db.tables();

There will be more explained method usages down below 👇

In code usages

createTable(name):

db.createTable("Items");

// Insert data into the table

deleteTable(name):

db.deleteTable("Items");

get(key):

db.get("Items");

console.log(db.get("Items"));

set(key, value):

db.set("Items", {
    Sword: { ID: 1, Price: 1000 },
    Potion: { ID: 2, Price: 2500 },
    Shield: { ID: 3, Price: 5000 }
});

console.log(db.get("Items"));

add(key, number):

db.add("Coins", 159);

console.log(db.get("Coins"));

subtract(key, number):

db.subtract("Coins", 150);

console.log(db.get("Coins"));

has(key):

console.log(db.has("Items"));

fetch(key):

db.fetch("Items");

console.log(db.fetch("Items"));

push(key, element):

db.push("Items", { 
    Bow: { ID: 4, Price: 6000 }
});

console.log(db.get("Items"));

type(key):

console.log(db.type("Items"));

tables():

console.log(db.tables());

Utilities

Here down below will be the usage for creating new util class:

const { Util } = require('reaver.db');
const util = new Util("Your File Path");

Here down below will be the usage of the utils:

parseDataKey(key):

Util.parseDataKey("coins-88888-88888");

// { id: "coins", target: '88888-88888 };

Authors

Me! (Reaver)

Finishing!

Hope you all liked my package and i hope you will use it! Thanks for reading this page till the end and understanding the functions and the basics of my database, Hope you guys enjoy and i will see you in my next package 👋

1.5.3

4 years ago

1.4.6

4 years ago

1.3.7

4 years ago

1.4.5

4 years ago

1.4.4

4 years ago

1.5.2

4 years ago

1.4.3

4 years ago

1.5.1

4 years ago

1.4.2

4 years ago

1.5.0

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.4.9

4 years ago

1.4.8

4 years ago

1.3.9

4 years ago

1.4.7

4 years ago

1.3.8

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.2.0

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.1.6

4 years ago

1.2.4

4 years ago

1.1.5

4 years ago

1.3.2

4 years ago

1.2.3

4 years ago

1.3.1

4 years ago

1.2.2

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.1

4 years ago