Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uk.co.workingedge.cordova.plugin.sqliteporter

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uk.co.workingedge.cordova.plugin.sqliteporter - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

35

package.json
{
"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 @@ {

45

README.md
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc