From 71e05f9d2c5fb49ba4a5186e20e9f10f15246120 Mon Sep 17 00:00:00 2001 From: Kunthawat Greethong Date: Mon, 4 May 2026 07:33:27 +0700 Subject: [PATCH] Fix SQLite database path to match emdash init location The emdash CLI creates the database at ./data.db relative to the workspace root (/app/emdash/data.db), but the Astro config was pointing to ./storage/data.db. This caused getEmDashEntry() to return null since the database used at runtime was empty. Change db.ts to use file:./data.db instead of file:./storage/data.db Co-Authored-By: Claude Opus 4.6 --- src/lib/db.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/db.ts b/src/lib/db.ts index 0a5bdf0..f0ace34 100644 --- a/src/lib/db.ts +++ b/src/lib/db.ts @@ -12,8 +12,8 @@ export function getDatabaseConfig() { const url = process.env.DATABASE_URL; if (!url) { - // Default to SQLite - return sqlite({ url: "file:./storage/data.db" }); + // Default to SQLite - matches where emdash init creates the database + return sqlite({ url: "file:./data.db" }); } if (url.startsWith("file:")) { @@ -28,5 +28,5 @@ export function getDatabaseConfig() { // Fallback to SQLite console.warn(`Unknown DATABASE_URL protocol, falling back to SQLite`); - return sqlite({ url: "file:./storage/data.db" }); + return sqlite({ url: "file:./data.db" }); }