import { drizzle } from 'drizzle-orm/bun-sqlite';
import { Database } from 'bun:sqlite';
import * as schema from './schema';

if (!Bun.env.TEST_DATABASE_URL) throw new Error('TEST_DATABASE_URL is not set');

const testClient = new Database(Bun.env.TEST_DATABASE_URL);

export const testDb = drizzle(testClient, { schema });