diff --git a/packages/server/src/db/kysely.ts b/packages/server/src/db/kysely.ts index 6307668..75ca907 100644 --- a/packages/server/src/db/kysely.ts +++ b/packages/server/src/db/kysely.ts @@ -22,7 +22,17 @@ export function getKysely() { kysely = new Kysely({ 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; -} \ No newline at end of file +}