Skip to content

Database API

The configdb-server package

The configdb-server package acts as a layer of abstraction for different database backends. Currently only SQLAlchemy with support for different databases like sqlite-files, mysql, mariadb or postgresql is implemented. The functionality of this package is provided as member functions of the Database class found in the database_tools module.

High level database access

The package provides higher-level database functions via the database_tools module. It includes a staging area which is supposed to be used to edit a runkey before it is commited to the actual datbase. The package include functions to import and export entire trees to the staging area, create and edit trees in the staging area, clone trees from the actual database into the staging area and commit from the staging area to the backend database. These functions are documented using python docstrings. Examples on how to use these functions can be found in the example.py script or here.

Low level database access

For debugging, benchmarking and testing purposes more direct access to the database tables is beneficial. The package provides CRUD functions for all the tables via the adapter classes for the different backends. These are the functions used by the database_tools module. In addition to this function to manage the database are includes here as well.