Open
Description
- Install https://github.com/nolanlawson/cordova-plugin-sqlite-2 via ionic plugin add cordova-plugin-sqlite-2 --save
- Once you install, make sure that this https://github.com/pouchdb-community/pouchdb-adapter-cordova-sqlite runs properly. Specifically see this comment:
Note that you will need to do this within the deviceready Cordova event. If you are stuck trying to get this to work, then please refer to the pouchdb-adapter-cordova-sqlite-demo project which contains a fully working demo that you can try out yourself to see how it should work. The code it adds is simply:
<script src="js/pouchdb-6.1.2.js"></script>
<script src="js/pouchdb.cordova-sqlite-2.0.2.js"></script>
<script>
document.addEventListener('deviceready', function () {
var db = new PouchDB('database.db', {adapter: 'cordova-sqlite'});
db.post({}).then(function (res) {
return db.get(res.id);
}).then(function (doc) {
/* etc. */
}).catch(console.log.bind(console));
});
</script>
- Follow this to make sure it works: https://pouchdb.com/adapters.html
Metadata
Metadata
Assignees
Labels
No labels