Wednesday, 4 August 2021

Seperately log Room sqlite database operations in text file

I would like to log all database insert, delete, update operations in a text file stored in external storage.

Scenario:

I use room local database and api, when user is offline I would like to keep record of operations in a text file ideally "affected rows only".

The idea is to have a backup of transactions incase synchronization fails or api is unresponsive (or if table records are cleared), so that user still has access to all transaction he performed in text file which he can refer to. And text_file will be stored in external storage. Or is there any other approach programmer use to keep record of transactions other than sqlite.



from Seperately log Room sqlite database operations in text file

No comments:

Post a Comment