Skip to content

Commit 6d946d0

Browse files
craig-at-rsgChristopher J. Brody
authored and
Christopher J. Brody
committed
Update SQLitePlugin.m & plugin.xml to use PSPDFThreadSafeMutableDictionary
(iOS/macOS) with minor changes by @brodybits: - import PSPDFThreadSafeMutableDictionary in SQLitePlugin.m instead of SQLitePlugin.h - update SQLitePlugin.m & plugin.xml in single commit - update plugin version - update docs ref: storesafe#716
1 parent 570d5e8 commit 6d946d0

File tree

6 files changed

+19
-4
lines changed

6 files changed

+19
-4
lines changed

CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes
22

3+
###### cordova-sqlite-legacy-express-core 1.0.2
4+
5+
- Use PSPDFThreadSafeMutableDictionary for iOS/macOS to avoid threading issue ref: litehelpers/Cordova-sqlite-storage#716
6+
37
###### cordova-sqlite-legacy-express-core 1.0.1
48

59
- Fix bug 666 workaround to trigger ROLLBACK in the next event tick (needed to support version with pre-populated database on Windows)

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ MIT only
1414

1515
based on Phonegap-SQLitePlugin by @davibe (Davide Bertola <[email protected]>) and @joenoon (Joe Noon <[email protected]>)
1616

17-
includes PSPDFThreadSafeMutableDictionary (PSPDFThreadSafeMutableDictionary.m <https://gist.github.com/steipete/5928916>) MIT license by @steipete (<https://gist.github.com/steipete>)
17+
includes and uses PSPDFThreadSafeMutableDictionary (PSPDFThreadSafeMutableDictionary.m <https://gist.github.com/steipete/5928916>) MIT license by @steipete (<https://gist.github.com/steipete>)
1818

1919
## REMOVED from this version branch: Windows (8.1/...) version
2020

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Use the `location` or `iosDatabaseLocation` option in `sqlitePlugin.openDatabase
6666

6767
## Announcements
6868

69+
- 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)
6970
- 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)
7071
- [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.
7172
- The Lawnchair adapter is now moved to [litehelpers / cordova-sqlite-lawnchair-adapter](https://github.com/litehelpers/cordova-sqlite-lawnchair-adapter).

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cordova-sqlite-legacy-express-core",
3-
"version": "1.0.2-pre00",
3+
"version": "1.0.2",
44
"description": "Native interface to SQLite for PhoneGap/Cordova (legacy express core version)",
55
"cordova": {
66
"id": "cordova-sqlite-legacy-express-core",

plugin.xml

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
id="cordova-sqlite-legacy-express-core"
5-
version="1.0.2-pre00">
5+
version="1.0.2">
66

77
<name>Cordova sqlite storage plugin - legacy express core version</name>
88

@@ -41,6 +41,10 @@
4141
<!-- Note: the ios src is based off src/ios implicitly -->
4242
<header-file src="src/ios/SQLitePlugin.h" />
4343
<source-file src="src/ios/SQLitePlugin.m" />
44+
45+
<header-file src="src/ios/PSPDFThreadSafeMutableDictionary.h" />
46+
<source-file src="src/ios/PSPDFThreadSafeMutableDictionary.m" />
47+
4448
<framework src="libsqlite3.dylib" />
4549
</platform>
4650

@@ -55,6 +59,10 @@
5559
<!-- Note: the macOS (osx) src is based off src/ios implicitly -->
5660
<header-file src="src/ios/SQLitePlugin.h" />
5761
<source-file src="src/ios/SQLitePlugin.m" />
62+
63+
<header-file src="src/ios/PSPDFThreadSafeMutableDictionary.h" />
64+
<source-file src="src/ios/PSPDFThreadSafeMutableDictionary.m" />
65+
5866
<framework src="libsqlite3.dylib" />
5967
</platform>
6068

src/ios/SQLitePlugin.m

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
#import "sqlite3.h"
1212

13+
#import "PSPDFThreadSafeMutableDictionary.h"
14+
1315
// FUTURE TBD (in another version branch):
1416
//#define READ_BLOB_AS_BASE64
1517

@@ -27,7 +29,7 @@ -(void)pluginInitialize
2729
NSLog(@"Initializing SQLitePlugin");
2830

2931
{
30-
openDBs = [NSMutableDictionary dictionaryWithCapacity:0];
32+
openDBs = [PSPDFThreadSafeMutableDictionary dictionaryWithCapacity:0];
3133
appDBPaths = [NSMutableDictionary dictionaryWithCapacity:0];
3234
#if !__has_feature(objc_arc)
3335
[openDBs retain];

0 commit comments

Comments
 (0)