first commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { drizzle } from 'drizzle-orm/postgres-js';
|
||||
import postgres from 'postgres';
|
||||
import * as schema from './schema';
|
||||
|
||||
const connectionString = process.env.DATABASE_URL!;
|
||||
|
||||
if (!connectionString) {
|
||||
throw new Error('DATABASE_URL is required');
|
||||
}
|
||||
|
||||
// For query client (server)
|
||||
const client = postgres(connectionString);
|
||||
|
||||
export const db = drizzle(client, { schema });
|
||||
|
||||
export * from './schema';
|
||||
Reference in New Issue
Block a user