import { Database } from 'bun:sqlite'
import { DB_PATH } from '../config'
import { runMigrations } from './migrations'
import { runSeeds } from './seeds'

// Create database instance
export const db = new Database(DB_PATH)

// Initialize database
export function initDatabase() {
  runMigrations(db)
  runSeeds(db)
  console.log('[DB] SQLite initialized:', DB_PATH)
}

export { Database }
