Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vasilevvitalii/mssqltask
Task for MS SQL Server for nodejs backend app
https://github.com/vasilevvitalii/mssqltask
Last synced: about 2 months ago
JSON representation
Task for MS SQL Server for nodejs backend app
- Host: GitHub
- URL: https://github.com/vasilevvitalii/mssqltask
- Owner: VasilevVitalii
- License: mit
- Created: 2021-09-21T16:44:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-03T17:41:33.000Z (almost 3 years ago)
- Last Synced: 2024-11-03T08:33:59.190Z (2 months ago)
- Language: TypeScript
- Homepage:
- Size: 1.38 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mssqltask
## Features
1. Cron-style scheduler
2. Running at the same time on the server list
3. Can save result to json files to disk
4. Run in workers
## License
*MIT*
## Install
```
npm i mssqltask
```
## Example
```javascript
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()
```