I'm running a discord bot which uses the quick.db npm package. Quick.db saves to a .sqlite file, which was handy since I could edit some code and restart the program without the file being completely erased. I don't want every thing in that database to erase every time I build/deploy. Is there a way to save this file?
Heroku uses an ephemeral file system: every time you restart your server, the files are wiped. This includes the once-per-day restart that the system performs an automatic restart. In order to save your files, you need to arrange for more permanent storage, such as AWS S3 or another service. You can read more in the help topic Why are my file uploads missing/deleted?. You can also create your own service, if you're so inclined (e.g. host a Filezilla server somewhere), but the main point is that you have to take steps to preserve your data changes. You could also use Postgres or another plugin provided by Heroku add-ons instead of using SQLite.