sqlite3 data loss
I am currently attempting to use sqlite3 to have a database for a Discord bot. The code works perfectly fine except that at random times throughout the day the database will roll back on itself and lose several hours' and sometimes even days' worth of data. It's been very frustrating because when SQL statements are executed, everything seems normal until I check back hours later and discover that the data was rolled back. I'd like to know how I can resolve this problem so that the database does not lose data
Here are the two functions I use for my database with example calls at the bottom
(Database is not created here because I just copied/pasted the functions and examples from another repl)
Any file system db on repl does not work!
This is because repl always keeps a snapshot of things before you left, and when you get back onto the repl it reverts to the snapshot that you were on last, therefore reverting your data.