Jump to: navigation, search

Database Query API

36 bytes removed, 23:22, 25 January 2016
[This is a work in progress.]
== Overview ==
[ link title] Starting with Gramps 5.0, there are two database backends, Berkeley DB (BSDDB), and [ Python's DB-API]. BSDDB is a data store with much of the database code written in Python. We have used BSDDB in Gramps for many years. DB-API is a common interface to the popular SQL engines.
Previously, Gramps was a very modular design when it comes to accessing the data. For example, consider getting the People for the flat view. First we get a cursor that iterates over the data. Then we sort it, on whatever criteria we have requested. To sort the data, not only do we need to iterate over all of the data, but we need to unpickle and turn the raw data into Person objects. Of course, it would be much faster if we can store the order in an index, so that we can just get the data that we need. This is even more important when we only want to see a filtered segment of the database, say those people who have a surname of "Smith."

Navigation menu