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

Add support to specify location and iosDatabaseLocation #567

Merged
merged 2 commits into from Mar 19, 2018

Conversation

EugeniaM
Copy link

@EugeniaM EugeniaM commented Mar 15, 2018

This PR contains:

  • A BUGFIX

Describe the problem you have without this PR

When using 'cordova-sqlite' adapter (which uses native Cordova SQLite as its backing store) we need RxDB to create an instance of PouchDb with specified location or iosDatabaseLocation (these are required by cordoa sqlite plugin).
So an instance of PouchDb should be created like this:

new PouchDB('dbname', {adapter: 'cordova-sqlite', location: 'default'})

or this

new PouchDB('dbname', {adapter: 'cordova-sqlite', iosDatabaseLocation: 'default'})

The current implementation of RxDB let us specify only adapter.
This PR will give the possibility to specify location or iosDatabaseLocation in options property when creating database

await RxDB.create({
  name: 'dbname',
  adapter: 'cordova-sqlite',
  password: 'passwordPasswordPassword',
  options: { location: 'default' }
});

Todos

  • Documentation

@pubkey
Copy link
Owner

pubkey commented Mar 19, 2018

Hi @EugeniaM
Sorry I didn't have the time to answer this weekend.

I have the fear that using the whole options-object merged into the pouchdb-settings, can cause conflicts. So wen you add something to the options for a plugin which is also recognized by pouchdb, you have a problem.

Can we change it to introduce pouchSettings in RxDatabase, like it's done in RxCollection

@EugeniaM
Copy link
Author

@pubkey
Sure, no problem. I will change it in new commit to this PR

@EugeniaM
Copy link
Author

@pubkey
Added new commit to #567

@pubkey pubkey merged commit 0ef558b into pubkey:master Mar 19, 2018
@pubkey
Copy link
Owner

pubkey commented Mar 19, 2018

Wow. Thank you for that awesome PR. Merged.

pubkey added a commit that referenced this pull request Mar 19, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants