-2
I am having problem to recover the data from db SQL Server with Node the same does not pull in any way the result of the query informed:
module mssql
dbConnectio
const sql = require('mssql');
const config = {
user: 'user',
password: 'password',
server: 'id',
database: 'db_name',
port: '1433',
connectionTimeout: '5000',
requestTimeout: '5000',
options: {encrypt: true}
};
var pool = function(){
var conn = new sql.ConnectionPool(config, function(err){
var request = new sql.Request(conn);
//console.dir(request);
return request;
});
return conn;
}
module.exports = function(){
return pool;
}
Formulary
function FormulasDAO(connection) {
this._connection = connection;
}
FormulasDAO.prototype.getFormulas = function(callback){
this._connection.query('select * from USUARIO', callback);
}
module.exports = function() {
return FormulasDAO;
}
Question tag ta incomplete. I got thought it was Node.js only,but it was another. -1. Very confusing.
– Maury Developer
Thanks for the tip @Maurydeveloper
– Bruno Ferreira