interacting with database

Matthias Andree matthias.andree at gmx.de
Sat Feb 24 10:19:15 CET 2007


On Tue, 20 Feb 2007, Peter Likarish wrote:

> Hello all,
> 
> Question: What is the format of the value BLOB in wordlist.db and is 
> there a way to translate that into integer good/bad counts (w/out using 
> bogoutils)?

Check src/datastore.h, the dsv_t is what you're looking for. The actual
format is independent of the database engine you're using.

> Background:
> I've trained bogofilter and now I'm interested in interacting directly 
> with the database (I'm using sqlite).  To be clear, I want to integrate 
> the trained database directly into a browser and use a storage 
> interface, bypassing bogofilter commands if possible (one reason for 
> this is that the extension I am working on will work on Windows--as far 
> as I can tell no one's made bogofilter do that as of yet).

Compiling bogofilter for Cygwin shouldn't be a major effort, but I'm not
convinced if it works since the test suite hangs or makes extremely
little progress (I never waited for it to finish) when it comes to the
locking tests. I haven't looked at mingw.

> I've managed to open a connection to the database and can run simple 
> queries fetching key values from the db.  However, I cannot figure out 
> what format the value BLOB is in and I get an error attempting to read it.
> 
> Could someone clue me in?  I'd appreciate it,
> 

-- 
Matthias Andree



More information about the Bogofilter mailing list