mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 02:06:01 +00:00
better usage of __isStreamHeader flag
This commit is contained in:
@@ -14,18 +14,13 @@ function createBulkInsertStream(driver, stream, pool, name, options) {
|
||||
writable.addRow = (row) => {
|
||||
if (!writable.wasHeader) {
|
||||
writable.wasHeader = true;
|
||||
if (
|
||||
row.__isStreamHeader ||
|
||||
// TODO remove isArray test
|
||||
Array.isArray(row.columns)
|
||||
)
|
||||
return;
|
||||
if (row.__isStreamHeader) return;
|
||||
}
|
||||
if (options.createStringId) {
|
||||
row = {
|
||||
_id: new ObjectId().toString(),
|
||||
...row,
|
||||
}
|
||||
};
|
||||
}
|
||||
writable.buffer.push(row);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user