Changes

Jump to: navigation, search

Addon:QueryGramplet

106 bytes removed, 03:51, 29 December 2013
Notes
4) The SELECT fields use the bracketed notation for list references. Use "event_ref_list[0]".
5) JOINS are not necessary, because it automatically looks up all relations through the handles. In a SELECT, columns with multiple values in a list will appear as an outer-join with other values in the row.
6) UPDATE will work on any field, through a joined object or on the primary object. For example, you can update the birth date of an
10) .handle or .ref automatically look up their references.
11) Shortcut: you can use col[N] in the WHERE clause to reference a column selected. N is zero-based.
SELECT gramps_id, private FROM person WHERE not col[1];
SELECT gramps_id, primary_name.surname_list[1] FROM person WHERE col[1];
13) In a SELECT (for speed reasons), you You do not need to reference a field before you can use it. That is not necessary in the UPDATE or DELETE statements. (The idea here is that SELECTS are done quite frequently, but UPDATES are done rarely, and it doesn't matter if those take a little longer). Maybe we can relax this constraintWHERE clause.
14) The semicolon is optional.
15) Be careful selecting all fields from all records... that could take up a lot of memory, and bring down grampsGramps.
16) This should be fairly fast, but it does call eval(). This might make things a little slower, but made the code much easier to write. And it does use the full power of python.
17) You can use parens parentheses in an "UPDATE table SET field=value" value. Something like:
UPDATE table SET field=(field + 1);

Navigation menu