Next: , Previous: Preliminaries, Up: Tutorial


2.3 Getting Started

In order to use Elephant, you have to have an open store controller. To obtain an open store controller you call open-store

The chapter “SQL back-end” has information about setting up a SQL based backend; this tutorial will assume that you are using Berkeley-DB as a backend.

Make a directory to put your database store in. (This is called the environment in Sleepycat terminology.) That's all you need to set up your store! We'll assume in this tutorial you created a folder testdb in the current directory.

It is strongly recommended that you run the automated tests See Running the Tests that come with Elephant before you begin this tutorial; this takes less than five minutes and if will give you both confidence and clarity and your continued work. Since the default distribution comes with a directory structure set up, this is actually the easiest way to get started with Elephant before beginning this tutorial. If the tests fail for you, the Elephant developers will help you solve the problem, but will want to know the outcome of the tests as a starting point.

If you have run the tests successfully, you can just do:

     (open-store *default-spec*)

But if not you might have to set up your own controller specifier like this:

     (asdf:operate 'asdf:load-op :elephant)
     (use-package "ELE")
     (setf *testbdb-spec*
     '(:BDB "/home/read/projects/sql-back-end/elephant/tests/testdb/"))
     (open-store *testbdb-spec*)

When you're done with your session, don't forget to

     * (close-store)
     => NIL

Also there is a convenience macro with-open-store.