CSV import fixed

This commit is contained in:
Jan Prochazka
2024-09-17 09:59:47 +02:00
parent 319a7fd003
commit 4065e05013
4 changed files with 49 additions and 32 deletions

View File

@@ -32,7 +32,7 @@
"prepublishOnly": "yarn build"
},
"devDependencies": {
"csv": "^5.3.2",
"csv": "^6.3.10",
"dbgate-plugin-tools": "^1.0.7",
"lodash": "^4.17.21",
"webpack": "^5.91.0",

View File

@@ -51,6 +51,7 @@ async function reader({ fileName, encoding = 'utf-8', header = true, delimiter,
delimiter,
skip_lines_with_error: true,
to_line: limitRows ? limitRows + 1 : undefined,
ltrim: true,
});
const downloadedFile = await dbgateApi.download(fileName);
const fileStream = fs.createReadStream(downloadedFile, encoding);