DB abstractions (was: BerkeleyDB)
gyepi at praxis-sw.com
Thu Sep 19 10:18:05 EDT 2002
On Wed, Sep 18, 2002 at 10:46:06PM -0700, Adrian Otto wrote:
> We should use a consistent approach to do the following sorts of operations:
> - open_database() for creating/returning the database object pointer
> - get_word_value() for getting the value of a word (already exists)
> - set_word_value() for setting the value of a word (already exists)
> - increment_word_value() first get_word_value(), increment, then
> - decrement_word_value() first get_word_value(), decrement, then
> - close_database() for committing/closing the database object.
I agree with all this, and actually prefer passing some opaque database handle around
to passing a wordlist_t handle. I think we should also abstract the get_count() function into
the database since the existence of a .count file is really a function of the database implementation.
Also, I think all database functions should have a common prefix for clarity.
Barring any strenuous objections, I'll use 'datastore_'.
Big banners are OK. I'll add them to the header file.
I'll take on the task.
More information about the Bogofilter-dev