Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions packages/backend/src/db/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Database } from 'bun:sqlite';
import { drizzle } from 'drizzle-orm/bun-sqlite';
import { drizzle as drizzlePg } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';
import { getCurrentLogLevel, logger } from '../utils/logger';
import { logger } from '../utils/logger';
import path from 'node:path';
import fs from 'node:fs';

Expand All @@ -19,16 +19,6 @@ let pgliteClient: any = null;
let currentDialect: SupportedDialect | null = null;
let currentSchema: any = null;

function createDrizzleLogger() {
return {
logQuery(query: string, params: unknown[]) {
if (getCurrentLogLevel() === 'silly') {
logger.silly(`Query: ${query}`);
}
},
};
}

function parseConnectionString(uri: string): {
dialect: SupportedDialect;
connectionString: string;
Expand Down Expand Up @@ -140,7 +130,6 @@ export function initializeDatabase(connectionString?: string) {
systemSettings,
oauthCredentials,
},
logger: createDrizzleLogger(),
});
} else {
const postgresDriver = getPostgresDriver();
Expand Down Expand Up @@ -190,7 +179,6 @@ export function initializeDatabase(connectionString?: string) {
pgliteClient = dataDir ? new PGlite(dataDir) : new PGlite();
dbInstance = drizzlePglite(pgliteClient, {
schema,
logger: createDrizzleLogger(),
});
} else {
sqlClient = postgres(connStr, {
Expand All @@ -208,7 +196,6 @@ export function initializeDatabase(connectionString?: string) {

dbInstance = drizzlePg(sqlClient, {
schema,
logger: createDrizzleLogger(),
});
}
}
Expand Down