no edit summary
Starting with Gramps 5.0, there is a new method on the database object called "select." The goal of select is to make it possible to select most any data, based on most any criteria, sorted in most any order. In addition, where possible,
it would be fast.
The database select method works as follows:
== Result ==
The database.select() method will always return a Result. A result is a collection of all of the data (ie, it is not a generator).
Results are a subclass of the Python list object, with additional properties:
* total - total number of records (in the case of start or limit is given)* time - the time in seconds it too to collect the data* expanded - whether the data needed to be expanded (unpickled and primary objects created). BSDDB selects alway are expanded* query - the actual SQL query, if one
Each element in the Result list is a dictionary of dotted-field path strings and their data (if any). If a value is None, it either means that the value is None, or that there is no such field for this primary object.
== Implementation ==
could make special fields for these, and special indexes. Gramps 5.0 creates "secondary" fields and indexes in SQL for every str, int, or bool data on a primary object. These secondary fields are known from the primary object's schema.
The schema idea has been augmented with additional methods based on the idea of "fields". Now, you can ask a person object: