Skip to content

Conversation

@keke001009
Copy link

I have created a queryLogger option to the database for mysql, postgreSQL and sqlite.

sequelize logging options

example

database

  const connection: Database = new Database(
    { dialect: "mysql" },
    {
      ...options,
      queryLogger : (query : string, execTime : number)=>{
        console.log(`[${execTime} ms] ${query}`)
      }
    },
  );

code

const result = await Flight.where({ departure: "Paris" }).first();

expected

[9 ms] select * from `flights` where `departure` = 'Paris' limit 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant