debug: add postgres.js debug logging
This commit is contained in:
@@ -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 });
|
||||||
|
|||||||
Reference in New Issue
Block a user