in reply to problem with DB_FILE
Hm, tried your code with some existing files I had..
Got segmentation faults on some of them.
Then I recreated the .db file, and ba da bing ba da boom.
Did you try with a new history.db, or a different .db file, just out of curiosity?