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

both location or iosDatabaseLocation values are present in openDatabase call #596

Open
agnosco opened this issue Dec 12, 2016 · 5 comments

Comments

@agnosco
Copy link

agnosco commented Dec 12, 2016

I upgraded Cordova-sqlite-storage from version 1.2.1 to 1.5.1 and when I launch the app I'm getting following error:
Error: AMBIGUOUS: both location or iosDatabaseLocation values are present in openDatabase call
at newSQLError (file:///android_asset/www/plugins/cordova-sqlite-storage/www/SQLitePlugin.js:26:18)

@brodycj
Copy link
Contributor

brodycj commented Dec 14, 2016

The error should read "both location and iosDatabaseLocation values are present...". I will fix this when I get a chance.

As I already documented you must specify exactly one or the other.

@agnosco
Copy link
Author

agnosco commented Dec 20, 2016

Thank you.

It was working fine with 1.2.1 version but when I upgraded to the latest one I get to this error.

if (!!openargs.location && !!openargs.iosDatabaseLocation) {
throw newSQLError('AMBIGUOUS: both location or iosDatabaseLocation values are present in openDatabase call');
}

and for open database I have:

var db= $window.sqlitePlugin.openDatabase({
name: 'my.db',
location: 'default',
iosDatabaseLocation: 'Documents'
}

Do I need to make any changes to work with it?

@brodycj
Copy link
Contributor

brodycj commented Dec 20, 2016

Please read the documentation and check your code very carefully. The documentation explains how you should use the sqlitePlugin.openDatabase call. As I tried to explain in another comment before you have to use either location or iosDatabaseLocation. You have to use exactly one. You cannot use both.

Is the documentation not clear enough?

@jpike88
Copy link

jpike88 commented Dec 15, 2017

The documentation isn't clear enough. If you guys cleaned up the Readme so it didn't look like someone mashed the keyboard for an hour, people wouldn't be so confused at already what is a confusing option set.

@brodycj
Copy link
Contributor

brodycj commented Dec 22, 2017

The documentation isn't clear enough.

@jpike88 I would definitely agree, please see my response in storesafe/cordova-sqlite-storage-help#33.

This was referenced Dec 22, 2017
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