import Database from "better-sqlite3";
import { drizzle } from "drizzle-orm/better-sqlite3";
import * as schema from "./schema";

// Configurable database path with intelligent defaults
const dbPath = "./data/fitai.db";

const sqlite = new Database(dbPath);
export const db = drizzle(sqlite, { schema });

export * from "./schema";
export {
  eq,
  and,
  or,
  desc,
  asc,
  sql,
  inArray,
  gte,
  lte,
  like,
} from "drizzle-orm";
