-
Notifications
You must be signed in to change notification settings - Fork 716
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
Cordova sqlite express EXPERIMENTAL WIP #730
base: dev
Are you sure you want to change the base?
Conversation
Here is some logcat output. The first few errors are expected in selfTest. The SQLITE_BUSY errors need more investigation.
|
needed for selfTest to pass on builtin android.database implementation (no Android-sqlite-connector / Android-sqlite-native-driver libraries) ref: storesafe#730
7269cba
to
d412eb5
Compare
This experimental WIP is now FIXED to pass selfTest on Android by fixing the SQLiteAndroidDatabase class to end transaction if active before closing. P.S. Another TODO item is to update some existing tests to pass on the builtin android.database implementation. |
An additional issue I noticed is that the builtin android.database implementation seems to treat numeric parameter values (integer or floating point) as string values. Needs further investigation. |
Another thing I noticed from the logcat output is that the builtin Android sqlite database implementation attempts to execute PRAGMA journal_mode to check the actual value when opening the database. This is what triggered the failure originally discussed here. But if I would check the result of PRAGMA journal_mode I do not get 100% same result on builtin android.database implementation vs Android-sqlite-connector, iOS, macOS ("osx"), Windows, or WP8. The following test case shows that PRAGMA journal_mode returns journal_mode value of "persist" on builtin android.database implementation, "delete" on the other implementations Android-sqlite-connector/iOS/macOS/Windows/WP8: it(suiteName + 'Check journal mode (plugin ONLY)', function(done) {
if (isWebSql) pending('SKIP: NOT SUPPORTED for (WebKit) Web SQL');
var db = openDatabase("Check-sqlite-PRAGMA-encoding.db", "1.0", "Demo", DEFAULT_SIZE);
expect(db).toBeDefined();
db.executeSql('PRAGMA journal_mode', [], function(rs) {
expect(rs).toBeDefined();
expect(rs.rows).toBeDefined();
expect(rs.rows.length).toBe(1);
expect(rs.rows.item(0).journal_mode).toBe('??');
// Close (plugin only) & finish:
(isWebSql) ? done() : db.close(done, done);
}, function(error) {
// NOT EXPECTED:
expect(false).toBe(true);
expect(error.message).toBe('--');
done();
});
}, MYTIMEOUT); P.S. TBD it is not certain whether which journal_mode value of DELETE or PERSIST would be more optimal on mobile platforms, especially Android & iOS. Performance comparison should be measured using something such as https://github.com/brodybits/Cordova-sqlite-perftest. |
Needed for new BUG 666 workaround solution to pass selfTest in case of builtin android.database implementation (no Android-sqlite-connector / Android-sqlite-native-driver libraries). Ref: - storesafe/cordova-sqlite-storage#730 - storesafe/cordova-sqlite-storage#666
Close db before opening (ignore close error) Now tested on builtin android.database implementation (no Android-sqlite-connector / Android-sqlite-native-driver libs). Ref: - storesafe/cordova-sqlite-storage#666 - storesafe/cordova-sqlite-storage#730
NOW FIXED (see comment below):
This experimental WIP change shows that the new BUG #666 workaround solution causes selfTest to fail on built-in android.database implementation (Android-sqlite-connector not used).This is a blocking issue for #687: new major release using built-in sqlite libraries on Android/iOS/macOSA FUTURE TODO item is to cover this scenario in an open/close/delete test.