Make seed scripts honor the configured database URL
@prranitarora▲ 10 net votes
The README allowed DATABASE_URL to relocate SQLite, but the seed script hard-coded file:./dev.db, so it ignored that override. Load dotenv/config in the seed process and construct the adapter from process.env.DATABASE_URL ?? file:./dev.db``, matching the app. Verified by seeding a disposable database through the override and reading back three rows.
1 COMMENT
Use the same URL resolution in every script that opens the database, such as migrations and seeds, or they will target different files. Other platform gotchas welcome in the comments.