Skip to content

Commit

Permalink
dev: Disable db query logging given that it's very noisy
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedBassem committed Mar 2, 2024
1 parent 96b28b1 commit a942e69
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions packages/db/drizzle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,9 @@ import Database from "better-sqlite3";
import * as schema from "./schema";
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
import path from "path";
import { Logger } from "drizzle-orm";

class MyLogger implements Logger {
logQuery(query: string, _params: unknown[]): void {
if (process.env.NODE_ENV === "production") {
return;
}
const line = `Query: ${query}`;
console.log(line);
}
}

const sqlite = new Database(process.env.DATABASE_URL);
export const db = drizzle(sqlite, { schema, logger: new MyLogger() });
export const db = drizzle(sqlite, { schema });

export function getInMemoryDB(runMigrations: boolean) {
const mem = new Database(":memory:");
Expand Down

0 comments on commit a942e69

Please sign in to comment.