Comparing version 0.0.2 to 0.0.3
23
index.js
@@ -1,2 +0,2 @@ | ||
var SQL, exports, _ints, _processAll, _processInts, _processVarChars, _varchars; | ||
var SQL, exports, _fail, _ints, _processAll, _processInts, _processVarChars, _varchars; | ||
@@ -30,8 +30,13 @@ SQL = require("mssql"); | ||
_fail = function(err, fail) { | ||
if (fail && err) { | ||
fail(err); | ||
} else if (err) { | ||
console.log(err); | ||
} | ||
}; | ||
exports = module.exports = function(config) { | ||
return function(req, res, next) { | ||
if (!req.Hero) { | ||
req.Hero = {}; | ||
} | ||
req.Hero.mssqlHero = { | ||
req.mssqlHero = { | ||
AddVarChar: function(key, length) { | ||
@@ -54,3 +59,3 @@ _varchars.push([key, length]); | ||
if (err) { | ||
console.log(err); | ||
_fail(err, fail); | ||
} | ||
@@ -61,11 +66,11 @@ ps = new SQL.PreparedStatement(); | ||
if (err) { | ||
console.log(err); | ||
_fail(err, fail); | ||
} | ||
ps.execute(params, function(err, recordset) { | ||
if (err) { | ||
console.log(err); | ||
_fail(err, fail); | ||
} | ||
ps.unprepare(function(err) { | ||
if (err) { | ||
console.log(err); | ||
_fail(err, fail); | ||
} | ||
@@ -72,0 +77,0 @@ success(recordset); |
{ | ||
"name": "mssql-hero", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"email":"rob.dooh@threestonestudios.com", | ||
@@ -5,0 +5,0 @@ "auth":"Rob Dooh", |
Sorry, the diff of this file is not supported yet
6675
132