I am currently working on an application that stores all the data locally on the device, and updates it whenever there is a change.
Therefore, I am looking for a way to store, read and update objects with relations between them inside client-side javascript code easily.
I know I can use localStorage, WebSQL, IndexedDB or plain Javascript Object, but I am looking for ORM or something that will simplify the actions and handle the relations for me.
I am aware of the JayData library but looking for better alternatives.
If you need a Database in your Browser maybe PuchDB is what you need.
You can find the API-documentation here: http://pouchdb.com/api.html. Everything can be stored at localStorage of the clients WebBrowser.
Example:
var db = new PouchDB('dbname');
// save some data
db.put({
_id: 'mydoc',
title: 'Heroes'
}, function(err, response) { });
// get som
db.get('mydoc', function(err, doc) { });
I hope this was helpfull :-)
Have you checkout my own library, ydn-db. It does not handle relationship, but otherwise very good non-relational ORM ;-).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With