What is the official Zotero view on plugins that make changes to the Zotero database's structure ?

I am not sure if this has been spelled out anywhere before. But what is Zotero's official view on plugins that make changes to Zotero's sqlite database's structure, such as adding tables or fields ? Is it completely normal - and mostly safe - or frowned upon ?

I realized that there are many things I don't know about this. Firstly, which plugins do write to the database - some just changing data, others adding to the structure ? I was looking at (a copy of) my zotero.sqlite in DB Browser recently, which I hadn't done for some time. And I noticed that one of my newer plugins (llm for Zotero) had written 15 tables to the database. I don't recall noticing anything from a plugin in the database before (but maybe it was just not as obvious). I don't know how many of my other plugins might also have made changes to the database structure.

I also noticed recently that several of my other plugins (Beaver, Zoplicate) have created their own sqlite databases in my Zotero data folder. Should plugin developers do that rather than add structure to zotero.sqlite ?

There are other plugins that just alter Zotero data (Linter for example), but AFAIK they usually don't create new database tables or fields.

I do recall that some years ago one plugin's update did corrupt the database. The problem was discussed and resolved here (I am not sure that naming that plugin is useful - it was not a widely known plugin at the time).

What protections does Zotero have against a plugin doing something 'bad' to the database ?

Should plugin developers be required to make it clearer that their plugin writes to Zotero.sqlite, either just data or new structure ? Should there even be a formal process when plugins are installed, for users to agree to plugins writing data or adding structure to the database ?

And when a plugin is uninstalled (or just disabled), should there be a mechanism to remove any new structure it has written to the database ? Does Zotero have any way to identify (and maybe 'clean') a database with non-standard additions ?

Of course one very important protection for users is backups (ideally incremental/differential), should something go wrong. Those would be more useful if the original install dates of all plugins was kept and made visible (rather than just the install date of the latest update, as now); so that one could go back to a date prior to a plugin's installation.
https://www.zotero.org/support/zotero_data#backing_up_your_zotero_data
  • +1
    I add a question. How does changes of Zotero's sqlite database's by plugins affect on Zotero data syncing?
  • dstillman Zotero Team
    edited today at 2:07pm
    Plugins should absolutely not make changes to zotero.sqlite — either the structure or the data. Plugins that do this won't be allowed into a future official plugin directory and could conceivably be banned from running altogether. We won't provide any support for people with modified databases.

    In server logs, we see constant permanent sync errors caused by made-up data from plugins and other AI tools. The only safe way to modify the database is by using the object methods in the JavaScript API, which include all sorts of data-integrity and consistency checks.
    I also noticed recently that several of my other plugins (Beaver, Zoplicate) have created their own sqlite databases in my Zotero data folder. Should plugin developers do that rather than add structure to zotero.sqlite ?
    Yes. There are built-in methods to do this.
    Does Zotero have any way to identify (and maybe 'clean') a database with non-standard additions ?
    No. The only way to recover from this is to delete the database and sync down from the online library.
  • edited today at 2:28pm
    Thanks for that clear position. It would appear that there are plugins that are flouting these rules ...

    https://s3.amazonaws.com/zotero.org/images/forums/u5906489/lplw8vyqsw68qszgopj3.png
  • FWIW, creating totally separate tables is relatively less bad — it balloons the database with hidden data that wouldn't be removed when the plugin was removed, but it's unlikely to cause other problems.

    Modifying anything within the official tables is extremely likely to break things in ways that can't be easily fixed without wiping the database and resyncing the data.
Sign In or Register to comment.