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

data2model

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data2model - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

22

models/exampleModel.js

@@ -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 @@

4

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

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