Matthew Trejo há 4 meses atrás
pai
commit
34535b353a
1 ficheiros alterados com 4 adições e 1 exclusões
  1. 4 1
      src/lib/db/index.ts

+ 4 - 1
src/lib/db/index.ts

@@ -5,9 +5,12 @@ import { drizzle } from 'drizzle-orm/postgres-js';
 import postgres from 'postgres';
 import * as schema from './schema';
 
+// Ensure postgres is properly imported
+const postgresClient = postgres || require('postgres');
+
 if (!process.env.DATABASE_URL) {
   throw new Error('DATABASE_URL is not defined');
 }
 
-const client = postgres(process.env.DATABASE_URL);
+const client = postgresClient(process.env.DATABASE_URL);
 export const db = drizzle(client, { schema });