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

Local database support #43

Closed
drodil opened this issue Oct 6, 2020 · 3 comments · Fixed by #75
Closed

Local database support #43

drodil opened this issue Oct 6, 2020 · 3 comments · Fixed by #75
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@drodil
Copy link
Owner

drodil commented Oct 6, 2020

As it is very painful to keep the beer, hops and yeast data in Rust structs, find out if there is optional solution to store this data inside the executable/lib. For example file based database that could travel inside the package. See #23 #39 #41 #42 for use cases of this.

@drodil drodil added enhancement New feature or request help wanted Extra attention is needed labels Oct 6, 2020
@tommilligan
Copy link
Contributor

Personally, I would just add data files in JSON/YAML format and load them when required with serde.

Pros:

  • easily editable/contributable
  • tiny amount of code required to load
  • fits the existing data structures (a big vec of data)

Cons:

  • will take slightly longer to load all data data from disk than if we were querying data as needed from a proper database if we include it as a string inline at compile time, it will just be the time to parse the string into a struct which is negligible.

If you think that's an okay solution, I'll start working on it.

@mlatief
Copy link
Collaborator

mlatief commented Oct 8, 2020

that sounds good actually, please go ahead.

@drodil
Copy link
Owner Author

drodil commented Oct 8, 2020

Sounds like a good idea! Just wondering about the packaging of the json for the rustybeer library; is it possible to do somehow so that the users of the library have the same data available? Don't have that much of experience about that so please enlighten me! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants