faiteanu / hibiscus.docmanager

DocManager plugin for Jameica/Hibiscus
Other
6 stars 0 forks source link

Account deletion #11

Open DonkeeeyKong opened 3 months ago

DonkeeeyKong commented 3 months ago

Thanks for the great program!

I made a mistake and now I have the same account twice. And both get connected to when I try to load new documents. I understand that deleting accounts is not possible from the GUI, but is there another way?

Thanks in advance!

faiteanu commented 3 months ago

Deleting an account is indeed not implemented yet, despite a button saying "Delete" :-/

If you want to manually delete an account in the database, follow the descriptions in the Hibiscus documentation to connect to the database using a suitable program. You can try to delete the duplicate account from the table DOCMANAGER_ACCOUNT. Deletion will fail if documents were already downloaded for that account. In that case you have to delete the document metadata from table DOCMANAGER_DOCUMENT first. This will not delete your files from your harddrive, only the metadata!

First, find the ID of your duplicate account from DOCMANAGER_ACCOUNT. Run the SQL statement DELETE * FROM DOCMANAGER_DOCUMENT WHERE AccountID = <your id> and then DELETE * FROM DOCMANAGER_ACCOUNT WHERE ID = <your id>

DonkeeeyKong commented 3 months ago

Thank you. I will try that!

DonkeeeyKong commented 3 months ago

I had no luck with this. I've connected to the database (~/.var/app/de.willuhn.Jameica/data/jameica/hibiscus/h2db/hibiscus;CIPHER=XTEA, I am using the flatpak) using DBeaver CE but even though it shows a successful connection I can't see or access any tables...

Edit: Nevermind. After trying the Flatpak and Snap versions, I could access the database without problems with a native DBeaver CE installation....

Edit 2: It worked. I had to adjust the SQL statements a little bit though: DELETE FROM DOCMANAGER_DOCUMENT WHERE AccountID=1 DELETE FROM DOCMANAGER_ACCOUNT WHERE ID=1

The above option gave me an error:

Syntax error in SQL statement "DELETE *[*] FROM DOCMANAGER_DOCUMENT WHERE ACCOUNTID = 1 "; expected "identifier"; SQL statement:
DELETE * FROM DOCMANAGER_DOCUMENT WHERE AccountID = 1 [42001-199]

Thanks a lot for the help! :)

faiteanu commented 3 months ago

I didn't test these SQL statements, and indeed there are some slight variations between dialects. The form DELETE * FROM... should usually work, but some databases accept only DELETE FROM... without the asterisk. Depending on the application you use (DBeaver) you might also be able to select rows using your mouse and directly delete them.