fix: improve env onboarding and dev error messages

This commit is contained in:
2026-01-04 01:22:25 +05:30
parent 1648a56680
commit e9b5fcce43
3 changed files with 15 additions and 5 deletions

View File

@@ -1,6 +1,12 @@
import { drizzle } from 'drizzle-orm/neon-http';
import * as schema from './schema.ts';
export const db = drizzle(process.env.DATABASE_URL!, { schema });
const databaseUrl = process.env.DATABSE_URL;
export * from './schema.ts';
if(!databaseUrl) {
throw new Error{
"DTABASE_URL is missing. Create the required env file (see .env.example) and set DATABASE_URL"
};
}
export const db = drizzle(databaseUrl, { schema });