Database Backends
This page documents the new backend infrastructure introduced in Gramps 5.0.
Contents
Overview
When Gramps was originally written, it was decided that it would use the Berkeley database (also known as BSDDB) and its Python bindings. At the time (early 2000s) there were not that many choices for hierarchical structures, which Gramps uses.
The BSDDB system is very sophisticated; however, it requires that all of the details be manually handled. Although this is quite powerful, it does take a high level of skill.
A serious problem with the BSDDB system is that the internal system can change with a system upgrade. That means that you may not be able to open your database after a system upgrade.
Another problem with the BSDDB system is that it is very easy to end up with corrupted databases.
Backends
Currently, there are 4 different database backends with which you can use. These are described below.
BSDDB Backend
DB-API 2.0 Backend
This API was defined in PEP-0249, https://www.python.org/dev/peps/pep-0249/ . It defines a simple interface to run SQL commands, and return their results. Some common database engines implement this API, including:
- Sqlite3
- MySQL
- Postgresql
Other implementations: https://wiki.python.org/moin/DbApiModuleComparison