Skip to content

Commit

Permalink
Update PRAGMA journal_mode test for Android 8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher J. Brody committed Jan 4, 2018
1 parent 5970782 commit ed630b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ See the [Sample section](#sample) for a sample with a more detailed explanation.
- iOS versions supported: 8.x / 9.x / 10.x / 11.x (see [deviations section](#deviations) below for differences in case of WKWebView)
- FTS3, FTS4, and R-Tree are fully tested and supported for all target platforms in this version branch.
- Default `PRAGMA journal_mode` setting (*tested*):
- Android pre-8.0 with builtin android.database implementation (as selected using the `androidDatabaseImplementation` option in `window.sqlitePlugin.openDatabase`): `persist`
- Android with builtin android.database implementation (as selected using the `androidDatabaseImplementation` option in `window.sqlitePlugin.openDatabase`): `persist` (pre-8.x) / `truncate` (Android 8+)
- otherwise: `delete`
- AUTO-VACUUM is not enabled by default. If no form of `VACUUM` or `PRAGMA auto_vacuum` is used then sqlite will automatically reuse deleted data space for new data but the database file will never shrink. For reference: <http://www.sqlite.org/pragma.html#pragma_auto_vacuum> and [litehelpers/Cordova-sqlite-storage#646](https://github.com/litehelpers/Cordova-sqlite-storage/issues/646)
- In case of memory issues please use smaller transactions or use the plugin version at [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) (GPL or commercial license terms).
Expand Down
9 changes: 6 additions & 3 deletions spec/www/spec/sqlite-version-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,12 @@ var mytests = function() {
expect(rs).toBeDefined();
expect(rs.rows).toBeDefined();
expect(rs.rows.length).toBe(1);
// TBD different for builtin android.database implementation:
if (!isWindows && isAndroid && isImpl2) // TBD ...
expect(rs.rows.item(0).journal_mode).toBe('persist');
// DEFAULT PRAGMA journal_mode setting is
// DIFFERENT for builtin android.database implementation:
if (!isWindows && isAndroid && isImpl2)
expect(rs.rows.item(0).journal_mode).toBe(
(/Android [2-7]/.test(navigator.userAgent)) ?
'persist' : 'truncate');
else
expect(rs.rows.item(0).journal_mode).toBe('delete');

Expand Down

0 comments on commit ed630b2

Please sign in to comment.