import { drizzle } from 'drizzle-orm/neon-http';
import * as schema from './schema.ts';

const databaseUrl = process.env.DATABSE_URL;

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 });