2024-09-27 21:39:03 -04:00
|
|
|
import { drizzle } from "drizzle-orm/better-sqlite3";
|
|
|
|
import Database from "better-sqlite3";
|
2024-09-27 21:49:52 -04:00
|
|
|
import * as schema from "@server/db/schema";
|
2024-12-25 15:49:35 -05:00
|
|
|
import { APP_PATH } from "@server/config";
|
2024-09-28 14:02:06 -04:00
|
|
|
import path from "path";
|
2024-09-27 21:39:03 -04:00
|
|
|
|
2024-12-25 15:49:35 -05:00
|
|
|
export const location = path.join(APP_PATH, "db", "db.sqlite");
|
2024-10-26 23:37:25 -04:00
|
|
|
|
2024-10-06 11:13:50 -04:00
|
|
|
const sqlite = new Database(location);
|
2024-09-27 21:39:03 -04:00
|
|
|
export const db = drizzle(sqlite, { schema });
|
|
|
|
|
|
|
|
export default db;
|