Ditto
Ditto copied to clipboard
Feature Request: New CLI flag for "Compact And Repair Database"
I use to run a script that "Compact And Repair Database". I run it nightly when outside of work hours. Since this action is possible only though GUI then i have a script that opens ditto's "Advanced Options" and clicks on the suitable button. It could be great if this can be done through CLI instead
Thanks!
Any plans to support this feature?
Try vacuum the ditto.db
with the sqlite3.exe
binary avaiable from their website:
sqlite3.exe C:\My\Path\To\Ditto\Ditto.db "VACUUM;"
Better to shutdown Ditto
before trying, just in case you have no .DB backups. Can be easily scripted with batch files and whatnot.
Try vacuum the
ditto.db
with thesqlite3.exe
binary avaiable from their website:
actually, the built-in Compact also deletes old entries before the "VACUUM;" command (code) so it's only a half-solution manually executing SQLs for deleting old entries is already too complicated. therefore i would really like to have Ditto support a new command line flag to compact the database
For those interested, here's the SQL command that can be used via the command line to compact the Ditto database:
sqlite3.exe C:\My\Path\To\Ditto\Ditto.db "DELETE FROM Main WHERE lID in (SELECT lID FROM Main WHERE (lastPasteDate < 1234) AND (bIsGroup = 0) AND (lShortCut = 0) AND (lParentID <= 0) AND (lDontAutoDelete = 0) AND (stickyClipOrder = -(2147483647)) AND (stickyClipGroupOrder = -(2147483647)));Delete FROM MainDeletes;VACUUM"
Notes:
- replace 1234 with the desired epoch value for deleting entries that haven't been pasted before it (be assure that entries which are marked as "Never Auto Delete" would not be deleted anyway).
- close ditto before running this command since "Ditto.db" shouldn't be used during the execution of this command