J
J
jtag2021-05-02 15:11:04
Node.js
jtag, 2021-05-02 15:11:04

How to display the output to the console of a "raw" mysql query when querying?

I am using nodejs and sequelize, mysql dialect. There is a request:

let uuid_person = uuid();
    try {
      let person = await db.person.findOrCreate({
        where: {
          sirname: sirname,
          name: name,
        },
        default:{
          uuid: uuid_person,
          middlename: middlename,
          iin: iin,
          sex: sex,
          birthday: brthd,
          actuality: '1'
        }
      })
    }catch(e){
      console.log(e)
    }

Is it possible to add in the options so that the query for mysql is displayed in the console?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
ReactLover, 2021-05-02
@msa6886

{ logging: console.log }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question