Bug 426116 - Compact database (unique block instead of loose files)
Summary: Compact database (unique block instead of loose files)
Status: RESOLVED INTENTIONAL
Alias: None
Product: digikam
Classification: Applications
Component: Database-Engine (show other bugs)
Version: 7.0.0
Platform: macOS (DMG) macOS
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-02 19:39 UTC by Jo
Modified: 2023-05-18 06:19 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.1.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jo 2020-09-02 19:39:48 UTC
SUMMARY
A compact database (unique block) would be less messy than a database with several loose files, in addition i'd prefer to see database files in a folder related to the Application's specific preferences, on Mac this would be ideally in "home/library/application support/digikam/", which exists also on my HD.


SOFTWARE/OS VERSIONS
macOS: 10.14.6
Comment 1 caulier.gilles 2020-09-02 19:46:10 UTC
What do you mean by conpact "database"

Do you talk about the core database files used by digiKAm to store all metadata for the DAM ?

Do you talk about the collection of album ?

Gilles Caulier
Comment 2 Jo 2020-09-03 05:35:13 UTC
I'm talking about the database files created to monitor folder and file changes on hd 
(digikam.db, recognition.db, similarity.db, thumbnails.db, etc. ), so it'll be the collection of albums
Comment 3 Maik Qualmann 2020-09-03 06:57:19 UTC
There is a reason that these 4 files are separate and not in a database. SQLite cannot read and write at the same time. So that the processes can be better scale and to reduce unnecessary waiting for the database, there are 4 files. You can save the databases to any location in your system where you have write access.

Maik
Comment 4 Jo 2020-09-03 07:44:55 UTC
Yes, I no doubt, my question wasn't to unify databases into one  big and inefficient database, but to create a kind of Digikam file that contains all these database data, to clean up all those loose files 

>You can save the databases to any location in your system where you have write access.

Sounds good, so could you move them by default in an application specific preferences folder, please ?
Comment 5 Mario Frank 2020-09-03 08:53:22 UTC
Hi Jo,

Depending on the OS, the default location of databases may be different.
So there is no easy catch for all OSs.
Usually, the location is defined in the digikamrc.

The digikamrc contains the following settings:

Database Name=/path/to/core/db/
Database Name Face=/path/to/core/db/
Database Name Similarity=/path/to/core/db/
Database Name Thumbnails=/path/to/core/db/

In your case, you could move the files to 

/home/library/application support/digikam/sqlite_db/

and set the values to 

Database Name=/home/library/application support/digikam/sqlite_db/
Database Name Face=/home/library/application support/digikam/sqlite_db/
Database Name Similarity=/home/library/application support/digikam/sqlite_db/
Database Name Thumbnails=/home/library/application support/digikam/sqlite_db/

When starting digiKam again, this should work without any problems.

Also, there is a command line option for digiKam:

--database-directory <dir> 

this one will search for the db files in the specified directory.

Does this solve your problem?

Cheers,
Mario
Comment 6 Jo 2020-09-10 05:17:59 UTC
Hi Mario,
Sounds nice, and exactly what I'm  looking for. 
The only drawback is I've to edit the paths each newly added database again. Not that it happens very often, so it might be ok. Still i see it technically useful to implement, so my report 

Yes, I'm aware the path to the  application specific preferences folder can't be defined unequivocally the same for all platforms, but needs to be defined specifically for each Os

Since Digikam knows already the path to application support folder, I'd love to see Digikam make use of this path automatically as much as possible,
For what pertains preference related files. 
So all those loose files are out of the way, so to say
Comment 7 caulier.gilles 2023-05-18 06:19:34 UTC
The online doc list all paths used by the application to store files:

https://docs.digikam.org/en/getting_started/installation.html#configuration-files
https://docs.digikam.org/en/setup_application/database_settings.html

To compact the database, there is no plan for this topic for technical reasons.

Gilles Caulier