Using a database to load / store shiny bookmarks

,

Hello Posit Community! I’m working on a Shiny app that requires finer control over the way bookmarks are loaded and stored. Specifically, I’d like to have the ability to store and load bookmarks into a database, rather than saved on the local filesystem. (It looks like this exact question was asked in 2020 and there was no solution then, but I’m hoping 4 years later we have more options)

From a previous answer, it looks like I can use the (undocumented) load.interface and save.interface options to customize the bookmark loading and saving functionality, but they only allow the load / save folder to be customized, rather than customize the entire process of loading and saving state objects.

My current plan is to use a bit of “sleight-of-hand” to store bookmarks into a db, rather than the filesystem: in the save interface function I’ll to allow it to save the bookmark in a temporary folder, then parse the rds files and store the relevant info into my database (and reverse this process for loading – query the database, write a temporary file, then allow load.interface to load the state from there). Of course, this is somewhat of a hack.

Is there a different / better approach for this that I’m missing? Or are there any future plans to directly support this kind of functionality in Shiny anywhere down the road?

Thanks!