Skip to content

Commit

Permalink
cordova-sqlite-ext 2.0.0 - merge release
Browse files Browse the repository at this point in the history
Merge branch 'storage-master' into cordova-sqlite-ext-master
  • Loading branch information
Christopher J. Brody committed Dec 27, 2017
2 parents 79751f9 + 912ec40 commit 545b6ec
Show file tree
Hide file tree
Showing 27 changed files with 2,283 additions and 696 deletions.
26 changes: 26 additions & 0 deletions CHANGES.md
@@ -1,5 +1,31 @@
# Changes

## cordova-sqlite-ext 2.0.0

## cordova-sqlite-storage 2.1.4

- Visual Studio 2017 updates for Windows UWP build

### cordova-sqlite-storage 1.5.4

- Fix iOS/macOS version to report undefined insertId in case INSERT OR IGNORE is ignored
- Fix FIRST_WORD check for android.sqlite.database implementation
- SQLite 3.15.2 build fixes

## cordova-sqlite-storage 2.0.2

- Fix Windows target platform version

### cordova-sqlite-storage 1.5.3

- Fix merges to prevent possible conflicts with other plugins (Windows)
- Fix handling of undefined SQL argument values (Windows)
- Signal error in case of a failure opening the database file (iOS/macOS)

### cordova-sqlite-storage 2.0.0

- Reference Windows platform toolset v141 to support Visual Studio 2017 (RC)

## cordova-sqlite-ext 0.10.7

- cordova-sqlite-ext build flag fixes:
Expand Down
16 changes: 14 additions & 2 deletions CONTRIBUTING.md
@@ -1,11 +1,23 @@
## Bugs and other issues
# General

