Skip to content

ToluFash/AbstractNonPersistentDatabase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Abstract Non-Persistent Database

An abstract database for Javascript

Interface

The following methods are recommended for implementation by objects to be persisted

  • 1.1 persist(): stores the object in the Database.prototype.
    persist(){
        return Database.prototype.persist(this);
    }

Methods

  • 1.1 Database(): Construct a new Database.
let database = Database();

or

let database = new AbstractDatabase();
  • 1.2 Database.prototype.getItemWhereisValue:

    • field : Persisted Object Name
    • where : Object Attribute
    • value : Attribute Value
let obj = {'a':'anchor','b':'ball','c':'cat'};
obj.persist();
Database.prototype.getItemWhereIsValue("Object",'a',"anchor");
  • 1.3 Database.prototype.getItembyId:

    • field : Persisted Object Name
    • id : Object Id
Database.prototype.getItembyId(field,id);
  • 1.4 Database.prototype.getField: returns all stored objects of a certain Object Name

    • field : Persisted Object Name
Database.prototype.getItembyId(field);
  • 1.5 Database.prototype.persist: saves the object to the database

    • obj : Object
Database.prototype.persist(obj);
  • 1.6 Database.prototype.delete: delete the object identified by an id from the database

    • field : Object Name
    • id : Id
Database.prototype.delete(field,id);
  • 1.6 Database.prototype.dumps: returns all field in the database in an array

    • field : Object Name
    • id : Id
Database.prototype.dump()

About

Abstract Non Persistent Database for Javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published