Skip to content

Commit f168c41

Browse files
committed
Merge pull request #8 from thgreasi/inheritWebSqlDriver
feat: use webSqlDriver methods to reduce the implementation
2 parents 40fb936 + a1cbd7e commit f168c41

File tree

5 files changed

+88
-349
lines changed

5 files changed

+88
-349
lines changed

README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,32 @@
22
[![npm](https://img.shields.io/npm/dm/localforage-cordovasqlitedriver.svg)](https://www.npmjs.com/package/localforage-cordovasqlitedriver)
33
SQLite driver for [Cordova](https://cordova.apache.org/) apps using [localForage](https://github.com/mozilla/localForage).
44

5-
## upgrade warning
6-
7-
v1.2 *BREAKING CHANGE*
8-
The default storage location for SQLite has changed in newer versions of [Cordova SQLite storage plugin](https://github.com/litehelpers/Cordova-sqlite-storage/).
9-
10-
*WARNING*: The new "default" location value is NOT the same as the old default location and would break an upgrade for an app that was using the old default value (0) on iOS.
11-
12-
If you are upgrading to a newer version of `localForage-cordovaSQLiteDriver` you need to verify where your previous storage location was and update the `location` property of the localForage database. Otherwise the default is `'default'`. This is to avoid breaking the iCloud Design Guide. See [here](https://github.com/litehelpers/Cordova-sqlite-storage#important-icloud-backup-of-sqlite-database-is-not-allowed) for further details.
13-
14-
## requirements
5+
## Requirements
156

167
* [Cordova](https://cordova.apache.org/)/[ionic](http://ionicframework.com/)
178
* [Cordova SQLite storage plugin](https://github.com/litehelpers/Cordova-sqlite-storage/)
18-
* [localForage](https://github.com/mozilla/localForage) v1.1.1+
9+
* [localForage](https://github.com/mozilla/localForage) v1.4.0+
10+
* for earlier versions of localforage, please use the v1.2.x releases
1911

20-
## install dependencies
12+
## Install Dependencies
2113

2214
* install Cordova-sqlite-storage plugin `cordova plugin add https://github.com/litehelpers/Cordova-sqlite-storage.git`
2315
* install localForage-cordovaSQLiteDriver `bower install --save localForage-cordovaSQLiteDriver`
2416

25-
## setup your project
17+
## CHANGELOG
18+
19+
### v1.3
20+
Reduce driver size (almost by 50%) by "inheriting" the method implementations of the `localforage.WEBSQL` driver.
21+
22+
### v1.2 *BREAKING CHANGE*
23+
Add support for newer versions of [Cordova SQLite storage plugin](https://github.com/litehelpers/Cordova-sqlite-storage/) (v0.8.x & v1.2.x).
24+
25+
*UPGRADE WARNING*: The default storage location for SQLite has changed in newer versions of [Cordova SQLite storage plugin](https://github.com/litehelpers/Cordova-sqlite-storage/). The new "`default`" location value is NOT the same as the old "`default`" location and will break an upgrade for an app that was using the old default value (0) on iOS. If you are upgrading to a newer version of `localForage-cordovaSQLiteDriver` you need to verify where your previous storage location was and update the `location` property of the localForage database. Otherwise the default is `'default'`. This is to avoid breaking the iCloud Design Guide. See [here](https://github.com/litehelpers/Cordova-sqlite-storage#important-icloud-backup-of-sqlite-database-is-not-allowed) for further details.
26+
27+
### v1.1
28+
Try using the `getSerializer()` (available in localforage v1.3) as the prefered way to retrieve the serializer.
29+
30+
## Setup Your Project
2631

2732
* Include localforage and localForage-cordovaSQLiteDriver in your main html page, after the cordova include.
2833
* Call `defineDriver` and `setDriver` to make localForage use the cordovaSQLiteDriver.

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "localforage-cordovasqlitedriver",
3-
"version": "1.2.1",
3+
"version": "1.3.0",
44
"main": [
55
"src/localforage-cordovasqlitedriver.js"
66
],
@@ -18,7 +18,7 @@
1818
"site*"
1919
],
2020
"dependencies": {
21-
"localforage": "^1.2.1"
21+
"localforage": "^1.4.0"
2222
},
2323
"devDependencies": {
2424
"es6-promise": "~1.0.0",

component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "localForage-cordovaSQLiteDriver",
3-
"version": "1.2.1",
3+
"version": "1.3.0",
44
"dependencies": {
55
"then/promise": "5.0.0"
66
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"driver",
99
"cordova"
1010
],
11-
"version": "1.2.1",
11+
"version": "1.3.0",
1212
"homepage": "https://github.com/thgreasi/localForage-cordovaSQLiteDriver",
1313
"repository": {
1414
"type": "git",

0 commit comments

Comments
 (0)