diff --git a/CHANGES.md b/CHANGES.md index 0d133c33..9ccdbd75 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # Changes +## cordova-sqlite-evplus-ext-free 0.0.5 + +### cordova-sqlite-evcore-legacy-ext-common-free 0.0.5 + +- Use cordova-sqlite-evcore-free-dependencies 0.8.2 with SQLite 3.22.0, with SQLITE_DEFAULT_SYNCHRONOUS=3 (EXTRA DURABLE ref: litehelpers/Cordova-sqlite-storage#736) & other build fixes + ## cordova-sqlite-evplus-ext-free 0.0.4 ### cordova-sqlite-evcore-legacy-ext-common-free 0.0.4 diff --git a/README.md b/README.md index 20e7fc3a..462a8ed3 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Native interface to sqlite in a Cordova/PhoneGap plugin for Android, iOS, macOS, This plugin version uses a special Android NDK sqlite database access library (C-language implementation) to provide significant performance and memory usage improvements on the Android platform. -This plugin version is available under GPL v3 (http://www.gnu.org/licenses/gpl.txt) or commercial license options and includes components available under the MIT and Apache 2.0 licenses listed in [LICENSE.md](./LICENSE.md). Contact for commercial license: +This plugin version is available under GPL v3 () or commercial license options and includes components available under the MIT and Apache 2.0 licenses listed in [LICENSE.md](./LICENSE.md). Contact for commercial license: **NOTICE:** Commercial licenses for _Cordova-sqlite-evcore and_ [litehelpers / Cordova-sqlite-enterprise-free](https://github.com/litehelpers/Cordova-sqlite-enterprise-free) are **NOT** valid for this version. For an upgrade please contact . @@ -22,7 +22,7 @@ TBD NOTE: This version branch has external sqlite3 dependencies that are install ## WARNING: Multiple SQLite problem on Android -This plugin uses a non-standard [litehelpers / Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) sqlite database access implementation on Android. In case an application access the SAME database using multiple plugins there is a risk of data corruption (ref: [litehelpers/Cordova-sqlite-storage#626](https://github.com/litehelpers/Cordova-sqlite-storage/issues/626)) as described in and . +This plugin uses non-standard [litehelpers / Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) sqlite database access implementation on Android. In case an application access the SAME database using multiple plugins there is a risk of data corruption (ref: [litehelpers/Cordova-sqlite-storage#626](https://github.com/litehelpers/Cordova-sqlite-storage/issues/626)) as described in and . The workaround is to use the `androidDatabaseImplementation: 2` setting as described in the **Android sqlite implementation** section below: @@ -132,16 +132,17 @@ See the [Sample section](#sample) for a sample with a more detailed explanation. - BASE64 integrated from [brodybits / sqlite3-base64](https://github.com/brodybits/sqlite3-base64), using [brodybits / libb64-encode](https://github.com/brodybits/libb64-encode) (based on by Chris Venter, public domain) - REGEXP for Android _(default [Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) database access implementation)_, iOS, and macOS using [brodybits / sqlite3-regexp-cached](https://github.com/brodybits/sqlite3-regexp-cached) (based on by Alexey Tourbin, public domain) - The iOS database location is now mandatory, as documented below. -- SQLite version `3.15.2` included with the following compile-time options: - - `SQLITE_THREADSAFE=1` on iOS/macOS/Windows (`SQLITE_THREADSAFE=2` Android) +- SQLite version `3.22.0` included with the following compile-time options: + - `SQLITE_THREADSAFE=1` + - `SQLITE_DEFAULT_SYNCHRONOUS=3` (EXTRA DURABLE build setting) ref: [litehelpers/Cordova-sqlite-storage#736](https://github.com/litehelpers/Cordova-sqlite-storage/issues/736) - `SQLITE_LOCKING_STYLE=1` on iOS/macOS ONLY - `HAVE_USLEEP=1` (iOS/macOS/Windows) + - `SQLITE_DEFAULT_MEMSTATUS=0` + - `SQLITE_OMIT_DECLTYPE` + - `SQLITE_OMIT_DEPRECATED` + - `SQLITE_OMIT_SHARED_CACHE` + - `SQLITE_OMIT_LOAD_EXTENSION` - `SQLITE_TEMP_STORE=2` - - `SQLITE_DEFAULT_MEMSTATUS=0` (iOS/macOS/Windows) - - `SQLITE_OMIT_DECLTYPE` (iOS/macOS/Windows) - - `SQLITE_OMIT_DEPRECATED` (iOS/macOS/Windows) - - `SQLITE_OMIT_SHARED_CACHE` (iOS/macOS/Windows) - - `SQLITE_OMIT_LOAD_EXTENSION` (iOS/macOS/Windows) - `SQLITE_ENABLE_FTS3` - `SQLITE_ENABLE_FTS3_PARENTHESIS` - `SQLITE_ENABLE_FTS4` @@ -177,6 +178,7 @@ See the [Sample section](#sample) for a sample with a more detailed explanation. ## Announcements +- Using recent version of SQLite3 (`3.22.0`) with `SQLITE_DEFAULT_SYNCHRONOUS=3` (EXTRA DURABLE) build setting to be extra robust against possible database corruption ref: [litehelpers/Cordova-sqlite-storage#736](https://github.com/litehelpers/Cordova-sqlite-storage/issues/736) - Nice overview of alternatives for storing local data in Cordova apps at: - New alternative solution for small data storage: [TheCocoaProject/ cordova-plugin-nativestorage](https://github.com/TheCocoaProject/cordova-plugin-nativestorage) - simpler "native storage of variables" for Android/iOS/Windows - Resolved Java 6/7/8 concurrent map compatibility issue reported in [litehelpers/Cordova-sqlite-storage#726](https://github.com/litehelpers/Cordova-sqlite-storage/issues/726), THANKS to pointer by [@NeoLSN (Jason Yang/楊朝傑)](https://github.com/NeoLSN) in [litehelpers/Cordova-sqlite-storage#727](https://github.com/litehelpers/Cordova-sqlite-storage/issues/727). @@ -185,7 +187,7 @@ See the [Sample section](#sample) for a sample with a more detailed explanation. - Fixed iOS/macOS platform version to use [PSPDFThreadSafeMutableDictionary.m](https://gist.github.com/steipete/5928916) to avoid threading issue ref: [litehelpers/Cordova-sqlite-storage#716](https://github.com/litehelpers/Cordova-sqlite-storage/issues/716) - [brodybits / cordova-sqlite-test-app](https://github.com/brodybits/cordova-sqlite-test-app) project is a CC0 (public domain) starting point (NOTE that this plugin must be added) and may also be used to reproduce issues with this plugin. - The Lawnchair adapter is now moved to [litehelpers / cordova-sqlite-lawnchair-adapter](https://github.com/litehelpers/cordova-sqlite-lawnchair-adapter). -- [litehelpers / cordova-sqlite-ext](https://github.com/litehelpers/cordova-sqlite-ext) now supports SELECT BLOB data in Base64 format on all platforms in addition to REGEXP (Android/iOS/macOS) and pre-populated database (all platforms). +- This plugin version now supports SELECT BLOB data in Base64 format on all platforms in addition to REGEXP (Android/iOS/macOS) ~~and pre-populated database (all platforms - FUTURE TODO)~~. - [brodybits / sql-promise-helper](https://github.com/brodybits/sql-promise-helper) provides a Promise-based API wrapper. - [nolanlawson / pouchdb-adapter-cordova-sqlite](https://github.com/nolanlawson/pouchdb-adapter-cordova-sqlite) supports this plugin along with other implementations such as [nolanlawson / sqlite-plugin-2](https://github.com/nolanlawson/sqlite-plugin-2) and [Microsoft / cordova-plugin-websql](https://github.com/Microsoft/cordova-plugin-websql). - macOS ("osx" platform) is now supported @@ -350,7 +352,7 @@ In case you get stuck with something please read through the [support](#support) ### Plugin usage examples -- [brodybits / cordova-sqlite-storage-starter-app](https://github.com/brodybits/cordova-sqlite-storage-starter-app) (uses `cordova-sqlite-storage` plugin version) +- [brodybits / cordova-sqlite-storage-starter-app](https://github.com/brodybits/cordova-sqlite-storage-starter-app) (using `cordova-sqlite-storage` plugin version) - ### Plugin tutorials diff --git a/package.json b/package.json index c35283cd..ee7f10b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-sqlite-evplus-ext-free", - "version": "0.0.4", + "version": "0.0.5", "description": "Cordova/PhoneGap sqlite storage - free enterprise version with performance improvements for Android (common version branch with external sqlite3 dependencies)", "cordova": { "id": "cordova-sqlite-evplus-ext-free", @@ -24,13 +24,13 @@ "cordova-windows" ], "author": "various", - "license": "GPL", + "license": "GPL-3.0 OR Commercial", "bugs": { "url": "https://github.com/litehelpers/cordova-plugin-sqlite-evplus-ext-free/issues" }, "homepage": "https://github.com/litehelpers/cordova-plugin-sqlite-evplus-ext-free", "dependencies": { - "cordova-sqlite-evcore-free-dependencies": "0.8.1" + "cordova-sqlite-evcore-free-dependencies": "0.8.2" }, "scripts": { "start": "node scripts/prepareSpec.js" diff --git a/plugin.xml b/plugin.xml index b485dd3f..4ba1392f 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="0.0.5"> Cordova sqlite storage - free enterprise version with performance improvements for Android (legacy common version branch with external sqlite3 dependencies) @@ -68,7 +68,7 @@ + compiler-flags="-w -DSQLITE_THREADSAFE=1 -DSQLITE_DEFAULT_SYNCHRONOUS=3 -DSQLITE_LOCKING_STYLE=1 -DHAVE_USLEEP=1 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_TEMP_STORE=2 -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_JSON1 -DSQLITE_DEFAULT_PAGE_SIZE=4096 -DSQLITE_DEFAULT_CACHE_SIZE=-2000" /> @@ -100,7 +100,7 @@ + compiler-flags="-w -DSQLITE_THREADSAFE=1 -DSQLITE_DEFAULT_SYNCHRONOUS=3 -DSQLITE_LOCKING_STYLE=1 -DHAVE_USLEEP=1 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_TEMP_STORE=2 -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_JSON1 -DSQLITE_DEFAULT_PAGE_SIZE=4096 -DSQLITE_DEFAULT_CACHE_SIZE=-2000" /> diff --git a/spec/www/spec/db-tx-error-mapping-test.js b/spec/www/spec/db-tx-error-mapping-test.js index f80542ac..c2ce0b9e 100755 --- a/spec/www/spec/db-tx-error-mapping-test.js +++ b/spec/www/spec/db-tx-error-mapping-test.js @@ -151,7 +151,7 @@ var mytests = function() { }); }, MYTIMEOUT); - it(suiteName + 'INSERT syntax error [VALUES in the wrong place] with a trailing space', function(done) { + it(suiteName + 'INSERT syntax error [VALUES in the wrong place (XXX "incomplete input")] with a trailing space [XXX TBD PROPER INFO MESSAGE NOT ON Android/...]', function(done) { if (isWP8) pending('SKIP for WP(8)'); // FUTURE TBD var db = openDatabase("INSERT-Syntax-error-test.db", "1.0", "Demo", DEFAULT_SIZE); @@ -184,12 +184,12 @@ var mytests = function() { expect(error.message).toMatch(/could not prepare statement.*1 near \"VALUES\": syntax error/); else if (isWindows) expect(error.message).toMatch(/Error preparing an SQLite statement/); - else if (isAndroid && !isImpl2) + else if (isAndroid && !isImpl2) //* XXX TBD PROPER INFO MESSAGE NOT ON Android/... expect(error.message).toMatch(/syntax error or other error.*code 1/); else if (isAndroid && isImpl2) expect(error.message).toMatch(/near \"VALUES\": syntax error.*code 1.*while compiling: INSERT INTO test_table/); else - expect(error.message).toMatch(/near \" \": syntax error/); + expect(error.message).toMatch(/incomplete input/); // XXX SQLite 3.22.0 on iOS/macOS // FAIL transaction & check reported transaction error: return true; @@ -209,8 +209,10 @@ var mytests = function() { expect(error.message).toMatch(/callback raised an exception.*or.*error callback did not return false/); else if (isWindows) expect(error.message).toMatch(/error callback did not return false.*Error preparing an SQLite statement/); + else if (!isWindows && isAndroid) // XXX TBD PROPER INFO MESSAGE NOT ON Android/... + expect(error.message).toMatch(/error callback did not return false.*syntax error/); // XXX Android/... else - expect(error.message).toMatch(/error callback did not return false.*syntax error/); + expect(error.message).toMatch(/error callback did not return false.*incomplete input/); // XXX SQLite 3.22.0 on iOS/macOS isWebSql ? done() : db.close(done, done); }, function() { diff --git a/spec/www/spec/sqlite-version-test.js b/spec/www/spec/sqlite-version-test.js index 707d5725..71438e28 100755 --- a/spec/www/spec/sqlite-version-test.js +++ b/spec/www/spec/sqlite-version-test.js @@ -69,7 +69,7 @@ var mytests = function() { expect(rs.rows.item(0).myResult).toMatch(/3\.[0-9]+\.[0-9]+/); // Check specific [plugin only]: if (!isWebSql && !(!isWindows && isAndroid && isImpl2)) - expect(rs.rows.item(0).myResult).toBe('3.15.2'); + expect(rs.rows.item(0).myResult).toBe('3.22.0'); // Close (plugin only) & finish: (isWebSql) ? done() : db.close(done, done); diff --git a/src/windows/SQLite3-Win-RT/SQLite3/SQLite3.Shared.vcxitems b/src/windows/SQLite3-Win-RT/SQLite3/SQLite3.Shared.vcxitems index 334e0c38..4a0e473f 100644 --- a/src/windows/SQLite3-Win-RT/SQLite3/SQLite3.Shared.vcxitems +++ b/src/windows/SQLite3-Win-RT/SQLite3/SQLite3.Shared.vcxitems @@ -11,7 +11,7 @@ %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(MSBuildThisFileDirectory)..\..\..\..\node_modules\cordova-sqlite-evcore-free-dependencies;$(MSBuildThisFileDirectory)..\..\..\..\node_modules\cordova-sqlite-evcore-free-dependencies\sqlite3-base64;$(MSBuildThisFileDirectory)..\..\..\..\node_modules\cordova-sqlite-evcore-free-dependencies\libb64-encode - /DSQLITE_THREADSAFE=1 /DHAVE_USLEEP=1 /DSQLITE_DEFAULT_MEMSTATUS=0 /DSQLITE_OMIT_DECLTYPE /DSQLITE_OMIT_DEPRECATED /DSQLITE_OMIT_PROGRESS_CALLBACK /DSQLITE_OMIT_SHARED_CACHE /DSQLITE_TEMP_STORE=2 /DSQLITE_OMIT_LOAD_EXTENSION /DSQLITE_ENABLE_FTS3 /DSQLITE_ENABLE_FTS3_PARENTHESIS /DSQLITE_ENABLE_FTS4 /DSQLITE_ENABLE_FTS5 /DSQLITE_ENABLE_RTREE /DSQLITE_ENABLE_JSON1 /DSQLITE_DEFAULT_PAGE_SIZE=4096 /DSQLITE_DEFAULT_CACHE_SIZE=-2000 /DSQLITE_OS_WINRT %(AdditionalOptions) + /DSQLITE_THREADSAFE=1 /DSQLITE_DEFAULT_SYNCHRONOUS=3 /DHAVE_USLEEP=1 /DSQLITE_DEFAULT_MEMSTATUS=0 /DSQLITE_OMIT_DECLTYPE /DSQLITE_OMIT_DEPRECATED /DSQLITE_OMIT_PROGRESS_CALLBACK /DSQLITE_OMIT_SHARED_CACHE /DSQLITE_TEMP_STORE=2 /DSQLITE_OMIT_LOAD_EXTENSION /DSQLITE_ENABLE_FTS3 /DSQLITE_ENABLE_FTS3_PARENTHESIS /DSQLITE_ENABLE_FTS4 /DSQLITE_ENABLE_FTS5 /DSQLITE_ENABLE_RTREE /DSQLITE_ENABLE_JSON1 /DSQLITE_DEFAULT_PAGE_SIZE=4096 /DSQLITE_DEFAULT_CACHE_SIZE=-2000 /DSQLITE_OS_WINRT %(AdditionalOptions)