Ask coding questions

← Back to all posts
Help with sql database getting corrupted when I refresh page (PYTHON 3)

So basically, I will create a SQL database using the package called "Flask-SQLAlchemy". This database works completely fine until I refresh my page. When I refresh my page, and try running the program again, I get an error saying "sqlalchemy.exc.DatabaseError: (sqlite3.DatabaseError) database disk image is malformed". Is there any reason this is happening, and maybe a possible fix?


Something happened the last 4 days or so, sqlite when accessed malforms. I have no idea why.


SQLite doesn't really work well with replit at the moment


@Vandesm14 yea, I found that out the hard way, after spending 2 days making a program just to have the database not even work. Plus if I were to switch to another database, it would be much harder than usual, since the package I was using had special functions to use with flask.


@Stae24 Did you have any luck with it? I just started creating a Flask project with SQLAlchemy and have been experiencing the same issues