Comparing version 0.0.2 to 0.0.3
@@ -30,17 +30,9 @@ /** | ||
this.groupBy = ['col1']; | ||
this.firstLine = []; | ||
this.functionsBeforeParse = []; | ||
this.functionsAfterParse = ['saveData']; | ||
this.checkFunctionAfterParse = ''; | ||
// this.savePoint = ''; | ||
// this.needTemporaryTable = false; | ||
this.columns = { | ||
col1: { | ||
find: "xml.group" | ||
//exclude: null, | ||
// defaultValue: false, | ||
// valueOptions: { | ||
// replace: {}, | ||
// regex: {} | ||
// } | ||
find: "xml.group", | ||
valueOptions: { | ||
replace: { showReplace: 'hello' } | ||
} | ||
}, | ||
@@ -50,8 +42,2 @@ | ||
find: "xml.tag" | ||
//exclude: null, | ||
// defaultValue: false, | ||
// valueOptions: { | ||
// replace: {}, | ||
// regex: {} | ||
// } | ||
}, | ||
@@ -58,0 +44,0 @@ |
{ | ||
"name": "data2model", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "", | ||
"main": "index.js", | ||
"bin": { | ||
"xml2model": "xml2model.js", | ||
"xml2model": "XmlParser.js", | ||
"csv2model": "Csv2Model.es6", | ||
@@ -9,0 +9,0 @@ "CreateModel": "CreateModel.js" |
@@ -21,3 +21,3 @@ # data2model | ||
and executes the query, given the `exampleModel` found in the models directory. | ||
and executes the query, given the `exampleModel` found in the models directory. | ||
@@ -42,7 +42,6 @@ ## Important | ||
'use strict'; | ||
const _Parser = require('./../index'); | ||
const _Parser = require('data2model'); | ||
const XmlParser = _Parser.xml; | ||
const CsvParser = _Parser.csv; | ||
let parser = new XmlParser({database: 'databaseToUse'}); | ||
let parser = new XmlParser({database: 'databaseToUse'}); | ||
parser.parseFile("./examples/example.xml", ['exampleModel']); | ||
@@ -65,14 +64,2 @@ | ||
As a example, if you add the following to your `_BaseModel`'s functions `Map`, you'll get the same as when running an `INSERT ... ON DUPLICATE KEY UPDATE` query, but for `LOAD DATA LOCAL INFILE`: | ||
[ | ||
'csvImportProducts', (data) => Promise.all([ | ||
this.loadDataInfileString(data.file, 'temp_' + data.table, data.cs, data.ss, data.options), | ||
'COMMIT;START TRANSACTION', | ||
this.copyTableData('temp_' + data.table, data.table, new Map([['tmpTableColumnName', 'destinationColumnName']])), | ||
'SAVEPOINT sp2', | ||
this.rm(data.table, new Map([['where', new Map([['tmpTableColumnName', '']])]])), | ||
this.rmCompareNotIn(data.table, 'temp_' + data.table, new Map([['tmpTableColumnName', 'destinationColumnName']])) | ||
]) | ||
I'll add some examples and easier usage later, feel free to ask on stackoverflow.com or post your issues here. | ||
@@ -79,0 +66,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
265815
1919
69