Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore: changeset
  • Loading branch information
Princesseuh committed May 1, 2024
commit 2e96f997196e3ced6fffc67a63ca9c1a46b3e10c
5 changes: 5 additions & 0 deletions .changeset/olive-cars-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/db": patch
---

Fixes `ASTRO_DATABASE_FILE` not correctly resolving relative paths (e.g. `ASTRO_DATABASE_FILE=./api/database.db`
3 changes: 2 additions & 1 deletion packages/db/src/runtime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ export function normalizeDatabaseUrl(envDbUrl: string | undefined, defaultDbUrl:
if (envDbUrl.startsWith('file://')) {
return envDbUrl;
}
return new URL(envDbUrl, pathToFileURL(process.cwd())).toString();

return new URL(envDbUrl, pathToFileURL(process.cwd()) + "/").toString();
} else {
// This is going to be a file URL always,
return defaultDbUrl;
Expand Down