Ask coding questions

← Back to all posts
Why does Node.js SQLite Rows disappear after some time?
Jareer12

So basically I have this route https://jareer.xyz/api/messages that uses SQLite to store data. But after a while some of the latest added rows disappear i don't understand why is it because I use Uptime Robot?

Voters
Jareer12
Comments
hotnewtop
Coder100

SQLITE uses file based storage. Replit, doesn't support file based storage. To prevent abuse and spammers, files that are programmatically made or changed, the changes will revert if you don't go on to the repl every so often.

Jareer12

Is there a way I can prevent that or any other DBs I can use instead of SQLite? @Coder100

Coder100
  1. you can't
  2. have you heard of replit db? @Jareer12
Jareer12

I read some Repl.it DB docs but couldn't found what would fit for my app so I was thinking if it's possible if you don't use up time and the repl dies and autosaves? Does the repl auto-save when it dies? @Coder100

Coder100

@Jareer12
no, where did you get something about the repl dying?? The file won't save if you aren't on the repl it's just that