5,421
edits
Changes
m
* '''DbGeneric''' - general read and write implementations
** '''DbWriteBase''' - virtual and implementation-independent methods for reading data ([http://sourceforge.net/p/gramps/source/ci/master/tree/gramps/gen/db/base.py gen/db/base.py])
** '''DbReadBase''' - virtual and implementation-independent methods for reading data ([http://sourceforge.net/p/gramps/source/ci/master/tree/gramps/gen/db//base.py gen/db/base.py])
=== DbBsddb ===
The DbBsddb interface defines a hierarchical database (non-relational) written in [http://www.jcea.es/programacion/pybsddb.htm PyBSDDB]. There is no such thing as a database schema, and the meaning of the data is defined in the Python classes above. The data is stored as pickled tuples and unserialized into the [[Using_database_API#Primary_Objects|primary data types (below)]].
→Database API: re-order the BSDDB and generic DB sections to reflect the SQLite new status as current default for v5.1 of Gramps.
At the root of any database interface is either DbReadBase and/or DbWriteBase. These define the methods to read and write to a database, respectively.
The SQLite database engine became an optional add-on plugin for Gramps 5.0 and then replaced BSDDB as the default database backend in the 5.1 version. The BSDDB engine is expected to be retired from the standard install for 5.2 release of Gramps.
The full database hierarchy is:
* '''DbGeneric''' - general read and write implementations** '''DbWriteBase''' - virtual and implementation-independent methods for reading data ([http://sourceforge.net/p/gramps/source/ci/master/tree/gramps/gen/db/base.py gen/db/base.py])** '''DbReadBase''' - virtual and implementation-independent methods for reading data ([http://sourceforge.net/p/gramps/source/ci/master/tree/gramps/gen/db//base.py gen/db/base.py]) * '''DbBsddb''' - read and write implementation to BSDDB databases ([http://sourceforge.net/p/gramps/source/ci/master/tree/gramps/gen/db/write.py gen/db/write.py])(The SQLite database became optional replaced BSDDB as the default database engine in the 5.1 version
** '''DbWriteBase''' - virtual and implementation-independent methods for reading data ([http://sourceforge.net/p/gramps/source/ci/master/tree/gramps/gen/db//base.py gen/db/base.py])
** '''DbBsddbRead''' - read-only (accessors, getters) implementation to BSDDB databases ([http://sourceforge.net/p/gramps/source/ci/master/tree/gramps/gen/db/read.py gen/db/read.py])
** '''UpdateCallback''' - callback functionality ([http://sourceforge.net/p/gramps/source/ci/master/tree/gramps/gen/updatecallback.py gen/updatecallback.py])
** '''DbTxn''' - class for managing Gramps transactions and the undo database ([http://sourceforge.net/p/gramps/source/ci/master/tree/gramps/gen/db/txn.py gen/db/txn.py])
=== DB-API ===
To be compatible with BSDDB, DB-API stores Gramps data in an identical manner (pickled tuples). However, to allow for fast access, DB-API also stores "flat" data (such as strings and integers) in secondary SQL fields. These are indexed so that data can be selected without having to traverse, unpickle, initialize objects, and compare properties.
=== DbBsddb ===
The DbBsddb interface defines a hierarchical database (non-relational) written in [http://www.jcea.es/programacion/pybsddb.htm PyBSDDB]. There is no such thing as a database schema, and the meaning of the data is defined in the Python classes above. The data is stored as pickled tuples and unserialized into the [[Using_database_API#Primary_Objects|primary data types (below)]].
=== Using the Database ===