From 561e7b546ede061cf859c360bad06ff60995020d Mon Sep 17 00:00:00 2001 From: Christopher Mayor Date: Mon, 27 Apr 2026 11:57:23 -0700 Subject: [PATCH] debug: add postgres.js debug logging --- src/lib/db/index.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/db/index.ts b/src/lib/db/index.ts index 8069953..5407054 100644 --- a/src/lib/db/index.ts +++ b/src/lib/db/index.ts @@ -4,5 +4,12 @@ import * as schema from "./schema"; const connectionString = process.env.DATABASE_URL!; -const client = postgres(connectionString); -export const db = drizzle(client, { schema }); +const client = postgres(connectionString, { + debug: (connection, query, params, types) => { + console.log("[postgres.js debug]", query, params); + }, + onnotice: (notice) => { + console.log("[postgres.js notice]", notice); + }, +}); +export const db = drizzle(client, { schema, logger: true });