**IMPORTANT:** Please raise general questions in [litehelpers / Cordova-sqlite-help / issues](https://github.com/litehelpers/Cordova-sqlite-help/issues).

## Reproducible bugs

- Verify the results of calling the echoTest and selfTest functions as described in README.md
- Check the pitfalls and other troubleshooting steps in README.md and [brodybits / Avoiding-some-Cordova-pitfalls](https://github.com/brodybits/Avoiding-some-Cordova-pitfalls)
- Reproduce the issue in a fresh, clean project, ideally based on [brodybits / Cordova-sqlite-bootstrap-test](https://github.com/brodybits/Cordova-sqlite-bootstrap-test)
- Reproduce the issue in a fresh, clean project, preferably based on [brodybits / Cordova-sqlite-bootstrap-test](https://github.com/brodybits/Cordova-sqlite-bootstrap-test) or [brodybits / cordova-sqlite-test-app](https://github.com/brodybits/cordova-sqlite-test-app).

Please see README.md for more details.

## Feature requests

Feature requests are welcome for community discussion and future consideration. Preference will be given to paid customers. Please contact <sales@litehelpers.net> for more information.

## Other questions

**NOTE:** As stated above please other questions in [litehelpers / Cordova-sqlite-help / issues](https://github.com/litehelpers/Cordova-sqlite-help/issues).

## Contributing patches

- Patches with bug fixes are helpful, especially when submitted with test code.
Expand Down
4 changes: 4 additions & 0 deletions HISTORY.md
Expand Up @@ -134,6 +134,10 @@ New versions introduced
available under GPL or commercial licensing options with support for PhoneGap Build
- Cordova-sqlite-evplus (legacy) versions with GPL or premium commercial licensing options

## Major changes 2017

Windows platform toolset dependency updated for Visual Studio 2017

## Recent changes

See CHANGES.md
80 changes: 41 additions & 39 deletions README.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion SQLitePlugin.coffee.md
Expand Up @@ -416,7 +416,8 @@
for v in values
t = typeof v
params.push (
if v == null || v == undefined || t == 'number' || t == 'string' then v
if v == null || v == undefined then null
else if t == 'number' || t == 'string' then v
else v.toString()
)

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "cordova-sqlite-ext",
"version": "0.10.7",
"version": "2.0.0",
"description": "Native interface to SQLite for PhoneGap/Cordova with extra features",
"cordova": {
"id": "cordova-sqlite-ext",
Expand Down
8 changes: 4 additions & 4 deletions plugin.xml
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-ext"
version="0.10.7">
version="2.0.0">

<name>Cordova sqlite storage plugin with extra features</name>

Expand Down Expand Up @@ -81,7 +81,7 @@
</feature>
</config-file>

<!-- Note: the macOS src is based off src/ios implicitly -->
<!-- Note: the macOS (osx) src is based off src/ios implicitly -->
<header-file src="src/ios/SQLitePlugin.h" />
<source-file src="src/ios/SQLitePlugin.m" />
<!-- FUTURE TBD: more common directory name for Apple macOS/iOS versions -->
Expand All @@ -107,12 +107,12 @@
<!-- windows -->
<platform name="windows">
<js-module src="src/windows/sqlite-proxy.js" name="SQLiteProxy">
<merges target="" />
<runs />
</js-module>

<!-- SQLite3 JS module from SQLite3-WinRT/SQLite3JS: -->
<js-module src="src/windows/SQLite3-Win-RT/SQLite3JS/js/SQLite3.js" name="SQLite3">
<merges target="" />
<runs />
</js-module>

<!-- Thanks to AllJoyn-Cordova / cordova-plugin-alljoyn for guidance: -->
Expand Down
70 changes: 65 additions & 5 deletions spec/www/spec/basic-db-tx-sql-storage-results.js
Expand Up @@ -7,10 +7,12 @@ var DEFAULT_SIZE = 5000000; // max to avoid popup in safari/ios
var isWP8 = /IEMobile/.test(navigator.userAgent); // Matches WP(7/8/8.1)
var isWindows = /Windows /.test(navigator.userAgent); // Windows
var isAndroid = !isWindows && /Android/.test(navigator.userAgent);
var isMac = /Macintosh/.test(navigator.userAgent);

// NOTE: In the core-master branch there is no difference between the default
// implementation and implementation #2. But the test will also apply
// the androidLockWorkaround: 1 option in the case of implementation #2.
// NOTE: While in certain version branches there is no difference between
// the default Android implementation and implementation #2,
// this test script will also apply the androidLockWorkaround: 1 option
// in case of implementation #2.
var scenarioList = [
isAndroid ? 'Plugin-implementation-default' : 'Plugin',
'HTML5',
Expand Down Expand Up @@ -479,9 +481,7 @@ var mytests = function() {
}, MYTIMEOUT);

it(suiteName + 'tx sql starting with extra semicolon results test', function(done) {
// [BUG #458] BROKEN for androidDatabaseImplementation: 2 (built-in android.database) setting
if (isWP8) pending('BROKEN for WP8');
if (isAndroid && isImpl2) pending('BROKEN for androidDatabaseImplementation: 2 (built-in android.database) setting');

var db = openDatabase('tx-sql-starting-with-extra-semicolon-results-test.db', '1.0', 'Test', DEFAULT_SIZE);

Expand Down Expand Up @@ -772,6 +772,8 @@ var mytests = function() {
describe(suiteName + 'STANDARD multi-row INSERT tests', function() {

it(suiteName + 'INSERT multiple rows from with SELECT; check results & check stored data [rowsAffected INCORRECT with androidDatabaseImplementation: 2 (built-in android.database) setting]', function(done) {
// NOTE: This test also verifies litehelpers/Cordova-sqlite-storage#63
// (insertId randomly "returns undefined" after an INSERT) is fixed.
var db = openDatabase('INSERT-with-SELECT-test.db', '1.0', 'Test', DEFAULT_SIZE);

db.transaction(function(tx) {
Expand Down Expand Up @@ -885,6 +887,64 @@ var mytests = function() {

});

it(suiteName + 'INSERT OR IGNORE result in case of constraint violation [(WebKit) Web SQL DEVIATION on Android/iOS: reports old insertId value]', function(done) {
var db = openDatabase('INSERT-OR-IGNORE-test.db', '1.0', 'Test', DEFAULT_SIZE);

db.transaction(function(tx) {
tx.executeSql('DROP TABLE IF EXISTS tt;');

tx.executeSql('CREATE TABLE tt (data1 NUMERIC UNIQUE, data2 TEXT);');

tx.executeSql('INSERT OR IGNORE INTO tt VALUES (?,?)', [101,'Alice'], function(ignored, rs) {
// CORRECT RESULT EXPECTED:
expect(rs).toBeDefined();
expect(rs.insertId).toBe(1);
expect(rs.rowsAffected).toBe(1);
});

var check1 = false;
tx.executeSql('INSERT OR IGNORE INTO tt VALUES (?,?)', [102,'Betty'], function(ignored, rs) {
// CORRECT RESULT EXPECTED:
expect(rs).toBeDefined();
expect(rs.insertId).toBe(2);
expect(rs.rowsAffected).toBe(1);
check1 = true;
});

tx.executeSql('INSERT OR IGNORE INTO tt VALUES (?,?)', [102,'Carol'], function(ignored, rs1) {
expect(check1).toBe(true);
expect(rs1).toBeDefined();

// NOTE: According to https://www.w3.org/TR/webdatabase/#database-query-results (section 4.5)
// this access should really raise an INVALID_ACCESS_ERR exception.
var checkInsertId = rs1.insertId;
if (isWebSql)
expect(checkInsertId).toBe(2); // Andriod/iOS WebKit Web SQL DEVIATION: OLD insertId value
else
expect(checkInsertId).toBe(undefined);

expect(rs1.rowsAffected).toBe(0);

tx.executeSql('SELECT COUNT(*) AS MyCount FROM tt', [], function(ignored, rs2) {
expect(rs2).toBeDefined();
expect(rs2.rows).toBeDefined();
expect(rs2.rows.length).toBe(1);
expect(rs2.rows.item(0).MyCount).toBe(2);

// Close (plugin only - always the case in this test) & finish:
(isWebSql) ? done() : db.close(done, done);
});
});
}, function(e) {
// ERROR RESULT (NOT EXPECTED):
expect(false).toBe(true);
expect(e).toBeDefined();

// Close (plugin only) & finish:
(isWebSql) ? done() : db.close(done, done);
});
}, MYTIMEOUT);

describe(suiteName + 'ALTER TABLE tests', function() {

it(suiteName + 'ALTER TABLE ADD COLUMN test', function(done) {
Expand Down

0 comments on commit 545b6ec

Please sign in to comment.