Skip to content

[server] webui DB import and export #14347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

feiloo
Copy link

@feiloo feiloo commented Jun 23, 2025

addresses #11718

  • uses the dexie addon "dexie-export-import"
  • import wipes and refills the db, it doesnt add to the db
  • import and export implemented as buttons
  • reloads window after import to show the imported conversations

Copy link
Collaborator

@ngxson ngxson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit concern that this is import/export at raw database level, not at DAO level.

This can be problematic if we introduce db migration in the future. For example, if the export is from an older version and it's imported in a newer version of the code, it will be messed up

@feiloo
Copy link
Author

feiloo commented Jun 24, 2025

The solution and this PR depends on how much we want to rely on Dexie.

Dexie and dexie-export-import track the database version afaict, so it would error on incompatible db imports. It also enables database migrations: https://dexie.org/docs/Tutorial/Design#database-versioning

Otoh, Dexie probably also isn't bug-free in this regard, and more abstractions/dependent.
If Dexie-based import-export is too abstracted/debtful feel free to close without merge.

I tend to prefer fewer abstractions (no Dexie, just IndexedDB, lower-level import, export, migrations), but since Dexie was already used, i went with it for this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants