mssqltask
v0.3.6
Published
Task for MS SQL Server
Downloads
6
Readme
mssqltask
Features
- Cron-style scheduler
- Running at the same time on the server list
- Can save result to json files to disk
- Run in workers
License
MIT
Install
npm i mssqltask
Example
import * as mssqltask from 'mssqltask'
const task = mssqltask.Create({
key: 'task1',
metronom: {kind: 'cron', cron: '0 */1 * * * *'},
servers: [
{
"instance": "./EXPRESS2017",
"login": "sa",
"password": "123456789"
},
],
queries: ["print 'hello'; select * from sys.objects; select * from sys.objects; print 'bye'"],
processResult: {
pathSaveTickets: 'c:/log',
pathSaveRows: 'c:/log',
pathSaveMessages: 'c:/log'
}
})
task.maxWorkersSet(5) //if need - set limit, default = each mssql server run in individual worker
task.onError(error => {
console.log(error)
})
task.onChanged(state => {
console.log(state)
})
task.start()