edrews / BrewShopApp

Android app for homebrew recipe and inventory management
Other
18 stars 14 forks source link

Use a database to store ingredients rather than CSV/JSON #32

Open DougEdey opened 9 years ago

DougEdey commented 9 years ago

This allows easy backup to of inventory as well.

I have a SQLite DB that has all the ingredients (Hops, malts, yeasts, adjuncts), and styles from all the BJCP standards that can be re-used.

https://github.com/DougEdey/Strangebrew_Android/tree/master/sb/src/main/assets/data

edrews commented 9 years ago

Hey, thanks. Good idea too about storing them in a sqlite db in the assets folder. Plus it will probably be more efficient to load than parsing JSON or CSV.

edrews commented 9 years ago

Oh, I found the open source BrewTarget project has a sqlite db too that they use for ingredient store. https://gitorious.org/brewtarget/brewtarget/source/487557bad68bd6bd1e636fb1f621640ea87ee916:data

It looks very comprehensive. What do you think about joining up with them to share DB records?

DougEdey commented 9 years ago

I've not had a chance to look yet, but does it have BJCP 2014 guidelines?

edrews commented 9 years ago

Have the 2014 guidelines been released yet?

DougEdey commented 9 years ago

Not finalised but they'll be here within the month according to BJCP.

DougEdey commented 9 years ago

Starting to work on this now, do you know if BrewTarget allow us to use their DB?

edrews commented 9 years ago

I haven't asked. Can you try to get in touch with one of their dev's? The database file is GPL-3 but I think it's worth asking anyway.

DougEdey commented 9 years ago

I reached out via twitter. I'll start on it as it is though. Hopefully have something this weekend.

DougEdey commented 9 years ago

Got some initial code on https://github.com/DougEdey/BrewShopApp/tree/DB_Data

I'll not do a pull until much later when I've got all the ingredients reading, writing, and inventory implemented.

There's some great stuff in their DB (like substitutions), so I'm massively expanding the ingredient classes as I find stuff.

DougEdey commented 9 years ago

Just completed the malts, hops, yeasts, and styles conversion to SQL.

Some notes so far: There's a LOT more stuff in here now, many more ingredients, substitutions, styles, etc... But the styles don't have the mouthfeel, ingredients, etc... breakdown, so I've converted that to be just the description.

For testing I have just confirmed that the ingredients are there. And I can select some, including the yeast/styles.

You may want to do a manual checkout of my branch and run any tests on it, then I can do a pull request when you're happy.

This is just reading the main ingredients right now. I've not quite worked out how to add data to the database for the inventory.

DougEdey commented 9 years ago

No longer working on this, good luck.