Skip to content
← Back to Community
sqlite3
Profile icon
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
Profile icon
SaxonHays
Profile icon
pcvanhoren
Profile icon
werfo
Profile icon
22Guptalavanya
Profile icon
21natzil
Profile icon
JohnsonTheGreat
Comments
hotnewtop
Profile icon
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?

Profile icon
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.

Profile icon
gherson

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

Profile icon
DrinksClub

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

Profile icon
AbdulKalam4

any solution for php for the same problem