kuzudb / explorer

Browser-based user interface for Kùzu graph database
https://hub.docker.com/r/kuzudb/explorer
MIT License
29 stars 5 forks source link

[feature request] Override default settings via ENVs #124

Closed bigluck closed 5 months ago

bigluck commented 5 months ago

I'd love it if the default options could be overridden using environment variables.

In my case, I need to re-start the docker container every time I change my graph, but by restarting it I lose all my settings like:

I know that certain configurations can be set for each node type/label, but currently, I just want to override the default settings using something like:

Thanks! :)

bigluck commented 5 months ago

For reference, this is the workaround I'm using now :)

settings = document.querySelectorAll('div.modal-body table')[0]
settings.querySelectorAll('tr input[type=number]').forEach((a) => { a.value = 100;  a.dispatchEvent(new Event('input', { bubbles: true, cancelable: true })); });
settings.querySelectorAll('tr select').forEach((a) => { a.selectedIndex = 0; a.dispatchEvent(new Event('change', { bubbles: true, cancelable: true })); });
mewim commented 5 months ago

We have persisted the settings in a local SQLite3 database (other than the GPT token) stored under the kuzu database directory if you open it in READ_WRITE mode. Is this not working for you? If not, there might be a bug.

bigluck commented 5 months ago

Oh I see. no in my case unfortunately it does not work, not for a bug but because I always recreate the DB from the scratch and the old folder is automatically deleted :(

mewim commented 5 months ago

OK. In this case, I think I'll implement two-levels of setting storage. I would also store the settings in browser localStorage but give a preference to the SQLite database. I'll let you know when this is done.