-
Notifications
You must be signed in to change notification settings - Fork 55
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
PouchDB compatibility #19
Comments
Unfortunately I am not so experienced with running PouchDB and cannot promise when I will have a chance to look at this issue. |
Thanks for your quick response. I'm still investigating the issue, it doesn't seem to be sqlcipher specific, I get the same problem when using the normal sqlite plugin. In my log I get this error:
Which occurs in the mycb callback in SQLitePlugin.js (~ line 407). |
I think this is caused by the problem reported in storesafe/cordova-sqlite-storage/issues/409. A quick fix is to edit $ git diff -U7 www
diff --git a/www/SQLitePlugin.js b/www/SQLitePlugin.js
index c9e2c88..e0a00b8 100644
--- a/www/SQLitePlugin.js
+++ b/www/SQLitePlugin.js
@@ -118,15 +118,15 @@
};
SQLitePlugin.prototype.readTransaction = function(fn, error, success) {
if (!this.openDBs[this.dbname]) {
error(newSQLError('database not open'));
return;
}
- this.addTransaction(new SQLitePluginTransaction(this, fn, error, success, false, true));
+ this.addTransaction(new SQLitePluginTransaction(this, fn, error, success, true, true));
};
SQLitePlugin.prototype.startNextTransaction = function() {
var self;
self = this;
nextTick((function(_this) {
return function() { |
I can confirm that this indeed fixes the issue. Thank you so much! |
A workaround fix is now integrated and covered by the test suite. |
I'm trying to make this work with PouchDB. So far I made a couple of fixes to PouchDB, specifically to pass the encryption key in. Also pouch caches database objects on their name only, changed this to use the full options, ie. also the encryption key.
Now a have basic operation with pouch and sqlcipher working (can put and get objects), however queries fail (both temporary and persistent). Any ideas how to make this work or hints how to fix it?
The text was updated successfully, but these errors were encountered: