Changes

Jump to: navigation, search

GEPS 032: Database Backend API

461 bytes added, 04:23, 16 May 2015
no edit summary
* are too BSDDB specific (some tools?)
* could be abstracted away from details
 
**Step one is completed.**
===Step 2===
# selecting which backend to use for new databases [DONE]
# selecting the database to load (Family Tree Manager) [Prototype Working; needs to come from pluginsDONE]
We will use the directory structure, as we do now. In each directory, the type of database needs to be identified. This could be done in two ways:
# well-defined database backend types. These could be registered, like any plugin/addon.[DONE]
# is there really any reason for Gramps to have to have the code for the db backend? All that is necessary is for the backend to create the Database instance.
Other things that might need to be changed:
Listing the databases (-l and -L). That might include changing the current listing:[DONE]
<pre>
There still could be uses for the transactions, However. For example, we can use an abstraction for the History undo/redo. Although the current system only exists in the current session, and is limited. We can probably create a better method with more features (such as diff between versions, lifetime changes, etc).
 
Transactions in the Python code are ignored.
==Complications==
==Progress==
The first step is to separate all of the gramps.gen.db code into reusable and extendable components. [DONE]
This has begun with the [http://sourceforge.net/p/gramps/source/ci/master/tree/gramps/gen/db/dictionary.py DictionaryDB] {{bug|4972}}, which is a in-memory replacement for the BSDDB. Still needs the indexes, and metadata support (gender names, bookmarks, etc). Also, the Dictionary transaction is non-existent.
Currently, the best working replacement backend is "dictionarydb".[MOSTLY COMPLETE]
We can develop backends that work directly on Exported formats. Others to consider: GEDCOM and CSV. These would probably use a DbDictionary, and simply import/export on load/close (would lose data if power outage; would be fast as in-memory, slow on start/stop).
 
== Unresolved Issues ==
 
(as of May 16, 2015)
 
1. Currently if the first thing you do is import into a Djangodb, it complains that settings are not set. If you first do something with the database, then all is fine. Could be related to the sys.modules reset.
 
2. dictionarydb and djangodb are not yet finished. Mostly metadata needs to be dealt with.
 
3. sqlitedb hasn't been started yet.
==Other Backends==

Navigation menu