Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PouchDB not detecting sqlite plugin using cordova

I recently used PouchDB to get an easy way of developing through mobile phone but it seems there's a bit problem when I'm trying to deploy it on a mobile phone. You see, our data will contain a huge amount so the only option here is to use sqlite plugin for database instead of websql or indexeddb. So I tried the example provided by the documentation and it worked pretty well. But when I console.log(pouch.adapter) it says "websql". I tried browsing for the database using eclipse but there was nothing there. How can I force pouchdb to use sqlite always? Thanks!

Tldr; tried deploying pouchDB with sqlite plugin but instead it used websql. trying to force pouchDB to use sqlite all the time.

like image 381
Mike Shreek Avatar asked May 30 '26 08:05

Mike Shreek


1 Answers

I responded in the Google Groups, but basically db.adapter will report "websql" whether it's using WebSQL or the SQLite plugin. Kinda confusing, sorry about that!

Update: as of PouchDB 3.4.0, you can call db.info().then(console.log.bind(console)) and print out the database info, and it will report sqlite_plugin true or false. Makes debugging easier. :)

like image 146
nlawson Avatar answered Jun 01 '26 00:06

nlawson