feat(db): add Drizzle ORM with local SQLite storage
Configure Bun SQLite with WAL mode, foreign keys, and a shared database path for development and production. Add migration commands and startup migration handling, check database connectivity in the health endpoint, and document configuration while excluding local database files from Git.
This commit is contained in:
9
scripts/start.ts
Normal file
9
scripts/start.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { databasePath } from "../src/db/config";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
// Bun's built HTML assets resolve from dist; keep the database path absolute.
|
||||
process.env.DATABASE_PATH = databasePath;
|
||||
process.env.NODE_ENV = "production";
|
||||
process.chdir(fileURLToPath(new URL("../dist", import.meta.url)));
|
||||
const entrypoint = new URL("../dist/index.js", import.meta.url).href;
|
||||
await import(entrypoint);
|
||||
Reference in New Issue
Block a user