0.2.2 ā€¢ Published 6 years ago

sprocit v0.2.2

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

log Sproc it

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

Install

npm i sprocit 

Create your config

const config = {
  provider: 'mssql', // only provider, for now
  user: 'dbuser',
  password: '---',
  server: 'localhost',
  database: 'master',
  options: {
    encrypt: false // true, for using Azure
  }
}

Execute a Stored procedure

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
  })

Run a Query

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
0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago