Changes

Jump to: navigation, search

GEPS 010: Relational Backend

1,133 bytes removed, 17:17, 26 March 2009
finishing removal of exporter adding new pages
This page is for the discussion of a proposed implementation of a SQL backend for GRAMPS.
A proposed implementation SQL stands for "Structured Query Language" and is pronounced "sequel" (it is being developed in [httpa joke://gramps.svn.sourceforge.net/viewvc/gramps/trunk/src/plugins/export/ExportSql.py?view=markup trunk/src/plugins/export/ExportSql.py] You can export most of GRAMPS through an SQL Export using the Export Assistant. (Currentlyas it came after QUEL, the selection options are ignored, and it will output everythingis its sequel).
SQL stands = Reasons for "Structured Query Language" and is pronounced "sequel" (it is a joke: as it came after QUEL, it is its sequel). After you export your GRAMPS data into a file such as ''Untitled_1.sql'' using making the above Exporter, then you can use SQL queries like:switch == Research =[[Relational database comparison]][[Database abstraction layers comparison]]
<pre>
$ sqlite3 Untitled_1.sql
SQLite version 3.5.9
Enter ".help" for instructions
 
sqlite> .tables
dates family names people repository
events media notes places sources
 
sqlite> .headers on
.headers on
 
sqlite> select * from people;
handle|gramps_id|gender|death_ref_index|birth_ref_index|change|marker0|marker1|private
b247d7186567ff472ef|I0000|1|-1|-1|1225135132|-1||0
 
sqlite> select * from names where surname like "%Smith%";
private|first_name|surname|suffix|title|name_type0|name_type1|prefix|patronymic|group_as|sort_as|display_as|call
0|Test|Smith|||2|||||0|0|
 
sqlite> .exit
$
</pre>
 
The current database in GRAMPS would require that you write some code to do this, and you'd need to know some details about the data.
= SQL Backend =
For sql, one would use the prepare method, obtain all people in a list, then return True or False if person is in this list. As db is passed, db can have a support_sql attribute, and code can be written depending on this setting. This does not look very ideal though.
=== See Also ===
[[ExportSql.py]]
[[Category:GEPS|S]]
76
edits

Navigation menu