Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Spike: replace file system with Room/sql #215

Closed
digitalbuddha opened this issue May 18, 2017 · 16 comments · Fixed by #338
Closed

Spike: replace file system with Room/sql #215

digitalbuddha opened this issue May 18, 2017 · 16 comments · Fixed by #338

Comments

@digitalbuddha
Copy link
Contributor

Now that android has a proper orm, we should Spike on depreciating our filesystem and moving to Room (new orm). It seems like you can save nested objects without having to write complex logic yourself, that was always the blocker imo to using sql.

Ideally store should be able to work with retrofit returning a pojo which is the written to and read from Room.

Alternatively we can create Room persisters that work with sql while keeping current File System stuff the same.

Yay exciting times in android!

@pavlospt
Copy link
Contributor

We have the same ideas! I was thinking though of creating a persister module with Room for starters :P

@png6
Copy link

png6 commented May 30, 2017

@pavlospt Let me know how your efforts with a persister module goes with Room. I recently tested an implementation of the persister with Room and it works however it seems difficult to come up with a generic solution. Unlike the FileSystem persister, you're dealing with the POJO entities directly and would need to provide the proper DAO. Further, depending how you ingest the data from an external source (e.g. webservice) you'll lose the ordering of objects when stored in to a DB unless you do extra work to preserve some kind of order.

@pavlospt
Copy link
Contributor

@png6 Haven't had the time to start writing one yet. You can PR your solution and we can discuss upon it :)

@digitalbuddha
Copy link
Contributor Author

One suggestion is to have dao implement persister and then pass the dao as the persister to store.

@digitalbuddha
Copy link
Contributor Author

closing due to not really being an issue.

@sevar83
Copy link

sevar83 commented Oct 9, 2017

Hey guys, any plans about Room?

@santoshag
Copy link

@digitalbuddha any plans to support Room now that stable 1.0 is released?

@digitalbuddha
Copy link
Contributor Author

It's supported you need to make a Persister pointed to your roomDAO. I was working on a sample but got lazy. Will revive it

@santoshag
Copy link

From the discussion above about DAO implementing Persister and passing that at store creation, I thought that the library has to provide additional support for dao. Please post a sample whenever you get a chance, it would be very helpful. Thanks!

@sahibjaspal
Copy link
Contributor

Hey @digitalbuddha , did you get a chance to revive the sample?

@digitalbuddha
Copy link
Contributor Author

digitalbuddha commented Mar 14, 2018 via email

@sevar83
Copy link

sevar83 commented Mar 14, 2018

Thanks @digitalbuddha! I would appreciate very much a sample how to persist a POST request (usually in offline scenario).

@tiwiz
Copy link
Contributor

tiwiz commented Mar 14, 2018

@sevar83 would you use Retrofit for that request?

@sevar83
Copy link

sevar83 commented Mar 14, 2018

@TwiZ Yes.

@tiwiz
Copy link
Contributor

tiwiz commented Mar 14, 2018 via email

@GianfrancoMS
Copy link

GianfrancoMS commented Apr 29, 2018

Hey @digitalbuddha , any news on supporting Room?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants