From 2f5c891654fe72291a3223aa0a41964501bd0604 Mon Sep 17 00:00:00 2001 From: mbean Date: Mon, 15 Oct 2018 10:42:45 -0700 Subject: [PATCH] temp --- websqldump.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/websqldump.js b/websqldump.js index 5074643..20155bd 100644 --- a/websqldump.js +++ b/websqldump.js @@ -40,11 +40,12 @@ params: [name], success: function(results) { if (!results.rows || !results.rows.length) { - if (typeof config.error === "function") - config.error("No such table: " + table); + if (typeof config.error === "function") { + config.error(`No such ${type}: ${name}`); + } return; } - config.exportSql.push(results.rows.item(0)["sql"]); + config.exportSql.push(results.rows.item(0)["sql"] + ";"); if (config.schemaonly || type === "view") { if (typeof config.success === "function") { config.success(config.exportSql); @@ -72,17 +73,18 @@ } config.exportSql.push( "INSERT INTO " + - table + + name + "(" + _fields.join(",") + ") VALUES (" + _values.join(",") + - ")" + ");" ); } } - if (typeof config.success === "function") - config.success(config.exportSql.toString()); + if (typeof config.success === "function") { + config.success(config.exportSql); + } }, error: function(err) { if (typeof config.error === "function") config.error(err);