mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 08:56:00 +00:00
JSON import
This commit is contained in:
@@ -15,7 +15,6 @@ class ParseStream extends stream.Transform {
|
||||
this.rowsWritten = 0;
|
||||
}
|
||||
_transform(chunk, encoding, done) {
|
||||
const obj = JSON.parse(chunk);
|
||||
if (!this.wasHeader) {
|
||||
this.push({
|
||||
__isStreamHeader: true,
|
||||
@@ -25,7 +24,7 @@ class ParseStream extends stream.Transform {
|
||||
this.wasHeader = true;
|
||||
}
|
||||
if (!this.limitRows || this.rowsWritten < this.limitRows) {
|
||||
this.push(obj.value);
|
||||
this.push(chunk.value);
|
||||
this.rowsWritten += 1;
|
||||
}
|
||||
done();
|
||||
|
||||
Reference in New Issue
Block a user