Skip to content

Commit

Permalink
chore: changeset (#10925)
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh authored May 1, 2024
1 parent dd1d937 commit a0c77fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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

0 comments on commit a0c77fc

Please sign in to comment.