feat: kysely detail logs on error
This commit is contained in:
parent
67466b4968
commit
05c59937e9
@ -22,6 +22,16 @@ export function getKysely() {
|
||||
kysely = new Kysely<DB>({
|
||||
dialect: createSqliteDialect(),
|
||||
// plugins: [new ParseJSONResultsPlugin()],
|
||||
log: (event) => {
|
||||
if (event.level === "error") {
|
||||
console.error("Query failed : ", {
|
||||
durationMs: event.queryDurationMillis,
|
||||
error: event.error,
|
||||
sql: event.query.sql,
|
||||
params: event.query.parameters,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return kysely;
|
||||
|
Loading…
Reference in New Issue
Block a user