Click here to Skip to main content
15,791,531 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
so i made a small discord bot with node.js and used sqlite in it.
i deployed it and it worked. but if i update my bot the whole database get reset becous the old database file overides it. how cna i prevent this from happening ?

What I have tried:

searching the internet. but id did not find anything that could help me.
Updated 4-Apr-18 9:24am

1 solution

The says[^]:
SQLite runs in memory, and backs up its data store in files on disk. While this strategy works well for development, Heroku’s Cedar stack has an ephemeral filesystem. You can write to it, and you can read from it, but the contents will be cleared periodically. If you were to use SQLite on Heroku, you would lose your entire database at least once every 24 hours.
Everytime you update your app, you lose you in memory database. So change your database to something other than SQLite.
Share this answer
dolfijn3000 4-Apr-18 14:26pm    
I just found that article too. But i dont know anything else to use.
Christiaan van Bergen 4-Apr-18 14:51pm    
Sorry, I cannot advise you on which one to use. Look at the marketplace ( Ask a new question here on CP, what a good (beginners) alternative would be. Good luck.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900