Contents
2021-10-28: The following queries are compatible with #RM8 but, while included in , the app itself is not.
If a user has set certain Fact Types to be excluded from GEDCOM export, those fact types are also not transferred to another database via Drag and Drop (DnD). This setting is controlled in the Edit Fact Type window, accessible through the menu path Lists > Fact Type List which opens the Fact Types window through which one can inspect the settings one fact at a time. The Edit button opens the Edit Fact Type window on the selected fact. To ensure that all facts or events for the selected persons are transferred via DnD, one needs to remember to inspect and change the ‘excluded’ facts to ‘included’; following the DnD, the settings wanted for GEDCOM, if different from those for DnD, must be restored. Given the one-at-a-time procedure, it is desirable to have more expeditious ways to change settings. This page offers some short queries that will satisfy some needs until such time as RootsMagic gains more efficient controls. These queries are included in RMtrix.
List Include Settings
This query puts the Include settings for all fact types in table form on one screen for easy inspection. Sorting the list on any column rapidly shows which fact types have been included or excluded from RootsMagic outputs.
Screenshot from SQLiteSpy. 1 = included, 0 = excluded. |
-- List FactType Include Settings SELECT Name, Flags & 1 AS GEDCOM, Flags & 2 <> 0 AS WEB, Flags & 4 <> 0 AS FGS, Flags & 8 <> 0 AS NARR, Flags & 16 <> 0 AS INDIV, Flags & 32 <> 0 AS LISTS FROM FactTypeTable ORDER BY Name ;
N.B.: As written, the above query (and some of the others) requires SQLiteSpy to have the fake RMNOCASE collation as described at RMNOCASE – faking it in SQLiteSpy.
Save Current Fact Type Settings for Later Restoration
It would be nice to be able to save the current settings, make changes that are temporary, and restore them later. This query simply makes a copy of the FactTypeTable and saves it in the database file. Dead simple and does not affect RootsMagic operations.
-- Save current FactType settings for subsequent restoration DROP TABLE IF EXISTS zFactTypeTable; CREATE TABLE IF NOT EXISTS zFactTypeTable AS SELECT * FROM FactTypeTable;
Set All Fact Types to be Included in GEDCOM and Drag and Drop
This query changes only the GEDCOM include setting so that all fact types are included in both Export and DnD. Similar UPDATE queries could be done for other include settings.
-- Set all FactTypes to be included in GEDCOM and Drag and Drop UPDATE FactTypeTable SET Flags = Flags +1 WHERE NOT Flags & 1 ;
Restore Saved Fact Type Settings
Regardless of what changes have been made or how they were made, this query returns the FactTypeTable to the way it was when its then current settings were saved to a backup table.
-- Restore saved FactTypeTable settings INSERT OR REPLACE INTO FactTypeTable SELECT * FROM zFactTypeTable;
Other Ideas
- Some may want to have more than one set of saved settings and be able to name or describe each set. That is possible; it would require another custom table and the addition of a SettingID column to the table that stores the multiple sets, or a different table for each set.
- Direct interaction with the settings from a tabular screen – possible using a high level programming language
It appears that w/ RM v9 sets the initial FactTypeTable.Flags value = 2147483647. This is true for built-in and user defined Fact Types. Once the FactType is edited then the Flags value is recalculated to something between -1 and -63 as noted above.
After further review, w/ RM v9.1.4 the FLAGS value for new FactTypes seems to be initially
= 2147483584 + (sum of the FactType Include Settings as noted above),
so that all with all options included, the selected initial value would
= 2147483647 (the largest 32 bit integer).
As noted in my previous reply, once any value in the FactType is edited, the Flags field gets adjusted to something between -1 and -63 based on the selected include options.
Finally, I’m not aware of whether this field used to be stored as a positive value but it’s interesting that while the UI creates negative Flags values calculated as
= (sum of the FactType Include Settings as noted above) – 64
it is also true that positive values are accepted.
So, for example,
* Setting Flags = -1 appears to have the same effect as setting Flags = 63, the UI shows all options selected, and
* Setting Flags = -59 yields the same effect as setting Flags = 5 , the UI shows ‘Exporting Gedcom files’ and ‘Family Group Sheets’ selected.
I am assuming there is some calculation or logic here that I have not yet wrapped my head around.