# Adding key to Gramps database metadata table

**URL:** <https://gramps.discourse.group/t/adding-key-to-gramps-database-metadata-table/1949>\
**Category:** Development\
**Tags:** metadata\
**Created:** [November 2, 2021, 8:39am UTC](https://gramps.discourse.group/t/adding-key-to-gramps-database-metadata-table/1949 "2021-11-02T08:39:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidMStraub](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davidmstraub/32/7_2.png) [@DavidMStraub](https://gramps.discourse.group/u/DavidMStraub)\
**Post date:** [November 2, 2021, 8:39am UTC](https://gramps.discourse.group/t/adding-key-to-gramps-database-metadata-table/1949/1 "2021-11-02T08:39:39Z")

</div>

Hi,

while developing the Gramps Web API sync addon and trying to solve [an issue](https://github.com/DavidMStraub/gramps-addon-webapisync/issues/5), I was wondering whether it would be considered acceptable for a Gramps addon to add a key to the `metadata` table in a Gramps database. This would allow me to store the last successful sync timestamp, making detecting simultaneous changes much easier without resorting to ugly hacks. However, the addon would have to call the private method `db._set_metadata` on the `DBAPI` instance. Would that be considered an acceptable thing to do? (Specifically, would it not be considered bad enough to block merging into `addons-source`?)

---

<div class="post-metadata">

**Author:** ![cdhorn](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@cdhorn](https://gramps.discourse.group/u/cdhorn)\
**Post date:** [November 2, 2021, 10:29pm UTC](https://gramps.discourse.group/t/adding-key-to-gramps-database-metadata-table/1949/2 "2021-11-02T22:29:09Z")

</div>

You could save it in the plugin ini file. I’m doing that for database specific options in the view I have been playing with.

It would be useful if there was a simple database table with id/key/value columns any plugin could use to store state specific to that database and that would be included in Gramps XML exports and imports.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [December 2, 2021, 10:29pm UTC](https://gramps.discourse.group/t/adding-key-to-gramps-database-metadata-table/1949/3 "2021-12-02T22:29:23Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
