cordova-sqlite-storage
Advanced tools
Comparing version 3.2.1 to 3.3.0
# Changes | ||
#### cordova-sqlite-storage 3.3.0 | ||
- new default page & cache sizes with cordova-sqlite-storage-dependencies@2.1.0 | ||
##### cordova-sqlite-storage-commoncore 1.0.0 | ||
- additional EU string manipulation test cases | ||
#### cordova-sqlite-storage 3.2.1 | ||
@@ -4,0 +12,0 @@ |
{ | ||
"name": "cordova-sqlite-storage", | ||
"version": "3.2.1", | ||
"version": "3.3.0", | ||
"description": "Native interface to SQLite for PhoneGap/Cordova - cordova-sqlite-storage plugin version", | ||
@@ -33,3 +33,3 @@ "cordova": { | ||
"dependencies": { | ||
"cordova-sqlite-storage-dependencies": "2.0.1" | ||
"cordova-sqlite-storage-dependencies": "2.1.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "scripts": { |
@@ -15,4 +15,7 @@ /* 'use strict'; */ | ||
var isSafariBrowser = isWebKitBrowser && !isEdgeBrowser && !isChromeBrowser; | ||
var isAppleMobileOS = /iPhone/.test(navigator.userAgent) || | ||
/iPad/.test(navigator.userAgent) || /iPod/.test(navigator.userAgent); | ||
// detect iOS platform: | ||
var isAppleMobileOS = | ||
(/iPhone/.test(navigator.userAgent) | ||
|| /iPad/.test(navigator.userAgent) | ||
|| /iPod/.test(navigator.userAgent)); | ||
@@ -103,6 +106,7 @@ // should avoid popups (Safari seems to count 2x) | ||
var sqlerror = null; // VERIFY this was received | ||
// VERIFY that an error object was received in the end | ||
var sqlerror = null; | ||
db.transaction(function(tx) { | ||
// This insertion has a SQL syntax error | ||
// syntax error due to misspelling: | ||
tx.executeSql('SLCT 1 ', [], function(tx) { | ||
@@ -175,7 +179,80 @@ // NOT EXPECTED: | ||
it(suiteName + 'INSERT with VALUES in the wrong place (with a trailing space) [TBD "incomplete input" vs "syntax error" message on (WebKit) Web SQL on Android 8.0(+) & iOS 12.0(+)]', function(done) { | ||
it(suiteName + 'syntax error: comma after a field name', function(done) { | ||
var db = openDatabase('comma-after-field-name-error-test.db'); | ||
expect(db).toBeDefined(); | ||
// VERIFY that an error object was received in the end | ||
var sqlerror = null; | ||
db.transaction(function(tx) { | ||
// This insertion has a SQL syntax error | ||
tx.executeSql('SELECT name, from Users', [], function(tx) { | ||
// NOT EXPECTED: | ||
expect(false).toBe(true); | ||
throw new Error('abort tx'); | ||
}, function(tx, error) { | ||
sqlerror = error; | ||
expect(error).toBeDefined(); | ||
expect(error.code).toBeDefined(); | ||
expect(error.message).toBeDefined(); | ||
// error.hasOwnProperty('message') apparently NOT WORKING on | ||
// WebKit Web SQL on Android 5.x/... or iOS 10.x/...: | ||
if (!isWebSql || isWindows || (isAndroid && (/Android 4/.test(navigator.userAgent)))) | ||
expect(error.hasOwnProperty('message')).toBe(true); | ||
if (isWindows || (isAndroid && isImpl2)) | ||
expect(error.code).toBe(0); | ||
else | ||
expect(error.code).toBe(5); | ||
if (isWebSql && !(/Android 4.[1-3]/.test(navigator.userAgent))) | ||
expect(error.message).toMatch(/could not prepare statement.*1 near \"from\": syntax error/); | ||
else if (isWindows) | ||
expect(error.message).toMatch(/Error preparing an SQLite statement/); | ||
else | ||
expect(error.message).toMatch(/near \"from\": syntax error/); | ||
// FAIL transaction & check reported transaction error: | ||
return true; | ||
}); | ||
}, function (error) { | ||
expect(!!sqlerror).toBe(true); // VERIFY the SQL error callback was triggered | ||
expect(error).toBeDefined(); | ||
expect(error.code).toBeDefined(); | ||
expect(error.message).toBeDefined(); | ||
// error.hasOwnProperty('message') apparently NOT WORKING on | ||
// WebKit Web SQL on Android 5.x/... or iOS 10.x/...: | ||
if (!isWebSql || isWindows || (isAndroid && (/Android 4/.test(navigator.userAgent)))) | ||
expect(error.hasOwnProperty('message')).toBe(true); | ||
if (isWindows || isWebSql || (isAndroid && isImpl2)) | ||
expect(error.code).toBe(0); | ||
else | ||
expect(error.code).toBe(5); | ||
if (isWebSql) | ||
expect(error.message).toMatch(/callback raised an exception.*or.*error callback did not return false/); | ||
else if (isWindows) | ||
expect(error.message).toMatch(/error callback did not return false.*Error preparing an SQLite statement/); | ||
else | ||
expect(error.message).toMatch(/error callback did not return false.*syntax error/); | ||
isWebSql ? done() : db.close(done, done); | ||
}, function() { | ||
// NOT EXPECTED: | ||
expect(false).toBe(true); | ||
isWebSql ? done() : db.close(done, done); | ||
}); | ||
}, MYTIMEOUT); | ||
it(suiteName + 'INSERT with VALUES in the wrong place (and with a trailing space) [TBD "incomplete input" vs "syntax error" message IGNORED on (WebKit) Web SQL on Android 7.0(+) & iOS 12.0(+)]', function(done) { | ||
var db = openDatabase("INSERT-Syntax-error-test.db", "1.0", "Demo", DEFAULT_SIZE); | ||
expect(db).toBeDefined(); | ||
var sqlerror = null; // VERIFY this was received | ||
// VERIFY that an error object was received in the end | ||
var sqlerror = null; | ||
@@ -208,6 +285,6 @@ db.transaction(function(tx) { | ||
if (isWebSql && (isAppleMobileOS || /Android [7-9]/.test(navigator.userAgent))) | ||
// TBD incomplete input vs syntax error message on Android 8.0(+) & iOS 12.0(+) | ||
if (isWebSql && (isAppleMobileOS || (/Android [7-9]/.test(navigator.userAgent)))) | ||
// TBD incomplete input vs syntax error message IGNORED on Android 7.0(+) & iOS 12.0(+) | ||
expect(error.message).toMatch(/could not prepare statement.*/); | ||
else if (isWebSql && !isChromeBrowser && !(/Android 4.[1-3]/.test(navigator.userAgent))) | ||
else if (isWebSql && !isBrowser && !(/Android 4.[1-3]/.test(navigator.userAgent))) | ||
expect(error.message).toMatch(/could not prepare statement.*1 near \"VALUES\": syntax error/); | ||
@@ -223,3 +300,4 @@ else if (isWebSql && isBrowser) | ||
else if (isAndroid && isImpl2) | ||
expect(error.message).toMatch(/near \"VALUES\": syntax error.*code 1.*while compiling: INSERT INTO test_table/); | ||
// TBD more general pattern for Android 9 vs ... | ||
expect(error.message).toMatch(/code 1.*while compiling: INSERT INTO test_table/); | ||
else | ||
@@ -252,3 +330,4 @@ expect(error.message).toMatch(/incomplete input/); | ||
else if (isAndroid && isImpl2) | ||
expect(error.message).toMatch(/error callback did not return false.*syntax error/); | ||
// TBD more general pattern for Android 9 vs ... | ||
expect(error.message).toMatch(/error callback did not return false.*code 1/); | ||
else | ||
@@ -269,3 +348,4 @@ expect(error.message).toMatch(/error callback did not return false.*incomplete input/); | ||
var sqlerror = null; // VERIFY this was received | ||
// VERIFY that an error object was received in the end | ||
var sqlerror = null; | ||
@@ -362,3 +442,4 @@ db.transaction(function(tx) { | ||
var sqlerror = null; // VERIFY this was received | ||
// VERIFY that an error object was received in the end | ||
var sqlerror = null; | ||
@@ -439,3 +520,4 @@ db.transaction(function(tx) { | ||
var sqlerror = null; // VERIFY the SQL error callback was triggered | ||
// VERIFY that an error object was received in the end | ||
var sqlerror = null; | ||
@@ -515,3 +597,4 @@ db.transaction(function(tx) { | ||
var sqlerror = null; // VERIFY this was received | ||
// VERIFY that an error object was received in the end | ||
var sqlerror = null; | ||
@@ -593,3 +676,4 @@ db.transaction(function(tx) { | ||
var sqlerror = null; // VERIFY this was received | ||
// VERIFY that an error object was received in the end | ||
var sqlerror = null; | ||
@@ -674,3 +758,4 @@ db.transaction(function(tx) { | ||
var sqlerror = null; // VERIFY the SQL error callback was triggered | ||
// VERIFY that an error object was received in the end | ||
var sqlerror = null; | ||
@@ -677,0 +762,0 @@ db.transaction(function(tx) { |
@@ -164,6 +164,3 @@ /* 'use strict'; */ | ||
expect(rs.rows.length).toBe(1); | ||
if (!isWebSql && !isWindows && isAndroid && isImpl2) | ||
expect(rs.rows.item(0).page_size).toBe(4096); // CORRECT [androidDatabaseImplementation: 2] | ||
else | ||
expect(rs.rows.item(0).page_size).toBe(1024); // XXX TBD OLD VALUE USED IN THIS PLUGIN VERSION ref: litehelpers/Cordova-sqlite-storage#781 | ||
expect(rs.rows.item(0).page_size).toBe(4096); | ||
@@ -194,5 +191,4 @@ // Close (plugin only) & finish: | ||
expect(resultRow.cache_size).toBeDefined(); | ||
if (!isWebSql && isAndroid && | ||
(!isImpl2 || | ||
(isImpl2 && (/Android [3-7]/.test(navigator.userAgent))))) | ||
if (!isWebSql && isAndroid && isImpl2 | ||
&& (/Android [3-7]/.test(navigator.userAgent))) | ||
expect(resultRow.cache_size).toBe(2000); // TBD OLD VALUE on Android (...) | ||
@@ -232,2 +228,3 @@ else | ||
expect(rs.rows.item(0).journal_mode).toBe( | ||
(/Android 9/.test(navigator.userAgent)) ? 'wal' : | ||
(/Android 8.1.99/.test(navigator.userAgent)) ? 'wal' : | ||
@@ -234,0 +231,0 @@ (/Android 8/.test(navigator.userAgent)) ? 'truncate' : |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1298617
21270
1799
+ Addedcordova-sqlite-storage-dependencies@2.1.0(transitive)
- Removedcordova-sqlite-storage-dependencies@2.0.1(transitive)