mcfly icon indicating copy to clipboard operation
mcfly copied to clipboard

Combine the mcfly databases on different machines.

Open hongyi-zhao opened this issue 2 years ago • 8 comments

Assuming I run mcfly on multiple machines, one mcfly database file will be generated on each machine. So, the problem is how to combine these mcfly databases into one.

Regards, HY

hongyi-zhao avatar Aug 23 '21 08:08 hongyi-zhao

They're SQLite databases so you'd need to merge each of their tables. This would take a bit of code, but should work.

cantino avatar Aug 23 '21 15:08 cantino

Why not implement the corresponding option in mcfly?

hongyi-zhao avatar Aug 24 '21 00:08 hongyi-zhao

How would you envision that option working?

Alternatively, you could try synchronizing the database using something like Dropbox or Syncthing?

cantino avatar Aug 24 '21 21:08 cantino

How would you envision that option working?

Just an idea, no specific scenario.

Alternatively, you could try synchronizing the database using something like Dropbox or Syncthing?

Do you mean to use a centralized cloud storage workflow?

hongyi-zhao avatar Aug 25 '21 04:08 hongyi-zhao

Now that I think about it, Dropbox wouldn't work because the database would always conflict. I'm not sure what a clean way would be to support streams from multiple machines besides having a merge tool, or maybe allowing it to read from multiple DBs that are then synced. I think this is out of scope for this project, though.

cantino avatar Aug 25 '21 16:08 cantino

What about git + a merge driver like the one https://github.com/larkery/zsh-histdb uses?

deini avatar Apr 14 '22 05:04 deini

I think this also would be a super useful feature, I've wasted multiple hours today trying to import another mcfly history.

nicoandmee avatar Jul 07 '22 00:07 nicoandmee

I'm open to contributions of a merge tool, or an ENV variable that lists multiple DBs to read from.

cantino avatar Jul 16 '22 18:07 cantino