Ask coding questions

← Back to all posts
sqlite3
JohnsonTheGreat (25)

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

Commentshotnewtop
21natzil (707)

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 (1)

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