2 ms·
I don't fully get it -- this is an SQlite implementation in JavaScript, which is different from what you'd use in a native app. Unless you store it to localStor
by dheera 6y ago
I don't fully get it -- this is an SQlite implementation in JavaScript, which is different from what you'd use in a native app. Unless you store it to localStorage or cookies, all variables disappear when you navigate away from the page.
Can you write an offline HTML5 webapp with any of these libraries such that it can cerealize the entire database into a string and then store that to localStorage and reload the next time?
It's an honest question and not sure why people are downvoting without giving reasons.
- tehbeard 6y agoReally you'd want to do this in to an indexeddb store rather than local storage. Less issues with size limits and string serialisation as you can chuck Blob instances straight into it. You'd have to handle loading/saving though
- kpkrish 6y agoIs there some way by which the indexedDB store can stay synchronised with the server database running in the backend. Something simple so that the front-end app developer can just focus on implementing business requirements.
- tehbeard 6y agoindexedDB is too low level for that kind of thing by itself. It's just a fast Key-Value store with secondary indexes that's in your browser. You either need to find a solution that has a sync system built in (such as <https://dexie.org/ https://dexie.org/> or <https://pouchdb.com/ https://pouchdb.com/> ) or you'd roll your own atop whatever you were using.