debug: add postgres.js debug logging

This commit is contained in:
Christopher Mayor
2026-04-27 11:57:23 -07:00
parent d686d1bd4f
commit 561e7b546e

View File

@@ -4,5 +4,12 @@ import * as schema from "./schema";
const connectionString = process.env.DATABASE_URL!; const connectionString = process.env.DATABASE_URL!;
const client = postgres(connectionString); const client = postgres(connectionString, {
export const db = drizzle(client, { schema }); 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 });