Log the query?
See original GitHub issueHey, is there a way to log the generated query?
I tried this but it did not printed out the queries.
export const db = new Kysely<ModelTypeMap>({
dialect: new PostgresDialect({
host: "localhost",
database: "postgres",
password: "postgres",
user: "postgres",
log: (message) => {
console.info(message);
},
}),
});
// Output
/*
checking client timeout
connecting new client
new client connected
pulse queue
no queued requests
[
{
id: 2,
slug: 'a',
name: 'a',
last_updated: 2021-11-29T11:51:27.581Z,
thumbnail_url: 'aa',
default_source: 'a',
status: 'ENABLED'
}
]
remove idle client
*/
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
General Query Log - MariaDB Knowledge Base
The general query log is a log of every SQL query received from a client, as well as each client connect and disconnect....
Read more >MySQL 8.0 Reference Manual :: 5.4.3 The General Query Log
The general query log is a general record of what mysqld is doing. The server writes information to this log when clients connect...
Read more >Sample queries - Logging - Google Cloud
This document provides you with suggested queries to make it easier to find important logs using the Logs Explorer in the Google Cloud...
Read more >Log queries in Azure Monitor - Microsoft Learn
Azure Monitor Logs is based on Azure Data Explorer, and log queries are written by using the same Kusto Query Language (KQL).
Read more >Query Logging - the Advantage Developer Zone
Query logging is a powerful tool for uncovering problem queries. It also increases the amount of work that Advantage must perform during queries—significantly ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@AzSiAz 0.11.3 now supports a custom logger function:
There’s currently no built-in way to log queries in Kysely. The parameters the
PostgresDialect
takes are passed directly to the pg module.You can get the compiled sql like this for any query:
I’ll add an easier way to debug queries soon.