Skip to content

Commit

Permalink
Remove Windows 'Universal' support from this version branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher J. Brody committed Feb 7, 2016
1 parent 7e95d64 commit 8ff4e96
Show file tree
Hide file tree
Showing 19 changed files with 26 additions and 1,281 deletions.
6 changes: 3 additions & 3 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- Cordova 2.7+ port with background processing by @j3k0 (Jean-Christophe Hoelt <[email protected]>)
- Maintained by @brodybits (Chris Brody)

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

- SQLiteProxy.js by @vldmrrr (Vladimir Avdonin) and @brodybits (Chris Brody)
- Using SQLite3-WinRT C++ classes and SQLite3JS (Javascript part) by @doo (doo GmbH)
- ~~SQLiteProxy.js by @vldmrrr (Vladimir Avdonin) and @brodybits (Chris Brody)~~
- ~~Using SQLite3-WinRT C++ classes and SQLite3JS (Javascript part) by @doo (doo GmbH)~~
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 0.x.x-xx

- Windows version removed from this version branch
- Move Android version to io.sqlc package

## 0.7.2-common-dev
Expand Down
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ Other major changes by @brodybits in 2015:
- react-native-sqlite-storage version for Android and iOS developed and maintained
by @andpor (Andrzej Porebski <[email protected]>), based on this project

## Major changes 2016

- Windows version removed from this version branch (available in cordova-sqlite-ext or Cordova-sqlite-legacy versions)

## Recent changes

See CHANGES.md
59 changes: 18 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Cordova/PhoneGap sqlite storage adapter (common-src branch)

