0

Is there a method or property that I can see the raw query that is going to be executed on my MS SQL DB when I execute the findAll.

var sql= {where: query.id,
        attributes: queryAttrb,
        include: [
            {
                model: queryModel,
                where: dboQuery.spiStatus
            }]};

model.findAll(sql);
Ajay Srikanth
  • 1,095
  • 4
  • 22
  • 43
  • 4
    Possible duplicate of [How can I see the SQL generated by Sequelize.js?](http://stackoverflow.com/questions/21427501/how-can-i-see-the-sql-generated-by-sequelize-js) – Ryan Wheale Jan 04 '17 at 01:36

1 Answers1

0

Just add logging:

var sql = {
    where: query.id,
    attributes: queryAttrb,
    include: [
        {
            model: queryModel,
            where: dboQuery.spiStatus
        }],
    logging: console.log
};

model.findAll(sql);
Adam
  • 4,985
  • 2
  • 29
  • 61