Sproc it is a Promise-based API for executing SQL stored procedures (for Nodejs)
Work it, Sproc it, Do it, Make us
🎼 ...
Harder, Better, Faster, Stronger
npm i sprocit
const config = {
provider: 'mssql', // only provider, for now
user: 'dbuser',
password: '---',
server: 'localhost',
database: 'master',
options: {
encrypt: false // true, for using Azure
}
}
const sp = require('sprocit').create()
const params = [{name: 'id', value: 1}]
// just 'connect' then => 'execute'
sp.connect(config)
.then(db => {
db.exec('getItem', params)
.then(console.log) // logs results
})
sp.connect(config)
.then(db => {
db.query('select * from items')
.then(console.log) // logs results
})
See tests for advanced usage
TODO:
- Mocha tests with Chai assertions
- PostgreSQL support