Skip to content

Commit

Permalink
fast: ahora incluye pk. Close #20
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoefe committed Oct 12, 2016
1 parent 0665ac1 commit 277f965
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
19 changes: 1 addition & 18 deletions bin/txt-to-sql-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,24 +117,6 @@ function fastProcessEncodingOptions(info) {
info.inputEncodingDetected = encoding;
if(! info.opts.inputEncoding) { info.opts.inputEncoding = info.inputEncodingDetected; }
if(! info.opts.outputEncoding) { info.opts.outputEncoding = info.inputEncodingDetected; }
//var inFromToString = info.rawTable.toString("utf8");
if(info.opts.inputEncoding==='ANSI') {
// if(inFromToString.substr(1).indexOf('\uFFFD')<0) {
// throw new Error('ansi -> utf8: replacement character not found');
// }
//info.decodedBuffer = iconv.decode(info.rawTable, "win1252");
// if(txtToSql.compareBuffers(info.decodedBuffer, info.rawTable) === -1) {
// throw new Error('ansi -> utf8: no conversion performed');
// }
} else if(info.opts.inputEncoding==='UTF8') {
//info.decodedBuffer = inFromToString;
// var result = txtToSql.compareBuffers(info.rawTable, new Buffer(info.decodedBuffer, 'utf8'));
// if(result !== -1) {
// throw new Error('utf8 check failed in position: '+result);
// }
} else {
//info.decodedBuffer = inFromToString;
}
return info;
});
}
Expand All @@ -152,6 +134,7 @@ function fastAnalyzeLines(info) {
txtToSql.verifyColumnNames(info);
txtToSql.determineColumnTypes(info);
txtToSql.determineColumnValuesInfo(info);
txtToSql.determinePrimaryKey(info);
return txtToSql.generatePrepareResult(info);
}

Expand Down
1 change: 1 addition & 0 deletions lib/txt-to-sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ txtToSql.separateRows = separateRows;
txtToSql.verifyColumnCount = verifyColumnCount;
txtToSql.determineColumnTypes = determineColumnTypes;
txtToSql.determineColumnValuesInfo = determineColumnValuesInfo;
txtToSql.determinePrimaryKey = determinePrimaryKey;
txtToSql.quoteNames = quoteNames;
txtToSql.generateDropTable = generateDropTable;
txtToSql.generateCreateScript = generateCreateScript;
Expand Down
1 change: 1 addition & 0 deletions web/txt-to-sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ txtToSql.separateRows = separateRows;
txtToSql.verifyColumnCount = verifyColumnCount;
txtToSql.determineColumnTypes = determineColumnTypes;
txtToSql.determineColumnValuesInfo = determineColumnValuesInfo;
txtToSql.determinePrimaryKey = determinePrimaryKey;
txtToSql.quoteNames = quoteNames;
txtToSql.generateDropTable = generateDropTable;
txtToSql.generateCreateScript = generateCreateScript;
Expand Down

0 comments on commit 277f965

Please sign in to comment.