Native interface to sqlite in a Cordova/PhoneGap plugin for Android, iOS, and Windows "Universal" (8.1), with API similar to HTML5/[Web SQL API](http://www.w3.org/TR/webdatabase/).
Native interface to sqlite in a Cordova/PhoneGap plugin for Android, _and_ iOS, ~~and Windows "Universal" (8.1),~~ with API similar to HTML5/[Web SQL API](http://www.w3.org/TR/webdatabase/).

License for Android and Windows "Universal" (8.1) versions: MIT or Apache 2.0
License for Android ~~and Windows "Universal" (8.1)~~ version~~s~~: MIT or Apache 2.0

License for iOS version: MIT only

This version branch contains the source code for the Android, iOS, and Windows "Universal" (8.1) versions. This version branch does not contain any libraries or source code from www.sqlite.org. This version branch uses the built-in sqlite libraries on Android and iOS.
This version branch contains the source code for the Android, iOS~~, and Windows "Universal" (8.1)~~ versions. This version branch does not contain any libraries or source code from www.sqlite.org. This version branch uses the built-in sqlite libraries on Android and iOS.

NOTE (TBD): no Circle CI or Travis CI working in this version branch.

Expand Down Expand Up @@ -43,17 +43,18 @@ I raised [Cordova bug CB-9830](https://issues.apache.org/jira/browse/CB-9830) to

## Status

- Windows "Universal" version is removed from this version branch.
- WP(7/8) is not supported by this version branch (TBD link to where WP(7/8) will be supported)
- The following features are moved to [litehelpers / cordova-sqlite-ext](https://github.com/litehelpers/cordova-sqlite-ext) and removed from this project:
- REGEXP support
- Pre-populated database
- Amazon Fire-OS is dropped due to lack of support by Cordova. Android version should be used to deploy to Fire-OS 5.0(+) devices ref: [cordova/cordova-discuss#32 (comment)](https://github.com/cordova/cordova-discuss/issues/32#issuecomment-167021676)
- Windows "Universal" for Windows 8.0/8.1(+) and Windows Phone 8.1(+) version is in an alpha state:
- Issue with UNICODE `\u0000` character (same as `\0`)
- No background processing (for future consideration)
- You *may* encounter issues with Cordova CLI due to [CB-8866](https://issues.apache.org/jira/browse/CB-8866). *Old workaround:* you can install using [litehelpers / cordova-windows-nufix](https://github.com/litehelpers/cordova-windows-nufix) and `plugman` as described below.
- In addition, problems with the Windows "Universal" version have been reported in case of a Cordova project using a Visual Studio template/extension instead of Cordova/PhoneGap CLI or `plugman`
- Not tested with a Windows 10 (or Windows Phone 10) target; Windows 10 build is not expected to work with Windows Phone
- ~~Windows "Universal" for Windows 8.0/8.1(+) and Windows Phone 8.1(+) version is in an alpha state:~~
- ~~Issue with UNICODE `\u0000` character (same as `\0`)~~
- ~~No background processing (for future consideration)~~
- ~~You *may* encounter issues with Cordova CLI due to [CB-8866](https://issues.apache.org/jira/browse/CB-8866). *Old workaround:* you can install using [litehelpers / cordova-windows-nufix](https://github.com/litehelpers/cordova-windows-nufix) and `plugman` as described below.~~
- ~~In addition, problems with the Windows "Universal" version have been reported in case of a Cordova project using a Visual Studio template/extension instead of Cordova/PhoneGap CLI or `plugman`~~
- ~~Not tested with a Windows 10 (or Windows Phone 10) target; Windows 10 build is not expected to work with Windows Phone~~
- FTS3, FTS4, and R-Tree support is tested working OK in this version (for all target platforms in this version branch Android/iOS/Windows "Universal")
- Android is supported back to SDK 10 (a.k.a. Gingerbread, Android 2.3.3); support for older versions is available upon request.
- API to open the database may be changed somewhat to be more streamlined. Transaction and single-statement query API will NOT be changed.
Expand Down Expand Up @@ -97,7 +98,7 @@ I raised [Cordova bug CB-9830](https://issues.apache.org/jira/browse/CB-9830) to
- Memory issue observed when adding a large number of records due to the JSON implementation which is improved in [litehelpers / Cordova-sqlite-enterprise-free](https://github.com/litehelpers/Cordova-sqlite-enterprise-free) (available with a different licensing scheme)
- A stability issue was reported on the iOS version when in use together with [SockJS](http://sockjs.org/) client such as [pusher-js](https://github.com/pusher/pusher-js) at the same time (see [litehelpers/Cordova-sqlite-storage#196](https://github.com/litehelpers/Cordova-sqlite-storage/issues/196)). The workaround is to call sqlite functions and [SockJS](http://sockjs.org/) client functions in separate ticks (using setTimeout with 0 timeout).
- If a sql statement fails for which there is no error handler or the error handler does not return `false` to signal transaction recovery, the plugin fires the remaining sql callbacks before aborting the transaction.
- In case of an error, the error `code` member is bogus on Android and Windows (fixed for Android in [litehelpers / Cordova-sqlite-enterprise-free](https://github.com/litehelpers/Cordova-sqlite-enterprise-free)).
- In case of an error, the error `code` member is bogus on Android ~~and Windows~~ (fixed for Android in [litehelpers / Cordova-sqlite-enterprise-free](https://github.com/litehelpers/Cordova-sqlite-enterprise-free)).
- Possible crash on Android when using Unicode emoji characters due to [Android bug 81341](https://code.google.com/p/android/issues/detail?id=81341), which _should_ be fixed in Android 6.x
- In-memory database `db=window.sqlitePlugin.openDatabase({name: ":memory:"})` is currently not supported.
- Close database bugs described below.
Expand All @@ -116,7 +117,7 @@ I raised [Cordova bug CB-9830](https://issues.apache.org/jira/browse/CB-9830) to
- The Android version cannot work with more than 100 open db files (due to the threading model used).
- UNICODE line separator (`\u2028`) and paragraph separator (`\u2029`) are currently not supported and known to be broken in iOS version due to [Cordova bug CB-9435](https://issues.apache.org/jira/browse/CB-9435).
- Blob type is currently not supported and known to be broken on multiple platforms.
- UNICODE `\u0000` (same as `\0`) character not working in Android (default native database implementation), Windows "Universal" (8.1/XX), ~~or _(in another version branch)_ WP(7/8)~~
- UNICODE `\u0000` (same as `\0`) character not working in Android (default native database implementation)~~, Windows "Universal" (8.1/XX), or _(in another version branch)_ WP(7/8)~~
- Case-insensitive matching and other string manipulations on Unicode characters, which is provided by optional ICU integration in the sqlite source and working with recent versions of Android, is not supported for any target platforms.
- iOS version uses a thread pool but with only one thread working at a time due to "synchronized" database access
- Large query result can be slow, also due to JSON implementation
Expand Down Expand Up @@ -148,7 +149,7 @@ I raised [Cordova bug CB-9830](https://issues.apache.org/jira/browse/CB-9830) to
## Common pitfall(s)

- It is NOT allowed to execute sql statements on a transaction following the HTML5/[Web SQL API](http://www.w3.org/TR/webdatabase/), as described below.
- Not in this version branch: ~~It is possible to make a Windows Phone 8.1 project using either the `windows` platform or the `wp8` platform. The `windows` platform is highly recommended over `wp8` whenever possible. Also, some plugins only support `windows` and some plugins support only `wp8`.~~
- ~~Not in this version branch: It is possible to make a Windows Phone 8.1 project using either the `windows` platform or the `wp8` platform. The `windows` platform is highly recommended over `wp8` whenever possible. Also, some plugins only support `windows` and some plugins support only `wp8`.~~
- The plugin class name starts with "SQL" in capital letters, but in Javascript the `sqlitePlugin` object name starts with "sql" in small letters.
- Attempting to open a database before receiving the 'deviceready' event callback.
- Inserting STRING into ID field
Expand Down Expand Up @@ -363,7 +364,7 @@ You can find more details and a step-by-step description how to do this right in
The threading model depends on which version is used:
- For Android, one background thread per db;
- for iOS, background processing using a very limited thread pool (only one thread working at a time);
- for Windows "Universal" (8.1), no background processing (for future consideration).
- ~~for Windows "Universal" (8.1), no background processing (for future consideration).~~

# Sample with PRAGMA feature

Expand Down Expand Up @@ -532,26 +533,6 @@ Documentation at: http://ngcordova.com/docs/plugins/sqlite/

# Installing

## Windows "Universal" target platform

**IMPORTANT:** There are issues supporing certain Windows target platforms due to [CB-8866](https://issues.apache.org/jira/browse/CB-8866):
- When using Visual Studio, the default target ("Mixed Platforms") will not work
- Problems have been with the Windows "Universal" version case of a Cordova project using a Visual Studio template/extension instead of Cordova/PhoneGap CLI or `plugman`

*Old workaround:* As an alternative, which will support the ("Mixed Platforms") target, you can use `plugman` instead with [litehelpers / cordova-windows-nufix](https://github.com/litehelpers/cordova-windows-nufix), as described here.

### Old workaround - Using plugman to support "Mixed Platforms"

- make sure you have the latest version of `plugman` installed: `npm install -g plugman`
- Download the [cordova-windows-nufix 3.9.0-nufixpre-01 zipball](https://github.com/litehelpers/cordova-windows-nufix/archive/3.9.0-nufixpre-01.zip) (or you can clone [litehelpers / cordova-windows-nufix](https://github.com/litehelpers/cordova-windows-nufix) instead)
- Create your Windows "Universal" (8.1) project using [litehelpers / cordova-windows-nufix](https://github.com/litehelpers/cordova-windows-nufix):
- `path.to.cordova-windows-nufix/bin/create.bat your_app_path your.app.id YourAppName`
- `cd your_app_path` and install plugin using `plugman`:
- `plugman install --platform windows --project . --plugin https://github.com/litehelpers/cordova-sqlite-common`
- Put your sql program in your project `www` (don't forget to reference it from `www\index.html` and wait for `deviceready` event)

Then your project in `CordovaApp.sln` should work with "Mixed Platforms" on both Windows 8.1 and Windows Phone 8.1.

## Easy install with Cordova CLI tool

npm install -g cordova # if you don't have cordova
Expand All @@ -560,7 +541,7 @@ Then your project in `CordovaApp.sln` should work with "Mixed Platforms" on both

You can find more details at [this writeup](http://iphonedevlog.wordpress.com/2014/04/07/installing-chris-brodys-sqlite-database-with-cordova-cli-android/).

**WARNING:** for Windows target platform please read the section above.
~~**WARNING:** for Windows target platform please read the section above.~~

**IMPORTANT:** sometimes you have to update the version for a platform before you can build, like: `cordova prepare ios`

Expand All @@ -575,7 +556,7 @@ You can find more details at [this writeup](http://iphonedevlog.wordpress.com/20
plugman install --platform MYPLATFORM --project path.to.my.project.folder --plugin https://github.com/litehelpers/cordova-sqlite-common
```

where MYPLATFORM is `android`, `ios`, or `windows`.
where MYPLATFORM is `android`, `ios`~~, or `windows`~~.

A posting how to get started developing on Windows host without the Cordova CLI tool (for Android target only) is available [here](http://brodybits.blogspot.com/2015/03/trying-cordova-for-android-on-windows-without-cordova-cli.html).

Expand All @@ -584,10 +565,10 @@ A posting how to get started developing on Windows host without the Cordova CLI
- `SQLitePlugin.coffee.md`: platform-independent (Literate coffee-script, can be read by recent coffee-script compiler)
- `www`: `SQLitePlugin.js` platform-independent Javascript as generated from `SQLitePlugin.coffee.md` (and checked in!)
- `src`: platform-specific source code:
- `external` - placeholder used to import `sqlite3.[hc]` in this version branch-needed to build Windows "Universal" (8.1) version
- `external` - placeholder ~~used to import `sqlite3.[hc]` in this version branch-needed to build Windows "Universal" (8.1) version~~
- `android` - Java plugin code for Android
- `ios` - Objective-C plugin code for iOS;
- `windows` - Javascript proxy code and SQLite3-WinRT project for Windows "Universal" (8.1);
- ~~`windows` - Javascript proxy code and SQLite3-WinRT project for Windows "Universal" (8.1);~~
- `spec`: test suite using Jasmine (2.2.0), ported from QUnit `test-www` test suite, working on all platforms
- `tests`: very simple Jasmine test suite that is run on Circle CI (Android version) and Travis CI (iOS version)
- `Lawnchair-adapter`: Lawnchair adaptor, based on the version from the Lawnchair repository, with the basic Lawnchair test suite in `test-www` subdirectory
Expand Down Expand Up @@ -669,10 +650,6 @@ Sample change to `config.xml` for Cordova/PhoneGap 2.x:
<plugin name="Compass" value="CDVLocation" />
```

## Manual installation - Windows "Universal" (8.1) version

Described above.

## Quick installation test

Assuming your app has a recent template as used by the Cordova create script, add the following code to the `onDeviceReady` function, after `app.receivedEvent('deviceready');`:
Expand Down
17 changes: 0 additions & 17 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,6 @@

</platform>

<!-- windows -->
<platform name="windows">
<js-module src="src/windows/SQLiteProxy.js" name="SQLiteProxy">
<merges target="" />
</js-module>

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

<!-- Thanks to AllJoyn-Cordova / cordova-plugin-alljoyn: -->
<framework src="src/windows/SQLite3-WinRT/SQLite3/SQLite3.Windows/SQLite3.Windows.vcxproj" custom="true" type="projectReference" target="windows" />
<framework src="src/windows/SQLite3-WinRT/SQLite3/SQLite3.WindowsPhone/SQLite3.WindowsPhone.vcxproj" custom="true" type="projectReference" target="phone" />

</platform>

</plugin>

<!-- vim: set expandtab : -->
1 change: 0 additions & 1 deletion src/windows/SQLite3-WinRT/SQLite3/Constants.cpp

This file was deleted.

50 changes: 0 additions & 50 deletions src/windows/SQLite3-WinRT/SQLite3/Constants.h

This file was deleted.

55 changes: 0 additions & 55 deletions src/windows/SQLite3-WinRT/SQLite3/Database.cpp

This file was deleted.

28 changes: 0 additions & 28 deletions src/windows/SQLite3-WinRT/SQLite3/Database.h

This file was deleted.

Loading

0 comments on commit 8ff4e96

Please sign in to comment.