database.manage_database#

autoclean.utils.database.manage_database(operation, run_record=None, update_record=None)[source]#

Manage database operations with thread safety.

Parameters:
operationstr

Operations can be:

  • create_collection: Create a new collection.

  • store: Store a new record.

  • update: Update an existing record.

  • update_status: Update the status of an existing record.

  • drop_collection: Drop the collection.

  • get_collection: Get the collection.

  • get_record: Get a record from the collection.

run_recorddict

The record to store.

update_recorddict

The record updates.

Returns:
Any

Operation-specific return value.