mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-27 17:00:54 +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
15 lines
392 B
TypeScript
15 lines
392 B
TypeScript
import Database from "better-sqlite3";
|
|
import { drizzle } from "drizzle-orm/better-sqlite3";
|
|
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
|
|
|
|
import { schema } from "..";
|
|
|
|
export const createDb = () => {
|
|
const sqlite = new Database(":memory:");
|
|
const db = drizzle(sqlite, { schema });
|
|
migrate(db, {
|
|
migrationsFolder: "./packages/db/migrations",
|
|
});
|
|
return db;
|
|
};
|