Flat File Database - 2

FFDB2 is a relatively simple C++ library for handling relational algebra, rowsets, and flat text file databases, implemented using STL.

Overview

FFDB2 supports 5 data types (integer, floating point, string, raw and boolean) and the following relational operations:

FFDB2 runs entirely in memory so no disk operations are made when working with the rowsets.

Quick example

The following example assumes that you have two relations ("rowsets"), 1 for users and 1 for their assigned quotas. The goal of this sample is to find the user "johnny"'s quotas.

RowSet rowset_users;
RowSet rowset_quotas;
...
PreparedSelection prep_user_sel;
int cond_idx = prep_user_sel.add_condition("username", cond_eq);
prep_user_sel.set_value(cond_idx, "johnny");
RowSet this_user;
prep_user_sel.execute(&this_user);
...
RowSet this_user_quota;
Join(this_user, rowset_quotas, &this_user_quota, "id", cond_eq, "userid", 0);
...

Extensible table layout

The tables can have more fields than the application is aware of so no change is needed when making gradual extensions of the table layout.

Download

ffdb-2.2.tar.gz (31KB)

Old version: ffdb-2.1.tar.gz (31KB)

Old version: ffdb-2.0.tar.gz (31KB)

Building

Typing make will work in the most cases.

You can can change compiler and compile options be editing the makefiles, or by specifying them on the command-line such as: make CXX=g++ CXXFLAGS=-O2

You should also build the unittest target to make sure that the library mostly work.

Supported systems

FFDB2 is known to have passed the unittests some time in the past:

Future work