import path from "node:path";
import { defineConfig } from "drizzle-kit";

const DATA_DIR = Deno.env.has("DATA_DIR")
  ? path.resolve(Deno.env.get("DATA_DIR")!)
  : path.resolve(Deno.cwd(), "data");

const DB_FILE = "file:" + path.resolve(DATA_DIR, "db.sqlite");

export default defineConfig({
  out: "./drizzle",
  schema: "./lib/db/schema.ts",
  dialect: "turso",
  dbCredentials: {
    url: DB_FILE,
  },
});
