Comparing version 0.2.1 to 0.3.0
@@ -76,2 +76,18 @@ 'use strict'; | ||
} | ||
}, { | ||
key: 'replace', | ||
value: function replace(tableName, file) { | ||
var _this3 = this; | ||
var origins = require(file); | ||
var _conn = void 0; | ||
return this._conn.then(function (conn) { | ||
_conn = conn; | ||
return _bluebird2.default.mapSeries(origins, function (d, i) { | ||
d.id = i + 1; | ||
var statement = _this3.propsToColumn(d); | ||
return _conn.query('insert into ' + tableName + ' set ? on duplicate key update ? ', [statement, statement]); | ||
}); | ||
}); | ||
} | ||
}]); | ||
@@ -78,0 +94,0 @@ |
{ | ||
"name": "json2mysql", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "A tool for comparing your configure json file with mysql table, then Loaded", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
7215
80
2