1.0.3 • Published 2 years ago

guedesdb v1.0.3

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

guedesBD

The best dynamic local database that exists (#fuck mysql)

N|Solid

Build Status

guedesDB is a lightweight, to the point, no bullshit local database for node projects. You also have the option to share your data among multiple projects.

Features

  • Setup up database inside your project or globally for all projects;
  • Create your own objects and save them in .gds format;
  • Read all objects for your created types;
  • Read an object by ID for your created types;
  • Read an object by a specific attribute and its value for your created types;
  • Update any object with its id(yes that includes new parameters if you feel like it) for all your created types;
  • Delete any object with its id for all yout created types;
  • Dynamically counted ids for maximum certainty that all ids are different

Installation

guedesDB requires Node.js v10+ to run.

Install the dependencies and devDependencies and start the server.

cd [yourproject]
npm i guedesdb

Create your config file("local" for locally hosting the DB inside project or "global" for hosting the DB globally for shared use between projects)

{
    "storage": "local"
}

After calling guedesdb from the package you need to set it up with your config file...

const guedesDB = require('guedesDB');
guedesDB.SetupFolders(config);

And you're done, now you can use all of the methods guedesDB has to offer

Methods

guedesDB is currently extended with the following methods. Instructions on how to use them in your own application are linked below.

PluginREADMEExample
SetupFoldersSetupFolders(config file)SetupFolders(./config.json);
GetAllObjectsGetAllObjects(your type)GetAllObjects('users');
GetByIDGetByID(your type,id);GetByID('users',0);
GetByAttributeGetByAttribute(your type,your attribute,value);GetByAttribute('users',name,'jonaspistolas');
createObjectcreateObject(your type,your object);createObject('users',{name:'jonas',surname:'pistolas'});
UpdateObjectUpdateObject(your type,id,your objectUpdateObject('users',0,{name:'jonas2',surname:'pistolas2'});
DeleteObjectDeleteObject(your type,id);DeleteObject('users',0);

License

MIT

Fuck you Rui