mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 03:53:57 +00:00
fix
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
export function createBulkInsertStream(driver, stream, pool, name, options) {
|
function createBulkInsertStream(driver, stream, pool, name, options) {
|
||||||
const collectionName = name.pureName;
|
const collectionName = name.pureName;
|
||||||
const db = pool.__getDatabase();
|
const db = pool.__getDatabase();
|
||||||
|
|
||||||
@@ -12,9 +12,12 @@ export function createBulkInsertStream(driver, stream, pool, name, options) {
|
|||||||
writable.addRow = (row) => {
|
writable.addRow = (row) => {
|
||||||
if (!writable.wasHeader) {
|
if (!writable.wasHeader) {
|
||||||
writable.wasHeader = true;
|
writable.wasHeader = true;
|
||||||
if (row.__isStreamHeader ||
|
if (
|
||||||
|
row.__isStreamHeader ||
|
||||||
// TODO remove isArray test
|
// TODO remove isArray test
|
||||||
Array.isArray(row.columns)) return;
|
Array.isArray(row.columns)
|
||||||
|
)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
writable.buffer.push(row);
|
writable.buffer.push(row);
|
||||||
};
|
};
|
||||||
@@ -56,3 +59,5 @@ export function createBulkInsertStream(driver, stream, pool, name, options) {
|
|||||||
|
|
||||||
return writable;
|
return writable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports = createBulkInsertStream;
|
||||||
|
|||||||
Reference in New Issue
Block a user