uk.co.workingedge.cordova.plugin.sqliteporter
Advanced tools
Comparing version 0.0.4 to 0.0.5
{ | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"name": "uk.co.workingedge.cordova.plugin.sqliteporter", | ||
"cordova_name": "sqlite porter", | ||
"description": "Enables importing/exporting of SQLite databases to/from JSON/SQL.", | ||
"author": "Dave Alden", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/dpa99c/cordova-sqlite-porter.git" | ||
}, | ||
"cordova": { | ||
"id": "uk.co.workingedge.cordova.plugin.sqliteporter" | ||
}, | ||
"repo": "https://github.com/dpa99c/cordova-sqlite-porter.git", | ||
"issue": "https://github.com/dpa99c/cordova-sqlite-porter/issues", | ||
"keywords": [ | ||
"ecosystem:cordova", | ||
"cordova", | ||
"cordova-android", | ||
"cordova-amazon-fireos", | ||
"cordova-ios", | ||
"cordova-blackberry10", | ||
"cordova-wp7", | ||
"cordova-wp8", | ||
"cordova-windows8", | ||
"cordova-windows", | ||
"cordova-tizen", | ||
"cordova-browser", | ||
"phonegap", | ||
@@ -36,14 +18,3 @@ "database", | ||
], | ||
"platforms": [ | ||
"android", | ||
"amazon-fireos", | ||
"ios", | ||
"blackberry10", | ||
"wp7", | ||
"wp8", | ||
"windows8", | ||
"windows", | ||
"tizen", | ||
"browser" | ||
], | ||
"platforms": [], | ||
"engines": [ | ||
@@ -50,0 +21,0 @@ { |
SQLite Porter Cordova/Phonegap Plugin | ||
================================= | ||
## Contents | ||
* [Overview](#overview) | ||
* [Installation](#installation) | ||
* [Usage](#usage) | ||
* [JSON import optimisations](#json-import-optimisations) | ||
* [Example projects](#example-projects) | ||
* [License](#license) | ||
# Overview | ||
This Cordova/Phonegap plugin can be used to import/export to/from a SQLite database using either SQL or JSON. | ||
@@ -21,3 +32,3 @@ | ||
Usage scenarios | ||
## Usage scenarios | ||
@@ -28,9 +39,2 @@ - Create and populate a database from a database dump. | ||
## Contents | ||
* [Installation](#installation) | ||
* [Usage](#usage) | ||
* [Example projects](#example-projects) | ||
* [License](#license) | ||
# Installation | ||
@@ -334,6 +338,23 @@ | ||
## Example projects | ||
# JSON import optimisations | ||
### HTML5 WebSQL | ||
The JSON structure passed to the [importJsonToDb()](#importjsontodb) function is parsed in order to generate corresponding SQL commands. | ||
In doing so, the following optimisations have been made to minimize time taken to import large amounts of data: | ||
## Batch inserts | ||
Using UNION SELECT syntax (see [this stackoverflow post](http://stackoverflow.com/a/5009740/777265) for details), INSERTS are grouped by up to 500 in a single SQL statement. | ||
This leads to significant performance gains when bulk importing data as to populate a database | ||
For example, in the [example project](https://github.com/dpa99c/cordova-sqlite-porter-example) illustrating use of this plugin, | ||
the complex database example is actually the [Chinook database](https://chinookdatabase.codeplex.com/) - a sample database which contains over 15,000 INSERTS in the SQL file. | ||
Running the example project on my Samsung Galaxy S4, importing this SQL file takes around 300 seconds (5 mins). | ||
Whereas the JSON equivalent (using UNION SELECTs) contains only 17 INSERT statements and importing this takes around 3 seconds - 100 times faster! | ||
Note: when using the [importSqlToDb()](#importsqltodb), you must make any optimisations in your SQL. | ||
# Example projects | ||
## HTML5 WebSQL | ||
[https://github.com/dpa99c/cordova-sqlite-porter-example](https://github.com/dpa99c/cordova-sqlite-porter-example) | ||
@@ -343,3 +364,3 @@ | ||
### Native SQLite | ||
## Native SQLite | ||
@@ -350,3 +371,3 @@ [https://github.com/dpa99c/cordova-sqlite-porter-example-native-plugin](https://github.com/dpa99c/cordova-sqlite-porter-example-native-plugin) | ||
License | ||
# License | ||
================ | ||
@@ -353,0 +374,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40502
390
2
1