Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vasilevvitalii/mssqldriver
Driver for MS SQL Server, based on tediousjs
https://github.com/vasilevvitalii/mssqldriver
Last synced: about 2 months ago
JSON representation
Driver for MS SQL Server, based on tediousjs
- Host: GitHub
- URL: https://github.com/vasilevvitalii/mssqldriver
- Owner: VasilevVitalii
- License: mit
- Created: 2021-10-21T18:11:59.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-21T07:01:28.000Z (about 1 year ago)
- Last Synced: 2024-10-28T12:09:53.960Z (2 months ago)
- Language: TypeScript
- Size: 1.07 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mssqldriver
Driver for MS SQL Server, based on https://tediousjs.github.io/tedious
## Features
1. Receiving data in chunks or full
2. Receiving spid
3. Many queries in one connection
## License
*MIT*
## Install
```
npm i mssqldriver
```
## Example
```typescript
import * as mssqldriver from 'mssqldriver'
const mssql = mssqldriver.Create({
authentication: 'sqlserver',
instance: 'myserver/myinstance',
login: 'sa',
password: '123'
})
mssql.exec([`print 'Hello'`, `select * from sys.columns`], {formatCells: 'string', hasSpid: true, receiveMessage: 'directly', receiveTables: 200}, callbackExec => {
if (callbackExec.kind === 'spid') {
console.log(`spid`, callbackExec.spid)
return
}
if (callbackExec.kind === 'message') {
console.log(`message`, callbackExec.message)
return
}
if (callbackExec.kind === 'columns') {
console.log(`columns (new table begin)`, callbackExec.columns)
return
}
if (callbackExec.kind === 'rows') {
console.log(`rows`, callbackExec.rows)
return
}
if (callbackExec.kind === 'finish') {
console.log(`finish`, callbackExec.finish)
}
})
```