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

How to use new location option with pouchdb? #200

Closed
tannerlinsley opened this issue Mar 7, 2015 · 11 comments
Closed

How to use new location option with pouchdb? #200

tannerlinsley opened this issue Mar 7, 2015 · 11 comments

Comments

@tannerlinsley
Copy link

I'm confused how I can tell pouchdb to use the new location parameter to not back up to icloud. Any ideas?

@nolanlawson
Copy link
Contributor

You cannot. We haven't implemented it in PouchDB yet.

If you would like to contribute the fix to PouchDB, you are more than welcome to modify the code and submit a pull request. Here is the code that will need to be modified. I would recommend adding an option to the PouchDB constructor, e.g. sqlite_plugin_location or something like that, and then passing it in to that openDB function.

@brody4hire
Copy link

Thanks @tannerlinsley and @nolanlawson!

@brody4hire
Copy link

In a more general case, it would be nice to configure default values as well. Nice to do this from config.xml, see: http://stackoverflow.com/questions/24939920/access-config-xml-preferences-from-javascript-plugins

@nolanlawson
Copy link
Contributor

That's a nice pattern; thanks for sharing. :)

@tannerlinsley
Copy link
Author

Using the above changes, my app says that it's opening a db, but nothing ever happens after this...

SQLitePlugin openargs: {"name":"","version":1,"description":"_pouch_myapp","size":1,"location":2,"dblocation":"nosync"}

@brody4hire
Copy link

What you quote from the trace indicates that for some reason, the plugin attempts to open a database with name of "", which will not work. The plugin should check for and reject (probably with an exception) this case. Please try further to log or otherwise debug the "config" object given to sqlitePlugin.openDatabase.

@tannerlinsley
Copy link
Author

False alarm. I found a bug on my end. Thanks for the help on this one guys!

@brody4hire
Copy link

Happy to hear @tannerlinsley. I have raised #207 to add the XML enhancements whenever I get a chance (or someone else issues a pull request). And thanks to both @nolanlawson and @tannerlinsley for fixing PouchDB to work with the new location option.

@nolanlawson
Copy link
Contributor

This feature should appear in the next release of PouchDB. Or for those who are in a hurry, here are some prerelease builds: pouchdb.js and pouchdb.min.js.

@tannerlinsley
Copy link
Author

Thanks!

On Tue, Mar 17, 2015 at 8:05 AM Nolan Lawson [email protected]
wrote:

This feature should appear in the next release of PouchDB. Or for those
who are in a hurry, here are some prerelease builds: pouchdb.js
https://nolanlawson.s3.amazonaws.com/pouchdb/www/20150315/pouchdb.js
and pouchdb.min.js
https://nolanlawson.s3.amazonaws.com/pouchdb/www/20150315/pouchdb.min.js
.


Reply to this email directly or view it on GitHub
#200 (comment)
.

@brody4hire
Copy link

FYI documented at: http://pouchdb.com/api.html#create_database

(Link will be added to README.md when I get a chance.)

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

No branches or pull requests

3 participants