a fun bot for the hc slack
1import { drizzle } from "drizzle-orm/bun-sqlite";
2import { Database } from "bun:sqlite";
3import * as schema from "./schema";
4
5// Use environment variable for the database path in production
6const dbPath = process.env.DATABASE_PATH || "./local.db";
7
8// Create a SQLite database instance using Bun's built-in driver
9const sqlite = new Database(dbPath);
10
11// Create a Drizzle instance with the database and schema
12export const db = drizzle(sqlite, { schema });
13
14// Export the sqlite instance and schema for use in other files
15export { sqlite, schema };