mzsm / Jaid

Jane Indexed Database Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jaid

Jane Indexed Database library

How to use

var db = Jaid.Database({
  name: 'library',
  version: 1,
  objectStores: [
    {
      name: 'books',
      keyPath: 'isbn',
      autoIncrement: false,
      indexes: [
        {name: 'title', keyPath: 'title'},
        {name: 'publisher', keyPath: 'publisher'},
        {name: 'author', keyPath: 'authors', multiEntry: true}
      ]
    }
  ]
});
db.onSuccess(function(){
  var transaction = db.readWriteTransaction('books');
  transaction.put(
    'books',
    {
      title: 'TypeScript Reference',
      publisher: 'Impress Japan',
      isbn: '9784844335887',
      authors: ['WAKAME Masahiro']
    }
  );
});

About

Jane Indexed Database Library

License:MIT License


Languages

Language:JavaScript 50.6%Language:TypeScript 30.4%Language:CSS 12.1%Language:Python 4.2%Language:Shell 2.7%