Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where is the SQLite adaptor? #4

Open
andy008 opened this issue Mar 2, 2017 · 7 comments
Open

Where is the SQLite adaptor? #4

andy008 opened this issue Mar 2, 2017 · 7 comments

Comments

@andy008
Copy link

andy008 commented Mar 2, 2017

Is this article misnamed, or am I missing something?

When you set pouchDB it's using the WebSQL adaptor, not SQLite.

@ashteya
Copy link
Owner

ashteya commented Mar 2, 2017

When I made the tutorial I was using a version of PouchDB before 6.0.0. In that version, PouchDB would automatically select the SQLite adapter if you had that installed. Since 6.0.0. this is no longer the case.

I will update the tutorial this week, but in the meantime, have a look at the first comment by Nolan Lawson on the tutorial: http://disq.us/p/1f65qim

@andy008
Copy link
Author

andy008 commented Mar 2, 2017

Makes sense. Unfortunately, I've yet to see a working Ionic 2 example using the pouchdb-adapter-cordova-sqlite plugin. I gave it a good try but it kept throwing errors about expecting the location to be set - but there was no option exposed to pouchDB to set it.

@alejo8591
Copy link

@andy008 and @ashteya same issue...!!!

@alejo8591
Copy link

The issue can be solved with the official PouchDB developer plugin: cordova-plugin-sqlite-2

@andy008
Copy link
Author

andy008 commented Mar 21, 2017

No, Pouch has withdrawn built-in support for SQLite. You need an adaptor to connect to the Cordova Plugin, which exists but I could not get to work with Pouch. See https://libraries.io/npm/pouchdb-adapter-cordova-sqlite

The examples are all pre-Ionic 2, and although I got the plug-in to install, when called it complains about various missing parameters which cannot be passed through.

@ashteya
Copy link
Owner

ashteya commented Mar 21, 2017

@andy008 I updated the tutorial a few days ago and tested it on iOS and can confirm that it worked. Can you let me know what exactly went wrong for you?

@alejo8591
Copy link

alejo8591 commented Mar 21, 2017

@andy008 yep!, In historical notes they affirm it; Is decoupled from the PouchDB core:

Until PouchDB 6.0.0, PouchDB's regular websql adapter supported the Cordova SQLite Plugin automatically. However, the PouchDB team found this to be confusing, error-prone, and difficult to configure, which is why it was extracted into a separate plugin. You can read details in PouchDB's list of breaking changes.

So what I did I installed pouchdb-adapter-cordova-sqlite and how to plug in SQLite cordova-plugin-sqlite-2, it works for iOS and Android >= API 16.

On the other hand probe with the other suggestion plugins, but I didn't work, only with the one that maintains the developer of PouchDB.

Regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants