Best way to persist plugin-specific data

What is the best way to persist some extra data specific to a plugin where the volume might be arbitrarily large.
To give an example, I was looking into building a plugin to provide full text search in resources, how to best store the index?
I tried using a separate SQLite database but turns out using a native module like SQLite with webpack is not trivial.
Appreciate any ideas.

I tried using a separate SQLite database but turns out using a native module like SQLite with webpack is not trivial.

The app is packaged with SQLite so I could give access to the module, like it's already done for fs-extra.

There's also a simple key/value store that could be exposed to plugin. Would that work for your plugin?

I guess it should work.
At some point I'd like to try writing a plugin in Rust compiled to WebAssembly, and I imagine I'll face similar issues then, but that's another story.

I wanted to use sqlite's FTS capabilites, so this won't help.

Then you may have to bundle an embedded database separately, such as SQLite / H2. As for the trouble... Nodejs native modules are troublesome

did this ever go anywhere? sqlite wouldn't really be useful if the plugin is used across devices. I'd imagine something like (for osx)

$HOME/.config/joplin-desktop/plugins/io.github.jackgruber.backup/ where the plugin is sandboxed to only be able to write there, and then maybe a joplin.fs.read/write function to access the files there.

this way things are synced as well. I wouldn't need to configure settings for plugins for each device too.

Not really, I used sqlite as I needed its full-text search capabilities and didn't care about sync.

I am not sure why you're assuming things will get synced (or am I misreading and this is a part of the proposal?). Currently even Joplin's own settings aren't synced, much less any plugin settings/data.

oh I don't know why I'm assuming it would be synced either. I was confusing the app dir with the sync dir for a moment

link here: [feature] persistent storage for plugins · Issue #8080 · laurent22/joplin · GitHub