Ask coding questions

← Back to all posts
sqlite3
JohnsonTheGreat

I've been trying to get used to using sqlite3 recently and mostly it's been going well. However recently, my database files have started becoming malformed. Is it because I'm not properly closing my connection to the database? I've had this error using both Python and NodeJS and it is starting to concern me.

Here's my code that has the error, I was planning on changing it to add all the DB handling to the db file to make it neater, but I think I'll have to stop the errors from occurring.

https://repl.it/@JohnsonTheGreat/Express-Checklist-Generator-1

Voters
pcvanhoren
werfo
22Guptalavanya
21natzil
JohnsonTheGreat
Comments
hotnewtop
21natzil

We're sorry Johnson, you're not doing anything wrong. Repls and sqlite3 do not play nicely, and often files will become malformed. While this is an issue we're trying to solve. However at the moment, using sqlite is not possible. Might I suggest some great alternatives? Python has tinyDB and ZODB, which don't become corrupted.

gherson

@21natzil Is it still true that Sqlite3 usage is discouraged?

DrinksClub

@21natzil any solution for node.js? please.

haroldsikkema

I am wondering, Is this data corruption still an issue in 2021? What is the current recommended way to setup a persistent SQL database with Replit?