Author Topic: Database hacking  (Read 8698 times)

Offline altgeeky1

  • BeerSmith Apprentice Brewer
  • **
  • Posts: 18
Database hacking
« on: October 20, 2009, 05:46:07 PM »
Hi,

I'm poking around the .bsm databases using a hex viewer.

My goal is to make my BeerSmith data available automatically so it can be used in my own scripts, RSS feed, etc.
I do not want to have to manually export things as reports or XML, over and over.

I can read database descriptions from a script. Your records are simply padded at offsets from each other, ex: grains.bsm.
What I CAN'T do is find the "quantity" for an item type... it's either not next to the item/description, or the values are not in numeric form or as pointers somewhere else....

Any chance I could get a C snippet which describes your format?
I wouldn't require any follow-up support, and this would save me a lot of time.
Opening the data up would be freedom for all, we could write viewers for iPhone, Android, web etc. and you might have fewer requests for that sort of thing.. although at the moment, I have to be clear and say I'm just looking to auto-generate RSS.

I'll take this offline if that's what you prefer.

thanks!

Offline BeerSmith

  • Brewer, Author, Patriot
  • BeerSmith Administrator
  • BeerSmith Grandmaster Brewer
  • *****
  • Posts: 5569
  • BeerSmith - take the guesswork out of brewing!
    • BeerSmith
Re: Database hacking
« Reply #1 on: October 20, 2009, 11:00:51 PM »
Hi,
  Yes, send me an email and I may be able to provide what you need.  Note however, that we plan to go to a purely XML format in the future which should resolve the shortcomings of the existing binary format.

Brad
Get a free trial of BeerSmith 3 here

Offline altgeeky1

  • BeerSmith Apprentice Brewer
  • **
  • Posts: 18
Re: Database hacking
« Reply #2 on: February 16, 2011, 02:14:20 PM »
Hi Brad,

I originally stated this as being able to read/decrypt the BeerSmith database, but a simpler explanation is:

1) From outside of BeerSmith (command line, etc) I want to do a database dump
2) With these results, I would post process in my own scripts (email reminders for ingredients, etc).

So if there were a command line tool which dumped BS database, that would be perfect! 
Do you have any standalone reader for the database?


I know that the next version will have XML database as the native format. Any idea when that is coming?

Offline BeerSmith

  • Brewer, Author, Patriot
  • BeerSmith Administrator
  • BeerSmith Grandmaster Brewer
  • *****
  • Posts: 5569
  • BeerSmith - take the guesswork out of brewing!
    • BeerSmith
Re: Database hacking
« Reply #3 on: February 17, 2011, 03:26:01 PM »
Hi,
  Unfortunately there is no underlying database in the current version - it actually has a bunch of binary structures (classes actually) that store the data and are essentially dumped in the output file.  I had to write a bunch of code to import this into the new version I'm working on (a few weeks worth of coding), but it would take a long time to describe it all for someone else to do it.  Frankly I don't think its worth it to deconstruct the binary version at this point.

  Could you not just export the BeerSmith files to BeerXML format and work with them from there?

  I'm actually in the cleanup phase on the new version now to get a test release out - hoping to get it into testing within a few weeks.  Once I have an idea of how the testing goes, I'll establish a release date for the final version - likely within a few months.

Brad
Get a free trial of BeerSmith 3 here