
Some information about the Akonadi server storage backend
=========================================================

The storage backend stores the PIM data and some resource data into a
relational database. The used schema is shown with the help of Umbrello
in the akonadi-storage.xmi file in an ERM diagramm.

To create the schema in a new database using SqLite 3 and to fill some
initial data into the schema, you can run the following commands:

    cat create-database-schema.sql | sqlite3 akonadi.db
    cat create-default-values.sql | sqlite3 akonadi.db

To walk through the schema and it's content from a plain command line,
you can do something like this:

    # sqlite3 akonadi.db
    sqlite> .mode columns
    sqlite> .header ON
    sqlite> select * from mimetypes;
    id          mime_type
    ----------  --------------
    1           message/rfc822
    2           text/ical
    3           text/vcard
    sqlite> .quit
    #

The ".mode" and ".header" commands change the output to be more what users
of sqlplus are used to. You can input ".help" to get a list for the built
in non-SQL commands.

IMPORTANT: If you run the Akonadi server with DB access, please make sure
that you start it from the directory where your prepared db file is located.
A configuration switch is still missing to point the server to any file.
To use the db access in the server, do something like this:
    ...
    DataStore::instance()->listMimeTypes());
    ...

C++ Files Overview:
-------------------

entity.{h,cpp} 
The files contain classes which reflect records in the tables of the database.

datastorage.{h,cpp} 
The files contain a class which provides the access to the underlaying database tables.

debug.{h,cpp} 
The files contain convinience methods to dump the content of the entity classes
or of lists of them via qDebug() calls to stderr. This makes it easy to watch the
content during the development.


NOTE
====

This is work in progress. I'm in the process of defining the interfaces of
the entity classes and I will step by step add code which does the real
database access.
I also plan to add unit tests to make sure the the database access works
as intended.

If you have questions or want to help, please contact me via my
<a.gungl@gmx.de> account.

