I am trying to run a stored procedure on my SQL database from the node server using seriate. however i get the follwoing error and i am not sure why. I'd really appreciate your help on it.
Error: { [RequestError: SqlContext Error. Failed on step "GetData" with: "Timeout: Request failed to complete i 15000ms"] name: 'RequestError', message: 'SqlContext Error. Failed on step "GetData" with: "Timeout Request failed to complete in 15000ms"', code: 'ETIMEOUT', number: 'ETIMEOUT', lineNumber: undefined, state: undefined, class: undefined, serverName: undefined, procName: undefined, precedingErrors: [], step: 'GetData' }
This is my code:
var sql = require( "seriate" );
var connection = {
name: "example-1",
user: "user",
password: "pass",
host: "host_ip",
database: "Test"
};
exports.getDataSql = function(req, res) {
var results = {};
sql.execute( connection, {
procedure: "GetData",
params: {
Name: {
type: sql.NVARCHAR(50),
val: "user2"
},
LName: {
type: sql.NVARCHAR(50),
val: "user1"
},
finalName: {
type: sql.NVARCHAR(50),
val: "user3"
}
}
}).then( function( results ) {
console.log("getting data: ");
res.json(results[0][0]);
}, function( err ) {
console.log( "Error", err );
res.status(500).send({ error: 'Something failed!' });
} );
};