New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

sprocit

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sprocit

call your sprocs from node

latest
Source
npmnpm
Version
0.2.2
Version published
Maintainers
1
Created
Source

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

Keywords

sql

FAQs

Package last updated on 18 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts