Comments (2)
In a way parallel to that, can it use other packages such as KnexJs to get the job done?
from node-etl.
Solved it.
const streamz = require('streamz')
const knex = require('knex')
const SQL = knex({
client: 'mssql',
connection: { ... }
}
const n = 100
...
.pipe(streamz(async function insert (batch) {
return await SQL.batchInsert(table, batch, n)
.then(r => r && console.log(`${n} rows inserted`) || true) // mandatory to execute insert command
.catch(e => {
const E = {
...e,
message: e.message.replace(/(@p0).+(@p\d+)/m, '$1, ...$2'), // shortens Knex errors
data0: batch[0] // add first row data for debugging
}
throw E // return error to caller
})
}))
Perhaps better would be to create a plugin that encapsulates that, but anyways..
from node-etl.
Related Issues (20)
- Parallel processing HOT 1
- Postgres Upsert Requires All NOT NULL values to be included in the object.
- Typescript typings HOT 4
- Mongo insert is deprecated HOT 2
- Missing "pipeline" option in Elasticsearch
- fixed layout for binary source
- Postgres Upsert - Unique Field Support
- Old version of [email protected] has a dependency to "minimist": "^0.2.0" with a prototype pollution vulnerability HOT 1
- Can't change data type of field in Elasticsearch mapping
- __line HOT 1
- Mongo "pushResults" option
- Close mysql stream on error
- MSSQL Support HOT 1
- mongo ConnectAsync undefined
- ElasticSearch should retry with backoffs if transport error
- Elasticsearch concurrency option does nothing HOT 1
- Add AWS DynamoDB HOT 1
- etl.csv: strict: false - all headers lost after row with wrong number of columns for all following records
- Postgres upsert non-functional. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-etl.