- Add disease detail page component with data fetching and error handling - Create shared types for diseases and classifications - Implement API routes for diseases, classifications, and dashboard summary - Develop reusable components for risk badge and disease card - Build catalog page with search and filter functionality - Update dashboard page with data-backed summary and manual classification form - Register new routes in the web application - Ensure type safety and consistency across shared modules
16 lines
437 B
TypeScript
16 lines
437 B
TypeScript
import { drizzle } from 'drizzle-orm/postgres-js';
|
|
import postgres from 'postgres';
|
|
import { env } from '../config/env';
|
|
import * as schema from './schema';
|
|
|
|
let db: ReturnType<typeof drizzle<typeof schema>> | undefined;
|
|
|
|
export function createDbClient() {
|
|
if (!env.databaseUrl) {
|
|
throw new Error('DATABASE_URL is required to create a database client');
|
|
}
|
|
|
|
db ??= drizzle(postgres(env.databaseUrl), { schema });
|
|
return db;
|
|
}
|