Database

Where is my Data?

Peers, keys, policies, mailinglists and releases are stored in an SQLite database. By default it is located in $HOME/.batzenca/batzenca.db. This default can be changed by setting the environment variable BATZENCADIR. If BATZENCA is set, then the database will be located at $BATZENCADIR/batzenca.db.

Design

  • New objects of type Foo are created from scratch using Foo.__init__. For querying the database class methods like Foo.from_bar are provided which query the database for bar and return – if found – the object of type Foo matching bar. Some classes have additional class methods for creating fresh objects from scratch. For example, batzenca.database.keys.Key has methods to create new objects from PGP keys stored in a file on disk.

  • Newly created objects are were not added to the current session automatically. The caller is responsible for calling:

    >>> session.add(obj)
    
  • To save changes to the database the caller must call:

    >>> session.commit()
    

EntryNotFound

Key

Peer

Policy

MailingList

Release