Skip to content

Commit

Permalink
cordova-sqlite-storage 2.3.2 - quick updates
Browse files Browse the repository at this point in the history
- Mark some Android errors as internal plugin errors (quick fix)
- remove trailing whitespace from Android implementation
- quick doc updates
- test coverage updates included
  • Loading branch information
Christopher J. Brody committed May 24, 2018
1 parent 6850602 commit 87a06a0
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 14 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changes

### cordova-sqlite-storage 2.3.2

- Mark some Android errors as internal plugin errors (quick fix)
- remove trailing whitespace from Android implementation
- test coverage updates
- quick doc updates

### cordova-sqlite-storage 2.3.1

- Mark some iOS/macOS plugin error messages as internal plugin errors (quick fix)
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Native SQLite component with API based on HTML5/[Web SQL (DRAFT) API](http://www
- Android
- iOS
- macOS ("osx" platform)
- Windows 10 (UWP) desktop and mobile (see below for major limitations)
- Windows 10 (UWP) DESKTOP and MOBILE (see below for major limitations)

Browser platform is supported as described in [Browser platform usage notes](#browser-platform-usage-notes) section below.

Expand All @@ -14,19 +14,20 @@ Browser platform is supported as described in [Browser platform usage notes](#br

with possible corruption risk in case of sqlite access from multiple plugins (see below)

## NEW MAJOR RELEASE in June 2018 with BREAKING CHANGES
## NEW MAJOR RELEASE in July 2018 with BREAKING CHANGES

New release in June 2018 will include the following major enhancements:
New release in July 2018 will include the following major enhancements ([litehelpers/Cordova-sqlite-storage#773](https://github.com/litehelpers/Cordova-sqlite-storage/issues/773)):

- browser platform support using [kripken / sql.js](https://github.com/kripken/sql.js) ([litehelpers/Cordova-sqlite-storage#576](https://github.com/litehelpers/Cordova-sqlite-storage/pull/576))
- cordova-sqlite-storage and cordova-sqlite-ext will be combined together, no more separate plugin version needed for pre-populated databases ([litehelpers/Cordova-sqlite-storage#529](https://github.com/litehelpers/Cordova-sqlite-storage/issues/529))
- include typings from DefinitelyTyped ([litehelpers/Cordova-sqlite-storage#768](https://github.com/litehelpers/Cordova-sqlite-storage/pull/768))

Breaking changes expected:
**BREAKING CHANGES expected:**

- drop support for Android pre-5.0 ([litehelpers/Cordova-sqlite-storage#771](https://github.com/litehelpers/Cordova-sqlite-storage/issues/771)); feedback is requested in case of interest in support for Android 4.4, 4.3, 4.2, or 4.1
- drop support for iOS 8.x (was already dropped by cordova-ios@4.4.0)
- drop Android NDK build for x86_64 ([litehelpers/Cordova-sqlite-storage#772](https://github.com/litehelpers/Cordova-sqlite-storage/issues/772)); NDK build for x86 will still work on x86_64 if no other plugins have NDK build for x86_64; feedback is requested in case of interest in NDK build for x86_64
- ~~drop Android NDK build for x86_64 ([litehelpers/Cordova-sqlite-storage#772](https://github.com/litehelpers/Cordova-sqlite-storage/issues/772)); NDK build for x86 will still work on x86_64 if no other plugins have NDK build for x86_64; feedback is requested in case of interest in NDK build for x86_64~~
- drop support for location: 0-2 values in openDatabase call (please use `location: 'default'` or `iosDatabaseLocation` setting in openDatabase as documented below)

## Browser platform usage notes

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-sqlite-storage",
"version": "2.3.1",
"version": "2.3.2",
"description": "Native interface to SQLite for PhoneGap/Cordova",
"cordova": {
"id": "cordova-sqlite-storage",
Expand Down
2 changes: 1 addition & 1 deletion 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-storage"
version="2.3.1">
version="2.3.2">

<name>Cordova sqlite storage plugin</name>

Expand Down
3 changes: 2 additions & 1 deletion src/android/io/sqlc/SQLiteAndroidDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ void executeSqlBatch(String[] queryarr, JSONArray[] jsonparamsArr, CallbackConte

if (mydb == null) {
// not allowed - can only happen if someone has closed (and possibly deleted) a database and then re-used the database
cbc.error("database has been closed");
// (internal plugin error)
cbc.error("INTERNAL PLUGIN ERROR: database not open");
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/android/io/sqlc/SQLiteConnectorDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ private JSONObject executeSQLiteStatement(String query, JSONArray paramsAsJson,
myStatement.bindNull(i + 1);
} else {
Object p = paramsAsJson.get(i);
if (p instanceof Float || p instanceof Double)
if (p instanceof Float || p instanceof Double)
myStatement.bindDouble(i + 1, paramsAsJson.getDouble(i));
else if (p instanceof Number)
else if (p instanceof Number)
myStatement.bindLong(i + 1, paramsAsJson.getLong(i));
else
myStatement.bindTextNativeString(i + 1, paramsAsJson.getString(i));
Expand Down
8 changes: 4 additions & 4 deletions src/android/io/sqlc/SQLitePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private boolean executeAndPossiblyThrow(Action action, JSONArray args, CallbackC
JSONArray txargs = allargs.getJSONArray("executes");

if (txargs.isNull(0)) {
cbc.error("missing executes list");
cbc.error("INTERNAL PLUGIN ERROR: missing executes list");
} else {
int len = txargs.length();
String[] queries = new String[len];
Expand All @@ -144,10 +144,10 @@ private boolean executeAndPossiblyThrow(Action action, JSONArray args, CallbackC
r.q.put(q);
} catch(Exception e) {
Log.e(SQLitePlugin.class.getSimpleName(), "couldn't add to queue", e);
cbc.error("couldn't add to queue");
cbc.error("INTERNAL PLUGIN ERROR: couldn't add to queue");
}
} else {
cbc.error("database not open");
cbc.error("INTERNAL PLUGIN ERROR: database not open");
}
}
break;
Expand Down Expand Up @@ -371,7 +371,7 @@ public void run() {
Log.e(SQLitePlugin.class.getSimpleName(), "couldn't delete database", e);
dbq.cbc.error("couldn't delete database: " + e);
}
}
}
} catch (Exception e) {
Log.e(SQLitePlugin.class.getSimpleName(), "couldn't close database", e);
if (dbq.cbc != null) {
Expand Down

0 comments on commit 87a06a0

Please # to comment.