mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-27 08:50:56 +01:00
* chore: add initial db migration * test: add unit tests for packages auth, common, widgets * fix: deep source issues * fix: format issues * wip: add unit tests for api routers * fix: deep source issues * test: add missing unit tests for integration router * wip: board tests * test: add unit tests for board router * fix: remove unnecessary null assertions * fix: deepsource issues * fix: formatting * fix: pnpm lock * fix: lint and typecheck issues * chore: address pull request feedback * fix: non-null assertions * fix: lockfile broken
18 lines
500 B
TypeScript
18 lines
500 B
TypeScript
import Database from "better-sqlite3";
|
|
import type { BetterSQLite3Database } from "drizzle-orm/better-sqlite3";
|
|
import { drizzle } from "drizzle-orm/better-sqlite3";
|
|
|
|
import * as sqliteSchema from "./schema/sqlite";
|
|
|
|
export const schema = sqliteSchema;
|
|
|
|
export * from "drizzle-orm";
|
|
|
|
export const sqlite = new Database(process.env.DB_URL);
|
|
|
|
export const db = drizzle(sqlite, { schema });
|
|
|
|
export type Database = BetterSQLite3Database<typeof schema>;
|
|
|
|
export { createId } from "@paralleldrive/cuid2";
|