Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage options: selecting where to save app #914

Open
saona-raimundo opened this issue Nov 26, 2021 · 3 comments
Open

Storage options: selecting where to save app #914

saona-raimundo opened this issue Nov 26, 2021 · 3 comments

Comments

@saona-raimundo
Copy link

The current way to have a persistent app is to implement epi::App and use the feature persistence.
In particular, one must implement the method save.

save uses a default location given by:

But there is no way (as far as I can see) to change the default location.

Describe the solution you'd like

I would like to be able to choose where the data is stored.

Describe alternatives you've considered

I propose to exhibit the call to create a dyn epi::Storage, so people could change it.

We could add a method to the epi::App trait

fn storage(&self) -> dyn Storage { ... }

A default implementation is given by the current behaviour.

Additional context

A very simple use case is that I would like to store the app data in a Google drive folder, so I get "persistence" across devices too.

@kkharji
Copy link
Contributor

kkharji commented Apr 11, 2022

Interesting use case with google drive. How about persistence over backend server 🤔

@emilk
Copy link
Owner

emilk commented Apr 11, 2022

Perhaps the path could be an option in NativeSettings ?

@wmte
Copy link

wmte commented Jun 19, 2023

Perhaps the path could be an option in NativeSettings ?

I worry this does not address user-selectable paths (ie, a typical File->Save action) which I am trying to unify with the current persistence mechanism.

By exposing FileStorage I was able to save to a chosen path on user interaction. In my application I use the default storage behavior as a kind of 'session-resume', but would like to also have manual save and load as I expect users to generate multiple application states.

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

No branches or pull requests

4 participants