You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Astro v5.1.10
Node v23.6.0
System Linux (x64)
Package Manager npm
Output server
Adapter @astrojs/node
Integrations @astrojs/tailwind
astro:db
@astrojs/db/file-url
astro-auth
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Hi! I'm trying to run a project in my own private server that uses only a local DB through astro:db. I noticed the following issue
Build the project with ASTRO_DATABASE_FILE=file:database.db astro build creates the 'dist' folder as well as a database.db file with my db schema
I can run the build project with HOST=0.0.0.0 PORT=4321 node ./dist/server/entry.mjs and I see the data being properly added to the database as expected
When I pull a new version of my code and rebuild the project with the same command above then it seems a brand new database.db file is created and ends up overwriting the old file. In so doing I lose all my data.
What's the expected result?
I would expect the data be persisted when one rebuilds the project. I tried exploring the astro db push commands but these only seem to work when one is targeting a remote DB.
If Astro doesn't support running only with a local db then it should say so in the documentation.
A hacky workaround is to copy the original database somewhere else, then build, and then copy it back to the original location. Of course, this only works if there have been no schema changes 😄
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Hi! I'm trying to run a project in my own private server that uses only a local DB through
astro:db
. I noticed the following issueASTRO_DATABASE_FILE=file:database.db astro build
creates the 'dist' folder as well as adatabase.db
file with my db schemaHOST=0.0.0.0 PORT=4321 node ./dist/server/entry.mjs
and I see the data being properly added to the database as expecteddatabase.db
file is created and ends up overwriting the old file. In so doing I lose all my data.What's the expected result?
I would expect the data be persisted when one rebuilds the project. I tried exploring the
astro db push
commands but these only seem to work when one is targeting a remote DB.If Astro doesn't support running only with a local db then it should say so in the documentation.
A hacky workaround is to copy the original database somewhere else, then build, and then copy it back to the original location. Of course, this only works if there have been no schema changes 😄
Link to Minimal Reproducible Example
https://codeberg.org/meadowingc/astro-minimal-issue-db-cleared-on-build
Participation
The text was updated successfully, but these errors were encountered: