Problem to run select with sequelize

Asked

Viewed 168 times

0

I’m having trouble executing a select in Nodejs where it takes quite long looking that the same stays in infinite loop.

module - sequelizejs bd - SQL server

dbConnection

const Sequelize = require('sequelize');

    var teste = new Sequelize('bd_name', 'user_name', 'password', {
            host: 'ip_server',
            dialect: 'mssql'
          });
    
        }

teste.authenticate()
.then(()=>{
    console.log('Conexão estabelecida com sucesso.');
    
})
.catch(err=>{
    console.error('Erro na conexão com o banco de dados:', err);
});      
        
    module.exports = function() {
        return teste; 
     }
      

Formulary

function FormulasDAO(connection) {
    this._connection = connection;
}

FormulasDAO.prototype.getFormulas = function(callback){
    this._connection.query('select * from USUARIO', callback);
}


module.exports = function() {
    return FormulasDAO;
}

inserir a descrição da imagem aqui

  • 1

    What size of your table USUARIO? If it has many rows and columns it may be that the query be really slow

  • @Sorack has exactly 280 records

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.