From a6d74427101801f74a2a2368e9084b90042021a9 Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Thu, 7 Dec 2017 18:01:22 -0500 Subject: [PATCH 01/12] SKIP UNICODE \\u2028 line separator string test on Android Web SQL for now --- spec/www/spec/db-tx-string-test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/www/spec/db-tx-string-test.js b/spec/www/spec/db-tx-string-test.js index c4768269a..82075c8e9 100755 --- a/spec/www/spec/db-tx-string-test.js +++ b/spec/www/spec/db-tx-string-test.js @@ -229,6 +229,7 @@ var mytests = function() { if (isWP8) pending('BROKEN on WP(8)'); // [BUG #202] UNICODE characters not working with WP(8) if (!isWebSql && !isWindows && isAndroid) pending('SKIP for Android plugin (cordova-android 6.x BUG: cordova/cordova-discuss#57)'); if (!isWebSql && !isWindows && !isAndroid && !isWP8) pending('SKIP for iOS/macOS plugin (Cordova BUG: CB-9435)'); + if (isWebSql && !isWindows && isAndroid) pending('SKIP for Android Web SQL'); // TBD SKIP for Android Web for now // NOTE: since the above test shows the UNICODE line separator (\u2028) // is seen by the sqlite implementation OK, it is now concluded that From 45446898af64dc4c658f9d722f3b4575318cf168 Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Thu, 7 Dec 2017 18:01:22 -0500 Subject: [PATCH 02/12] legacy version branch test fixes - test fix needed for this version branch to pass on several Android versions - cordova-sqlite-spec name in lower case in this version branch - .gitignore test fixes in this version branch --- .gitignore | 3 +++ spec/config.xml | 2 +- spec/platforms/.gitignore | 4 ---- spec/plugins/.gitignore | 4 ---- spec/www/spec/db-tx-value-bindings-test.js | 2 ++ 5 files changed, 6 insertions(+), 9 deletions(-) delete mode 100644 spec/platforms/.gitignore delete mode 100644 spec/plugins/.gitignore diff --git a/.gitignore b/.gitignore index c262bb5f0..8a83f574e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ .metadata/* *.swp *~ +spec/myplugin +spec/plugins +spec/platforms diff --git a/spec/config.xml b/spec/config.xml index 4177ccb82..bd3ab6fbe 100644 --- a/spec/config.xml +++ b/spec/config.xml @@ -1,7 +1,7 @@ - Cordova-sqlite-spec + cordova-sqlite-spec Runs the unit tests suite for the Cordova SQLite plugin. diff --git a/spec/platforms/.gitignore b/spec/platforms/.gitignore deleted file mode 100644 index 5e7d2734c..000000000 --- a/spec/platforms/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/spec/plugins/.gitignore b/spec/plugins/.gitignore deleted file mode 100644 index 5e7d2734c..000000000 --- a/spec/plugins/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/spec/www/spec/db-tx-value-bindings-test.js b/spec/www/spec/db-tx-value-bindings-test.js index 23a760b5c..273aa1fcd 100755 --- a/spec/www/spec/db-tx-value-bindings-test.js +++ b/spec/www/spec/db-tx-value-bindings-test.js @@ -350,11 +350,13 @@ var mytests = function() { // we would like to know, so the test is coded to fail if it starts // working there. if(isWebSql) { + /* SKIP IN THIS VERSION BRANCH: ok(expected.indexOf(name) === -1, 'field value: ' + JSON.stringify(name) + ' should not be in this until a bug is fixed ' + JSON.stringify(expected)); equal(name.length, 0, 'length of field === 0'); + // */ start(); return; } From 35dc759569d77b983d87341d643ed290d8498192 Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Thu, 7 Dec 2017 18:01:22 -0500 Subject: [PATCH 03/12] cordova-sqlite-legacy-express-core package fix - style(package): add macOS Platform by Daniel Sogl in this legacy version branch --- CHANGES.md | 4 ++++ package.json | 6 ++++-- plugin.xml | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 968eb4fe2..7c410120d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Changes +###### cordova-sqlite-legacy-express-core 1.0.3-pre0 + +TBD + ###### cordova-sqlite-legacy-express-core 1.0.2 - Use PSPDFThreadSafeMutableDictionary for iOS/macOS to avoid threading issue ref: litehelpers/Cordova-sqlite-storage#716 diff --git a/package.json b/package.json index 9950f0d74..3dbde39e9 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,14 @@ { "name": "cordova-sqlite-legacy-express-core", - "version": "1.0.2", + "version": "1.0.3-pre0", "description": "Native interface to SQLite for PhoneGap/Cordova (legacy express core version)", "cordova": { "id": "cordova-sqlite-legacy-express-core", "platforms": [ "android", - "ios" + "ios", + "osx", + "xx" ] }, "repository": { diff --git a/plugin.xml b/plugin.xml index a0a873850..0bcd25e70 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="1.0.3-pre0"> Cordova sqlite storage plugin - legacy express core version From 8efff355372ab87ceadf49707fe8697fe9845566 Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Fri, 8 Dec 2017 13:37:06 -0500 Subject: [PATCH 04/12] README.md document issue with cordova-android@7 ref: litehelpers/Cordova-sqlite-storage#729 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 24c3df237..880846c80 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ Use the `location` or `iosDatabaseLocation` option in `sqlitePlugin.openDatabase - A recent version of the Cordova CLI (such as `6.5.0` or `7.1.0`) is recommended. Cordova versions older than `6.0.0` are missing the `cordova-ios@4.0.0` security fixes. In addition it is *required* to use `cordova prepare` in case of cordova-ios older than `4.3.0` (Cordova CLI `6.4.0`). - This version uses a `before_plugin_install` hook to install sqlite3 library dependencies from `cordova-sqlite-storage-dependencies` via npm. +- This plugin will NOT work on `cordova-android@7` due to issue with JAR and NDK library files as discussed in [litehelpers/Cordova-sqlite-storage#729](https://github.com/litehelpers/Cordova-sqlite-storage/issues/729). - SQLite `3.8.10.2` included when building (all platforms), with the following definitions for iOS/macOS/Windows: - `SQLITE_THREADSAFE=1` (`SQLITE_THREADSAFE=2` on iOS/macOS) - `SQLITE_DEFAULT_MEMSTATUS=0` @@ -192,6 +193,7 @@ As "strongly recommended" by [Web SQL Database API 8.5 SQL injection](https://ww ## Known issues +- This plugin will NOT work on `cordova-android@7` due to issue with JAR and NDK library files as discussed in [litehelpers/Cordova-sqlite-storage#729](https://github.com/litehelpers/Cordova-sqlite-storage/issues/729). - iOS/macOS platform version does not support certain rapidly repeated open-and-close or open-and-delete test scenarios due to how the implementation handles background processing - As described below, auto-vacuum is NOT enabled by default. - It is possible to request a SQL statement list such as "SELECT 1; SELECT 2" within a single SQL statement string, however the plugin will only execute the first statement and silently ignore the others ref: [litehelpers/Cordova-sqlite-storage#551](https://github.com/litehelpers/Cordova-sqlite-storage/issues/551) From f868edd291737fe47f5074ecb00148a42f716511 Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Sun, 10 Dec 2017 12:31:42 -0500 Subject: [PATCH 05/12] cordova-sqlite-legacy-express-core doc updates legacy version branch doc fixes & updates --- README.md | 121 +++++++++++++++++++++++++++++------------------------- 1 file changed, 66 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 4e99f8554..6487971e6 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,20 @@ Native interface to sqlite in a Cordova/PhoneGap plugin for Android/iOS/macOS, with API similar to HTML5/[Web SQL API](http://www.w3.org/TR/webdatabase/). -License for Android platform version: MIT or Apache 2.0 +License terms for Android platform version: MIT or Apache 2.0 -License for iOS/macOS platform version: MIT only +License terms for iOS/macOS platform version: MIT only ## About this version branch This version branch contains the source code for the Android/iOS/macOS platforms (legacy express core version branch). This version does not contain any libraries or source code from www.sqlite.org. This version branch uses the built-in sqlite libraries on Android, iOS, and macOS. +This version branch is now used to develop Android platform version without dependency on JAR or NDK library artifacts for testing on `cordova-android@7`. + +**NOTICE:** Workaround solution for [BUG 666 (litehelpers/Cordova-sqlite-storage#666)](https://github.com/litehelpers/Cordova-sqlite-storage/issues/666) (possible transaction issue after window.location change change with possible data loss) is incorrect in this version branch as discussed in [this BUG 666 comment](https://github.com/litehelpers/Cordova-sqlite-storage/issues/666#issuecomment-343757398) and may continue to suffer from a possible data loss risk. New workaround solution described in [this newer BUG 666 comment](https://github.com/litehelpers/Cordova-sqlite-storage/issues/666#issuecomment-350159666) is available in newer version branches. New workaround solution to bug 666 will cause selfTest to fail on Android ref: + +NOTE: This version branch has some additional known [issues fixed in newer version branches](#issues-fixed-in-newer-version-branches). + ## BREAKING CHANGE: Database location parameter is now mandatory @@ -55,12 +61,12 @@ Use the `location` or `iosDatabaseLocation` option in `sqlitePlugin.openDatabase - REGEXP (Android/iOS/macOS) - SELECT BLOB data in Base64 format (all platforms Android/iOS/macOS/Windows) - Pre-populated database (Android/iOS/macOS/Windows) -- Amazon Fire-OS is dropped due to lack of support by Cordova. Android version should be used to deploy to Fire-OS 5.0(+) devices. For reference: [cordova/cordova-discuss#32 (comment)](https://github.com/cordova/cordova-discuss/issues/32#issuecomment-167021676) +- Amazon Fire-OS is dropped due to lack of support by Cordova. Android platform version should be used to deploy to Fire-OS 5.0(+) devices. For reference: [cordova/cordova-discuss#32 (comment)](https://github.com/cordova/cordova-discuss/issues/32#issuecomment-167021676) - FTS3 and FTS4 are tested working OK in this version branch (for all target platforms in this version branch Android/iOS/macOS) - R-Tree is *not* tested or supported for Android in this version branch. -- Android is supported back to SDK 10 (a.k.a. Gingerbread, Android 2.3.3); support for older versions is available upon request. -- iOS versions supported: 8.x/9.x/10.x -- In case of memory issues please use smaller transactions or use the version (with GPL or commercial license options) at: [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) +- Android versions supported: 2.3.3 - 7.1.1 (API level 10 - 25), depending on Cordova version ref: +- iOS versions supported: 8.x / 9.x / 10.x / 11.x +- In case of memory issues please use smaller transactions or use the version at [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) (GPL or commercial license terms). @@ -79,7 +85,6 @@ Use the `location` or `iosDatabaseLocation` option in `sqlitePlugin.openDatabase - Self-test functions to verify proper installation and operation of this plugin - More explicit `openDatabase` and `deleteDatabase` `iosDatabaseLocation` option - Added simple sql batch function -- Published [brodybits / Cordova-quick-start-checklist](https://github.com/brodybits/Cordova-quick-start-checklist) and [brodybits / Cordova-troubleshooting-guide](https://github.com/brodybits/Cordova-troubleshooting-guide) - [MetaMemoryT / websql-promise](https://github.com/MetaMemoryT/websql-promise) now provides a Promises-based interface to both Web SQL and this plugin - [SQLCipher](https://www.zetetic.net/sqlcipher/) for Android/iOS/macOS/Windows is supported by [litehelpers / Cordova-sqlcipher-adapter](https://github.com/litehelpers/Cordova-sqlcipher-adapter) @@ -89,13 +94,13 @@ Use the `location` or `iosDatabaseLocation` option in `sqlitePlugin.openDatabase - Drop-in replacement for HTML5/[Web SQL API](http://www.w3.org/TR/webdatabase/): the only change should be to replace the static `window.openDatabase()` factory call with `window.sqlitePlugin.openDatabase()`, with parameters as documented below. - Failure-safe nested transactions with batch processing optimizations (according to HTML5/[Web SQL API](http://www.w3.org/TR/webdatabase/)) -- API (based on HTML5/[Web SQL API](http://www.w3.org/TR/webdatabase/)) is designed to be as flexible as possible but does not allow the application to leave any transactions hanging open. +- Transaction API (based on HTML5/[Web SQL API](http://www.w3.org/TR/webdatabase/)) is designed for maximum flexiblibility, does not allow any transactions to be left hanging open. - As described in [this posting](http://brodyspark.blogspot.com/2012/12/cordovaphonegap-sqlite-plugins-offer.html): - - Keeps sqlite database in a user data location that is known; can be reconfigured (iOS/macOS platform version); and may be synchronized to iCloud (iOS platform version). - - No 5MB maximum, more information at: http://www.sqlite.org/limits.html -- Also tested for multi-page applications with window location changes + - Keeps sqlite database in known, platform specific user data location on all platforms (Android/iOS/macOS/Windows), which can be reconfigured on iOS/macOS. Whether or not the database on the iOS platform is synchronized to iCloud depends on the selected database location. + - No arbitrary size limit. SQLite limits described at: +- ~~Also tested for multi-page applications with window location changes~~ _(workaround solution for BUG 666 is incorrect in this version branch)_ - This project is self-contained: no dependencies on other plugins such as cordova-plugin-file -- Windows 10 UWP platform version available in [litehelpers / cordova-sqlite-ext](https://github.com/litehelpers/cordova-sqlite-ext) and Windows 8.1/Windows Phone 8.1/Windows 10 platform version available in [litehelpers / Cordova-sqlite-legacy](https://github.com/litehelpers/Cordova-sqlite-legacy) use the performant C++ [doo / SQLite3-WinRT](https://github.com/doo/SQLite3-WinRT) component. +- Windows 10 UWP platform version available in TBD uses the performant C++ [doo / SQLite3-WinRT](https://github.com/doo/SQLite3-WinRT) component. - [SQLCipher](https://www.zetetic.net/sqlcipher/) support for Android/iOS/macOS/Windows is available in: [litehelpers / Cordova-sqlcipher-adapter](https://github.com/litehelpers/Cordova-sqlcipher-adapter) - Intellectual property: - All source code is tracked to the original author in git @@ -112,7 +117,7 @@ Use the `location` or `iosDatabaseLocation` option in `sqlitePlugin.openDatabase - [Trailforks Mountain Bike Trail Map App](http://www.trailforks.com/apps/map/) with a couple of nice videos at: - [Get It Done app](http://getitdoneapp.com/) by [marcucio.com](http://marcucio.com/) - [KAAHE Health Encyclopedia](http://www.kaahe.org/en/index.php?option=com_content&view=article&id=817): Official health app of the Kingdom of Saudi Arabia. -- [Larkwire](http://www.larkwire.com/) (iOS version): Learn bird songs the fun way +- [Larkwire](http://www.larkwire.com/) (iOS platform): Learn bird songs the fun way - [Tangorin](https://play.google.com/store/apps/details?id=com.tangorin.app) (Android) Japanese Dictionary at [tangorin.com](http://tangorin.com/) @@ -148,28 +153,24 @@ As "strongly recommended" by [Web SQL Database API 8.5 SQL injection](https://ww - iOS/macOS platform version does not support certain rapidly repeated open-and-close or open-and-delete test scenarios due to how the implementation handles background processing - As described below, auto-vacuum is NOT enabled by default. - It is possible to request a SQL statement list such as "SELECT 1; SELECT 2" within a single SQL statement string, however the plugin will only execute the first statement and silently ignore the others ref: [litehelpers/Cordova-sqlite-storage#551](https://github.com/litehelpers/Cordova-sqlite-storage/issues/551) -- INSERT statement that affects multiple rows (due to SELECT cause or using TRIGGER(s), for example) does not report proper rowsAffected on Android -- Memory issue observed when adding a large number of records due to the JSON implementation which is improved in [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) (available with GPL or commercial license options) +- Execution of INSERT statement that affects multiple rows (due to SELECT cause or using TRIGGER(s), for example) does not report proper rowsAffected on Android +- Memory issue observed when adding a large number of records due to the JSON implementation which is improved in [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) (GPL or commercial license terms) - Infinity (positive or negative) values are not supported on Android/iOS/macOS due to issues described above including a possible crash on iOS/macOS ref: [litehelpers/Cordova-sqlite-storage#405](https://github.com/litehelpers/Cordova-sqlite-storage/issues/405) -- A stability issue was reported on the iOS version when in use together with [SockJS](http://sockjs.org/) client such as [pusher-js](https://github.com/pusher/pusher-js) at the same time (see [litehelpers/Cordova-sqlite-storage#196](https://github.com/litehelpers/Cordova-sqlite-storage/issues/196)). The workaround is to call sqlite functions and [SockJS](http://sockjs.org/) client functions in separate ticks (using setTimeout with 0 timeout). -- If a sql statement fails for which there is no error handler or the error handler does not return `false` to signal transaction recovery, the plugin fires the remaining sql callbacks before aborting the transaction. +- A stability issue was reported on the iOS platform version when in use together with [SockJS](http://sockjs.org/) client such as [pusher-js](https://github.com/pusher/pusher-js) at the same time (see [litehelpers/Cordova-sqlite-storage#196](https://github.com/litehelpers/Cordova-sqlite-storage/issues/196)). The workaround is to call sqlite functions and [SockJS](http://sockjs.org/) client functions in separate ticks (using setTimeout with 0 timeout). - Possible crash on Android when using Unicode emoji and other 4-octet UTF-8 characters due to [Android bug 81341](https://code.google.com/p/android/issues/detail?id=81341), which *should* be fixed in Android 6.x - Close/delete database bugs described below. - When a database is opened and deleted without closing, the iOS/macOS platform version is known to leak resources. - It is NOT possible to open multiple databases with the same name but in different locations (iOS/macOS platform version). -- Incorrect or missing insertId/rowsAffected in results for INSERT/UPDATE/DELETE SQL statements with extra semicolon(s) in the beginning for Android (android.database implementation) -- readTransaction does *not* reject modification SQL statements with extra semicolon(s) in the beginning -- Problems reported with PhoneGap Build in the past: - - PhoneGap Build Hydration. - - Apparently FIXED: ~~PhoneGap Build may fail to build the iOS version unless the name of the app starts with an uppercase and contains no spaces (see [litehelpers/Cordova-sqlite-storage#243](https://github.com/litehelpers/Cordova-sqlite-storage/issues/243); [Wizcorp/phonegap-facebook-plugin#830](https://github.com/Wizcorp/phonegap-facebook-plugin/issues/830); [phonegap/build#431](https://github.com/phonegap/build/issues/431)).~~ -Issues fixed in some newer version branches: +### Issues fixed in newer version branches + +- Incorrect or missing insertId/rowsAffected in results for INSERT/UPDATE/DELETE SQL statements with extra semicolon(s) in the beginning for Android (android.database implementation) - In case of an error, the error `code` member is bogus on Android - iOS platform version generates extra logging in release version - iOS platform version may crash if deleteDatabase is called with an object in place of the database name - readTransaction does not reject ALTER, REINDEX, and REPLACE operations -- readTransaction does not reject modification statements with extra semicolon(s) in the beginning -- extra executeSql callbacks triggered in a transaction after a failure that was not recovered by an error callback that returns false +- readTransaction does *not* reject modification statements with extra semicolon(s) in the beginning +- extra executeSql callbacks triggered in a transaction after a failure that was not recovered by an error callback (by returning false) - does not signal an error in case of excess parameter argument values given on iOS/macOS @@ -179,17 +180,17 @@ Issues fixed in some newer version branches: - ~~The db version, display name, and size parameter values are not supported and will be ignored.~~ (No longer supported by the API) - Absolute and relative subdirectory path(s) are not tested or supported. - This plugin will not work before the callback for the 'deviceready' event has been fired, as described in **Usage**. (This is consistent with the other Cordova plugins.) -- Extremely large records are not supported by this plugin version. TBD: specify maximum record; FUTURE TBD: to be fixed in [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) (available with GPL or commercial license options) -- This plugin version will not work within a web worker (not properly supported by the Cordova framework). Use within a web worker is supported for Android/iOS in: [litehelpers / Cordova-sqlite-evplus-legacy-workers-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-workers-free) (available with GPL or premium commercial license options) +- Extremely large records are not supported by this plugin. It is recommended to store images and similar binary data in separate files. TBD: specify maximum record. For future consideration: support in a version such as [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) (available with GPL or commercial license options) +- This plugin version will not work within a web worker (not properly supported by the Cordova framework). Use within a web worker is supported for Android/iOS in [litehelpers / cordova-sqlite-evmax-ext-workers-legacy-build-free](https://github.com/litehelpers/cordova-sqlite-evmax-ext-workers-legacy-build-free) (GPL or premium commercial license terms). - In-memory database `db=window.sqlitePlugin.openDatabase({name: ':memory:', ...})` is currently not supported. -- The Android version cannot work with more than 100 open db files (due to the threading model used). -- UNICODE `\u2028` (line separator) and `\u2029` (paragraph separator) characters are currently not supported and known to be broken in iOS, macOS, and Android version due to JSON issues reported in [Cordova bug CB-9435](https://issues.apache.org/jira/browse/CB-9435) and [cordova/cordova-discuss#57](https://github.com/cordova/cordova-discuss/issues/57). There *may* be a similar issue with certain other UNICODE characters in the iOS/macOS version (needs further investigation). This is fixed for iOS in: [litehelpers / Cordova-sqlite-evplus-legacy-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-free) and [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) (available with GPL or special commercial license options) as well as [litehelpers / Cordova-sqlite-evplus-legacy-workers-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-workers-free) (available with GPL or premium commercial license options) +- The Android platform version cannot properly support more than 100 open database files due to the threading model used. +- UNICODE `\u2028` (line separator) and `\u2029` (paragraph separator) characters are currently not supported and known to be broken on iOS, macOS, and Android platform versions due to JSON issues reported in [Cordova bug CB-9435](https://issues.apache.org/jira/browse/CB-9435) and [cordova/cordova-discuss#57](https://github.com/cordova/cordova-discuss/issues/57). This is fixed with a workaround for iOS/macOS in: [litehelpers / Cordova-sqlite-evplus-legacy-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-free) and [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) (available with GPL or special commercial license options) as well as [litehelpers / Cordova-sqlite-evplus-legacy-workers-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-workers-free) (available with GPL or premium commercial license options) - The BLOB data type is not fully supported by this version branch. SELECT BLOB in Base64 format is supported by [litehelpers / cordova-sqlite-ext](https://github.com/litehelpers/cordova-sqlite-ext) (permissive license terms) and [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) (GPL or commercial license options). - Truncation in case of UNICODE `\u0000` (same as `\0`) character on Android - Case-insensitive matching and other string manipulations on Unicode characters, which is provided by optional ICU integration in the sqlite source and working with recent versions of Android, is not supported for any target platforms. -- iOS/macOS platform version uses a thread pool but with only one thread working at a time due to "synchronized" database access +- The iOS/macOS platform version uses a thread pool but with only one thread working at a time due to "synchronized" database access. - Some large query results may be slow, also due to the JSON implementation. -- ATTACH to another database file is not supported by this version. Attach/detach is supported (along with the memory and iOS UNICODE `\u2028` line separator / `\u2029` paragraph separator fixes) in: [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) (available with GPL or special commercial license options) +- ATTACH to another database file is not supported by this version branch. Attach/detach is supported (along with the memory and iOS UNICODE `\u2028` line separator / `\u2029` paragraph separator fixes) in [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) (available with GPL or special commercial license terms). - UPDATE/DELETE with LIMIT or ORDER BY is not supported. - WITH clause is not supported by some older Android/iOS versions. - User-defined savepoints are not supported and not expected to be compatible with the transaction locking mechanism used by this plugin. In addition, the use of BEGIN/COMMIT/ROLLBACK statements is not supported. @@ -259,8 +260,14 @@ Documented in: [brodybits / Avoiding-some-Cordova-pitfalls](https://github.com/b ## Major TODOs -- Integrate with IndexedDBShim and some other libraries such as Sequelize, Squel.js, WebSqlSync, Persistence.js, Knex, etc. -- Version with proper BLOB support +- More formal documentation of API, especially for non-standard functions +- Browser platform +- IndexedDBShim adapter +- Further cleanup of [support](#support) section +- Resolve or document remaining [open Cordova-sqlite-storage bugs](https://github.com/litehelpers/Cordova-sqlite-storage/issues?q=is%3Aissue+is%3Aopen+label%3Abug-general) +- Resolve [cordova-sqlite-help doc-todo issues](https://github.com/litehelpers/Cordova-sqlite-help/issues?q=is%3Aissue%20label%3Adoc-todo) and [cordova-sqlite-storage doc-todo issues](https://github.com/litehelpers/Cordova-sqlite-storage/issues?q=is%3Aissue+is%3Aopen+label%3Adoc-todo) + + ## For future considertion @@ -269,19 +276,20 @@ Documented in: [brodybits / Avoiding-some-Cordova-pitfalls](https://github.com/b ## Alternatives -### Other versions +### Comparison of sqlite plugin versions -- [litehelpers / cordova-sqlite-ext](https://github.com/litehelpers/cordova-sqlite-ext) - version with REGEXP (Android/iOS/macOS), SELECT BLOB in Base64 format (all platforms Android/iOS/macOS/Windows), and pre-populated databases (all platforms Android/iOS/macOS/Windows) -- [litehelpers / Cordova-sqlite-legacy-build-support](https://github.com/litehelpers/Cordova-sqlite-legacy-build-support) - maintenance of WP8 version along with Windows 8.1/Windows Phone 8.1 and the other supported platforms Android/iOS/macOS/Windows 10; limited support for PhoneGap CLI/PhoneGap Build/plugman/Intel XDK; limited testing; limited updates +- [litehelpers / Cordova-sqlite-storage](https://github.com/litehelpers/Cordova-sqlite-storage) - core version for Android/iOS/macOS/Windows (permissive license terms) +- [litehelpers / cordova-sqlite-ext](https://github.com/litehelpers/cordova-sqlite-ext) - version with REGEXP (Android/iOS/macOS), SELECT BLOB in Base64 format (all platforms Android/iOS/macOS/Windows), and pre-populated databases (all platforms Android/iOS/macOS/Windows). Permissive license terms. +- [litehelpers / Cordova-sqlite-legacy-build-support](https://github.com/litehelpers/Cordova-sqlite-legacy-build-support) - maintenance of WP8 version along with Windows 8.1/Windows Phone 8.1 and the other supported platforms Android/iOS/macOS/Windows 10; limited support for PhoneGap CLI/PhoneGap Build/plugman/Intel XDK; limited testing; limited updates. Permissive license terms. - [litehelpers / Cordova-sqlcipher-adapter](https://github.com/litehelpers/Cordova-sqlcipher-adapter) - supports [SQLCipher](https://www.zetetic.net/sqlcipher/) for Android/iOS/macOS/Windows -- [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) - Enhancements for Android: JSON and SQL statement handling implemented in C, supports larger transactions and handles large SQL batches in less than half the time as this version. Supports arbitrary database location on Android. Support for build environments such as PhoneGap Build and Intel XDK. Available with GPL or commercial license options. Also includes REGEXP (Android/iOS/macOS) and SELECT BLOB in Base64 format (all platforms Android/iOS/macOS/Windows). -- [litehelpers / Cordova-sqlite-evplus-legacy-workers-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-workers-free) - version with support for web workers, includes internal memory improvements to support larger transactions (Android/iOS) and fix to support all Unicode characters (iOS) (with GPL or premium commercial license options) -- [litehelpers / Cordova-sqlite-evplus-legacy-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-free) - internal memory improvements to support larger transactions (Android/iOS) and fix to support all Unicode characters (iOS) - with GPL or special commercial license options -- [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) - version with support for ATTACH, includes internal memory improvements to support larger transactions (Android/iOS) and fix to support all Unicode characters (with GPL or special commercial license options) -- Adaptation for React Native Android and iOS: [andpor / react-native-sqlite-storage](https://github.com/andpor/react-native-sqlite-storage) -- Original version for iOS (with a slightly different transaction API): [davibe / Phonegap-SQLitePlugin](https://github.com/davibe/Phonegap-SQLitePlugin) +- [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) - Enhancements for Android: JSON and SQL statement handling implemented in C, supports larger transactions and handles large SQL batches in less than half the time as this version. Supports arbitrary database location on Android. Support for build environments such as PhoneGap Build and Intel XDK. Also includes REGEXP (Android/iOS/macOS) and SELECT BLOB in Base64 format (all platforms Android/iOS/macOS/Windows). GPL or commercial license terms. +- [litehelpers / cordova-sqlite-evplus-ext-legacy-build-free](https://github.com/litehelpers/cordova-sqlite-evplus-ext-legacy-build-free) - internal memory improvements to support larger transactions (Android/iOS) and fix to support all Unicode characters (iOS). (GPL or special commercial license terms). +- [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) - version with support for ATTACH, includes internal memory improvements to support larger transactions (Android/iOS) and fix to support all Unicode characters (GPL or special commercial license terms). +- [litehelpers / cordova-sqlite-evmax-ext-workers-legacy-build-free](https://github.com/litehelpers/cordova-sqlite-evmax-ext-workers-legacy-build-free) - version with support for web workers, includes internal memory improvements to support larger transactions (Android/iOS) and fix to support all Unicode characters (iOS). (GPL or premium commercial license terms). +- Adaptation for React Native Android and iOS: [andpor / react-native-sqlite-storage](https://github.com/andpor/react-native-sqlite-storage) (permissive license terms) +- Original version for iOS (with a non-standard, outdated transaction API): [davibe / Phonegap-SQLitePlugin](https://github.com/davibe/Phonegap-SQLitePlugin) (permissive license terms) - + ### Other SQLite adapter projects @@ -303,7 +311,6 @@ Documented in: [brodybits / Avoiding-some-Cordova-pitfalls](https://github.com/b - Use [phearme / cordova-ContentProviderPlugin](https://github.com/phearme/cordova-ContentProviderPlugin) to query content providers on Android devices - [ABB-Austin / cordova-plugin-indexeddb-async](https://github.com/ABB-Austin/cordova-plugin-indexeddb-async) - Asynchronous IndexedDB plugin for Cordova that uses [axemclion / IndexedDBShim](https://github.com/axemclion/IndexedDBShim) (Browser/iOS/Android/Windows) and [Thinkwise / cordova-plugin-websql](https://github.com/Thinkwise/cordova-plugin-websql) - (Windows) -- Another sqlite binding for React-Native (iOS version): [almost/react-native-sqlite](https://github.com/almost/react-native-sqlite) - Use [NativeScript](https://www.nativescript.org) with its web view and [NathanaelA / nativescript-sqlite](https://github.com/Natha naelA/nativescript-sqlite) (Android and/or iOS) - Standard HTML5 [local storage](https://en.wikipedia.org/wiki/Web_storage#localStorage) @@ -421,7 +428,7 @@ window.openDatabase = function(dbname, ignored1, ignored2, ignored3) { ### Workaround for Android db locking issue -[litehelpers/Cordova-sqlite-storage#193](https://github.com/litehelpers/Cordova-sqlite-storage/issues/193) was reported (as observed by several app developers) that on some newer versions of the Android database classes, if the app is stopped or aborted without closing the database then: +[litehelpers/Cordova-sqlite-storage#193](https://github.com/litehelpers/Cordova-sqlite-storage/issues/193) reported (as observed by a number of app developers in the past) that when using the `androidDatabaseImplementation: 2` setting on certain Android versions and if the app is stopped or aborted without closing the database then: - (sometimes) there is an unexpected database lock - the data that was inserted is lost. @@ -746,7 +753,7 @@ db.executeSql("SELECT LENGTH('tenletters') AS stringlength", [], function (res) }); ``` -**SECOND BUG:** When a database connection is closed, any queued transactions are left hanging. All pending transactions should be errored when a database connection is closed. +**SECOND BUG:** When a database connection is closed, any queued transactions are left hanging. TODO: All pending transactions should be errored whenever a database connection is closed. **NOTE:** As described above, if multiple database access handle objects are opened for the same database and one database handle access object is closed, the database is no longer available for the other database handle objects. Possible workarounds: - It is still possible to open one or more new database handle objects on a database that has been closed. @@ -806,7 +813,7 @@ Other resource (apparently for Ionic 1): -## Source tree - -- `SQLitePlugin.coffee.md`: platform-independent (Literate coffee-script, can be read by recent coffee-script compiler) -- `www`: `SQLitePlugin.js` platform-independent Javascript as generated from `SQLitePlugin.coffee.md` (and checked in!) -- `src`: platform-specific source code -- `spec`: test suite using Jasmine (2.2.0) -- `tests`: very simple Jasmine test suite that is run on Circle CI (Android version) and Travis CI (iOS version) (used as a placeholder) - ## Installation test ### Easy installation test @@ -970,6 +969,18 @@ To run from a windows powershell (here is a sample for android target): - [nolanlawson / pouchdb-adapter-cordova-sqlite](https://github.com/nolanlawson/pouchdb-adapter-cordova-sqlite) + + +## Source tree + +- `SQLitePlugin.coffee.md`: platform-independent (Literate CoffeeScript, can be compiled with a recent CoffeeScript compiler) +- `www`: platform-independent Javascript as generated from `SQLitePlugin.coffee.md` (and committed!) +- `src`: platform-specific source code +- `spec`: test suite using Jasmine +- `tests`: very simple Jasmine test suite that is run on Circle CI (Android platform) and Travis CI (iOS platform) (used as a placeholder) + + + # Contributing ## Community From 4e80bd334a30c37f5686c5210c4905ede87cc51c Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Fri, 8 Dec 2017 12:36:41 -0500 Subject: [PATCH 06/12] package.json style add "cordova-osx" to keywords --- CHANGES.md | 2 +- package.json | 6 ++++-- plugin.xml | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7c410120d..b21ae4104 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,6 @@ # Changes -###### cordova-sqlite-legacy-express-core 1.0.3-pre0 +###### cordova-sqlite-legacy-express-core 1.0.3-pre01 TBD diff --git a/package.json b/package.json index 3dbde39e9..a925020b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-sqlite-legacy-express-core", - "version": "1.0.3-pre0", + "version": "1.0.3-pre01", "description": "Native interface to SQLite for PhoneGap/Cordova (legacy express core version)", "cordova": { "id": "cordova-sqlite-legacy-express-core", @@ -19,7 +19,9 @@ "sqlite", "ecosystem:cordova", "cordova-android", - "cordova-ios" + "cordova-ios", + "cordova-osx", + "xx" ], "author": "various", "license": "MIT", diff --git a/plugin.xml b/plugin.xml index 0bcd25e70..b196fa4c9 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="1.0.3-pre01"> Cordova sqlite storage plugin - legacy express core version From a61b96518bae93b9567cbbf5564916e6ae30d0a3 Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Sat, 9 Dec 2017 21:21:20 -0500 Subject: [PATCH 07/12] Update delete test (do not ignore delete error on any platform) --- spec/www/spec/db-open-close-delete-test.js | 48 ++++++++++++++-------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/spec/www/spec/db-open-close-delete-test.js b/spec/www/spec/db-open-close-delete-test.js index 31d710f8c..350316932 100755 --- a/spec/www/spec/db-open-close-delete-test.js +++ b/spec/www/spec/db-open-close-delete-test.js @@ -143,8 +143,7 @@ var mytests = function() { } } - test_it(suiteName + ' test sqlitePlugin.deleteDatabase()', function () { - stop(); + it(suiteName + ' test sqlitePlugin.deleteDatabase()', function (done) { var db = openDatabase("DB-Deletable", "1.0", "Demo", DEFAULT_SIZE); function createAndInsertStuff() { @@ -155,9 +154,14 @@ var mytests = function() { tx.executeSql('INSERT INTO test VALUES (?)', ['foo']); }); }, function (err) { - ok(false, 'create and insert tx failed with ERROR: ' + JSON.stringify(err)); + // NOT EXPECTED: console.log('create and insert tx failed with ERROR: ' + JSON.stringify(err)); - start(); + expect(false).toBe(true); + expect(err).toBeDefined(); + expect(err.message).toBeDefined(); + expect(err.message).toBe('--'); + done(); + }, function () { // check that we can read it db.transaction(function(tx) { @@ -165,9 +169,13 @@ var mytests = function() { equal(res.rows.item(0).name, 'foo'); }); }, function (err) { - ok(false, 'SELECT tx failed with ERROR: ' + JSON.stringify(err)); + // NOT EXPECTED: console.log('SELECT tx failed with ERROR: ' + JSON.stringify(err)); - start(); + expect(false).toBe(true); + expect(err).toBeDefined(); + expect(err.message).toBeDefined(); + expect(err.message).toBe('--'); + done(); }, function () { deleteAndConfirmDeleted(); }); @@ -182,30 +190,38 @@ var mytests = function() { db.transaction(function (tx) { tx.executeSql('SELECT name FROM test', []); }, function (err) { - ok(true, 'got an expected transaction error'); + // EXPECTED RESULT: + expect(err).toBeDefined(); + expect(err.message).toBeDefined(); testDeleteError(); }, function () { + // SUCCESS CALLBACK NOT EXPECTED: console.log('UNEXPECTED SUCCESS: expected a transaction error'); - ok(false, 'expected a transaction error'); - start(); + expect(false).toBe(true); + done(); }); }, function (err) { + // NOT EXPECTED - DO NOT IGNORE ON ANY PLATFORM: console.log("ERROR: " + JSON.stringify(err)); - ok(false, 'error: ' + err); - start(); + expect(false).toBe(true); + expect(err).toBeDefined(); + expect(err.message).toBeDefined(); + expect(err.message).toBe('--'); + done(); }); } function testDeleteError() { // should throw an error if the db doesn't exist deleteDatabase("Foo-Doesnt-Exist", function () { + // SUCCESS CALLBACK NOT EXPECTED: console.log('UNEXPECTED SUCCESS: expected a delete error'); - ok(false, 'expected error'); - start(); + expect(false).toBe(true); + done(); }, function (err) { - ok(!!err, 'got error like we expected'); - - start(); + // EXPECTED RESULT: + expect(err).toBeDefined(); + done(); }); } From 452d3c9c01aa68f2ad1ce886bf10f13382cc36eb Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Sat, 9 Dec 2017 21:57:16 -0500 Subject: [PATCH 08/12] selfTest database cleanup fixes - cleanup (delete) database in separate step - do not ignore close or delete error on any platforms - fix logging & return statements --- CHANGES.md | 4 ++-- SQLitePlugin.coffee.md | 39 ++++++++++++++++++++++----------------- package.json | 2 +- plugin.xml | 2 +- www/SQLitePlugin.js | 37 ++++++++++++++----------------------- 5 files changed, 40 insertions(+), 44 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index b21ae4104..b4ad1a9c3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,8 +1,8 @@ # Changes -###### cordova-sqlite-legacy-express-core 1.0.3-pre01 +###### cordova-sqlite-legacy-express-core 1.0.3-pre02 -TBD +- selfTest database cleanup do not ignore close or delete error on any platforms ###### cordova-sqlite-legacy-express-core 1.0.2 diff --git a/SQLitePlugin.coffee.md b/SQLitePlugin.coffee.md index a3dc8c066..bb4312d05 100644 --- a/SQLitePlugin.coffee.md +++ b/SQLitePlugin.coffee.md @@ -881,24 +881,20 @@ , (tx2_err) -> SelfTest.finishWithError errorcb, "readTransaction error: #{tx2_err}" + , () -> - # CLEANUP & FINISH: - db.close () -> - SQLiteFactory.deleteDatabase {name: SelfTest.DBNAME, location: 'default'}, successcb, (cleanup_err)-> - # TBD IGNORE THIS ERROR on Windows (and WP8): - if /Windows /.test(navigator.userAgent) or /IEMobile/.test(navigator.userAgent) - console.log "IGNORE CLEANUP (DELETE) ERROR: #{JSON.stringify cleanup_err} (Windows/WP8)" - successcb() + + # CLEANUP & FINISH: + db.close () -> + SelfTest.cleanupAndFinish successcb, errorcb + return + + , (close_err) -> + # DO NOT IGNORE CLOSE ERROR ON ANY PLATFORM: + SelfTest.finishWithError errorcb, "close error: #{close_err}" return - SelfTest.finishWithError errorcb, "Cleanup error: #{cleanup_err}" - , (close_err) -> - # TBD IGNORE THIS ERROR on Windows (and WP8): - if /Windows /.test(navigator.userAgent) or /IEMobile/.test(navigator.userAgent) - console.log "IGNORE close ERROR: #{JSON.stringify close_err} (Windows/WP8)" - SQLiteFactory.deleteDatabase {name: SelfTest.DBNAME, location: 'default'}, successcb, successcb return - SelfTest.finishWithError errorcb, "close error: #{close_err}" , (select_err) -> SelfTest.finishWithError errorcb, "SELECT error: #{select_err}" @@ -910,13 +906,22 @@ SelfTest.finishWithError errorcb, "Open database error: #{open_err}" return + cleanupAndFinish: (successcb, errorcb) -> + SQLiteFactory.deleteDatabase {name: SelfTest.DBNAME, location: 'default'}, successcb, (cleanup_err)-> + # DO NOT IGNORE CLEANUP DELETE ERROR ON ANY PLATFORM: + SelfTest.finishWithError errorcb, "CLEANUP DELETE ERROR: #{cleanup_err}" + return + return + finishWithError: (errorcb, message) -> console.log "selfTest ERROR with message: #{message}" SQLiteFactory.deleteDatabase {name: SelfTest.DBNAME, location: 'default'}, -> errorcb newSQLError message - # FUTURE TODO: return - # FUTURE TODO log err2 - , (err2)-> errorcb newSQLError "Cleanup error: #{err2} for error: #{message}" + return + , (err2)-> + console.log "selfTest CLEANUP DELETE ERROR #{err2}" + errorcb newSQLError "CLEANUP DELETE ERROR: #{err2} for error: #{message}" + return return ## Exported API: diff --git a/package.json b/package.json index a925020b4..aeea63637 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-sqlite-legacy-express-core", - "version": "1.0.3-pre01", + "version": "1.0.3-pre02", "description": "Native interface to SQLite for PhoneGap/Cordova (legacy express core version)", "cordova": { "id": "cordova-sqlite-legacy-express-core", diff --git a/plugin.xml b/plugin.xml index b196fa4c9..e7b3ecbdf 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="1.0.3-pre02"> Cordova sqlite storage plugin - legacy express core version diff --git a/www/SQLitePlugin.js b/www/SQLitePlugin.js index 6d612d448..03cb363d7 100644 --- a/www/SQLitePlugin.js +++ b/www/SQLitePlugin.js @@ -762,28 +762,10 @@ }, function(tx2_err) { return SelfTest.finishWithError(errorcb, "readTransaction error: " + tx2_err); }, function() { - return db.close(function() { - return SQLiteFactory.deleteDatabase({ - name: SelfTest.DBNAME, - location: 'default' - }, successcb, function(cleanup_err) { - if (/Windows /.test(navigator.userAgent) || /IEMobile/.test(navigator.userAgent)) { - console.log("IGNORE CLEANUP (DELETE) ERROR: " + (JSON.stringify(cleanup_err)) + " (Windows/WP8)"); - successcb(); - return; - } - return SelfTest.finishWithError(errorcb, "Cleanup error: " + cleanup_err); - }); + db.close(function() { + SelfTest.cleanupAndFinish(successcb, errorcb); }, function(close_err) { - if (/Windows /.test(navigator.userAgent) || /IEMobile/.test(navigator.userAgent)) { - console.log("IGNORE close ERROR: " + (JSON.stringify(close_err)) + " (Windows/WP8)"); - SQLiteFactory.deleteDatabase({ - name: SelfTest.DBNAME, - location: 'default' - }, successcb, successcb); - return; - } - return SelfTest.finishWithError(errorcb, "close error: " + close_err); + SelfTest.finishWithError(errorcb, "close error: " + close_err); }); }); }); @@ -797,15 +779,24 @@ return SelfTest.finishWithError(errorcb, "Open database error: " + open_err); }); }, + cleanupAndFinish: function(successcb, errorcb) { + SQLiteFactory.deleteDatabase({ + name: SelfTest.DBNAME, + location: 'default' + }, successcb, function(cleanup_err) { + SelfTest.finishWithError(errorcb, "CLEANUP DELETE ERROR: " + cleanup_err); + }); + }, finishWithError: function(errorcb, message) { console.log("selfTest ERROR with message: " + message); SQLiteFactory.deleteDatabase({ name: SelfTest.DBNAME, location: 'default' }, function() { - return errorcb(newSQLError(message)); + errorcb(newSQLError(message)); }, function(err2) { - return errorcb(newSQLError("Cleanup error: " + err2 + " for error: " + message)); + console.log("selfTest CLEANUP DELETE ERROR " + err2); + errorcb(newSQLError("CLEANUP DELETE ERROR: " + err2 + " for error: " + message)); }); } }; From b656b89b0a56c4545298eb973d51977d4126d041 Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Sun, 10 Dec 2017 10:16:02 -0500 Subject: [PATCH 09/12] General doc fixes & updates --- README.md | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 6487971e6..6c1367a8f 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ Use the `location` or `iosDatabaseLocation` option in `sqlitePlugin.openDatabase - Published [brodybits / Cordova-quick-start-checklist](https://github.com/brodybits/Cordova-quick-start-checklist) and [brodybits / Avoiding-some-Cordova-pitfalls](https://github.com/brodybits/Avoiding-some-Cordova-pitfalls). - Self-test functions to verify proper installation and operation of this plugin - More explicit `openDatabase` and `deleteDatabase` `iosDatabaseLocation` option -- Added simple sql batch function +- Added straightforward sql batch function - [MetaMemoryT / websql-promise](https://github.com/MetaMemoryT/websql-promise) now provides a Promises-based interface to both Web SQL and this plugin - [SQLCipher](https://www.zetetic.net/sqlcipher/) for Android/iOS/macOS/Windows is supported by [litehelpers / Cordova-sqlcipher-adapter](https://github.com/litehelpers/Cordova-sqlcipher-adapter) @@ -150,7 +150,7 @@ As "strongly recommended" by [Web SQL Database API 8.5 SQL injection](https://ww ## Known issues -- iOS/macOS platform version does not support certain rapidly repeated open-and-close or open-and-delete test scenarios due to how the implementation handles background processing +- The iOS/macOS platform versions do not support certain rapidly repeated open-and-close or open-and-delete test scenarios due to how the implementation handles background processing - As described below, auto-vacuum is NOT enabled by default. - It is possible to request a SQL statement list such as "SELECT 1; SELECT 2" within a single SQL statement string, however the plugin will only execute the first statement and silently ignore the others ref: [litehelpers/Cordova-sqlite-storage#551](https://github.com/litehelpers/Cordova-sqlite-storage/issues/551) - Execution of INSERT statement that affects multiple rows (due to SELECT cause or using TRIGGER(s), for example) does not report proper rowsAffected on Android @@ -173,6 +173,8 @@ As "strongly recommended" by [Web SQL Database API 8.5 SQL injection](https://ww - extra executeSql callbacks triggered in a transaction after a failure that was not recovered by an error callback (by returning false) - does not signal an error in case of excess parameter argument values given on iOS/macOS +Some additional issues are tracked in [open Cordova-sqlite-storage bug-general issues](https://github.com/litehelpers/Cordova-sqlite-storage/issues?q=is%3Aissue+is%3Aopen+label%3Abug-general). + ## Other limitations @@ -180,23 +182,25 @@ As "strongly recommended" by [Web SQL Database API 8.5 SQL injection](https://ww - ~~The db version, display name, and size parameter values are not supported and will be ignored.~~ (No longer supported by the API) - Absolute and relative subdirectory path(s) are not tested or supported. - This plugin will not work before the callback for the 'deviceready' event has been fired, as described in **Usage**. (This is consistent with the other Cordova plugins.) -- Extremely large records are not supported by this plugin. It is recommended to store images and similar binary data in separate files. TBD: specify maximum record. For future consideration: support in a version such as [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) (available with GPL or commercial license options) +- Extremely large records are not supported by this plugin. It is recommended to store images and similar binary data in separate files. TBD: specify maximum record. For future consideration: support in a version such as [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) (GPL or commercial license terms). - This plugin version will not work within a web worker (not properly supported by the Cordova framework). Use within a web worker is supported for Android/iOS in [litehelpers / cordova-sqlite-evmax-ext-workers-legacy-build-free](https://github.com/litehelpers/cordova-sqlite-evmax-ext-workers-legacy-build-free) (GPL or premium commercial license terms). - In-memory database `db=window.sqlitePlugin.openDatabase({name: ':memory:', ...})` is currently not supported. - The Android platform version cannot properly support more than 100 open database files due to the threading model used. -- UNICODE `\u2028` (line separator) and `\u2029` (paragraph separator) characters are currently not supported and known to be broken on iOS, macOS, and Android platform versions due to JSON issues reported in [Cordova bug CB-9435](https://issues.apache.org/jira/browse/CB-9435) and [cordova/cordova-discuss#57](https://github.com/cordova/cordova-discuss/issues/57). This is fixed with a workaround for iOS/macOS in: [litehelpers / Cordova-sqlite-evplus-legacy-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-free) and [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) (available with GPL or special commercial license options) as well as [litehelpers / Cordova-sqlite-evplus-legacy-workers-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-workers-free) (available with GPL or premium commercial license options) +- UNICODE `\u2028` (line separator) and `\u2029` (paragraph separator) characters are currently not supported and known to be broken on iOS, macOS, and Android platform versions due to JSON issues reported in [Cordova bug CB-9435](https://issues.apache.org/jira/browse/CB-9435) and [cordova/cordova-discuss#57](https://github.com/cordova/cordova-discuss/issues/57). This is fixed with a workaround for iOS/macOS in: [litehelpers / Cordova-sqlite-evplus-legacy-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-free) and [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) (GPL or special commercial license terms) as well as [litehelpers / Cordova-sqlite-evplus-legacy-workers-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-workers-free) (GPL or premium commercial license terms). - The BLOB data type is not fully supported by this version branch. SELECT BLOB in Base64 format is supported by [litehelpers / cordova-sqlite-ext](https://github.com/litehelpers/cordova-sqlite-ext) (permissive license terms) and [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) (GPL or commercial license options). - Truncation in case of UNICODE `\u0000` (same as `\0`) character on Android - Case-insensitive matching and other string manipulations on Unicode characters, which is provided by optional ICU integration in the sqlite source and working with recent versions of Android, is not supported for any target platforms. - The iOS/macOS platform version uses a thread pool but with only one thread working at a time due to "synchronized" database access. - Some large query results may be slow, also due to the JSON implementation. -- ATTACH to another database file is not supported by this version branch. Attach/detach is supported (along with the memory and iOS UNICODE `\u2028` line separator / `\u2029` paragraph separator fixes) in [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) (available with GPL or special commercial license terms). +- ATTACH to another database file is not supported by this version branch. Attach/detach is supported (along with the memory and iOS UNICODE `\u2028` line separator / `\u2029` paragraph separator fixes) in [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) (GPL or special commercial license terms). - UPDATE/DELETE with LIMIT or ORDER BY is not supported. - WITH clause is not supported by some older Android/iOS versions. - User-defined savepoints are not supported and not expected to be compatible with the transaction locking mechanism used by this plugin. In addition, the use of BEGIN/COMMIT/ROLLBACK statements is not supported. - Problems have been reported when using this plugin with Crosswalk (for Android). It may help to install Crosswalk as a plugin instead of using Crosswalk to create the project. - Does not work with [axemclion / react-native-cordova-plugin](https://github.com/axemclion/react-native-cordova-plugin) since the `window.sqlitePlugin` object is *not* properly exported (ES5 feature). It is recommended to use [andpor / react-native-sqlite-storage](https://github.com/andpor/react-native-sqlite-storage) for SQLite database access with React Native Android/iOS instead. +Additional limitations are tracked in [open Cordova-sqlite-storage doc-todo issues](https://github.com/litehelpers/Cordova-sqlite-storage/issues?q=is%3Aissue+is%3Aopen+label%3Adoc-todo). + ## Further testing needed @@ -209,7 +213,7 @@ As "strongly recommended" by [Web SQL Database API 8.5 SQL injection](https://ww - Actual behavior when using SAVEPOINT(s) - R-Tree is not fully tested with Android - UNICODE characters not fully tested -- Use with TRIGGER(s), JOIN and ORDER BY RANDOM +- ORDER BY RANDOM() (ref: [litehelpers/Cordova-sqlite-storage#334](https://github.com/litehelpers/Cordova-sqlite-storage/issues/334)) - UPDATE/DELETE with LIMIT or ORDER BY (newer Android/iOS versions) - Integration with JXCore for Cordova (must be built without sqlite(3) built-in) - Delete an open database inside a statement or transaction callback. @@ -262,7 +266,7 @@ Documented in: [brodybits / Avoiding-some-Cordova-pitfalls](https://github.com/b - More formal documentation of API, especially for non-standard functions - Browser platform -- IndexedDBShim adapter +- IndexedDBShim adapter (possibly based on IndexedDBShim) - Further cleanup of [support](#support) section - Resolve or document remaining [open Cordova-sqlite-storage bugs](https://github.com/litehelpers/Cordova-sqlite-storage/issues?q=is%3Aissue+is%3Aopen+label%3Abug-general) - Resolve [cordova-sqlite-help doc-todo issues](https://github.com/litehelpers/Cordova-sqlite-help/issues?q=is%3Aissue%20label%3Adoc-todo) and [cordova-sqlite-storage doc-todo issues](https://github.com/litehelpers/Cordova-sqlite-storage/issues?q=is%3Aissue+is%3Aopen+label%3Adoc-todo) @@ -272,7 +276,10 @@ Documented in: [brodybits / Avoiding-some-Cordova-pitfalls](https://github.com/b ## For future considertion - Auto-vacuum option -- Browser platform +- Support for extremely large records in a version such as [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) (available with GPL or commercial license options) +- Integrate with some other libraries such as Sequelize, Squel.js, WebSqlSync, Persistence.js, Knex, etc. + + ## Alternatives @@ -875,7 +882,7 @@ Free support is provided on a best-effort basis and is only available in public Commercial support is available by contacting: -## Before asking for help +## Before seeking help First steps: - Verify that you have followed the steps in [brodybits / Cordova-quick-start-checklist](https://github.com/brodybits/Cordova-quick-start-checklist) @@ -961,6 +968,8 @@ To run from a windows powershell (here is a sample for android target): # Adapters +**GENERAL:** The adapters described here are community maintained. + ## Lawnchair Adapter - [litehelpers / cordova-sqlite-lawnchair-adapter](https://github.com/litehelpers/cordova-sqlite-lawnchair-adapter) @@ -969,12 +978,16 @@ To run from a windows powershell (here is a sample for android target): - [nolanlawson / pouchdb-adapter-cordova-sqlite](https://github.com/nolanlawson/pouchdb-adapter-cordova-sqlite) +## Adapters wanted + +- IndexedDBShim adapter (possibly based on IndexedDBShim) + ## Source tree -- `SQLitePlugin.coffee.md`: platform-independent (Literate CoffeeScript, can be compiled with a recent CoffeeScript compiler) -- `www`: platform-independent Javascript as generated from `SQLitePlugin.coffee.md` (and committed!) +- `SQLitePlugin.coffee.md`: platform-independent (Literate CoffeeScript, can be compiled with a recent CoffeeScript (1.x) compiler) +- `www`: platform-independent Javascript as generated from `SQLitePlugin.coffee.md` using `coffeescript@1` (and committed!) - `src`: platform-specific source code - `spec`: test suite using Jasmine - `tests`: very simple Jasmine test suite that is run on Circle CI (Android platform) and Travis CI (iOS platform) (used as a placeholder) From 4c7b59c085db405b191c2ef50e8de538dc4010cf Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Sun, 10 Dec 2017 18:32:38 -0500 Subject: [PATCH 10/12] Resolve Java 6/7/8 concurrent map compatibility & cleanup imports for Android MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FIXES litehelpers/Cordova-sqlite-storage#726 (keySet error) THANKS to @NeoLSN (Jason Yang/楊朝傑) for pointer to the solution in litehelpers/Cordova-sqlite-storage#727 --- CHANGES.md | 3 ++- README.md | 1 + package.json | 2 +- plugin.xml | 2 +- src/android/io/sqlc/SQLitePlugin.java | 28 +++++++++++++++++---------- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index b4ad1a9c3..e43f50c94 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,8 @@ # Changes -###### cordova-sqlite-legacy-express-core 1.0.3-pre02 +###### cordova-sqlite-legacy-express-core 1.0.3 +- Resolve Java 6/7/8 concurrent map compatibility issue reported in litehelpers/Cordova-sqlite-storage#726, THANKS to pointer by @NeoLSN (Jason Yang/楊朝傑) in litehelpers/Cordova-sqlite-storage#727. - selfTest database cleanup do not ignore close or delete error on any platforms ###### cordova-sqlite-legacy-express-core 1.0.2 diff --git a/README.md b/README.md index 6c1367a8f..cbf649a96 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ Use the `location` or `iosDatabaseLocation` option in `sqlitePlugin.openDatabase ## Announcements +- 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). - 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) - Resolved transaction problem after window.location (page) change with possible data loss ref: [litehelpers/Cordova-sqlite-storage#666](https://github.com/litehelpers/Cordova-sqlite-storage/issues/666) - [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. diff --git a/package.json b/package.json index aeea63637..c63251245 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-sqlite-legacy-express-core", - "version": "1.0.3-pre02", + "version": "1.0.3", "description": "Native interface to SQLite for PhoneGap/Cordova (legacy express core version)", "cordova": { "id": "cordova-sqlite-legacy-express-core", diff --git a/plugin.xml b/plugin.xml index e7b3ecbdf..11689aa60 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="1.0.3"> Cordova sqlite storage plugin - legacy express core version diff --git a/src/android/io/sqlc/SQLitePlugin.java b/src/android/io/sqlc/SQLitePlugin.java index 9ad6d49e4..f4fb74cf8 100755 --- a/src/android/io/sqlc/SQLitePlugin.java +++ b/src/android/io/sqlc/SQLitePlugin.java @@ -8,15 +8,18 @@ import android.annotation.SuppressLint; -import android.util.Base64; import android.util.Log; import java.io.File; + import java.lang.IllegalArgumentException; import java.lang.Number; -import java.util.concurrent.ConcurrentHashMap; + +import java.util.Map; import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.LinkedBlockingQueue; + import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -27,19 +30,24 @@ import org.json.JSONException; import org.json.JSONObject; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - public class SQLitePlugin extends CordovaPlugin { /** * Multiple database runner map (static). - * NOTE: no public static accessor to db (runner) map since it would not work with db threading. - * FUTURE put DBRunner into a public class that can provide external accessor. + * + * NOTE: no public static accessor to db (runner) map since it is not + * expected to work properly with db threading. + * + * FUTURE TBD put DBRunner into a public class that can provide external accessor. + * + * ADDITIONAL NOTE: Storing as Map to avoid portabiity issue + * between Java 6/7/8 as discussed in: + * https://gist.github.com/AlainODea/1375759b8720a3f9f094 + * + * THANKS to @NeoLSN (Jason Yang/楊朝傑) for giving the pointer in: + * https://github.com/litehelpers/Cordova-sqlite-storage/issues/727 */ - static ConcurrentHashMap dbrmap = new ConcurrentHashMap(); + static Map dbrmap = new ConcurrentHashMap(); /** * NOTE: Using default constructor, no explicit constructor. From 7d897be5c950791537b3486776074056dfe3a0ec Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Sun, 10 Dec 2017 09:55:19 -0500 Subject: [PATCH 11/12] legacy branch doc fixes --- README.md | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 880846c80..2c93c203e 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,10 @@ This version branch uses a `before_plugin_install` hook to install sqlite3 libra |[![Circle CI](https://circleci.com/gh/litehelpers/Cordova-sqlite-storage.svg?style=svg)](https://circleci.com/gh/litehelpers/Cordova-sqlite-storage)|[![Build Status](https://travis-ci.org/litehelpers/Cordova-sqlite-storage.svg)](https://travis-ci.org/litehelpers/Cordova-sqlite-storage)| --> +NOTE: This version branch has some additional known [issues fixed in newer version branches](#issues-fixed-in-newer-version-branches). + + + ## WARNING: Multiple SQLite problem on Android @@ -104,7 +108,6 @@ Use the `location` or `iosDatabaseLocation` option in `sqlitePlugin.openDatabase - Windows platform version uses `UTF-16le` internal database encoding while the other platform versions use `UTF-8` internal encoding. (`UTF-8` internal encoding is preferred ref: [litehelpers/Cordova-sqlite-storage#652](https://github.com/litehelpers/Cordova-sqlite-storage/issues/652)) - FTS3, FTS4, and R-Tree support is tested working OK in this version (for all target platforms in this version branch Android/iOS/macOS/Windows) - Android versions supported: 2.3.3 - 7.1.1 (API level 10 - 25), depending on Cordova version ref: -minimum API level is supported back to SDK 10 (a.k.a. Gingerbread, Android 2.3.3); support for older versions is available upon request. - iOS versions supported: 8.x / 9.x / 10.x / 11.x - In case of memory issues please use smaller transactions or use the version at [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) (GPL or commercial license terms). @@ -207,15 +210,15 @@ As "strongly recommended" by [Web SQL Database API 8.5 SQL injection](https://ww - Close/delete database bugs described below. - When a database is opened and deleted without closing, the iOS/macOS platform version is known to leak resources. - It is NOT possible to open multiple databases with the same name but in different locations (iOS/macOS platform version). -- Incorrect or missing insertId/rowsAffected in results for INSERT/UPDATE/DELETE SQL statements with extra semicolon(s) in the beginning for Android (android.database implementation) -- readTransaction does *not* reject modification SQL statements with extra semicolon(s) in the beginning -Issues fixed in some newer version branches: +### Issues fixed in newer version branches + +- Incorrect or missing insertId/rowsAffected in results for INSERT/UPDATE/DELETE SQL statements with extra semicolon(s) in the beginning for Android platform version in case the `androidDatabaseImplementation: 2` (built-in android.database implementation) option is used. - In case of an error, the error `code` member is bogus on Android - iOS platform version generates extra logging in release version - iOS platform version may crash if deleteDatabase is called with an object in place of the database name - readTransaction does not reject ALTER, REINDEX, and REPLACE operations -- readTransaction does not reject modification statements with extra semicolon(s) in the beginning +- readTransaction does *not* reject modification statements with extra semicolon(s) in the beginning - extra executeSql callbacks triggered in a transaction after a failure that was not recovered by an error callback that returns false - does not signal an error in case of excess parameter argument values given on iOS/macOS @@ -231,7 +234,6 @@ Issues fixed in some newer version branches: - In-memory database `db=window.sqlitePlugin.openDatabase({name: ':memory:', ...})` is currently not supported. - The Android platform version cannot properly support more than 100 open database files due to the threading model used. - SQL error messages reported by Windows platform version are not consistent with Android/iOS/macOS platform versions. -- UNICODE `\u2028` (line separator) and `\u2029` (paragraph separator) characters are not supported and known to be broken on iOS, macOS, and Android platform versions due to JSON issues reported in [Cordova bug CB-9435](https://issues.apache.org/jira/browse/CB-9435) and [cordova/cordova-discuss#57](https://github.com/cordova/cordova-discuss/issues/57). - UNICODE `\u2028` (line separator) and `\u2029` (paragraph separator) characters are currently not supported and known to be broken on iOS, macOS, and Android platform versions due to JSON issues reported in [Cordova bug CB-9435](https://issues.apache.org/jira/browse/CB-9435) and [cordova/cordova-discuss#57](https://github.com/cordova/cordova-discuss/issues/57). This is fixed with a workaround for iOS/macOS in: [litehelpers / Cordova-sqlite-evplus-legacy-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-free) and [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) (available with GPL or special commercial license options) as well as [litehelpers / Cordova-sqlite-evplus-legacy-workers-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-workers-free) (available with GPL or premium commercial license options) - The BLOB data type is not fully supported by this version branch. SELECT BLOB in Base64 format is supported by [litehelpers / cordova-sqlite-ext](https://github.com/litehelpers/cordova-sqlite-ext) (permissive license terms) and [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) (GPL or commercial license options). - Truncation in case of UNICODE `\u0000` (same as `\0`) character on Android (default Android-sqlite-connector database implementation) and Windows. @@ -903,14 +905,6 @@ cordova platform add ios -## Source tree - -- `SQLitePlugin.coffee.md`: platform-independent (Literate coffee-script, can be read by recent coffee-script compiler) -- `www`: `SQLitePlugin.js` platform-independent Javascript as generated from `SQLitePlugin.coffee.md` (and checked in!) -- `src`: platform-specific source code -- `spec`: test suite using Jasmine (2.2.0) -- `tests`: very simple Jasmine test suite that is run on Circle CI (Android platform) and Travis CI (iOS platform) (used as a placeholder) - ## Installation test ### Easy installation test @@ -982,7 +976,7 @@ Free support for issues with Angular/"ngCordova"/Ionic will only be provided if ## What information is needed for help Please include the following: -- Which platform(s) _(Android/iOS/macOS/Windows 8.1/Windows Phone 8.1/Windows 10)_ +- Which platform(s) (Android/iOS/macOS/Windows 8.1/Windows Phone 8.1/Windows 10) - Clear description of the issue - A small, complete, self-contained program that demonstrates the problem, preferably as a Github project. ZIP/TGZ/BZ2 archive available from a public link is OK. No RAR or other such formats please! - A Cordova project is highly preferred. Intel, MS IDE, or similar project formats should be avoided. @@ -1035,6 +1029,20 @@ To run from a windows powershell (here is a sample for android target): - [nolanlawson / pouchdb-adapter-cordova-sqlite](https://github.com/nolanlawson/pouchdb-adapter-cordova-sqlite) + + +## Source tree + +- `SQLitePlugin.coffee.md`: platform-independent (Literate CoffeeScript, can be compiled with a recent CoffeeScript compiler) +- `www`: platform-independent Javascript as generated from `SQLitePlugin.coffee.md` (and committed!) +- `src`: platform-specific source code +- `node_modules`: placeholder for external dependencies +- `scripts`: installation hook script to fetch the external dependencies via `npm` +- `spec`: test suite using Jasmine +- `tests`: very simple Jasmine test suite that is run on Circle CI (Android platform) and Travis CI (iOS platform) (used as a placeholder) + + + # Contributing ## Community From d07611934ac49fa313ee078c9201ff55044de9e9 Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Sun, 10 Dec 2017 10:32:08 -0500 Subject: [PATCH 12/12] General doc updates --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2c93c203e..31f8414ae 100644 --- a/README.md +++ b/README.md @@ -106,9 +106,9 @@ Use the `location` or `iosDatabaseLocation` option in `sqlitePlugin.openDatabase - INCORRECT error code and INCONSISTENT error message in error callbacks ref: [litehelpers/Cordova-sqlite-storage#539](https://github.com/litehelpers/Cordova-sqlite-storage/issues/539) - Not possible to read BLOB column values - Windows platform version uses `UTF-16le` internal database encoding while the other platform versions use `UTF-8` internal encoding. (`UTF-8` internal encoding is preferred ref: [litehelpers/Cordova-sqlite-storage#652](https://github.com/litehelpers/Cordova-sqlite-storage/issues/652)) -- FTS3, FTS4, and R-Tree support is tested working OK in this version (for all target platforms in this version branch Android/iOS/macOS/Windows) - Android versions supported: 2.3.3 - 7.1.1 (API level 10 - 25), depending on Cordova version ref: - iOS versions supported: 8.x / 9.x / 10.x / 11.x +- FTS3, FTS4, and R-Tree are fully tested and supported for all target platforms in this version branch. - In case of memory issues please use smaller transactions or use the version at [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) (GPL or commercial license terms). @@ -144,7 +144,7 @@ Use the `location` or `iosDatabaseLocation` option in `sqlitePlugin.openDatabase - As described in [this posting](http://brodyspark.blogspot.com/2012/12/cordovaphonegap-sqlite-plugins-offer.html): - Keeps sqlite database in known, platform specific user data location on all platforms (Android/iOS/macOS/Windows), which can be reconfigured on iOS/macOS. Whether or not the database on the iOS platform is synchronized to iCloud depends on the selected database location. - No arbitrary size limit. SQLite limits described at: -- Also tested for multi-page applications with window location changes +- Also validated for multi-page applications with window location changes by selfTest function. - This project is self-contained though with sqlite3 dependencies auto-fetched by npm. There are no dependencies on other plugins such as cordova-plugin-file. - Windows platform version uses a customized version of the performant [doo / SQLite3-WinRT](https://github.com/doo/SQLite3-WinRT) C++ component. - [SQLCipher](https://www.zetetic.net/sqlcipher/) support for Android/iOS/macOS/Windows is available in: [litehelpers / Cordova-sqlcipher-adapter](https://github.com/litehelpers/Cordova-sqlcipher-adapter)