uk.co.workingedge.cordova.plugin.sqliteporter
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"name": "uk.co.workingedge.cordova.plugin.sqliteporter", | ||
@@ -4,0 +4,0 @@ "cordova_name": "sqlite porter", |
@@ -500,3 +500,3 @@ SQLite Porter Cordova/Phonegap Plugin [![Latest Stable Version](https://img.shields.io/npm/v/uk.co.workingedge.cordova.plugin.sqliteporter.svg)](https://www.npmjs.com/package/uk.co.workingedge.cordova.plugin.sqliteporter) [![Total Downloads](https://img.shields.io/npm/dt/uk.co.workingedge.cordova.plugin.sqliteporter.svg)](https://npm-stat.com/charts.html?package=uk.co.workingedge.cordova.plugin.sqliteporter) | ||
"data": { | ||
"updates": { | ||
"deletes": { | ||
"Artist":[ | ||
@@ -503,0 +503,0 @@ { |
@@ -75,9 +75,3 @@ /** | ||
var totalCount, currentCount; | ||
var statements = removeComments(sql) | ||
.match(statementRegEx);; | ||
if(statements === null || (Array.isArray && !Array.isArray(statements))) | ||
statements = []; | ||
function handleError(e){ | ||
@@ -90,3 +84,11 @@ if(opts.errorFn){ | ||
} | ||
var statements = removeComments(sql) | ||
.match(statementRegEx);; | ||
if(statements === null || (Array.isArray && !Array.isArray(statements))) | ||
statements = []; | ||
function applyStatements() { | ||
@@ -563,3 +565,3 @@ if (statements.length > 0) { | ||
function (transaction) { | ||
transaction.executeSql("SELECT sql FROM sqlite_master;", [], | ||
transaction.executeSql("SELECT tbl_name, type FROM sqlite_master;", [], | ||
function (transaction, results) { | ||
@@ -571,4 +573,4 @@ var dropStatements = []; | ||
var row = results.rows.item(i); | ||
if (row.sql != null && row.sql.indexOf("CREATE TABLE") != -1 && row.sql.indexOf("__") == -1) { | ||
var tableName = sqlUnescape(trimWhitespace(trimWhitespace(row.sql.replace("CREATE TABLE", "")).split(/ |\(/)[0])); | ||
if(row.type == 'table') { | ||
var tableName = row.tbl_name; | ||
if(!isReservedTable(tableName)){ | ||
@@ -578,2 +580,8 @@ dropStatements.push("DROP TABLE IF EXISTS " + sqlEscape(tableName)); | ||
} | ||
if(row.type == 'view') { | ||
var viewName = row.tbl_name; | ||
if(!isReservedTable(viewName)){ | ||
dropStatements.push("DROP VIEW IF EXISTS " + sqlEscape(viewName)); | ||
} | ||
} | ||
} | ||
@@ -725,4 +733,4 @@ } | ||
} | ||
module.exports = sqlitePorter; | ||
}()); |
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
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
69440
9
676