cloud_server.db

Database manager classes for servers using this template.

class cloud_server.db.FilesMetadataDatabaseManager[source]

Manager class for files metadata database operations.

__init__()[source]

Initialize the FilesMetadataDatabaseManager with the given database configuration.

property db_url: str

Get the database URL.

list_files()[source]

Public method to list all file metadata entries.

Return type:

list[FileMetadata]

perform_file_metadata_action(action, file_metadata=None, file_id=None)[source]

Perform a database action (CRUD) on file metadata.

Return type:

FileMetadata

synchronize_with_storage(storage_directory)[source]

Synchronize the files metadata database with the actual files in the storage directory.

This method ensures that the database entries accurately reflect the files present in the storage directory. It adds metadata for new files, updates metadata for existing files, and removes metadata for deleted files.

Parameters:

storage_directory (Path) – The path to the storage directory to synchronize with

Return type:

None

Modules

files_metadata_database_manager

Files metadata database manager.