You change data through various “editors” which can invoke “sub-editors”. For example, you patch a person data in the person editor (file gui/editors/editperson.py) but modifying the name or adding a new one is done in the name editor (file gui/editors/editname.py).
When you hit OK, a global test is made to see if data has really changed before committing to the DB. If nothing has changed, you don’t write back into the DB. This global test is method data_has_changed() of class EditPrimary. It compares serialised current object with serialised original object (which may be an “empty” object in case of creation).
This test is fine with BSDDB backend (or its emulation with SQL). But it is too coarse for a smarter SQL schema where a Gramps genealogical object is spread over several TABLEs. For example, names are stored in a different TABLE than persons because a person may be known under several names.
In such an approach, not all “components” of a primary objects have changed (I am thinking mainly of the various lists like events, attributes, tags, notes, …). It is then a pity to write back unchanged records to the DB.
This can be solved by keeping a “dirty” flag for the components (and the primary object). The problem is to manage this flag.
Is there a Gramps signal (not a standard GTK+ signal) which reports changes to a genealogical object in an editor? How is handled a change of ordering within lists (e.g. what happens when events are reordered according to some criteria like date or participant?)?