tedious-basedal

A Base DAL (data access layer) for tedious (node TDS for SQL Server)

npm install tedious-basedal
2 downloads in the last week
5 downloads in the last month

tedious-baseDAL

A Base DAL (data access layer) for tedious (node TDS for SQL Server)

install

npm install tedious-basedal

usage


  var BaseDAL = require('tedious-basedal')

  var id = 1

  var dal = new BaseDAL()
  dal.ConnectionString ({
      server  : 'localhost'
    , userName: 'username'
    , password: 'pass'
    , database: 'dbName'
  })

  var _params = []
  _params.push({
    name: 'ID',
    type: TYPES.Int,
    value: id
  })

  dal.ExecuteSPDataset('dbo.usp_GetUserByID', _params, function (err, data) {
    if (err) console.error(err)
    else console.log(data)
    // => data {rows: [{column1: 'value'}], returnValue: 1}
  })
npm loves you