justdvnsh/AnimeClassroom

Make a new database table for the offline cache

Closed this issue · 5 comments

As offline cache has been added to the app, it has disrupted the flow of favorites tab. Since both data is being saved in one single table, so it has messed up the database. We want to save the offline cache into a separate database. The solution to this would be pretty simple. We don't need new entities for cache. We can simply create a new database for cache specifically.

@krishnachaitanya0107 Want to take this up ?

Sure @justdvnsh , It would be great if you can guide me a bit on this issue .

@krishnachaitanya0107 Sure. Well, you don't have to do anything. You just have to create a new file like AnimeDatabase which would also be a room database, but would provide different Dao. that dao would be looking up for animes, deleting animes and everything from the cache anime database you just created. Finally in the database module, provide your database to be injected into the dao. And then provide that dao to the repo, which would be working normally. Does that make sense ?

All right @justdvnsh , I will start working on the issue . If I feel stuck anywhere I will let you know . Please assign it to me .

@krishnachaitanya0107 Sure. Happy coding