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 <noreply@anthropic.com>
This commit is contained in:
@@ -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" });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user