Skip to content

Commit

Permalink
Update SQLitePlugin.m & plugin.xml to use PSPDFThreadSafeMutableDicti…
Browse files Browse the repository at this point in the history
…onary

(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
  • Loading branch information
craig-at-rsg authored and Christopher J. Brody committed Nov 2, 2017
1 parent 570d5e8 commit 6d946d0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes

###### cordova-sqlite-legacy-express-core 1.0.2

- Use PSPDFThreadSafeMutableDictionary for iOS/macOS to avoid threading issue ref: litehelpers/Cordova-sqlite-storage#716

###### cordova-sqlite-legacy-express-core 1.0.1

- Fix bug 666 workaround to trigger ROLLBACK in the next event tick (needed to support version with pre-populated database on Windows)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ MIT only

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

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

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

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Use the `location` or `iosDatabaseLocation` option in `sqlitePlugin.openDatabase

## Announcements

- 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.
- The Lawnchair adapter is now moved to [litehelpers / cordova-sqlite-lawnchair-adapter](https://github.com/litehelpers/cordova-sqlite-lawnchair-adapter).
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-legacy-express-core",
"version": "1.0.2-pre00",
"version": "1.0.2",
"description": "Native interface to SQLite for PhoneGap/Cordova (legacy express core version)",
"cordova": {
"id": "cordova-sqlite-legacy-express-core",
Expand Down
10 changes: 9 additions & 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-legacy-express-core"
version="1.0.2-pre00">
version="1.0.2">

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

Expand Down Expand Up @@ -41,6 +41,10 @@
<!-- Note: the ios src is based off src/ios implicitly -->
<header-file src="src/ios/SQLitePlugin.h" />
<source-file src="src/ios/SQLitePlugin.m" />

<header-file src="src/ios/PSPDFThreadSafeMutableDictionary.h" />
<source-file src="src/ios/PSPDFThreadSafeMutableDictionary.m" />

<framework src="libsqlite3.dylib" />
</platform>

Expand All @@ -55,6 +59,10 @@
<!-- 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" />

<header-file src="src/ios/PSPDFThreadSafeMutableDictionary.h" />
<source-file src="src/ios/PSPDFThreadSafeMutableDictionary.m" />

<framework src="libsqlite3.dylib" />
</platform>

Expand Down
4 changes: 3 additions & 1 deletion src/ios/SQLitePlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#import "sqlite3.h"

#import "PSPDFThreadSafeMutableDictionary.h"

// FUTURE TBD (in another version branch):
//#define READ_BLOB_AS_BASE64

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

{
openDBs = [NSMutableDictionary dictionaryWithCapacity:0];
openDBs = [PSPDFThreadSafeMutableDictionary dictionaryWithCapacity:0];
appDBPaths = [NSMutableDictionary dictionaryWithCapacity:0];
#if !__has_feature(objc_arc)
[openDBs retain];
Expand Down

0 comments on commit 6d946d0

Please sign in to comment.