public
Description: A Helma NG datastore implementation based on Oracle (formerly Sleepycat) Berkeley DB.
Homepage:
Clone URL: git://github.com/hns/berkeleystore.git
Andreas Bolka (author)
Wed Sep 23 08:43:00 -0700 2009
hns (committer)
Wed Sep 30 00:49:40 -0700 2009
name age message
file README Loading commit data...
directory lib/
README
This is a backend for the Helma NG Storable interface based on the Oracle
(formerly Sleepycat) Berkeley DB.

    http://www.oracle.com/database/berkeley-db/db/index.html

Requirements
============

It is written against version 4.6 of Berkeley DB which is the default version
installed in current Debian and Ubuntu releases. Berkeleystore uses the native
version of Berkeley DB, but it probably could be rewritten relatively easily
for use with the pure Java Berkeley DB JE as both share most of their API.

Features
========

Like the filestore backend, berkeleystore uses JSON as persistent object format.
Berkeleystore currently has limited query support. All object properties except
for long texts and nested objects but including references and arrays are
automatically indexed so most queries should be pretty efficient.

Functionality
=============

Initializing the store:

    include('helma/storage/berkeleystore');
    store = new Store(dbpath);

Creating a new Storable class:

    Book = store.defineClass('book');

Creating and saving a new Storable instance:

    var b = new Book({title: "DBs for dummies"});
    b.save();

Retrieving all objects from a db:

    var books = Book.all();

Retrieving an object by id:

    var book = Book.get(id);

Deleting an object from the db:

    book.remove();

Running a query on the database:

    Book.query().equals('prop', value).select();

The Query.select() method takes an optional argument to retrieve
just a property rather than the whole object, e.g. '_id' or 'title'.