Ask coding questions

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

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?

Voters
Stae24
Comments
hotnewtop
Chas2002

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

Vandesm14

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

Stae24

@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.

Coefficient

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