denodb
denodb copied to clipboard
Add query-logger
I have created a queryLogger option to the database for mysql, postgreSQL and sqlite.
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