Updating Sqlite Database Without Lag

Hey, 

I’m making a business app that uses a tableview. The data for each for is stored in a sqlite database.

The issue that I’m having is when I update the database (say, increase or decrease a certain field) the entire app freezes until the database is done updating. 

I know LUA doesn’t have mutlithreading, so what’s the best way to manipulate a database without having the whole app freeze up? Would coroutines work?

Thanks! :slight_smile:

I’m experiencing this myself. I’m hoping someone will reply with a magic bullet but I’m not very optimistic.

You can try to work around it, for example:

Only do writes when tableview is not moving (would require some tableview hack I suppose).

Only do writes on app suspend event (not sure how reliable that would be).

I’m experiencing this myself. I’m hoping someone will reply with a magic bullet but I’m not very optimistic.

You can try to work around it, for example:

Only do writes when tableview is not moving (would require some tableview hack I suppose).

Only do writes on app suspend event (not sure how reliable that would be).