1.0.8 • Published 4 years ago

@dharmesh-hemaram/jdb v1.0.8

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
4 years ago

DB

NPM version

About

DB is javascript library / wrapper used to communicate with IndexedDB efficiently. DB have set of predefined function which helps developers ease in writing object oriented code for storing, manipulating and retrieving data in indexedDB.

Versions

Changes in 1.0.2:

  • Updated code to remove unwanted methods and variables.

Install

In Browser

<script src="DB.js"></script>

npm

npm i --save DB;

In Node

// ES2015
import {DB} from '@dharmesh-hemaram/DB';

//require JS
let DB =  require('@dharmesh-hemaram/DB').DB;

//AMD
define(['@dharmesh-hemaram/DB'], function (package) {
  let DB = package.DB;
});

Getting started

Configuration

create database configuration file db_confog.json

{
  "databaseName":"testDB",
  "version":1,
  "tables":[
    {
      "name":"customers",
      "keyPath":"customerId",
      "autoIncrement":false,
      "columns":[
        {
          "name":"customerName",
          "nullable":false,
          "type":"string"
        },{}
      ]
    },{}
  ]
}

Setup

import {DB} from '@dharmesh-hemaram/DB';

DB.setup(databaseJSON).then(dbInst => console.log(dbInst));

Serve

  DB.getInst().databaseName.tableName.get().then(result).catch(error);

Query

Usefull Stuff:

  • E-Mail
  • Wiki
  • Test

    If this project help you reduce time to develop, you can give me a cup of coffee :) PayPal

Licensing

The code in this project is licensed under Apache 2.0 license.