Skip to content

Commit

Permalink
cordova-sqlite-evplus-ext-free 0.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher J. Brody committed Apr 6, 2018
2 parents 44573fb + 232b004 commit fa6f46a
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 23 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <sales@litehelpers.net>
This plugin version is available under GPL v3 (<https://www.gnu.org/licenses/gpl-3.0.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: <sales@litehelpers.net>

**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 <sales@litehelpers.net>.

Expand All @@ -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 <http://ericsink.com/entries/multiple_sqlite_problem.html> and <https://www.sqlite.org/howtocorrupt.html>.
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 <http://ericsink.com/entries/multiple_sqlite_problem.html> and <https://www.sqlite.org/howtocorrupt.html>.

The workaround is to use the `androidDatabaseImplementation: 2` setting as described in the **Android sqlite implementation** section below:

Expand Down Expand Up @@ -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 <http://libb64.sourceforge.net/> 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 <http://git.altlinux.org/people/at/packages/?p=sqlite3-pcre.git> 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`
Expand Down Expand Up @@ -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: <https://www.sitepoint.com/storing-local-data-in-a-cordova-app/>
- 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).
Expand All @@ -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
Expand Down Expand Up @@ -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)
- <http://stackoverflow.com/questions/26604952/a-simple-cordova-android-example-including-sqlite-read-write-and-search>

### Plugin tutorials
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-sqlite-evplus-ext-free"
version="0.0.4">
version="0.0.5">

<name>Cordova sqlite storage - free enterprise version with performance improvements for Android (legacy common version branch with external sqlite3 dependencies)</name>

Expand Down Expand Up @@ -68,7 +68,7 @@

<header-file src="node_modules/cordova-sqlite-evcore-free-dependencies/sqlite3.h" />
<source-file src="node_modules/cordova-sqlite-evcore-free-dependencies/sqlite3.c"
compiler-flags="-w -DSQLITE_THREADSAFE=1 -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" />
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" />
</platform>

<!-- macOS (osx) -->
Expand Down Expand Up @@ -100,7 +100,7 @@

<header-file src="node_modules/cordova-sqlite-evcore-free-dependencies/sqlite3.h" />
<source-file src="node_modules/cordova-sqlite-evcore-free-dependencies/sqlite3.c"
compiler-flags="-w -DSQLITE_THREADSAFE=1 -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" />
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" />
</platform>

<!-- windows -->
Expand Down
10 changes: 6 additions & 4 deletions spec/www/spec/db-tx-error-mapping-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion spec/www/spec/sqlite-version-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/windows/SQLite3-Win-RT/SQLite3/SQLite3.Shared.vcxitems
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>%(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</AdditionalIncludeDirectories>
<AdditionalOptions>/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)</AdditionalOptions>
<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)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down

0 comments on commit fa6f46a

Please sign in to comment.