You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-9
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Native SQLite component with API based on HTML5/[Web SQL (DRAFT) API](http://www
6
6
- macOS ("osx" platform)
7
7
- Windows 10 (UWP) DESKTOP and MOBILE (see below for major limitations)
8
8
9
-
Browser platform is supported _with some limitations (no support for numbered parameters)_as described in [Browser platform usage notes](#browser-platform-usage-notes) sectionbelow.
9
+
Browser platform is currently supported with some limitations as described in [browser platform usage notes](#browser-platform-usage-notes) section, will be supported with more features such as numbered parameters in upcoming major release for July 2018 (see below).
10
10
11
11
**LICENSE:** MIT, with Apache 2.0 option for Android and Windows platforms (see [LICENSE.md](./LICENSE.md) for details, including third-party components used by this plugin)
12
12
@@ -29,13 +29,6 @@ New release in July 2018 will include the following major enhancements ([litehel
29
29
-~~drop Android NDK build for x86_64 ([litehelpers/Cordova-sqlite-storage#772](https://github.com/litehelpers/Cordova-sqlite-storage/issues/772)); NDK build for x86 will still work on x86_64 if no other plugins have NDK build for x86_64; feedback is requested in case of interest in NDK build for x86_64~~
30
30
- drop support for location: 0-2 values in openDatabase call (please use `location: 'default'` or `iosDatabaseLocation` setting in openDatabase as documented below)
31
31
32
-
## Browser platform usage notes
33
-
34
-
As stated above the browser platform will be supported _(with numbered parameters working_ using [kripken / sql.js](https://github.com/kripken/sql.js) (see [litehelpers/Cordova-sqlite-storage#576](https://github.com/litehelpers/Cordova-sqlite-storage/pull/576)) in the near future. Alternative solutions for now _(with no support for numbered parameters such as `?1`, `?2`, ...)_:
35
-
36
-
- Use [brodybits / sql-promise-helper](https://github.com/brodybits/sql-promise-helper) as described in [brodybits/sql-promise-helper#4](https://github.com/brodybits/sql-promise-helper/issues/4)
37
-
- Mocking on Ionic Native is possible as described in <https://www.techiediaries.com/mocking-native-sqlite-plugin/> and <https://medium.com/@tintin301/ionic-sqlite-storage-setting-up-for-browser-development-and-testing-67c0f17fc7af>
38
-
39
32
## About this plugin version
40
33
41
34
This is the common plugin version which supports the most widely used features and serves as the basis for the other versions.
@@ -326,6 +319,37 @@ In addition, this guide assumes a basic knowledge of some key JavaScript concept
326
319
327
320
**NOTICE:** This plugin is only supported with the Cordova CLI. This plugin is *not* supported with other Cordova/PhoneGap systems such as PhoneGap CLI, PhoneGap Build, Plugman, Intel XDK, Webstorm, etc.
328
321
322
+
## Browser platform usage notes
323
+
324
+
As stated above the browser platform will supported with features such as numbered parameters using [kripken / sql.js](https://github.com/kripken/sql.js) (see [litehelpers/Cordova-sqlite-storage#576](https://github.com/litehelpers/Cordova-sqlite-storage/pull/576)) in the near future. Alternative solutions for now, with features such as numbered paramters (`?1`, `?2`, etc.) missing:
325
+
326
+
1. Use [brodybits / sql-promise-helper](https://github.com/brodybits/sql-promise-helper) as described in [brodybits/sql-promise-helper#4](https://github.com/brodybits/sql-promise-helper/issues/4)
327
+
2. Mocking on Ionic Native is possible as described in <https://www.techiediaries.com/mocking-native-sqlite-plugin/> and <https://medium.com/@tintin301/ionic-sqlite-storage-setting-up-for-browser-development-and-testing-67c0f17fc7af>
328
+
3. Open the database as follows:
329
+
330
+
```js
331
+
if (window.cordova.platformId==='browser') db =window.openDatabase('MyDatabase', '1.0', 'Data', 2*1024*1024);
332
+
else db =window.sqlitePlugin.openDatabase({name:'MyDatabase.db', location:'default'});
(lower limit needed to avoid permission request from Safari)
344
+
345
+
and limit database access to DRAFT standard transactions:
346
+
- no `executeSql` calls outside DRAFT standard transactions
347
+
- no `sqlBatch` calls
348
+
- no `echoTest` or `selfTest` possible
349
+
- no `deleteDatabase` calls
350
+
351
+
It would be ideal for the application code to abstract the openDatabase part away from the rest of the database access code.
352
+
329
353
### Windows platform notes
330
354
331
355
The Windows platform can present a number of challenges which increase when using this plugin. The following tips are recommended for getting started with Windows:
@@ -688,7 +712,7 @@ FUTURE TBD: Proper date/time handling will be further tested and documented at s
688
712
## Major TODOs
689
713
690
714
- More formal documentation of API, especially for non-standard functions
691
-
- Browser platform
715
+
- Browser platform, using [kripken / sql.js](https://github.com/kripken/sql.js) in upcoming release, as discussed in [litehelpers/Cordova-sqlite-storage#576](https://github.com/litehelpers/Cordova-sqlite-storage/pull/576)
692
716
- IndexedDBShim adapter (possibly based on IndexedDBShim)
693
717
- Further cleanup of [support](#support) section
694
718
- Resolve or document remaining [open Cordova-sqlite-storage bugs](https://github.com/litehelpers/Cordova-sqlite-storage/issues?q=is%3Aissue+is%3Aopen+label%3Abug-general)
0 commit comments