Answer the question
In order to leave comments, you need to log in
Very slow SQL speed in NODE + tedious (AZURE), what could be the problem?
test middleware:
exports.Test = function (req, res, next) {
var id = 1;
var param = 'test';
var bodyParser = require('body-parser');
var Connection = require('tedious').Connection;
var config = {
// тут конфиг БД
options: {encrypt: true, database: 'database'}
};
var Request = require('tedious').Request;
var TYPES = require('tedious').TYPES;
var connection = new Connection(config);
connection.on('connect', function(err) {
executeStatement();
});
function executeStatement() {
request = new Request("select * from dbo.Table where param= '"+param+"' AND Id= '"+id+"' ", function(err, rowCount) {
res.send(JSON.stringify(menues));
});
var menues = new Array();
request.on('row', function(columns) {
columns.forEach(function(column) {
menues.push(column.value);
});
});
connection.execSql(request);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question