Some effort has been made to make sure that Yabu is crash safe. This means that the database should survive process kills, core dumps and such -- although this is not something that can be absolutely guaranteed. Also, all non-commited and pending transactions will be cancelled in case of a crash.
Yabu uses three types of objects, listed below:
A simple example is illustrated below.
// Create a database called "my.database" in write/create mode.
object db = Yabu.db("my.database", "wc");
// Create a table called "fruit".
object table = db["fruit"];
// Store a record called "orange" with the value "yummy".
table["orange"] = "yummy";
// Store a record called "apple" with the value 42.
table["apple"] = 42;
Transactions are slightly more complex, but not much so. See example below.
// Create a database called "my.database"
// in write/create/transaction mode.
object db = Yabu.db("my.database", "wct");
// Create a table called "fruit".
object table = db["fruit"];
// Create a transaction object for table "fruit".
object transaction = table->transaction();
// Store a record called "orange" with
// the value "yummy". Note that this record
// is only visible through the transaction object.
transaction["orange"] = "yummy";
// Store a record called "apple" with the value 42.
// As with "orange", this record is invisible
// for all objects except this transaction object.
transaction["apple"] = 42;
// Commit the records "orange" and "apple".
// These records are now a part of the database.
transaction->commit();